Преглед на файлове

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.

Thijs Kinkhorst преди 18 години
родител
ревизия
567ef6de29

+ 1 - 0
ChangeLog

@@ -186,6 +186,7 @@ Version 1.5.2 - SVN
     better-than-nothing alternative.
     better-than-nothing alternative.
   - Fix Priority and Receipt compose options being reset after return from
   - Fix Priority and Receipt compose options being reset after return from
     HTML addressbook, and allow returning from an empty address book (#1673056).
     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)
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------
 --------------------------------------

+ 1 - 2
functions/imap_mailbox.php

@@ -360,8 +360,7 @@ function sqimap_mailbox_exists ($imap_stream, $mailbox, $mailboxlist=null) {
  * @since 1.0 or older
  * @since 1.0 or older
  */
  */
 function sqimap_mailbox_select ($imap_stream, $mailbox) {
 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;
         return;
     }
     }
 
 

+ 1 - 1
functions/page_header.php

@@ -196,7 +196,7 @@ function displayInternalLink($path, $text, $target='') {
  * @return void
  * @return void
  */
  */
 
 
-function displayPageHeader($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') {
+function displayPageHeader($color, $mailbox='', $sHeaderJs='', $sBodyTagJs = '') {
 
 
     global $reply_focus, $hide_sm_attributions, $frame_top,
     global $reply_focus, $hide_sm_attributions, $frame_top,
         $provider_name, $provider_uri, $startMessage,
         $provider_name, $provider_uri, $startMessage,

+ 1 - 1
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
       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 
       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
       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.
       <br /><br />
       <br /><br />
       
       
       <b>Unseen message notification type</b><br />
       <b>Unseen message notification type</b><br />

+ 2 - 2
plugins/abook_take/take.php

@@ -22,7 +22,7 @@ require('../../include/init.php');
 require(SM_PATH . 'functions/forms.php');
 require(SM_PATH . 'functions/forms.php');
 require(SM_PATH . 'functions/addressbook.php');
 require(SM_PATH . 'functions/addressbook.php');
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 /* input form data */
 /* input form data */
 sqgetGlobalVar('email', $email, SQ_POST);
 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);
 abook_create_form(SM_PATH . 'src/addressbook.php','addaddr',_("Add to address book"),_("Add address"),$formdata);
 echo '</form>';
 echo '</form>';
 ?>
 ?>
-</body></html>
+</body></html>

+ 2 - 2
plugins/administrator/options.php

@@ -233,7 +233,7 @@ if ( !adm_check_user() ) {
     exit;
     exit;
 }
 }
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 $newcfg = array( );
 $newcfg = array( );
 
 
@@ -646,4 +646,4 @@ if ( $fp = @fopen( $cfgfile, 'w' ) ) {
 }
 }
 
 
 ?>
 ?>
-</body></html>
+</body></html>

+ 2 - 2
plugins/bug_report/bug_report.php

@@ -24,7 +24,7 @@ require_once(SM_PATH . 'functions/forms.php');
 /** load plugin functions */
 /** load plugin functions */
 require_once(SM_PATH . 'plugins/bug_report/functions.php');
 require_once(SM_PATH . 'plugins/bug_report/functions.php');
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 /** is bug_report plugin disabled or called by wrong user */
 /** is bug_report plugin disabled or called by wrong user */
 if (! is_plugin_enabled('bug_report') || ! bug_report_check_user()) {
 if (! is_plugin_enabled('bug_report') || ! bug_report_check_user()) {
@@ -131,4 +131,4 @@ echo addSubmit(_("Start Bug Report Form"));
     </form>
     </form>
     <br />
     <br />
   </body>
   </body>
-</html>
+</html>

+ 2 - 2
plugins/calendar/calendar.php

@@ -169,7 +169,7 @@ if( !isset($day) || $day <= 0){
 $todayis = date( 'mdY' );
 $todayis = date( 'mdY' );
 $calself=basename($PHP_SELF);
 $calself=basename($PHP_SELF);
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 calendar_header();
 calendar_header();
 readcalendardata();
 readcalendardata();
 startcalendar();
 startcalendar();
@@ -177,4 +177,4 @@ drawmonthview();
 endcalendar();
 endcalendar();
 
 
 ?>
 ?>
-</body></html>
+</body></html>

+ 2 - 2
plugins/calendar/day.php

@@ -169,7 +169,7 @@ $calself=basename($PHP_SELF);
 
 
 $daily_events = array();
 $daily_events = array();
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 calendar_header();
 calendar_header();
 readcalendardata();
 readcalendardata();
 day_header();
 day_header();
@@ -177,4 +177,4 @@ initialize_events();
 display_events();
 display_events();
 ?>
 ?>
 </table></td></tr></table>
 </table></td></tr></table>
-</body></html>
+</body></html>

+ 2 - 2
plugins/calendar/event_create.php

@@ -122,7 +122,7 @@ if (!isset($hour) || $hour <= 0){
 $calself=basename($PHP_SELF);
 $calself=basename($PHP_SELF);
 
 
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 //load calendar menu
 //load calendar menu
 calendar_header();
 calendar_header();
 
 
@@ -175,4 +175,4 @@ if(!isset($event_text)){
 
 
 ?>
 ?>
 </table></td></tr></table>
 </table></td></tr></table>
-</body></html>
+</body></html>

+ 2 - 2
plugins/calendar/event_delete.php

@@ -119,7 +119,7 @@ if ($day <= 0){
 
 
 $calself=basename($PHP_SELF);
 $calself=basename($PHP_SELF);
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 //load calendar menu
 //load calendar menu
 calendar_header();
 calendar_header();
 
 
@@ -145,4 +145,4 @@ if (isset($dyear) && isset($dmonth) && isset($dday) && isset($dhour) && isset($d
 
 
 ?>
 ?>
 </table></td></tr></table>
 </table></td></tr></table>
-</body></html>
+</body></html>

+ 2 - 2
plugins/calendar/event_edit.php

@@ -255,7 +255,7 @@ if ($hour <= 0){
 
 
 $calself=basename($PHP_SELF);
 $calself=basename($PHP_SELF);
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 //load calendar menu
 //load calendar menu
 calendar_header();
 calendar_header();
 
 
@@ -311,4 +311,4 @@ if (!isset($updated)){
 
 
 ?>
 ?>
 </table></td></tr></table>
 </table></td></tr></table>
-</body></html>
+</body></html>

+ 1 - 1
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);
 do_hook('change_password_init', $null);
 ?>
 ?>

+ 1 - 1
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 . 'functions/forms.php');
 include_once(SM_PATH . 'plugins/filters/filters.php');
 include_once(SM_PATH . 'plugins/filters/filters.php');
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 /* get globals */
 /* get globals */
 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);

+ 1 - 1
plugins/filters/spamoptions.php

@@ -25,7 +25,7 @@ sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
 sqgetGlobalVar('action', $action, SQ_GET);
 sqgetGlobalVar('action', $action, SQ_GET);
 /* end globals */
 /* end globals */
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 if (sqgetGlobalVar('spam_submit',$spam_submit,SQ_POST)) {
 if (sqgetGlobalVar('spam_submit',$spam_submit,SQ_POST)) {
     $spam_filters = load_spam_filters();
     $spam_filters = load_spam_filters();

+ 1 - 1
plugins/info/options.php

@@ -26,7 +26,7 @@ require_once(SM_PATH . 'plugins/info/functions.php');
 
 
 global $username, $color, $folder_prefix, $default_charset;
 global $username, $color, $folder_prefix, $default_charset;
 $default_charset = strtoupper($default_charset);
 $default_charset = strtoupper($default_charset);
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 $mailbox = 'INBOX';
 $mailbox = 'INBOX';
 
 
 /**
 /**

+ 1 - 1
plugins/listcommands/options.php

@@ -70,7 +70,7 @@ if (sqGetGlobalVar('addlist', $ignore, SQ_FORM)
 
 
 
 
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 $oTemplate->assign('lists', $lists);
 $oTemplate->assign('lists', $lists);
 $oTemplate->display('plugins/listcommands/non_rfc_lists.tpl');
 $oTemplate->display('plugins/listcommands/non_rfc_lists.tpl');

+ 1 - 1
plugins/mail_fetch/fetch.php

@@ -119,7 +119,7 @@ function Mail_Fetch_Select_Server($mailfetch) {
 }
 }
 
 
 $mailfetch = Mail_Fetch_Servers();
 $mailfetch = Mail_Fetch_Servers();
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 echo '<br />';
 echo '<br />';
 
 

+ 1 - 1
plugins/mail_fetch/options.php

@@ -55,7 +55,7 @@ sqgetGlobalVar('submit_mailfetch', $submit_mailfetch, SQ_POST);
 
 
 /* end globals */
 /* end globals */
 
 
-displayPageHeader( $color, 'None' );
+displayPageHeader( $color );
 
 
 switch( $mf_action ) {
 switch( $mf_action ) {
  case 'add':
  case 'add':

+ 1 - 1
plugins/newmail/newmail_opt.php

@@ -23,7 +23,7 @@ include_once(SM_PATH . 'plugins/newmail/functions.php');
 
 
 include_once(SM_PATH . 'functions/forms.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" .
 echo html_tag( 'table', '', 'center', $color[0], 'width="95%" cellpadding="1" cellspacing="0" border="0"' ) . "\n" .
         html_tag( 'tr' ) . "\n" .
         html_tag( 'tr' ) . "\n" .

+ 2 - 2
plugins/spamcop/options.php

@@ -18,7 +18,7 @@ require('../../include/init.php');
 /* plugin functions */
 /* plugin functions */
 include_once(SM_PATH . 'plugins/spamcop/functions.php');
 include_once(SM_PATH . 'plugins/spamcop/functions.php');
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 /** is spamcop plugin disabled */
 /** is spamcop plugin disabled */
 // option changes do nothing, if read_body_header_right hook is not active.
 // option changes do nothing, if read_body_header_right hook is not active.
@@ -194,4 +194,4 @@ echo '<p><b>' . _("More information") . '</b><br />';
 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."), '<a href="http://spamcop.net/help.shtml">', '</a>');
 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."), '<a href="http://spamcop.net/help.shtml">', '</a>');
 echo "</p>\n";
 echo "</p>\n";
 ?>
 ?>
-</body></html>
+</body></html>

+ 1 - 1
plugins/squirrelspell/sqspell_functions.php

@@ -125,7 +125,7 @@ function sqspell_makePage($title, $scriptsrc, $body){
       $MOD = 'options_main';
       $MOD = 'options_main';
   }
   }
 
 
-  displayPageHeader($color, 'None');
+  displayPageHeader($color);
   echo "&nbsp;<br />\n";
   echo "&nbsp;<br />\n";
   /**
   /**
    * Check if we need to link in a script.
    * Check if we need to link in a script.

+ 2 - 2
plugins/translate/options.php

@@ -20,7 +20,7 @@ require('../../include/init.php');
 /** Plugin functions */
 /** Plugin functions */
 include_once(SM_PATH . 'plugins/translate/functions.php');
 include_once(SM_PATH . 'plugins/translate/functions.php');
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 ?>
 ?>
    <table width="95%" align="center" border="0" cellpadding="1" cellspacing="0"><tr><td bgcolor="<?php echo $color[0]; ?>">
    <table width="95%" align="center" border="0" cellpadding="1" cellspacing="0"><tr><td bgcolor="<?php echo $color[0]; ?>">
@@ -78,4 +78,4 @@ if (!$disable_compose_translate) {
 </td></tr>
 </td></tr>
 </table>
 </table>
 </form>
 </form>
-</body></html>
+</body></html>

+ 1 - 1
src/about.php

@@ -21,7 +21,7 @@
  */
  */
 require('../include/init.php');
 require('../include/init.php');
 
 
-displayPageHeader($color, 'None' );
+displayPageHeader($color);
 
 
 ?>
 ?>
 <p align="center">
 <p align="center">

+ 1 - 1
src/addressbook.php

@@ -40,7 +40,7 @@ sqgetGlobalVar('doedit',        $doedit,        SQ_POST);
 $abook_sort_order = get_abook_sort();
 $abook_sort_order = get_abook_sort();
 
 
 /* Create page header before addressbook_init in order to  display error messages correctly. */
 /* Create page header before addressbook_init in order to  display error messages correctly. */
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 /* Open addressbook with error messages on.
 /* Open addressbook with error messages on.
  remote backends (LDAP) are enabled because they can be used. (list_addr function)
  remote backends (LDAP) are enabled because they can be used. (list_addr function)

+ 1 - 1
src/compose.php

@@ -383,7 +383,7 @@ if (!isset($compose_messages[$session]) || ($compose_messages[$session] == NULL)
     $composeMessage=$compose_messages[$session];
     $composeMessage=$compose_messages[$session];
 }
 }
 
 
-if (!isset($mailbox) || $mailbox == '' || ($mailbox == 'None')) {
+if (empty($mailbox)) {
     $mailbox = 'INBOX';
     $mailbox = 'INBOX';
 }
 }
 
 

+ 1 - 1
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/folder_manip.php');
 require_once(SM_PATH . 'functions/forms.php');
 require_once(SM_PATH . 'functions/forms.php');
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 /* get globals we may need */
 /* get globals we may need */
 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);

+ 1 - 1
src/help.php

@@ -16,7 +16,7 @@
  */
  */
 require('../include/init.php');
 require('../include/init.php');
 
 
-displayPageHeader($color, 'None' );
+displayPageHeader($color);
 
 
 $helpdir[0] = 'basic.hlp';
 $helpdir[0] = 'basic.hlp';
 $helpdir[1] = 'main_folder.hlp';
 $helpdir[1] = 'main_folder.hlp';

+ 1 - 1
src/image.php

@@ -16,7 +16,7 @@
  */
  */
 require('../include/init.php');
 require('../include/init.php');
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 /* globals */
 /* globals */
 if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) {
 if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) {

+ 1 - 1
src/left_main.php

@@ -69,7 +69,7 @@ if ($auto_create_special && !isset($auto_create_done)) {
     $autocreate = array($sent_folder, $trash_folder, $draft_folder);
     $autocreate = array($sent_folder, $trash_folder, $draft_folder);
     $folders_created = false;
     $folders_created = false;
     foreach( $autocreate as $folder ) {
     foreach( $autocreate as $folder ) {
-        if (($folder != '') && ($folder != 'none')) {
+        if ($folder != '') {
             /**
             /**
              * If $show_only_subscribed_folders is true, don't use 
              * If $show_only_subscribed_folders is true, don't use 
              * $mailboxes array for checking if mailbox exists.
              * $mailboxes array for checking if mailbox exists.

+ 1 - 1
src/options.php

@@ -237,7 +237,7 @@ if ($optmode == SMOPT_MODE_SUBMIT) {
 /* Finally, display whatever page we are supposed to show now. */
 /* 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
  * The main option page has a different layout then the rest of the option

+ 1 - 1
src/options_highlight.php

@@ -104,7 +104,7 @@ if (isset($theid) && ($action == 'delete') ||
 
 
     setPref($data_dir, $username, 'hililist', serialize($message_highlight_list));
     setPref($data_dir, $username, 'hililist', serialize($message_highlight_list));
 }
 }
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 /**
 /**
  * Display the current rule list
  * Display the current rule list

+ 1 - 1
src/options_identities.php

@@ -61,7 +61,7 @@ if (!empty($return)) {
     exit;
     exit;
 }
 }
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 /* since 1.1.3 */
 /* since 1.1.3 */
 do_hook('options_identities_top', $null);
 do_hook('options_identities_top', $null);

+ 1 - 1
src/options_order.php

@@ -73,7 +73,7 @@ if (!sqgetGlobalVar('account', $account,  SQ_GET)) {
 /* Finally, display whatever page we are supposed to show now. */
 /* 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'] : ''));
 
 
 
 
 /**
 /**

+ 1 - 1
src/search.php

@@ -1312,7 +1312,7 @@ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort,
 $boxes = sqimap_mailbox_list($imapConnection);
 $boxes = sqimap_mailbox_list($imapConnection);
 /* ensure we have a valid default mailbox name */
 /* ensure we have a valid default mailbox name */
 $mailbox = asearch_nz($mailbox_array[0]);
 $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 ;)
     $mailbox = $boxes[0]['unformatted']; //Usually INBOX ;)
 
 
 
 

+ 2 - 2
src/vcard.php

@@ -41,7 +41,7 @@ sqgetGlobalVar('startMessage', $startMessage, SQ_GET);
 $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
 $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
 sqimap_mailbox_select($imapConnection, $mailbox);
 sqimap_mailbox_select($imapConnection, $mailbox);
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 $msg_url = 'read_body.php?mailbox='.urlencode($mailbox).
 $msg_url = 'read_body.php?mailbox='.urlencode($mailbox).
     '&amp;startMessage='.urlencode($startMessage).
     '&amp;startMessage='.urlencode($startMessage).
@@ -185,4 +185,4 @@ $oTemplate->assign('info', $opts);
 $oTemplate->display('vcard.tpl');
 $oTemplate->display('vcard.tpl');
 
 
 $oTemplate->display('footer.tpl');
 $oTemplate->display('footer.tpl');
-?>
+?>

+ 1 - 1
src/view_text.php

@@ -75,7 +75,7 @@ if ($type1 == 'html' || (isset($override_type1) &&  $override_type1 == 'html'))
     translateText($body, $wrap_at, $charset);
     translateText($body, $wrap_at, $charset);
 }
 }
 
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 
 $oTemplate->assign('view_message_href', $msg_url);
 $oTemplate->assign('view_message_href', $msg_url);
 $oTemplate->assign('download_href', $dwnld_url);
 $oTemplate->assign('download_href', $dwnld_url);

+ 1 - 1
templates/default/page_header.tpl

@@ -17,7 +17,7 @@ extract($t);
 
 
 
 
 $current_folder_str = '';
 $current_folder_str = '';
-if ( $shortBoxName <> '' && strtolower( $shortBoxName ) <> 'none' ) {
+if ( $shortBoxName != '' ) {
     $current_folder_str .= _("Current Folder") . ": <em>$shortBoxName&nbsp;</em>\n";
     $current_folder_str .= _("Current Folder") . ": <em>$shortBoxName&nbsp;</em>\n";
 } else {
 } else {
     $current_folder_str .= '&nbsp;';
     $current_folder_str .= '&nbsp;';