Changeset - 143f48e9e161
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 12 years ago 2013-10-30 01:22:00
ohnobinki@ohnopublishing.net
Add description blurbs that happen to be picked up by facebook’s link blurb generator, somewhat addresses bug #90.

We have per-tab blurbs expanding the sections and a page-wide blurb listing the courses.
2 files changed with 53 insertions and 0 deletions:
0 comments (0 inline, 0 general)
inc/class.schedule.php
Show inline comments
 
@@ -592,6 +592,23 @@ class Schedule
 
        if ($have_saturday)
 
          $dayloop_max = 6;
 

	
 
        /*
 
         * Something to describe the whole page to a link-blurb
 
         * generator (like Facebook’s link-sharer), so per-course.
 
         */
 
        echo '    <div id="courseList" class="description" title="Chosen Courses."><p>' . PHP_EOL;
 
        foreach ($this->courses as $course_j => $course)
 
          {
 
            if ($course_j)
 
              echo ';' . PHP_EOL;
 
            $title = $course->title_get();
 
            echo '      ' . page::entities(
 
              $course->getName()
 
              . (empty($title) ? '' : ': ' . $title));
 
          }
 
        echo '. There are ' . $this->nPermutations . ' valid permutation' . ($this->nPermutations == 1 ? '' : 's') . ' for these courses.' . PHP_EOL;
 
        echo '    </p></div>' . PHP_EOL;
 

	
 
        echo '    <div id="regDialog" title="Registration Codes">' . PHP_EOL
 
	  . '      <div id="regDialog-content"></div>' . PHP_EOL
 
	  . '      <p class="regDialog-disclaimer graytext">' . PHP_EOL
 
@@ -686,6 +703,35 @@ class Schedule
 

	
 
	     echo  '      <div class="section" id="tabs-' . ($i+1) . "\">\n";
 
  
 
             /*
 
              * A description readable by link blurb-generators (like
 
              * facebook’s link sharer) per permutation (so
 
              * section-specific). This gets picked up by the
 
              * blurb-generators because they respect fragments in
 
              * URIs.
 
              */
 
             echo '    <div class="sectionList"><p>' . PHP_EOL;
 
             foreach ($this->courses as $course_j => $course)
 
               {
 
                 foreach ($course as $course_slot)
 
                   {
 
                     $section = $course_slot->section_get_i($this->storage[$i][$course_j]);
 
                     if ($course_j)
 
                       echo ';' . PHP_EOL;
 
                     $instructors = array();
 
                     foreach ($section as $section_meeting)
 
                       if ($instructor = $section_meeting->instructor_get())
 
                         $instructors[$instructor] = TRUE;
 
                     $title = $course->title_get();
 
                     echo '      ' . page::entities(
 
                       $course->getName() . '-' . $section->getLetter()
 
                       . (empty($title) ? '' : ': ' . $title)
 
                       . (empty($instructors) ? '' : ' with ' . implode(', ', array_keys($instructors))));
 
                   }
 
               }
 
             echo '.' . PHP_EOL;
 
             echo '    </p></div>' . PHP_EOL;
 

	
 
	    // Beginning of table
 
	    echo "        <table style=\"empty-cells:show;\" border=\"1\" cellspacing=\"0\">\n";
 
				
styles/output.css
Show inline comments
 
@@ -199,6 +199,13 @@ td{
 
{
 
  float: right;
 
}
 
/*
 
 * For link-blurb generators to read, not humans to directly see.
 
 */
 
.sectionList, #courseList
 
{
 
  display: none;
 
}
 

	
 
table {
 
  border-radius: 5px;
0 comments (0 inline, 0 general)