public function display($cachable = false, $urlparams = false) { $urlAssets = "components/com_nivoslider/assets/"; //add style $document = JFactory::getDocument(); $document->addStyleSheet($urlAssets . "style.css"); $document->addScript("http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"); //TODO: remove the js func //$document->addScript($urlAssets."jsfunc.js"); $currentView = JRequest::getVar('view', $this->default_view); if ($currentView == $this->default_view || $currentView == 'items') { NivoSliderHelper::addSubmenu($currentView); } if (NivoSliderHelper::isJoomla3()) { $document->addStyleSheet($urlAssets . "style-joomla3.css"); } parent::display(); return $this; }
<?php /** * @package Unite Nivo Slider for Joomla 1.7-2.5 * @version 1.0.0 * @author UniteJoomla.com * @copyright (C) 2012- Unite Joomla * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ // no direct access defined('_JEXEC') or die('Restricted access'); //error_reporting(E_ALL); // debug require_once JPATH_COMPONENT . '/helpers/nivoslider.php'; require_once JPATH_COMPONENT . '/helpers/class.php'; // Include dependancies jimport('joomla.application.component.controller'); if (NivoSliderHelper::isJoomla3()) { $controller = JControllerLegacy::getInstance('nivoslider'); } else { $controller = JController::getInstance('nivoslider'); } // Perform the Request task $task = JRequest::getVar('task'); $controller->execute($task); $controller->redirect();