$title = str_replace($search, $replace, $title);
}
- $buttons = '<table><tr><td>'.update_module_button($this->modulerecord->id, $this->course->id, get_string('modulename', $this->activityname)).'</td>';
+ $buttons = '<table><tr><td>'.$OUTPUT->update_module_button($this->modulerecord->id, $this->activityname).'</td>';
if ($this->user_allowed_editing() && !empty($CFG->showblocksonmodpages)) {
$buttons .= '<td><form '.$CFG->frametarget.' method="get" action="view.php"><div>'.
'<input type="hidden" name="id" value="'.$this->modulerecord->id.'" />'.
foreach ($params as $key=>$value) {
if (is_int($key)) {
- throw new coding_error('Url parameters can not have numeric keys!');
+ throw new coding_exception('Url parameters can not have numeric keys!');
}
if (is_array($value)) {
- throw new coding_error('Url parameters values can not be arrays!');
+ throw new coding_exception('Url parameters values can not be arrays!');
}
if (is_object($value) and !method_exists($value, '__toString')) {
- throw new coding_error('Url parameters values can not be objects, unless __toString() is defined!');
+ throw new coding_exception('Url parameters values can not be objects, unless __toString() is defined!');
}
$this->params[$key] = (string)$value;
}
}
$PAGE->navbar->add($chooseqtype);
$PAGE->set_title($chooseqtype);
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, $cm->modname));
echo $OUTPUT->header();
} else {
$PAGE->navbar->add(get_string('questionbank', 'question'),$returnurl);
$param->moveto = optional_param('moveto', 0, PARAM_INT);
$param->edit = optional_param('edit', 0, PARAM_INT);
- $url = new moodle_url($thispageurl);
+ $url = new moodle_url($CFG->wwwroot.$thispageurl);
foreach ((array)$param as $key=>$value) {
if (($key !== 'cancel' && $value !== 0) || ($key === 'cancel' && $value !== '')) {
$url->param($key, $value);
$thispageurl->remove_params('cat', 'category');
redirect($thispageurl);
}
- if ($cm!==null) {
- // Page header
- $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
- ? $OUTPUT->update_module_button($cm->id, $cm->modname)
- : "";
- $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
- $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
- } else {
- // Print basic page layout.
- $strupdatemodule = '';
- }
if (!$param->edit){
$PAGE->navbar->add($streditingcategories);
}
$PAGE->set_title($streditingcategories);
- $PAGE->set_button($strupdatemodule);
echo $OUTPUT->header();
// print tabs
}
$streditingcategories = get_string('editcategories', 'quiz');
- if ($cm!==null) {
- // Page header
- $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
- ? $OUTPUT->update_module_button($cm->id, $cm->modname)
- : "";
- $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
- $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
- } else {
- // Print basic page layout.
- $strupdatemodule = '';
- }
$PAGE->set_url($thispageurl->out());
$PAGE->navbar->add($streditingcategories, $thispageurl->out());
$PAGE->navbar->add(get_string('movingcategory', 'question'));
$PAGE->set_title($streditingcategories);
- $PAGE->set_button($strupdatemodule);
echo $OUTPUT->header();
// print tabs
}
$streditingcategories = get_string('editcategories', 'quiz');
-if ($cmid) {
- // Page header
- $context = get_context_instance(CONTEXT_MODULE, $cm->id);
- $strupdatemodule = has_capability('moodle/course:manageactivities', $context)
- ? $OUTPUT->update_module_button($cm->id, $cm->modname)
- : "";
- $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
- $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
-} else {
- // Print basic page layout.
- $strupdatemodule = '';
-}
$strmovingquestions = get_string('movingquestions', 'question');
$PAGE->set_url($thispageurl->out());
$PAGE->navbar->add($strmovingquestions);
$PAGE->set_title($strmovingquestions);
-$PAGE->set_button($strupdatemodule);
echo $OUTPUT->header();
// print tabs
$context = $contexts->lowest();
$streditingquestions = get_string('editquestions', "quiz");
if ($cm!==null) {
- $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
- ? $OUTPUT->update_module_button($cm->id, $cm->modname)
- : "";
- $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
- $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
$PAGE->navbar->add($streditingquestions);
$PAGE->set_title($streditingquestions);
- $PAGE->set_button($strupdatemodule);
echo $OUTPUT->header();
$currenttab = 'edit';
$PAGE->set_url($thispageurl->out());
$PAGE->set_title($strexportquestions);
if ($cm!==null) {
- $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
- ? $OUTPUT->update_module_button($cm->id, $cm->modname)
- : "";
- $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
- $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
$PAGE->navbar->add($strexportquestions);
- $PAGE->set_button($strupdatemodule);
echo $OUTPUT->header();
$currenttab = 'edit';
$mode = 'export';
//==========
if ($cm!==null) {
- $strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $COURSE->id))
- ? $OUTPUT->update_module_button($cm->id, $cm->modname)
- : "";
- $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
- $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
$PAGE->navbar->add($txt->importquestions);
$PAGE->set_title($txt->importquestions);
- $PAGE->set_button($strupdatemodule);
echo $OUTPUT->header();
$currenttab = 'edit';
$PAGE->set_title($streditingquestion);
if ($cm !== null) {
$strmodule = get_string('modulename', $cm->modname);
- $strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $COURSE->id))
- ? $OUTPUT->update_module_button($cm->id, $strmodule)
- : "";
-
$streditingmodule = get_string('editinga', 'moodle', $strmodule);
-
$PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$cm->course)));
$PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
if (stripos($returnurl, "$CFG->wwwroot/mod/{$cm->modname}/view.php")!== 0){
$PAGE->navbar->add($streditingmodule, $returnurl);
}
$PAGE->navbar->add($streditingquestion);
- $PAGE->set_button($strupdatemodule);
echo $OUTPUT->header();
} else {