From 5c7511c7c64f62f44244ba1c9f1aac9952c564e1 Mon Sep 17 00:00:00 2001 From: Jan Klemkow Date: Tue, 9 Oct 2012 15:28:22 +0200 Subject: Rename 'newmodule' into sqlbox in all files. --- sqlbox/index.php | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'sqlbox/index.php') diff --git a/sqlbox/index.php b/sqlbox/index.php index 60e85d0..b4c9456 100644 --- a/sqlbox/index.php +++ b/sqlbox/index.php @@ -22,13 +22,11 @@ * if you like, and it can span multiple lines. * * @package mod - * @subpackage newmodule - * @copyright 2011 Your Name + * @subpackage sqlbox + * @copyright 2012 Jan Klemkow, Benjamin Franzke * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -/// Replace newmodule with the name of your module and remove this line - require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); require_once(dirname(__FILE__).'/lib.php'); @@ -38,19 +36,19 @@ $course = $DB->get_record('course', array('id' => $id), '*', MUST_EXIST); require_course_login($course); -add_to_log($course->id, 'newmodule', 'view all', 'index.php?id='.$course->id, ''); +add_to_log($course->id, 'sqlbox', 'view all', 'index.php?id='.$course->id, ''); $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); -$PAGE->set_url('/mod/newmodule/index.php', array('id' => $id)); +$PAGE->set_url('/mod/sqlbox/index.php', array('id' => $id)); $PAGE->set_title(format_string($course->fullname)); $PAGE->set_heading(format_string($course->fullname)); $PAGE->set_context($coursecontext); echo $OUTPUT->header(); -if (! $newmodules = get_all_instances_in_course('newmodule', $course)) { - notice(get_string('nonewmodules', 'newmodule'), new moodle_url('/course/view.php', array('id' => $course->id))); +if (! $sqlboxs = get_all_instances_in_course('sqlbox', $course)) { + notice(get_string('nosqlboxs', 'sqlbox'), new moodle_url('/course/view.php', array('id' => $course->id))); } if ($course->format == 'weeks') { @@ -64,25 +62,25 @@ if ($course->format == 'weeks') { $table->align = array('left', 'left', 'left'); } -foreach ($newmodules as $newmodule) { - if (!$newmodule->visible) { +foreach ($sqlboxs as $sqlbox) { + if (!$sqlbox->visible) { $link = html_writer::link( - new moodle_url('/mod/newmodule.php', array('id' => $newmodule->coursemodule)), - format_string($newmodule->name, true), + new moodle_url('/mod/sqlbox.php', array('id' => $sqlbox->coursemodule)), + format_string($sqlbox->name, true), array('class' => 'dimmed')); } else { $link = html_writer::link( - new moodle_url('/mod/newmodule.php', array('id' => $newmodule->coursemodule)), - format_string($newmodule->name, true)); + new moodle_url('/mod/sqlbox.php', array('id' => $sqlbox->coursemodule)), + format_string($sqlbox->name, true)); } if ($course->format == 'weeks' or $course->format == 'topics') { - $table->data[] = array($newmodule->section, $link); + $table->data[] = array($sqlbox->section, $link); } else { $table->data[] = array($link); } } -echo $OUTPUT->heading(get_string('modulenameplural', 'newmodule'), 2); +echo $OUTPUT->heading(get_string('modulenameplural', 'sqlbox'), 2); echo html_writer::table($table); echo $OUTPUT->footer(); -- cgit