|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 // This file is part of Moodle - http://moodle.org/ 00003 // 00004 // Moodle is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // Moodle is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00016 // 00017 // This file is part of BasicLTI4Moodle 00018 // 00019 // BasicLTI4Moodle is an IMS BasicLTI (Basic Learning Tools for Interoperability) 00020 // consumer for Moodle 1.9 and Moodle 2.0. BasicLTI is a IMS Standard that allows web 00021 // based learning tools to be easily integrated in LMS as native ones. The IMS BasicLTI 00022 // specification is part of the IMS standard Common Cartridge 1.1 Sakai and other main LMS 00023 // are already supporting or going to support BasicLTI. This project Implements the consumer 00024 // for Moodle. Moodle is a Free Open source Learning Management System by Martin Dougiamas. 00025 // BasicLTI4Moodle is a project iniciated and leaded by Ludo(Marc Alier) and Jordi Piguillem 00026 // at the GESSI research group at UPC. 00027 // SimpleLTI consumer for Moodle is an implementation of the early specification of LTI 00028 // by Charles Severance (Dr Chuck) htp://dr-chuck.com , developed by Jordi Piguillem in a 00029 // Google Summer of Code 2008 project co-mentored by Charles Severance and Marc Alier. 00030 // 00031 // BasicLTI4Moodle is copyright 2009 by Marc Alier Forment, Jordi Piguillem and Nikolas Galanis 00032 // of the Universitat Politecnica de Catalunya http://www.upc.edu 00033 // Contact info: Marc Alier Forment granludo @ gmail.com or marc.alier @ upc.edu 00034 00049 require_once("../../config.php"); 00050 require_once($CFG->dirroot.'/mod/lti/lib.php'); 00051 00052 $id = required_param('id', PARAM_INT); // course id 00053 00054 $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST); 00055 00056 require_login($course); 00057 $PAGE->set_pagelayout('incourse'); 00058 00059 add_to_log($course->id, "lti", "view all", "index.php?id=$course->id", ""); 00060 00061 $PAGE->set_url('/mod/lti/index.php', array('id' => $course->id)); 00062 $pagetitle = strip_tags($course->shortname.': '.get_string("modulenamepluralformatted", "lti")); 00063 $PAGE->set_title($pagetitle); 00064 $PAGE->set_heading($course->fullname); 00065 00066 echo $OUTPUT->header(); 00067 00068 // Print the main part of the page 00069 echo $OUTPUT->heading(get_string("modulenamepluralformatted", "lti")); 00070 00071 // Get all the appropriate data 00072 if (! $basicltis = get_all_instances_in_course("lti", $course)) { 00073 notice(get_string('noltis', 'lti'), "../../course/view.php?id=$course->id"); 00074 die; 00075 } 00076 00077 // Print the list of instances (your module will probably extend this) 00078 $timenow = time(); 00079 $strname = get_string("name"); 00080 $strsectionname = get_string('sectionname', 'format_'.$course->format); 00081 $usesections = course_format_uses_sections($course->format); 00082 if ($usesections) { 00083 $sections = get_all_sections($course->id); 00084 } 00085 00086 $table = new html_table(); 00087 $table->attributes['class'] = 'generaltable mod_index'; 00088 00089 if ($usesections) { 00090 $table->head = array ($strsectionname, $strname); 00091 $table->align = array ("center", "left"); 00092 } else { 00093 $table->head = array ($strname); 00094 } 00095 00096 foreach ($basicltis as $basiclti) { 00097 if (!$basiclti->visible) { 00098 //Show dimmed if the mod is hidden 00099 $link = "<a class=\"dimmed\" href=\"view.php?id=$basiclti->coursemodule\">$basiclti->name</a>"; 00100 } else { 00101 //Show normal if the mod is visible 00102 $link = "<a href=\"view.php?id=$basiclti->coursemodule\">$basiclti->name</a>"; 00103 } 00104 00105 if ($course->format == "weeks" or $course->format == "topics") { 00106 $table->data[] = array ($basiclti->section, $link); 00107 } else { 00108 $table->data[] = array ($link); 00109 } 00110 } 00111 00112 echo "<br />"; 00113 00114 echo html_writer::table($table); 00115 00116 // Finish the page 00117 echo $OUTPUT->footer();