<?php
/**
- * Example hooks for Mnemo
+ * Mnemo Hooks configuration file.
*
- * $Horde: mnemo/config/hooks.php.dist,v 1.1 2008/11/26 21:21:02 chuck Exp $
+ * THE HOOKS PROVIDED IN THIS FILE ARE EXAMPLES ONLY. DO NOT ENABLE THEM
+ * BLINDLY IF YOU DO NOT KNOW WHAT YOU ARE DOING. YOU HAVE TO CUSTOMIZE THEM
+ * TO MATCH YOUR SPECIFIC NEEDS AND SYSTEM ENVIRONMENT.
+ *
+ * For more information please see the horde/config/hooks.php.dist file.
+ *
+ * $Id$
*/
-// if (!function_exists('_mnemo_hook_format_description')) {
-// function _mnemo_hook_format_description($text)
-// {
-// $text = preg_replace('/#(\d+)/', '<a href="http://bugs.horde.org/ticket/\1">\0</a>', $text);
-// $text = preg_replace('/(bug|ticket|request|enhancement|issue):\s*#?(\d+)/i', '<a href="http://bugs.horde.org/ticket/\1">\0</a>', $text);
+class Mnemo_Hooks
+{
+ /**
+ * TODO
+ */
+// function format_description($text)
+// {
+// $text = preg_replace('/#(\d+)/', '<a href="http://bugs.horde.org/ticket/\1">\0</a>', $text);
+// $text = preg_replace('/(bug|ticket|request|enhancement|issue):\s*#?(\d+)/i', '<a href="http://bugs.horde.org/ticket/\1">\0</a>', $text);
//
-// $text = preg_replace_callback('/\[\[note: ?(.*)\]\]/i', create_function('$m', 'return \'<a href="/horde/mnemo/notes/?q=\' . urlencode($m[1]) . \'">\' . htmlspecialchars($m[0]) . \'</a>\';'), $text);
-// $text = preg_replace_callback('/\[\[task: ?(.*)\]\]/i', create_function('$m', 'return \'<a href="/horde/nag/tasks/?q=\' . urlencode($m[1]) . \'">\' . htmlspecialchars($m[0]) . \'</a>\';'), $text);
+// $text = preg_replace_callback('/\[\[note: ?(.*)\]\]/i', create_function('$m', 'return \'<a href="/horde/mnemo/notes/?q=\' . urlencode($m[1]) . \'">\' . htmlspecialchars($m[0]) . \'</a>\';'), $text);
+// $text = preg_replace_callback('/\[\[task: ?(.*)\]\]/i', create_function('$m', 'return \'<a href="/horde/nag/tasks/?q=\' . urlencode($m[1]) . \'">\' . htmlspecialchars($m[0]) . \'</a>\';'), $text);
//
-// return $text;
-// }
-// }
+// return $text;
+// }
+
+
+ /**
+ * TODO
+ */
+// function description_help()
+// {
+// return '<p>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.</p>';
+// }
-// if (!function_exists('_mnemo_hook_description_help')) {
-// function _mnemo_hook_description_help()
-// {
-// return '<p>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.</p>';
-// }
-// }
+}
<?php endif; ?>
<p><?php echo Horde::label('memo_body', _("Note _Text")) ?> (<?php printf(_("%s characters"), '<span id="charcount">' . Horde_String::length(str_replace(array("\r", "\n"), '', $memo_body)) . '</span>') ?>):</p>
<textarea name="memo_body" id="memo_body" class="fixed" rows="20" onchange="updateCharCount()" onclick="updateCharCount()" onkeypress="setTimeout('updateCharCount()', 1)"><?php echo htmlspecialchars($memo_body) ?></textarea>
- <?php try { echo Horde::callHook('_mnemo_hook_description_help', array(), 'mnemo', ''); } catch (Horde_Exception_HookNotSet $e) {} ?>
+ <?php try { echo Horde::callHook('description_help', array(), 'mnemo', ''); } catch (Horde_Exception_HookNotSet $e) {} ?>
<p>
<input type="submit" class="button" value="<?php echo _("Save") ?>" onclick="return checkCategory();" />
</div>
<?php else: ?>
<div class="noteBody">
- <?php $body = Horde_Text_Filter::filter($memo['body'], 'text2html', array('parselevel' => 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; ?>
+ <?php $body = Horde_Text_Filter::filter($memo['body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null)); try { $body = Horde::callHook('format_description', array($body), 'mnemo', $body); } catch (Horde_Exception_HookNotSet $e) {} echo $body; ?>
</div>
<?php endif; ?>
</td>