Esempio n. 1
0
 public function __construct()
 {
     $this->config = EB::config();
     $this->doc = JFactory::getDocument();
     // If environment is set to production, change to static.
     $environment = $this->config->get('easyblog_environment');
     if ($environment == 'production') {
         $environment = 'static';
     }
     $this->namespace = 'EASYBLOG';
     $this->shortName = 'eb';
     $this->environment = $environment;
     $this->mode = $this->config->get('easyblog_mode');
     $this->version = (string) EB::getLocalVersion();
     $this->baseUrl = EB::getBaseUrl();
     $this->token = EB::getToken();
     $this->inline = $this->config->get('inline_configuration');
     $this->enableCdn = $this->config->get('enable_cdn');
     $this->ajaxUrl = JURI::base() . '?option=com_easyblog';
     // If we should use http://site.com/index.php for the ajax calls, we need to append it here
     if ($this->config->get('ajax_use_index')) {
         $this->ajaxUrl = JURI::base() . 'index.php?option=com_easyblog';
     }
     parent::__construct();
 }
Esempio n. 2
0
 public function __construct()
 {
     if (defined('EASYBLOG_COMPONENT_CLI')) {
         $this->cli = true;
     }
     if ($this->cli) {
         $this->version = EASYBLOG_COMPONENT_VERSION;
     }
     if (!$this->cli) {
         $this->version = (string) EB::getLocalVersion();
     }
     $this->resourceManifestFile = EASYBLOG_RESOURCES . '/default-' . $this->version . '.json';
 }
Esempio n. 3
0
 /**
  * Main method to display the dashboard view.
  *
  * @since	4.0
  * @access	public
  * @return	null
  *
  * @author	Mark Lee <*****@*****.**>
  */
 public function versionChecks()
 {
     $localVersion = EB::getLocalVersion();
     // Get the online version from the server
     $onlineVersion = EB::getLatestVersion();
     $theme = EB::template();
     $theme->set('localVersion', $localVersion);
     $theme->set('onlineVersion', $onlineVersion);
     $contents = '';
     $state = version_compare($localVersion, $onlineVersion);
     $outdated = $state === -1;
     $file = $outdated ? 'version.outdated' : 'version.latest';
     // Version up to date
     $contents = $theme->output('admin/structure/' . $file);
     return $this->ajax->resolve($contents, $outdated, $localVersion, $onlineVersion);
 }
Esempio n. 4
0
 public function __construct()
 {
     $this->config = EB::config();
     $this->doc = JFactory::getDocument();
     // If environment is set to production, change to static.
     $environment = $this->config->get('easyblog_environment');
     if ($environment == 'production') {
         $environment = 'static';
     }
     $this->namespace = 'EASYBLOG';
     $this->shortName = 'eb';
     $this->environment = $environment;
     $this->mode = $this->config->get('easyblog_mode');
     $this->version = (string) EB::getLocalVersion();
     $this->baseUrl = EB::getBaseUrl();
     $this->token = EB::getToken();
     $this->inline = $this->config->get('inline_configuration');
     $this->enableCdn = $this->config->get('enable_cdn');
     parent::__construct();
 }
Esempio n. 5
0
 /**
  * Override parent's implementation
  *
  * @since	1.2
  * @access	public
  * @param	string
  * @return
  */
 public function display($tpl = null)
 {
     // Set the appropriate namespace
     $namespace = 'admin/' . $tpl;
     // Get the child contents
     $output = $this->theme->output($namespace);
     // Get the sidebar
     $sidebar = $this->getSidebar();
     // Determine if this is a tmpl view
     $tmpl = $this->input->get('tmpl', '', 'word');
     // Prepare the structure
     $theme = EB::getTemplate();
     // Get current version
     $version = EB::getLocalVersion();
     // Render a different structure prefix when tmpl=component
     $prefix = $tmpl == 'component' ? 'eb-window' : '';
     // Initialize all javascript frameworks
     EB::init('admin');
     // Collect all javascripts attached so that we can output them at the bottom of the page
     $scripts = EB::scripts()->getScripts();
     $theme->set('info', $this->info);
     $theme->set('prefix', $prefix);
     $theme->set('version', $version);
     $theme->set('heading', $this->heading);
     $theme->set('desc', $this->desc);
     $theme->set('output', $output);
     $theme->set('tmpl', $tmpl);
     $theme->set('sidebar', $sidebar);
     $theme->set('jscripts', $scripts);
     $contents = $theme->output('admin/structure/default');
     // If the toolbar registration exists, load it up
     if (method_exists($this, 'registerToolbar')) {
         $this->registerToolbar();
     }
     echo $contents;
 }