The notice and info have been moved

This commit is contained in:
Michael 2022-10-17 18:55:22 +00:00
parent 20291ddc2b
commit fdfa1f8630
73 changed files with 273 additions and 284 deletions

View file

@ -36,7 +36,7 @@ class Details extends BaseAdmin
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
if (!is_dir("view/theme/$theme")) {
notice(DI::l10n()->t("Item not found."));
DI::sysmsg()->addNotice(DI::l10n()->t("Item not found."));
return '';
}
@ -54,11 +54,11 @@ class Details extends BaseAdmin
if ($isEnabled) {
Theme::uninstall($theme);
info(DI::l10n()->t('Theme %s disabled.', $theme));
DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s disabled.', $theme));
} elseif (Theme::install($theme)) {
info(DI::l10n()->t('Theme %s successfully enabled.', $theme));
DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s successfully enabled.', $theme));
} else {
notice(DI::l10n()->t('Theme %s failed to install.', $theme));
DI::sysmsg()->addNotice(DI::l10n()->t('Theme %s failed to install.', $theme));
}
DI::baseUrl()->redirect('admin/themes/' . $theme);

View file

@ -77,7 +77,7 @@ class Embed extends BaseAdmin
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
if (!is_dir("view/theme/$theme")) {
notice($this->t('Unknown theme.'));
DI::sysmsg()->addNotice($this->t('Unknown theme.'));
return '';
}

View file

@ -48,7 +48,7 @@ class Index extends BaseAdmin
}
Theme::setAllowedList($allowed_themes);
info(DI::l10n()->t('Themes reloaded'));
DI::sysmsg()->addInfo(DI::l10n()->t('Themes reloaded'));
break;
case 'toggle' :
@ -56,17 +56,17 @@ class Index extends BaseAdmin
if ($theme) {
$theme = Strings::sanitizeFilePathItem($theme);
if (!is_dir("view/theme/$theme")) {
notice(DI::l10n()->t('Item not found.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.'));
return '';
}
if (in_array($theme, Theme::getAllowedList())) {
Theme::uninstall($theme);
info(DI::l10n()->t('Theme %s disabled.', $theme));
DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s disabled.', $theme));
} elseif (Theme::install($theme)) {
info(DI::l10n()->t('Theme %s successfully enabled.', $theme));
DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s successfully enabled.', $theme));
} else {
notice(DI::l10n()->t('Theme %s failed to install.', $theme));
DI::sysmsg()->addNotice(DI::l10n()->t('Theme %s failed to install.', $theme));
}
}