From c636744bf76414e101c38cb30c3edb9cccd5db60 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 30 Nov 2009 13:50:31 -0700 Subject: [PATCH] prefsHandle->prefsSpecial; add prefsSpecialGenerate callback --- framework/Prefs/lib/Horde/Prefs/Ui.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/framework/Prefs/lib/Horde/Prefs/Ui.php b/framework/Prefs/lib/Horde/Prefs/Ui.php index 12f7cbfe5..5c6c1a42b 100644 --- a/framework/Prefs/lib/Horde/Prefs/Ui.php +++ b/framework/Prefs/lib/Horde/Prefs/Ui.php @@ -1,7 +1,7 @@ isLocked($pref) || ($_prefs[$pref]['type'] == 'special')) { switch ($_prefs[$pref]['type']) { - - /* These either aren't set or are set in other - * parts of the UI. */ case 'implicit': case 'link': + /* These either aren't set or are set in other + * parts of the UI. */ break; case 'select': @@ -169,8 +176,8 @@ class Horde_Prefs_Ui case 'special': /* Code for special elements written specifically * for each application. */ - if ($registry->hasAppMethod($app, 'prefsHandle')) { - $updated = $updated | $registry->callAppMethod($app, 'prefsHandle', array('args' => array($pref, $updated))); + if ($registry->hasAppMethod($app, 'prefsSpecial')) { + $updated = $updated | $registry->callAppMethod($app, 'prefsSpecial', array('args' => array($pref, $updated))); } break; } @@ -260,7 +267,10 @@ class Horde_Prefs_Ui break; case 'special': - require $registry->get('templates', empty($_prefs[$pref]['shared']) ? $registry->getApp() : 'horde') . '/prefs/' . $pref . '.inc'; + if (!$registry->hasAppMethod($app, 'prefsSpecialGenerate') || + $registry->callAppMethod($app, 'prefsSpecialGenerate', array('args' => array($pref)))) { + require $registry->get('templates', empty($_prefs[$pref]['shared']) ? $registry->getApp() : 'horde') . '/prefs/' . $pref . '.inc'; + } break; default: -- 2.11.0