本文整理汇总了PHP中EasyBlogHelper::getThemeObject方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::getThemeObject方法的具体用法?PHP EasyBlogHelper::getThemeObject怎么用?PHP EasyBlogHelper::getThemeObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::getThemeObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getThemes
public function getThemes()
{
$path = EBLOG_THEMES;
$result = JFolder::folders($path, '.', false, true, $exclude = array('.svn', 'CVS', '.', '.DS_Store'));
$themes = array();
// Cleanup output
foreach ($result as $item) {
$name = basename($item);
if ($name != 'dashboard') {
$obj = EasyBlogHelper::getThemeObject($name);
if ($obj) {
$themes[] = $obj;
}
}
}
return $themes;
}
示例2: display
function display($tpl = null)
{
// @rule: Test for user access if on 1.6 and above
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
if (!JFactory::getUser()->authorise('easyblog.manage.theme', 'com_easyblog')) {
JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
JFactory::getApplication()->close();
}
}
JHTML::_('behavior.tooltip');
//initialise variables
$document = JFactory::getDocument();
$user = JFactory::getUser();
$mainframe = JFactory::getApplication();
$config = EasyBlogHelper::getConfig();
$element = JRequest::getWord('element');
$theme = EasyBlogHelper::getThemeObject($element);
$blogImageFile = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $element . DIRECTORY_SEPARATOR . 'image.ini';
$blogImage = false;
jimport('joomla.filesystem.file');
if (JFile::exists($blogImageFile)) {
$contents = JFile::read($blogImageFile);
require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'json.php';
$json = new Services_JSON();
$types = $json->decode($contents);
foreach ($types as $type) {
if ($type->name == 'frontpage' || $type->name == 'entry') {
$blogImage[$type->name] = $type;
}
}
}
$this->assign('blogimages', $this->getBlogImages($theme->element));
$this->assign('param', $this->getParams($theme->element));
$this->assign('blogImage', $blogImage);
$this->assign('theme', $theme);
$this->assign('config', $config);
parent::display($tpl);
}