Changeset - 73b131aa114b
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 14 years ago 2011-04-09 13:29:31
ohnobinki@ohnopublishing.net
Completely disallow calling `new page()'. Use page::page_create() instead.
2 files changed with 10 insertions and 2 deletions:
0 comments (0 inline, 0 general)
ajax.php
Show inline comments
 
@@ -73,13 +73,13 @@ if (isset($_REQUEST['school_registration
 
      {
 
	$school = school_load_guess();
 
	if (empty($school))
 
	  slate_permutate_json_error('Unable to load any school.');
 
      }
 

	
 
    $page = new Page('', array(), FALSE);
 
    $page = page::page_create('');
 

	
 
    $courses = array();
 
    if (!empty($_REQUEST['courses']) && is_array($_REQUEST['courses']))
 
      {
 
	/*
 
	 * The below course deserialization blob should be moved into
inc/class.page.php
Show inline comments
 
@@ -90,22 +90,30 @@ class page
 
   * Whether or not the user should be presented with the option to
 
   * change the school profile or semester.
 
   */
 
  private $school_semester_constant;
 

	
 
  /**
 
   * \brief
 
   *   Construct a new page.
 
   *
 
   * Only to be called by page::page_construct(). Use that function
 
   * instead of the new keyword.
 
   *
 
   * \see page::page_construct()
 
   *
 
   * \param $ntitle
 
   *   Must be a valid HTML string (i.e., escaped with htmlentities()).
 
   * \param $nscripts
 
   *   An array of strings identifying the scripts to include for this page.
 
   * \param $options
 
   *   An array containing any of the following keys:
 
   *     - 'school': The school to use instead of the autodetected one.
 
   *     - 'semester': The semester to use instead of the autodetected one.
 
   */
 
  public function __construct($ntitle, $nscripts = array(), $immediate = TRUE, array $options = array())
 
  protected function __construct($ntitle, $nscripts = array(), $immediate = TRUE, array $options = array())
 
  {
 
    /* Begin tracking generation time */
 
    $this->pageGenTime = round(microtime(),4);
 

	
 
    global $ga_trackers;
 

	
0 comments (0 inline, 0 general)