Navigation buttons
Maintained by
Davo Smith
Add customisable navigation buttons (next/prev/etc.) to the bottom of each activity page (Moodle 1.9/2.0+)
Comments
Comments are no longer open for new posts. Existing comments remain available to read.
$output = $this->container_end_all(true);
With the lines:
require_once($CFG->dirroot.'/blocks/navbuttons/footer.php');
$output = draw_navbuttons().$this->container_end_all(true);
i have to replace $output = $this->container_end_all(true); with $output = draw_navbuttons().$this->container_end_all(true);
where do i have to add? require_once($CFG->dirroot.'/blocks/navbuttons/footer.php');
is this correct?
in our moodle with adaptable as theme, the plugin isn't working properly. as i understand the readme file correctly, we have to change the file renderers.php from the theme folder. in this file the lines connected to the footer are:
public function get_footer_blocks($layoutrow = 'footerlayoutrow') {
global $PAGE, $OUTPUT;
$fields = array();
$blockcount = 0;
$style = '';
if (!$this->get_footer_visibility()) {
return '';
}
$output = '
for ($i = 1; $i <= 3; $i++) {
$footerrow = $layoutrow . $i;
$footerrow = $PAGE->theme->settings->$footerrow;
if ($footerrow != '0-0-0-0') {
$fields[] = $footerrow;
}
}
foreach ($fields as $field) {
$output .= '
$vals = explode('-', $field);
foreach ($vals as $val) {
if ($val > 0) {
$blockcount ++;
$footerheader = 'footer' . $blockcount . 'header';
$footercontent = 'footer' . $blockcount . 'content';
if (!empty($PAGE->theme->settings->$footercontent)) {
$output .= '
if (!empty($PAGE->theme->settings->$footerheader)) {
$output .= '
';
';$output .= $OUTPUT->get_setting($footerheader, 'format_text');
$output .= '
}
$output .= $OUTPUT->get_setting($footercontent, 'format_html');
$output .= '
}
}
}
$output .= '
}
$output .= '
return $output;
}
which line do we need to change to put these lines:
require_once($CFG->dirroot.'/blocks/navbuttons/footer.php');
$output = draw_navbuttons().$this->container_end_all(true);
thanks for any support!
That would mean that the next activity in the course is linked to, even if it is hidden or not available due to conditional restrictions, but that will lead to lots of error screens if the activity is still not available to the user after they've clicked on the link (so hiding an activity in the course would lead to everyone getting an error when reaching it, rather than just skipping over it to get to the next activity).
An alternative might be more complex code that refreshes the buttons via javascript once the activity is complete, but that is beyond the scope of what I'd be able to do in my spare time (maybe could be tackled in work time, if you had a budget to pay for it).
There is nothing I can do about it as long as the plugin is still in the 'Other' category (I had hoped to remove the core change when some new hooks were added a to the Moodle footer a couple of years back, but those hooks were implemented in a way that doesn't allow extra output to be inserted, so I'm still stuck with the core change).
Why it's not in AMOS for translation? I'm PT-PT translator. Only in GitHub?