Esempio n. 1
0
 /**
  * Support Zip files for image galleries 
  * @see TiendaFile::upload()
  */
 function upload()
 {
     if ($result = parent::upload()) {
         // Check if it's a supported archive
         $allowed_archives = array('zip', 'tar', 'tgz', 'gz', 'gzip', 'tbz2', 'bz2', 'bzip2');
         if (in_array(strtolower($this->getExtension()), $allowed_archives)) {
             $dir = $this->getDirectory();
             jimport('joomla.filesystem.archive');
             JArchive::extract($this->full_path, $dir);
             JFile::delete($this->full_path);
             $this->is_archive = true;
             $files = JFolder::files($dir);
             // Thumbnails support
             if (count($files)) {
                 // Name correction
                 foreach ($files as &$file) {
                     $file = new TiendaImage($dir . '/' . $file);
                 }
                 $this->archive_files = $files;
                 $this->physicalname = $files[0]->getPhysicalname();
             }
         }
     }
     return $result;
 }
Esempio n. 2
0
 /**
  *
  * @param $tpl
  * @return unknown_type
  */
 function getLayoutVars($tpl = null)
 {
     $app = JFactory::getApplication();
     $layout = $this->getLayout();
     $this->renderSubmenu();
     switch (strtolower($layout)) {
         case "gallery":
         case "setquantities":
         case "selectcategories":
             $this->_default($tpl);
             break;
         case "view":
             $this->_form($tpl);
             break;
         case "form_relations":
         case "form":
             $app->input->set('hidemainmenu', '1');
             DSCImage::loadUploadify();
             $this->_form($tpl);
             break;
         case "default":
         default:
             $this->set('leftMenu', 'leftmenu_catalog');
             $this->_default($tpl);
             break;
     }
 }
Esempio n. 3
0
 /**
  * 
  * @param $tpl
  * @return unknown_type
  */
 function getLayoutVars($tpl = null)
 {
     $layout = $this->getLayout();
     switch (strtolower($layout)) {
         case "gallery":
         case "setquantities":
         case "selectcategories":
             $this->_default($tpl);
             break;
         case "view":
             $this->_form($tpl);
             break;
         case "form_relations":
         case "form":
             JRequest::setVar('hidemainmenu', '1');
             DSCImage::loadUploadify();
             $this->_form($tpl);
             break;
         case "default":
         default:
             $this->set('leftMenu', 'leftmenu_catalog');
             $this->_default($tpl);
             break;
     }
 }