Changeset - da99c618fb18
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 15 years ago 2011-03-22 16:41:12
ohnobinki@ohnopublishing.net
Genericize the registration codes dialogue's link.
2 files changed with 14 insertions and 2 deletions:
0 comments (0 inline, 0 general)
school.d/cedarville.inc
Show inline comments
 
@@ -17,24 +17,25 @@
 
 * You should have received a copy of the GNU Affero General Public License
 
 * along with SlatePermutate.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
function cedarville_info()
 
{
 
  return array('name' => 'Cedarville University',
 
	       'url' => 'http://cedarville.edu/',
 
	       'domains' => array(
 
				  'cedarville.edu',
 
				  ),
 
	       'example_course_id' => 'MATH-2510',
 
	       'registration_url' => 'http://cedarville.edu/cgi-bin/secure/register_student.pl',
 
	       'student_address' => 'Cedarville Student',
 
	       );
 
}
 

	
 
function cedarville_instructions_html()
 
{
 
  return <<<EOF
 
<h2>Instructions</h2>
 
<p>
 
  SlatePermutate can be a useful tool for scheduling your next semester at <a href="http://cedarville.edu/" rel="external">Cedarville University</a>.
 
</p>
 
<ol>
school.d/default.inc
Show inline comments
 
@@ -54,25 +54,36 @@ function default_instructions_html()
 
</ol>
 
EOF;
 
}
 

	
 
/**
 
 * \brief
 
 *  A generic fallback for school_registration_html().
 
 *
 
 * \see school_registration_html()
 
 */
 
function default_registration_html(Page $page, array $school, array $courses)
 
{
 
  if (!empty($school['registration_url']))
 
    {
 
      $link_url = $school['registration_url'];
 
      $link_text = $school['name'] . '\'s registration system';
 
    }
 
  else
 
    {
 
      $link_url = $school['url'];
 
      $link_text = $school['name'] . '\'s website';
 
    }
 

	
 
  $html = ''
 
    . '  <p>' . PHP_EOL
 
    . '    Enter these codes into your school\'s online course registration' . PHP_EOL
 
    . '    system (<a href="' . htmlentities($school['url']) . '">' . htmlentities($school['name']) . '\'s website</a>)' . PHP_EOL
 
    . '    Enter these codes into ' . htmlentities($school['name']) . '\'s online course registration' . PHP_EOL
 
    . '    system (<a href="' . htmlentities($link_url) . '">' . htmlentities($link_text) . '</a>)' . PHP_EOL
 
    . '    to register for classes:' . PHP_EOL
 
    . '  </p>' . PHP_EOL
 
    . '  <ul class="synonym-list">' . PHP_EOL;
 
  foreach ($courses as $course)
 
    foreach ($course as $section)
 
      $html .= '    <li>' . htmlentities($section->getSynonym()) . '</li>' . PHP_EOL;
 
  $html .= '  </ul>' . PHP_EOL;
 
  return $html;
 
}
0 comments (0 inline, 0 general)