Example #1
0
 public function __construct()
 {
     // EasyBlog's configuration
     $this->config = EB::config();
     $this->jconfig = EB::jconfig();
     // Joomla's document object
     $this->doc = JFactory::getDocument();
     // Joomla's application object
     $this->app = JFactory::getApplication();
     // Request input object
     $this->input = EB::request();
     // Current logged in user.
     $this->my = JFactory::getUser();
     // String library
     $this->string = EB::string();
     $this->lang = JFactory::getLanguage();
 }
Example #2
0
 public function display($tpl = null)
 {
     if (!$this->config->get('main_remotepublishing_xmlrpc')) {
         return;
     }
     $theme = EB::template();
     // Get the site details
     $title = EB::jconfig()->get('sitename');
     $link = rtrim(JURI::root(), '/') . '/index.php?option=com_easyblog&tmpl=component';
     $xmlrpc = rtrim(JURI::root(), '/') . '/index.php?option=com_easyblog&view=xmlrpc&tmpl=component';
     $theme->set('title', $title);
     $theme->set('link', $link);
     $theme->set('xmlrpc', $xmlrpc);
     $output = $theme->output('site/rsd/template');
     header('Content-Type: application/xml; charset=utf-8', true);
     echo $output;
     exit;
 }
Example #3
0
 public function __construct()
 {
     $this->doc = JFactory::getDocument();
     $this->app = JFactory::getApplication();
     $this->my = JFactory::getUser();
     $this->config = EB::config();
     $this->info = EB::info();
     $this->jconfig = EB::jconfig();
     $this->acl = EB::acl();
     // If this is a dashboard theme, we need to let the theme object know
     $options = array('paramsPrefix' => $this->paramsPrefix);
     // If this is an ajax document, we should pass the $ajax library to the client
     if ($this->doc->getType() == 'ajax') {
         //we need to load frontend language from here incase it was called from backend.
         JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
         $this->ajax = EB::ajax();
     }
     // Create an instance of the theme so child can start setting variables to it.
     $this->theme = EB::template(null, $options);
     // Set the input object
     $this->input = EB::request();
 }
Example #4
0
 /**
  * Override parent's display method
  *
  * @since   4.0
  * @access  public
  * @param   string
  * @return
  */
 public function display($cachable = false, $urlparams = array())
 {
     $viewType = $this->doc->getType();
     $viewName = $this->input->get('view', 'latest');
     $viewLayout = $this->input->get('layout', 'default', 'string');
     // Get the view
     $view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout));
     // Set the layout
     $view->setLayout($viewLayout);
     // Get Joomla's configuration
     $jconfig = EB::jconfig();
     // Display the view
     if ($cachable && $viewType != 'feed' && $jconfig->get('caching') >= 1) {
         $option = $this->input->get('option');
         $cache = JFactory::getCache($option, 'view');
         if (is_array($urlparams)) {
             if (!empty($this->app->registeredurlparams)) {
                 $registeredurlparams = $app->registeredurlparams;
             } else {
                 $registeredurlparams = new stdClass();
             }
             foreach ($urlparams as $key => $value) {
                 // Add your safe url parameters with variable type as value {@see JFilterInput::clean()}.
                 $registeredurlparams->{$key} = $value;
             }
             $app->registeredurlparams = $registeredurlparams;
         }
         $cache->get($view, 'display');
     } else {
         if (method_exists($view, $viewLayout)) {
             $view->{$viewLayout}();
         } else {
             $view->display();
         }
     }
     return $this;
 }
Example #5
0
 /**
  * Retrieves Joomla's cache object
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public static function getCache()
 {
     $jconfig = EB::jconfig();
     $options = array('defaultgroup' => '', 'storage' => $jconfig->get('cache_handler', ''), 'caching' => true, 'cachebase' => $jconfig->get('cache_path', JPATH_SITE . '/cache'));
     $cache = JCache::getInstance('', $options);
     return $cache;
 }