Ejemplo n.º 1
0
$strdialogues = get_string("modulenameplural", "dialogue");
$navlinks = array(array('name' => $strdialogues, 'link' => "index.php?id={$course->id}", 'type' => 'activity'), array('name' => format_string($dialogue->name), 'link' => '', 'type' => 'activityinstance'));
$navigation = build_navigation($navlinks);
print_header_simple(format_string($dialogue->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strdialogue), navmenu($course, $cm));
if (!$hascapparticipate) {
    // no access
    notify(get_string("notavailable", "dialogue"));
    print_footer($course);
    die;
}
groups_print_activity_menu($cm, "view.php?id={$cm->id}&pane={$pane}");
echo '<br />';
print_simple_box(format_text($dialogue->intro), 'center', '70%', '', 5, 'generalbox', 'intro');
echo "<br />";
// get some stats
$countopen = dialogue_count_open($dialogue, $USER, $hascapviewall, $currentgroup);
$countclosed = dialogue_count_closed($dialogue, $USER, $hascapviewall, $currentgroup);
// set up tab table
$names[0] = get_string("pane0", "dialogue");
if ($countopen == 1) {
    $names[1] = get_string("pane1one", "dialogue");
} else {
    $names[1] = get_string("pane1", "dialogue", $countopen);
}
if ($countclosed == 1) {
    $names[3] = get_string("pane3one", "dialogue");
} else {
    $names[3] = get_string("pane3", "dialogue", $countclosed);
}
$tabs = array();
if ($hascapopen) {
Ejemplo n.º 2
0
add_to_log($course->id, 'dialogue', 'view all', "index.php?id={$course->id}", '');
$strdialogue = get_string('modulename', 'dialogue');
$strdialogues = get_string('modulenameplural', 'dialogue');
$strname = get_string('name');
$stropendialogues = get_string('opendialogues', 'dialogue');
$strcloseddialogues = get_string('closeddialogues', 'dialogue');
$navlinks = array(array('name' => $strdialogues, 'link' => '', 'type' => 'activity'));
$navigation = build_navigation($navlinks);
print_header_simple($strdialogues, '', $navigation, '', '', true, '', navmenu($course));
if (!($dialogues = get_all_instances_in_course('dialogue', $course))) {
    notice('There are no dialogues', "../../course/view.php?id={$course->id}");
    die;
}
$timenow = time();
$table->head = array($strname, $stropendialogues, $strcloseddialogues);
$table->align = array('center', 'center', 'center');
foreach ($dialogues as $dialogue) {
    $hascapviewall = has_capability('mod/dialogue:viewall', get_context_instance(CONTEXT_COURSE, $course->id));
    $dimmedclass = '';
    if (!$dialogue->visible) {
        // Show dimmed if the mod is hidden
        $dimmedclass = 'class="dimmed"';
    }
    $table->data[] = array("<a {$dimmedclass} href=\"view.php?id={$dialogue->coursemodule}\">" . format_string($dialogue->name) . "</a>", dialogue_count_open($dialogue, $USER), dialogue_count_closed($dialogue, $USER, $hascapviewall));
}
echo '<br />';
print_table($table);
print_footer($course);
?>

}
require_login($course->id);
add_to_log($course->id, "dialogue", "view all", "index.php?id={$course->id}", "");
$strdialogue = get_string("modulename", "dialogue");
$strdialogues = get_string("modulenameplural", "dialogue");
$strname = get_string("name");
$stropendialogues = get_string("opendialogues", "dialogue");
$strcloseddialogues = get_string("closeddialogues", "dialogue");
$navlinks = array(array('name' => $strdialogues, 'link' => '', 'type' => 'activity'));
$navigation = build_navigation($navlinks);
print_header_simple("{$strdialogues}", "", $navigation, "", "", true, "", navmenu($course));
if (!($dialogues = get_all_instances_in_course("dialogue", $course))) {
    notice("There are no dialogues", "../../course/view.php?id={$course->id}");
    die;
}
$hascapviewall = has_capability('mod/dialogue:viewall', get_context_instance(CONTEXT_COURSE, $course->id));
$timenow = time();
$table->head = array($strname, $stropendialogues, $strcloseddialogues);
$table->align = array("center", "center", "center");
foreach ($dialogues as $dialogue) {
    if (!($cm = get_coursemodule_from_instance("dialogue", $dialogue->id, $course->id))) {
        error("Course Module ID was incorrect");
    }
    $table->data[] = array("<a href=\"view.php?id={$cm->id}\">{$dialogue->name}</a>", dialogue_count_open($dialogue, $USER), dialogue_count_closed($dialogue, $USER, $hascapviewall));
}
echo "<br />";
print_table($table);
print_footer($course);
?>