/** * Initialises the field types used * within the addressbook form, then sets up * the form as usual * @param boolean $globalAddressbooks Whether the user can create global addressbooks * @param string $action Form destination * @param array $customdata Custom data for pre-populating form fields * @param string $method Method of form submission - GET or POST * @param string $target Form's target * @param array $attributes HTML form attributes * @param boolean $editable Whether the form can be edited * @version 2012090401 * @since 2012071701 */ public function __construct($globalAddressbooks, $action = null, $customdata = null, $method = 'post', $target = '', $attributes = null, $editable = true) { $this->addressbookTypes = array(MoodletxtAddressbook::$ADDRESSBOOK_TYPE_PRIVATE => get_string('optionaddressbookprivate', 'block_moodletxt')); if ($globalAddressbooks) { $this->addressbookTypes[MoodletxtAddressbook::$ADDRESSBOOK_TYPE_GLOBAL] = get_string('optionaddressbookglobal', 'block_moodletxt'); } parent::moodleform($action, $customdata, $method, $target, $attributes, $editable); }
/** * Sets up the form object with initial data/attributes * @param string $action Form destination * @param array $customdata Custom data for pre-populating form fields * @param string $method Method of form submission - GET or POST * @param string $target Form's target * @param array $attributes HTML form attributes * @param boolean $editable Whether the form can be edited * @version 2012092201 * @since 2012092201 */ public function __construct($action = null, $customdata = null, $method = 'post', $target = '', $attributes = null, $editable = true) { parent::moodleform($action, $customdata, $method, $target, $attributes, $editable); }