Esempio n. 1
0
 protected function readMetaData(&$xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->cssClass = isset($xmlArr["ATTRIBUTES"]["CSSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSCLASS"] : "input_barcodescanner";
     $this->cssErrorClass = isset($xmlArr["ATTRIBUTES"]["CSSERRORCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSERRORCLASS"] : $this->cssClass . "_error";
     $this->cssFocusClass = isset($xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"] : $this->cssClass . "_focus";
 }
Esempio n. 2
0
 /**
  * Read metadata info from metadata array and store to class variable
  *
  * @param array $xmlArr metadata array
  * @return void
  */
 protected function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_SelectFrom = isset($xmlArr["ATTRIBUTES"]["SELECTFROM"]) ? $xmlArr["ATTRIBUTES"]["SELECTFROM"] : null;
     $this->m_SelectedList = isset($xmlArr["ATTRIBUTES"]["SELECTEDLIST"]) ? $xmlArr["ATTRIBUTES"]["SELECTEDLIST"] : null;
     $this->m_SelectFromSQL = isset($xmlArr["ATTRIBUTES"]["SELECTFROMSQL"]) ? $xmlArr["ATTRIBUTES"]["SELECTFROMSQL"] : null;
 }
Esempio n. 3
0
 /**
  * Gets or sets an attribute
  *
  * When no $value is given, the current content of the attribute is returned.
  * An empty string is returned for unset attributes.
  *
  * When a $value is given, the content is set to that value and the Element
  * itself is returned for easy chaining
  *
  * @param string $name Name of the attribute to access
  * @param null|string $value New value to set
  * @return string|$this
  */
 public function attr($name, $value = null)
 {
     if (strtolower($name) == 'multiple') {
         throw new \InvalidArgumentException('Sorry, the dropdown element does not support the "multiple" attribute');
     }
     return parent::attr($name, $value);
 }
Esempio n. 4
0
 protected function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_cssClass = isset($xmlArr["ATTRIBUTES"]["CSSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSCLASS"] : "column_input_text";
     $this->m_cssErrorClass = isset($xmlArr["ATTRIBUTES"]["CSSERRORCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSERRORCLASS"] : $this->m_cssClass . "_error";
     $this->m_cssFocusClass = isset($xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"] : $this->m_cssClass . "_focus";
 }
 private static function getAddEmployeeLeaveForm()
 {
     // leave_start_date
     $tmp_input = new InputElement('frm_leave_start_date');
     $tmp_input->type = 'date';
     $tmp_input->label = 'Startdatum*';
     $tmp_input->required = 1;
     $form_elements_ar[$tmp_input->id] = $tmp_input->getHTML();
     // leave_end_date
     $tmp_input = new InputElement('frm_leave_end_date');
     $tmp_input->type = 'date';
     $tmp_input->label = 'Einddatum';
     $form_elements_ar[$tmp_input->id] = $tmp_input->getHTML();
     // hidden form name
     $tmp_input = new InputElement(self::FORM_HIDDEN_NAME);
     $tmp_input->type = 'hidden';
     $tmp_input->value = 'submit';
     $form_elements_ar[$tmp_input->id] = $tmp_input->getHTML();
     // build submit button
     $frm_btn_submit = HTML::Button('Toevoegen', 'frm_btn_submit');
     $frm_btn_submit->type = 'submit';
     $frm_btn_submit->form = self::FORM_CSS_ID;
     $form_elements_ar[$tmp_input->id] = $frm_btn_submit;
     $form = HTML::Form(HTML::H4('Nieuw verlof bij ' . self::$employee->getName()) . implode('', $form_elements_ar), self::FORM_CSS_ID, 'extras_form');
     $form->method = 'post';
     $form->action = TS_Module_HRM_PresencePlanning_Links::getHref('edit_employee', array('employee_id' => self::$employee->id, 'action' => 'add_leave'));
     return $form;
 }
Esempio n. 6
0
 public function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_cssClass = isset($xmlArr["ATTRIBUTES"]["CSSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSCLASS"] : "input_textarea";
     $this->m_cssErrorClass = isset($xmlArr["ATTRIBUTES"]["CSSERRORCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSERRORCLASS"] : "input_textarea_error";
     $this->m_cssFocusClass = isset($xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"] : "input_textarea_focus";
 }
Esempio n. 7
0
 /**
  * (non-PHPdoc)
  * @see \tfc\mvc\form\InputElement::getInput()
  */
 public function getInput()
 {
     $this->setType('text');
     $format = $this->getAttribute('format');
     $this->setClass($this->getClass() . ' form_' . $format);
     $output = parent::getInput();
     return $output;
 }
Esempio n. 8
0
 public function getValue()
 {
     if (!$this->m_Value && strtoupper($this->getFormObj()->m_FormType) != 'NEW') {
         $rec = $this->getFormObj()->getActiveRecord();
         $this->m_Value = $rec[$this->m_FieldName];
     }
     return parent::getValue();
 }
Esempio n. 9
0
 /**
  * (non-PHPdoc)
  * @see \tfc\mvc\form\InputElement::getInput()
  */
 public function getInput()
 {
     if ($this->rows > 0) {
         $this->setAttribute('rows', $this->rows);
     }
     if ($this->cols > 0) {
         $this->setAttribute('cols', $this->cols);
     }
     return parent::getInput();
 }
Esempio n. 10
0
 protected function readMetaData(&$xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_cssClass = isset($xmlArr["ATTRIBUTES"]["CSSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSCLASS"] : "input_text";
     $this->m_cssErrorClass = isset($xmlArr["ATTRIBUTES"]["CSSERRORCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSERRORCLASS"] : $this->m_cssClass . "_error";
     $this->m_cssFocusClass = isset($xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"] : $this->m_cssClass . "_focus";
     $this->m_cssHoverClass = isset($xmlArr["ATTRIBUTES"]["CSSHOVERCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSHOVERCLASS"] : $this->m_cssClass . "_hover";
     $this->m_Value = isset($xmlArr["ATTRIBUTES"]["DEFAULTVALUE"]) ? I18n::getInstance()->translate($xmlArr["ATTRIBUTES"]["DEFAULTVALUE"]) : null;
     $this->m_ReadOnly = isset($xmlArr["ATTRIBUTES"]["READONLY"]) ? $xmlArr["ATTRIBUTES"]["READONLY"] : "N";
 }
Esempio n. 11
0
 protected function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_AntiSpamImage = isset($xmlArr["ATTRIBUTES"]["ANTISPAMIMAGE"]) ? $xmlArr["ATTRIBUTES"]["ANTISPAMIMAGE"] : "{@home:base_url}/bin/antispam_image.php";
     $this->m_Length = isset($xmlArr["ATTRIBUTES"]["LENGTH"]) ? $xmlArr["ATTRIBUTES"]["LENGTH"] : 6;
     $this->m_SpamLevel = isset($xmlArr["ATTRIBUTES"]["SPAMLEVEL"]) ? $xmlArr["ATTRIBUTES"]["SPAMLEVEL"] : 1;
     $this->m_cssClass = isset($xmlArr["ATTRIBUTES"]["CSSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSCLASS"] : "input_text_s";
     $this->m_cssErrorClass = isset($xmlArr["ATTRIBUTES"]["CSSERRORCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSERRORCLASS"] : "input_text_s_error";
     $this->m_cssFocusClass = isset($xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"] : "input_text_s_focus";
 }
Esempio n. 12
0
 /**
  * Read array meta data, and store to meta object
  *
  * @param array $xmlArr
  * @return void
  */
 protected function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_Image = isset($xmlArr["ATTRIBUTES"]["IMAGE"]) ? $xmlArr["ATTRIBUTES"]["IMAGE"] : null;
     $this->m_Sortable = isset($xmlArr["ATTRIBUTES"]["SORTABLE"]) ? $xmlArr["ATTRIBUTES"]["SORTABLE"] : null;
     $this->m_Link = isset($xmlArr["ATTRIBUTES"]["LINK"]) ? $xmlArr["ATTRIBUTES"]["LINK"] : null;
     if ($this->m_Link != null) {
         $this->m_Link = str_replace('{@home:url}', APP_INDEX, $this->m_Link);
         if (strpos($this->m_Link, APP_INDEX) === false) {
             $this->m_Link = APP_INDEX . $this->m_Link;
         }
     }
 }
Esempio n. 13
0
 protected function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_cssClass = isset($xmlArr["ATTRIBUTES"]["CSSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSCLASS"] : "input_select_w";
     $this->m_cssErrorClass = isset($xmlArr["ATTRIBUTES"]["CSSERRORCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSERRORCLASS"] : $this->m_cssClass . "_error";
     $this->m_cssFocusClass = isset($xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"] : $this->m_cssClass . "_focus";
     $this->m_cssHoverClass = isset($xmlArr["ATTRIBUTES"]["CSSHOVERCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSHOVERCLASS"] : $this->m_cssClass . "_hover";
     //$this->m_Value = isset($xmlArr["ATTRIBUTES"]["DEFAULTVALUE"]) ? $xmlArr["ATTRIBUTES"]["DEFAULTVALUE"] : null;
     $this->m_ReadOnly = isset($xmlArr["ATTRIBUTES"]["READONLY"]) ? $xmlArr["ATTRIBUTES"]["READONLY"] : "N";
     $this->m_SelectFrom = isset($xmlArr["ATTRIBUTES"]["SELECTFROM"]) ? $xmlArr["ATTRIBUTES"]["SELECTFROM"] : null;
     $this->m_SelectedList = isset($xmlArr["ATTRIBUTES"]["SELECTEDLIST"]) ? $xmlArr["ATTRIBUTES"]["SELECTEDLIST"] : null;
     $this->m_SelectFromSQL = isset($xmlArr["ATTRIBUTES"]["SELECTFROMSQL"]) ? $xmlArr["ATTRIBUTES"]["SELECTFROMSQL"] : null;
     $this->m_BlankOption = isset($xmlArr["ATTRIBUTES"]["BLANKOPTION"]) ? $xmlArr["ATTRIBUTES"]["BLANKOPTION"] : null;
     $this->m_DefaultValueRename = isset($xmlArr["ATTRIBUTES"]["DEFAULTVALUERENAME"]) ? $xmlArr["ATTRIBUTES"]["DEFAULTVALUERENAME"] : "N";
     $this->m_BlankOption = $this->translateString($this->m_BlankOption);
 }
Esempio n. 14
0
 /**
  * InputCheckboxElement constructor.
  * @param $name
  * @param null $value
  * @param array $attributes
  */
 public function __construct($name, $value = null, array $attributes = [])
 {
     parent::__construct($name, $value, $attributes);
     $this->setAttribute('type', 'checkbox');
 }
Esempio n. 15
0
 public static function forming()
 {
     $form = new Form("POST", Page::url("/forms"));
     $input = new InputElement("login", "Identifiant :", "Pierre");
     $form->addElement($input);
     $form->addElement(new ClosedElement("br"));
     // Balise, Name, Label, Value
     $input = new FormElement("select", "age", "Age :", 10);
     $input->addElement(new FormElement("option", "", "0-10", 0));
     $input->addElement(new FormElement("option", "", "10-20", 10));
     $input->addElement(new FormElement("option", "", "20-30", 20));
     $input->addElement(new FormElement("option", "", "30-40", 30));
     $input->addElement(new FormElement("option", "", "40-50", 40));
     $form->addElement($input);
     $form->addElement(new ClosedElement("br"));
     $input = new FormElement("label", null, "Age : ");
     $input->addClasses("label_input_checkbox_radio");
     $form->addElement($input);
     $input = new InputElement("mabox1", "0-10", 0, "checkbox", "mabox1");
     $input->setAttribute("checked", "checked");
     $form->addElement($input);
     $input = new InputElement("mabox2", "10-20", 10, "checkbox", "mabox2");
     $input->setAttribute("checked", "checked");
     $form->addElement($input);
     $input = new InputElement("mabox3", "20-30", 20, "checkbox", "mabox3");
     $form->addElement($input);
     $input = new InputElement("mabox4", "30-40", 30, "checkbox", "mabox4");
     $input->setAttribute("checked", "checked");
     $input->setAttribute("disabled", "disabled");
     $form->addElement($input);
     $input = new InputElement("mabox5", "40-50", 40, "checkbox", "mabox5");
     $input->setAttribute("disabled", "disabled");
     $form->addElement($input);
     $input = new FormElement("label", null, "Age : ");
     $input->addClasses("label_input_checkbox_radio");
     $form->addElement($input);
     $input = new InputElement("monradio", "0-10", 0, "radio", "monradio1");
     $input->setAttribute("checked", "checked");
     $form->addElement($input);
     $input = new InputElement("monradio", "10-20", 10, "radio", "monradio2");
     $form->addElement($input);
     $input = new InputElement("monradio", "20-30", 20, "radio", "monradio3");
     $form->addElement($input);
     $input = new InputElement("monradio", "30-40", 30, "radio", "monradio4");
     $form->addElement($input);
     $input = new InputElement("monradio", "40-50", 40, "radio", "monradio5");
     $form->addElement($input);
     $input = new FormElement("textarea", "description", t("Description : "), "Test");
     $input->setAttribute("row", 6);
     $input->setAttribute("col", 18);
     $input->addClasses("actualite_area_text");
     $form->addElement($input);
     $form->addElement(new ClosedElement("br"));
     $input = new InputElement("monbutton", null, "Test JS", "button");
     $input->setAttribute("onclick", "alert('Test JS OK');");
     $form->addElement($input);
     $theme = new Theme();
     $theme->process_form($form);
     $theme->process_theme();
 }
Esempio n. 16
0
 /**
  * Read metadata info from metadata array and store to class variable
  *
  * @param array $xmlArr metadata array
  * @return void
  */
 protected function readMetaData(&$xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_BlankOption = isset($xmlArr["ATTRIBUTES"]["BLANKOPTION"]) ? $xmlArr["ATTRIBUTES"]["BLANKOPTION"] : null;
     $this->m_SelectFrom = isset($xmlArr["ATTRIBUTES"]["SELECTFROM"]) ? $xmlArr["ATTRIBUTES"]["SELECTFROM"] : null;
 }
Esempio n. 17
0
 public function __construct()
 {
     parent::__construct();
 }
Esempio n. 18
0
 /**
  * @param string $id
  * @param array  $htmlAttributes
  */
 public function __construct($id, array $htmlAttributes)
 {
     parent::__construct('password', $id, $htmlAttributes);
 }
Esempio n. 19
0
 /**
  * Read array meta data, and store to meta object
  *
  * @param array $xmlArr
  * @return void
  */
 protected function readMetaData(&$xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_Image = isset($xmlArr["ATTRIBUTES"]["IMAGE"]) ? $xmlArr["ATTRIBUTES"]["IMAGE"] : null;
 }
Esempio n. 20
0
 /**
  * InputRangeElement constructor.
  * @param $name
  * @param int $min
  * @param int $max
  * @param int $step
  * @param null $value
  * @param array $attributes
  */
 public function __construct($name, $min = 0, $max = 0, $step = 1, $value = null, array $attributes = [])
 {
     parent::__construct($name, $value, $attributes);
     $this->setAttributes(['type' => 'range', 'min' => (int) $min, 'max' => (int) $max, 'step' => (int) $step]);
 }
Esempio n. 21
0
 /**
  * InputButtonElement constructor.
  * @param null $value
  * @param array $attributes
  */
 public function __construct($value = null, array $attributes = [])
 {
     parent::__construct(null, $value, $attributes);
     $this->setAttribute('type', 'button');
 }
Esempio n. 22
0
 protected function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->trueValue = isset($xmlArr["ATTRIBUTES"]["TRUEVALUE"]) ? $xmlArr["ATTRIBUTES"]["TRUEVALUE"] : "1";
     $this->falseValue = isset($xmlArr["ATTRIBUTES"]["FALSEVALUE"]) ? $xmlArr["ATTRIBUTES"]["FALSEVALUE"] : "0";
 }
Esempio n. 23
0
 protected function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_FormReference = isset($xmlArr["ATTRIBUTES"]["FORMREFERENCE"]) ? $xmlArr["ATTRIBUTES"]["FORMREFERENCE"] : null;
     $this->m_RenameElementSet = isset($xmlArr["ATTRIBUTES"]["RENAMEELEMENTSET"]) ? $xmlArr["ATTRIBUTES"]["RENAMEELEMENTSET"] : 'Y';
 }
Esempio n. 24
0
 /**
  * @param string $id
  * @param array  $htmlAttributes
  */
 public function __construct($id, array $htmlAttributes = [])
 {
     parent::__construct('text', $id, $htmlAttributes);
 }
 /**
  * @param string $id
  * @param array  $htmlAttributes
  */
 public function __construct($id, array $htmlAttributes)
 {
     parent::__construct('hidden', $id, $htmlAttributes);
 }
Esempio n. 26
0
 protected function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_CheckStatus = isset($xmlArr["ATTRIBUTES"]["CHECKSTATUS"]) ? $xmlArr["ATTRIBUTES"]["CHECKSTATUS"] : null;
 }
Esempio n. 27
0
 /**
  * Read array meta data, and store to meta object
  *
  * @param array $xmlArr
  * @return void
  */
 protected function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->m_Mode = isset($xmlArr["ATTRIBUTES"]["MODE"]) ? $xmlArr["ATTRIBUTES"]["MODE"] : null;
     $this->m_Config = isset($xmlArr["ATTRIBUTES"]["CONFIG"]) ? $xmlArr["ATTRIBUTES"]["CONFIG"] : null;
 }
Esempio n. 28
0
 /**
  * @param string $id
  * @param string $group
  * @param array  $value
  * @param array  $htmlAttributes
  */
 public function __construct($id, $group, $value, array $htmlAttributes)
 {
     parent::__construct('checkbox', $id, $htmlAttributes);
     $this->addAttributes(['name' => $group . '[' . $value . ']']);
     parent::setValue($value);
 }
Esempio n. 29
0
 /**
  * @param string $name The name of this form element
  * @param string $label The label text for this element
  */
 public function __construct($name, $label)
 {
     parent::__construct('textarea', $name, $label);
     $this->attr('dir', 'auto');
 }
Esempio n. 30
0
 /**
  * @param string $type The type of this element
  * @param string $name The name of this form element
  * @param string $label The label text for this element
  */
 public function __construct($type, $name, $label)
 {
     parent::__construct($type, $name, $label);
     // default value is 1
     $this->attr('value', 1);
 }