Skip to content

Commit

Permalink
Improve smart menu settings forms
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Aug 31, 2023
1 parent c37932f commit 3e92fd0
Show file tree
Hide file tree
Showing 11 changed files with 401 additions and 303 deletions.
4 changes: 2 additions & 2 deletions classes/form/smartmenu_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ public function definition() {
$mform->addHelpButton('start_date', 'smartmenusfrom', 'theme_boost_union');

$mform->addElement('date_time_selector', 'end_date',
get_string('smartmenusdurationuntil', 'theme_boost_union'), array('optional' => true));
$mform->addHelpButton('end_date', 'smartmenusdurationuntil', 'theme_boost_union');
get_string('smartmenusuntil', 'theme_boost_union'), array('optional' => true));
$mform->addHelpButton('end_date', 'smartmenusuntil', 'theme_boost_union');

// Add the Submit button.
// When two elements we need a group.
Expand Down
4 changes: 2 additions & 2 deletions classes/form/smartmenu_item_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ public function definition() {
$mform->addHelpButton('start_date', 'smartmenusfrom', 'theme_boost_union');
// Hide the item, if the end date is reached.
$mform->addElement('date_time_selector', 'end_date',
get_string('smartmenusdurationuntil', 'theme_boost_union'), array('optional' => true));
$mform->addHelpButton('end_date', 'smartmenusdurationuntil', 'theme_boost_union');
get_string('smartmenusuntil', 'theme_boost_union'), array('optional' => true));
$mform->addHelpButton('end_date', 'smartmenusuntil', 'theme_boost_union');

$this->add_action_buttons();
}
Expand Down
2 changes: 1 addition & 1 deletion classes/smartmenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ public static function manage_instance($formdata) {
// New menu added, recreate the menuslist.
$cache->delete(self::CACHE_MENUSLIST);
// Show the menu inserted success notification.
\core\notification::success(get_string('smartmenusinsertsuccess', 'theme_boost_union'));
\core\notification::success(get_string('smartmenusinsertmenusuccess', 'theme_boost_union'));
}

// Allow to update the DB changes to Database.
Expand Down
4 changes: 2 additions & 2 deletions classes/smartmenu_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,8 @@ public static function manage_instance($formdata) {
WHERE sortorder >= :sortorder AND id != :item AND menu=:menuid";

$DB->execute($sql, ['sortorder' => $record->sortorder, 'item' => $itemid, 'menuid' => $record->menu]);
// Show the menu inserted success notification.
\core\notification::success(get_string('smartmenusinsertsuccess', 'theme_boost_union'));
// Show the menu item inserted success notification.
\core\notification::success(get_string('smartmenusinsertmenuitemsuccess', 'theme_boost_union'));

// Delete the cached data of its menu. Menu will recreate with this item.
$menucache->delete_menu($formdata->menu);
Expand Down
Loading

0 comments on commit 3e92fd0

Please sign in to comment.