/** * @brief Coloca los recursos externos, que permiten el funcionamiento del * rotador. * @param object $rotator Objeto que representa el rotador */ function putResource(&$rotator) { jimport('Amadeus.Util.Html'); AmadeusUtilHtml::includeResource('/modules/mod_rotator/js/jquery.nivo.slider.pack.js'); AmadeusUtilHtml::includeResource('/modules/mod_rotator/css/nivo-slider.css'); $document =& JFactory::getDocument(); $document->addStyleDeclaration($rotator->css); }
/** * @brief Obtiene la configuración de los campos a ser desplegados * en el formulario. * @return array */ function getFields() { jimport('Amadeus.Util.Html'); AmadeusUtilHtml::includeResource('/administrator/components/com_rotator/css/fileuploader.css'); require_once JPATH_COMPONENT . DS . 'helper.php'; $content = '<div style="font-size: 12px; font-weight: bold;padding: 2px 0 10px 20px;">'; $content .= 'Seleccione un rotador para agregarle más imágenes o banners:</div>'; $content .= RotatorHelper::listRotators('index.php?' . $this->getAction() . '&task=add&step=add'); $_fields = array(array('title' => JText::_('ALL_ROTATOR'), 'html' => $content)); return $_fields; }
/** * @brief Obtiene la configuración de los campos a ser desplegados * en el formulario. * @return array */ function getFields() { jimport('Amadeus.Util.Html'); require_once JPATH_COMPONENT . DS . 'helper.php'; $visible = false; if ($this->task == 'add') { $visible = true; } $disabled = array(); if ($visible) { $disabled = array('disabled' => 'disabled'); } AmadeusUtilHtml::includeResource('/administrator/components/com_rotator/js/jquery.Jcrop.min.js'); AmadeusUtilHtml::includeResource('/administrator/components/com_rotator/js/fileuploader.min.js'); AmadeusUtilHtml::includeResource('/administrator/components/com_rotator/css/fileuploader.min.css'); AmadeusUtilHtml::includeResource('/administrator/components/com_rotator/css/jquery.Jcrop.min.css'); jimport('Amadeus.Util.Database'); $orden = AmadeusUtilDataBase::countData('am_banners', 'rotator = ' . $this->rotator->id) + 1; $_fields = array(array('html' => '<h2 class="main-title">' . $this->rotator->nombre . '</h2>'), $this->getAreaUploadImages($visible), $this->getAreaPreviewImage($visible), array('title' => JText::_('GENERAL_INFORMATION'), 'fields' => array('id' => array('hidden' => true, 'type' => 'integer', 'html' => AmadeusUtilHtml::inputHidden('id', array('value' => 0)) . '<input name="step" type="hidden" value="error" />'), 'rotator' => array('hidden' => true, 'type' => 'integer', 'html' => AmadeusUtilHtml::inputHidden('rotator', array('value' => $this->rotator->id))), 'title' => array('label' => JText::_('LABELTITLE'), 'tooltip' => JText::_('TOOLTIPTITLE'), 'type' => 'string', 'html' => AmadeusUtilHtml::inputText('title', array_merge(array('size' => 60), $disabled))), 'button' => array('label' => JText::_('LABELBUTTON'), 'tooltip' => JText::_('TOOLTIPBUTTON'), 'type' => 'string', 'mandatory' => false, 'html' => AmadeusUtilHtml::inputText('button', $disabled)), 'link' => array('label' => JText::_('LABELLINK'), 'tooltip' => JText::_('TOOLTIPLINK'), 'type' => 'string', 'html' => AmadeusUtilHtml::inputText('link', array_merge(array('size' => 60), $disabled))), 'orden' => array('label' => JText::_('LABELORDEN'), 'tooltip' => JText::_('TOOLTIPORDEN'), 'type' => 'integer', 'html' => AmadeusUtilHtml::inputText('orden', array_merge(array('size' => '10', 'value' => $orden), $disabled))), 'published' => array('label' => JText::_('LABELPUBLISHED'), 'tooltip' => JText::_('TOOLTIPPUBLISHED'), 'type' => 'include', 'include' => array('1', '0'), 'html' => AmadeusUtilHtml::radioButton('published', array(0 => JText::_('UNPUBLISH'), 1 => JText::_('PUBLISH')), array_merge(array('value' => 1), $disabled))))), array('title' => JText::_('BANNER_INFORMATION'), 'fields' => array('description' => array('label' => JText::_('LABELDESCRIPTION'), 'tooltip' => JText::_('TOOLTIPDESCRIPTION'), 'type' => 'raw', 'html' => AmadeusUtilHtml::inputArea('description', array_merge(array('rows' => 10, 'cols' => 40, 'raw' => true), $disabled)))))); return $_fields; }