diff options
| author | 2023-03-26 14:17:22 +0200 | |
|---|---|---|
| committer | 2023-03-26 14:17:22 +0200 | |
| commit | 5f898dcc5ee244e4adbd6aa83b607c844d432fb6 (patch) | |
| tree | 3511bcb3f78d053f4488e70000ab55fee7bb688a /app/layout | |
| parent | df24fa2207f56909084c613495b6f235b351c640 (diff) | |
Modernize Constants and use new constant for string 'currentUser' (#5089)
* Modernize Constants and use new constant 'currentUser'
* Add FreshRSS_Context::currentUser() function and use
* Add FreshRSS_Context::currentUser() function and use
* Add FreshRSS_Context::currentUser() function and use
* Add FreshRSS_Context::currentUser() function and use
* Add FreshRSS_Context::currentUser() function and use
* Update app/Controllers/userController.php
* Update app/Controllers/userController.php
* Update app/Controllers/userController.php
* Update app/Models/Auth.php
* Update p/api/greader.php
* Update p/api/greader.php
* Update p/api/greader.php
* Update app/Models/Context.php
* Update app/Models/LogDAO.php
* Update lib/Minz/Log.php
* Update p/api/greader.php
* Update app/layout/header.phtml
* Update app/views/helpers/export/articles.phtml
* Update cli/do-install.php
* Remarque's from Alkarex
* Remarque's from Alkarex
* Refactor using new Minz_User class
* Consistent naming of public constants
---------
Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/layout')
| -rw-r--r-- | app/layout/aside_configure.phtml | 2 | ||||
| -rw-r--r-- | app/layout/header.phtml | 4 | ||||
| -rw-r--r-- | app/layout/nav_menu.phtml | 6 | ||||
| -rw-r--r-- | app/layout/simple.phtml | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 6acb08f02..e179ef121 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -3,7 +3,7 @@ <ul> <li class="item nav-section"> - <div class="item nav-header"><?= _t('gen.menu.account') ?>: <?= htmlspecialchars(Minz_Session::param('currentUser', '_'), ENT_NOQUOTES, 'UTF-8')?></div> + <div class="item nav-header"><?= _t('gen.menu.account') ?>: <?= htmlspecialchars(Minz_User::name() ?? '', ENT_NOQUOTES, 'UTF-8')?></div> <ul> <li class="item<?= Minz_Request::controllerName() === 'user' && Minz_Request::actionName() === 'profile' ? ' active' : '' ?>"> <a href="<?= _url('user', 'profile') ?>"><?= _t('gen.menu.user_profile') ?></a> diff --git a/app/layout/header.phtml b/app/layout/header.phtml index 37dd39d6c..dabdff051 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -55,14 +55,14 @@ <li class="item dropdown-section"> <div class="dropdown-section-title"> - <?= _t('gen.menu.account') ?>: <?= htmlspecialchars(Minz_Session::param('currentUser', '_'), ENT_NOQUOTES, 'UTF-8') ?> + <?= _t('gen.menu.account') ?>: <?= htmlspecialchars(Minz_User::name() ?? '', ENT_NOQUOTES, 'UTF-8') ?> </div> <ul> <li class="item"><a href="<?= _url('user', 'profile') ?>"><?= _t('gen.menu.user_profile') ?></a></li> <?php if (FreshRSS_Auth::accessNeedsAction()): ?> <li class="item"><a class="signout" href="<?= _url('auth', 'logout') ?>"><?= _t('gen.auth.logout'); ?><?= _i('logout') ?></a></li> <?php else: ?> - <li class="item"><span class="signout">(<?= htmlspecialchars(Minz_Session::param('currentUser', '_'), ENT_NOQUOTES, 'UTF-8') ?>)</span></li> + <li class="item"><span class="signout">(<?= htmlspecialchars(Minz_User::name() ?? '', ENT_NOQUOTES, 'UTF-8') ?>)</span></li> <?php endif; ?> </ul> </li> diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 848144568..5b6919f9b 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -57,10 +57,10 @@ <?php $state = Minz_Request::param('state', ''); ?> <?php if ($state != '') { ?> <input type="hidden" name="state" value="<?= $state ?>" /> - <?php } ?> + <?php } ?> <div class="stick search"> - <input type="search" name="search" + <input type="search" name="search" value="<?= htmlspecialchars(htmlspecialchars_decode(FreshRSS_Context::$search, ENT_QUOTES), ENT_COMPAT, 'UTF-8'); ?>" placeholder="<?= _t('gen.menu.search') ?>" title="<?= _t('gen.menu.search') ?>" /><button class="btn" type="submit" title="<?= _t('index.menu.search_short') ?>"><?= _i('search') ?></button> </div> @@ -209,7 +209,7 @@ <?php $url_output['a'] = 'rss'; if (FreshRSS_Context::$user_conf->token) { - $url_output['params']['user'] = Minz_Session::param('currentUser'); + $url_output['params']['user'] = Minz_User::name(); $url_output['params']['token'] = FreshRSS_Context::$user_conf->token; } if (FreshRSS_Context::$user_conf->since_hours_posts_per_rss) { diff --git a/app/layout/simple.phtml b/app/layout/simple.phtml index c9d209999..7251f6810 100644 --- a/app/layout/simple.phtml +++ b/app/layout/simple.phtml @@ -46,7 +46,7 @@ <?php if (FreshRSS_Auth::accessNeedsAction()) { ?> <a class="signout" href="<?= _url('auth', 'logout') ?>"> <?= _i('logout') . _t('gen.auth.logout') ?> - (<?= htmlspecialchars(Minz_Session::param('currentUser', '_'), ENT_NOQUOTES, 'UTF-8') ?>) + (<?= htmlspecialchars(Minz_User::name() ?? '', ENT_NOQUOTES, 'UTF-8') ?>) </a> <?php } ?> </div> |
