Example #1
0
 function _setConfig()
 {
     global $_DOCMAN;
     // Get the configuartion object
     require_once $this->path . "themeConfig.php";
     $this->setError('docman');
     $theme = new StdClass();
     $theme->conf =& new themeConfig();
     $theme->name = $this->name;
     $theme->path = $_DOCMAN->getPath('themes', $this->name, 1);
     $theme->icon = DOCMAN_Utils::pathIcon(null, 1);
     $theme->png = DOCMAN_Utils::supportPng();
     $this->theme =& $theme;
 }
Example #2
0
 /**
  * @param string  $ The icon name (ex. 'zip.png')
  * @param boolean $ The path type, live (1), absolute (2)
  * @param string  $ Image size
  * @param boolean $ The browser supports png alpha transparency
  * @return string the icon path
  **/
 function pathIcon($icon, $type = null, $size = null)
 {
     global $_DOCMAN, $mosConfig_live_site, $mosConfig_absolute_path;
     $icon_path = "components/com_docman/themes/" . $_DOCMAN->getCfg('icon_theme') . "/images/icons/";
     // set icon size
     if (!isset($size)) {
         $icon_path .= $_DOCMAN->getCfg('icon_size') ? "32x32/" : "16x16/";
     } else {
         $icon_path .= $size . "/";
     }
     // set path type
     $path_type = '';
     switch ($type) {
         case 1:
             $path_type = $mosConfig_live_site . "/";
             break;
         case 2:
             $path_type = $mosConfig_absolute_path . "/";
             break;
         default:
             break;
     }
     // Check for a version without PNG transparency if needed
     $png = DOCMAN_Utils::supportPng();
     // check file existances
     $no_alpha = file_exists($mosConfig_absolute_path . '/' . $icon_path . 'no_alpha/' . $icon);
     $no_alphagen = file_exists($mosConfig_absolute_path . '/' . $icon_path . 'no_alpha/generic.png');
     $normal = file_exists($mosConfig_absolute_path . '/' . $icon_path . $icon);
     // choose the icon to use, either the non-alpha version, the normal one or generic icon
     if ($png) {
         if ($normal) {
             //do nothing
         } else {
             $icon = 'generic.png';
         }
     } else {
         if ($no_alpha) {
             $icon_path .= 'no_alpha/';
         } elseif ($no_alphagen) {
             $icon_path .= 'no_alpha/';
             $icon = 'generic.png';
         } elseif ($normal) {
             //do nothing
         } else {
             $icon = 'generic.png';
         }
     }
     return $path_type . $icon_path . $icon;
 }
 function _setConfig()
 {
     global $_DOCMAN;
     // Get the configuartion object
     require_once $this->path . 'themeConfig.php';
     $this->setError('docman');
     $theme = new StdClass();
     $theme->conf = new themeConfig();
     $theme->name = $this->name;
     if (!$this->name) {
         throw new Exception('Theme name not found');
     }
     $theme->path = $_DOCMAN->getPath('themes', $this->name, 1);
     $theme->icon = DOCMAN_Utils::pathIcon(null, 1);
     $theme->png = DOCMAN_Utils::supportPng();
     $this->theme =& $theme;
 }