Changeset - afba6cc05e68
[Not reviewed]
default
0 3 0
Nathan Brink (binki) - 15 years ago 2010-10-16 23:54:22
ohnobinki@ohnopublishing.net
Remove ->input_form_render() functions which were obsoleted by the last commit (0741fde6e765).
3 files changed with 1 insertions and 144 deletions:
0 comments (0 inline, 0 general)
class.class.php
Show inline comments
 
@@ -61,33 +61,13 @@ class Classes
 
  //--------------------------------------------------
 
  // Returns the name of the class.
 
  //--------------------------------------------------
 
  function getName()
 
  public function getName()
 
  {
 
    return $this->name;
 
  }
 

	
 
  /**
 
   * \brief
 
   *   Renders this Classes into something suitable for input.php.
 
   */
 
  function input_form_render($class_key)
 
  {
 
    $n = "\n";
 
    $out = '<tr title="' . $class_key . '" class="class class' . $class_key . '">' . $n
 
      . '  <td><input type="text" class="required defText" title="Class Name" name="postData[' . $class_key . '][name]" value="' . htmlentities($this->getName()) . '"/></td>' . $n
 
      . '  <td colspan="8"></td>' . $n
 
      . '  <td class="tdInput"><div class="addSection"><input type="button" value="Add section" class="gray" /></div></td>' . $n
 
      . '  <td class="tdInput"><div class="deleteClass"><input type="button" value="Remove" class="gray" /></div></td>' . $n
 
      . "</tr>\n";
 

	
 
    foreach ($this->sections as $key => $section)
 
      $out .= $section->input_form_render($class_key, $key);
 

	
 
    return $out;
 
  }
 

	
 
  /**
 
   * \brief
 
   *   Split up a user-friendly course specification into components.
 
   *
 
   * This will only return the 'department' and 'course' components of
class.schedule.php
Show inline comments
 
@@ -358,24 +358,6 @@ class Schedule
 
    $outputPage->foot();
 
  }
 

	
 
  /**
 
   * \brief
 
   *   Render the input table form for editing a saved schedule in input.php.
 
   *
 
   * This function's output must be synchronized with the
 
   * associated javascript in scripts/scheduleInput.js.
 
   */
 
  function input_form_render()
 
  {
 
    $out = '';
 
    static $n = "\n";
 

	
 
    foreach ($this->classStorage as $class_key => $class)
 
      $out .= $class->input_form_render($class_key);
 

	
 
    return $out;
 
  }
 

	
 
  //--------------------------------------------------
 
  // Changes the title of the page.
 
  //--------------------------------------------------
class.section.php
Show inline comments
 
@@ -202,111 +202,6 @@ class Section
 
  
 
  /**
 
   * \brief
 
   *   Create output suitable for editing on input.php.
 
   *
 
   * \see Classes::input_form_render()
 
   *
 
   * \param $class_key
 
   *   The same $class_key passed to Classes::input_form_render().
 
   * \param $section_key
 
   *   The index of this section.
 
   * \param $section_format
 
   *   The type of input method used for this section. Valid values
 
   *   are 'numerous', 'numbered', and 'lettered'
 
   */
 
  public function input_form_render($class_key, $section_key, $section_format = 'numerous')
 
  {
 
    static $n = "\n";
 
    $out = '<tr class="section class' . $class_key . '">' . $n
 
      . '  <td class="none"></td>' . $n;
 
    switch ($section_format)
 
      {
 
      case 'numerous':
 
      default:
 
	/* see customIds() in scheduleInput.js */
 
	$out .= '  <td class="sectionIdentifier center">' . $n
 
	. '    <input type="text" size="1" class="required" title="Section Name"' . $n
 
	. '           name="postData[' . $class_key . '][' . $section_key . '][letter]"' . $n
 
	. '           value="' . htmlentities($this->letter) . '" />' . $n
 
	. "  </td>\n";
 
      break;
 
      }
 

	
 
    $out .= "  <td>\n"
 
      . '    <select class="selectRequired" name="postData[' . $class_key . '][' . $section_key . '][start]">' . $n;
 
    for ($h = 7; $h <= 21; $h ++)
 
      {
 
	$nm = 'p';
 
	$hr = $h;
 
	if ($h < 12)
 
	  $nm = 'a';
 
	elseif ($h > 12)
 
	  $hr -= 12;
 

	
 
	foreach (array('00', '30') as $m)
 
	  {
 
	    $val = $h . $m;
 

	
 
	    $selected = '';
 
	    if ($this->start == $val)
 
	      $selected = ' selected="selected"';
 

	
 
	    $label = $hr . ':' . $m . $nm . 'm';
 
	    $out .= '      <option value="' . $val . '"' . $selected . '>' . $label . '</option>' . $n;
 
	  }
 
      }
 
    $out .= "    </select>\n"
 
      . "  </td>\n";
 

	
 
    /* ugh, code duplication :-(  --binki commenting on his own code*/
 
    $out .= "  <td>\n"
 
      . '    <select class="selectRequired" name="postData[' . $class_key . '][' . $section_key . '][end]">' . $n;
 
    for ($h = 7; $h <= 21; $h ++)
 
      {
 
	$nm = 'p';
 
	$hr = $h;
 
	if ($h < 12)
 
	  $nm = 'a';
 
	elseif ($h > 12)
 
	  $hr -= 12;
 

	
 
	foreach (array('20', '50') as $m)
 
	  {
 
	    $val = $h . $m;
 

	
 
	    $selected = '';
 
	    if ($this->tend == $val)
 
	      $selected = ' selected="selected"';
 

	
 
	    $label = $hr . ':' . $m . $nm . 'm';
 
	    $out .= '      <option value="' . $val . '"' . $selected . '>' . $label . '</option>' . $n;
 
	  }
 
      }
 
    $out .= "    </select>\n"
 
      . "  </td>\n";
 

	
 
    foreach ($this->bdays as $day_key => $day_enabled)
 
      {
 
	if ($day_enabled)
 
	  $day_enabled = 'checked="checked"';
 
	else
 
	  $day_enabled = '';
 
	$out .= "  <td>\n"
 
	  . '    <input type="checkbox" class="daysRequired"'
 
	  . '           name="postData[' . $class_key . '][' . $section_key . '][days][' . $day_key . ']" value="1" ' . $day_enabled . ' />' . $n
 
	  . "  </td>\n";
 
      }
 

	
 
    $out .= '  <td><div class="deleteSection"><input type="button" value="X" class="gray" /></div></td>' . $n;
 
    $out .= '  <td></td>' . $n;
 

	
 
    $out .= "</tr>\n";
 

	
 
    return $out;
 
  }
 

	
 
  /**
 
   * \brief
 
   *   Splits up a section specifier into dept, course number, and
 
   *   section.
 
   *
0 comments (0 inline, 0 general)