From 835db280639a530c9336208f24501eec0dfe28ef Mon Sep 17 00:00:00 2001 From: pdontthink Date: Fri, 8 Dec 2006 05:24:15 +0000 Subject: [PATCH] Remove embedded HTML for displaying submit buttons on option pages, also display more than one submit button so you need not scroll to the bottom to change options right at the top of a page. Doesn't look so good on the Personal Information page, so if anyone has any bright ideas on how to fine-tune this... git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11989 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/options.php | 44 ----------------------------------- src/options.php | 9 +++---- templates/default/options.tpl | 6 ++++- 3 files changed, 10 insertions(+), 49 deletions(-) diff --git a/functions/options.php b/functions/options.php index 7b60af67..ccd40206 100644 --- a/functions/options.php +++ b/functions/options.php @@ -689,48 +689,4 @@ function create_option_groups($optgrps, $optvals) { return ($result); } -/** - * @param array $option_groups - */ -function print_option_groups($option_groups) { - /* Print each option group. */ - foreach ($option_groups as $next_optgrp) { - /* If it is not blank, print the name for this option group. */ - if ($next_optgrp['name'] != '') { - echo html_tag( 'tr', "\n". - html_tag( 'td', - '' . $next_optgrp['name'] . '' , - 'center' ,'', 'valign="middle" colspan="2" style="white-space: nowrap;"' ) - ) ."\n"; - } - - /* Print each option in this option group. */ - foreach ($next_optgrp['options'] as $option) { - if ($option->type != SMOPT_TYPE_HIDDEN) { - echo html_tag( 'tr', "\n". - html_tag( 'td', $option->caption . ':', 'right' ,'', 'valign="middle"' ) . - html_tag( 'td', $option->createHTMLWidget(), 'left' ) - ) ."\n"; - } else { - echo $option->createHTMLWidget(); - } - } - - /* Print an empty row after this option group. */ - echo html_tag( 'tr', - html_tag( 'td', ' ', 'left', '', 'colspan="2"' ) - ) . "\n"; - } -} - -/** - * Create submit button inside table row. - * @param string $name - */ -function OptionSubmit( $name ) { - echo html_tag( 'tr', - html_tag( 'td', '    ', 'right', '', 'colspan="2"' ) - ) . "\n"; -} - // vim: et ts=4 diff --git a/src/options.php b/src/options.php index 6ef511f0..a376454a 100644 --- a/src/options.php +++ b/src/options.php @@ -406,7 +406,7 @@ if ($optpage == SMOPT_PAGE_MAIN) { /** * The variables below should not be needed by the template since all plugin * hooks are called here, not in the template. If we find otherwise, these - * variables can be passed to the template. Commenting out for not. + * variables can be passed to the template. Commenting out for now. */ /* $oTemplate->assign('max_refresh', isset($max_refresh) ? $max_refresh : NULL); @@ -420,8 +420,10 @@ if ($optpage == SMOPT_PAGE_MAIN) { * END comment block */ + $oTemplate->assign('submit_name', $submit_name); $oTemplate->display('options.tpl'); +//FIXME: need to remove HTML from here! echo " \n" . " \n"; @@ -430,8 +432,7 @@ if ($optpage == SMOPT_PAGE_MAIN) { do_hook($inside_hook_name); } - /* Spit out a submit button. */ - OptionSubmit($submit_name); +//FIXME: need to remove HTML from here! echo "\n" . "\n"; @@ -443,4 +444,4 @@ if ($optpage == SMOPT_PAGE_MAIN) { } $oTemplate->display('footer.tpl'); -?> \ No newline at end of file +?> diff --git a/templates/default/options.tpl b/templates/default/options.tpl index 24652335..31e317c2 100644 --- a/templates/default/options.tpl +++ b/templates/default/options.tpl @@ -50,7 +50,11 @@ foreach ($options as $option) { } } + echo " \n \n" + . "     \n \n \n"; + echo "\n"; } ?> - \ No newline at end of file + -- 2.25.1