Page 1 of 1

mact unset

Posted: Fri Apr 01, 2011 5:57 pm
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" />

Re: mact unset

Posted: Sat May 07, 2011 2:24 pm
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.