Changeset - d996590336e3
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 14 years ago 2012-02-14 22:17:13
ohnobinki@ohnopublishing.net
Add support for hiding hysterical (historical) semesters on the semester selection page.
2 files changed with 20 insertions and 0 deletions:
0 comments (0 inline, 0 general)
inc/class.page.php
Show inline comments
 
@@ -531,34 +531,46 @@ class page
 
     * We can pre-htmlentities() $linkto because we're only appending
 
     * a safe string.
 
     */
 
    $linkto = htmlentities($linkto . 'semester=');
 

	
 
    $time = time();
 
    /**
 
     * Hysterical... or historical? Uncle John Brink prefers
 
     * ``hysterical''...
 
     */
 
    $hysterical = FALSE;
 

	
 
    echo "    <p>\n";
 
    echo "      <ul>\n";
 
    foreach (school_semesters($this->school) as $semester)
 
      {
 
	$text_extra = array();
 
	$class_extra = '';
 
	if ($semester['id'] == $this->semester['id'])
 
	  {
 
	    $class_extra = ' highlight';
 
	    $text_extra[] = 'selected';
 
	  }
 
	if ($semester['time_start'] > 36000 && $semester['time_start'] < ($time - 365*24*60*60))
 
	  {
 
	    $class_extra .= ' hysterical';
 
	    $hysterical = TRUE;
 
	  }
 

	
 
	if ($semester['time_start'] < $time && $semester['time_end'] > $time)
 
	  $text_extra[] = 'current';
 

	
 
	$text_extra = implode($text_extra, ', ');
 
	if (strlen($text_extra))
 
	  $text_extra = ' (' . $text_extra . ')';
 

	
 
	echo '        <li class="semester' . $class_extra . '"><a href="' . $linkto . $semester['id'] . '">' . htmlentities($semester['name']) . '</a>' . $text_extra . "</li>\n";
 
      }
 
    if ($hysterical)
 
	echo '       <li style="display: none;" class="hysterical-show"><a class="hysterical-show-a" href="#">(Show hysterical semesters…)</a></li>' . PHP_EOL;
 
    echo "      </ul>\n";
 
    echo "    </p>\n";
 
  }
 

	
 
  /**
 
   * \brief
scripts/scheduleInput.js
Show inline comments
 
@@ -931,7 +931,15 @@ jQuery(document).ready(function() {
 
        });
 

	
 
	credit_hours_shown = jQuery('#content').is('.credit-hours-shown');
 
	jQuery('.section-credit-hours-entry').live('change', function() {
 
		credit_hours_change(jQuery(this).closest('.section').data('course_i'));
 
	});
 

	
 
	/* For the ``Select Semester'' page */
 
	jQuery('.hysterical-show-a').click(function() {
 
	    jQuery('.hysterical').show();
 
	    jQuery('.hysterical-show').hide();
 
	});
 
	jQuery('.hysterical-show').show();
 
	jQuery('.hysterical').hide();
 
});
0 comments (0 inline, 0 general)