Example #1
0
 /**
  * Returns the list of sizes from the current theme or overrides.
  *
  * @access	public
  * @param	null
  * @return	Array	An array containing size information.
  */
 public function getSizes()
 {
     jimport('joomla.filesystem.file');
     $theme = new CodeThemes();
     // @task: Retrieve the list of defined sizes in the template overrides.
     $template = JFactory::getApplication()->getTemplate();
     $file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'image.ini';
     $this->setSize($this->readSize($file), $template);
     // Set the active theme to the template's name first.
     $this->activeTheme = $template;
     // If override exists, we just stick to theirs
     if (!JFile::exists($file)) {
         // @task: We still need to generate images from the default theme.
         $file = dirname($theme->getPath()) . DIRECTORY_SEPARATOR . 'default' . DIRECTORY_SEPARATOR . 'image.ini';
         $this->setSize($this->readSize($file), 'default');
         // Set the active theme to the template's name first.
         $this->activeTheme = 'default';
         // @task: Retrieve the list of defined sizes in the current theme.
         if ($theme->getName() != 'default') {
             $file = $theme->getPath() . DIRECTORY_SEPARATOR . 'image.ini';
             if (JFile::exists($file)) {
                 $this->setSize($this->readSize($file), $theme->getName());
                 $this->activeTheme = $theme->getName();
             } else {
                 // If the current theme doesn't have any image.ini, we assume to use the default one.
                 $this->activeTheme = 'default';
             }
         }
     }
     return $this->customSizes;
 }