Example #1
0
 function __construct($config = array())
 {
     // RokGallery image picker proxying:
     if (JFactory::getApplication()->input->get('view') === 'candymacros' & JFactory::getApplication()->input->get('layout') === 'list') {
         JHtml::_('stylesheet', 'system/adminlist.css', array(), true);
         $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR;
     } elseif (JFactory::getApplication()->input->get('view') === 'candymacros' & JFactory::getApplication()->input->get('layout') === 'default') {
         JHtml::_('stylesheet', 'system/adminlist.css', array(), true);
         $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR;
     }
     parent::__construct($config);
 }
Example #2
0
 public function display($cachable = false, $urlparams = false)
 {
     require_once JPATH_COMPONENT . '/helpers/rokcandy.php';
     $jinput = JFactory::getApplication()->input;
     // Load the submenu.
     RokCandyHelper::addSubmenu($jinput->get('view', 'candymacros'));
     $view = $jinput->get('view', 'candymacros');
     $layout = $jinput->get('layout', 'default');
     $id = $jinput->get('id', '', 'int');
     // Check for edit form.
     if ($view == 'candymacro' && $layout == 'edit' && !$this->checkEditId('com_rokcandy.edit.candymacro', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_rokcandy&view=candymacros', false));
         return false;
     }
     parent::display();
     return $this;
 }
Example #3
0
<?php

/**
 * @version $Id: rokcandy.php 5112 2012-11-08 23:59:29Z btowles $
 * @author RocketTheme, LLC http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 */
// no direct access
defined('_JEXEC') or die;
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_rokcandy')) {
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
// Include dependancies
jimport('joomla.application.component.controller');
include_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/legacy_class.php';
$controller = RokCandyLegacyJController::getInstance('rokcandy');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();