From 876fdb605dcb48b44b5c0a3a6f2f106c941e5c20 Mon Sep 17 00:00:00 2001 From: kink Date: Tue, 6 Mar 2007 14:57:12 +0000 Subject: [PATCH] do not special case a folder named 'None'. There's no reason to not use the empty string and this prevents people who want to have a "None" folder from using it properly. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12315 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + functions/imap_mailbox.php | 3 +-- functions/page_header.php | 2 +- help/en_US/options.hlp | 2 +- plugins/abook_take/take.php | 4 ++-- plugins/administrator/options.php | 4 ++-- plugins/bug_report/bug_report.php | 4 ++-- plugins/calendar/calendar.php | 4 ++-- plugins/calendar/day.php | 4 ++-- plugins/calendar/event_create.php | 4 ++-- plugins/calendar/event_delete.php | 4 ++-- plugins/calendar/event_edit.php | 4 ++-- plugins/change_password/options.php | 2 +- plugins/filters/options.php | 2 +- plugins/filters/spamoptions.php | 2 +- plugins/info/options.php | 2 +- plugins/listcommands/options.php | 2 +- plugins/mail_fetch/fetch.php | 2 +- plugins/mail_fetch/options.php | 2 +- plugins/newmail/newmail_opt.php | 2 +- plugins/spamcop/options.php | 4 ++-- plugins/squirrelspell/sqspell_functions.php | 2 +- plugins/translate/options.php | 4 ++-- src/about.php | 2 +- src/addressbook.php | 2 +- src/compose.php | 2 +- src/folders.php | 2 +- src/help.php | 2 +- src/image.php | 2 +- src/left_main.php | 2 +- src/options.php | 2 +- src/options_highlight.php | 2 +- src/options_identities.php | 2 +- src/options_order.php | 2 +- src/search.php | 2 +- src/vcard.php | 4 ++-- src/view_text.php | 2 +- templates/default/page_header.tpl | 2 +- 38 files changed, 49 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7ee71f2..fb4ce220 100644 --- a/ChangeLog +++ b/ChangeLog @@ -186,6 +186,7 @@ Version 1.5.2 - SVN better-than-nothing alternative. - Fix Priority and Receipt compose options being reset after return from HTML addressbook, and allow returning from an empty address book (#1673056). + - Do not special case the 'None' folder. Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 5d0e5ab4..e7c41309 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -360,8 +360,7 @@ function sqimap_mailbox_exists ($imap_stream, $mailbox, $mailboxlist=null) { * @since 1.0 or older */ function sqimap_mailbox_select ($imap_stream, $mailbox) { - // FIX ME: WHAAAA DO NOT USE "None" for something that does not exist. Use false or NULL instead - if ($mailbox == 'None') { + if (empty($mailbox)) { return; } diff --git a/functions/page_header.php b/functions/page_header.php index 530774a8..c181479d 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -196,7 +196,7 @@ function displayInternalLink($path, $text, $target='') { * @return void */ -function displayPageHeader($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') { +function displayPageHeader($color, $mailbox='', $sHeaderJs='', $sBodyTagJs = '') { global $reply_focus, $hide_sm_attributions, $frame_top, $provider_name, $provider_uri, $startMessage, diff --git a/help/en_US/options.hlp b/help/en_US/options.hlp index 9cf33468..31d6508a 100644 --- a/help/en_US/options.hlp +++ b/help/en_US/options.hlp @@ -268,7 +268,7 @@ messages, the INBOX will become bold and a number will appear to the right of it to say how many new messages are in it. If you set it to All Folders, this behavior will happen on all folders. If you notice that loading the folder list - is really slow, you can set this to INBOX or None and that should speed it up. + is really slow, you can set this to INBOX and that should speed it up.

Unseen message notification type
diff --git a/plugins/abook_take/take.php b/plugins/abook_take/take.php index 1f9c8d51..3ac2c509 100644 --- a/plugins/abook_take/take.php +++ b/plugins/abook_take/take.php @@ -22,7 +22,7 @@ require('../../include/init.php'); require(SM_PATH . 'functions/forms.php'); require(SM_PATH . 'functions/addressbook.php'); -displayPageHeader($color, 'None'); +displayPageHeader($color); /* input form data */ sqgetGlobalVar('email', $email, SQ_POST); @@ -45,4 +45,4 @@ $formdata=array('email'=>$addrs); abook_create_form(SM_PATH . 'src/addressbook.php','addaddr',_("Add to address book"),_("Add address"),$formdata); echo ''; ?> - \ No newline at end of file + diff --git a/plugins/administrator/options.php b/plugins/administrator/options.php index 15a1c4b2..57e631b5 100644 --- a/plugins/administrator/options.php +++ b/plugins/administrator/options.php @@ -233,7 +233,7 @@ if ( !adm_check_user() ) { exit; } -displayPageHeader($color, 'None'); +displayPageHeader($color); $newcfg = array( ); @@ -646,4 +646,4 @@ if ( $fp = @fopen( $cfgfile, 'w' ) ) { } ?> - \ No newline at end of file + diff --git a/plugins/bug_report/bug_report.php b/plugins/bug_report/bug_report.php index c62498ca..2e847584 100644 --- a/plugins/bug_report/bug_report.php +++ b/plugins/bug_report/bug_report.php @@ -24,7 +24,7 @@ require_once(SM_PATH . 'functions/forms.php'); /** load plugin functions */ require_once(SM_PATH . 'plugins/bug_report/functions.php'); -displayPageHeader($color, 'None'); +displayPageHeader($color); /** is bug_report plugin disabled or called by wrong user */ if (! is_plugin_enabled('bug_report') || ! bug_report_check_user()) { @@ -131,4 +131,4 @@ echo addSubmit(_("Start Bug Report Form"));
- \ No newline at end of file + diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index dae2a87d..f76e2d0f 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -169,7 +169,7 @@ if( !isset($day) || $day <= 0){ $todayis = date( 'mdY' ); $calself=basename($PHP_SELF); -displayPageHeader($color, 'None'); +displayPageHeader($color); calendar_header(); readcalendardata(); startcalendar(); @@ -177,4 +177,4 @@ drawmonthview(); endcalendar(); ?> - \ No newline at end of file + diff --git a/plugins/calendar/day.php b/plugins/calendar/day.php index a2a2049b..40e4a4df 100644 --- a/plugins/calendar/day.php +++ b/plugins/calendar/day.php @@ -169,7 +169,7 @@ $calself=basename($PHP_SELF); $daily_events = array(); -displayPageHeader($color, 'None'); +displayPageHeader($color); calendar_header(); readcalendardata(); day_header(); @@ -177,4 +177,4 @@ initialize_events(); display_events(); ?> - \ No newline at end of file + diff --git a/plugins/calendar/event_create.php b/plugins/calendar/event_create.php index 86fe2e84..db2347c2 100644 --- a/plugins/calendar/event_create.php +++ b/plugins/calendar/event_create.php @@ -122,7 +122,7 @@ if (!isset($hour) || $hour <= 0){ $calself=basename($PHP_SELF); -displayPageHeader($color, 'None'); +displayPageHeader($color); //load calendar menu calendar_header(); @@ -175,4 +175,4 @@ if(!isset($event_text)){ ?> - \ No newline at end of file + diff --git a/plugins/calendar/event_delete.php b/plugins/calendar/event_delete.php index dc90191b..79867aef 100644 --- a/plugins/calendar/event_delete.php +++ b/plugins/calendar/event_delete.php @@ -119,7 +119,7 @@ if ($day <= 0){ $calself=basename($PHP_SELF); -displayPageHeader($color, 'None'); +displayPageHeader($color); //load calendar menu calendar_header(); @@ -145,4 +145,4 @@ if (isset($dyear) && isset($dmonth) && isset($dday) && isset($dhour) && isset($d ?> - \ No newline at end of file + diff --git a/plugins/calendar/event_edit.php b/plugins/calendar/event_edit.php index 7d38c64e..5b94a1b7 100644 --- a/plugins/calendar/event_edit.php +++ b/plugins/calendar/event_edit.php @@ -255,7 +255,7 @@ if ($hour <= 0){ $calself=basename($PHP_SELF); -displayPageHeader($color, 'None'); +displayPageHeader($color); //load calendar menu calendar_header(); @@ -311,4 +311,4 @@ if (!isset($updated)){ ?> - \ No newline at end of file + diff --git a/plugins/change_password/options.php b/plugins/change_password/options.php index 15b674ea..9b72d6c4 100644 --- a/plugins/change_password/options.php +++ b/plugins/change_password/options.php @@ -62,7 +62,7 @@ if(sqgetGlobalVar('cpw_go', $cpw_go, SQ_POST)) { } } -displayPageHeader($color, 'None'); +displayPageHeader($color); do_hook('change_password_init', $null); ?> diff --git a/plugins/filters/options.php b/plugins/filters/options.php index 8056a83d..9cc1e54e 100644 --- a/plugins/filters/options.php +++ b/plugins/filters/options.php @@ -18,7 +18,7 @@ include_once(SM_PATH . 'functions/imap_general.php'); include_once(SM_PATH . 'functions/forms.php'); include_once(SM_PATH . 'plugins/filters/filters.php'); -displayPageHeader($color, 'None'); +displayPageHeader($color); /* get globals */ sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); diff --git a/plugins/filters/spamoptions.php b/plugins/filters/spamoptions.php index bcef8e51..16b25835 100644 --- a/plugins/filters/spamoptions.php +++ b/plugins/filters/spamoptions.php @@ -25,7 +25,7 @@ sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); sqgetGlobalVar('action', $action, SQ_GET); /* end globals */ -displayPageHeader($color, 'None'); +displayPageHeader($color); if (sqgetGlobalVar('spam_submit',$spam_submit,SQ_POST)) { $spam_filters = load_spam_filters(); diff --git a/plugins/info/options.php b/plugins/info/options.php index 79fa0d18..d09ee6cd 100644 --- a/plugins/info/options.php +++ b/plugins/info/options.php @@ -26,7 +26,7 @@ require_once(SM_PATH . 'plugins/info/functions.php'); global $username, $color, $folder_prefix, $default_charset; $default_charset = strtoupper($default_charset); -displayPageHeader($color, 'None'); +displayPageHeader($color); $mailbox = 'INBOX'; /** diff --git a/plugins/listcommands/options.php b/plugins/listcommands/options.php index 26e4ec23..67dfc015 100644 --- a/plugins/listcommands/options.php +++ b/plugins/listcommands/options.php @@ -70,7 +70,7 @@ if (sqGetGlobalVar('addlist', $ignore, SQ_FORM) -displayPageHeader($color, 'None'); +displayPageHeader($color); $oTemplate->assign('lists', $lists); $oTemplate->display('plugins/listcommands/non_rfc_lists.tpl'); diff --git a/plugins/mail_fetch/fetch.php b/plugins/mail_fetch/fetch.php index 918fe298..17711ec5 100644 --- a/plugins/mail_fetch/fetch.php +++ b/plugins/mail_fetch/fetch.php @@ -119,7 +119,7 @@ function Mail_Fetch_Select_Server($mailfetch) { } $mailfetch = Mail_Fetch_Servers(); -displayPageHeader($color, 'None'); +displayPageHeader($color); echo '
'; diff --git a/plugins/mail_fetch/options.php b/plugins/mail_fetch/options.php index 81780f19..7931bb61 100644 --- a/plugins/mail_fetch/options.php +++ b/plugins/mail_fetch/options.php @@ -55,7 +55,7 @@ sqgetGlobalVar('submit_mailfetch', $submit_mailfetch, SQ_POST); /* end globals */ -displayPageHeader( $color, 'None' ); +displayPageHeader( $color ); switch( $mf_action ) { case 'add': diff --git a/plugins/newmail/newmail_opt.php b/plugins/newmail/newmail_opt.php index 5b194f38..24678eef 100644 --- a/plugins/newmail/newmail_opt.php +++ b/plugins/newmail/newmail_opt.php @@ -23,7 +23,7 @@ include_once(SM_PATH . 'plugins/newmail/functions.php'); include_once(SM_PATH . 'functions/forms.php'); -displayPageHeader($color, 'None'); +displayPageHeader($color); echo html_tag( 'table', '', 'center', $color[0], 'width="95%" cellpadding="1" cellspacing="0" border="0"' ) . "\n" . html_tag( 'tr' ) . "\n" . diff --git a/plugins/spamcop/options.php b/plugins/spamcop/options.php index f30987ad..8e186181 100755 --- a/plugins/spamcop/options.php +++ b/plugins/spamcop/options.php @@ -18,7 +18,7 @@ require('../../include/init.php'); /* plugin functions */ include_once(SM_PATH . 'plugins/spamcop/functions.php'); -displayPageHeader($color, 'None'); +displayPageHeader($color); /** is spamcop plugin disabled */ // option changes do nothing, if read_body_header_right hook is not active. @@ -194,4 +194,4 @@ echo '

' . _("More information") . '
'; printf(_("For more information about SpamCop, it's services, spam in general, and many related topics, try reading through SpamCop's %sHelp and Feedback%s section."), '', ''); echo "

\n"; ?> - \ No newline at end of file + diff --git a/plugins/squirrelspell/sqspell_functions.php b/plugins/squirrelspell/sqspell_functions.php index 4044f23a..7f8d771d 100644 --- a/plugins/squirrelspell/sqspell_functions.php +++ b/plugins/squirrelspell/sqspell_functions.php @@ -125,7 +125,7 @@ function sqspell_makePage($title, $scriptsrc, $body){ $MOD = 'options_main'; } - displayPageHeader($color, 'None'); + displayPageHeader($color); echo " 
\n"; /** * Check if we need to link in a script. diff --git a/plugins/translate/options.php b/plugins/translate/options.php index 7974d6ff..7e18ef25 100644 --- a/plugins/translate/options.php +++ b/plugins/translate/options.php @@ -20,7 +20,7 @@ require('../../include/init.php'); /** Plugin functions */ include_once(SM_PATH . 'plugins/translate/functions.php'); -displayPageHeader($color, 'None'); +displayPageHeader($color); ?>
@@ -78,4 +78,4 @@ if (!$disable_compose_translate) {
- \ No newline at end of file + diff --git a/src/about.php b/src/about.php index 98ed98da..5a121887 100644 --- a/src/about.php +++ b/src/about.php @@ -21,7 +21,7 @@ */ require('../include/init.php'); -displayPageHeader($color, 'None' ); +displayPageHeader($color); ?>

diff --git a/src/addressbook.php b/src/addressbook.php index bfb0a253..69e45f7b 100644 --- a/src/addressbook.php +++ b/src/addressbook.php @@ -40,7 +40,7 @@ sqgetGlobalVar('doedit', $doedit, SQ_POST); $abook_sort_order = get_abook_sort(); /* Create page header before addressbook_init in order to display error messages correctly. */ -displayPageHeader($color, 'None'); +displayPageHeader($color); /* Open addressbook with error messages on. remote backends (LDAP) are enabled because they can be used. (list_addr function) diff --git a/src/compose.php b/src/compose.php index 9e72e917..2da86907 100644 --- a/src/compose.php +++ b/src/compose.php @@ -383,7 +383,7 @@ if (!isset($compose_messages[$session]) || ($compose_messages[$session] == NULL) $composeMessage=$compose_messages[$session]; } -if (!isset($mailbox) || $mailbox == '' || ($mailbox == 'None')) { +if (empty($mailbox)) { $mailbox = 'INBOX'; } diff --git a/src/folders.php b/src/folders.php index 91e41d79..ae3c8967 100644 --- a/src/folders.php +++ b/src/folders.php @@ -22,7 +22,7 @@ require_once(SM_PATH . 'functions/imap_general.php'); require_once(SM_PATH . 'functions/folder_manip.php'); require_once(SM_PATH . 'functions/forms.php'); -displayPageHeader($color, 'None'); +displayPageHeader($color); /* get globals we may need */ sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); diff --git a/src/help.php b/src/help.php index fd0525e7..ebfa81b1 100644 --- a/src/help.php +++ b/src/help.php @@ -16,7 +16,7 @@ */ require('../include/init.php'); -displayPageHeader($color, 'None' ); +displayPageHeader($color); $helpdir[0] = 'basic.hlp'; $helpdir[1] = 'main_folder.hlp'; diff --git a/src/image.php b/src/image.php index e1a2680c..2bf417c5 100644 --- a/src/image.php +++ b/src/image.php @@ -16,7 +16,7 @@ */ require('../include/init.php'); -displayPageHeader($color, 'None'); +displayPageHeader($color); /* globals */ if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) { diff --git a/src/left_main.php b/src/left_main.php index 3805ec17..5b1cf17e 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -69,7 +69,7 @@ if ($auto_create_special && !isset($auto_create_done)) { $autocreate = array($sent_folder, $trash_folder, $draft_folder); $folders_created = false; foreach( $autocreate as $folder ) { - if (($folder != '') && ($folder != 'none')) { + if ($folder != '') { /** * If $show_only_subscribed_folders is true, don't use * $mailboxes array for checking if mailbox exists. diff --git a/src/options.php b/src/options.php index 499a4359..4350c59e 100644 --- a/src/options.php +++ b/src/options.php @@ -237,7 +237,7 @@ if ($optmode == SMOPT_MODE_SUBMIT) { /* Finally, display whatever page we are supposed to show now. */ /***************************************************************/ -displayPageHeader($color, 'None', (isset($optpage_data['xtra']) ? $optpage_data['xtra'] : '')); +displayPageHeader($color, null, (isset($optpage_data['xtra']) ? $optpage_data['xtra'] : '')); /* * The main option page has a different layout then the rest of the option diff --git a/src/options_highlight.php b/src/options_highlight.php index c7678ca8..1b9768b5 100644 --- a/src/options_highlight.php +++ b/src/options_highlight.php @@ -104,7 +104,7 @@ if (isset($theid) && ($action == 'delete') || setPref($data_dir, $username, 'hililist', serialize($message_highlight_list)); } -displayPageHeader($color, 'None'); +displayPageHeader($color); /** * Display the current rule list diff --git a/src/options_identities.php b/src/options_identities.php index 74849482..7a49817c 100644 --- a/src/options_identities.php +++ b/src/options_identities.php @@ -61,7 +61,7 @@ if (!empty($return)) { exit; } -displayPageHeader($color, 'None'); +displayPageHeader($color); /* since 1.1.3 */ do_hook('options_identities_top', $null); diff --git a/src/options_order.php b/src/options_order.php index b3559bd4..8f081acd 100644 --- a/src/options_order.php +++ b/src/options_order.php @@ -73,7 +73,7 @@ if (!sqgetGlobalVar('account', $account, SQ_GET)) { /* Finally, display whatever page we are supposed to show now. */ /***************************************************************/ -displayPageHeader($color, 'None', (isset($optpage_data['xtra']) ? $optpage_data['xtra'] : '')); +displayPageHeader($color, null, (isset($optpage_data['xtra']) ? $optpage_data['xtra'] : '')); /** diff --git a/src/search.php b/src/search.php index c2a1054e..1606105d 100644 --- a/src/search.php +++ b/src/search.php @@ -1312,7 +1312,7 @@ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, $boxes = sqimap_mailbox_list($imapConnection); /* ensure we have a valid default mailbox name */ $mailbox = asearch_nz($mailbox_array[0]); -if (($mailbox == '') || ($mailbox == 'None')) //Workaround for sm quirk IMHO (what if I really have a mailbox called None?) +if ($mailbox == '') $mailbox = $boxes[0]['unformatted']; //Usually INBOX ;) diff --git a/src/vcard.php b/src/vcard.php index 7589bfec..b9766fb9 100644 --- a/src/vcard.php +++ b/src/vcard.php @@ -41,7 +41,7 @@ sqgetGlobalVar('startMessage', $startMessage, SQ_GET); $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0); sqimap_mailbox_select($imapConnection, $mailbox); -displayPageHeader($color, 'None'); +displayPageHeader($color); $msg_url = 'read_body.php?mailbox='.urlencode($mailbox). '&startMessage='.urlencode($startMessage). @@ -185,4 +185,4 @@ $oTemplate->assign('info', $opts); $oTemplate->display('vcard.tpl'); $oTemplate->display('footer.tpl'); -?> \ No newline at end of file +?> diff --git a/src/view_text.php b/src/view_text.php index 8f434475..ce84feb4 100644 --- a/src/view_text.php +++ b/src/view_text.php @@ -75,7 +75,7 @@ if ($type1 == 'html' || (isset($override_type1) && $override_type1 == 'html')) translateText($body, $wrap_at, $charset); } -displayPageHeader($color, 'None'); +displayPageHeader($color); $oTemplate->assign('view_message_href', $msg_url); $oTemplate->assign('download_href', $dwnld_url); diff --git a/templates/default/page_header.tpl b/templates/default/page_header.tpl index 3860ac16..99a4de40 100644 --- a/templates/default/page_header.tpl +++ b/templates/default/page_header.tpl @@ -17,7 +17,7 @@ extract($t); $current_folder_str = ''; -if ( $shortBoxName <> '' && strtolower( $shortBoxName ) <> 'none' ) { +if ( $shortBoxName != '' ) { $current_folder_str .= _("Current Folder") . ": $shortBoxName \n"; } else { $current_folder_str .= ' '; -- 2.25.1