public function display_waitlist()
 {
     // action_waitlist
     global $OUTPUT, $PAGE, $USER;
     $cuserid = cm_get_crlmuserid($USER->id);
     $usercurs = curriculumstudent::get_curricula($cuserid);
     if (count($usercurs) > elis::$config->local_elisprogram->catalog_collapse_count) {
         $buttonLabel = get_string('show');
         $extraclass = ' hide';
     } else {
         $buttonLabel = get_string('hide');
         $extraclass = '';
     }
     // Needed for the hide buttons
     $this->include_js();
     if (!empty($usercurs)) {
         foreach ($usercurs as $usercur) {
             echo $OUTPUT->heading('<div class="clearfix"></div><div class="headermenu"><script id="curriculum' . $usercur->curid . 'script" type="text/javascript">toggleVisibleInit("curriculum' . $usercur->curid . 'script", "curriculum' . $usercur->curid . 'button", "' . $buttonLabel . '", "Hide", "Show", "curriculum' . $usercur->curid . '");</script></div>' . $usercur->name . ' (' . $usercur->idnumber . ')');
             echo '<div id="curriculum' . $usercur->curid . "\" {$this->div_attrs} class=\"yui-skin-sam\">";
             $courses = student::get_waitlist_in_curriculum($cuserid, $usercur->curid);
             if ($courses->valid() === true) {
                 echo "<div id=\"{$usercur->curid}\"></div>";
                 $table = new waitlisttable($courses);
                 $table->print_yui_table('curriculum' . $usercur->curid);
             } else {
                 echo '<p>' . get_string('nocoursesinthiscurriculum', 'local_elisprogram') . '</p>';
             }
             unset($courses);
             echo '</div>';
         }
     } else {
         echo $OUTPUT->heading(get_string('nocoursesinthiscurriculum', 'local_elisprogram'));
     }
     echo '<br/>';
     echo $OUTPUT->box(get_string('lp_waitlist_instructions', 'local_elisprogram'), 'generalbox lp_instructions');
 }
 public function action_waitlist()
 {
     global $CFG, $CURMAN, $USER;
     $cuserid = cm_get_crlmuserid($USER->id);
     $usercurs = curriculumstudent::get_curricula($cuserid);
     if (count($usercurs) > $CURMAN->config->catalog_collapse_count) {
         $buttonLabel = get_string('show', 'block_curr_admin');
         $extraclass = ' hide';
     } else {
         $buttonLabel = get_string('hide', 'block_curr_admin');
         $extraclass = '';
     }
     require_js($CFG->wwwroot . '/curriculum/js/util.js');
     $this->include_yui();
     if (!empty($usercurs)) {
         foreach ($usercurs as $usercur) {
             print_heading('<div class="clearfix"></div><div class="headermenu"><script id="curriculum' . $usercur->curid . 'script" type="text/javascript">toggleVisibleInit("curriculum' . $usercur->curid . 'script", "curriculum' . $usercur->curid . 'button", "' . $buttonLabel . '", "Hide", "Show", "curriculum' . $usercur->curid . '");</script></div>' . $usercur->name . ' (' . $usercur->idnumber . ')');
             echo '<div id="curriculum' . $usercur->curid . '" class="yui-skin-sam">';
             if ($courses = student::get_waitlist_in_curriculum($cuserid, $usercur->curid)) {
                 echo "<div id=\"{$usercur->curid}\"></div>";
                 $table = new waitlisttable($courses);
                 $table->print_yui_table($usercur->curid);
             } else {
                 echo '<p>' . get_string('nocoursesinthiscurriculum', 'block_curr_admin') . '</p>';
             }
             echo '</div>';
         }
     } else {
         print_heading(get_string('nocoursesinthiscurriculum', 'block_curr_admin'));
     }
     echo '<br/>';
     print_box(get_string('lp_waitlist_instructions', 'block_curr_admin'), 'generalbox lp_instructions');
 }