예제 #1
0
 /**
  *
  * 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;
 }
예제 #2
0
 /**
  * 
  * add submenu
  */
 public static function addSubmenu($currentView, $currentLayout)
 {
     switch ($currentView) {
         default:
         case GlobalsUniteHCar::VIEW_SLIDER:
             $sliderID = JRequest::getVar("id");
             $isNew = empty($sliderID);
             //disable the menu on new slider
             if ($isNew == true) {
                 return false;
             }
             $viewSliderSettings = UniteFunctionJoomlaHCar::getViewUrl(GlobalsUniteHCar::VIEW_SLIDER, GlobalsUniteHCar::LAYOUT_SLIDER_GENERAL, "id=" . $sliderID);
             $viewSliderVisual = UniteFunctionJoomlaHCar::getViewUrl(GlobalsUniteHCar::VIEW_SLIDER, GlobalsUniteHCar::LAYOUT_SLIDER_VISUAL, "id=" . $sliderID);
             $viewSlides = UniteFunctionJoomlaHCar::getViewUrl(GlobalsUniteHCar::VIEW_ITEMS, "", "id=" . $sliderID);
             //slider settings:
             $selectedGeneral = $currentView == GlobalsUniteHCar::VIEW_SLIDER && $currentLayout == GlobalsUniteHCar::LAYOUT_SLIDER_GENERAL;
             $selectedVisual = $currentView == GlobalsUniteHCar::VIEW_SLIDER && $currentLayout == GlobalsUniteHCar::LAYOUT_SLIDER_VISUAL;
             $selectedSlides = $currentView == GlobalsUniteHCar::VIEW_ITEMS;
             JSubMenuHelper::addEntry(JText::_('COM_UNITEHCAROUSEL_GENERAL_SETTINGS'), $viewSliderSettings, $selectedGeneral);
             JSubMenuHelper::addEntry(JText::_('COM_UNITEHCAROUSEL_VISUAL_SETTINGS'), $viewSliderVisual, $selectedVisual);
             JSubMenuHelper::addEntry(JText::_('COM_UNITEHCAROUSEL_SLIDES'), $viewSlides, $selectedSlides);
             break;
         case GlobalsUniteHCar::VIEW_SLIDERS:
             //don't show menu at all.
             break;
     }
 }