Changeset - f652ff09d273
[Not reviewed]
default
0 8 0
Nathan Brink (binki) - 15 years ago 2011-02-04 22:59:53
ohnobinki@ohnopublishing.net
Add an example course ID to the school profile's metadata and use this example course ID on input.php and in the qTip.
8 files changed with 35 insertions and 5 deletions:
0 comments (0 inline, 0 general)
inc/school.inc
Show inline comments
 
@@ -42,6 +42,7 @@
 
 * array with the following keys:
 
 * - name: a friendly name for the school. Must be a valid XHTML attribute string.
 
 * - url: the school's website URL as a valid XHTML attribute string. (i.e., escape ampersands).
 
 * - example_course_id: An example course identifier representative of a school's course IDs. (e.g., CS-101 for Calvin).
 
 *
 
 * \param $school_id
 
 *   The school's alphanumeric identifier (which determines the name
 
@@ -290,6 +291,25 @@ function school_default_courses($school)
 

	
 
/**
 
 * \brief
 
 *   Return an example course id for the school.
 
 *
 
 * Each school may specify an example course ID by placing a key
 
 * called 'example_course_id' into the array returned by its
 
 * <school_id>_info() function. See school_load().
 
 *
 
 * \param $school
 
 *   The school's handle.
 
 * \return
 
 *   A string containing a representative example of a course ID for
 
 *   the given school.
 
 */
 
function school_example_course_id(array $school)
 
{
 
  return $school['example_course_id'];
 
}
 

	
 
/**
 
 * \brief
 
 *   Determine if a school has crawler data stored.
 
 *
 
 * \param $school
input.php
Show inline comments
 
@@ -38,7 +38,9 @@ if (isset($_REQUEST['s']))
 
    $sch = schedule_store_retrieve($schedule_store, $schedule_id);
 
  }
 

	
 
$my_hc = 'jQuery(document).ready(
 
$my_hc = 'var slate_permutate_example_course_id = \'' . str_replace('\'', '\\\'', school_example_course_id($inputPage->get_school())) . '\';
 

	
 
jQuery(document).ready(
 
  function()
 
  {
 
    var class_last = 0;
 
@@ -62,7 +64,7 @@ else
 
  }
 
if ($qtips_always || !isset($_SESSION['saw_qtips']))
 
  {
 
    $my_hc .= '        addTips();';
 
    $my_hc .= '        addTips();' . PHP_EOL;
 
    $_SESSION['saw_qtips'] = TRUE;
 
  }
 
$my_hc .= '  });
 
@@ -104,8 +106,10 @@ if (!empty($_REQUEST['selectschool'])
 
<p>
 
  Welcome to SlatePermutate<?php $inputPage->addressStudent(', ', '', FALSE); ?>!
 
  <?php if (school_has_auto($inputPage->get_school())): ?>
 
  To get started, enter in some a course identifier and click the
 
  autosuggestion to automatically load available sections for each class.
 
  To get started, enter in some a course identifier (e.g., <em>
 
  <?php echo school_example_course_id($inputPage->get_school()); ?></em>)
 
  and click the autosuggestion to automatically load available sections
 
  for each class.
 
  <?php else: ?>
 
  To get started, enter a course number and add some sections to it.
 
  Then specify each section's letter/number and what times it meets,
school.d/calvin.inc
Show inline comments
 
@@ -29,6 +29,7 @@ function calvin_info()
 
	       'domains' => array(
 
				  'calvin.edu',
 
				  ),
 
	       'example_course_id' => 'CS-232',
 
	       'student_address' => 'Knight',
 
	       );
 
}
school.d/cedarville.inc
Show inline comments
 
@@ -25,6 +25,7 @@ function cedarville_info()
 
	       'domains' => array(
 
				  'cedarville.edu',
 
				  ),
 
	       'example_course_id' => 'MATH-2510',
 
	       'student_address' => 'Cedarville Student',
 
	       );
 
}
school.d/default.inc
Show inline comments
 
@@ -28,6 +28,7 @@ function default_info()
 
		*/
 
	       'domains' => array(
 
				  ),
 
	       'example_course_id' => 'ENGL-101',
 
	       'student_address' => 'student',
 
	       );
 
}
school.d/msu.inc
Show inline comments
 
@@ -25,6 +25,7 @@ function msu_info()
 
               'domains' => array(
 
                                  'msu.edu',
 
                                  ),
 
	       'example_course_id' => 'ENG-129',
 
               'student_address' => 'Spartan',
 
               );
 
}
school.d/umich.inc
Show inline comments
 
@@ -25,6 +25,7 @@ function umich_info()
 
               'domains' => array(
 
                                  'umich.edu',
 
                                  ),
 
	       'example_course_id' => 'MATH-161',
 
               'student_address' => 'Wolverine',
 
               );
 
}
scripts/scheduleInput.js
Show inline comments
 
@@ -224,7 +224,8 @@ function addTips()
 
  var td = tr.eq(tr.length-2);
 

	
 
  jQuery('td:first', td).qtip({
 
    content: 'Start typing your class ID (such as PEF-1010) and click a suggestion to add sections',
 
    /* slate_permutate_example_course_id is set globally in input.php. */
 
    content: 'Start typing your class ID (such as ' + slate_permutate_example_course_id + ') and click a suggestion to add sections',
 
    style: {
 
      border: { 
 
        width: 3,
0 comments (0 inline, 0 general)