Ejemplo n.º 1
0
 public function __construct()
 {
     $this->my = JFactory::getUser();
     $this->config = EB::config();
     $this->app = JFactory::getApplication();
     $this->input = EB::request();
 }
Ejemplo n.º 2
0
 public function __construct($location, $name = null, $useOverride = false)
 {
     static $defaultWorkspace;
     $this->app = JFactory::getApplication();
     $this->input = EB::request();
     $this->config = EB::config();
     $this->doc = JFactory::getDocument();
     // Determines if this is a module section
     if ($location == 'module') {
         $this->isModule = true;
         $location = 'site';
     }
     if (!isset($defaultWorkspace)) {
         $override = $this->app->getTemplate();
         $defaultWorkspace = array('site' => strtolower($this->config->get('theme_site')), 'site_base' => strtolower($this->config->get('theme_site_base')), 'admin' => strtolower($this->config->get('theme_admin')), 'admin_base' => strtolower($this->config->get('theme_admin_base')), 'module' => null, 'override' => $override);
     }
     $this->workspace = $defaultWorkspace;
     $workspace = array();
     // Internally, override is a location.
     if ($useOverride) {
         $location = 'override';
     }
     // For specific template, else default template will be used.
     if (!empty($name)) {
         $workspace[$location] = $name;
     }
     // Because we can't do late static binding on PHP < 5.3.
     // Used by $this->override() method.
     $this->class = __CLASS__;
     parent::__construct('EASYBLOG', $workspace, $location);
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     $this->config = EB::config();
     $this->app = JFactory::getApplication();
     $this->input = EB::request();
     // Determines if the current request is for debug
     $this->debug = $this->input->get('debug', false, 'bool');
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     $this->app = JFactory::getApplication();
     $this->input = EB::request();
     $config = EB::config();
     $key = $config->get('integrations_flickr_api_key');
     $secret = $config->get('integrations_flickr_secret_key');
     parent::__construct($key, $secret);
 }
Ejemplo n.º 5
0
 public function __construct(&$items, $cache = true)
 {
     $this->items = $items;
     $this->cache = $cache;
     $this->my = JFactory::getUser();
     $this->config = EB::config();
     $this->app = JFactory::getApplication();
     $this->input = EB::request();
     $this->limitstart = $this->input->get('limitstart', 0, 'int');
 }
Ejemplo n.º 6
0
 public function __construct()
 {
     $this->my = JFactory::getUser();
     $this->app = JFactory::getApplication();
     $this->input = EB::request();
     $this->acl = EB::acl();
     $this->config = EB::config();
     // Set the user project
     $this->user = EB::user($this->my->id);
 }
Ejemplo n.º 7
0
 public function __construct()
 {
     // Get the config object
     $this->config = EB::config();
     // Get app settings
     $this->app = JFactory::getApplication();
     $this->input = EB::request();
     // Assign the key and secret
     $this->key = $this->config->get('amazon_key');
     $this->secret = $this->config->get('amazon_secret');
 }
Ejemplo n.º 8
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->app = JFactory::getApplication();
     $this->input = EB::request();
     $this->doc = JFactory::getDocument();
     $this->config = EB::config();
     $this->my = JFactory::getUser();
     $this->info = EB::info();
     if ($this->doc->getType() == 'ajax') {
         $this->ajax = EB::ajax();
     }
 }
Ejemplo n.º 9
0
 public function __construct()
 {
     $this->config = EB::getConfig();
     $this->jconfig = JFactory::getConfig();
     $this->app = JFactory::getApplication();
     $this->doc = JFactory::getDocument();
     $this->my = JFactory::getUser();
     $this->input = EB::request();
     $this->info = EB::info();
     $this->theme = EB::getTemplate(null, array('view' => $this, 'admin' => true));
     if ($this->doc->getType() == 'ajax') {
         $this->ajax = EB::ajax();
     }
     parent::__construct();
 }
Ejemplo n.º 10
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();
 }
Ejemplo n.º 11
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();
 }
Ejemplo n.º 12
0
 public function __construct()
 {
     $this->jConfig = EB::jConfig();
     $this->app = JFactory::getApplication();
     $this->input = EB::request();
     $this->config = EB::config();
     $this->apiKey = $this->config->get('integrations_facebook_api_key');
     $this->apiSecret = $this->config->get('integrations_facebook_secret_key');
     // Default redirection url
     $this->redirect = rtrim(JURI::root(), '/') . '/administrator/index.php?option=com_easyblog&task=facebook.grant';
     // Determines if there's a "system" in the url
     $system = $this->input->get('system', false, 'bool');
     if ($system) {
         $this->redirect .= '&system=1';
     }
     // Determines if there's a "userId" in the url
     $userId = $this->input->get('userId', null, 'default');
     if ($userId) {
         $this->redirect .= '&userId=' . $userId;
     }
     parent::__construct(array('appId' => $this->apiKey, 'secret' => $this->apiSecret));
 }
Ejemplo n.º 13
0
 /**
  * Renders publish / unpublish icon.
  *
  * @since	1.0
  * @access	public
  * @param	object	The object to check against.
  * @param	string	The controller to be called.
  * @param	string	The key for the object.
  * @param	Array	An optional array of tasks
  * @param	Array	An optional array of tooltips
  * @param   boolean An optional boolean of enforce disabled state
  *
  * @author	Mark Lee <*****@*****.**>
  */
 public static function published($obj, $controllerName = '', $key = '', $tasks = array(), $tooltip = array(), $disabled = false)
 {
     $input = EB::request();
     $view = $input->get('view', '', 'cmd');
     $layout = $input->get('layout', '', 'cmd');
     // If primary key is not provided, then we assume that we should use 'state' as the key property.
     $key = !empty($key) ? $key : 'state';
     $publishTask = isset($tasks[0]) ? $tasks[0] : $controllerName . '.publish';
     $unpublishTask = isset($tasks[1]) ? $tasks[1] : $controllerName . '.unpublish';
     $allowed = $disabled ? false : true;
     switch ($obj->{$key}) {
         case '2':
         case EASYBLOG_POST_SCHEDULED:
             $class = 'scheduled';
             $tooltip = JText::_('COM_EASYBLOG_SCHEDULED');
             $allowed = false;
             if ($view == 'blogs' && $layout == 'templates') {
                 $class = 'unpublish';
                 $tooltip = JText::_('COM_EASYBLOG_GRID_BLANK_TEMPLATE');
             }
             break;
         case EASYBLOG_POST_DRAFT:
             $class = 'draft';
             $tooltip = JText::_('COM_EASYBLOG_DRAFT');
             $allowed = false;
             break;
         case EASYBLOG_POST_ARCHIVED:
             $class = 'archived';
             $tooltip = JText::_('COM_EASYBLOG_GRID_TOOLTIP_ARCHIVED');
             $allowed = false;
             break;
         case EASYBLOG_POST_PUBLISHED:
             $class = 'publish';
             $tooltip = isset($tooltip[1]) ? $tooltip[1] : 'COM_EASYBLOG_GRID_TOOLTIP_PUBLISH';
             break;
         case EASYBLOG_POST_UNPUBLISHED:
             $class = 'unpublish';
             $tooltip = isset($tooltip[0]) ? $tooltip[0] : 'COM_EASYBLOG_GRID_TOOLTIP_UNPUBLISH';
             break;
         case EASYBLOG_POST_TRASHED:
             $class = 'trash';
             $tooltip = JText::_('COM_EASYBLOG_TRASHED');
             break;
     }
     if (is_array($tooltip)) {
         $tooltip = '';
     }
     if (is_string($tooltip) && !empty($tooltip)) {
         $tooltip = JText::_($tooltip);
     }
     $task = $obj->{$key} ? $unpublishTask : $publishTask;
     $theme = EB::getTemplate();
     $theme->set('allowed', $allowed);
     $theme->set('tooltip', $tooltip);
     $theme->set('task', $task);
     $theme->set('class', $class);
     return $theme->output('admin/html/grid.published');
 }
* @copyright	Copyright (C) 2010 - 2015 Stack Ideas Sdn Bhd. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* EasyBlog is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
jimport('joomla.filesystem.file');
$engine = JPATH_ADMINISTRATOR . '/components/com_easyblog/includes/easyblog.php';
if (!JFile::exists($engine)) {
    return;
}
require_once $engine;
$input = EB::request();
$option = $input->get('option', '', 'cmd');
$view = $input->get('view', '', 'cmd');
$id = $input->get('id', 0, 'int');
// Allowed views
$allowed = array('entry', 'categories', 'teamblog');
if ($option != 'com_easyblog') {
    return;
}
if (!in_array($view, $allowed)) {
    return;
}
if (!$id) {
    return;
}
$type = 'entry';