use Friendica\Util\Strings;
use Friendica\Util\Temporal;
-require_once 'include/enotify.php';
-require_once 'include/text.php';
-require_once 'include/items.php';
+/**
+ * Sets the current theme for theme settings pages.
+ *
+ * This needs to be done before the post() or content() methods are called.
+ *
+ * @param App $a
+ */
+function admin_init(App $a)
+{
+ if ($a->argc > 2 && $a->argv[1] == 'themes') {
+ $theme = $a->argv[2];
+ if (is_file("view/theme/$theme/config.php")) {
+ $a->setCurrentTheme($theme);
+ }
+ }
+}
/**
* @brief Process send data from the admin panels subpages
$theme = $a->argv[2];
if (is_file("view/theme/$theme/config.php")) {
- $orig_theme = Renderer::$theme;
- $orig_page = $a->page;
- $orig_session_theme = $_SESSION['theme'];
- require_once "view/theme/$theme/theme.php";
require_once "view/theme/$theme/config.php";
- $_SESSION['theme'] = $theme;
- $init = $theme . '_init';
- if (function_exists($init)) {
- $init($a);
- }
if (function_exists('theme_admin_post')) {
theme_admin_post($a);
}
-
- $_SESSION['theme'] = $orig_session_theme;
- Renderer::$theme = $orig_theme;
- $a->page = $orig_page;
}
info(L10n::t('Theme settings updated.'));
if ($a->isAjax()) {
return;
}
- $return_path = 'admin/themes/' . $theme;
+ $return_path = 'admin/themes/' . $theme . (!empty($_GET['mode']) ? '?mode=' . $_GET['mode'] : '');
break;
case 'tos':
admin_page_tos_post($a);
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
}
- $banner = htmlspecialchars($banner);
$info = Config::get('config', 'info');
- $info = htmlspecialchars($info);
// Automatically create temporary paths
get_temppath();
Thank you and welcome to %4$s.'));
$preamble = sprintf($preamble, $user['username'], Config::get('config', 'sitename'));
- $body = sprintf($body, System::baseUrl(), $user['email'], $result['password'], Config::get('config', 'sitename'));
+ $body = sprintf($body, System::baseUrl(), $user['nickname'], $result['password'], Config::get('config', 'sitename'));
notification([
'type' => SYSTEM_EMAIL,
$admin_form = '';
if (is_file("view/theme/$theme/config.php")) {
- $orig_theme = Renderer::$theme;
- $orig_page = $a->page;
- $orig_session_theme = $_SESSION['theme'];
- require_once "view/theme/$theme/theme.php";
require_once "view/theme/$theme/config.php";
- $_SESSION['theme'] = $theme;
-
- $init = $theme . "_init";
- if (function_exists($init)) {
- $init($a);
- }
if (function_exists('theme_admin')) {
$admin_form = theme_admin($a);
}
-
- $_SESSION['theme'] = $orig_session_theme;
- Renderer::$theme = $orig_theme;
- $a->page = $orig_page;
}
$screenshot = [Theme::getScreenshot($theme), L10n::t('Screenshot')];
'$toggle' => L10n::t('Toggle'),
'$settings' => L10n::t('Settings'),
'$baseurl' => System::baseUrl(true),
- '$addon' => $theme,
+ '$addon' => $theme . (!empty($_GET['mode']) ? '?mode=' . $_GET['mode'] : ''),
'$status' => $status,
'$action' => $action,
'$info' => Theme::getInfo($theme),