icon pic support

This commit is contained in:
Cornelius Weiß 2005-02-17 08:04:55 +00:00
parent 5a116ed264
commit f8e33c8aef
5 changed files with 8 additions and 7 deletions

View File

@ -22,6 +22,7 @@ class bo_resources
var $vfs_basedir = '/resources/'; var $vfs_basedir = '/resources/';
var $pictures_dir = '/resources/pictures/'; var $pictures_dir = '/resources/pictures/';
var $thumbs_dir = '/resources/pictures/thumbs/'; var $thumbs_dir = '/resources/pictures/thumbs/';
var $resource_icons = '/resources/templates/default/images/resource_icons/';
function bo_resources() function bo_resources()
{ {
@ -29,10 +30,6 @@ class bo_resources
$this->acl = CreateObject('resources.bo_acl'); $this->acl = CreateObject('resources.bo_acl');
$this->cats = $this->acl->egw_cats; $this->cats = $this->acl->egw_cats;
$this->vfs = CreateObject('phpgwapi.vfs'); $this->vfs = CreateObject('phpgwapi.vfs');
// print_r($this->cats->return_single(33)); die();
list($cat) = $this->cats->return_single(33);
$cat['data'] = unserialize($cat['data']);
} }
/*! /*!
@ -255,10 +252,14 @@ class bo_resources
$picture = false /*$this->config->use_vfs*/ ? 'vfs:' : $GLOBALS['phpgw_info']['server']['webserver_url']; $picture = false /*$this->config->use_vfs*/ ? 'vfs:' : $GLOBALS['phpgw_info']['server']['webserver_url'];
$picture .= $size ? $this->pictures_dir.$id.'.jpg' : $this->thumbs_dir.$id.'.jpg'; $picture .= $size ? $this->pictures_dir.$id.'.jpg' : $this->thumbs_dir.$id.'.jpg';
break; break;
case 'gen_src':
case 'cat_src': case 'cat_src':
list($picture) = $this->cats->return_single($this->so->get_value('cat_id',$id));
$picture = unserialize($picture['data']);
$picture = $GLOBALS['phpgw_info']['server']['webserver_url'].'/phpgwapi/images/'.$picture['icon'];
break;
case 'gen_src':
default : default :
$picture = 'generic.png'; $picture = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->resource_icons.'generic.png';
} }
return $picture; return $picture;
} }

View File

@ -27,7 +27,7 @@ class ui_resources
*/ */
function ui_resources() function ui_resources()
{ {
// print_r($GLOBALS['phpgw']); die(); // print_r($GLOBALS['phpgw_info']); die();
$this->tmpl = CreateObject('etemplate.etemplate','resources.show'); $this->tmpl = CreateObject('etemplate.etemplate','resources.show');
$this->bo = CreateObject('resources.bo_resources'); $this->bo = CreateObject('resources.bo_resources');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB