本文整理汇总了PHP中ThemeUtil::getModuleStyleSheet方法的典型用法代码示例。如果您正苦于以下问题:PHP ThemeUtil::getModuleStyleSheet方法的具体用法?PHP ThemeUtil::getModuleStyleSheet怎么用?PHP ThemeUtil::getModuleStyleSheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThemeUtil
的用法示例。
在下文中一共展示了ThemeUtil::getModuleStyleSheet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* display block
*
* @param array $blockinfo a blockinfo structure
* @return output the rendered bock
*/
public function display($blockinfo)
{
// security check
if (!SecurityUtil::checkPermission('Menublock::', "$blockinfo[title]::", ACCESS_READ)) {
return;
}
// Break out options from our content field
$vars = BlockUtil::varsFromContent($blockinfo['content']);
// add the stylesheet to the header
if (isset($vars['stylesheet'])) {
PageUtil::addVar('stylesheet', ThemeUtil::getModuleStyleSheet('Blocks', $vars['stylesheet']));
}
// if cache is enabled, checks for a cached output
if ($this->view->getCaching()) {
// set the cache id
$this->view->setCacheId($blockinfo['bkey'].'/bid'.$blockinfo['bid'].'/'.UserUtil::getGidCacheString());
// check out if the contents are cached
if ($this->view->is_cached('blocks_block_menu.tpl')) {
$blockinfo['content'] = $this->view->fetch('blocks_block_menu.tpl');
return BlockUtil::themeBlock($blockinfo);
}
}
// Styling - this is deprecated and is only to support old menu for now
if (empty($vars['style'])) {
$vars['style'] = 1;
}
// Content
$menuitems = array();
if (!empty($vars['content'])) {
$contentlines = explode('LINESPLIT', $vars['content']);
foreach ($contentlines as $contentline) {
list($url, $title, $comment) = explode('|', $contentline);
if (SecurityUtil::checkPermission('Menublock::', "$blockinfo[title]:$title:", ACCESS_READ)) {
$menuitems[] = self::addMenuItem($title, $url, $comment);
$content = true;
}
}
}
// Modules
if (!empty($vars['displaymodules'])) {
$mods = ModUtil::getUserMods();
// Separate from current content, if any
if ($vars['content'] == 1) {
$menuitems[] = self::addMenuItem('', '', '');
}
foreach ($mods as $mod) {
if (SecurityUtil::checkPermission("$mod[name]::", '::', ACCESS_OVERVIEW)) {
$menuitems[] = self::addMenuItem($mod['displayname'], ModUtil::url($mod['name'], 'user', 'main'), $mod['description']);
$content = true;
}
}
}
// check for any empty result set
if (empty($menuitems)) {
return;
}
// assign the items
$this->view->assign('menuitems', $menuitems);
// get the block content
$blockinfo['content'] = $this->view->fetch('blocks_block_menu.tpl');
// pass the block array back to the theme for display
return BlockUtil::themeBlock($blockinfo);
}