Skip to content

Commit

Permalink
MDL-13050 Reverting, it's not working out as well as planned
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Jan 21, 2008
1 parent 9455d7c commit 0fbc557
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 162 deletions.
21 changes: 1 addition & 20 deletions mod/assignment/lib.php
Expand Up @@ -1020,26 +1020,7 @@ function display_submissions($message='') {

add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id='.$this->assignment->id, $this->assignment->id, $this->cm->id);

$navlinks = array();
$navlinks[] = array(
'name' => get_string('grades'),
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
'type' => 'link');
$navlinks[] = array(
'name' => get_string('modulenameplural', $cm->modname),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
'type' => 'activity');
$navlinks[] = array(
'name' => format_string($cm->name),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
'type' => 'activityinstance');
$navlinks[] = array(
'name' => $this->strsubmissions,
'link' => '',
'type' => 'link');

$navigation = build_navigation($navlinks);

$navigation = build_navigation($this->strsubmissions, $this->cm);
print_header_simple(format_string($this->assignment->name,true), "", $navigation,
'', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));

Expand Down
20 changes: 1 addition & 19 deletions mod/exercise/submissions.php
Expand Up @@ -50,25 +50,7 @@
$strsubmissions = get_string("submissions", "exercise");

// ... print the header and...
$navlinks = array();
$navlinks[] = array(
'name' => get_string('grades'),
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
'type' => 'link');
$navlinks[] = array(
'name' => get_string('modulenameplural', $cm->modname),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
'type' => 'activity');
$navlinks[] = array(
'name' => format_string($cm->name),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
'type' => 'activityinstance');
$navlinks[] = array(
'name' => $strsubmissions,
'link' => '',
'type' => 'title');

$navigation = build_navigation($navlinks);
$navigation = build_navigation($strsubmissions, $cm);
print_header_simple(format_string($exercise->name), "", $navigation,
"", "", true);

Expand Down
16 changes: 1 addition & 15 deletions mod/forum/view.php
Expand Up @@ -64,21 +64,7 @@


/// Print header.
$navlinks = array();
$navlinks[] = array(
'name' => get_string('grades'),
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
'type' => 'link');
$navlinks[] = array(
'name' => get_string('modulenameplural', $cm->modname),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
'type' => 'activity');
$navlinks[] = array(
'name' => format_string($cm->name),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
'type' => 'activityinstance');

$navigation = build_navigation($navlinks);
$navigation = build_navigation('', $cm);
print_header_simple(format_string($forum->name), "",
$navigation, "", "", true, $buttontext, navmenu($course, $cm));

Expand Down
23 changes: 2 additions & 21 deletions mod/glossary/view.php
Expand Up @@ -225,35 +225,16 @@
$strwaitingapproval = get_string('waitingapproval', 'glossary');

/// If we are in approval mode, prit special header
$navlinks = array();
$navlinks[] = array(
'name' => get_string('grades'),
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
'type' => 'link');
$navlinks[] = array(
'name' => get_string('modulenameplural', $cm->modname),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
'type' => 'activity');
$navlinks[] = array(
'name' => format_string($cm->name),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
'type' => 'activityinstance');

if ($tab == GLOSSARY_APPROVAL_VIEW) {
require_capability('mod/glossary:approve', $context);

$navlinks[] = array(
'name' => $strwaitingapproval,
'link' => '',
'type' => 'title');

$navigation = build_navigation($navlinks);
$navigation = build_navigation($strwaitingapproval, $cm);
print_header_simple(format_string($glossary->name), "", $navigation, "", "", true,
update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));

print_heading($strwaitingapproval);
} else { /// Print standard header
$navigation = build_navigation($navlinks);
$navigation = build_navigation('', $cm);
print_header_simple(format_string($glossary->name), "", $navigation, "", "", true,
update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
}
Expand Down
29 changes: 2 additions & 27 deletions mod/hotpot/report.php
Expand Up @@ -408,49 +408,24 @@ function hotpot_delete_selected_attempts(&$hotpot, $del) {
/// report selector menus

function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
global $CFG;
$strmodulenameplural = get_string("modulenameplural", "hotpot");
$strmodulename = get_string("modulename", "hotpot");

$title = format_string($course->shortname) . ": $hotpot->name";
$heading = $course->fullname;

$modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id);

$navlinks = array();
$navlinks[] = array(
'name' => get_string('grades'),
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
'type' => 'link');
$navlinks[] = array(
'name' => get_string('modulenameplural', $cm->modname),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
'type' => 'activity');
$navlinks[] = array(
'name' => format_string($cm->name),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
'type' => 'activityinstance');


if (has_capability('mod/hotpot:viewreport',$modulecontext)) {
if ($mode=='overview' || $mode=='simplestat' || $mode=='fullstat') {
$module = "quiz";
} else {
$module = "hotpot";
}

$navlinks[] = array(
'name' => get_string("report$mode", $module),
'link' => '',
'type' => 'title');
$navigation = build_navigation(get_string("report$mode", $module), $cm);
} else {
$navlinks[] = array(
'name' => get_string("report", "quiz"),
'link' => '',
'type' => 'title');
$navigation = build_navigation(get_string("report", "quiz"), $cm);
}

$navigation = build_navigation($navlinks);

$button = update_module_button($cm->id, $course->id, $strmodulename);
print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
Expand Down
20 changes: 1 addition & 19 deletions mod/lesson/locallib.php
Expand Up @@ -238,25 +238,7 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '') {
}

/// Header setup
if (in_array($currenttab, array('reportoverview', 'reportdetail'))) {
$navlinks = array();
$navlinks[] = array(
'name' => get_string('grades'),
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
'type' => 'link');
$navlinks[] = array(
'name' => get_string('modulenameplural', $cm->modname),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
'type' => 'activity');
$navlinks[] = array(
'name' => format_string($cm->name),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
'type' => 'activityinstance');

$navigation = build_navigation($navlinks);
} else {
$navigation = build_navigation('', $cm);
}
$navigation = build_navigation('', $cm);

/// Print header, heading, tabs and messages
print_header("$course->shortname: $strname", $course->fullname, $navigation,
Expand Down
16 changes: 1 addition & 15 deletions mod/quiz/report/default.php
Expand Up @@ -27,21 +27,7 @@ function print_header_and_tabs($cm, $course, $quiz, $reportmode="overview", $met
$strquizzes = get_string("modulenameplural", "quiz");
$strquiz = get_string("modulename", "quiz");
/// Print the page header
$navlinks = array();
$navlinks[] = array(
'name' => get_string('grades'),
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
'type' => 'link');
$navlinks[] = array(
'name' => get_string('modulenameplural', $cm->modname),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
'type' => 'activity');
$navlinks[] = array(
'name' => format_string($cm->name),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
'type' => 'activityinstance');

$navigation = build_navigation($navlinks);
$navigation = build_navigation('', $cm);

print_header_simple(format_string($quiz->name), "", $navigation,
'', $meta, true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
Expand Down
27 changes: 1 addition & 26 deletions mod/workshop/view.php
Expand Up @@ -68,32 +68,7 @@
}

// ...display header...

if ($action == 'teachersview') {
$navlinks = array();
$navlinks[] = array(
'name' => get_string('grades'),
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
'type' => 'link');
$navlinks[] = array(
'name' => get_string('modulenameplural', $cm->modname),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
'type' => 'activity');
$navlinks[] = array(
'name' => format_string($cm->name),
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
'type' => 'activityinstance');
$navlinks[] = array(
'name' => $action,
'link' => '',
'type' => 'title');


$navigation = build_navigation($navlinks);
} else {
$navigation = build_navigation($action, $cm);
}

$navigation = build_navigation($action, $cm);
print_header_simple(format_string($workshop->name), "", $navigation,
"", "", true, update_module_button($cm->id, $course->id, $strworkshop), navmenu($course, $cm));

Expand Down

0 comments on commit 0fbc557

Please sign in to comment.