mact unset

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
jeverd01
Forum Members
Forum Members
Posts: 20
Joined: Thu May 20, 2010 2:00 am

mact unset

Post by jeverd01 »

Hi everyone,

I tried extending a module with little luck so far. The mact is outputting unset when I use create form

Code: Select all

class addScheduleForm extends CMSModule {
var $eventName = "";
var $eventDate = "";
var $eventInfo = "";

    function setName($value){
        $this->eventName=$value;
    }
    function setDate($value){
        $this->eventDate=$value;
    }
    function setInfo($value){
        $this->eventInfo=$value;
    }


    function createForm($id, $returnid) {
        parent::CMSModule();
 
        echo "<h3>Add a Schedule Event</h3>";
        echo $this->CreateFormStart($id, "addevent", '$returnid');
        echo "Event Name";
        echo "<br/>";
        echo $this->CreateInputText($id, "eventName", $this->eventName, 30, 40, "");
        echo "<br/>";
        echo "<br/>";
        echo "Event Date";
         echo "<br/>";
        echo $this->CreateInputText($id, "eventDate", $this->eventDate, 30, 40, "");
        echo "<br/>";
        echo "<br/>";
        echo "Class Information";
        echo "<br/>";
        echo $this->CreateTextArea($this->GetPreference('allow_summary_wysiwyg', 1), $id, $this->eventInfo, 'eventInfo', '', '', '', '', '80', '3');
        echo "<br/>";
        echo "<br/>";

        echo $this->CreateInputSubmit($id, "submit", "Add Event");
        echo $this->CreateInputSubmit($id, "cancel", "Cancel");
        echo $this->CreateFormEnd();
    }
}


Any suggestions. I tried passing the return id and id as a parameter of the createForm method I created and still the output of the hidden form fields was as follows.

Code: Select all

<input type="hidden" name="mact" value="unset,m1_,addevent,0" />
<input type="hidden" name="m1_returnid" value="&#036;returnid" />
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

Re: mact unset

Post by irish »

You're instantiating you parent class inside a method instead of in your construct, try adding this to your class.

Code: Select all

function __construct(){
		parent::CMSModule();	
	}
Then remove the

Code: Select all

parent::CMSModule();	 
from the createForm method.
Post Reply

Return to “Developers Discussion”