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


PHP Setting::getTabIndex方法代码示例

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


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

示例1: edit

 /**
  * Display the imagetypes for editing
  *
  * Placeholders:
  * The imagetypes' name is written to IMAGETYPE_NAME, and the key
  * to IMAGETYPE_KEY.  Other fields are IMAGETYPE_WIDTH,
  * IMAGETYPE_HEIGHT, and IMAGETYPE_QUALITY for width, height, and
  * quality, respectively.
  * Some entries from $_CORELANG are set up. Their indices are used as
  * placeholder name as well.
  * If you want your imagetypes to be stored, you *MUST* handle the parameter
  * 'act=imagetypes_edit' in your modules' getPage(), and call this method
  * again.
  * @return  \Cx\Core\Html\Sigma   The Template object
  */
 static function edit()
 {
     global $objTemplate, $_CORELANG;
     $result = self::storeFromPost();
     if ($result === true) {
         $objTemplate->setVariable('CONTENT_OK_MESSAGE', $_CORELANG['TXT_CORE_IMAGETYPE_STORED_SUCCESSFULLY']);
     } elseif ($result === false) {
         $objTemplate->setVariable('CONTENT_STATUS_MESSAGE', $_CORELANG['TXT_CORE_IMAGETYPE_ERROR_STORING']);
     }
     if (!empty($_REQUEST['imagetype_delete_key'])) {
         $result = self::deleteByKey($_REQUEST['imagetype_delete_key']);
         if ($result === true) {
             $objTemplate->setVariable('CONTENT_OK_MESSAGE', $_CORELANG['TXT_CORE_IMAGETYPE_DELETED_SUCCESSFULLY']);
         } elseif ($result === false) {
             $objTemplate->setVariable('CONTENT_STATUS_MESSAGE', $_CORELANG['TXT_CORE_IMAGETYPE_ERROR_DELETING']);
         }
     }
     self::reset();
     //$objTemplate->setCurrentBlock();
     //echo(nl2br(htmlentities(var_export($objTemplate->getPlaceholderList()))));
     $objTemplateLocal = new \Cx\Core\Html\Sigma(\Env::get('cx')->getCodeBaseCorePath() . '/ImageType/View/Template/Generic');
     // TODO: Needed?
     \Cx\Core\Csrf\Controller\Csrf::add_placeholder($objTemplateLocal);
     $objTemplateLocal->setErrorHandling(PEAR_ERROR_DIE);
     if (!$objTemplateLocal->loadTemplateFile('Types.html')) {
         die("Failed to load template Types.html");
     }
     $uri = \Html::getRelativeUri_entities();
     $active_tab = \Cx\Core\Setting\Controller\Setting::getTabIndex();
     \Html::replaceUriParameter($uri, 'active_tab=' . $active_tab);
     \Html::stripUriParam($uri, 'imagetype_delete_key');
     \Html::stripUriParam($uri, 'key');
     \Html::stripUriParam($uri, 'act');
     $objTemplateLocal->setGlobalVariable($_CORELANG + array('URI_BASE' => $uri));
     $arrImagetypes = self::getArray();
     //echo("ImageType::edit(): got Array: ".var_export($arrImagetypes, true)."<br />");
     if (!is_array($arrImagetypes)) {
         $objTemplateLocal->setVariable('CONTENT_STATUS_MESSAGE', $_CORELANG['TXT_CORE_IMAGETYPE_ERROR_RETRIEVING']);
         return $objTemplateLocal;
     }
     if (empty($arrImagetypes)) {
         $objTemplateLocal->setVariable('CONTENT_STATUS_MESSAGE', sprintf($_CORELANG['TXT_CORE_IMAGETYPE_WARNING_NONE_FOUND_FOR_MODULE'], MODULE_ID));
         return $objTemplateLocal;
     }
     $i = 0;
     foreach ($arrImagetypes as $key => $arrImagetype) {
         $name = $arrImagetype['name'];
         $width = $arrImagetype['width'];
         $height = $arrImagetype['height'];
         $quality = $arrImagetype['quality'];
         $width_thumb = $arrImagetype['width_thumb'];
         $height_thumb = $arrImagetype['height_thumb'];
         $quality_thumb = $arrImagetype['quality_thumb'];
         $objTemplateLocal->setVariable(array('CORE_IMAGETYPE_ROWCLASS' => ++$i % 2 + 1, 'CORE_IMAGETYPE_KEY' => $key . \Html::getHidden('imagetype_key[' . $key . ']', $key, 'imagetype_key-' . $key), 'CORE_IMAGETYPE_NAME' => \Html::getInputText('imagetype_name[' . $key . ']', $name, 'imagetype_name-' . $key, 'style="width: 220px;"'), 'CORE_IMAGETYPE_WIDTH' => \Html::getInputText('imagetype_width[' . $key . ']', $width, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PIXEL'], 'CORE_IMAGETYPE_HEIGHT' => \Html::getInputText('imagetype_height[' . $key . ']', $height, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PIXEL'], 'CORE_IMAGETYPE_QUALITY' => \Html::getInputText('imagetype_quality[' . $key . ']', $quality, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PERCENT_SIGN'], 'CORE_IMAGETYPE_WIDTH_THUMB' => \Html::getInputText('imagetype_width_thumb[' . $key . ']', $width_thumb, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PIXEL'], 'CORE_IMAGETYPE_HEIGHT_THUMB' => \Html::getInputText('imagetype_height_thumb[' . $key . ']', $height_thumb, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PIXEL'], 'CORE_IMAGETYPE_QUALITY_THUMB' => \Html::getInputText('imagetype_quality_thumb[' . $key . ']', $quality_thumb, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PERCENT_SIGN']));
         $objTemplateLocal->parse('core_imagetype_data');
     }
     $objTemplateLocal->touchBlock('core_imagetype_section');
     $objTemplateLocal->parse('core_imagetype_section');
     $objTemplateLocal->setVariable(array('CORE_IMAGETYPE_ROWCLASS' => 1, 'CORE_IMAGETYPE_KEY' => \Html::getInputText('imagetype_key[new]', '', false, 'style="width: 220px;"'), 'CORE_IMAGETYPE_NAME' => \Html::getInputText('imagetype_name[new]', '', false, 'style="width: 220px;"'), 'CORE_IMAGETYPE_WIDTH' => \Html::getInputText('imagetype_width[new]', self::DEFAULT_WIDTH, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PIXEL'], 'CORE_IMAGETYPE_HEIGHT' => \Html::getInputText('imagetype_height[new]', self::DEFAULT_HEIGHT, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PIXEL'], 'CORE_IMAGETYPE_QUALITY' => \Html::getInputText('imagetype_quality[new]', self::DEFAULT_QUALITY, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PERCENT_SIGN'], 'CORE_IMAGETYPE_WIDTH_THUMB' => \Html::getInputText('imagetype_width_thumb[new]', self::DEFAULT_WIDTH_THUMB, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PIXEL'], 'CORE_IMAGETYPE_HEIGHT_THUMB' => \Html::getInputText('imagetype_height_thumb[new]', self::DEFAULT_HEIGHT_THUMB, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PIXEL'], 'CORE_IMAGETYPE_QUALITY_THUMB' => \Html::getInputText('imagetype_quality_thumb[new]', self::DEFAULT_QUALITY_THUMB, false, 'style="width: 30px; text-align: right;"') . $_CORELANG['TXT_CORE_IMAGETYPE_PERCENT_SIGN'], 'CORE_IMAGETYPE_FUNCTIONS' => ''));
     $objTemplateLocal->parse('core_imagetype_data');
     return $objTemplateLocal;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:77,代码来源:ImageType.class.php


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