Esempio n. 1
0
 /**
  * @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;
 }
Esempio n. 2
0
 /**
  * @brief Obtiene la configuración de los campos a ser desplegados
  * en el formulario.
  * @return array
  */
 function getFields()
 {
     jimport('Amadeus.Util.Html');
     $disabled = array();
     $size = array('size' => 40);
     $size2 = array('size' => 7);
     if ($this->task == 'edit') {
         $disabled = array('disabled' => 'disabled', 'class' => 'disabled');
     }
     $st_thumbs = array('disabled' => 'disabled', 'class' => 'disabled');
     $thumb = JRequest::getVar('thumb', '0', 'post');
     if (($this->task == 'apply' || $this->task == 'save') && $thumb == '1') {
         $st_thumbs = array();
     }
     $size2 = array_merge($size2, $disabled);
     $configth = array_merge($size2, $st_thumbs);
     $confthumb = array('onchange' => 'document.adminForm.twidth.disabled = this.value=="0"; document.adminForm.theight.disabled = this.value=="0";');
     $confthumb = array_merge($confthumb, $disabled);
     $_fields = array(array('title' => JText::_('GENERAL_CONFIGURATION'), 'fields' => array('id' => array('hidden' => true, 'type' => 'integer', 'html' => AmadeusUtilHtml::inputHidden('id', array('value' => 0))), 'nombre' => array('label' => JText::_('LABELNAME'), 'tooltip' => JText::_('TOOLTIPNAME'), 'type' => 'string', 'html' => AmadeusUtilHtml::inputText('nombre', $size)), 'class' => array('label' => JText::_('LABELCLASS'), 'tooltip' => JText::_('TOOLTIPCLASS'), 'type' => 'string', 'html' => AmadeusUtilHtml::inputText('class', $size)), '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('value' => 1))))), array('title' => JText::_('LOOK_CONFIGURATION'), 'fields' => array('thumb' => array('label' => JText::_('LABELTHUMB'), 'tooltip' => JText::_('TOOLTIPTHUMB'), 'type' => 'include', 'include' => array('1', '0'), 'html' => AmadeusUtilHtml::radioButton('thumb', array(0 => JText::_('JNO'), 1 => JText::_('JYES')), array_merge(array('value' => 0), $confthumb))), 'twidth' => array('label' => JText::_('LABELTWIDTH'), 'tooltip' => JText::_('TOOLTIPTWIDTH'), 'type' => 'integer', 'html' => AmadeusUtilHtml::inputText('twidth', $configth) . '&nbsp;&nbsp;px'), 'theight' => array('label' => JText::_('LABELTHEIGHT'), 'tooltip' => JText::_('TOOLTIPTHEIGHT'), 'type' => 'integer', 'html' => AmadeusUtilHtml::inputText('theight', $configth) . '&nbsp;&nbsp;px'), 'width' => array('label' => JText::_('LABELWIDTH'), 'tooltip' => JText::_('TOOLTIPWIDTH'), 'type' => 'integer', 'html' => AmadeusUtilHtml::inputText('width', $size2) . '&nbsp;&nbsp;px'), 'height' => array('label' => JText::_('LABELHEIGHT'), 'tooltip' => JText::_('TOOLTIPHEIGHT'), 'type' => 'integer', 'html' => AmadeusUtilHtml::inputText('height', $size2) . '&nbsp;&nbsp;px'))), array('title' => JText::_('CSS'), 'html' => AmadeusUtilHtml::inputArea('css', array('style' => 'width:99%', 'rows' => 20)), 'fields' => array('css' => array('label' => JText::_('LABELCSS'), 'type' => 'raw'))));
     return $_fields;
 }