[system] / trunk / wwmoodle / Moodle / wwmoodleset / view.php Repository:
ViewVC logotype

View of /trunk/wwmoodle/Moodle/wwmoodleset/view.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4171 - (download) (as text) (annotate)
Mon Jun 26 23:31:52 2006 UTC (13 years, 8 months ago) by dpvc
File size: 2526 byte(s)
Updates to use moodle theme to simplify the WW GUI when used in
moodle, and to resize the IFRAME to fit the size of its contents.

    1 <?php
    2 // $Id: view.php,v 1.3 2006-06-26 23:31:52 dpvc Exp $
    3 
    4 /// This page prints a particular instance of wwmoodleset
    5 /// (Replace wwmoodleset with the name of your module)
    6 
    7 require_once("../../config.php");
    8 require_once("lib.php");
    9 
   10     $id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
   11     $a  = optional_param('a', 0, PARAM_INT);  // NEWMODULE ID
   12 
   13 if ($id) {
   14   if (! $cm = get_record("course_modules", "id", $id)) {
   15     error("Course Module ID was incorrect");
   16   }
   17 
   18   if (! $course = get_record("course", "id", $cm->course)) {
   19     error("Course is misconfigured");
   20   }
   21 
   22   if (! $wwmoodleset = get_record("wwmoodleset", "id", $cm->instance)) {
   23     error("Course module is incorrect");
   24   }
   25 } else {
   26   if (! $wwmoodleset = get_record("wwmoodleset", "id", $a)) {
   27     error("Course module is incorrect");
   28   }
   29   if (! $course = get_record("course", "id", $wwmoodleset->course)) {
   30     error("Course is misconfigured");
   31   }
   32   if (! $cm = get_coursemodule_from_instance("wwmoodleset", $wwmoodleset->id, $course->id)) {
   33     error("Course Module ID was incorrect");
   34   }
   35 }
   36 
   37 require_login($course->id);
   38 
   39 add_to_log($course->id, "wwmoodleset", "view", "view.php?id=$cm->id", "$wwmoodleset->id");
   40 
   41 /// Print the page header
   42 
   43 if ($course->category) {
   44   $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
   45 }
   46 
   47 $strwwmoodlesets = get_string("modulenameplural", "wwmoodleset");
   48 $strwwmoodleset  = get_string("modulename", "wwmoodleset");
   49 
   50 print_header("$course->shortname: $wwmoodleset->name", "$course->fullname", "$navigation <a href='index.php?id=$course->id'>$strwwmoodlesets</a> -> $wwmoodleset->name", "", "", true, update_module_button($cm->id, $course->id, $strwwmoodleset), navmenu($course, $cm));
   51 
   52 /// Print the main part of the page
   53 
   54 $sSetLink = wwmoodleset_linkToSet($wwmoodleset->set_id, wwmoodleset_courseIdToShortName($wwmoodleset->course));
   55 print("<p style='font-size: smaller; color: #aaa;'>" . get_string("iframeNoShow-1", "wwmoodleset")
   56       . "<a href='$sSetLink'>" . get_string("iframeNoShow-2", "wwmoodleset") . "</a>.</p>\n");
   57 print("<p align='center'><iframe id='wwPage' src='$sSetLink' frameborder='1' "
   58       . "width='".$CFG->wwmoodleset_iframe_width."' "
   59       . "height='".$CFG->wwmoodleset_iframe_height."'>"
   60       . get_string("iframeNoShow-1", "wwmoodleset") . "<a href='$sSetLink'>" . get_string("iframeNoShow-2", "wwmoodleset")
   61       . "</a>.</iframe></p>\n");
   62 
   63 print("<script>ww.Init(".isteacher($course->id).")</script>");
   64 
   65 
   66 /// Finish the page
   67 print_footer($course);
   68 
   69 ?>

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9