// the id of the module
$hash = optional_param('hash', "", PARAM_TEXT);
// file or dir hash
$requestid = optional_param('requestid', "", PARAM_TEXT);
// file or dir hash
$paramone = optional_param('paramone', "", PARAM_TEXT);
// nature of value depends on datatype, maybe path
$paramtwo = optional_param('paramtwo', "", PARAM_TEXT);
// nature of value depends on datatype, maybe protocol
$paramthree = optional_param('paramthree', "", PARAM_TEXT);
// nature of value depends on datatype, maybe filearea
switch ($datatype) {
    case "xmlpairs":
        header("Content-type: text/xml");
        echo "<?xml version=\"1.0\"?>\n";
        $returnxml = fetch_xmlpairs($courseid);
        break;
    case "unassignedusers":
        header("Content-type: text/xml");
        echo "<?xml version=\"1.0\"?>\n";
        $returnxml = fetch_unassigned_users(5, $courseid, null);
        break;
    case "offlineusers":
        header("Content-type: text/xml");
        echo "<?xml version=\"1.0\"?>\n";
        $returnxml = "";
        break;
    case "courseusers":
        header("Content-type: text/xml");
        echo "<?xml version=\"1.0\"?>\n";
        $returnxml = fetch_course_users($courseid);
Example #2
0
    if (!($course = get_record("course", "id", $pairwork->course))) {
        error("Course is misconfigured");
    }
    if (!($cm = get_coursemodule_from_instance("poodllpairwork", $pairwork->id, $course->id))) {
        error("Course Module ID was incorrect");
    }
}
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_login($course->id);
add_to_log($course->id, "poodllpairwork", "view", "view.php?id={$cm->id}", "{$pairwork->id}");
//If this is request for XML data,
//do that first and don't return html
if ($view == "xmldata") {
    header("Content-type: text/xml");
    echo "<?xml version=\"1.0\"?>\n";
    echo fetch_xmlpairs($course->id);
    return;
}
/// Print the page header
$strpairworks = get_string("modulenameplural", "poodllpairwork");
$strpairwork = get_string("modulename", "poodllpairwork");
$navlinks = array();
$navlinks[] = array('name' => $strpairworks, 'link' => "index.php?id={$course->id}", 'type' => 'activity');
$navlinks[] = array('name' => format_string($pairwork->name), 'link' => '', 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header_simple(format_string($pairwork->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strpairwork), navmenu($course, $cm));
//Setup and Print the tab header
/// Determine the current tab
switch ($view) {
    case 'play':
        $currenttab = 'play';