Exemple #1
0
 /**
  * Constructor
  *
  * Presets all variables
  *
  * @access  protected
  * @return  void
  * @since   1.5.5
  */
 function __construct()
 {
     jimport('joomla.filesystem.folder');
     $config = JoomConfig::getInstance();
     $mainframe = JFactory::getApplication('administrator');
     // Fill all variables
     $this->icon_url = JURI::root() . 'media/joomgallery/images/';
     $this->css_url = JURI::root() . 'media/joomgallery/css/';
     $this->js_url = JURI::root() . 'media/joomgallery/js/';
     $this->_external['thumb'] = false;
     $this->thumb_url = JURI::root() . $config->get('jg_paththumbs');
     $this->thumb_path = JPath::clean(JPATH_ROOT . '/' . $config->get('jg_paththumbs'));
     if (!JFolder::exists($this->thumb_path)) {
         $this->_external['thumb'] = true;
         $this->thumb_url = '';
         $this->thumb_path = JPath::clean($config->get('jg_paththumbs'));
     }
     $this->_external['img'] = false;
     $this->img_url = JURI::root() . $config->get('jg_pathimages');
     $this->img_path = JPath::clean(JPATH_ROOT . '/' . $config->get('jg_pathimages'));
     if (!JFolder::exists($this->img_path)) {
         $this->_external['img'] = true;
         $this->img_url = '';
         $this->img_path = JPath::clean($config->get('jg_pathimages'));
     }
     $this->_external['orig'] = false;
     $this->orig_url = JURI::root() . $config->get('jg_pathoriginalimages');
     $this->orig_path = JPath::clean(JPATH_ROOT . '/' . $config->get('jg_pathoriginalimages'));
     if (!JFolder::exists($this->orig_path)) {
         $this->_external['orig'] = true;
         $this->orig_url = '';
         $this->orig_path = JPath::clean($config->get('jg_pathoriginalimages'));
     }
     $this->temp_path = JPath::clean(JPATH_ROOT . '/' . $config->get('jg_pathtemp'));
     if (!JFolder::exists($this->temp_path)) {
         $this->temp_path = JPath::clean($config->get('jg_pathtemp'));
     }
     $this->ftp_path = JPath::clean(JPATH_ROOT . '/' . $config->get('jg_pathftpupload'));
     if (!JFolder::exists($this->ftp_path)) {
         $this->ftp_path = JPath::clean($config->get('jg_pathftpupload'));
     }
     $this->wtm_path = JPath::clean(JPATH_ROOT . '/' . $config->get('jg_wmpath'));
     if (!JFolder::exists($this->wtm_path)) {
         $this->wtm_path = JPath::clean($config->get('jg_wmpath'));
     }
     if (!($this->version = $mainframe->getUserState('joom.version.string'))) {
         $this->version = JoomExtensions::getGalleryVersion();
         $mainframe->setUserState('joom.version.string', $this->version);
     }
 }