Changeset - 19228cef8a8b
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 15 years ago 2011-03-22 16:31:05
ohnobinki@ohnopublishing.net
Display an informative not on the Registration Codes dialogue to indicate that it is relevant to the currently selected tab.
2 files changed with 6 insertions and 3 deletions:
0 comments (0 inline, 0 general)
inc/class.schedule.php
Show inline comments
 
@@ -384,49 +384,52 @@ class Schedule
 
		  if ($meeting->getDay(5))
 
		    {
 
		      $max_day_plusone = 6;
 
		      $have_saturday = TRUE;
 
		    }
 

	
 
		  /* very late / very early classes */
 
		  while ($meeting->getEndTime() > $max_time)
 
		    {
 
		      $max_time += 30;
 
		      $time[] = $max_time;
 
		    }
 
		  while ($meeting->getStartTime() < $min_time)
 
		    {
 
		      $min_time -= 30;
 
		      $time[] = $min_time;
 
		      $sort_time = TRUE;
 
		    }
 
		}
 
	  }
 
	/* ensure that early times are actually first ;-) */
 
	if ($sort_time)
 
	  sort($time);
 

	
 
        echo '<div id="regDialog" title="Registration Codes"></div>';
 
        echo '    <div id="regDialog" title="Registration Codes">' . PHP_EOL
 
	  . '      <div id="regDialog-content"></div>' . PHP_EOL
 
	  . '      <p id="regDialog-disclaimer" class="graytext"><em>Note: The registration information above corresponds to the sections displayed on the currently selected tab.</em></p>'
 
	  . '    </div>';
 
	echo '<div id="tabs">' . "\n" .
 
               '<div id="show-box" class="show-buttons">
 
                  <form action="#"><p class="nospace">
 
                    <label><strong>Display:</strong></label>
 
                    <input id="show-prof" name="show-prof" type="checkbox" checked="checked" /><label for="show-prof">Professor</label>
 
                    <input id="show-location" name="show-location" type="checkbox" /><label for="show-location">Room</label>
 
                    <input id="show-synonym" name="show-synonym" type="checkbox" /><label for="show-synonym">Synonym</label>
 
                    <span id="regCodes"><label><a href="#">Registration Codes</a></label></span></p>
 
                  </form>';
 

	
 
          echo '</div> <!-- id="show-box" -->'
 
	     . '<div id="the-tabs"><ul>' . "\n";
 
			
 
	for($nn = $first_permutation + 1; $nn <= $last_permutation; $nn++)
 
	  {
 
	    echo  "<li><a href=\"#tabs-" . $nn . "\">&nbsp;" . $nn . "&nbsp;</a></li>\n";
 
	  }
 
			
 
	echo "    </ul></div>\n  \n";
 

	
 
	echo "    <div id=\"pagers\">\n";
 
	/* Previous button */
 
	if ($page > 0)
 
	  echo '      <div id="pager-previous" class="pager left"><a href="' . htmlentities($this->url($this->id, $page - 1)) . '">&laquo; Previous</a></div>' . "\n";
scripts/displayTables.js
Show inline comments
 
@@ -86,43 +86,43 @@ function slate_permutate_load(target, da
 
                url: 'ajax.php',
 
		data: data,
 
		success: function(data, status_text, xhr)
 
		{
 
		    if (data && data.success && jQuery.type(data.data) != 'undefined')
 
			handler(target, data.data);
 
		    else
 
			error_handler(target, status_text, data);
 
		},
 
		dataType: 'json',
 
		error: function(xhr_jq, status_text, error)
 
		{
 
		    error_handler(target, status_text, null);
 
		}
 
		});
 
}
 

	
 
jQuery(document).ready( function()
 
  {
 
      jQuery('#show-box input').change(show_box_change);
 
      jQuery('#show-box input').change();
 

	
 
      jQuery("#regDialog").dialog({ modal: true, width: 550, resizable: false, draggable: false, autoOpen: false });   
 
      jQuery('#regCodes').click( function() {
 
        jQuery('#regDialog').html('<p>Loading registration information...</p>');
 
        jQuery('#regDialog-content').html('<p>Loading registration information...</p>');
 

	
 
	/* hmm... why isn't this information just stored in a global JS variable? */
 
	var tab_i = jQuery('#tabs').tabs('option','selected');
 
	var tab_fragment_i = /-([^-]+)$/.exec(jQuery('#the-tabs li:eq(' + tab_i + ') a').attr('href'))[1];
 
        var tab_course_data_json_selector = '.course-data-' + tab_fragment_i;
 
	
 
        var tab_course_data_json = jQuery(tab_course_data_json_selector).text();
 
        var tab_course_data = eval('(' + tab_course_data_json + ')');
 

	
 
	slate_permutate_load(jQuery('#regDialog'), {school_registration_html: true, courses: tab_course_data});
 
	slate_permutate_load(jQuery('#regDialog-content'), {school_registration_html: true, courses: tab_course_data});
 

	
 
        jQuery("#regDialog").dialog('open');
 

	
 
	return false;
 
      });
 
  }
 
);
 

	
0 comments (0 inline, 0 general)