本文整理汇总了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;
}
示例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));
}
示例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>';
//.........这里部分代码省略.........
示例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;
}
示例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));
}