/** * * display some view */ public function display($cachable = false, $urlparams = false) { $urlAssets = GlobalsUniteHCar::$urlAssets; $isJoomla3 = UniteFunctionsHCar::isJoomla3(); if ($isJoomla3) { JHtml::_('bootstrap.framework'); } //add style $document = JFactory::getDocument(); $document->addStyleSheet($urlAssets . "style.css"); //add jquery //$document->addScript("http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"); //add jquery ui //$document->addScript("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"); $document->addStyleSheet($urlAssets . "jui/jquery-ui-1.8.19.custom.css"); //add custom scripts if ($isJoomla3 == false) { $document->addScript($urlAssets . "jquery.min.js"); } $document->addScript($urlAssets . "jquery-ui.min.js"); $document->addScript($urlAssets . "admin.js"); $document->addScript($urlAssets . "hcarousel.js"); //add ajax url: $currentView = JRequest::getVar('view', $this->default_view); $ajaxUrl = UniteFunctionJoomlaHCar::getViewUrl($currentView, "ajax"); $document->addScriptDeclaration("var g_urlAjax='{$ajaxUrl}';"); if ($isJoomla3) { $document->addStyleSheet($urlAssets . "style-joomla3.css?app=hcarousel"); } parent::display(); return $this; }
<?php /** * @package Unite Horizontal Carousel for Joomla 1.7-2.5 * @version 1.0 * @author UniteCMS.net * @copyright (C) 2012- Unite CMS * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ // no direct access defined('_JEXEC') or die('Restricted access'); require_once JPATH_ADMINISTRATOR . "/components/com_unitehcarousel/includes.php"; //error_reporting(E_ALL); // debug // Include dependancies jimport('joomla.application.component.controller'); if (UniteFunctionsHCar::isJoomla3()) { $controller = JControllerLegacy::getInstance(GlobalsUniteHCar::EXTENSION_NAME); } else { $controller = JController::getInstance(GlobalsUniteHCar::EXTENSION_NAME); } // Perform the Request task $task = JRequest::getVar('task'); $controller->execute($task); $controller->redirect();
<?php /** * @package Unite Horizontal Carousel for Joomla 1.7-2.5 * @version 1.0.0 * @author UniteCMS.net * @copyright (C) 2012- Unite CMS * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html * */ // no direct access defined('_JEXEC') or die('Restricted access'); $currentDir = dirname(__FILE__) . "/"; require_once $currentDir . "helpers/globals.class.php"; require_once $currentDir . "helpers/helper.class.php"; require_once $currentDir . "helpers/output.class.php"; require_once $currentDir . "unitejoomla/includes.php"; $isJoomla3 = UniteFunctionsHCar::isJoomla3(); if ($isJoomla3) { require_once dirname(__FILE__) . "/models/model_joomla3.php"; } else { //joomla 2.5 require_once dirname(__FILE__) . "/models/model_joomla2.php"; } //init the globals GlobalsUniteHCar::init(); UniteFunctionJoomlaHCar::$componentName = GlobalsUniteHCar::COMPONENT_NAME;