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


PHP Layout::getCurrentTheme方法代码示例

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


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

示例1: wrap

 /**
  * Wraps the content with the layout header
  */
 public static function wrap($content, $title = NULL, $use_blank = false)
 {
     $theme = self::getCurrentTheme();
     $template['THEME_HTTP'] = Layout::getThemeHttpRoot() . $theme . '/';
     $template['CONTENT'] = $content;
     Layout::loadHeaderTags($template);
     if (isset($title)) {
         $template['PAGE_TITLE'] = strip_tags($title);
     }
     if ($use_blank) {
         $empty_tpl = sprintf('%sthemes/%s/blank.tpl', PHPWS_SOURCE_DIR, Layout::getCurrentTheme());
         if (is_file($empty_tpl)) {
             $result = PHPWS_Template::process($template, 'layout', $empty_tpl, TRUE);
             return $result;
         }
     }
     $result = PHPWS_Template::process($template, 'layout', 'header.tpl');
     return $result;
 }
开发者ID:sysulsj,项目名称:phpwebsite,代码行数:22,代码来源:Layout.php

示例2: setThemeFile

 public function setThemeFile($module, $file)
 {
     $current_theme = \Layout::getCurrentTheme();
     $this->theme_file = implode('', array(PHPWS_SOURCE_DIR, 'themes/', $current_theme, '/', 'templates/', $module, '/', $file));
 }
开发者ID:par-orillonsoft,项目名称:phpwebsite,代码行数:5,代码来源:Template.php

示例3: getList

 /**
  * Returns a list of items based on the table currently set in this manager
  *
  * @param  string  $listName The name of the list wanting to be returned
  * @param  string  $title    The title of the list
  * @param  boolean $makeForm Flag whether or not to make a form out of the list
  * @access public
  */
 function getList($listName, $title = NULL, $makeForm = TRUE, $overRideOp = NULL)
 {
     $this->listName = $listName;
     if (!isset($this->_table) && !isset($this->_request)) {
         $message = _('Manager was not fully initialized to get a list.');
         $error = new PHPWS_Error('core', 'PHPWS_Manager::getList()', $message, 'exit', 1);
         $error->message(NULL);
     }
     $theme = Layout::getCurrentTheme();
     $themeModuleRowTpl = "themes/{$theme}/templates/" . $this->_module . '/' . $this->_templates[$this->listName] . '/row.tpl';
     $moduleRowTpl = PHPWS_SOURCE_DIR . 'mod/' . $this->_module . '/templates/' . $this->_templates[$this->listName] . '/row.tpl';
     $themeCoreRowTpl = 'themes/' . $theme . '/templates/core/defaultRow.tpl';
     $coreRowTpl = PHPWS_SOURCE_DIR . 'templates/defaultRow.tpl';
     $themeModuleListTpl = "themes/{$theme}/templates/" . $this->_module . '/' . $this->_templates[$this->listName] . '/list.tpl';
     $moduleListTpl = PHPWS_SOURCE_DIR . 'mod/' . $this->_module . '/templates/' . $this->_templates[$this->listName] . '/list.tpl';
     $themeCoreListTpl = "themes/{$theme}/templates/core/defaultList.tpl";
     $coreListTpl = PHPWS_SOURCE_DIR . 'templates/defaultList.tpl';
     if (file_exists($themeModuleRowTpl)) {
         $rowTpl = $themeModuleRowTpl;
     } else {
         if (file_exists($moduleRowTpl)) {
             $rowTpl = $moduleRowTpl;
         } else {
             if (file_exists($themeCoreRowTpl)) {
                 $rowTpl = $themeCoreRowTpl;
             } else {
                 $rowTpl = $coreRowTpl;
             }
         }
     }
     if (file_exists($themeModuleListTpl)) {
         $listTpl = $themeModuleListTpl;
     } else {
         if (file_exists($moduleListTpl)) {
             $listTpl = $moduleListTpl;
         } else {
             if (file_exists($themeCoreListTpl)) {
                 $listTpl = $themeCoreListTpl;
             } else {
                 $listTpl = $coreListTpl;
             }
         }
     }
     if (isset($_REQUEST['PHPWS_MAN_LIST']) && $this->listName == $_REQUEST['PHPWS_MAN_LIST']) {
         $this->catchOrder();
     }
     if (isset($overRideOp)) {
         $op = $overRideOp;
     } else {
         if (isset($this->_listPaging[$this->listName]['op'])) {
             $op = $this->_listPaging[$this->listName]['op'];
         }
     }
     if (isset($this->_listPaging[$this->listName]) && is_array($this->_listPaging[$this->listName])) {
         if (!isset($this->_pagers[$this->listName])) {
             $this->_pagers[$this->listName] = new PHPWS_Pager();
             $this->_pagers[$this->listName]->setLinkBack('./index.php?module=' . $this->_module . '&' . $op . '&PHPWS_MAN_PAGE=' . $this->listName);
             $this->_pagers[$this->listName]->setLimits($this->_listPaging[$this->listName]['limits']);
             $this->_pagers[$this->listName]->makeArray(TRUE);
             if ($this->_anchor) {
                 $this->_pagers[$this->listName]->setAnchor('#' . $this->listName);
             }
             $this->_pagers[$this->listName]->limit = $this->_listPaging[$this->listName]['limit'];
         }
         $this->_pagers[$this->listName]->setData($this->_getIds());
         if (isset($_REQUEST['PHPWS_MAN_PAGE']) && $this->listName == $_REQUEST['PHPWS_MAN_PAGE']) {
             $this->_pagers[$this->listName]->pageData();
         } else {
             $this->_pagers[$this->listName]->pageData(FALSE);
         }
         if (isset($this->_class)) {
             $items = $this->getItems($this->_pagers[$this->listName]->getData(), FALSE, TRUE);
         } else {
             $items = $this->getItems($this->_pagers[$this->listName]->getData());
         }
         $totalItems = count($items);
         //            $totalItems = $this->_pagers[$this->listName]->getNumRows();
     } else {
         if (isset($this->_class)) {
             $items = $this->getItems(NULL, FALSE, TRUE);
         } else {
             $items = $this->getItems();
         }
         $totalItems = sizeof($items);
     }
     /* Begin building main list tags array for processTemplate() */
     $listTags = array();
     if (isset($this->_listExtraLabels) && is_array($this->_listExtraLabels)) {
         $listTags = $this->_listExtraLabels;
     }
     $listTags['TITLE'] = $title;
     $listTags['ANCHOR'] = '<a id="' . $this->listName . '" name="' . $this->listName . '"></a>';
//.........这里部分代码省略.........
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:101,代码来源:Manager.php

示例4: boxMoveForm

 private static function boxMoveForm()
 {
     $current_theme = \Layout::getCurrentTheme();
     $db = \Database::getDB();
     $tbl = $db->addTable('layout_box');
     $tbl->addFieldConditional('theme', $current_theme);
     $tbl->addFieldConditional('active', 1);
     $tbl->addOrderBy('theme_var');
     $tbl->addOrderBy('box_order');
     $boxes = $db->select();
     $theme_vars = $_SESSION['Layout_Settings']->_allowed_move;
     $move_select = '<optgroup label="Shift within current variable">' . '<option>Click below to move this block</option>' . '<option value="move_box_top">Top</option>' . '<option value="move_box_up">Up</option>' . '<option value="move_box_down">Down</option>' . '<option value="move_box_bottom">Bottom</option>' . '</optgroup>' . '<optgroup label="Move to theme variable">';
     foreach ($theme_vars as $tv) {
         $listing[$tv] = null;
         $move_select .= "<option>{$tv}</option>";
     }
     $move_select .= '</optgroup></select>';
     foreach ($boxes as $box) {
         $box_name = $box['module'] . ':' . $box['content_var'];
         $listing[$box['theme_var']][$box['box_order']] = array('id' => $box['id'], 'name' => $box_name);
     }
     //var_dump($listing);exit;
     $template = new \Template(array('rows' => $listing, 'move_select' => $move_select));
     $template->setModuleTemplate('layout', 'box_move.html');
     echo $template->get();
     exit;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:27,代码来源:LayoutAdmin.php

示例5: setThemeFile

 public function setThemeFile($module, $file)
 {
     if (!class_exists('Layout')) {
         $db = \Database::getDB();
         $lc = $db->addTable('layout_config');
         $row = $db->selectOneRow();
         $current_theme = $row['default_theme'];
     } else {
         $current_theme = \Layout::getCurrentTheme();
     }
     $this->theme_file = implode('', array(PHPWS_SOURCE_DIR, 'themes/', $current_theme, '/', 'templates/', $module, '/', $file));
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:12,代码来源:Template.php


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