From 6a9acbca99e0444d2d958cc2ce16cd29565570b6 Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Tue, 29 Jan 2002 20:13:37 +0000 Subject: [PATCH 1/1] Added very basic plugins and themes edition git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2289 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/administrator/options.php | 109 +++++++++++++++++++++++++++++- plugins/administrator/setup.php | 2 +- 2 files changed, 107 insertions(+), 4 deletions(-) diff --git a/plugins/administrator/options.php b/plugins/administrator/options.php index 02cdc294..be1f0eb4 100644 --- a/plugins/administrator/options.php +++ b/plugins/administrator/options.php @@ -210,6 +210,10 @@ foreach ( $newcfg as $k => $v ) { echo "$name". "$v"; $newcfg[$k] = "'$v'"; + if ( isset( $defcfg[$k]['comment'] ) ) { + echo '   ' . $defcfg[$k]['comment']; + } + echo "\n"; break; case SMOPT_TYPE_INTEGER: if ( isset( $HTTP_POST_VARS[$e] ) ) { @@ -218,6 +222,10 @@ foreach ( $newcfg as $k => $v ) { } echo "$name". ""; + if ( isset( $defcfg[$k]['comment'] ) ) { + echo '   ' . $defcfg[$k]['comment']; + } + echo "\n"; break; case SMOPT_TYPE_NUMLIST: if ( isset( $HTTP_POST_VARS[$e] ) ) { @@ -234,6 +242,10 @@ foreach ( $newcfg as $k => $v ) { echo ">$vp"; } echo ''; + if ( isset( $defcfg[$k]['comment'] ) ) { + echo '   ' . $defcfg[$k]['comment']; + } + echo "\n"; break; case SMOPT_TYPE_STRLIST: if ( isset( $HTTP_POST_VARS[$e] ) ) { @@ -250,6 +262,10 @@ foreach ( $newcfg as $k => $v ) { echo ">$vp"; } echo ''; + if ( isset( $defcfg[$k]['comment'] ) ) { + echo '   ' . $defcfg[$k]['comment']; + } + echo "\n"; break; case SMOPT_TYPE_TEXTAREA: @@ -259,6 +275,10 @@ foreach ( $newcfg as $k => $v ) { } echo "$name". ""; + if ( isset( $defcfg[$k]['comment'] ) ) { + echo '   ' . $defcfg[$k]['comment']; + } + echo "\n"; break; case SMOPT_TYPE_STRING: if ( isset( $HTTP_POST_VARS[$e] ) ) { @@ -267,6 +287,10 @@ foreach ( $newcfg as $k => $v ) { } echo "$name". ""; + if ( isset( $defcfg[$k]['comment'] ) ) { + echo '   ' . $defcfg[$k]['comment']; + } + echo "\n"; break; case SMOPT_TYPE_BOOLEAN: if ( isset( $HTTP_POST_VARS[$e] ) ) { @@ -285,16 +309,95 @@ foreach ( $newcfg as $k => $v ) { echo "$name" . "" . _("Yes") . "" . _("No"); + if ( isset( $defcfg[$k]['comment'] ) ) { + echo '   ' . $defcfg[$k]['comment']; + } + echo "\n"; break; default: echo "$name" . "$v"; + if ( isset( $defcfg[$k]['comment'] ) ) { + echo '   ' . $defcfg[$k]['comment']; + } + echo "\n"; + } + +} + +$i = 0; +echo '' . _("Theme Name") . + '' . _("Theme Path") . + ''; +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 '   ' . $defcfg[$k]['comment']; + $name = substr( $v1, 1, strlen( $v1 ) - 2 ); + $path = substr( $v2, 1, strlen( $v2 ) - 2 ); + echo ''. + "". + "". + "\n"; + $i++; + +} + +echo "" . _("Plugins") . ''; + +$fd = opendir( '../plugins/' ); +$op_plugin = array(); +while (false!==($file = readdir($fd))) { + if ($file != '.' && $file != '..' && $file != 'CVS' ) { + if ( filetype( $file ) == 'dir' ) { + $op_plugin[] = $file; + } } - echo "\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 ''. + "$i.". + "". + ''; + $i++; + +} + echo "" , ''; diff --git a/plugins/administrator/setup.php b/plugins/administrator/setup.php index 3331da24..a90859ae 100644 --- a/plugins/administrator/setup.php +++ b/plugins/administrator/setup.php @@ -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 ); } -- 2.25.1