Example #1
0
 /**
  * @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&aacute;s im&aacute;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;
 }
Example #2
0
 /**
  * @brief Crea el arreglo con el area del preview de la imagen.
  * @param bool $visible Indica si es visible o no el elemento
  * @return bool;
  */
 function getAreaPreviewImage($visible)
 {
     $confarea = array('style' => 'width: ' . $this->rotator->width . 'px; height: ' . $this->rotator->height . 'px; overflow: hidden;');
     if ($visible) {
         $area = RotatorHelper::areaThumbnail('preview', $confarea);
         $area .= '<div class="qq-upload-button save-image" style="display:none;">Seleccionar</div>';
         return array('title' => JText::_('IMAGE_FINAL'), 'html' => $area);
     } else {
         $image = JRequest::getVar('seeImage', '', 'post');
         $thumb = JRequest::getVar('seeThumb', '', 'post');
         $confarea = array_merge($confarea, array('img' => $image));
         $area = AmadeusUtilHtml::inputHidden('image', array('value' => $image));
         if ($this->rotator->thumb) {
             $config = array('thumb' => array('width' => $this->rotator->twidth, 'height' => $this->rotator->theight), 'aspectratio' => 'ratio', 'preview' => 'preview');
             $area .= '<table class="banner-thumb" width="100%"><tr><td width="60%">Banner</td>';
             $area .= '<td>Thumb</td></tr><tr><td class="img-banner">';
             $area .= RotatorHelper::areaThumbnail('preview', $confarea) . '</td>';
             $area .= '<td><div id="preview-thumb" class="preview-img" ';
             $area .= 'style="height:' . $this->rotator->theight . 'px;';
             $area .= 'width:' . $this->rotator->twidth . 'px;overflow:hidden;">';
             $area .= '<img src="' . $thumb . '" width="' . $this->rotator->twidth . '"';
             $area .= ' height="' . $this->rotator->theight . '" />';
             $area .= '</div></td></tr>';
             $area .= '<tr><td colspan="2">';
             $area .= '<div class="d-ratio">';
             $area .= AmadeusUtilHtml::checkButton('ratio', array('1' => '<b>Selecci&oacute;n proporcional</b>'), array('value' => '1'));
             $area .= '</div></td></tr></table>';
             $area .= RotatorHelper::doJcrop('image', $config);
         } else {
             $area .= RotatorHelper::areaThumbnail('preview', $confarea) . '</td>';
         }
         return array('title' => JText::_('IMAGE_FINAL'), 'html' => $area);
     }
 }