Source of file UserFormWidget.php
Size: 1,134 Bytes - Last Modified: 2021-12-24T06:49:13+00:00
/var/www/docs.ssmods.com/process/src/code/UserFormWidget.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 | <?php class UserFormWidget extends Widget { private static $db = array( ); private static $has_one = array( 'FormPage' => 'UserDefinedForm' ); /** * @var string */ private static $title = "User form Widget"; /** * @var string */ private static $cmsTitle = "Widget to display user forms"; /** * @var string */ private static $description = "Add user defined forms to your pages."; public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab("Root.Main", new TextField('WidgetLabel', 'Widget Label'), "Enabled"); $fields->addFieldToTab("Root.Main", new TextField('WidgetName', 'Widget Name'), "Enabled"); return $fields; } public function Title() { return $this->WidgetLabel; } public function Form() { $form = false; if ($this->FormPage()) { $result = new UserDefinedForm_Controller($this->FormPage()); $result->init(); $form = $result->Form(); } return $form; } } |