Beispiel #1
0
<?php

//
require_once "../../config.php";
require_once "lib.php";
require_variable($id);
// course
if (!($course = get_record("course", "id", $id))) {
    error("Course ID is incorrect");
}
require_login($course->id);
add_to_log($course->id, "feedback", "view all", "index.php?id={$course->id}", "");
/// Get all required strings
$strfeedbacks = get_string("modulenameplural", "feedback");
$strfeedback = get_string("modulename", "feedback");
/// Print the header
if ($course->category) {
    $navigation = "<a href=\"../../course/view.php?id={$course->id}\">{$course->shortname}</a> ->";
}
print_header("{$course->shortname}: {$strfeedbacks}", "{$course->fullname}", "{$navigation} {$strfeedbacks}", "", "", true, "", navmenu($course));
/// Get all the appropriate data
if (!($feedbacks = get_all_instances_in_course("feedback", $course))) {
    notice("There are no feedbacks", "../../course/view.php?id={$course->id}");
    die;
}
/// Print the list of instances (your module will probably extend this)
$timenow = time();
$strname = get_string("name");
$strweek = get_string("week");
$strtopic = get_string("topic");
if ($course->format == "weeks") {
     if ($form->section) {
         $heading->what = $fullmodulename;
         $heading->in = "{$sectionname} {$cw->section}";
         $pageheading = get_string("duplicatingain", "moodle", $heading);
     } else {
         $pageheading = get_string("duplicatinga", "moodle", $fullmodulename);
     }
     $strnav = "<a href=\"{$CFG->wwwroot}/mod/{$module->name}/view.php?id={$cm->id}\">{$form->name}</a> ->";
 } else {
     if (isset($_GET['add']) and confirm_sesskey()) {
         if (empty($_GET['add'])) {
             redirect($_SERVER["HTTP_REFERER"]);
             die;
         }
         require_variable($id);
         require_variable($section);
         echo 'ccc';
         if (!($course = get_record("course", "id", $id))) {
             error("This course doesn't exist!!");
         }
         if (!($module = get_record("modules", "name", $_GET['add']))) {
             error("This module type doesn't exist");
         }
         $form->section = $section;
         // The section number itself
         $form->course = $course->id;
         $form->module = $module->id;
         $form->modulename = $module->name;
         $form->instance = "";
         $form->coursemodule = "";
         $form->mode = "add";
Beispiel #3
0
}
if (!($dialogue = get_record("dialogue", "id", $cm->instance))) {
    error("Course module dialogue is incorrect");
}
require_login($course->id);
// set up some general variables
$usehtmleditor = can_use_html_editor();
$navigation = "";
if ($course->category) {
    $navigation = "<A HREF=\"../../course/view.php?id={$course->id}\">{$course->shortname}</A> ->";
}
$strdialogues = get_string("modulenameplural", "dialogue");
$strdialogue = get_string("modulename", "dialogue");
// ... print the header and...
print_header("{$course->shortname}: {$dialogue->name}", "{$course->fullname}", "{$navigation} <A HREF=index.php?id={$course->id}>{$strdialogues}</A> -> \n                  <A HREF=\"view.php?id={$cm->id}\">{$dialogue->name}</A>", "", "", true);
require_variable($action);
// need something to do!
/************** close conversation ************************************/
if ($action == 'closeconversation') {
    if (empty($_GET['cid'])) {
        error("Close dialogue: Missing conversation id");
    } else {
        $conversationid = $_GET['cid'];
    }
    if (!set_field("dialogue_conversations", "closed", 1, "id", $conversationid)) {
        error("Close dialogue: unable to set closed");
    }
    if (!set_field("dialogue_conversations", "lastid", $USER->id, "id", $conversationid)) {
        error("Close dialogue: unable to set lastid");
    }
    $pane = $_GET['pane'];