0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: slider.php.tar
home/academiac/www/administrator/components/com_unitehcarousel/models/slider.php 0000604 00000004525 15137230726 0024432 0 ustar 00 <?php /** * @package Unite Horizontal Carousel for Joomla 1.7-2.5 * @author UniteCMS.net * @copyright (C) 2012 Unite CMS, All Rights Reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ // No direct access defined('_JEXEC') or die; jimport('joomla.application.component.modeladmin'); class UniteHCarouselModelSlider extends UniteHCarModel{ public function getTable($type = 'Sliders', $prefix = 'UniteHCarouselTable', $config = array()) { $table = JTable::getInstance($type, $prefix, $config); return $table; } /** * * get item override */ public function getItem($pk = null){ $item = parent::getItem($pk); if(property_exists($item, "visual") && is_array($item->visual) == false){ $registry = new JRegistry(); $registry->loadString($item->visual,'JSON'); $item->visual = $registry->toArray(); } return($item); } /** * * get the form */ public function getForm($data = array(), $loadData = true) { jimport('joomla.form.form'); // Get the form. $form = $this->loadForm('com_unitehcarousel.slider', 'slider', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } return $form; } /** * * load the form data */ protected function loadFormData() { // Check the session for previously entered form data. $data = JFactory::getApplication()->getUserState('com_unitehcarousel.edit.slider.data', array()); if (empty($data)) { $data = $this->getItem(); } return $data; } /** * * prepare table for saving */ protected function prepareTableReal(&$table) { jimport('joomla.filter.output'); $date = JFactory::getDate(); $user = JFactory::getUser(); $table->title = htmlspecialchars_decode($table->title, ENT_QUOTES); $table->alias = JApplication::stringURLSafe($table->alias); if (empty($table->alias)) { $table->alias = JApplication::stringURLSafe($table->title); } if (empty($table->id)) { // Set ordering to the last item if not set if (empty($table->ordering)) { $db = JFactory::getDbo(); $db->setQuery('SELECT MAX(ordering) FROM #__unitehcarousel_sliders'); $max = $db->loadResult(); $table->ordering = $max+1; } } } } home/academiac/www/administrator/components/com_unitehcarousel/models/fields/slider.php 0000604 00000003165 15137237027 0025700 0 ustar 00 <?php /** * @package Unite Horizontal Carousel for Joomla 1.7-2.5 * @author UniteCMS.net * @copyright (C) 2012 Unite CMS, All Rights Reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ defined('JPATH_BASE') or die; /** * Supports a modal article picker. * * @package Joomla.Administrator * @subpackage com_content * @since 1.6 */ class JFormFieldSlider extends JFormField { /** * The form field type. * * @var string * @since 1.6 */ protected $type = 'Slider'; /** * * include all the files needed */ protected function requireFramework(){ $currentDir = dirname(__FILE__); $pathBase = $currentDir."/../../"; $pathBase = realpath($pathBase)."/"; $pathHelpers = $pathBase."helpers/"; require_once($pathHelpers."helper.class.php"); require_once($pathHelpers."globals.class.php"); require_once($pathBase."/unitejoomla/includes.php"); GlobalsUniteHCar::init(); } /** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { $this->requireFramework(); $arrSliders = HelperUniteHCar::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; } } home/academiac/www/administrator/components/com_unitehcarousel/controllers/slider.php 0000604 00000001523 15137500324 0025502 0 ustar 00 <?php /** * @package Unite Horizontal Carousel for Joomla 1.7-2.5 * @author UniteCMS.net * @copyright (C) 2012 Unite CMS, All Rights Reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ // No direct access defined('_JEXEC') or die; jimport('joomla.application.component.controllerform'); class UniteHCarouselControllerSlider extends JControllerForm { /** * * bypass direct saving restrictions */ private function holdID(){ $context = "$this->option.edit.$this->context"; $recordId = JRequest::getInt("id"); $this->holdEditId($context, $recordId); } public function save($key=null, $urlVar=null){ $this->holdID(); return parent::save($key,$urlVar); } public function cancel($key=null){ $this->holdID(); return parent::cancel($key); } } ?>