Changeset - 42656e88bc44
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 15 years ago 2010-09-30 20:30:44
ohnobinki@ohnopublishing.net
Ask for stricter standards-compliance, add <?xml ?> header, and use application/xhtml+xml and XHTML if the browser supports it.
2 files changed with 27 insertions and 11 deletions:
0 comments (0 inline, 0 general)
inc/class.page.php
Show inline comments
 
@@ -10,15 +10,14 @@ class page {
 
  public $lastJobTable = '';
 
  private $pageGenTime = 0;
 
  private $indexpath = 'http://protofusion.org/SlatePermutate/'; // full url to index for php header redirection
 
  /* whether or not to output valid XHTML */
 
  public $xhtml = FALSE;
 

	
 
  // Scripts and styles
 
  private $headCode = array();
 

	
 
  private $trackingcode = '<script type="text/javascript">
 
				var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
 
				document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
 
        		   </script>
 

	
 
  /* the inclusion of ga.js is augmented in __construct(). */
 
  private $trackingcode = '
 
			  <script type="text/javascript">
 
				var nathangPageTracker = _gat._getTracker("UA-17441156-1");
 
				nathangPageTracker._trackPageview();
 
@@ -43,6 +42,21 @@ class page {
 
   $this->pagetitle = $ntitle;
 
   $this->scripts = $nscripts;
 

	
 
   /* 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');
 
     }
 

	
 
   $ga_www = 'http://www.';
 
   if ($_SERVER['SERVER_PORT'] != 80)
 
     $ga_www = 'https://ssl.';
 
   $this->trackingcode = '<script type="text/javascript" src="' . $ga_www . 'google-analytics.com/ga.js"' . ($this->xhtml ? '/' : '') . ">\n"
 
     . $this->trackingcode;
 

	
 
    session_start();
 
    if($immediate
 
       && $ntitle != "NOHEAD")
 
@@ -83,12 +97,14 @@ class page {
 
  public function head(){
 
    $this->pageGenTime = round(microtime(), 3);
 

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

	
 
    echo '<!DOCTYPE ' . $this->doctype . '>
 
	  <html ' . $this->htmlargs . '>
 
	  <head>
 
	    <title>' . $this->pagetitle . ' :: ' . $this->base_title . '</title>
 
	    <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
 
           <link rel="stylesheet" href="styles/general.css" type="text/css" media="screen" charset="utf-8" />';
 
           <link rel="stylesheet" href="styles/general.css" type="text/css" media="screen" charset="utf-8"' . ($this->xhtml ? '/' : '') . '>';
 

	
 
    // Write out all passed scripts
 
    foreach ($this->scripts as $i){
 
@@ -126,7 +142,7 @@ class page {
 
		foreach($session['saved'] as $key => $schedule){
 
			$sch = unserialize($schedule);
 
			echo "#" . ($key + 1) . " - " . $sch->getName()
 
			  . " - <a href=\"process.php?savedkey=$key\">view</a>" .'</a> <a href="input.php?savedkey="' . $key . '">edit</a> '
 
			  . " - <a href=\"process.php?savedkey=$key\">view</a>" .' <a href="input.php?savedkey="' . $key . '">edit</a> '
 
			  . "<a href=\"process.php?delsaved=$key\">delete</a>"
 
			  . "<br /><br />\n";
 
		}
input.php
Show inline comments
 
@@ -58,9 +58,9 @@ var sectionsOfClass = Array();
 
	<td class="advanced" colspan="11" style="padding-bottom: 2em;">
 
	  Section Labels are <select id="isNumeric" class="required" name="isnumbered">
 
	    <?php $isSelected = 'selected="selected"'; ?>
 
	    <option value="numerous" <? if(!$sch || $sch->section_format == "numerous") echo $isSelected ?> >Custom</option>
 
	    <option value="numbered" <? if($sch && $sch->section_format == "numbered") echo $isSelected ?> >Numbered</option>
 
	    <option value="lettered" <? if($sch && $sch->section_format == "lettered") echo $isSelected ?> >Lettered</option>
 
	    <option value="numerous" <?php if(!$sch || $sch->section_format == "numerous") echo $isSelected ?> >Custom</option>
 
	    <option value="numbered" <?php if($sch && $sch->section_format == "numbered") echo $isSelected ?> >Numbered</option>
 
	    <option value="lettered" <?php if($sch && $sch->section_format == "lettered") echo $isSelected ?> >Lettered</option>
 
	  </select>
 
	</td>
 
	</tr>
0 comments (0 inline, 0 general)