Skip to content

Commit

Permalink
Merge pull request #185 from ucsf-education/rm_helpmenu
Browse files Browse the repository at this point in the history
removes Help Menu feature.
  • Loading branch information
stopfstedt authored Jul 24, 2024
2 parents f12d26b + e4346d7 commit ed4717a
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 213 deletions.
4 changes: 0 additions & 4 deletions classes/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
interface constants {

/** @var int The maximum number of help menu items. */
const HELPMENU_ITEMS_COUNT = 10;

/** @var int The maximum number of banner alerts. */
const BANNERALERT_ITEMS_COUNT = 10;

Expand Down
67 changes: 0 additions & 67 deletions classes/output/helpmenu.php

This file was deleted.

13 changes: 0 additions & 13 deletions lang/en/theme_ucsf.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,6 @@
$string['end_weeklydesc'] = 'Set time when you want your weekly alert to start/end.';
$string['enddate'] = 'End date';
$string['generalsettings'] = 'General settings';
$string['helpfeedback'] = 'Helpmenu';
$string['helpfeedbackenabled'] = 'Enabled';
$string['helpfeedbackenableddesc'] = ' Check to enable the display of the helpmenu in the site navigation banner.';
$string['helpfeedbacklink'] = 'Link';
$string['helpfeedbacklinkdesc'] = 'The URL that this menu item links to. Leave this field empty to exclude this item from the menu.';
$string['helpfeedbacklinklabel'] = "Title";
$string['helpfeedbacklinklabeldesc'] = "The menu item title. Must be provided if a link is given, otherwise this item will be excluded from them menu.";
$string['helpfeedbacklinktarget'] = 'Open link in new window';
$string['helpfeedbacklinktargetdesc'] = "Check to have this menu item's link open up in a new window.";
$string['helpfeedbackno'] = 'Menu item {$a}';
$string['helpfeedbacksettings'] = 'Helpmenu';
$string['helpmenu'] = 'Helpmenu';
$string['invalidenddate'] = 'Invalid end date.';
$string['invalidstartandenddate'] = 'Invalid start date and end date.';
$string['invalidstartdate'] = 'Invalid start date.';
Expand Down Expand Up @@ -131,7 +119,6 @@
$string['switchedroleto'] = 'You are viewing this course currently with the role:';
$string['timezone_alerts'] = 'Timezone settings';
$string['timezone_alertsdesc'] = 'Alerts are using UTC time. Set the time that you need for your alert settings.';
$string['togglehelpmenu'] = 'Toggle help menu';
$string['unaddableblocks'] = 'Unneeded blocks';
$string['unaddableblocks_desc'] = 'The blocks specified are not needed when using this theme and will not be listed in the \'Add a block\' menu.';
$string['weekly'] = 'Weekly';
14 changes: 0 additions & 14 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

use theme_ucsf\output\helpmenu;

/**
* Serves any files associated with the theme settings.
*
Expand Down Expand Up @@ -96,15 +94,3 @@ function theme_ucsf_get_main_scss_content(theme_config $theme): string {
// Combine them together.
return $pre . "\n" . $scss . "\n" . $post;
}

/**
* Output callback for injecting our help menu into the nav bar.
*
* @link https://docs.moodle.org/dev/Output_callbacks#render_navbar_output
* @param renderer_base $renderer
* @return string
* @throws coding_exception
*/
function theme_ucsf_render_navbar_output(renderer_base $renderer): string {
return $renderer->render(new helpmenu());
}
6 changes: 0 additions & 6 deletions scss/components/helpmenu.scss

This file was deleted.

1 change: 0 additions & 1 deletion scss/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ h5 {
* Components
======================================*/
@import "components/backtotopbutton";
@import "components/helpmenu";

/*=======================================
* Settings: Functionality -> Courses.
Expand Down
50 changes: 0 additions & 50 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,56 +121,6 @@
// Course-catgories list.
$categories = core_course_category::make_categories_list('', 0, ' | ');

// Helpmenu.
$page = new admin_settingpage('theme_ucsf_helpmenu', get_string('helpfeedbacksettings', 'theme_ucsf'));

$setting = new admin_setting_configcheckbox(
'theme_ucsf/helpfeedbackenabled',
get_string('helpfeedbackenabled', 'theme_ucsf'),
get_string('helpfeedbackenableddesc', 'theme_ucsf'),
'0',
);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);

for ($i = 1; $i <= constants::HELPMENU_ITEMS_COUNT; $i++) {
$heading = get_string('helpfeedbackno', 'theme_ucsf', $i);
$setting = new admin_setting_heading(
'theme_ucsf/helpfeedback' . $i . 'heading',
get_string('helpfeedbackno', 'theme_ucsf', $i),
''
);
$page->add($setting);

$setting = new admin_setting_configtext(
'theme_ucsf/helpfeedback' . $i . 'link',
get_string('helpfeedbacklink', 'theme_ucsf'),
get_string('helpfeedbacklinkdesc', 'theme_ucsf'),
'');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);

$setting = new admin_setting_configtext(
'theme_ucsf/helpfeedback' . $i . 'linklabel',
get_string('helpfeedbacklinklabel', 'theme_ucsf'),
get_string('helpfeedbacklinklabeldesc', 'theme_ucsf'),
''
);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);

$setting = new admin_setting_configcheckbox(
'theme_ucsf/helpfeedback' . $i . 'linktarget',
get_string('helpfeedbacklinktarget', 'theme_ucsf'),
get_string('helpfeedbacklinktargetdesc', 'theme_ucsf'),
'0',
);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
}

$settings->add($page);

// Banner Alerts.
$page = new admin_settingpage('theme_ucsf_alerts', get_string('alertsheading', 'theme_ucsf'));

Expand Down
58 changes: 0 additions & 58 deletions templates/helpmenu.mustache

This file was deleted.

0 comments on commit ed4717a

Please sign in to comment.