Changeset - 4e1fd8bb6784
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2010-10-27 19:41:53
ohnobinki@ohnopublishing.net
Some more whitespace for slightly cleaner HTML. Also set charset=utf8 in Content-Type as this is today's best-practice.
1 file changed with 11 insertions and 5 deletions:
0 comments (0 inline, 0 general)
inc/class.page.php
Show inline comments
 
@@ -67,14 +67,16 @@ class page
 
   /* compliant browsers which care, such as gecko, explicitly request xhtml: */
 
   if(!empty($_SERVER['HTTP_ACCEPT'])
 
      && strpos($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') !== FALSE
 
      || !strlen($_SERVER['HTTP_ACCEPT']) /* then the browser doesn't care :-) */)
 
     {
 
       $this->xhtml = TRUE;
 
       header('Content-type: application/xhtml+xml');
 
       header('Content-Type: application/xhtml+xml; charset=utf-8');
 
     }
 
   else
 
     header('Content-Type: text/html; charset=utf-8');
 

	
 
   if (count($ga_trackers))
 
     {
 
       $ga_www = 'http://www.';
 
       if ($_SERVER['SERVER_PORT'] != 80)
 
	 $ga_www = 'https://ssl.';
 
@@ -124,13 +126,18 @@ class page
 
    if ($enable)
 
      $this->scripts[] = $key;
 
  }
 

	
 
// Public functions/vars
 

	
 
  public function head(){
 
  /**
 
   * \brief
 
   *   Output the HTML header for a page, including the <!DOCTYPE> and <head />
 
   */
 
  public function head()
 
  {
 
    $this->pageGenTime = round(microtime(), 3);
 

	
 
    if ($this->xhtml)
 
       echo '<?xml version="1.0" encoding="utf-8" ?>' . "\n";
 

	
 
    echo '<!DOCTYPE ' . $this->doctype . '>
 
@@ -138,15 +145,14 @@ class page
 
	  <head>
 
	    <title>' . $this->pagetitle . ' :: ' . $this->base_title . '</title>
 
           <link rel="stylesheet" href="styles/general.css" type="text/css" media="screen" charset="utf-8" />
 
	   <link rel="stylesheet" type="text/css" media="print" href="styles/print.css" />';
 

	
 
    // Write out all passed scripts
 
    foreach ($this->scripts as $i){
 
    	echo $this->headCode["$i"];
 
    }
 
    foreach ($this->scripts as $i)
 
      echo '            ' . $this->headCode["$i"] . "\n";
 

	
 
    echo '</head>
 
	  <body '.$this->bodyargs.' ><div id="page">';
 
    echo $this->top(); // Write out top
 
  }
 

	
0 comments (0 inline, 0 general)