Changeset - 60bdc2d2972a
[Not reviewed]
default
0 5 0
Nathan Brink (binki) - 15 years ago 2010-10-16 20:49:32
ohnobinki@ohnopublishing.net
Make the professor attribute of the Section class optionalish.
5 files changed with 10 insertions and 18 deletions:
0 comments (0 inline, 0 general)
class.class.php
Show inline comments
 
@@ -23,15 +23,6 @@ class Classes
 
    $this->nsections = 0;
 
  }
 
	
 
  //--------------------------------------------------
 
  // Adds a new section to the class.
 
  //--------------------------------------------------
 
  function addSection($l, $p, $s, $e, $d)
 
  {
 
    $this->sections[$this->nsections] = new Section($l, $p, $s, $e, $d);
 
    $this->nsections++;
 
  }
 

	
 
  /**
 
   * \brief
 
   *   Adds an already-instantiated section to this class.
class.schedule.php
Show inline comments
 
@@ -92,8 +92,7 @@ class Schedule
 
      {
 
	echo "Could not find class: " . $n . "<br />";
 
      } else {
 
      $p = "unknown prof";
 
      $this->classStorage[$counter]->addSection($l, $p, $s, $e, $d);
 
      $this->classStorage[$counter]->section_add(new Section($l, $s, $e, $d));
 
    }
 
  }
 

	
class.section.php
Show inline comments
 
@@ -23,8 +23,6 @@ class Section
 
   * \param $letter
 
   *   The identifier (often a letter or numeral) of this section. For
 
   *   CS-262-A, this would be 'a'.
 
   * \param $prof
 
   *   The faculty person(s) who teaches this section.
 
   * \param $time_start
 
   *   The time of day when this section meets. Formatted as a string,
 
   *   with the 24-hr representation of the hour taking the first two
 
@@ -39,15 +37,19 @@ class Section
 
   *   one of Monday, Tuesday, Wednesday, Thursday, and Friday. For
 
   *   example, '135' would be for a course which meets on Monday,
 
   *   Wednesday, and Friday.
 
   * \param $prof
 
   *   The faculty person(s) who teaches this section.
 
   */
 
  function __construct ($letter, $prof, $time_start, $time_end, $days)
 
  function __construct ($letter, $time_start, $time_end, $days, $prof = '')
 
  {
 
    $this->letter = $letter;
 
    $this->prof = $prof;
 
    $this->start = $time_start;
 
    $this->tend = $time_end;
 

	
 
    $this->idays = $days;
 
    $this->bdays = $this->setbdays();
 

	
 
    $this->prof = $prof;
 
  }
 

	
 
  function setbdays()
school.d/calvin.crawl.inc
Show inline comments
 
@@ -320,7 +320,7 @@ function calvin_crawl(Semester $semester
 
	    foreach (array('date_start', 'date_end', 'meeting_type', 'days', 'time_start', 'time_end', 'meeting_place') as $var)
 
	      echo $var . ':' . ${$var} . "\n";
 

	
 
	  $section = new Section($section_id['section'], $faculty_name, $time_start, $time_end, $days);
 
	  $section = new Section($section_id['section'], $time_start, $time_end, $days, $faculty_name);
 
	  $semester->section_add($section_id['department'], $section_id['course'], $section);
 
	}
 

	
school.d/cedarville.inc
Show inline comments
 
@@ -202,9 +202,9 @@ function cedarville_crawl($semester, $ve
 
		 */
 
		$section_letter = 'L' . $section_letter;
 
	      $semester->section_add($section_parts['department'], $section_parts['course'],
 
				     new Section($section_letter, $instructor,
 
				     new Section($section_letter,
 
						 $meeting['time_start'], $meeting['time_end'],
 
						 $meeting['days']));
 
						 $meeting['days'], $instructor));
 
	    }
 
	}
 
    }
0 comments (0 inline, 0 general)