]> git.mjollnir.org Git - moodle.git/commitdiff
mod-lesson MDL-19812 Added set_url calls, replaced deprecated functions
authorsamhemelryk <samhemelryk>
Thu, 24 Sep 2009 08:05:55 +0000 (08:05 +0000)
committersamhemelryk <samhemelryk>
Thu, 24 Sep 2009 08:05:55 +0000 (08:05 +0000)
mod/lesson/grade.php
mod/lesson/highscores.php
mod/lesson/import.php
mod/lesson/importppt.php
mod/lesson/index.php
mod/lesson/locallib.php
mod/lesson/mediafile.php

index 4e1ebdab4e44b195465dbbf05fb69644570151e1..33a4f389100a2285593af4adb6582e9a20602706 100644 (file)
@@ -1,9 +1,11 @@
-<?php  // $Id$
+<?php
 
     require_once("../../config.php");
 
     $id   = required_param('id', PARAM_INT);          // Course module ID
 
+    $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/lesson/grade.php', array('id'=>$id)));
+
     if (! $cm = get_coursemodule_from_id('lesson', $id)) {
         print_error('invalidcoursemodule');
     }
index d0569c4fd9cf0e6e21eb78d5b72eda488d7fc675..af73634c713c0ff04d62fc0cea4e07a5baf4d45f 100644 (file)
@@ -1,8 +1,8 @@
-<?php  // $Id$
+<?php
+
 /**
  * Provides the interface for viewing and adding high scores
  *
- * @version $Id$
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package lesson
  **/
     $mode    = optional_param('mode', '', PARAM_ALPHA);
     $link = optional_param('link', 0, PARAM_INT);
 
+    $url = new moodle_url($CFG->wwwroot.'/mod/lesson/highscores.php', array('id'=>$id));
+    if ($mode !== '') {
+        $url->param('mode', $mode);
+    }
+    if ($link !== 0) {
+        $url->param('link', $link);
+    }
+    $PAGE->set_url($url);
+
     list($cm, $course, $lesson) = lesson_get_basics($id);
     
     require_login($course->id, false, $cm);
index 1358e8ed23e4c90dec9adc734cd5febb275db6ca..2e6fdcd9e82280bd7db0e69adfa5a1f5dddea641 100644 (file)
@@ -1,8 +1,8 @@
-<?php // $Id$
+<?php
+
 /**
  * Imports lesson pages
  *
- * @version $Id$
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package lesson
  **/
     $id     = required_param('id', PARAM_INT);         // Course Module ID
     $pageid = optional_param('pageid', '', PARAM_INT); // Page ID
 
+    $url = new moodle_url($CFG->wwwroot.'/mod/lesson/import.php', array('id'=>$id));
+    if ($pageid !== '') {
+        $url->param('pageid', $pageid);
+    }
+    $PAGE->set_url($url);
+
     if (! $cm = get_coursemodule_from_id('lesson', $id)) {
         print_error('invalidcoursemodule');
     }
 
     $fileformatnames = get_import_export_formats('import');
 
-    print_heading_with_help($strimportquestions, "import", "lesson");
+    $helpicon = new moodle_help_icon();
+    $helpicon->text = $strimportquestions;
+    $helpicon->page = "import";
+    $helpicon->module = "lesson";
+
+    echo $OUTPUT->heading_with_help($helpicon);
 
     echo $OUTPUT->box_start('generalbox boxaligncenter');
     echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"import.php\">";
index 2a92304f14b282235352d9f42aa4d098d00fa937..125c92c5c319c9206affeae1483150a21bc8d7ef 100644 (file)
@@ -1,4 +1,5 @@
-<?php // $Id$
+<?php
+
 /**
  * This is a very rough importer for powerpoint slides
  * Export a powerpoint presentation with powerpoint as html pages
@@ -8,7 +9,6 @@
  * 
  * The script supports book and lesson.
  *
- * @version $Id$
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package lesson
  **/
     $id     = required_param('id', PARAM_INT);         // Course Module ID
     $pageid = optional_param('pageid', '', PARAM_INT); // Page ID
     global $matches;
+
+    $url = new moodle_url($CFG->wwwroot.'/mod/lesson/importppt.php', array('id'=>$id));
+    if ($pageid !== '') {
+        $url->param('pageid', $pageid);
+    }
+    $PAGE->set_url($url);
     
     if (! $cm = get_coursemodule_from_id('lesson', $id)) {
         print_error('invalidcoursemodule');
     }
 
     /// Print upload form
+    $helpicon = new moodle_help_icon();
+    $helpicon->text = $strimportppt;
+    $helpicon->page = "importppt";
+    $helpicon->module = "lesson";
 
-    print_heading_with_help($strimportppt, "importppt", "lesson");
+    echo $OUTPUT->heading_with_help($helpicon);
 
     echo $OUTPUT->box_start('generalbox boxaligncenter');
     echo "<form id=\"theform\" enctype=\"multipart/form-data\" method=\"post\">";
index f707ae3ca0bfac4804dcf406038962956f35772d..75210af80e92fa7459a04929e0e9aee66b9338b3 100644 (file)
@@ -1,8 +1,8 @@
-<?php // $Id$
+<?php
+
 /**
  * This page lists all the instances of lesson in a particular course
  *
- * @version $Id$
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package lesson
  **/
@@ -13,6 +13,8 @@
 
     $id = required_param('id', PARAM_INT);   // course
 
+    $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/lesson/index.php', array('id'=>$id)));
+
     if (!$course = $DB->get_record("course", array("id" => $id))) {
         print_error('invalidcourseid');
     }
index f02fb2bb8b000ff6f0b5589e1f1f1e5bc3555fec..eb68cd4ff83dc198dd848be286592e35f2ef31d6 100644 (file)
@@ -1,9 +1,9 @@
-<?php // $Id$
+<?php
+
 /**
  * Local library file for Lesson.  These are non-standard functions that are used
  * only by Lesson.
  *
- * @version $Id$
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package lesson
  **/
@@ -239,7 +239,7 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '', $extraedit
 /// Build the buttons
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
     if (has_capability('mod/lesson:edit', $context)) {
-        $buttons = update_module_button($cm->id, $course->id, get_string('modulename', 'lesson'));
+        $buttons = $OUTPUT->update_module_button($cm->id, 'lesson');
         if ($extraeditbuttons) {
             if ($lessonpageid === NULL) {
                 print_error('invalidpageid', 'lesson');
@@ -266,7 +266,13 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '', $extraedit
     echo $OUTPUT->header();
 
     if (has_capability('mod/lesson:manage', $context)) {
-        print_heading_with_help($activityname, 'overview', 'lesson');
+
+        $helpicon = new moodle_help_icon();
+        $helpicon->text = $activityname;
+        $helpicon->page = "overview";
+        $helpicon->module = "lesson";
+
+        echo $OUTPUT->heading_with_help($helpicon);
 
         if (!empty($currenttab)) {
             include($CFG->dirroot.'/mod/lesson/tabs.php');
index af39fdffdd70d86b201bafda572226b83ff148fe..2cae8242a6c25f588ab75914b8e344b1ec11b6ed 100644 (file)
@@ -1,4 +1,5 @@
-<?php  // $Id$
+<?php
+
 /**
  * This file plays the mediafile set in lesson settings.
  *
@@ -7,7 +8,6 @@
  *  If there is a way to use the resource class instead of this code, please change to do so
  *
  *
- * @version $Id$
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package lesson
  **/
 
     $id = required_param('id', PARAM_INT);    // Course Module ID
     $printclose = optional_param('printclose', 0, PARAM_INT);
-    
+
+    $url = new moodle_url($CFG->wwwroot.'/mod/lesson/mediafile.php', array('id'=>$id));
+    if ($printclose !== '') {
+        $url->param('printclose', $printclose);
+    }
+    $PAGE->set_url($url);
+
     if (! $cm = get_coursemodule_from_id('lesson', $id)) {
         print_error('invalidcoursemodule');
     }