/** * * @param object $poView * @return string */ public function render($poView = null) { $laMessage = $this->getFieldMessage(); Layout::parseTemplate($this->_sTemplate, "#%COLLENGTH%#", $this->_nColLength); Layout::parseTemplate($this->_sTemplate, "#%FOR%#", $this->getOptsVal('for')); Layout::parseTemplate($this->_sTemplate, "#%LABEL%#", $this->getOptsVal('label')); Layout::parseTemplate($this->_sTemplate, "#%HELPICON%#", $this->getHelpArea()); Layout::parseTemplate($this->_sTemplate, "#%REQUIREDICON%#", $this->getRequiredArea()); Layout::parseTemplate($this->_sTemplate, "#%MSGICON%#", $this->getMessageArea($laMessage)); Layout::parseTemplate($this->_sTemplate, "#%CLASSERROR%#", $laMessage['class']); Layout::parseTemplate($this->_sTemplate, "#%TYPE%#", $this->getAttrVal('type')); Layout::parseTemplate($this->_sTemplate, "#%ID%#", $this->getAttrVal('id')); Layout::parseTemplate($this->_sTemplate, "#%NAME%#", $this->_sName); Layout::parseTemplate($this->_sTemplate, "#%CLASS%#", $this->getAttrVal('class') . $laMessage['class']); Layout::parseTemplate($this->_sTemplate, "#%VALUE%#", $this->_sValue); Layout::parseTemplate($this->_sTemplate, "#%TITLE%#", $this->getAttrVal('title')); Layout::parseTemplate($this->_sTemplate, "#%PLACEHOLDER%#", $this->getAttrVal('placeholder')); Layout::parseTemplate($this->_sTemplate, "#%REQUIRED%#", $this->getAttrVal('required')); Layout::parseTemplate($this->_sTemplate, "#%READONLY%#", $this->getAttrVal('readonly')); Layout::parseTemplate($this->_sTemplate, "#%PATTERN%#", $this->getAttrVal('pattern')); Layout::parseTemplate($this->_sTemplate, "#%DATAMASK%#", $this->getAttrVal('data-mask')); Layout::parseTemplate($this->_sTemplate, "#%DATAMASKALT%#", $this->getAttrVal('data-maskalt')); Layout::parseTemplate($this->_sTemplate, "#%BTNID%#", $this->getDataOptsVal('id', $this->_sName . 'Btn')); Layout::parseTemplate($this->_sTemplate, "#%BTNTITLE%#", $this->getDataOptsVal('title', $this->getAttrVal('title'))); Layout::parseTemplate($this->_sTemplate, "#%BTNCLASS%#", $this->getDataOptsVal('class', "btn btn-default")); Layout::parseTemplate($this->_sTemplate, "#%DATAICON%#", $this->getDataOptsVal('data-icon', "glyphicon glyphicon-time")); return $this->_sTemplate; }
/** * * @param object $poView * @return string */ public function render($poView = null) { $laMessage = $this->getFieldMessage(); $lsType = $this->getAttrVal('type'); if ($lsType == 'hidden') { return $poView->formRow($this->_oElement); } elseif ($lsType == 'radio') { $loField = new RadioCheck($this->_oElement); return $loField->render(); } elseif ($lsType == 'multi_checkbox') { $loField = new RadioCheck($this->_oElement); return $loField->render(); } else { $this->_oElement->setAttribute('title', ''); Layout::parseTemplate($this->_sTemplate, "#%COLLENGTH%#", $this->_nColLength); Layout::parseTemplate($this->_sTemplate, "#%ICONAREA%#", $this->getIconArea()); Layout::parseTemplate($this->_sTemplate, "#%FOR%#", $this->getOptsVal('for')); Layout::parseTemplate($this->_sTemplate, "#%LABEL%#", $this->getOptsVal('label')); Layout::parseTemplate($this->_sTemplate, "#%HELPICON%#", $this->getHelpArea()); Layout::parseTemplate($this->_sTemplate, "#%REQUIREDICON%#", $this->getRequiredArea()); Layout::parseTemplate($this->_sTemplate, "#%MSGICON%#", $this->getMessageArea($laMessage)); Layout::parseTemplate($this->_sTemplate, "#%CLASSERROR%#", $laMessage['class']); Layout::parseTemplate($this->_sTemplate, "#%ELEMENT%#", $poView->formElement($this->_oElement)); return $this->_sTemplate; } }
/** * * @param object $poView * @return string */ public function render($poView = null) { Layout::parseTemplate($this->_sTemplate, "#%COLLENGTH%#", $this->_nColLength); Layout::parseTemplate($this->_sTemplate, "#%LABELAREA%#", $this->getLabelArea()); Layout::parseTemplate($this->_sTemplate, "#%ICONAREA%#", $this->getIconArea()); Layout::parseTemplate($this->_sTemplate, "#%NAME%#", $this->_sName); Layout::parseTemplate($this->_sTemplate, "#%ELEMENT%#", $poView->formRow($this->_oElement)); return $this->_sTemplate; }
/** * * @param object $poView * @return string */ public function render($poView = null) { Layout::parseTemplate($this->_sTemplate, "#%TYPE%#", $this->getAttrVal("type")); Layout::parseTemplate($this->_sTemplate, "#%ID%#", $this->getAttrVal("id")); Layout::parseTemplate($this->_sTemplate, "#%NAME%#", $this->_sName); Layout::parseTemplate($this->_sTemplate, "#%CLASS%#", $this->getAttrVal("class")); Layout::parseTemplate($this->_sTemplate, "#%VALUE%#", $this->_sValue); Layout::parseTemplate($this->_sTemplate, "#%TITLE%#", $this->getAttrVal('title')); Layout::parseTemplate($this->_sTemplate, "#%LOADING%#", $this->getAttrVal('data-loading-text')); Layout::parseTemplate($this->_sTemplate, "#%COMPLETE%#", $this->getAttrVal('data-complete-text')); Layout::parseTemplate($this->_sTemplate, "#%ICONAREA%#", $this->getIconArea()); return $this->_sTemplate; }
/** * * @param object $poView * @return string */ public function render($poView = null) { Layout::parseTemplate($this->_sTemplate, "#%COLLENGTH%#", $this->_nColLength); Layout::parseTemplate($this->_sTemplate, "#%FOR%#", $this->getOptsVal('for')); Layout::parseTemplate($this->_sTemplate, "#%LABEL%#", $this->getOptsVal('label')); Layout::parseTemplate($this->_sTemplate, "#%HELPICON%#", $this->getHelpArea()); Layout::parseTemplate($this->_sTemplate, "#%NAME%#", $this->_sName); Layout::parseTemplate($this->_sTemplate, "#%ID%#", $this->getAttrVal("id", $this->_sName)); Layout::parseTemplate($this->_sTemplate, "#%TITLE%#", $this->getAttrVal("title")); Layout::parseTemplate($this->_sTemplate, "#%CLASS%#", $this->getAttrVal("class", "btn btn-default")); Layout::parseTemplate($this->_sTemplate, "#%DATAWNAME%#", $this->getDataOptsVal("data-wname")); Layout::parseTemplate($this->_sTemplate, "#%DATAURL%#", $this->getDataOptsVal("data-url")); Layout::parseTemplate($this->_sTemplate, "#%DATAPARAMS%#", $this->getDataOptsVal("data-params")); Layout::parseTemplate($this->_sTemplate, "#%DATAWHEIGHT%#", $this->getDataOptsVal("data-wheight", "90%")); Layout::parseTemplate($this->_sTemplate, "#%DATAWWIDTH%#", $this->getDataOptsVal("data-wwidth", "90%")); Layout::parseTemplate($this->_sTemplate, "#%DATAICON%#", $this->getDataOptsVal("data-icon", "glyphicon glyphicon-cog")); Layout::parseTemplate($this->_sTemplate, "#%VALUE%#", $this->_sValue); return $this->_sTemplate; }
/** * * @param object $poView * @return string */ public function render($poView = null) { $laColumn = $this->getDataOptsVal('data-column'); $lsTableTdArea = ""; if (is_array($laColumn)) { foreach ($laColumn as $lsTitle) { $lsTableTdArea .= '<th>' . $lsTitle . '</th>'; } } Layout::parseTemplate($this->_sTemplate, "#%COLLENGTH%#", $this->_nColLength); Layout::parseTemplate($this->_sTemplate, "#%FOR%#", $this->getOptsVal('for')); Layout::parseTemplate($this->_sTemplate, "#%LABEL%#", $this->getOptsVal('label')); Layout::parseTemplate($this->_sTemplate, "#%ID%#", $this->getAttrVal("id")); Layout::parseTemplate($this->_sTemplate, "#%NAME%#", $this->_sName); Layout::parseTemplate($this->_sTemplate, "#%VALUE%#", $this->_sValue); Layout::parseTemplate($this->_sTemplate, "#%REQUIRED%#", $this->getAttrVal("required")); Layout::parseTemplate($this->_sTemplate, "#%TABLETDAREA%#", $lsTableTdArea); return $this->_sTemplate; }
/** * * @param object $poView * @return string */ public function render($poView = null) { Layout::parseTemplate($this->_sTemplate, "#%COLLENGTH%#", $this->_nColLength); Layout::parseTemplate($this->_sTemplate, "#%FOR%#", $this->getOptsVal('for')); Layout::parseTemplate($this->_sTemplate, "#%LABEL%#", $this->getOptsVal('label')); Layout::parseTemplate($this->_sTemplate, "#%NAME%#", $this->_sName); Layout::parseTemplate($this->_sTemplate, "#%HELPICON%#", $this->getHelpArea()); Layout::parseTemplate($this->_sTemplate, "#%ID%#", $this->getAttrVal("id", $this->_sName)); Layout::parseTemplate($this->_sTemplate, "#%TITLE%#", $this->getAttrVal("title")); Layout::parseTemplate($this->_sTemplate, "#%CLASS%#", $this->getAttrVal("class", "btn btn-default")); Layout::parseTemplate($this->_sTemplate, "#%DATABTN%#", $this->getDataOptsVal("data-btn")); Layout::parseTemplate($this->_sTemplate, "#%DATATITLE%#", $this->getDataOptsVal("data-title")); Layout::parseTemplate($this->_sTemplate, "#%DATAACT%#", $this->getDataOptsVal("data-act")); Layout::parseTemplate($this->_sTemplate, "#%DATARETURNLABEL%#", $this->getDataOptsVal("data-return-label", $this->_sName)); Layout::parseTemplate($this->_sTemplate, "#%DATARETURN%#", $this->getDataOptsVal("data-return")); Layout::parseTemplate($this->_sTemplate, "#%DATAFILTER%#", $this->getDataOptsVal("data-filter")); Layout::parseTemplate($this->_sTemplate, "#%DATASELECT%#", $this->getDataOptsVal("data-select")); Layout::parseTemplate($this->_sTemplate, "#%DATAFNCALL%#", $this->getDataOptsVal("data-fnCall")); Layout::parseTemplate($this->_sTemplate, "#%DATAICON%#", $this->getDataOptsVal("data-icon", "glyphicon glyphicon-cog")); Layout::parseTemplate($this->_sTemplate, "#%VALUE%#", $this->_sValue); return $this->_sTemplate; }
/** * * @param string $psClass * @return string */ public function getItems($psClass = "") { $lsItemArea = ""; $lmOptChecked = $this->_sValue; $laOptions = $this->getOptsVal('value_options'); if (is_array($laOptions)) { foreach ($laOptions as $lsValue => $lmLabel) { $lsActive = ''; $lsChecked = ''; $lsColor = ''; $lsLabel = ''; $lsIcon = ''; $lsTitle = ''; $lsCheckbox = ''; if (is_array($lmLabel)) { $lsLabel = $lmLabel['label']; $lsIcon = isset($lmLabel['icon']) ? $this->getIcon($lmLabel['icon']) : ''; $lsTitle = isset($lmLabel['title']) ? 'title="' . $lmLabel['title'] . '"' : ''; } else { $lsLabel = $lmLabel; } $lsType = $this->getAttrVal('type'); if ($lsType == 'multi_checkbox') { $lsType = 'checkbox'; $lsCheckbox = '[]'; } if ($lsType == "checkbox") { if (is_array($lmOptChecked)) { foreach ($lmOptChecked as $lsOptChecked) { if ($lsOptChecked == $lsValue) { $lsActive = ' active'; $lsChecked = 'checked'; //$lsColor = " btn-info"; } } } elseif ($lmOptChecked == $lsValue) { $lsActive = ' active'; $lsChecked = 'checked'; //$lsColor = " btn-info"; } } else { if ($lmOptChecked == $lsValue) { $lsActive = ' active'; $lsChecked = 'checked'; //$lsColor = " btn-info"; } } $lsItemTemplate = $this->getItemTemplate(); if ($this->getOptsVal('data-default')) { $lsItemTemplate = $this->getClearItemTemplate($this->getOptsVal('data-display')); } Layout::parseTemplate($lsItemTemplate, "#%NAME%#", $this->_sName . $lsCheckbox); Layout::parseTemplate($lsItemTemplate, "#%ID%#", $this->_sName . '-' . $lsValue); Layout::parseTemplate($lsItemTemplate, "#%COLOR%#", $lsColor); Layout::parseTemplate($lsItemTemplate, "#%TYPE%#", $lsType); Layout::parseTemplate($lsItemTemplate, "#%CLASS%#", $psClass); Layout::parseTemplate($lsItemTemplate, "#%ACTIVE%#", $lsActive); Layout::parseTemplate($lsItemTemplate, "#%VALUE%#", $lsValue); Layout::parseTemplate($lsItemTemplate, "#%CHECKED%#", $lsChecked); Layout::parseTemplate($lsItemTemplate, "#%TOUPPER%#", $this->getAttrVal('data-toUpper')); Layout::parseTemplate($lsItemTemplate, "#%REQUIRED%#", $this->getAttrVal('required')); Layout::parseTemplate($lsItemTemplate, "#%READONLY%#", $this->getAttrVal('readonly')); Layout::parseTemplate($lsItemTemplate, "#%ITEMCLASS%#", $this->getAttrVal('class')); Layout::parseTemplate($lsItemTemplate, "#%ITEMLABEL%#", $lsLabel); Layout::parseTemplate($lsItemTemplate, "#%ICON%#", $lsIcon); Layout::parseTemplate($lsItemTemplate, "#%TITLE%#", $lsTitle); $lsItemArea .= $lsItemTemplate; } } return $lsItemArea; }
/** * * @param object $poView * @return string */ public function render($poView = null) { $laMessage = $this->getFieldMessage(); $laDateTime = preg_split("/ |T/", $this->_sValue); $lsDate = isset($laDateTime[0]) ? $laDateTime[0] : ""; $lsTime = isset($laDateTime[1]) ? $laDateTime[1] : ""; if ($this->getDataOptsVal('format-date', true)) { $lsDate = Translator::dateS2P($lsDate); } Layout::parseTemplate($this->_sTemplate, "#%COLLENGTH%#", $this->_nColLength); Layout::parseTemplate($this->_sTemplate, "#%FOR%#", $this->getOptsVal('for')); Layout::parseTemplate($this->_sTemplate, "#%LABEL%#", $this->getOptsVal('label')); Layout::parseTemplate($this->_sTemplate, "#%HELPICON%#", $this->getHelpArea()); Layout::parseTemplate($this->_sTemplate, "#%REQUIREDICON%#", $this->getRequiredArea()); Layout::parseTemplate($this->_sTemplate, "#%MSGICON%#", $this->getMessageArea($laMessage)); Layout::parseTemplate($this->_sTemplate, "#%CLASSERROR%#", $laMessage['class']); Layout::parseTemplate($this->_sTemplate, "#%ID%#", $this->getAttrVal('id')); Layout::parseTemplate($this->_sTemplate, "#%NAME%#", $this->_sName); Layout::parseTemplate($this->_sTemplate, "#%VALUE%#", Translator::dateS2P($this->_sValue)); Layout::parseTemplate($this->_sTemplate, "#%TYPE%#", $this->getAttrVal('type')); Layout::parseTemplate($this->_sTemplate, "#%CLASS%#", $this->getAttrVal('class') . $laMessage['class']); Layout::parseTemplate($this->_sTemplate, "#%VALUE1%#", $lsDate); Layout::parseTemplate($this->_sTemplate, "#%VALUE2%#", $lsTime); Layout::parseTemplate($this->_sTemplate, "#%TITLE%#", $this->getAttrVal('title')); Layout::parseTemplate($this->_sTemplate, "#%PLACEHOLDER%#", $this->getAttrVal('placeholder')); Layout::parseTemplate($this->_sTemplate, "#%REQUIRED%#", $this->getAttrVal('required')); Layout::parseTemplate($this->_sTemplate, "#%READONLY%#", $this->getAttrVal('readonly')); Layout::parseTemplate($this->_sTemplate, "#%PATTERN%#", $this->getAttrVal('pattern')); Layout::parseTemplate($this->_sTemplate, "#%DATAMASK%#", $this->getAttrVal('data-mask')); Layout::parseTemplate($this->_sTemplate, "#%DATAMASKALT%#", $this->getAttrVal('data-maskalt')); Layout::parseTemplate($this->_sTemplate, "#%BTNID%#", $this->getDataOptsVal('id', $this->_sName . 'Btn')); Layout::parseTemplate($this->_sTemplate, "#%BTNTITLE1%#", $this->getDataOptsVal('data-title1', $this->getAttrVal('title'))); Layout::parseTemplate($this->_sTemplate, "#%BTNCLASS1%#", $this->getDataOptsVal('data-class1', "btn btn-default")); Layout::parseTemplate($this->_sTemplate, "#%DATAICON1%#", $this->getDataOptsVal('data-icon1', "glyphicon glyphicon-calendar")); Layout::parseTemplate($this->_sTemplate, "#%BTNTITLE2%#", $this->getDataOptsVal('data-title2', $this->getAttrVal('title'))); Layout::parseTemplate($this->_sTemplate, "#%BTNCLASS2%#", $this->getDataOptsVal('data-class2', "btn btn-default")); Layout::parseTemplate($this->_sTemplate, "#%DATAICON2%#", $this->getDataOptsVal('data-icon2', "glyphicon glyphicon-time")); return $this->_sTemplate; }
/** * * @param object $poElement * @param string $psTemplate * @return \Onion\Form\Render\Element */ public function __construct($poElement, $psTemplate = "default") { $this->_oElement = $poElement; $this->_sName = $this->_oElement->getName(); $this->_sValue = $this->_oElement->getValue(); $this->_aAttr = $this->_oElement->getAttributes(); $this->_aOpts = $this->_oElement->getOptions(); if ($this->_oElement->getOption('data-type') !== null) { if ($this->_oElement->getOption($this->_oElement->getOption('data-type')) !== null) { $this->_aDataOpts = $this->_oElement->getOption($this->_oElement->getOption('data-type')); } } $lnColLength = $this->_oElement->getOption('length'); if (!empty($lnColLength)) { $this->_nColLength = $lnColLength; } $this->_sTemplateName = $psTemplate; if ($this->_sTemplateName == "default") { $this->_sTemplate = $this->getDefaultTemplate(); } else { $this->_sTemplate = Layout::getTemplate($this->_stemplate); } return $this; }
/** * * @param object $poView * @return string */ public function render($poView = null) { Layout::parseTemplate($this->_sTemplate, "#%COLLENGTH%#", $this->_nColLength); Layout::parseTemplate($this->_sTemplate, "#%CLASS%#", $this->getOptsVal('class')); Layout::parseTemplate($this->_sTemplate, "#%ICONAREA%#", $this->getIconArea()); Layout::parseTemplate($this->_sTemplate, "#%NAME%#", $this->_sName); Layout::parseTemplate($this->_sTemplate, "#%TEXT%#", $this->getOptsVal('text')); return $this->_sTemplate; }
/** * * @param object $poView * @return string */ public function render($poView = null) { $laMessage = $this->getFieldMessage(); Layout::parseTemplate($this->_sTemplate, "#%COLLENGTH%#", $this->_nColLength); Layout::parseTemplate($this->_sTemplate, "#%FOR%#", $this->getOptsVal('for')); Layout::parseTemplate($this->_sTemplate, "#%LABEL%#", $this->getOptsVal('label')); Layout::parseTemplate($this->_sTemplate, "#%HELPICON%#", $this->getHelpArea()); Layout::parseTemplate($this->_sTemplate, "#%REQUIREDICON%#", $this->getRequiredArea()); Layout::parseTemplate($this->_sTemplate, "#%MSGICON%#", $this->getMessageArea($laMessage)); Layout::parseTemplate($this->_sTemplate, "#%CLASSERROR%#", $laMessage['class']); Layout::parseTemplate($this->_sTemplate, "#%BTNID%#", $this->getDataOptsVal('id', $this->_sName . 'Btn')); Layout::parseTemplate($this->_sTemplate, "#%BTNTITLE%#", $this->getDataOptsVal('title', $this->getDataOptsVal('data-title', $this->getAttrVal('title')))); Layout::parseTemplate($this->_sTemplate, "#%BTNCLASS%#", $this->getDataOptsVal('class', "btn btn-default")); Layout::parseTemplate($this->_sTemplate, "#%DATATITLE%#", $this->getDataOptsVal('data-title')); Layout::parseTemplate($this->_sTemplate, "#%DATABTN%#", $this->getDataOptsVal('data-btn')); Layout::parseTemplate($this->_sTemplate, "#%DATAACT%#", $this->getDataOptsVal('data-act')); Layout::parseTemplate($this->_sTemplate, "#%DATARETURNLABEL%#", $this->getDataOptsVal('data-return-label', $this->_sName)); Layout::parseTemplate($this->_sTemplate, "#%DATARETURN%#", $this->getDataOptsVal('data-return')); Layout::parseTemplate($this->_sTemplate, "#%DATAFILTER%#", $this->getDataOptsVal('data-filter')); Layout::parseTemplate($this->_sTemplate, "#%DATASELECT%#", $this->getDataOptsVal('data-filter')); Layout::parseTemplate($this->_sTemplate, "#%DATAFNCALL%#", $this->getDataOptsVal('data-fnCall')); Layout::parseTemplate($this->_sTemplate, "#%DATAICON%#", $this->getDataOptsVal('data-icon', "glyphicon glyphicon-new-window")); Layout::parseTemplate($this->_sTemplate, "#%TYPE%#", $this->getAttrVal('type')); Layout::parseTemplate($this->_sTemplate, "#%ID%#", $this->getAttrVal('id')); Layout::parseTemplate($this->_sTemplate, "#%NAME%#", $this->_sName); Layout::parseTemplate($this->_sTemplate, "#%TITLE%#", $this->getAttrVal('title')); Layout::parseTemplate($this->_sTemplate, "#%CLASS%#", $this->getAttrVal('class') . $laMessage['class']); Layout::parseTemplate($this->_sTemplate, "#%VALUE%#", $this->_sValue); Layout::parseTemplate($this->_sTemplate, "#%PLACEHOLDER%#", $this->getAttrVal('placeholder')); Layout::parseTemplate($this->_sTemplate, "#%REQUIRED%#", $this->getAttrVal('required')); Layout::parseTemplate($this->_sTemplate, "#%READONLY%#", $this->getAttrVal('readonly', 'readonly="readonly"')); $lsBtnExtraTemplate = ""; if ($this->getDataOptsVal('data-extAct') != "") { $lsBtnExtraTemplate = $this->getBtnExtraTemplate(); Layout::parseTemplate($lsBtnExtraTemplate, "#%BTNID%#", $this->getDataOptsVal('data-extId', $this->_sName . 'ExtBtn')); Layout::parseTemplate($lsBtnExtraTemplate, "#%BTNTITLE%#", $this->getDataOptsVal('data-extTitle', $this->getDataOptsVal('title', $this->getAttrVal('title')))); Layout::parseTemplate($lsBtnExtraTemplate, "#%BTNCLASS%#", $this->getDataOptsVal('data-extClass', $this->getDataOptsVal('class', "btn btn-default"))); Layout::parseTemplate($lsBtnExtraTemplate, "#%DATATITLE%#", $this->getDataOptsVal('data-extTitle')); Layout::parseTemplate($lsBtnExtraTemplate, "#%DATAACT%#", $this->getDataOptsVal('data-extAct')); Layout::parseTemplate($lsBtnExtraTemplate, "#%DATAICON%#", $this->getDataOptsVal('data-extIcon', "glyphicon glyphicon-edit")); } Layout::parseTemplate($this->_sTemplate, "#%BTNEXTRAAREA%#", $lsBtnExtraTemplate); return $this->_sTemplate; }