Author: ralfbecker
New Revision: 56131
URL: http://svn.stylite.de/viewvc/egroupware?rev=56131&view=rev
Log:
use static Hooks methods
Modified:
trunk/egroupware/api/src/Accounts.php
trunk/egroupware/api/src/Auth.php
trunk/egroupware/api/src/CalDAV.php
trunk/egroupware/api/src/Categories.php
trunk/egroupware/api/src/Contacts.php
trunk/egroupware/api/src/Db/Backup.php
trunk/egroupware/api/src/Etemplate.php
trunk/egroupware/api/src/Etemplate/Widget.php
trunk/egroupware/api/src/Header/ContentSecurityPolicy.php
trunk/egroupware/api/src/Link.php
trunk/egroupware/api/src/Mail/Types.php
trunk/egroupware/api/src/Mailer.php
trunk/egroupware/api/src/Session.php
trunk/egroupware/api/src/Storage/Merge.php
trunk/egroupware/api/src/Vfs.php
trunk/egroupware/api/src/Vfs/Sqlfs/Utils.php
trunk/egroupware/api/src/Vfs/StreamWrapper.php
— trunk/egroupware/api/src/Accounts.php (original)
+++ trunk/egroupware/api/src/Accounts.php Wed May 11 20:58:10 2016
@@ -1057,7 +1057,7 @@
}
// call hook to notify interested apps about the new account
$GLOBALS[‘hook_values’] = $data;
-
Hooks::process($data+array(
'location' => 'addaccount',
// at login-time only the hooks from the following apps will be called
'order' => array('felamimail','fudforum'),
— trunk/egroupware/api/src/Auth.php (original)
+++ trunk/egroupware/api/src/Auth.php Wed May 11 20:58:10 2016
@@ -260,7 +260,7 @@
‘old_passwd’ => $old_passwd,
‘new_passwd’ => $new_passwd,
);
-
Hooks::process($GLOBALS['hook_values']+array(
'location' => 'changepassword'
),False,True); // called for every app now, not only enabled ones)
}
— trunk/egroupware/api/src/CalDAV.php (original)
+++ trunk/egroupware/api/src/CalDAV.php Wed May 11 20:58:10 2016
@@ -389,7 +389,7 @@
if ($path == '/')
{
-
Hooks::process(array(
'location' => 'groupdav_root_props',
'props' => &$files['files'][0]['props'],
'options' => $options,
— trunk/egroupware/api/src/Categories.php (original)
+++ trunk/egroupware/api/src/Categories.php Wed May 11 20:58:10 2016
@@ -626,11 +626,11 @@
);
if($this->is_global($cat_id, true)) // true = application global (otherwise eg. global addressbook categories call all apps)
{
-
$GLOBALS['egw']->hooks->process($GLOBALS['hook_values'],False,True); // called for every app now, not only enabled ones)
-
Hooks::process($GLOBALS['hook_values'],False,True); // called for every app now, not only enabled ones)
}
else
{
-
Hooks::single($GLOBALS['hook_values'], self::id2name($cat_id,'appname'));
}
$this->db->delete(self::TABLE,$where,__LINE__,__FILE__);
— trunk/egroupware/api/src/Contacts.php (original)
+++ trunk/egroupware/api/src/Contacts.php Wed May 11 20:58:10 2016
@@ -992,7 +992,7 @@
$GLOBALS[‘egw’]->accounts->cache_invalidate($contact[‘account_id’]);
// call edit-accout hook, to let other apps know about changed account (names or email)
$GLOBALS[‘hook_values’] = $GLOBALS[‘egw’]->accounts->read($contact[‘account_id’]);
-
Hooks::process($GLOBALS['hook_values']+array(
'location' => 'editaccount',
),False,True); // called for every app now, not only enabled ones)
}
@@ -1000,7 +1000,7 @@
if (!$to_write[‘owner’] && $to_write[‘account_id’] && $isUpdate)
{
$to_write[‘location’] = ‘editaccountcontact’;
-
$GLOBALS['egw']->hooks->process($to_write,False,True); // called for every app now, not only enabled ones));
-
Hooks::process($to_write,False,True); // called for every app now, not only enabled ones));
}
// Notify linked apps about changes in the contact data
Link::notify_update('addressbook', $contact['id'], $contact);
— trunk/egroupware/api/src/Db/Backup.php (original)
+++ trunk/egroupware/api/src/Db/Backup.php Wed May 11 20:58:10 2016
@@ -487,7 +487,7 @@
Api\Cache::flush(Api\Cache::INSTANCE);
// search-and-register-hooks
— trunk/egroupware/api/src/Etemplate.php (original)
+++ trunk/egroupware/api/src/Etemplate.php Wed May 11 20:58:10 2016
@@ -102,7 +102,7 @@
*/
function exec($method,array $content,array $sel_options=null,array $readonlys=null,array $preserv=null,$output_mode=0,$ignore_validation=’’,array $changes=null)
{
@@ -351,7 +351,7 @@
// tell request call to remove request, if it is not modified eg. by call to exec in callback
self::$request->remove_if_not_modified();
-
foreach(Hooks::process(array(
'hook_location' => 'etemplate2_before_process',
'location_name' => $template->id,
) + self::complete_array_merge(self::$request->preserv, $validated)) as $extras)
@@ -374,7 +374,7 @@
$tcontent = is_array($content) ? $content :
self::complete_array_merge(self::$request->preserv, $validated);
— trunk/egroupware/api/src/Etemplate/Widget.php (original)
+++ trunk/egroupware/api/src/Etemplate/Widget.php Wed May 11 20:58:10 2016
@@ -323,7 +323,7 @@
}
// Use hook to load custom widgets from other apps
— trunk/egroupware/api/src/Header/ContentSecurityPolicy.php (original)
+++ trunk/egroupware/api/src/Header/ContentSecurityPolicy.php Wed May 11 20:58:10 2016
@@ -11,6 +11,8 @@
*/
namespace EGroupware\Api\Header;
+
+use EGroupware\Api;
/**
- Content Security Policy headers
@@ -50,8 +52,8 @@
// set frame-src attrs of API and apps via hook
if ($source == ‘frame-src’ && !isset($attrs))
{
-
$attrs = array('manual.egroupware.org', 'www.egroupware.org');
-
if (($app_additional = $GLOBALS['egw']->hooks->process('csp-frame-src')))
— trunk/egroupware/api/src/Link.php (original)
+++ trunk/egroupware/api/src/Link.php Wed May 11 20:58:10 2016
@@ -207,7 +207,7 @@
// for performance reasons, we do it only once / cache it in the session
if (!($search_link_hooks = Cache::getSession(CLASS, ‘search_link_hooks’)))
{
-
$search_link_hooks = Hooks::process('search_link',array(), (bool)$GLOBALS['egw_info']['flags']['async-service']);
Cache::setSession(__CLASS__, 'search_link_hooks', $search_link_hooks);
}
if (is_array($search_link_hooks))
— trunk/egroupware/api/src/Mail/Types.php (original)
+++ trunk/egroupware/api/src/Mail/Types.php Wed May 11 20:58:10 2016
@@ -14,6 +14,8 @@
namespace EGroupware\Api\Mail;
+use EGroupware\Api;
+
class Types
{
/**
@@ -26,7 +28,7 @@
static public function getSMTPServerTypes($extended=true)
{
$retData = self::server_types(false, $extended);
-
foreach(Api\Hooks::process(array(
'location' => 'smtp_server_types',
'extended' => $extended,
), array('managementserver'), true) as $app => $data)
@@ -56,7 +58,7 @@
static public function getIMAPServerTypes($extended=true)
{
$retData = self::server_types(true, $extended);
-
foreach(Api\Hooks::process(array(
'location' => 'imap_server_types',
'extended' => $extended,
), array('managementserver'), true) as $app => $data)
— trunk/egroupware/api/src/Mailer.php (original)
+++ trunk/egroupware/api/src/Mailer.php Wed May 11 20:58:10 2016
@@ -503,7 +503,7 @@
}
$body_sha1 = null; // skip sha1, it requires whole mail in memory, which we traing to avoid now
-
$mail_id = Hooks::process(array(
'location' => 'send_mail',
'subject' => $subject=$this->getHeader('Subject'),
'from' => $this->getHeader('Return-Path') ? $this->getHeader('Return-Path') : $this->getHeader('From'),
@@ -578,7 +578,7 @@
}
catch (\Exception $e) {
// in case of errors/exceptions call hook again with previous returned mail_id and error-message to log
-
Hooks::process(array(
'location' => 'send_mail',
'subject' => $subject,
'from' => $this->getHeader('Return-Path') ? $this->getHeader('Return-Path') : $this->getHeader('From'),
— trunk/egroupware/api/src/Session.php (original)
+++ trunk/egroupware/api/src/Session.php Wed May 11 20:58:10 2016
@@ -566,7 +566,7 @@
$this->session_flags = ‘N’;
}
-
if (($hook_result = Hooks::process(array(
'location' => 'session_creation',
'sessionid' => $this->sessionid,
'session_flags' => $this->session_flags,
@@ -1042,7 +1042,7 @@
),LINE,FILE)->fetchColumn();
}
-
Hooks::process(array(
'location' => 'session_destroyed',
'sessionid' => $sessionid,
),'',true); // true = run hooks from all apps, not just the ones the current user has perms to run
— trunk/egroupware/api/src/Storage/Merge.php (original)
+++ trunk/egroupware/api/src/Storage/Merge.php Wed May 11 20:58:10 2016
@@ -500,7 +500,7 @@
$exportLimitStore[$app] = $GLOBALS[‘egw_info’][‘server’][‘export_limit’];
if ($app !=‘common’)
{
— trunk/egroupware/api/src/Vfs.php (original)
+++ trunk/egroupware/api/src/Vfs.php Wed May 11 20:58:10 2016
@@ -1768,7 +1768,7 @@
$extra[] = $extra_info;
}
-
if (($vfs_extra = Hooks::process(array(
'location' => 'vfs_extra',
'path' => $path,
'content' => $content,
— trunk/egroupware/api/src/Vfs/Sqlfs/Utils.php (original)
+++ trunk/egroupware/api/src/Vfs/Sqlfs/Utils.php Wed May 11 20:58:10 2016
@@ -125,7 +125,7 @@
if ($check_msgs) $msgs = array_merge($msgs, $check_msgs);
}
— trunk/egroupware/api/src/Vfs/StreamWrapper.php (original)
+++ trunk/egroupware/api/src/Vfs/StreamWrapper.php Wed May 11 20:58:10 2016
@@ -360,7 +360,7 @@
if (isset($GLOBALS['egw']) && isset($GLOBALS['egw']->hooks))
{
-
Api\Hooks::process(array(
'location' => str_replace('b','',$this->opened_stream_mode) == 'r' ? 'vfs_read' :
($this->opened_stream_is_new ? 'vfs_added' : 'vfs_modified'),
'path' => $this->opened_stream_path,
@@ -507,7 +507,7 @@
// call “vfs_unlink” hook only after successful unlink, with data from (not longer possible) stat call
if ($ok && isset($GLOBALS[‘egw’]) && isset($GLOBALS[‘egw’]->hooks))
{
-
Api\Hooks::process(array(
'location' => 'vfs_unlink',
'path' => $path[0] == '/' ? $path : self::parse_url($path, PHP_URL_PATH),
'url' => $url,
@@ -560,7 +560,7 @@
// call “vfs_rename” hook
if ($ret && isset($GLOBALS[‘egw’]) && isset($GLOBALS[‘egw’]->hooks))
{
-
Api\Hooks::process(array(
'location' => 'vfs_rename',
'from' => $path_from[0] == '/' ? $path_from : self::parse_url($path_from, PHP_URL_PATH),
'to' => $path_to[0] == '/' ? $path_to : self::parse_url($path_to, PHP_URL_PATH),
@@ -593,7 +593,7 @@
// call “vfs_mkdir” hook
if ($ret && isset($GLOBALS[‘egw’]) && isset($GLOBALS[‘egw’]->hooks))
{
-
Api\Hooks::process(array(
'location' => 'vfs_mkdir',
'path' => $path[0] == '/' ? $path : self::parse_url($path, PHP_URL_PATH),
'url' => $url,
@@ -631,7 +631,7 @@
// call “vfs_rmdir” hook, only after successful rmdir
if ($ok && isset($GLOBALS[‘egw’]) && isset($GLOBALS[‘egw’]->hooks))
{
-
Api\Hooks::process(array(
'location' => 'vfs_rmdir',
'path' => $path[0] == '/' ? $path : self::parse_url($path, PHP_URL_PATH),
'url' => $url,
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs