From 0b0e96c5adf15fdff2ed3bf8242c6a5573c1774f Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Tue, 5 Feb 2002 16:37:06 +0000 Subject: [PATCH] Code cleanup git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2368 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/bug_report/bug_report.php | 2 +- src/options.php | 157 ++++++++++++------------------ 2 files changed, 61 insertions(+), 98 deletions(-) diff --git a/plugins/bug_report/bug_report.php b/plugins/bug_report/bug_report.php index 5f5b0f51..aa95600c 100644 --- a/plugins/bug_report/bug_report.php +++ b/plugins/bug_report/bug_report.php @@ -28,7 +28,7 @@ require_once('../functions/imap.php'); require_once('../functions/array.php'); require_once('../functions/i18n.php'); require_once('../src/load_prefs.php'); -displayPageHeader($color, "None"); +displayPageHeader($color, 'None'); function Show_Array($array) { diff --git a/src/options.php b/src/options.php index 8e11f1b5..b2bd2254 100644 --- a/src/options.php +++ b/src/options.php @@ -19,18 +19,6 @@ require_once('../functions/array.php'); require_once('../functions/options.php'); require_once('../functions/strings.php'); -/* Set the base uri. */ -ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs); -$base_uri = $regs[1]; - -/* First and foremost, deal with language stuff. */ -if (isset($language)) { - setcookie('squirrelmail_language', $language, time()+2592000, $base_uri); - $squirrelmail_language = $language; -} else { - $language = getPref($data_dir, $username, 'language'); -} - /*********************************/ /*** Build the resultant page. ***/ /*********************************/ @@ -75,6 +63,51 @@ function process_optionmode_link($optpage) { /* There will be something here, later. */ } + +/** + * This function prints out an option page row. + */ +function print_optionpages_row($leftopt, $rightopt = false) { + global $color; + + echo "" . + '' . + "
' . + '' . + '' . + "'. + ""; + if ($rightopt) { + echo "'; + } else { + echo ""; + } + + echo '' . + '' . + "' . + ""; + if ($rightopt) { + echo "'; + } else { + echo ""; + } + + echo '' . + '
" . + '' . $leftopt['name'] . ''. + ' " . + '' . $rightopt['name'] . '' . + ' 
" . + $leftopt['desc'] . + ' " . + $rightopt['desc'] . + ' 
' . + '
\n"; +} + +/* ---------------------------- main ---------------------------- */ + /* Make sure we have an Option Page set. Default to main. */ if (!isset($optpage)) { $optpage = 'main'; @@ -85,9 +118,9 @@ if (!isset($optmode)) { $optmode = SMOPT_MODE_DISPLAY; } -/*************************************************************/ -/*** First, set the load information for each option page. ***/ -/*************************************************************/ +/* + * First, set the load information for each option page. + */ /* Initialize load information variables. */ $optpage_name = ''; @@ -167,16 +200,12 @@ if (isset($optpage_name) && ($optpage_name != '')) { $optpage_title .= " - $optpage_name"; } -?> - -
- -' . + '
-
- - ' . - "
- -' . + "\n". + ' -
'. + "$optpage_title
\n". + ''. + " -
\n"; /*******************************************************************/ /* DO OLD SAVING OF SUBMITTED OPTIONS. THIS WILL BE REMOVED LATER. */ @@ -389,76 +418,10 @@ if ($optpage == SMOPT_PAGE_MAIN) { } } -?> -
- -
- - - -" . - '
' . - '' . - '' . - "'. - ""; - if ($rightopt) { - echo "'; - } else { - echo ""; - } - - echo '' . "\n" . - '' . - "' . - ""; - if ($rightopt) { - echo "'; - } else { - echo ""; - } - - echo '' . "\n" . - '
" . - '' . $leftopt['name'] . ''. - ' " . - '' . $rightopt['name'] . '' . - ' 
" . - $leftopt['desc'] . - ' " . - $rightopt['desc'] . - ' 
' . - '
\n"; - } +echo '
'. + ''. + '' . + ''; -?> +?> \ No newline at end of file -- 2.25.1