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
 
@@ -7,21 +7,20 @@ class page {
 
  private $doctype = 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"';
 
  private $htmlargs = 'xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"';
 
  private $bodyargs = '';
 
  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();
 
				
 
				var ethanzPageTracker = _gat._getTracker("UA-2800455-1");
 
				ethanzPageTracker._trackPageview();
 
@@ -40,12 +39,27 @@ class page {
 
    $this->headCode['outputStyle'] = '<link rel="stylesheet" href="styles/output.css" type="text/css" media="screen" charset="utf-8" />'; 
 
    $this->headCode['gliderHeadcode'] = '<link rel="stylesheet" href="styles/glider.css" type="text/css" media="screen" charset="utf-8" /><script src="scripts/prototype.js" type="text/javascript" charset="utf-8"></script><script src="scripts/effects.js" type="text/javascript" charset="utf-8"></script><script src="scripts/glider.js" type="text/javascript" charset="utf-8"></script>'; 
 

	
 
   $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")
 
      $this->head();
 
 }
 

	
 
@@ -80,18 +94,20 @@ class page {
 

	
 
// Public functions/vars
 

	
 
  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){
 
    	echo $this->headCode["$i"];
 
    }
 

	
 
@@ -123,13 +139,13 @@ class page {
 
       echo '<p>';
 
	if(isset($session['saved']) && count($session['saved']) > 0){
 
		echo '<div id="savedBox" ><h3>Saved Schedules:</h3>';
 
		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";
 
		}
 
		echo '</div>';
 
	}
 
       echo '</p>';
input.php
Show inline comments
 
@@ -55,15 +55,15 @@ var sectionsOfClass = Array();
 
	</td>
 
      </tr>
 
      <tr>
 
	<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>
 
	<!-- Header -->
 
	<tr>
 
		<td>Class</td>
0 comments (0 inline, 0 general)