$string['contentheader'] = 'Content';
$string['foldercontent'] = 'Files and subfolders';
+$string['folderadministration'] = 'Folder administration';
$string['modulename'] = 'Folder';
$string['modulenameplural'] = 'Folders';
$string['neverseen'] = 'Never seen';
$string['deploymenterror'] = 'Content package error!';
$string['keepold'] = 'Archive packages';
$string['keepoldexplain'] = 'How many packages should be archived?';
+$string['imscpadministration'] = 'IMSCP Administration';
$string['modulename'] = 'IMS Content Package';
$string['modulenameplural'] = 'IMS Content packages';
$string['navigation'] = 'Navigation';
$string['legacyfilesdone'] = 'Finished';
$string['modulename'] = 'Page';
$string['modulenameplural'] = 'Pages';
+$string['pageadministration'] = 'Page administration';
$string['popupheight'] = 'Popup height (in pixels)';
$string['popupheightexplain'] = 'Specifies default height of popup windows.';
$string['popupwidth'] = 'Popup width (in pixels)';
$string['printintro'] = 'Display URL description';
$string['printintroexplain'] = 'Display URL description bellow content? Some display types may not display description even if enabled.';
$string['rolesinparams'] = 'Include role names in parameters';
+$string['urladministration'] = 'URL administration';
$PAGE->set_title($this->pagetitle);
$PAGE->set_heading($this->course->fullname);
- $PAGE->set_button($OUTPUT->update_module_button($this->cm->id, 'assignment'));
echo $OUTPUT->header();
add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id='.$this->cm->id, $this->assignment->id, $this->cm->id);
$PAGE->navbar->add($this->strsubmissions);
$PAGE->set_title(format_string($this->assignment->name,true));
- $PAGE->set_button( update_module_button($cm->id, $course->id, $this->strassignment));
echo $OUTPUT->header();
$course_context = get_context_instance(CONTEXT_COURSE, $course->id);
$title = $course->shortname . ': ' . format_string($chat->name);
- $buttons = '<table><tr><td>'.$OUTPUT->update_module_button($cm->id, $cm->modname).'</td>';
if ($PAGE->user_allowed_editing() && !empty($CFG->showblocksonmodpages)) {
- $buttons .= '<td><form '.$CFG->frametarget.' method="get" action="view.php"><div>'.
+ $buttons = '<table><tr><td><form '.$CFG->frametarget.' method="get" action="view.php"><div>'.
'<input type="hidden" name="id" value="'.$cm->id.'" />'.
'<input type="hidden" name="edit" value="'.($PAGE->user_is_editing()?'off':'on').'" />'.
- '<input type="submit" value="'.get_string($PAGE->user_is_editing()?'blockseditoff':'blocksediton').'" /></div></form></td>';
+ '<input type="submit" value="'.get_string($PAGE->user_is_editing()?'blockseditoff':'blocksediton').'" /></div></form></td></tr></table>';
+ $PAGE->set_button($buttons);
}
- $buttons .= '</tr></table>';
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
- $PAGE->set_button($buttons);
echo $OUTPUT->header();
/// Check to see if groups are being used here
if (!$download) {
$PAGE->navbar->add($strresponses);
$PAGE->set_title(format_string($choice->name).": $strresponses");
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'choice'));
echo $OUTPUT->header();
/// Check to see if groups are being used in this choice
$groupmode = groups_get_activity_groupmode($cm);
}
$PAGE->set_title(format_string($choice->name));
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'choice'));
echo $OUTPUT->header();
/// Submit any new data if there is any
}
$PAGE->set_title($data->name);
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'data'));
echo $OUTPUT->header();
/// Check to see if groups are being used here
} elseif (!$formdata = (array) $mform->get_data()) {
// build header to match the rest of the UI
$PAGE->set_title($data->name);
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'data'));
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($data->name));
global $CFG, $displaynoticegood, $displaynoticebad, $OUTPUT, $PAGE;
$PAGE->set_title($data->name);
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'data'));
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($data->name));
$PAGE->navbar->add(get_string($mode,'data'));
$PAGE->requires->js('mod/data/data.js');
$PAGE->set_title($data->name);
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'data'));
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($data->name));
// The code will be much nicer than this eventually.
$title = $course->shortname.': ' . format_string($data->name);
- $buttons = '<table><tr><td>'.$OUTPUT->update_module_button($cm->id, $cm->modname).'</td>';
if ($PAGE->user_allowed_editing() && !empty($CFG->showblocksonmodpages)) {
- $buttons .= '<td><form '.$CFG->frametarget.' method="get" action="view.php"><div>'.
+ $buttons = '<table><tr><td><form '.$CFG->frametarget.' method="get" action="view.php"><div>'.
'<input type="hidden" name="id" value="'.$cm->id.'" />'.
'<input type="hidden" name="edit" value="'.($PAGE->user_is_editing()?'off':'on').'" />'.
- '<input type="submit" value="'.get_string($PAGE->user_is_editing()?'blockseditoff':'blocksediton').'" /></div></form></td>';
+ '<input type="submit" value="'.get_string($PAGE->user_is_editing()?'blockseditoff':'blocksediton').'" /></div></form></td></tr></table>';
+ $PAGE->set_button($buttons);
}
- $buttons .= '</tr></table>';
if ($mode == 'asearch') {
$PAGE->navbar->add(get_string('search'));
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
- $PAGE->set_button($buttons);
+
echo $OUTPUT->header();
/// Check to see if groups are being used here
$PAGE->navbar->add(get_string('analysis','feedback'));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// print the tabs
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// print the tabs
$PAGE->navbar->add(get_string('feedback:complete', 'feedback'));
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/feedback/complete.php', array('id'=>$cm->id, 'gopage'=>$gopage, 'courseid'=>$course->id)));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
//ishidden check.
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
//ishidden check. hidden feedbacks except feedbacks on mainsite are only accessible with related capabilities
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// Print the main part of the page
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// Print the main part of the page
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// print the tabs
}
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/feedback/edit.php', array('id'=>$cm->id, 'do_show'=>$do_show)));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// print the tabs
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// print the tabs
include('tabs.php');
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// Print the main part of the page
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
include('tabs.php');
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// Print the main part of the page
$PAGE->navbar->add(get_string('show_entries','feedback'));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
include('tabs.php');
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// Print the main part of the page
$PAGE->navbar->add(format_string($feedback->name));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
/// Print the main part of the page
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/feedback/view.php', array('id'=>$cm->id, 'do_show'=>'view')));
$PAGE->set_title(format_string($feedback->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'feedback'));
echo $OUTPUT->header();
//ishidden check.
// finally send the file
send_stored_file($file, 86400, 0, $forcedownload);
}
+
+/**
+ * This function extends the global navigaiton for the site.
+ * It is important to note that you should not rely on PAGE objects within this
+ * body of code as there is no guarantee that during an AJAX request they are
+ * available
+ *
+ * @param navigation_node $navigation The folder node within the global navigation
+ * @param stdClass $course The course object returned from the DB
+ * @param stdClass $module The module object returned from the DB
+ * @param stdClass $cm The course module isntance returned from the DB
+ */
+function folder_extend_navigation($navigation, $course, $module, $cm) {
+ /**
+ * This is currently just a stub so that it can be easily expanded upon.
+ * When expanding just remove this comment and the line below and then add
+ * you content.
+ */
+ $navigation->nodetype = navigation_node::NODETYPE_LEAF;
+}
+
+/**
+ * This function extends the settings navigation block for the site.
+ *
+ * It is safe to rely on PAGE here as we will only ever be within the module
+ * context when this is called.
+ *
+ * @param settings_navigation $settings
+ * @param stdClass $module
+ */
+function folder_extend_settings_navigation($settings, $module) {
+ global $PAGE, $CFG, $DB;
+
+ // Load the folder instance from the database
+ $folder = $DB->get_record('folder', array('id'=>$PAGE->cm->instance));
+ // Add a folder node to the settings navigation.
+ $foldernavkey = $settings->add(get_string('folderadministration', 'folder'));
+ $foldernav = $settings->get($foldernavkey);
+ $foldernav->forceopen = true;
+
+ // If the user has the capability add an update this module link for the folder instance
+ if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {
+ $url = new moodle_url($CFG->wwwroot.'/course/mod.php', array('update'=>$PAGE->cm->id, 'return'=>true, 'sesskey'=>sesskey()));
+ $foldernav->add(get_string('updatethis', '', get_string('modulename', 'folder')), $url);
+ }
+
+ // Check if any children have been added. If not remove the node to save on clutter.
+ if (count($foldernav->children)<1) {
+ $settings->remove_child($foldernavkey);
+ }
+}
\ No newline at end of file
$PAGE->set_title($course->shortname.': '.$folder->name);
$PAGE->set_heading($course->fullname);
$PAGE->set_activity_record($folder);
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'folder'));
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($folder->name), 2);
} else { // the operation has not been confirmed yet so ask the user to do so
$PAGE->set_title(format_string($glossary->name));
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'glossary'));
echo $OUTPUT->header();
$areyousure = "<b>".format_string($entry->concept)."</b><p>$strareyousuredelete</p>";
$linkyes = 'deleteentry.php';
$PAGE->navbar->add(format_string($glossary->name), new moodle_url($CFG->wwwroot.'/mod/glossary/view.php', array('id'=>$cm->id,'tab'=>'GLOSSARY_CATEGORY_VIEW')));
$PAGE->navbar->add(get_string("categories","glossary"));
$PAGE->set_title(format_string($glossary->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'glossary'));
echo $OUTPUT->header();
if ( $hook >0 ) {
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/glossary/export.php', array('id'=>$cm->id)));
$PAGE->navbar->add($strexportentries);
$PAGE->set_title(format_string($glossary->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'glossary'));
echo $OUTPUT->header();
echo $OUTPUT->heading($strexportentries);
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/glossary/import.php', array('id'=>$cm->id, 'mode'=>$mode, 'hook'=>$hook)));
$PAGE->navbar->add($strimportentries);
$PAGE->set_title(format_string($glossary->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'glossary'));
echo $OUTPUT->header();
echo $OUTPUT->heading($strimportentries);
/// If we are in approval mode, prit special header
$PAGE->set_title(format_string($glossary->name));
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'glossary'));
$url = new moodle_url($CFG->wwwroot.'/mod/glossary/view.php', array('id'=>$cm->id));
if (isset($mode)) {
$url->param('mode', $mode);
return false;
}
}
+
+/**
+ * This function extends the global navigaiton for the site.
+ * It is important to note that you should not rely on PAGE objects within this
+ * body of code as there is no guarantee that during an AJAX request they are
+ * available
+ *
+ * @param navigation_node $navigation The imscp node within the global navigation
+ * @param stdClass $course The course object returned from the DB
+ * @param stdClass $module The module object returned from the DB
+ * @param stdClass $cm The course module isntance returned from the DB
+ */
+function imscp_extend_navigation($navigation, $course, $module, $cm) {
+ /**
+ * This is currently just a stub so that it can be easily expanded upon.
+ * When expanding just remove this comment and the line below and then add
+ * you content.
+ */
+ $navigation->nodetype = navigation_node::NODETYPE_LEAF;
+}
+
+/**
+ * This function extends the settings navigation block for the site.
+ *
+ * It is safe to rely on PAGE here as we will only ever be within the module
+ * context when this is called.
+ *
+ * @param settings_navigation $settings
+ * @param stdClass $module
+ */
+function imscp_extend_settings_navigation($settings, $module) {
+ global $PAGE, $CFG, $DB;
+
+ // Load the imscp instance from the database
+ $imscp = $DB->get_record('imscp', array('id'=>$PAGE->cm->instance));
+ // Add a imscp node to the settings navigation.
+ $imscpnavkey = $settings->add(get_string('imscpadministration', 'imscp'));
+ $imscpnav = $settings->get($imscpnavkey);
+ $imscpnav->forceopen = true;
+
+ // If the user has the capability add an update this module link for the imscp instance
+ if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {
+ $imscp = new moodle_imscp($CFG->wwwroot.'/course/mod.php', array('update'=>$PAGE->cm->id, 'return'=>true, 'sesskey'=>sesskey()));
+ $imscpnav->add(get_string('updatethis', '', get_string('modulename', 'imscp')), $imscp);
+ }
+
+ // Check if any children have been added. If not remove the node to save on clutter.
+ if (count($imscpnav->children)<1) {
+ $settings->remove_child($imscpnavkey);
+ }
+}
\ No newline at end of file
$PAGE->set_title($course->shortname.': '.$imscp->name);
$PAGE->set_heading($course->fullname);
$PAGE->set_activity_record($imscp);
-$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'imscp'));
echo $OUTPUT->header();
// verify imsmanifest was parsed properly
*/
function lesson_add_header_buttons($cm, $context, $extraeditbuttons=false, $lessonpageid=null) {
global $CFG, $PAGE, $OUTPUT;
- if (has_capability('mod/lesson:edit', $context)) {
- $buttons = $OUTPUT->update_module_button($cm->id, 'lesson');
- if ($extraeditbuttons) {
- if ($lessonpageid === null) {
- print_error('invalidpageid', 'lesson');
- }
- if (!empty($lessonpageid) && $lessonpageid != LESSON_EOL) {
- $options = array('id'=>$cm->id, 'redirect'=>'navigation', 'pageid'=>$lessonpageid);
- $buttonform = html_form::make_button($CFG->wwwroot.'/mod/lesson/lesson.php', $options, get_string('editpagecontent', 'lesson'));
- $buttons .= $OUTPUT->button($buttonform);
- }
- $buttons = $OUTPUT->box($buttons, 'edit_buttons');
+ if (has_capability('mod/lesson:edit', $context) && $extraeditbuttons) {
+ if ($lessonpageid === null) {
+ print_error('invalidpageid', 'lesson');
+ }
+ if (!empty($lessonpageid) && $lessonpageid != LESSON_EOL) {
+ $options = array('id'=>$cm->id, 'redirect'=>'navigation', 'pageid'=>$lessonpageid);
+ $buttonform = html_form::make_button($CFG->wwwroot.'/mod/lesson/lesson.php', $options, get_string('editpagecontent', 'lesson'));
+ $PAGE->set_button($OUTPUT->button($buttonform));
}
- $PAGE->set_button($buttons);
}
}
\ No newline at end of file
// finally send the file
send_stored_file($file, 86400, 0, $forcedownload);
}
+
+
+/**
+ * This function extends the global navigaiton for the site.
+ * It is important to note that you should not rely on PAGE objects within this
+ * body of code as there is no guarantee that during an AJAX request they are
+ * available
+ *
+ * @param navigation_node $navigation The page node within the global navigation
+ * @param stdClass $course The course object returned from the DB
+ * @param stdClass $module The module object returned from the DB
+ * @param stdClass $cm The course module isntance returned from the DB
+ */
+function page_extend_navigation($navigation, $course, $module, $cm) {
+ /**
+ * This is currently just a stub so that it can be easily expanded upon.
+ * When expanding just remove this comment and the line below and then add
+ * you content.
+ */
+ $navigation->nodetype = navigation_node::NODETYPE_LEAF;
+}
+
+/**
+ * This function extends the settings navigation block for the site.
+ *
+ * It is safe to rely on PAGE here as we will only ever be within the module
+ * context when this is called.
+ *
+ * @param settings_navigation $settings
+ * @param stdClass $module
+ */
+function page_extend_settings_navigation($settings, $module) {
+ global $PAGE, $CFG, $DB;
+
+ // Load the page instance from the database
+ $page = $DB->get_record('page', array('id'=>$PAGE->cm->instance));
+ // Add a page node to the settings navigation.
+ $pagenavkey = $settings->add(get_string('pageadministration', 'page'));
+ $pagenav = $settings->get($pagenavkey);
+ $pagenav->forceopen = true;
+
+ // If the user has the capability add an update this module link for the page instance
+ if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {
+ $url = new moodle_url($CFG->wwwroot.'/course/mod.php', array('update'=>$PAGE->cm->id, 'return'=>true, 'sesskey'=>sesskey()));
+ $pagenav->add(get_string('updatethis', '', get_string('modulename', 'page')), $url);
+ }
+
+ // Check if any children have been added. If not remove the node to save on clutter.
+ if (count($pagenav->children)<1) {
+ $settings->remove_child($pagenavkey);
+ }
+}
\ No newline at end of file
$PAGE->set_title($course->shortname.': '.$page->name);
$PAGE->set_heading($course->fullname);
$PAGE->set_activity_record($page);
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'page'));
echo $OUTPUT->header();
if (!empty($options['printheading'])) {
require_capability('mod/quiz:manage', $contexts->lowest());
// Print basic page layout.
-$strupdatemodule = '';
-if (has_capability('moodle/course:manageactivities', $contexts->lowest())) {
- $strupdatemodule = $OUTPUT->update_module_button($cm->id, 'quiz');
-}
$PAGE->navbar->add($streditingquiz);
$PAGE->set_title($streditingquiz);
-$PAGE->set_button($strupdatemodule);
echo $OUTPUT->header();
if (!$quizname = $DB->get_field($cm->modname, 'name', array('id' => $cm->instance))) {
echo $OUTPUT->header();
} else {
$PAGE->set_title(format_string($attemptobj->get_quiz_name()));
- $PAGE->set_button($attemptobj->update_module_button());
echo $OUTPUT->header();
}
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
}
// Bits of content =====================================================================
- /**
- * @return string the HTML snipped that needs to be supplied to print_header_simple
- * as the $button parameter.
- */
- public function update_module_button() {
- global $OUTPUT ;
- if (has_capability('moodle/course:manageactivities',
- get_context_instance(CONTEXT_COURSE, $this->course->id))) {
-
-
- return $OUTPUT->update_module_button($this->cm->id, 'quiz');
- } else {
- return '';
- }
- }
/**
* @param string $title the name of this particular quiz page.
$questionbankmanagement = '<a href="'.$CFG->wwwroot.
'/question/edit.php?courseid='.$course->id.'">'.
get_string('questionbankmanagement', 'quiz').'</a> ';
-$strupdatemodule = has_capability('moodle/course:manageactivities',
- $contexts->lowest()) ?
- $OUTPUT->update_module_button($cm->id, 'quiz') :
- "";
$PAGE->navbar->add($pagetitle);
$PAGE->requires->skip_link_to('questionbank', get_string('skipto', 'access', get_string('questionbank', 'question')));
$PAGE->requires->skip_link_to('quizcontentsblock', get_string('skipto', 'access', get_string('questionsinthisquiz', 'quiz')));
$PAGE->set_title($pagetitle);
-$PAGE->set_button($questionbankmanagement.$strupdatemodule);
+$PAGE->set_button($questionbankmanagement);
echo $OUTPUT->header();
// Initialise the JavaScript.
$strquiz = get_string("modulename", "quiz");
/// Print the page header
$PAGE->set_title(format_string($quiz->name));
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'quiz'));
echo $OUTPUT->header();
/// Print the tabs
$currenttab = 'reports';
} else {
$attemptobj->navigation($strreviewtitle);
$PAGE->set_title(format_string($attemptobj->get_quiz_name()));
- $PAGE->set_button($attemptobj->update_module_button());
echo $OUTPUT->header();
}
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
} else {
$attemptobj->navigation($title);
$PAGE->set_title(format_string($attemptobj->get_quiz_name()));
- $PAGE->set_button($attemptobj->update_module_button());
echo $OUTPUT->header();
}
// The code will be much nicer than this eventually.
$title = $course->shortname . ': ' . format_string($quiz->name);
- $buttons = '<table><tr><td>'.$OUTPUT->update_module_button($cm->id, $cm->modname).'</td>';
if ($PAGE->user_allowed_editing() && !empty($CFG->showblocksonmodpages)) {
- $buttons .= '<td><form '.$CFG->frametarget.' method="get" action="view.php"><div>'.
+ $buttons = '<table><tr><td><form '.$CFG->frametarget.' method="get" action="view.php"><div>'.
'<input type="hidden" name="id" value="'.$cm->id.'" />'.
'<input type="hidden" name="edit" value="'.($PAGE->user_is_editing()?'off':'on').'" />'.
- '<input type="submit" value="'.get_string($PAGE->user_is_editing()?'blockseditoff':'blocksediton').'" /></div></form></td>';
+ '<input type="submit" value="'.get_string($PAGE->user_is_editing()?'blockseditoff':'blocksediton').'" /></div></form></td></tr></table>';
+ $PAGE->set_button($buttons);
}
- $buttons .= '</tr></table>';
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
- $PAGE->set_button($buttons);
+
echo $OUTPUT->header();
/// Print heading and tabs (if there is more than one).
$PAGE->set_title("$course->shortname: ".format_string($survey->name));
$PAGE->set_heading($course->fullname);
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'survey'));
echo $OUTPUT->header();
/// Check to see if groups are being used in this survey
$strsurvey = get_string("modulename", "survey");
$PAGE->set_title(format_string($survey->name));
- $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'survey'));
echo $OUTPUT->header();
/// Check to see if groups are being used in this survey
return $info;
}
+/**
+ * This function extends the global navigaiton for the site.
+ * It is important to note that you should not rely on PAGE objects within this
+ * body of code as there is no guarantee that during an AJAX request they are
+ * available
+ *
+ * @param navigation_node $navigation The url node within the global navigation
+ * @param stdClass $course The course object returned from the DB
+ * @param stdClass $module The module object returned from the DB
+ * @param stdClass $cm The course module isntance returned from the DB
+ */
+function url_extend_navigation($navigation, $course, $module, $cm) {
+ /**
+ * This is currently just a stub so that it can be easily expanded upon.
+ * When expanding just remove this comment and the line below and then add
+ * you content.
+ */
+ $navigation->nodetype = navigation_node::NODETYPE_LEAF;
+}
+
+/**
+ * This function extends the settings navigation block for the site.
+ *
+ * It is safe to rely on PAGE here as we will only ever be within the module
+ * context when this is called.
+ *
+ * @param settings_navigation $settings
+ * @param stdClass $module
+ */
+function url_extend_settings_navigation($settings, $module) {
+ global $PAGE, $CFG, $DB;
+
+ // Load the url instance from the database
+ $url = $DB->get_record('url', array('id'=>$PAGE->cm->instance));
+ // Add a url node to the settings navigation.
+ $urlnavkey = $settings->add(get_string('urladministration', 'url'));
+ $urlnav = $settings->get($urlnavkey);
+ $urlnav->forceopen = true;
+
+ // If the user has the capability add an update this module link for the url instance
+ if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {
+ $url = new moodle_url($CFG->wwwroot.'/course/mod.php', array('update'=>$PAGE->cm->id, 'return'=>true, 'sesskey'=>sesskey()));
+ $urlnav->add(get_string('updatethis', '', get_string('modulename', 'url')), $url);
+ }
+
+ // Check if any children have been added. If not remove the node to save on clutter.
+ if (count($urlnav->children)<1) {
+ $settings->remove_child($urlnavkey);
+ }
+}
\ No newline at end of file
$PAGE->set_title($course->shortname.': '.$url->name);
$PAGE->set_heading($course->fullname);
$PAGE->set_activity_record($url);
- $PAGE->set_button(update_module_button($cm->id, '', get_string('modulename', 'url')));
echo $OUTPUT->header();
}