@@ -64,22 +64,22 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | if (!isset(self::$locations)) self::read(); |
| 66 | 66 | $hooks = self::$locations[$location]; |
| 67 | - if (!isset($hooks) || empty($hooks)) return array(); // not a single app implements that hook |
|
| 67 | + if (!isset($hooks) || empty($hooks)) return array(); // not a single app implements that hook |
|
| 68 | 68 | |
| 69 | 69 | $apps = array_keys($hooks); |
| 70 | 70 | if (!$no_permission_check) |
| 71 | 71 | { |
| 72 | 72 | // on install of a new egroupware both hook-apps and user apps may be empty/not set |
| 73 | - $apps = array_intersect((array)$apps,array_keys((array)$GLOBALS['egw_info']['user']['apps'])); |
|
| 73 | + $apps = array_intersect((array)$apps, array_keys((array)$GLOBALS['egw_info']['user']['apps'])); |
|
| 74 | 74 | } |
| 75 | 75 | if ($order) |
| 76 | 76 | { |
| 77 | - $apps = array_unique(array_merge((array)$order,$apps)); |
|
| 77 | + $apps = array_unique(array_merge((array)$order, $apps)); |
|
| 78 | 78 | } |
| 79 | 79 | $results = array(); |
| 80 | - foreach((array)$apps as $appname) |
|
| 80 | + foreach ((array)$apps as $appname) |
|
| 81 | 81 | { |
| 82 | - $results[$appname] = self::single($args,$appname,$no_permission_check); |
|
| 82 | + $results[$appname] = self::single($args, $appname, $no_permission_check); |
|
| 83 | 83 | } |
| 84 | 84 | return $results; |
| 85 | 85 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $ret = $redirects = array(); |
| 118 | - foreach((array)self::$locations[$location][$appname] as $hook) |
|
| 118 | + foreach ((array)self::$locations[$location][$appname] as $hook) |
|
| 119 | 119 | { |
| 120 | 120 | try { |
| 121 | 121 | // old style file hook |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | // hooks only existing in filesystem used by setup |
| 165 | - if (!$ret && $try_unregistered && file_exists(EGW_SERVER_ROOT.($hook='/'.$appname.'/inc/hook_'.$location.'.inc.php'))) |
|
| 165 | + if (!$ret && $try_unregistered && file_exists(EGW_SERVER_ROOT.($hook = '/'.$appname.'/inc/hook_'.$location.'.inc.php'))) |
|
| 166 | 166 | { |
| 167 | 167 | include(EGW_SERVER_ROOT.$hook); |
| 168 | 168 | return true; |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | * @param boolean $return_methods =false true: return hook-method(s) |
| 195 | 195 | * @return int|array the number of found hooks or for $return_methods array with methods |
| 196 | 196 | */ |
| 197 | - public static function exists($location, $app, $return_methods=false) |
|
| 197 | + public static function exists($location, $app, $return_methods = false) |
|
| 198 | 198 | { |
| 199 | 199 | if (!isset(self::$locations)) self::read(); |
| 200 | 200 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | * |
| 239 | 239 | * @param boolan $force_rescan =false true: do not use instance cache |
| 240 | 240 | */ |
| 241 | - public static function read($force_rescan=false) |
|
| 241 | + public static function read($force_rescan = false) |
|
| 242 | 242 | { |
| 243 | 243 | //$starttime = microtime(true); |
| 244 | 244 | if ($force_rescan) Cache::unsetInstance(__CLASS__, 'locations'); |
@@ -254,18 +254,18 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | // read all apps using just filesystem data |
| 256 | 256 | $locations = array(); |
| 257 | - foreach(array_merge(array('api'), array_keys($GLOBALS['egw_info']['apps'])) as $appname) |
|
| 257 | + foreach (array_merge(array('api'), array_keys($GLOBALS['egw_info']['apps'])) as $appname) |
|
| 258 | 258 | { |
| 259 | 259 | if ($appname[0] == '.' || !is_dir(EGW_SERVER_ROOT.'/'.$appname)) continue; |
| 260 | 260 | |
| 261 | - $f = EGW_SERVER_ROOT . '/' . $appname . '/setup/setup.inc.php'; |
|
| 261 | + $f = EGW_SERVER_ROOT.'/'.$appname.'/setup/setup.inc.php'; |
|
| 262 | 262 | $setup_info = array($appname => array()); |
| 263 | - if(@file_exists($f)) include($f); |
|
| 263 | + if (@file_exists($f)) include($f); |
|
| 264 | 264 | |
| 265 | 265 | // some apps have setup_info for more then themselfs (eg. api for groupdav) |
| 266 | - foreach($setup_info as $appname => $data) |
|
| 266 | + foreach ($setup_info as $appname => $data) |
|
| 267 | 267 | { |
| 268 | - foreach((array)$data['hooks'] as $location => $methods) |
|
| 268 | + foreach ((array)$data['hooks'] as $location => $methods) |
|
| 269 | 269 | { |
| 270 | 270 | if (is_int($location)) |
| 271 | 271 | { |