Changeset - 7c3278c804ca
[Not reviewed]
Mobile
0 2 0
Ethan Zonca - 14 years ago 2011-10-14 20:59:32
ez@ethanzonca.com
Initial work on mobile page class
2 files changed with 19 insertions and 17 deletions:
0 comments (0 inline, 0 general)
inc/class.page.php
Show inline comments
 
@@ -64,37 +64,37 @@ if (file_exists($config_inc)) {
 
 * various features.
 
 */
 
class page
 
{
 

	
 
  /* Site-wide configuration options */
 
  private $base_title = 'SlatePermutate - Find the schedule that works for you!';
 
  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"';
 
  protected $base_title = 'SlatePermutate - Find the schedule that works for you!';
 
  protected $doctype = 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"';
 
  protected $htmlargs = 'xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"';
 

	
 
  private $pageGenTime = 0;
 
  protected $pageGenTime = 0;
 

	
 
  private $xhtml = FALSE;
 
  protected $xhtml = FALSE;
 

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

	
 
  private $trackingcode = ''; // Tracking code
 
  private $pagetitle = ''; // Title of page
 
  private $scripts = array(); // Scripts to include on page
 
  protected $trackingcode = ''; // Tracking code
 
  protected $pagetitle = ''; // Title of page
 
  protected $scripts = array(); // Scripts to include on page
 

	
 
  /* the current school. See get_school(). */
 
  private $school;
 
  protected $school;
 

	
 
  private $semester;
 
  protected $semester;
 

	
 
  /*
 
   * Whether or not the user should be presented with the option to
 
   * change the school profile or semester.
 
   */
 
  private $school_semester_constant;
 
  protected $school_semester_constant;
 

	
 
  /**
 
   * \brief
 
   *   Construct a new page.
 
   *
 
   * Only to be called by page::page_construct(). Use that function
 
@@ -121,24 +121,26 @@ class page
 
    require_once('school.inc');
 

	
 
    /* Scripts and styles available for inclusion */
 

	
 
    $this->headCode['jQuery'] = '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script>';
 
    $this->headCode['jQueryUI'] = '<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script><link rel="stylesheet" href="styles/jqueryui.css" type="text/css" media="screen" charset="utf-8" />';
 
    $this->headCode['jQueryUI-NoStyles'] =  '<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>';
 
    $this->headCode['jValidate'] = '<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.pack.js"></script>';
 
    $this->headCode['jAddress'] = '<script type="text/javascript" src="http://js.ohnopub.net/js/jquery.address-1.3.2.min.js"></script>';
 
    $this->headCode['jQuery.cuteTime'] = '<script type="text/javascript" src="http://ohnopub.net/~ohnobinki/CuteTime/js/jquery.cuteTime.js"></script>';
 
    $this->headCode['qTip'] = '<script type="text/javascript" src="http://js.ohnopub.net/js/jquery.qtip-1.0.min.js"></script>';
 
    $this->headCode['qTip2'] = '<script type="text/javascript" src="http://js.ohnopub.net/js/2011.03.21/jquery.qtip.min.js"></script><link rel="stylesheet" href="http://js.ohnopub.net/js/2011.03.21/jquery.qtip.min.css" type="text/css" media="screen" />';
 
    $this->headCode['schedInput'] = '<script type="text/javascript" src="scripts/scheduleInput.js"></script>';
 
    $this->headCode['outputPrintStyle'] = '<link rel="stylesheet" href="styles/print.css" type="text/css" media="screen" charset="utf-8" />';
 
    $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" />'; 
 
    $this->headCode['uiTabsKeyboard'] = '<script type="text/javascript" src="scripts/uiTabsKeyboard.js"></script>';
 
    $this->headCode['displayTables'] = '<script type="text/javascript" src="scripts/displayTables.js"></script>';
 

	
 
    $this->headCode['jQueryMobile'] = '<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css" /><script src="http://code.jquery.com/jquery-1.6.2.min.js"></script><script src="http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.js"></script>';                                                                                                                         
 
    $this->headCode['mScheduleInput'] = '<script type="text/javascript" src="scripts/mSchedInput.js"></script>';                                                                                           
 
    $this->pagetitle = $ntitle;
 
    $this->scripts = $nscripts;
 

	
 
   /* Compliant browsers which care, such as gecko, explicitly request xhtml: */
 
   if(empty($_SERVER['HTTP_ACCEPT'])  /* then the browser doesn't care :-) */
 
      || strpos($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') !== FALSE)
 
@@ -208,15 +210,15 @@ class page
 
   *     - 'school': The school to use instead of the autodetected one.
 
   *     - 'semester': The semester to use instead of the autodetected one.
 
   *     - 'school_semester_constant': Whether the options to change
 
   *        the current school and semester should be hidden. TRUE by
 
   *        default.
 
   */
 
  public static function page_create($title, array $scripts = array(), array $options = array())
 
  public static function page_create($title, array $nscripts = array(), array $options = array())
 
  {
 
    return new page(htmlentities($title, ENT_QUOTES, 'UTF-8'), $scripts, FALSE, $options);
 
    return new page(htmlentities($title, ENT_QUOTES, 'UTF-8'), $nscripts, FALSE, $options);
 
  }
 

	
 
  /**
 
   * \brief
 
   *   Adds some headcode to this page.
 
   *
 
@@ -629,13 +631,13 @@ class page
 
  }
 

	
 
  /**
 
   * \brief
 
   *   Add a trailing slash to a path if one does not already exist
 
   */
 
  private function add_trailing_slash($path){
 
  protected function add_trailing_slash($path){
 
    if($path[strlen($path)-1] != '/') {
 
      return $path . "/";
 
    }
 
    else {
 
      return $path;
 
    }
index.php
Show inline comments
 
@@ -24,10 +24,10 @@ require_once 'inc/class.page.php';
 
$welcomepage->head();
 
?>
 

	
 
<h3>Find the schedule that works for you!</h3>
 
<p>Plan your next semester with SlatePermutate! SlatePermutate generates every possible schedule with the courses you enter to let you pick the schedule that fits your life.</p>
 

	
 
<p class="righttext" style="padding-right: 1em;"><a class="button blue large" href="input.php"><!--<img class="noborder" src="images/get-started.png" alt="Get Started" />-->Get Started</a></p>
 
<p class="righttext" style="padding-right: 1em;"><a class="button blue large" data-role="button" data-inline="true" data-theme="b" href="minput.php" data-ajax="false"><!--<img class="noborder" src="images/get-started.png" alt="Get Started" />-->Get Started</a></p>
 

	
 
<?php
 
$welcomepage->foot();
0 comments (0 inline, 0 general)