/** *@desc Contains specific instructions to generate all XML informations-> This method is processed only one time-> Usually is the last method processed-> *@param DOMNode $current *@return void */ public function generateObject($current) { if ($this->_readonly) { // XmlInputLabelField $ic; if ($this->_checked) { // XmlInputHidden $ih $ih = new XmlInputHidden($this->_name, $this->_value); $ic = new XmlInputLabelField($this->_caption, "[X]"); $ih->generateObject($current); } else { $ic = new XmlInputLabelField($this->_caption, "[ ]"); } $ic->generateObject($current); } else { // XmlNode $nodeWorking; if ($this->_inputCheckType == InputCheckType::CHECKBOX) { $nodeWorking = XmlUtil::CreateChild($current, "checkbox", ""); } else { $nodeWorking = XmlUtil::CreateChild($current, "radiobox", ""); } XmlUtil::AddAttribute($nodeWorking, "caption", $this->_caption); XmlUtil::AddAttribute($nodeWorking, "name", $this->_name); XmlUtil::AddAttribute($nodeWorking, "value", $this->_value); if ($this->_checked) { XmlUtil::AddAttribute($nodeWorking, "selected", "yes"); } } }
/** * Contains specific instructions to generate all XML informations * This method is processed only one time * Usually is the last method processed * * @param DOMNode $current */ public function generateObject($current) { $nodeWorking = null; // Criando o objeto que conterĂ¡ a lista switch ($this->_easyListType) { case EasyListType::CHECKBOX: XmlUtil::CreateChild($current, "caption", $this->_caption); $nodeWorking = $current; $iHid = new XmlInputHidden("qty" . $this->_name, count($this->_values)); $iHid->generateObject($nodeWorking); break; case EasyListType::RADIOBOX: XmlUtil::CreateChild($current, "caption", $this->_caption); $nodeWorking = $current; break; case EasyListType::SELECTLIST: case EasyListType::SELECTIMAGELIST: if ($this->_readOnly) { if ($this->_easyListType == EasyListType::SELECTLIST) { $deliLeft = strlen($this->_readOnlyDeli) != 0 ? $this->_readOnlyDeli[0] : ""; $deliRight = strlen($this->_readOnlyDeli) != 0 ? $this->_readOnlyDeli[1] : ""; //XmlInputHidden $xih //XmlInputLabelField $xlf $xlf = new XmlInputLabelField($this->_caption, $deliLeft . $this->_values[$this->_selected] . $deliRight); $xih = new XmlInputHidden($this->_name, $this->_selected); $xlf->generateObject($current); $xih->generateObject($current); } elseif ($this->_easyListType == EasyListType::SELECTIMAGELIST) { $img = new XmlnukeImage($this->_values[$this->_selected]); $img->generateObject($current); } return; } else { $nodeWorking = XmlUtil::CreateChild($current, "select", ""); XmlUtil::AddAttribute($nodeWorking, "caption", $this->_caption); XmlUtil::AddAttribute($nodeWorking, "name", $this->_name); if ($this->_required) { XmlUtil::AddAttribute($nodeWorking, "required", "true"); } if ($this->_size > 1) { XmlUtil::AddAttribute($nodeWorking, "size", $this->_size); } if ($this->_easyListType == EasyListType::SELECTIMAGELIST) { XmlUtil::AddAttribute($nodeWorking, "imagelist", "true"); XmlUtil::AddAttribute($nodeWorking, "thumbnailsize", $this->_thumbnailSize); XmlUtil::AddAttribute($nodeWorking, "notfoundimage", $this->_notFoundImage); XmlUtil::AddAttribute($nodeWorking, "noimage", $this->_noImage); } } break; case EasyListType::UNORDEREDLIST: XmlUtil::CreateChild($current, "b", $this->_caption); $nodeWorking = XmlUtil::CreateChild($current, "ul", ""); break; } $i = 0; foreach ($this->_values as $key => $value) { switch ($this->_easyListType) { case EasyListType::CHECKBOX: // XmlInputCheck $iCk $iCk = new XmlInputCheck($value, $this->_name . $i++, $key); $iCk->setType(InputCheckType::CHECKBOX); $iCk->setChecked($key == $this->_selected); $iCk->setReadOnly($this->_readOnly); $iCk->generateObject($nodeWorking); break; case EasyListType::RADIOBOX: // XmlInputCheck $iCk $iCk = new XmlInputCheck($value, $this->_name, $key); $iCk->setType(InputCheckType::RADIOBOX); $iCk->setChecked($key == $this->_selected); $iCk->setReadOnly($this->_readOnly); $iCk->generateObject($nodeWorking); break; case EasyListType::SELECTLIST: case EasyListType::SELECTIMAGELIST: $node = XmlUtil::CreateChild($nodeWorking, "option", ""); XmlUtil::AddAttribute($node, "value", $key); if ($key == $this->_selected) { XmlUtil::AddAttribute($node, "selected", "yes"); } XmlUtil::AddTextNode($node, $value); break; case EasyListType::UNORDEREDLIST: XmlUtil::CreateChild($nodeWorking, "li", $value); break; } } }
/** *@desc Contains specific instructions to generate all XML informations. This method is processed only one time. Usually is the last method processed. *@param DOMNode $current *@return void */ public function generateObject($current) { if ($this->_readonly) { // XmlInputLabelField ic $ic = new XmlInputLabelField($this->_caption, $this->_value); $ic->generateObject($current); // XmlInputHidden $ih $ih = new XmlInputHidden($this->_name, $this->_value); $ih->generateObject($current); } else { $nodeWorking = XmlUtil::CreateChild($current, "memo", ""); XmlUtil::AddAttribute($nodeWorking, "caption", $this->_caption); XmlUtil::AddAttribute($nodeWorking, "name", $this->_name); XmlUtil::AddAttribute($nodeWorking, "cols", $this->_cols); XmlUtil::AddAttribute($nodeWorking, "rows", $this->_rows); XmlUtil::AddAttribute($nodeWorking, "wrap", $this->_wrap); if ($this->_visualEditor) { XmlUtil::AddAttribute($nodeWorking, "visualedit", "true"); XmlUtil::AddAttribute($nodeWorking, "visualeditbasehref", $this->_visualEditorBaseHref); } elseif ($this->_maxLength > 0) { XmlUtil::AddAttribute($nodeWorking, "maxlength", $this->_maxLength); } XmlUtil::AddTextNode($nodeWorking, $this->_value); } }
/** *@desc Generate page, processing yours childs. *@param DOMNode $current *@return function */ public function generateObject($current) { if ($this->_readonly) { $deliLeft = strlen($this->_readOnlyDeli) != 0 ? $this->_readOnlyDeli[0] : ""; $deliRight = strlen($this->_readOnlyDeli) != 0 ? $this->_readOnlyDeli[1] : ""; // XmlInputLabelField $ic; if ($this->_inputextboxtype == InputTextBoxType::TEXT) { $ic = new XmlInputLabelField($this->_caption, $deliLeft . $this->_value . $deliRight); } else { $ic = new XmlInputLabelField($this->_caption, $deliLeft . "**********" . $deliRight); } $ic->generateObject($current); // XmlInputHidden $ih $ih = new XmlInputHidden($this->_name, $this->_value); $ih->generateObject($current); } else { if ($this->_inputextboxtype == InputTextBoxType::TEXT) { $nodeWorking = XmlUtil::CreateChild($current, "textbox", ""); } else { $nodeWorking = XmlUtil::CreateChild($current, "password", ""); } if (intval($this->_maxlength) != 0) { XmlUtil::AddAttribute($nodeWorking, "maxlength", $this->_maxlength); } XmlUtil::AddAttribute($nodeWorking, "caption", $this->_caption); XmlUtil::AddAttribute($nodeWorking, "name", $this->_name); XmlUtil::AddAttribute($nodeWorking, "value", $this->_value); XmlUtil::AddAttribute($nodeWorking, "size", $this->_size); if ($this->_autosuggestUrl != "") { $url = new XmlnukeManageUrl(URLTYPE::MODULE, $this->_autosuggestUrl); $urlStr = $url->getUrlFull(); if (strpos($urlStr, "?") === false) { $urlStr .= "?"; } else { $urlStr .= "&"; } XmlUtil::AddAttribute($nodeWorking, "autosuggesturl", str_replace("&", "&", $urlStr)); XmlUtil::AddAttribute($nodeWorking, "autosuggestparamreq", $this->_autosuggestParamReq); if ($this->_autosuggestCallback) { XmlUtil::AddAttribute($nodeWorking, "autosuggestcallback", $this->_autosuggestCallback); } XmlUtil::AddAttribute($nodeWorking, "autosuggest_array", $this->_autosuggestJsonArray); XmlUtil::AddAttribute($nodeWorking, "autosuggest_objid", $this->_autosuggestJsonObjKey); XmlUtil::AddAttribute($nodeWorking, "autosuggest_objvalue", $this->_autosuggestJsonObjValue); XmlUtil::AddAttribute($nodeWorking, "autosuggest_objinfo", $this->_autosuggestJsonObjInfo); } if ($this->getMask() == "") { if ($this->getDataType() == INPUTTYPE::DATE) { $this->setMask("99/99/9999"); } elseif ($this->getDataType() == INPUTTYPE::DATETIME) { $this->setMask("99/99/9999 99:99:99"); } } if ($this->getMask() != "") { XmlUtil::AddAttribute($nodeWorking, "mask", $this->_maskText); } if ($this->_disableAutoComplete) { XmlUtil::AddAttribute($nodeWorking, "autocomplete", "off"); } parent::generateObject($nodeWorking); } }