Author: ralfbecker
New Revision: 56092
URL: http://svn.stylite.de/viewvc/egroupware?rev=56092&view=rev
Log:
move category images to api, fixes PHP Fatal in admin_categories, if phpgwapi is not installed
Added:
trunk/egroupware/api/images/
- copied from r56081, trunk/phpgwapi/images/
Removed:
trunk/phpgwapi/images/
Modified:
trunk/admin/inc/class.admin_categories.inc.php
trunk/egroupware/api/src/Etemplate/Widget/Nextmatch.php
trunk/etemplate/inc/class.nextmatch_widget.inc.php
trunk/phpbrain/inc/class.uikb.inc.php
trunk/resources/inc/class.resources_bo.inc.php
— trunk/admin/inc/class.admin_categories.inc.php (original)
+++ trunk/admin/inc/class.admin_categories.inc.php Mon May 9 12:05:57 2016
@@ -34,7 +34,7 @@
/**
* Path where the icons are stored (relative to webserver_url)
*/
- const ICON_PATH = ‘/phpgwapi/images’;
-
const ICON_PATH = ‘/api/images’;
protected $appname = ‘admin’;
protected $get_rows = ‘admin.admin_categories.get_rows’;
@@ -332,25 +332,26 @@
}
/**
-
- Return icons from /phpgwapi/images
-
- Return icons from /api/images
-
-
@return array filename => label
*/
static function get_icons()
{
-
$dir = dir(EGW_SERVER_ROOT.self::ICON_PATH);
$icons = array();
-
$matches = null;
-
while(($file = $dir->read()))
-
{
-
if (preg_match('/^(.*)\\.(png|gif|jpe?g)$/i',$file,$matches))
-
{
-
$icons[$file] = ucfirst($matches[1]);
-
}
-
}
-
$dir->close();
-
asort($icons);
-
-
if (file_exists($image_dir=EGW_SERVER_ROOT.self::ICON_PATH) && ($dir = dir($image_dir)))
-
{
-
$matches = null;
-
while(($file = $dir->read()))
-
{
-
if (preg_match('/^(.*)\\.(png|gif|jpe?g)$/i',$file,$matches))
-
{
-
$icons[$file] = ucfirst($matches[1]);
-
}
-
}
-
$dir->close();
-
asort($icons);
-
}
return $icons;
}
— trunk/egroupware/api/src/Etemplate/Widget/Nextmatch.php (original)
+++ trunk/egroupware/api/src/Etemplate/Widget/Nextmatch.php Mon May 9 12:05:57 2016
@@ -85,6 +85,11 @@
*/
class Nextmatch extends Etemplate\Widget
{
- /**
-
- Path where the icons are stored (relative to webserver_url)
- */
- const ICON_PATH = ‘/api/images’;
- public function __construct($xml=’’)
{
if($xml) {
@@ -935,9 +940,9 @@
‘no_lang’ => true,
);
// add category icon
-
if ($cat['data']['icon'] && file_exists(EGW_SERVER_ROOT.'/phpgwapi/images/'.basename($cat['data']['icon'])))
-
{
-
$cat_actions[$cat['id']]['iconUrl'] = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/images/'.$cat['data']['icon'];
-
if ($cat['data']['icon'] && file_exists(EGW_SERVER_ROOT.self::ICON_PATH.'/'.basename($cat['data']['icon'])))
-
{
-
$cat_actions[$cat['id']]['iconUrl'] = $GLOBALS['egw_info']['server']['webserver_url'].self::ICON_PATH.'/'.$cat['data']['icon'];
}
}
}
@@ -974,9 +979,9 @@
‘prefix’ => $prefix,
);
// add category icon
-
if ($cat['data']['icon'] && file_exists(EGW_SERVER_ROOT.'/phpgwapi/images/'.basename($cat['data']['icon'])))
-
{
-
$cat_actions[$cat['id']]['iconUrl'] = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/images/'.$cat['data']['icon'];
-
if ($cat['data']['icon'] && file_exists(EGW_SERVER_ROOT.self::ICON_PATH.'/'.basename($cat['data']['icon'])))
-
{
-
$cat_actions[$cat['id']]['iconUrl'] = $GLOBALS['egw_info']['server']['webserver_url'].self::ICON_PATH.'/'.$cat['data']['icon'];
}
unset($cats[$key]);
}
— trunk/etemplate/inc/class.nextmatch_widget.inc.php (original)
+++ trunk/etemplate/inc/class.nextmatch_widget.inc.php Mon May 9 12:05:57 2016
@@ -78,6 +78,11 @@
class nextmatch_widget
{
/**
-
- Path where the icons are stored (relative to webserver_url)
- */
- const ICON_PATH = ‘/api/images’;
-
- /**
- Prefix for custom field names
-
*/
@@ -810,9 +815,9 @@
‘no_lang’ => true,
);
// add category icon
-
if ($cat['data']['icon'] && file_exists(EGW_SERVER_ROOT.'/phpgwapi/images/'.basename($cat['data']['icon'])))
-
{
-
$cat_actions[$cat['id']]['iconUrl'] = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/images/'.$cat['data']['icon'];
-
if ($cat['data']['icon'] && file_exists(EGW_SERVER_ROOT.self::ICON_PATH.'/'.basename($cat['data']['icon'])))
-
{
-
$cat_actions[$cat['id']]['iconUrl'] = $GLOBALS['egw_info']['server']['webserver_url'].self::ICON_PATH.'/'.$cat['data']['icon'];
}
}
}
@@ -849,9 +854,9 @@
‘prefix’ => $prefix,
);
// add category icon
-
if ($cat['data']['icon'] && file_exists(EGW_SERVER_ROOT.'/phpgwapi/images/'.basename($cat['data']['icon'])))
-
{
-
$cat_actions[$cat['id']]['iconUrl'] = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/images/'.$cat['data']['icon'];
-
if ($cat['data']['icon'] && file_exists(EGW_SERVER_ROOT.self::ICON_PATH.'/'.basename($cat['data']['icon'])))
-
{
-
$cat_actions[$cat['id']]['iconUrl'] = $GLOBALS['egw_info']['server']['webserver_url'].self::ICON_PATH.'/'.$cat['data']['icon'];
}
unset($cats[$key]);
}
— trunk/phpbrain/inc/class.uikb.inc.php (original)
+++ trunk/phpbrain/inc/class.uikb.inc.php Mon May 9 12:05:57 2016
@@ -1874,7 +1874,7 @@
$num_main_cat ++;
$categories_str .= “
”;
if ($cat[‘icon’])
— trunk/resources/inc/class.resources_bo.inc.php (original)
+++ trunk/resources/inc/class.resources_bo.inc.php Mon May 9 12:05:57 2016
@@ -23,6 +23,11 @@
*/
class resources_bo
{
- /**
-
- Path where the icons are stored (relative to webserver_url)
- */
- const ICON_PATH = ‘/api/images’;
- const DELETED = ‘deleted’;
const PICTURE_NAME = ‘.picture.jpg’;
var $resource_icons = ‘/resources/templates/default/images/resource_icons/’;
@@ -833,7 +838,7 @@
$picture = Api\Categories::id2name($resource[‘cat_id’], ‘data’);
if($picture[‘icon’])
{
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs
|