From 7a39f4b4c3e016620fcea75f6202d6ad601d9966 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Mon, 17 May 2010 17:26:43 +0200 Subject: [PATCH] Make methods public. --- ansel/config/hooks.php.dist | 4 ++-- horde/config/hooks.php.dist | 38 ++++++++++++++++---------------- imp/config/hooks.php.dist | 48 ++++++++++++++++++++--------------------- ingo/config/hooks.php.dist | 2 +- kronolith/config/hooks.php.dist | 2 +- mnemo/config/hooks.php.dist | 4 ++-- nag/config/hooks.php.dist | 4 ++-- shout/config/hooks.php.dist | 35 ------------------------------ 8 files changed, 51 insertions(+), 86 deletions(-) delete mode 100644 shout/config/hooks.php.dist diff --git a/ansel/config/hooks.php.dist b/ansel/config/hooks.php.dist index b7f565879..f2cf5112a 100644 --- a/ansel/config/hooks.php.dist +++ b/ansel/config/hooks.php.dist @@ -14,7 +14,7 @@ class Ansel_Hooks * when he/she tries to view an age limited content. This function must * return an integer value of user age */ -// function user_age() +// public function user_age() // { // $query = 'SELECT age FROM user WHERE user_uid = ' . $GLOBALS['ansel_db']->quote(Horde_Auth::getAuth()); // $result = $GLOBALS['ansel_db']->queryOne($query); @@ -31,7 +31,7 @@ class Ansel_Hooks * uploads images to Ansel. This will likely go away, being replaced by * by an remote image import/export functionality. */ -// function postupload($image_ids) +// public function postupload($image_ids) // { // $context = array('http_client' => new Horde_Http_Client(), // 'http_request' => new Horde_Controller_Request_Http(),); diff --git a/horde/config/hooks.php.dist b/horde/config/hooks.php.dist index 8ee4eee69..a14af6aef 100644 --- a/horde/config/hooks.php.dist +++ b/horde/config/hooks.php.dist @@ -165,7 +165,7 @@ class Horde_Hooks // // like the currently logged in user, global variables, server config, // // etc. It isn't, however, something you probably want to actually use // // in production, by virtue of demonstrating all those. :) -// function prefs_hook_theme($username = null) +// public function prefs_hook_theme($username = null) // { // if (Horde_Auth::getAuth() != 'chuck') { // return 'mozilla'; @@ -188,7 +188,7 @@ class Horde_Hooks // // Example preferences change hook. -// function prefs_change_hook_theme() +// public function prefs_change_hook_theme() // { // $GLOBALS['notification']->push('You changed your theme to ' . $GLOBALS['prefs']->getValue('theme') . '.'); // } @@ -202,7 +202,7 @@ class Horde_Hooks // // any information you need. You can "global" anything else you need. // // Return an address - either just the user@ side or a full address - // // and it will be used. -// function prefs_hook_from_addr($name = null) +// public function prefs_hook_from_addr($name = null) // { // // Example #1 // if (is_null($name)) { @@ -265,7 +265,7 @@ class Horde_Hooks // // Examples on how to set the fullname. -// function prefs_hook_fullname($user = null) +// public function prefs_hook_fullname($user = null) // { // // Example #1: Set the fullname from the GECOS information in the // // passwd file. @@ -317,7 +317,7 @@ class Horde_Hooks // // Preauthenticate hook. See above for description of format. -// function preauthenticate($userId, $credentials) +// public function preauthenticate($userId, $credentials) // { // // Example #1: Make Horde respect the Unix convention of not // // allowing login when a file named /etc/nologin exist. @@ -371,7 +371,7 @@ class Horde_Hooks // // Postauthenticate hook. See above for description of format. -// function postauthenticate($userId, $credentials) +// public function postauthenticate($userId, $credentials) // { // // Example #1: Validating the user's right to login to Horde by // // by consulting group membership in an LDAP directory. That @@ -424,7 +424,7 @@ class Horde_Hooks // Username conversion hook. See above for description of format. -// function authusername($userId, $toHorde) +// public function authusername($userId, $toHorde) // { // // Example #1: Append the virtual domain to the username. // // ex. $HTTP_HOST = 'mail.mydomain.com', $userId = 'myname' returns: @@ -453,13 +453,13 @@ class Horde_Hooks // Post-push hook. See above for format. -// function pushapp() +// public function pushapp() // { // // Code to run if the app is switched to horde // } // Add CSS files hook. See above for description of format. -// function cssfiles($theme) +// public function cssfiles($theme) // { // return array( // '/file/path/to/css' => 'uri/to/css' @@ -474,7 +474,7 @@ class Horde_Hooks * * @return array TODO */ -// function signup_preprocess($info) +// public function signup_preprocess($info) // { // $info['user_name'] = Horde_String::lower($info['user_name']); // return $info; @@ -487,7 +487,7 @@ class Horde_Hooks * @param string $userId The username. * @param array $data TODO */ -// function signup_queued($userId, $data) +// public function signup_queued($userId, $data) // { // // Example #1: Send a notification message to the web server // // administrator's e-mail address. @@ -512,7 +512,7 @@ class Horde_Hooks // } // // // Helper function for signup_queued Example #1 -// function _signup_queued_walkdata($fields, $data) +// private function _signup_queued_walkdata($fields, $data) // { // $msg = ''; // foreach ($data as $field => $value) { @@ -548,7 +548,7 @@ class Horde_Hooks * type - Any allowed Horde_Form field type * */ -// function signup_getextra() +// public function signup_getextra() // { // // Example #1: A hypothetical case where we would want to store // // extra information about a user into a turba sql address book. All @@ -567,7 +567,7 @@ class Horde_Hooks * the signup_getextra hook. * @param string $password The password. */ -// function signup_addextra($userId, $extra, $password) +// public function signup_addextra($userId, $extra, $password) // { // // Example #1: Continuation of Example #1 from signup_getextra(). // // Here we connect to the database using the sql parameters @@ -607,7 +607,7 @@ class Horde_Hooks * * @return array The altered share list. */ -// function share_list($userId, $perm, $owner, $share_list) +// public function share_list($userId, $perm, $owner, $share_list) // { // return $share_list; // } @@ -624,7 +624,7 @@ class Horde_Hooks * * @return string An error message. */ -// function perms_denied($permission) +// public function perms_denied($permission) // { // // Example #1: Provide link to upgrade script. // $app = (($pos = strpos($permission, ':')) === false) @@ -646,7 +646,7 @@ class Horde_Hooks * * @return TODO */ -// function group_driver($groupName, $userName) +// public function group_driver($groupName, $userName) // { // // Example #1: Look up whether or not this user is part of the // // "IT_department" group using an external database. @@ -673,7 +673,7 @@ class Horde_Hooks * @param TODO $share_obj TODO * @param string $app TODO */ -// function share_init($share_obj, $app) +// public function share_init($share_obj, $app) // { // // TODO: Move to turba? // if (($app == 'turba') && @@ -736,7 +736,7 @@ class Horde_Hooks * * @param TODO $share TODO */ -// function share_modify($share) +// public function share_modify($share) // { // $params = unserialize($share->get('params')); // if (is_array($params) && !empty($params['source']) && diff --git a/imp/config/hooks.php.dist b/imp/config/hooks.php.dist index e439cff3b..736a622f1 100644 --- a/imp/config/hooks.php.dist +++ b/imp/config/hooks.php.dist @@ -28,7 +28,7 @@ class IMP_Hooks * preauthentication hook, this must be true. If false, * IMP will try to authenticate using hordeauth. */ -// function preauthenticate($userId, $credentials) +// public function preauthenticate($userId, $credentials) // { // return true; // } @@ -39,7 +39,7 @@ class IMP_Hooks * * See horde/config/hooks.php.dist for more information. */ -// function postauthenticate($userId, $credentials) +// public function postauthenticate($userId, $credentials) // { // return true; // } @@ -54,7 +54,7 @@ class IMP_Hooks * * @return string The signature text to use. */ -// function prefs_hook_signature($username = null) +// public function prefs_hook_signature($username = null) // { // // Example #1: Set the signature from the system taglines file; the // // string "%TAG%" (if present in a user's signature) will be replaced @@ -78,7 +78,7 @@ class IMP_Hooks * * @return string The add_source value. */ -// function prefs_hook_add_source($username = null) +// public function prefs_hook_add_source($username = null) // { // if (!$username) { // return; @@ -99,7 +99,7 @@ class IMP_Hooks * * @return string The search_sources value. */ -// function prefs_hook_search_sources($username = null) +// public function prefs_hook_search_sources($username = null) // { // if (!$username) { // return; @@ -123,7 +123,7 @@ class IMP_Hooks * @return mixed The data to send to the browser (will be JSON encoded). * @throws Horde_Ajax_Exception */ -// function ajaxaction($action, $vars) +// public function ajaxaction($action, $vars) // { // switch ($action) { // case 'Foo': @@ -147,7 +147,7 @@ class IMP_Hooks * * @return string The MIME type of the file. */ - function attachmimetype($filename, $tempfile, $type) + public function attachmimetype($filename, $tempfile, $type) { /* By default, we trust the MIME type reported by the browser if it is * something other than the generic octet-stream type. */ @@ -173,7 +173,7 @@ class IMP_Hooks * @param Horde_Mime_Part $message The message content object. * @param Horde_Mime_Headers $headers The message headers object. */ -// function pre_sent($message, $headers) +// public function pre_sent($message, $headers) // { // // Do action here -- no return value from this hook. // } @@ -185,7 +185,7 @@ class IMP_Hooks * @param Horde_Mime_Part $message The message content object. * @param Horde_Mime_Headers $headers The message headers object. */ -// function post_sent($message, $headers) +// public function post_sent($message, $headers) // { // // Do action here -- no return value from this hook. // } @@ -198,7 +198,7 @@ class IMP_Hooks * * @return string The trailer text to be used. */ -// function trailer($trailer) +// public function trailer($trailer) // { // // Example #1: Set the trailer from the system taglines file; the // // string "%TAG%" (if present in a user's signature) will be replaced @@ -246,7 +246,7 @@ class IMP_Hooks * defined in the 'msgflags' preference. On error, return * an empty array. */ -// function msglist_flags($data, $mode) +// public function msglist_flags($data, $mode) // { // // Example #1: Add a icon if the message was sent from a user within // // the same domain. @@ -275,7 +275,7 @@ class IMP_Hooks * Return an empty string if the user is not to be * redirected. */ -// function mbox_redirect($mailbox) +// public function mbox_redirect($mailbox) // { // // Example #1: Redirect to various Horde apps based on the mailbox // // name. @@ -330,7 +330,7 @@ class IMP_Hooks * If a mailbox name doesn't appear in the list, the default * mailbox icon is displayed. */ -// function mbox_icons() +// public function mbox_icons() // { // // Example #1: Redirection scheme for Kolab_Cyrus // static $newmailboxes; @@ -446,7 +446,7 @@ class IMP_Hooks * * @return string The display label for $mbox. */ -// function mbox_label($mbox, $label) +// public function mbox_label($mbox, $label) // { // // Example #1: Show 'foo' as 'bar' // return ($mbox == 'foo') @@ -461,7 +461,7 @@ class IMP_Hooks * * @return boolean Is the mailbox read-only? */ -// function mbox_readonly($mailbox) +// public function mbox_readonly($mailbox) // { // // Example #1: Make messages in the 'foo' mailbox readonly. // return ($mailbox == 'foo'); @@ -485,7 +485,7 @@ class IMP_Hooks * @param string $view Either 'imp' or 'dimp'. * * @return array The altered array to use in the template. -// function mailboxarray($msgs, $view) +// public function mailboxarray($msgs, $view) // { // // Example #1: Adds a 'foo' entry to each message element. // switch ($view) { @@ -506,7 +506,7 @@ class IMP_Hooks * * @return boolean Is composing disabled? */ -// function disable_compose() +// public function disable_compose() // { // // Example #1: Entirely disable composition. // return false; @@ -520,7 +520,7 @@ class IMP_Hooks * * @return boolean If false, do not display the mailbox. */ -// function display_folder($mailbox) +// public function display_folder($mailbox) // { // // Example #1: Do not display the mailbox 'Foo'. // return ($mailbox != 'Foo'); @@ -542,7 +542,7 @@ class IMP_Hooks * * @return string An e-mail address. */ -// function spam_email($action) +// public function spam_email($action) // { // // Example #1: Create e-mail for DSPAM setup. // $prefix = ($action == 'spam') ? 'spam-' : 'fp-'; @@ -561,7 +561,7 @@ class IMP_Hooks * second: maximum disk space (in bytes) * */ -// function quota($params = null) +// public function quota($params = null) // { // // Example #1: Sample function for returning the quota. // // Uses the PECL ssh2 extension. @@ -682,7 +682,7 @@ class IMP_Hooks * * @return array The altered array to use in the template. */ -// function dimp_messageview($msg) +// public function dimp_messageview($msg) // { // // Example #1: Add a new foo variable // $msg['foo'] = '
BAR
'; @@ -708,7 +708,7 @@ class IMP_Hooks * second element is an array of javascript commands, one * command per array value. */ -// function dimp_previewview($msg) { +// public function dimp_previewview($msg) { // // Example #1: Alter the subject // $msg['subject'] .= 'test'; // @@ -738,7 +738,7 @@ class IMP_Hooks * must be properly escaped (i.e. htmlspecialchars() used * on the portions of the string where appropriate). */ -// function dimp_addressformatting($ob) +// public function dimp_addressformatting($ob) // { // // Example #1: Display only the raw text of the personal name // // or, if not set, the e-mail address. @@ -767,7 +767,7 @@ class IMP_Hooks * @return boolean If true, activates the feature. By default, these * advanced features are NOT active. */ -// function mimp_advanced($feature) +// public function mimp_advanced($feature) // { // switch ($feature) { // case 'checkbox': diff --git a/ingo/config/hooks.php.dist b/ingo/config/hooks.php.dist index 80247fa74..0912fde07 100644 --- a/ingo/config/hooks.php.dist +++ b/ingo/config/hooks.php.dist @@ -22,7 +22,7 @@ class Ingo_Hooks * * @return array A list of vacation addresses. */ -// function vacation_addresses($user = null) +// public function vacation_addresses($user = null) // { // // Example #1: User has 2 vacation addresses. // return array($user . '@example.com', $user . '@foobar.com'); diff --git a/kronolith/config/hooks.php.dist b/kronolith/config/hooks.php.dist index d1eed4377..a121df0ee 100644 --- a/kronolith/config/hooks.php.dist +++ b/kronolith/config/hooks.php.dist @@ -22,7 +22,7 @@ class Kronolith_Hooks * @return mixed The data to send to the browser (will be JSON encoded). * @throws Horde_Ajax_Exception */ -// function ajaxaction($action, $vars) +// public function ajaxaction($action, $vars) // { // switch ($action) { // case 'Foo': diff --git a/mnemo/config/hooks.php.dist b/mnemo/config/hooks.php.dist index 99f637db4..52de75588 100644 --- a/mnemo/config/hooks.php.dist +++ b/mnemo/config/hooks.php.dist @@ -16,7 +16,7 @@ class Mnemo_Hooks /** * TODO */ -// function format_description($text) +// public function format_description($text) // { // $text = preg_replace('/#(\d+)/', '\0', $text); // $text = preg_replace('/(bug|ticket|request|enhancement|issue):\s*#?(\d+)/i', '\0', $text); @@ -31,7 +31,7 @@ class Mnemo_Hooks /** * TODO */ -// function description_help() +// public function description_help() // { // return '

To create a link to a bug, use #123 where 123 is the bug number. To create a link to another task, use [[task: name]], where name is the beginning of the task name. To create a link to a note, use [[note: title]] where title is the beginning of the note title.

'; // } diff --git a/nag/config/hooks.php.dist b/nag/config/hooks.php.dist index 5e40a79e0..e0ab869ed 100644 --- a/nag/config/hooks.php.dist +++ b/nag/config/hooks.php.dist @@ -16,7 +16,7 @@ class Nag_Hooks /** * TODO */ -// function format_description($text) +// public function format_description($text) // { // $text = preg_replace('/#(\d+)/', '\0', $text); // $text = preg_replace('/(bug|ticket|request|enhancement|issue):\s*#?(\d+)/i', '\0', $text); @@ -31,7 +31,7 @@ class Nag_Hooks /** * TODO */ -// function description_help() +// public function description_help() // { // return '

To create a link to a bug, use #123 where 123 is the bug number. To create a link to another task, use [[task: name]], where name is the beginning of the task name. To create a link to a note, use [[note: title]] where title is the beginning of the note title.

'; // } diff --git a/shout/config/hooks.php.dist b/shout/config/hooks.php.dist deleted file mode 100644 index a78bae895..000000000 --- a/shout/config/hooks.php.dist +++ /dev/null @@ -1,35 +0,0 @@ -