Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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);
 }