r56092 - in /trunk: admin/inc/ egroupware/api/images/ egroupware/api/src/Etemplate/Widget/ etemplate/inc/ phpbrain/inc/ phpg...

classic Classic list List threaded Threaded
1 message Options
ralfbecker_sf ralfbecker_sf
Reply | Threaded
Open this post in threaded view
|

r56092 - in /trunk: admin/inc/ egroupware/api/images/ egroupware/api/src/Etemplate/Widget/ etemplate/inc/ phpbrain/inc/ phpg...

Author: ralfbecker
Date: Mon May  9 12:05:57 2016
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

Modified: trunk/admin/inc/class.admin_categories.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/inc/class.admin_categories.inc.php?rev=56092&r1=56091&r2=56092&view=diff
==============================================================================
--- 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;
  }
 

Modified: trunk/egroupware/api/src/Etemplate/Widget/Nextmatch.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Etemplate/Widget/Nextmatch.php?rev=56092&r1=56091&r2=56092&view=diff
==============================================================================
--- 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]);
  }

Modified: trunk/etemplate/inc/class.nextmatch_widget.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/inc/class.nextmatch_widget.inc.php?rev=56092&r1=56091&r2=56092&view=diff
==============================================================================
--- 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]);
  }

Modified: trunk/phpbrain/inc/class.uikb.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/phpbrain/inc/class.uikb.inc.php?rev=56092&r1=56091&r2=56092&view=diff
==============================================================================
--- 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 .= "<tr><td valign=top>";
  if ($cat['icon'])
- $categories_str .= "<img src='" . $GLOBALS['egw_info']['server']['webserver_url'] . '/phpgwapi/images/' . $cat['icon'] . "'>";
+ $categories_str .= "<img src='" . $GLOBALS['egw_info']['server']['webserver_url'] . '/api/images/' . $cat['icon'] . "'>";
  $categories_str .= "</td><td><a href='".$this->link('menuaction=phpbrain.uikb.index&cat='.$cat['id'])
  ."'><b>".$cat['name']."</b></a><br><div style='padding-left:10px'>";
  $has_subcats = False;

Modified: trunk/resources/inc/class.resources_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/resources/inc/class.resources_bo.inc.php?rev=56092&r1=56091&r2=56092&view=diff
==============================================================================
--- 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'])
  {
- $picture = !$fullsize?$GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/images/'.$picture['icon']:'/phpgwapi/images/'.$picture['icon'];
+ $picture = !$fullsize?$GLOBALS['egw_info']['server']['webserver_url'].self::ICON_PATH.'/'.$picture['icon']:self::ICON_PATH.'/'.$picture['icon'];
  break;
  }
  // fall through


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs