From: Michael M Slusarz Date: Thu, 16 Sep 2010 21:07:20 +0000 (-0600) Subject: Give option to disable up/down movement in source select widget X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=03f10878bdd362bd069c02f859395e22cf1c7b7a;p=horde.git Give option to disable up/down movement in source select widget --- diff --git a/framework/Core/lib/Horde/Core/Prefs/Ui/Widgets.php b/framework/Core/lib/Horde/Core/Prefs/Ui/Widgets.php index f8f98c15b..3ce0cf967 100644 --- a/framework/Core/lib/Horde/Core/Prefs/Ui/Widgets.php +++ b/framework/Core/lib/Horde/Core/Prefs/Ui/Widgets.php @@ -30,6 +30,8 @@ class Horde_Core_Prefs_Ui_Widgets * @param array $data Data items: *
      * 'mainlabel' - (string) Main label.
+     * 'no_up' - (boolean) [OPTIONAL] Disable movement of selected items
+     *           up/down.
      * 'selectlabel' - (array) Selected label.
      * 'sourcelabel' - (string) [OPTIONAL] Source selection label.
      * 'sources' - (array) List of sources - keys are source names. Each
@@ -90,8 +92,10 @@ class Horde_Core_Prefs_Ui_Widgets
         $t->set('addimg', Horde::img(isset($GLOBALS['registry']->nlsconfig['rtl'][$GLOBALS['language']]) ? 'lhand.png' : 'rhand.png', _("Add source")));
         $t->set('removeimg', Horde::img(isset($GLOBALS['registry']->nlsconfig['rtl'][$GLOBALS['language']]) ? 'rhand.png' : 'lhand.png', _("Remove source")));
 
-        $t->set('upimg', Horde::img('nav/up.png', _("Move up")));
-        $t->set('downimg', Horde::img('nav/down.png', _("Move down")));
+        if (empty($data['no_up'])) {
+            $t->set('upimg', Horde::img('nav/up.png', _("Move up")));
+            $t->set('downimg', Horde::img('nav/down.png', _("Move down")));
+        }
 
         return $t->fetch(HORDE_TEMPLATES . '/prefs/source.html');
     }
diff --git a/horde/templates/prefs/source.html b/horde/templates/prefs/source.html
index 4a958a496..cf9ff88e5 100644
--- a/horde/templates/prefs/source.html
+++ b/horde/templates/prefs/source.html
@@ -41,11 +41,13 @@
 
     
    
+
    
     
     
+