function getCode() { bx_import('BxTemplStudioMenu'); $aTmplVars = array(); foreach ($this->aItems as $sPosition => $mixedItems) { if (!$this->aVisible[$sPosition]) { continue; } $sContent = ""; if (is_array($mixedItems)) { $oMenu = new BxTemplStudioMenu(array('template' => 'menu_top_toolbar.html', 'menu_items' => $mixedItems)); $sContent = $oMenu->getCode(); } else { if (is_string($mixedItems) && !empty($mixedItems)) { $sContent = $mixedItems; } } $aTmplVars[] = array('name' => $sPosition, 'content' => $sContent); } if (empty($aTmplVars)) { return ''; } $oTemplate = BxDolStudioTemplate::getInstance(); $oTemplate->addJs($this->getJs()); $oTemplate->addCss($this->getCss()); return $oTemplate->parseHtmlByName('menu_top.html', array('bx_repeat:menus' => $aTmplVars)); }
function getPageMenu($aMenu = array(), $aMarkers = array()) { $this->aMenuItems = array(); foreach ($this->oModule->aTools as $aTool) { $this->aMenuItems[] = array('name' => $aTool['name'], 'icon' => $aTool['icon'], 'link' => sprintf($this->sUrl, $this->sModule, $aTool['name']), 'title' => $aTool['title'], 'selected' => $aTool['name'] == $this->sPage); } $oMenu = new BxTemplStudioMenu(array('template' => 'menu_main.html', 'menu_items' => $this->aMenuItems), $this->oModule->_oTemplate); return $oMenu->getCode(); }
function __construct($aParams = array(), $aField = array()) { parent::__construct($aParams, $aField); $sJsObject = $this->getJsObject(); $oTemplate = BxDolStudioTemplate::getInstance(); $this->aForm = array('form_attrs' => array('id' => '', 'action' => '', 'method' => BX_DOL_STUDIO_METHOD_DEFAULT), 'params' => array('db' => array('table' => 'sys_form_inputs', 'key' => 'id', 'uri' => '', 'uri_title' => '', 'submit_name' => 'do_submit')), 'inputs' => array('type' => array('type' => 'custom', 'name' => 'type', 'content' => '', 'attrs' => array('id' => 'bx-form-field-type', 'class' => 'bx-form-field-type', 'onchange' => $sJsObject . '.onSelectType()')), 'reset' => array('type' => 'reset', 'name' => 'close', 'value' => _t('_adm_form_btn_field_cancel'), 'attrs' => array('onclick' => "\$('.bx-popup-applied:visible').dolPopupHide()", 'class' => 'bx-def-margin-sec-left')))); $aTypes = array(); foreach ($this->aTypes as $sType) { $aTypes[$sType] = _t($this->sTypeTitlePrefix . $sType); } asort($aTypes); $aMenu = array(); foreach ($aTypes as $sName => $sTitle) { $aMenu[] = array('name' => $sName, 'icon' => 'ui-' . $sName . '.png', 'onclick' => $sJsObject . ".onSelectType('" . $sName . "', this)", 'title' => $sTitle); } $oMenu = new BxTemplStudioMenu(array('template' => 'menu_vertical.html', 'menu_items' => $aMenu)); $this->aForm['inputs']['type']['content'] = $oMenu->getCode(); }
public function getPageMenu($aMenu, $aMarkers = array()) { $oMenu = new BxTemplStudioMenu(array('template' => 'menu_side.html', 'menu_items' => $aMenu)); if (!empty($aMarkers)) { $oMenu->addMarkers($aMarkers); } return $oMenu->getCode(); }
protected function _getTmplVarsPageSettings($aPage = array(), $bCreate = true) { $sJsObject = $this->getPageJsObject(); $aTmplParams = array('menu' => array(), 'html_settings_groups_id' => $this->aHtmlIds['settings_groups_id'], 'bx_repeat:settings_groups' => array(), 'submit' => _t($bCreate ? '_adm_bp_btn_page_create' : '_adm_bp_btn_page_apply')); foreach ($this->aPageSettings as $aSetting) { //--- get menu items $aTmplParams['menu'][$aSetting['name']] = array('name' => $aSetting['name'], 'icon' => '', 'onclick' => $sJsObject . '.onChangeSettingGroup(\'' . $aSetting['name'] . '\', this);', 'title' => $aSetting['title'], 'selected' => isset($aSetting['active']) && (int) $aSetting['active'] == 1); //--- get settings $aTmplParams['bx_repeat:settings_groups'][] = array('html_settings_group_id' => $this->aHtmlIds['settings_group_id'] . $aSetting['name'], 'bx_if:hidden' => array('condition' => $aSetting['active'] != 1, 'content' => array()), 'content' => $this->{'getSettings' . $this->getClassName($aSetting['name'])}($aPage, $bCreate)); } bx_import('BxTemplStudioMenu'); $oMenu = new BxTemplStudioMenu(array('template' => 'menu_side.html', 'menu_items' => $aTmplParams['menu'])); $aTmplParams['menu'] = $oMenu->getCode(); return $aTmplParams; }