Adding initial RPC baseline functionality. The delete message request does in fact...
[squirrelmail.git] / functions / page_header.php
index f2a954323116040c0c33380643a0c701aba4f29a..501d9745ef3f51e57e2065f22217a786c0607473 100644 (file)
@@ -159,17 +159,7 @@ function makeInternalLink($path, $text, $target='') {
     //
     //do_hook('internal_link', $text);
 
-    $oTemplate->assign('uri', $base_uri . $path);
-    $oTemplate->assign('text', $text);
-    $oTemplate->assign('target', $target);
-
-    // blank the onclick because the template object might
-    // already contain an onclick value due to having been
-    // used to show a compose link (when comp_in_new is turned on)
-    //
-    $oTemplate->assign('onclick', '');
-
-    return $oTemplate->fetch('hyperlink.tpl');
+    return create_hyperlink($base_uri . $path, $text, $target);
 }
 
 /**
@@ -196,7 +186,7 @@ function displayPageHeader($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') {
 
     global $reply_focus, $hide_sm_attributions, $frame_top,
         $provider_name, $provider_uri, $startMessage,
-        $javascript_on, $action, $oTemplate;
+        $action, $oTemplate, $org_title;
 
     if (empty($sBodyTagJs)) {
         if (strpos($action, 'reply') !== FALSE && $reply_focus) {
@@ -220,7 +210,8 @@ function displayPageHeader($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') {
         $frame_top = '_top';
     }
 
-    if( $javascript_on || strpos($sHeaderJs, 'new_js_autodetect_results.value') ) {
+//FIXME: does checkForJavascript() make the 2nd part of the if() below unneccessary??
+    if( checkForJavascript() || strpos($sHeaderJs, 'new_js_autodetect_results.value') ) {
         $js_includes = $oTemplate->get_javascript_includes(TRUE);
         $sJsBlock = '';
         foreach ($js_includes as $js_file) {
@@ -231,10 +222,10 @@ function displayPageHeader($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') {
                         "\n<!--\n" .
                         $sHeaderJs . "\n\n// -->\n</script>\n";
         }
-        displayHtmlHeader ('SquirrelMail', $sJsBlock);
+        displayHtmlHeader ($org_title, $sJsBlock);
     } else {
         /* do not use JavaScript */
-        displayHtmlHeader ('SquirrelMail');
+        displayHtmlHeader ($org_title);
         $sBodyTagJs = '';
     }
     /*
@@ -281,7 +272,7 @@ function displayPageHeader($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') {
  */
 function compose_Header($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') {
 
-    global $reply_focus, $javascript_on, $action, $oTemplate;
+    global $reply_focus, $action, $oTemplate;
 
     if (empty($sBodyTagJs)) {
         if (strpos($action, 'reply') !== FALSE && $reply_focus) {
@@ -300,7 +291,7 @@ function compose_Header($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') {
     /*
      * Locate the first displayable form element (only when JavaScript on)
      */
-    if($javascript_on) {
+    if(checkForJavascript()) {
         if ($sHeaderJs) {
             $sJsBlock = "\n<script type=\"text/javascript\">" .
                         "\n<!--\n" .