Skip to content

Commit

Permalink
Improvement: Add the option to oppress the footer butto, solves moodl…
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Nov 5, 2023
1 parent 4affa26 commit 1c240ef
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Unreleased

* 2023-11-05 - Improvement: Option to suppress footer button, solves #444.
* 2023-10-09 - Improvement: Add a direct 'view course' icon on the course management pages, solves #129.
* 2023-10-05 - Improvement: Allow the admin to set the background-position of the background and login background images, solves #111.
* 2023-11-03 - Bugfix: Add missing cachedef strings to the language pack, solves #441.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ In this tab there are the following settings:

Whatever you add to this textarea will be displayed at the end of a page, in the footer. Refer to the setting description on the settings page for further instructions.

###### Footer

With these settings, you can suppress the footer (circle containing the question mark) button.

#### Tab "Static pages"

In this tab there are the following settings:
Expand Down
6 changes: 6 additions & 0 deletions lang/en/theme_boost_union.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,12 @@
// ... ... Setting: Footnote.
$string['footnotesetting'] = 'Footnote';
$string['footnotesetting_desc'] = 'Whatever you add to this textarea will be displayed at the end of a page, in the footer (not the floating footer) on every page which uses the layouts "drawers", "columns2" or "login". Content in this area could be for example the copyright, the terms of use or the name of your organisation. <br/> If you want to remove the footnote again, just empty the text area.';
// ... Section: Footer.
$string['footerheading'] = 'Footer';
// ... ... Setting: Footer.
$string['enablefooterbutton'] = 'Enable footer';
$string['enablefooterbutton_desc'] = 'With "footer", the circle containing the question mark at the bottom of the page is meant.<br />Upon click, the user is presented with an overlay. Depending on the site configuration the links
Help and documentation, Services and support, Contact site support, Login information, Reset user tour on this page, Data retention summary, Get the mobile app, Policies and Powered by Moodle could be shown.<br />With this setting it is possible to suppress this footer button.';

// Settings: Static pages tab.
$string['staticpagestab'] = 'Static pages';
Expand Down
5 changes: 5 additions & 0 deletions layout/includes/staticpages.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,8 @@
$templatecontext[$staticpage.'pagetitle'] = theme_boost_union_get_staticpage_pagetitle($staticpage);
}
}

// If the footerbutton is enabled.
if ($config->enablefooterbutton == THEME_BOOST_UNION_SETTING_SELECT_YES) {
$templatecontext['footerbutton'] = true;
}
14 changes: 14 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,20 @@
$setting = new admin_setting_confightmleditor($name, $title, $description, '');
$tab->add($setting);

// Create footer heading.
$name = 'theme_boost_union/footerheading';
$title = get_string('footerheading', 'theme_boost_union', null, true);
$setting = new admin_setting_heading($name, $title, null);
$tab->add($setting);

// Setting: Footer.
$name = 'theme_boost_union/enablefooterbutton';
$title = get_string('enablefooterbutton', 'theme_boost_union', null, true);
$description = get_string('enablefooterbutton_desc', 'theme_boost_union', null, true);
$setting = new admin_setting_configselect($name, $title, $description, THEME_BOOST_UNION_SETTING_SELECT_YES,
$yesnooption);
$tab->add($setting);

// Add tab to settings page.
$page->add($tab);

Expand Down
3 changes: 3 additions & 0 deletions templates/theme_boost/footer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
* Added the possibility to show the generic page 2 link.
* Added the possibility to show the generic page 3 link.
* Added the bottom menu bar to show menus in footer for mobile devices.
* Added the possibility to suppress the footer button (question mark in the circle).
}}

<footer id="page-footer" class="footer-popover bg-white">
Expand All @@ -84,9 +85,11 @@
{{#pix}}t/messages-o, core{{/pix}}
</button>
{{/output.has_communication_links}}
{{# footerbutton }}
<button class="btn btn-icon bg-secondary icon-no-margin btn-footer-popover" data-action="footer-popover" aria-label="{{#str}}showfooter, theme_boost{{/str}}">
{{#pix}}e/question, core{{/pix}}
</button>
{{/ footerbutton }}
</div>
<div class="footer-content-popover container" data-region="footer-content-popover">
{{#output.has_communication_links}}
Expand Down
28 changes: 28 additions & 0 deletions tests/behat/theme_boost_union_contentsettings_footer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,31 @@ Feature: Configuring the theme_boost_union plugin for the "Footer" tab on the "C
And I follow "Log in"
Then "#footnote" "css_element" should exist
And I should see "Whatever footnote" in the "#footnote" "css_element"

Scenario: Setting: Footer - Enable and disable the footer button
Given the following config values are set as admin:
| config | value | plugin |
| enablefooterbutton | no | theme_boost_union |
When I log in as "admin"
And I follow "Dashboard"
Then ".btn-footer-popover" "css_element" should not exist
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
Then ".btn-footer-popover" "css_element" should not exist
And I log out
And I follow "Log in"
Then ".btn-footer-popover" "css_element" should not exist
And the following config values are set as admin:
| config | value | plugin |
| enablefooterbutton | yes | theme_boost_union |
When I log in as "admin"
And I follow "Dashboard"
Then ".btn-footer-popover" "css_element" should exist
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
Then ".btn-footer-popover" "css_element" should exist
And I log out
And I follow "Log in"
Then ".btn-footer-popover" "css_element" should exist

0 comments on commit 1c240ef

Please sign in to comment.