Functions for options pages. Must be used if you want to display an
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 28 Oct 2001 00:36:05 +0000 (00:36 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 28 Oct 2001 00:36:05 +0000 (00:36 +0000)
option on an option page.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1628 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/options.php [new file with mode: 0644]

diff --git a/functions/options.php b/functions/options.php
new file mode 100644 (file)
index 0000000..ee50d54
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+   /**
+    **  options.php
+    **
+    **  Copyright (c) 1999-2000 The SquirrelMail development team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  Functions needed to display the options pages.
+    **
+    **  $Id$
+    **/
+
+    function OptionSelect( $title, $name, $data, $default, $show = '', $store = '' ) {
+
+        echo "<tr><td align=right valign=middle nowrap>$title</td><td>" .
+             "<select name=\"$name\">";
+        foreach( $data as $key => $opt ) {
+            if ( $store == '' ) {
+                $vl = $key;
+            } else{
+                $vl = $opt[$store];
+            }
+            if ( $show == '' ) {
+                $nm = $opt;
+            } else{
+                $nm = $opt[$show];
+            }
+            if ( $nm <> '') {
+                echo "<option value=\"$vl\"";
+                if( $vl == $default ) {
+                    echo ' selected';
+                }
+                echo ">$nm</option>\n";
+            }
+        }
+        echo "</select></td></tr>\n";
+
+    }
+
+    function OptionRadio( $title, $name, $data, $default, $show = '', $store = '', $sep = '&nbsp; &nbsp;'  ) {
+
+        echo "<tr><td align=right valign=middle nowrap>$title</td><td>";
+        foreach( $data as $key => $opt ) {
+            if ( $store == '' ) {
+                $vl = $key;
+            } else{
+                $vl = $opt[$store];
+            }
+            if ( $show == '' ) {
+                $nm = $opt;
+            } else{
+                $nm = $opt[$show];
+            }
+            if ( $nm <> '') {
+                echo "<input type=\"radio\" name=\"$name\" value=\"$vl\"";
+                if( $vl == $default ) {
+                    echo ' checked';
+                }
+                echo ">$nm $sep\n";
+            }
+        }
+        echo "</td></tr>\n";
+
+    }
+
+    function OptionText( $title, $name, $value, $size ) {
+
+        echo "<tr><td align=right valign=middle nowrap>$title</td><td>" .
+             "<input name=\"$name\" value=\"$value\" size=\"$size\">" .
+             "</td></tr>\n";
+
+    }
+
+    function OptionCheck( $title, $name, $value, $comment ) {
+
+        if ( $value )
+            $chk = 'checked';
+        echo "<tr><td align=right valign=middle nowrap>$title</td><td>" .
+             "<input type=\"checkbox\" name=\"$name\" $chk> $comment" .
+             "</td></tr>\n";
+
+    }
+
+?>
\ No newline at end of file