function display_stations() { global $CFG, $USER; $courseid = $this->instance->pageid; $pages = tao_get_learning_path_stations($courseid); $stations = ''; if (tao_is_my_learning_path($courseid)) { // get list of viewed pages $viewed = tao_get_viewed_learning_path_stations($courseid, $USER->id); } else { // just say we've viewed none $viewed = array(); } foreach ($pages as $page) { // have we viewed this one? if (in_array($page->id, $viewed)) { $icon = "tick"; } else { $icon = "caret_single_rtl"; // (nadavkav) } $stations .= '<p><img border="0" align="right" src="' . $CFG->wwwroot . '/theme/intel/pix/path/' . $icon . '.gif"/><a href="'; $stations .= $CFG->wwwroot . '/course/view.php?id=' . $courseid . '&page=' . $page->id . '" class="library"><span class="stations">'; $stations .= format_string($page->nameone) . '</span></a></p>'; // (nadavkav) } $html = '<h2>' . get_string('learningstations', 'block_tao_learning_path_summary') . '</h2>'; $html .= ' <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tbody> <!-- (nadavkav)--> <tr> <td width="10"> <br /> </td> <td width="100%"> <p style="text-align: center;"> <table cellspacing="0" cellpadding="0" border="0" id="lp-stations" width="100%"> <tbody> <!-- (nadavkav)--> <tr> <td class="lp-stations-list" valign="top">' . $stations . '</td> <td class="lp-stations-image" valign="top"> <img border="0" align="left" src="' . $CFG->wwwroot . '/theme/intel/pix/path/stufe01.gif" /><br /> </td> </tr> </tbody> </table> </p> </td> </tr></tbody> </table> '; return $html; }
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com * * Learning Path Station Completion Indicator Setting */ require_once dirname(dirname(dirname(__FILE__))) . '/config.php'; require_once $CFG->dirroot . '/course/format/page/lib.php'; require_once $CFG->dirroot . '/course/format/learning/lib.php'; require_once $CFG->dirroot . '/local/forms.php'; require_login(); $courseid = required_param('id', PARAM_INT); $context = get_context_instance(CONTEXT_COURSE, $courseid); $strtitle = get_string('lpcompletionchecklist', 'local'); print_header($strtitle, $strtitle); echo '<h2>' . $strtitle . '</h2>'; // check whether in 'my learning paths' if (!tao_is_my_learning_path($courseid)) { notify(get_string('cannotcompletelearningpath', 'local')); } else { // get list of all pages (stations) $stations = tao_get_learning_path_stations($courseid); // get list of viewed pages $viewed = tao_get_viewed_learning_path_stations($courseid, $USER->id); $mform = new tao_stationcompletion_form('', array('courseid' => $courseid, 'stations' => $stations, 'viewed' => $viewed)); if ($data = $mform->get_data()) { $selected = array_keys(get_object_vars($data)); foreach ($stations as $station) { $str = 'page_' . $station->id; // if selected if (in_array($str, $selected)) { // check whether we have it recorded already if (!in_array($station->id, $viewed)) {
page_print_add_mods_form($page, $course); } $class = 'format-page editing'; } else { $class = 'format-page'; } // get the overview page for the course $overview_page = page_get_default_page($course->id); $overview_link = ""; if ($overview_page->id != $page->id) { $overview_link = '<a href="' . course_page_uri($overview_page, $course) . '">דף מבוא</a>'; // should be get_string('overviewpage','format_learning'); // (nadavkav) } // create the 'my learning path' specific links $mypaths_link = ""; if (!tao_is_my_learning_path($course->id) && !isguest() && !($course->category == '7')) { // && !($course->category == '7') added to make sure it is not displayed when in Yesumiy Lemida course (nadavkav) $mypaths_link = '<a href="' . course_enrol_uri($overview_page, $course) . '">' . get_string('addtomylearningpaths', 'format_learning') . '</a>'; } $completion_page = '/local/lp/completion.php?id=' . $course->id; $completion_link = '<a href="' . $CFG->wwwroot . $completion_page . '" onclick="this.target=\'completion\'; return openpopup(\'' . $completion_page . '\', \'completion\', \'menubar=0,location=0,scrollbars,status,resizable,width=700,height=500\', 0);">' . get_string('completion', 'format_learning') . '</a>'; // print control row for the course echo '<table id="learning-path-header">'; echo '<tr><td><h1>' . $course->fullname . '</h1></td><td align="right">' . $mypaths_link . '</td></tr>'; echo '</table>'; // start the main layout table echo "\n<!-- start layout table -->\n"; echo '<table id="layout-table" class="' . $class . '" cellspacing="0" summary="' . get_string('layouttable') . '">'; tao_set_user_rafl_mode($course); if (isset($USER->raflmode) && $USER->raflmode) { // check wheter i have rights on this learning path