Give threading URI to template, let template do the HTML layout
[squirrelmail.git] / src / left_main.php
index 61af595db4431b83bec343eed968a74fadd6d8c3..3c1dd21ea5d6cf90bd4f8ae3873e9be3eb5dcd6e 100644 (file)
@@ -20,7 +20,6 @@ require('../include/init.php');
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'functions/imap_general.php');
 require_once(SM_PATH . 'functions/date.php');
-require_once(SM_PATH . 'templates/util_global.php');
 require_once(SM_PATH . 'templates/util_left_main.php');
 
 /* These constants are used for folder stuff. */
@@ -28,10 +27,7 @@ define('SM_BOX_UNCOLLAPSED', 0);
 define('SM_BOX_COLLAPSED',   1);
 
 /* get globals */
-sqgetGlobalVar('username', $username, SQ_SESSION);
-sqgetGlobalVar('key', $key, SQ_COOKIE);
 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
-sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
 
 sqgetGlobalVar('fold', $fold, SQ_GET);
 sqgetGlobalVar('unfold', $unfold, SQ_GET);
@@ -39,7 +35,7 @@ sqgetGlobalVar('unfold', $unfold, SQ_GET);
 
 // open a connection on the imap port (143)
 // why hide the output?
-$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, true);
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, true);
 
 /**
  * Using stristr since very old preferences may contain "None" and "none".
@@ -56,7 +52,7 @@ if (!empty($left_refresh) &&
 /**
  * Include extra javascript files needed by template
  */
-$js_includes = $oTemplate->getJavascriptIncludes();
+$js_includes = $oTemplate->get_javascript_includes(TRUE);
 foreach ($js_includes as $js_file) {
     $xtra .= '<script src="'.$js_file.'" type="text/javascript"></script>' ."\n";
 }
@@ -65,6 +61,7 @@ foreach ($js_includes as $js_file) {
 $mailboxes=sqimap_get_mailboxes($imapConnection,false,$show_only_subscribed_folders);
 
 displayHtmlHeader( 'SquirrelMail', $xtra );
+$oErrorHandler->setDelayedErrors(true);
 
 sqgetGlobalVar('auto_create_done',$auto_create_done,SQ_SESSION);
 /* If requested and not yet complete, attempt to autocreate folders. */
@@ -193,9 +190,8 @@ $oTemplate->assign('mailboxes', $mailbox_structure);
  * globals, which are dirty, filthy things in templates. :)
  */
 $settings = array();
-$settings['imapConnection'] = $imapConnection;
-$settings['iconThemePath'] = $icon_theme_path;
-$settings['templateDirectory'] = $sTplDir;
+#$settings['imapConnection'] = $imapConnection;
+$settings['templateID'] = $sTemplateID;
 $settings['unreadNotificationEnabled'] = $unseen_notify!=1;
 $settings['unreadNotificationAllFolders'] = $unseen_notify == 3;
 $settings['unreadNotificationDisplayTotal'] = $unseen_type == 2;
@@ -209,4 +205,3 @@ $oTemplate->display('left_main.tpl');
 
 sqimap_logout($imapConnection);
 $oTemplate->display('footer.tpl');
-?>
\ No newline at end of file