From ff66d3582269f87340d2ec4c7efcec3bea390e28 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Sat, 14 Feb 2026 12:55:52 -0500 Subject: [PATCH] Revert "fix: Add conditional to hook class template to prevent double declaration issues" This reverts commit da15ce73b5362e59f772cf2e8efd07aa13557d19. --- config/hooks.php.dist | 48 +++++++++++++++++++++---------------------- config/prefs.php | 9 ++++---- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/config/hooks.php.dist b/config/hooks.php.dist index 04962238..367dc497 100644 --- a/config/hooks.php.dist +++ b/config/hooks.php.dist @@ -1,5 +1,4 @@ \0', $text); - // $text = preg_replace('/(bug|ticket|request|enhancement|issue):\s*#?(\d+)/i', '\0', $text); - // - // $text = preg_replace_callback('/\[\[note: ?(.*)\]\]/i', function ($m) { return '' . htmlspecialchars($m[0]) . ''; }, $text); - // $text = preg_replace_callback('/\[\[task: ?(.*)\]\]/i', function ($m) { return '' . htmlspecialchars($m[0]) . ''; }, $text); - // - // return $text; - // } + +class Mnemo_Hooks +{ + /** + * TODO + */ +// public 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', function ($m) { return '' . htmlspecialchars($m[0]) . ''; }, $text); +// $text = preg_replace_callback('/\[\[task: ?(.*)\]\]/i', function ($m) { return '' . htmlspecialchars($m[0]) . ''; }, $text); +// +// return $text; +// } - /** - * TODO - */ - // 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.

'; - // } + /** + * TODO + */ +// 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/config/prefs.php b/config/prefs.php index 7a214e7a..2a06b5ca 100644 --- a/config/prefs.php +++ b/config/prefs.php @@ -1,5 +1,4 @@ 'enum', 'enum' => array(), 'desc' => _("Your default notepad:"), - 'on_init' => function ($ui) { + 'on_init' => function($ui) { $enum = array(); foreach (Mnemo::listNotepads(false, Horde_Perms::EDIT) as $key => $val) { $enum[$key] = Mnemo::getLabel($val); } $ui->prefs['default_notepad']['enum'] = $enum; }, - 'on_change' => function () { + 'on_change' => function() { $GLOBALS['injector']->getInstance('Mnemo_Factory_Notepads') ->create() ->setDefaultShare($GLOBALS['prefs']->getValue('default_notepad')); @@ -108,7 +107,7 @@ 'type' => 'multienum', 'enum' => array(), 'desc' => _("Select the notepads that, in addition to the default, should be used for synchronization with external devices:"), - 'on_init' => function ($ui) { + 'on_init' => function($ui) { $enum = array(); $sync = @unserialize($GLOBALS['prefs']->getValue('sync_notepads')); if (empty($sync)) { @@ -125,7 +124,7 @@ } $ui->prefs['sync_notepads']['enum'] = $enum; }, - 'on_change' => function () { + 'on_change' => function() { $sync = @unserialize($GLOBALS['prefs']->getValue('sync_notepads')); $haveDefault = false; $default = Mnemo::getDefaultNotepad(Horde_Perms::DELETE);