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

View of /trunk/wwmoodle/wwassignment/view.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5183 - (download) (as text) (annotate)
Wed Jul 18 17:58:06 2007 UTC (12 years, 7 months ago) by mleventi
File size: 2616 byte(s)
Changes to allow the new wwlink block to establish course link
Added README

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

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9