public function display($cachable = false, $urlparams = false) { require_once JPATH_COMPONENT . '/helpers/nivoslider.php'; $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::getCmd('view', $this->default_view); NivoSliderHelper::addSubmenu($currentView); parent::display(); return $this; }
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; }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { require_once JPATH_ADMINISTRATOR . "/components/com_nivoslider/helpers/nivoslider.php"; $arrSliders = NivoSliderHelper::getArrSliders(); $html = "<select id='{$this->id}_id' name='{$this->name}'>"; foreach ($arrSliders as $slider) { $title = $slider["title"]; $id = $slider["id"]; $selected = ""; $selectedID = $this->value; if (empty($selectedID)) { $selectedID = JRequest::getVar("sliderid"); } if ($id == $selectedID) { $selected = 'selected="selected"'; } $html .= "<option value='{$id}' {$selected}>{$title}</option>"; } $html .= "</select>"; return $html; }
<?php // No direct access. defined('_JEXEC') or die; JHtml::_('behavior.tooltip'); JHtml::_('behavior.formvalidation'); if (!empty($this->item->id)) { $urlEdit = NivoSliderHelper::getUrlItems($this->item->id); } ?> <script type="text/javascript"> Joomla.submitbutton = function(task) { if (task == 'slider.cancel' || document.formvalidator.isValid(document.id('slider-form'))) { Joomla.submitform(task, document.getElementById('slider-form')); } else { alert('<?php echo $this->escape(JText::_('COM_NIVOSLIDER_VALIDATION_FORM_FAILED')); ?> '); } } </script> <form action="<?php echo JRoute::_('index.php?option=com_nivoslider&layout=edit&id=' . (int) $this->item->id); ?> " method="post" name="adminForm" id="slider-form" class="form-validate"> <div class="width-60 fltlft">
/** * get items rewrited, add slider title to slide properties */ public function getItems() { $items = parent::getItems(); $arrSlidersAssoc = NivoSliderHelper::getArrSlidersAssoc(); foreach ($items as $key => $item) { if (!isset($arrSlidersAssoc[$item->sliderid])) { throw new Exception("Slider with id: {$item->sliderid} not found"); } $slider = $arrSlidersAssoc[$item->sliderid]; $items[$key]->slider_name = $slider["title"]; } return $items; }
<?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();
public static function getSlides($sliderID) { $slides = NivoSliderHelper::getArrSlides($sliderID); return $slides; }