当前位置: 首页>>代码示例>>PHP>>正文


PHP Setting::tab_index方法代码示例

本文整理汇总了PHP中Cx\Core\Setting\Controller\Setting::tab_index方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::tab_index方法的具体用法?PHP Setting::tab_index怎么用?PHP Setting::tab_index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cx\Core\Setting\Controller\Setting的用法示例。


在下文中一共展示了Setting::tab_index方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: settings

 /**
  * Sets up the Country settings page
  * @return  string          The page content
  */
 static function settings()
 {
     global $_CORELANG;
     $objTemplateCountry = new \Cx\Core\Html\Sigma(\Env::get('cx')->getCodeBaseCorePath() . '/Country/View/Template/Generic');
     $objTemplateCountry->loadTemplateFile('Overview.html');
     // Adds messages
     self::storeSettings();
     self::storeFromPost();
     $uri = \Html::getRelativeUri();
     // Let all links in this tab point here again
     \Html::replaceUriParameter($uri, 'active_tab=' . \Cx\Core\Setting\Controller\Setting::tab_index());
     // Create a copy of the URI for the Paging, as this is passed by
     // reference and modified
     $uri_paging = $uri;
     //DBG::log("URI: $uri");
     $objSorting = new Sorting($uri, array('id' => $_CORELANG['TXT_CORE_COUNTRY_ID'], 'active' => $_CORELANG['TXT_CORE_COUNTRY_ACTIVE'], 'ord' => $_CORELANG['TXT_CORE_COUNTRY_ORD'], 'name' => $_CORELANG['TXT_CORE_COUNTRY_NAME'], 'alpha2' => $_CORELANG['TXT_CORE_COUNTRY_ISO2'], 'alpha3' => $_CORELANG['TXT_CORE_COUNTRY_ISO3']), true, 'order_country');
     \Cx\Core\Setting\Controller\Setting::init('core', 'country');
     $limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_countries_per_page_backend', 'core');
     $count = 0;
     $arrCountries = self::getArray($count, null, $limit, \Paging::getPosition(), $objSorting->getOrder());
     if ($arrCountries === false) {
         return \Message::error($_CORELANG['TXT_CORE_COUNTRY_ERROR_INITIALIZING']);
     }
     $objTemplateCountry->setGlobalVariable($_CORELANG + array('CORE_COUNTRY' => $_CORELANG['TXT_CORE_COUNTRY'] . ' ' . sprintf($_CORELANG['TXT_CORE_TOTAL'], $count), 'HEAD_SETTINGS_COUNTRY_ID' => $objSorting->getHeaderForField('id'), 'HEAD_SETTINGS_COUNTRY_ACTIVE' => $objSorting->getHeaderForField('active'), 'HEAD_SETTINGS_COUNTRY_ORD' => $objSorting->getHeaderForField('ord'), 'HEAD_SETTINGS_COUNTRY_NAME' => $objSorting->getHeaderForField('name'), 'HEAD_SETTINGS_COUNTRY_ISO2' => $objSorting->getHeaderForField('alpha2'), 'HEAD_SETTINGS_COUNTRY_ISO3' => $objSorting->getHeaderForField('alpha3'), 'CORE_SETTING_TAB_INDEX' => \Cx\Core\Setting\Controller\Setting::tab_index(), 'SETTINGS_COUNTRY_PAGING' => \Paging::get($uri_paging, '', $count, $limit, true)));
     // Note:  Optionally disable the block 'settings_country_submit'
     // to disable storing changes
     $i = 0;
     foreach ($arrCountries as $country_id => $arrCountry) {
         $objTemplateCountry->setVariable(array('SETTINGS_COUNTRY_ROWCLASS' => ++$i % 2 + 1, 'SETTINGS_COUNTRY_ID' => $country_id, 'SETTINGS_COUNTRY_ACTIVE' => $arrCountry['active'] ? \Html::ATTRIBUTE_CHECKED : '', 'SETTINGS_COUNTRY_ORD' => $arrCountry['ord'], 'SETTINGS_COUNTRY_NAME' => $arrCountry['name'], 'SETTINGS_COUNTRY_ISO2' => $arrCountry['alpha2'], 'SETTINGS_COUNTRY_ISO3' => $arrCountry['alpha3'], 'SETTINGS_FUNCTIONS' => \Html::getBackendFunctions(array('delete' => 'delete_country_id=' . $country_id), array('delete' => $_CORELANG['TXT_CORE_COUNTRY_CONFIRM_DELETE'] . "\\n" . $_CORELANG['TXT_ACTION_IS_IRREVERSIBLE']))));
         $objTemplateCountry->parse('settings_country_row');
     }
     $objTemplateSetting = null;
     \Cx\Core\Setting\Controller\Setting::show_external($objTemplateSetting, $_CORELANG['TXT_CORE_COUNTRY_EDIT'], $objTemplateCountry->get());
     \Cx\Core\Setting\Controller\Setting::show($objTemplateSetting, $uri, $_CORELANG['TXT_CORE_COUNTRY_SETTINGS'], $_CORELANG['TXT_CORE_COUNTRY_SETTINGS']);
     return $objTemplateSetting->get();
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:40,代码来源:Country.class.php

示例2: edit

 /**
  * Show the selected mail template for editing
  *
  * Stores the MailTemplate if the 'bsubmit' parameter has been posted.
  * If the $key argument is empty, tries to pick the value from
  * $_REQUEST['key'].
  * @param   mixed     $section      The section of the mail template
  *                                  to be edited
  * @param   string    $key          The optional key of the mail template
  *                                  to be edited
  * @param   string    $act          The action of the mail template
  * @return  \Cx\Core\Html\Sigma     The template object
  */
 static function edit($section, $key = '', $useDefaultActs = true, $act = 'mailtemplate_overview')
 {
     global $_CORELANG;
     // If the $key parameter is empty, check the request
     if (empty($key)) {
         if (isset($_REQUEST['key'])) {
             $key = $_REQUEST['key'];
         }
     }
     // Try to load an existing template for any non-empty key
     $arrTemplate = null;
     if ($key != '') {
         $arrTemplate = self::get($section, $key, FRONTEND_LANG_ID);
     }
     // If there is none, get an empty template
     $new = false;
     if (!$arrTemplate) {
         $new = true;
         $arrTemplate = self::getEmpty($key);
     }
     // Copy the template?
     if (isset($_REQUEST['copy'])) {
         $arrTemplate['key'] = '';
         $new = true;
     }
     $objTemplate = new \Cx\Core\Html\Sigma(\Env::get('cx')->getCodeBaseCorePath() . '/MailTemplate/View/Template/Generic');
     $objTemplate->setErrorHandling(PEAR_ERROR_DIE);
     \Cx\Core\Csrf\Controller\Csrf::add_placeholder($objTemplate);
     if (!$objTemplate->loadTemplateFile('Edit.html')) {
         die("Failed to load template Edit.html");
     }
     $uri = \Html::getRelativeUri_entities();
     \Html::stripUriParam($uri, 'key');
     $uriAppendix = '';
     if ($useDefaultActs) {
         \Html::stripUriParam($uri, 'act');
         $uriAppendix = '&act=' . $act;
     }
     $tab_index = \Cx\Core\Setting\Controller\Setting::tab_index();
     \Html::replaceUriParameter($uri, 'active_tab=' . $tab_index);
     \Html::replaceUriParameter($uri, 'userFrontendLangId=' . FRONTEND_LANG_ID);
     $objTemplate->setGlobalVariable($_CORELANG + array('CORE_MAILTEMPLATE_EDIT_TITLE' => $new ? $_CORELANG['TXT_CORE_MAILTEMPLATE_ADD'] : $_CORELANG['TXT_CORE_MAILTEMPLATE_EDIT'], 'CORE_MAILTEMPLATE_CMD' => isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : '', 'CORE_MAILTEMPLATE_ACTIVE_TAB' => $tab_index, 'URI_BASE' => $uri . $uriAppendix));
     $i = 0;
     foreach ($arrTemplate as $name => $value) {
         // See if there is a posted parameter value
         if (isset($_POST[$name])) {
             $value = $_POST[$name];
         }
         // IDs are set up as hidden fields.
         // They *MUST NOT* be edited!
         if (preg_match('/(?:_id)$/', $name)) {
             // For copies, IDs *MUST NOT* be reused!
             if (isset($_REQUEST['copy'])) {
                 $value = 0;
             }
             $objTemplate->setVariable('MAILTEMPLATE_HIDDEN', \Html::getHidden($name, $value));
             $objTemplate->parse('core_mailtemplate_hidden');
             continue;
         }
         // Regular inputs of various kinds
         $input = '';
         $attribute = '';
         //            $arrMimetype = '';
         switch ($name) {
             case 'available':
                 continue 2;
                 /*
                 TODO: WARNING: FCKEditor v2.x f***s up the blocks in the mail template!
                 Use plain text areas instead.  See below.
                 */
             /*
             TODO: WARNING: FCKEditor v2.x f***s up the blocks in the mail template!
             Use plain text areas instead.  See below.
             */
             case 'message_html':
                 // Show WYSIWYG only if HTML is enabled
                 if (empty($arrTemplate['html'])) {
                     continue 2;
                 }
                 $objTemplate->setVariable(array('MAILTEMPLATE_ROWCLASS' => ++$i % 2 + 1, 'MAILTEMPLATE_SPECIAL' => $_CORELANG['TXT_CORE_MAILTEMPLATE_' . strtoupper($name)]));
                 $objTemplate->touchBlock('core_mailtemplate_special');
                 $objTemplate->parse('core_mailtemplate_special');
                 $objTemplate->setVariable(array('MAILTEMPLATE_ROWCLASS' => ++$i % 2 + 1, 'MAILTEMPLATE_SPECIAL' => new \Cx\Core\Wysiwyg\Wysiwyg($name, $value, 'fullpage')));
                 $objTemplate->touchBlock('core_mailtemplate_special');
                 $objTemplate->parse('core_mailtemplate_special');
                 continue 2;
                 //$objTemplate->replaceBlock('core_mailtemplate_special', '', true);
//.........这里部分代码省略.........
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:101,代码来源:MailTemplate.class.php


注:本文中的Cx\Core\Setting\Controller\Setting::tab_index方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。