From: Jan Schneider Date: Thu, 8 Apr 2010 08:28:39 +0000 (+0200) Subject: Migrate hooks to H4 (Request #8954). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=5944890f1edafddf8bdd8fec01792a6c530cc431;p=horde.git Migrate hooks to H4 (Request #8954). --- diff --git a/mnemo/config/hooks.php.dist b/mnemo/config/hooks.php.dist index d2eb43e7e..99f637db4 100644 --- a/mnemo/config/hooks.php.dist +++ b/mnemo/config/hooks.php.dist @@ -1,26 +1,39 @@ \0', $text); -// $text = preg_replace('/(bug|ticket|request|enhancement|issue):\s*#?(\d+)/i', '\0', $text); +class Mnemo_Hooks +{ + /** + * TODO + */ +// function format_description($text) +// { +// $text = preg_replace('/#(\d+)/', '\0', $text); +// $text = preg_replace('/(bug|ticket|request|enhancement|issue):\s*#?(\d+)/i', '\0', $text); // -// $text = preg_replace_callback('/\[\[note: ?(.*)\]\]/i', create_function('$m', 'return \'\' . htmlspecialchars($m[0]) . \'\';'), $text); -// $text = preg_replace_callback('/\[\[task: ?(.*)\]\]/i', create_function('$m', 'return \'\' . htmlspecialchars($m[0]) . \'\';'), $text); +// $text = preg_replace_callback('/\[\[note: ?(.*)\]\]/i', create_function('$m', 'return \'\' . htmlspecialchars($m[0]) . \'\';'), $text); +// $text = preg_replace_callback('/\[\[task: ?(.*)\]\]/i', create_function('$m', 'return \'\' . htmlspecialchars($m[0]) . \'\';'), $text); // -// return $text; -// } -// } +// return $text; +// } + + + /** + * TODO + */ +// 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.

'; +// } -// if (!function_exists('_mnemo_hook_description_help')) { -// function _mnemo_hook_description_help() -// { -// return '

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

'; -// } -// } +} diff --git a/mnemo/notes/index.php b/mnemo/notes/index.php index 3b1987d89..934c750f5 100644 --- a/mnemo/notes/index.php +++ b/mnemo/notes/index.php @@ -8,7 +8,9 @@ * did not receive this file, see http://www.horde.org/licenses/asl.php. */ -require_once dirname(__FILE__) . '/../lib/base.php'; +@define('MNEMO_BASE', dirname(dirname(__FILE__))); +require_once MNEMO_BASE . '/lib/Application.php'; +Horde_Registry::appInit('mnemo'); $search = Horde_Util::getGet('q'); if (!$search) { diff --git a/mnemo/templates/memo/memo.inc b/mnemo/templates/memo/memo.inc index 016da66a2..c9fa2928d 100644 --- a/mnemo/templates/memo/memo.inc +++ b/mnemo/templates/memo/memo.inc @@ -52,7 +52,7 @@ if ($memo_id):

 (' . Horde_String::length(str_replace(array("\r", "\n"), '', $memo_body)) . '') ?>):

- +

" onclick="return checkCategory();" /> diff --git a/mnemo/templates/view/memo.inc b/mnemo/templates/view/memo.inc index fe31b2a0c..e439cd275 100644 --- a/mnemo/templates/view/memo.inc +++ b/mnemo/templates/view/memo.inc @@ -56,7 +56,7 @@ if (!$print_view) {

- Horde_Text_Filter_Text2html::MICRO, 'class' => null)); try { $body = Horde::callHook('_mnemo_hook_format_description', array($body), 'mnemo', $body); } catch (Horde_Exception_HookNotSet $e) {} echo $body; ?> + Horde_Text_Filter_Text2html::MICRO, 'class' => null)); try { $body = Horde::callHook('format_description', array($body), 'mnemo', $body); } catch (Horde_Exception_HookNotSet $e) {} echo $body; ?>