Added very basic plugins and themes edition
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 29 Jan 2002 20:13:37 +0000 (20:13 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 29 Jan 2002 20:13:37 +0000 (20:13 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2289 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/administrator/options.php
plugins/administrator/setup.php

index 02cdc2945cc385a7dc49810d4c80f48bdc071859..be1f0eb4e00270a691840ac946d624f50ab028f4 100644 (file)
@@ -210,6 +210,10 @@ foreach ( $newcfg as $k => $v ) {
         echo "<tr><td>$name</td><td>".
              "<b>$v</b>";
         $newcfg[$k] = "'$v'";
+        if ( isset( $defcfg[$k]['comment'] ) ) {
+            echo ' &nbsp; ' . $defcfg[$k]['comment'];
+        }
+        echo "</td></tr>\n";
         break;
     case SMOPT_TYPE_INTEGER:
         if ( isset( $HTTP_POST_VARS[$e] ) ) {
@@ -218,6 +222,10 @@ foreach ( $newcfg as $k => $v ) {
         }
         echo "<tr><td>$name</td><td>".
              "<input size=10 name=\"adm_$n\" value=\"$v\">";
+        if ( isset( $defcfg[$k]['comment'] ) ) {
+            echo ' &nbsp; ' . $defcfg[$k]['comment'];
+        }
+        echo "</td></tr>\n";
         break;
     case SMOPT_TYPE_NUMLIST:
         if ( isset( $HTTP_POST_VARS[$e] ) ) {
@@ -234,6 +242,10 @@ foreach ( $newcfg as $k => $v ) {
             echo ">$vp</option>";
         }
         echo '</select>';
+        if ( isset( $defcfg[$k]['comment'] ) ) {
+            echo ' &nbsp; ' . $defcfg[$k]['comment'];
+        }
+        echo "</td></tr>\n";
         break;
     case SMOPT_TYPE_STRLIST:
         if ( isset( $HTTP_POST_VARS[$e] ) ) {
@@ -250,6 +262,10 @@ foreach ( $newcfg as $k => $v ) {
             echo ">$vp</option>";
         }
         echo '</select>';
+        if ( isset( $defcfg[$k]['comment'] ) ) {
+            echo ' &nbsp; ' . $defcfg[$k]['comment'];
+        }
+        echo "</td></tr>\n";
         break;
 
     case SMOPT_TYPE_TEXTAREA:
@@ -259,6 +275,10 @@ foreach ( $newcfg as $k => $v ) {
         }
         echo "<tr><td valign=top>$name</td><td>".
              "<textarea cols=\"$size\" name=\"adm_$n\">" . substr( $v, 1, strlen( $v ) - 2 ) . "</textarea>";
+        if ( isset( $defcfg[$k]['comment'] ) ) {
+            echo ' &nbsp; ' . $defcfg[$k]['comment'];
+        }
+        echo "</td></tr>\n";
         break;
     case SMOPT_TYPE_STRING:
         if ( isset( $HTTP_POST_VARS[$e] ) ) {
@@ -267,6 +287,10 @@ foreach ( $newcfg as $k => $v ) {
         }
         echo "<tr><td>$name</td><td>".
              "<input size=\"$size\" name=\"adm_$n\" value=\"" . substr( $v, 1, strlen( $v ) - 2 ) . "\">";
+        if ( isset( $defcfg[$k]['comment'] ) ) {
+            echo ' &nbsp; ' . $defcfg[$k]['comment'];
+        }
+        echo "</td></tr>\n";
         break;
     case SMOPT_TYPE_BOOLEAN:
         if ( isset( $HTTP_POST_VARS[$e] ) ) {
@@ -285,16 +309,95 @@ foreach ( $newcfg as $k => $v ) {
         echo "<tr><td>$name</td><td>" .
              "<INPUT$ct type=radio NAME=\"adm_$n\" value=\"TRUE\">" . _("Yes") .
              "<INPUT$cf type=radio NAME=\"adm_$n\" value=\"FALSE\">" . _("No");
+        if ( isset( $defcfg[$k]['comment'] ) ) {
+            echo ' &nbsp; ' . $defcfg[$k]['comment'];
+        }
+        echo "</td></tr>\n";
         break;
     default:
         echo "<tr><td>$name</td><td>" .
              "<b><i>$v</i></b>";
+        if ( isset( $defcfg[$k]['comment'] ) ) {
+            echo ' &nbsp; ' . $defcfg[$k]['comment'];
+        }
+        echo "</td></tr>\n";
+    }
+
+}
+
+$i = 0;
+echo '<tr><th>' . _("Theme Name") .
+     '</th><th>' . _("Theme Path") .
+     '</th></tr>';
+while ( isset( $newcfg["\$theme[$i]['NAME']"] ) ) {
+    $k1 = "\$theme[$i]['NAME']";
+    $e1 = "theme_name_$i";
+    if ( isset( $HTTP_POST_VARS[$e1] ) ) {
+        $v1 = '"' . $HTTP_POST_VARS[$e1] . '"';
+        $newcfg[$k1] = $v1;
+    } else {
+        $v1 = $newcfg[$k1];
+    }
+    $k2 = "\$theme[$i]['PATH']";
+    $e2 = "theme_path_$i";
+    if ( isset( $HTTP_POST_VARS[$e2] ) ) {
+        $v2 = '"' . $HTTP_POST_VARS[$e2] . '"';
+        $newcfg[$k2] = $v2;
+    } else {
+        $v2 = $newcfg[$k2];
     }
-    if ( isset( $defcfg[$k]['comment'] ) ) {
-        echo ' &nbsp; ' . $defcfg[$k]['comment'];
+    $name = substr( $v1, 1, strlen( $v1 ) - 2 );
+    $path = substr( $v2, 1, strlen( $v2 ) - 2 );
+    echo '<tr>'.
+         "<td align=right><input name=\"$e1\" value=\"$name\" size=30></td>".
+         "<td><input name=\"$e2\" value=\"$path\" size=40></td>".
+         "</tr>\n";
+    $i++;
+
+}
+
+echo "<tr bgcolor=\"$color[0]\"><th colspan=2>" . _("Plugins") .  '</th></tr>';
+
+$fd = opendir( '../plugins/' );
+$op_plugin = array();
+while (false!==($file = readdir($fd))) {
+    if ($file != '.' && $file != '..' && $file != 'CVS' ) {
+        if ( filetype( $file ) == 'dir' ) {
+            $op_plugin[] = $file;
+        }
     }
-    echo "</td></tr>\n";
 }
+closedir($fd);
+asort( $op_plugin );
+
+$i = 0;
+while ( isset( $newcfg["\$plugins[$i]"] ) ) {
+    $k = "\$plugins[$i]";
+    $e = "plugin_$i";
+    if ( isset( $HTTP_POST_VARS[$e] ) ) {
+        $v = '"' . $HTTP_POST_VARS[$e] . '"';
+        $newcfg[$k] = $v;
+    } else {
+        $v = $newcfg[$k];
+    }
+    $name = substr( $v, 1, strlen( $v ) - 2 );
+    echo '<tr>'.
+         "<td align=right>$i.</td>".
+         "<td><select name=\"$e\">";
+    foreach ( $op_plugin as $op ) {
+        if ( $op == $name ) {
+            $cs = ' selected';
+        } else {
+            $cs = '';
+        }
+        echo "<option$cs>$op</option>";
+    }
+    echo "</select></td>".
+         '</tr>';
+    $i++;
+
+}
+
 echo "<tr bgcolor=\"$color[5]\"><th colspan=2><input value=\"" .
      _("Change Settings") . "\" type=submit></th></tr>" ,
      '</table></td></tr></table></form>';
index 3331da24567011d3816d1873f755a41785af867e..a90859ae1279b097dafd9d48aabc3afbfd7abb77 100644 (file)
@@ -30,7 +30,7 @@ function squirrelmail_administrator_optpage_register_block() {
     $optpage_blocks[] = array(
         'name' => _("Administration"),
         'url'  => '../plugins/administrator/options.php',
-        'desc' => _("This module allows administrators to run SquirrelMail configuration remotely."),
+        'desc' => _("This module allows administrators to manage SquirrelMail main configuration remotely."),
         'js'   => false
     );
 }