diff --git a/app/modules/web/Controllers/Account/CopyController.php b/app/modules/web/Controllers/Account/CopyController.php
index 985ad10c..43bb0326 100644
--- a/app/modules/web/Controllers/Account/CopyController.php
+++ b/app/modules/web/Controllers/Account/CopyController.php
@@ -37,7 +37,7 @@ final class CopyController extends AccountViewBase
/**
* Copy action
*
- * @param int $id Account's ID
+ * @param int $id Account's ID
*/
public function copyAction(int $id): void
{
@@ -54,8 +54,8 @@ final class CopyController extends AccountViewBase
'title',
[
'class' => 'titleGreen',
- 'name' => __('New Account'),
- 'icon' => $this->icons->getIconAdd()->getIcon(),
+ 'name' => __('New Account'),
+ 'icon' => $this->icons->add()->getIcon(),
]
);
$this->view->assign('formRoute', 'account/saveCopy');
diff --git a/app/modules/web/Controllers/Account/CreateController.php b/app/modules/web/Controllers/Account/CreateController.php
index b4b0be03..111dd846 100644
--- a/app/modules/web/Controllers/Account/CreateController.php
+++ b/app/modules/web/Controllers/Account/CreateController.php
@@ -47,8 +47,8 @@ final class CreateController extends AccountViewBase
'title',
[
'class' => 'titleGreen',
- 'name' => __('New Account'),
- 'icon' => $this->icons->getIconAdd()->getIcon(),
+ 'name' => __('New Account'),
+ 'icon' => $this->icons->add()->getIcon(),
]
);
$this->view->assign('formRoute', 'account/saveCreate');
diff --git a/app/modules/web/Controllers/Account/DeleteController.php b/app/modules/web/Controllers/Account/DeleteController.php
index 7186452e..55c4e4e1 100644
--- a/app/modules/web/Controllers/Account/DeleteController.php
+++ b/app/modules/web/Controllers/Account/DeleteController.php
@@ -29,6 +29,7 @@ use SP\Core\Acl\AclActionsInterface;
use SP\Core\Application;
use SP\Core\Events\Event;
use SP\Core\UI\ThemeIcons;
+use SP\Domain\Account\Ports\AccountServiceInterface;
use SP\Modules\Web\Controllers\Helpers\Account\AccountHelper;
use SP\Mvc\Controller\WebControllerHelper;
use SP\Util\ErrorUtil;
@@ -40,13 +41,13 @@ final class DeleteController extends AccountControllerBase
{
private AccountHelper $accountHelper;
private ThemeIcons $icons;
- private \SP\Domain\Account\Ports\AccountServiceInterface $accountService;
+ private AccountServiceInterface $accountService;
public function __construct(
- Application $application,
- WebControllerHelper $webControllerHelper,
- AccountHelper $accountHelper,
- \SP\Domain\Account\Ports\AccountServiceInterface $accountService
+ Application $application,
+ WebControllerHelper $webControllerHelper,
+ AccountHelper $accountHelper,
+ AccountServiceInterface $accountService
) {
parent::__construct(
$application,
@@ -62,7 +63,7 @@ final class DeleteController extends AccountControllerBase
/**
* Delete action
*
- * @param int|null $id Account's ID
+ * @param int|null $id Account's ID
*/
public function deleteAction(?int $id = null): void
{
@@ -79,8 +80,8 @@ final class DeleteController extends AccountControllerBase
'title',
[
'class' => 'titleRed',
- 'name' => __('Remove Account'),
- 'icon' => $this->icons->getIconDelete()->getIcon(),
+ 'name' => __('Remove Account'),
+ 'icon' => $this->icons->delete()->getIcon(),
]
);
$this->view->assign('formRoute', 'account/saveDelete');
diff --git a/app/modules/web/Controllers/Account/EditController.php b/app/modules/web/Controllers/Account/EditController.php
index 81404317..ee310899 100644
--- a/app/modules/web/Controllers/Account/EditController.php
+++ b/app/modules/web/Controllers/Account/EditController.php
@@ -38,7 +38,7 @@ final class EditController extends AccountViewBase
/**
* Edit action
*
- * @param int $id Account's ID
+ * @param int $id Account's ID
*/
public function editAction(int $id): void
{
@@ -55,8 +55,8 @@ final class EditController extends AccountViewBase
'title',
[
'class' => 'titleOrange',
- 'name' => __('Edit Account'),
- 'icon' => $this->icons->getIconEdit()->getIcon(),
+ 'name' => __('Edit Account'),
+ 'icon' => $this->icons->edit()->getIcon(),
]
);
$this->view->assign('formRoute', 'account/saveEdit');
diff --git a/app/modules/web/Controllers/Account/EditPassController.php b/app/modules/web/Controllers/Account/EditPassController.php
index 5b740c20..b14b7eab 100644
--- a/app/modules/web/Controllers/Account/EditPassController.php
+++ b/app/modules/web/Controllers/Account/EditPassController.php
@@ -39,7 +39,7 @@ final class EditPassController extends AccountViewBase
/**
* Obtener los datos para mostrar el interface para modificar la clave de cuenta
*
- * @param int $id Account's ID
+ * @param int $id Account's ID
*
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
@@ -58,8 +58,8 @@ final class EditPassController extends AccountViewBase
'title',
[
'class' => 'titleOrange',
- 'name' => __('Edit Account Password'),
- 'icon' => $this->icons->getIconEditPass()->getIcon(),
+ 'name' => __('Edit Account Password'),
+ 'icon' => $this->icons->editPass()->getIcon(),
]
);
$this->view->assign('formRoute', 'account/saveEditPass');
diff --git a/app/modules/web/Controllers/Account/ViewController.php b/app/modules/web/Controllers/Account/ViewController.php
index be8efaf5..82ccbd61 100644
--- a/app/modules/web/Controllers/Account/ViewController.php
+++ b/app/modules/web/Controllers/Account/ViewController.php
@@ -39,7 +39,7 @@ final class ViewController extends AccountViewBase
/**
* View action
*
- * @param int $id Account's ID
+ * @param int $id Account's ID
*/
public function viewAction(int $id): void
{
@@ -59,8 +59,8 @@ final class ViewController extends AccountViewBase
'title',
[
'class' => 'titleNormal',
- 'name' => __('Account Details'),
- 'icon' => $this->icons->getIconView()->getIcon(),
+ 'name' => __('Account Details'),
+ 'icon' => $this->icons->view()->getIcon(),
]
);
diff --git a/app/modules/web/Controllers/Account/ViewLinkController.php b/app/modules/web/Controllers/Account/ViewLinkController.php
index ebeee051..ec97dc50 100644
--- a/app/modules/web/Controllers/Account/ViewLinkController.php
+++ b/app/modules/web/Controllers/Account/ViewLinkController.php
@@ -36,6 +36,8 @@ use SP\Core\Events\Event;
use SP\Core\Events\EventMessage;
use SP\Core\UI\ThemeIcons;
use SP\DataModel\AccountExtData;
+use SP\Domain\Account\Ports\AccountServiceInterface;
+use SP\Domain\Account\Ports\PublicLinkServiceInterface;
use SP\Domain\Account\Services\PublicLinkService;
use SP\Http\Uri;
use SP\Mvc\Controller\WebControllerHelper;
@@ -49,17 +51,17 @@ use SP\Util\Util;
*/
final class ViewLinkController extends AccountControllerBase
{
- private \SP\Domain\Account\Ports\AccountServiceInterface $accountService;
+ private AccountServiceInterface $accountService;
private ThemeIcons $icons;
private PublicLinkService $publicLinkService;
private ImageUtil $imageUtil;
public function __construct(
- Application $application,
- WebControllerHelper $webControllerHelper,
- \SP\Domain\Account\Ports\AccountServiceInterface $accountService,
- \SP\Domain\Account\Ports\PublicLinkServiceInterface $publicLinkService,
- ImageUtilInterface $imageUtil
+ Application $application,
+ WebControllerHelper $webControllerHelper,
+ AccountServiceInterface $accountService,
+ PublicLinkServiceInterface $publicLinkService,
+ ImageUtilInterface $imageUtil
) {
parent::__construct(
$application,
@@ -76,7 +78,7 @@ final class ViewLinkController extends AccountControllerBase
/**
* View public link action
*
- * @param string $hash Link's hash
+ * @param string $hash Link's hash
*/
public function viewLinkAction(string $hash): void
{
@@ -106,8 +108,8 @@ final class ViewLinkController extends AccountControllerBase
'title',
[
'class' => 'titleNormal',
- 'name' => __('Account Details'),
- 'icon' => $this->icons->getIconView()->getIcon(),
+ 'name' => __('Account Details'),
+ 'icon' => $this->icons->view()->getIcon(),
]
);
@@ -136,24 +138,30 @@ final class ViewLinkController extends AccountControllerBase
? '***'
: $this->request->getClientAddress(true);
- $baseUrl = ($this->configData->getApplicationUrl() ?: BootstrapBase::$WEBURI).BootstrapBase::$SUBURI;
+ $baseUrl = ($this->configData->getApplicationUrl() ?: BootstrapBase::$WEBURI) . BootstrapBase::$SUBURI;
$deepLink = new Uri($baseUrl);
- $deepLink->addParam('r', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW) . '/' . $accountData->getId());
+ $deepLink->addParam(
+ 'r',
+ Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW) . '/' . $accountData->getId()
+ );
$this->eventDispatcher->notify(
'show.account.link',
new Event(
$this, EventMessage::factory()
- ->addDescription(__u('Link viewed'))
- ->addDetail(__u('Account'), $accountData->getName())
- ->addDetail(__u('Client'), $accountData->getClientName())
- ->addDetail(__u('Agent'), $this->request->getHeader('User-Agent'))
- ->addDetail(__u('HTTPS'), $this->request->isHttps() ? __u('ON') : __u('OFF'))
- ->addDetail(__u('IP'), $clientAddress)
- ->addDetail(__u('Link'), $deepLink->getUriSigned($this->configData->getPasswordSalt()))
- ->addExtra('userId', $publicLinkData->getUserId())
- ->addExtra('notify', $publicLinkData->isNotify())
+ ->addDescription(__u('Link viewed'))
+ ->addDetail(__u('Account'), $accountData->getName())
+ ->addDetail(__u('Client'), $accountData->getClientName())
+ ->addDetail(__u('Agent'), $this->request->getHeader('User-Agent'))
+ ->addDetail(__u('HTTPS'), $this->request->isHttps() ? __u('ON') : __u('OFF'))
+ ->addDetail(__u('IP'), $clientAddress)
+ ->addDetail(
+ __u('Link'),
+ $deepLink->getUriSigned($this->configData->getPasswordSalt())
+ )
+ ->addExtra('userId', $publicLinkData->getUserId())
+ ->addExtra('notify', $publicLinkData->isNotify())
)
);
} else {
diff --git a/app/modules/web/Controllers/ConfigManager/IndexController.php b/app/modules/web/Controllers/ConfigManager/IndexController.php
index a2a1ffbf..42e4d0e4 100644
--- a/app/modules/web/Controllers/ConfigManager/IndexController.php
+++ b/app/modules/web/Controllers/ConfigManager/IndexController.php
@@ -41,6 +41,7 @@ use SP\Core\Exceptions\SPException;
use SP\Core\Language;
use SP\Core\MimeTypesInterface;
use SP\Domain\Account\Ports\AccountServiceInterface;
+use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Config\Ports\ConfigServiceInterface;
use SP\Domain\Crypt\Services\TemporaryMasterPassService;
use SP\Domain\Export\Services\BackupFiles;
@@ -180,10 +181,10 @@ final class IndexController extends ControllerBase
}
/**
- * @return \SP\Mvc\View\Components\DataTab
- * @throws \SP\Core\Exceptions\CheckException
- * @throws \SP\Core\Exceptions\ConstraintException
- * @throws \SP\Core\Exceptions\QueryException
+ * @return DataTab
+ * @throws CheckException
+ * @throws ConstraintException
+ * @throws QueryException
*/
protected function getConfigGeneral(): DataTab
{
@@ -200,7 +201,7 @@ final class IndexController extends ControllerBase
$template->assign(
'themes',
SelectItemAdapter::factory(
- $this->theme->getThemesAvailable()
+ $this->theme->getAvailable()
)->getItemsFromArraySelected([$this->configData->getSiteTheme()])
);
$template->assign(
@@ -245,8 +246,8 @@ final class IndexController extends ControllerBase
}
/**
- * @return \SP\Mvc\View\Components\DataTab
- * @throws \SP\Core\Exceptions\CheckException
+ * @return DataTab
+ * @throws CheckException
*/
protected function getAccountConfig(): DataTab
{
@@ -294,10 +295,10 @@ final class IndexController extends ControllerBase
}
/**
- * @return \SP\Mvc\View\Components\DataTab
- * @throws \SP\Core\Exceptions\CheckException
- * @throws \SP\Core\Exceptions\ConstraintException
- * @throws \SP\Core\Exceptions\QueryException
+ * @return DataTab
+ * @throws CheckException
+ * @throws ConstraintException
+ * @throws QueryException
*/
protected function getLdapConfig(): DataTab
{
@@ -357,9 +358,9 @@ final class IndexController extends ControllerBase
}
/**
- * @return \SP\Mvc\View\Components\DataTab
- * @throws \SP\Core\Exceptions\ConstraintException
- * @throws \SP\Core\Exceptions\QueryException
+ * @return DataTab
+ * @throws ConstraintException
+ * @throws QueryException
*/
protected function getMailConfig(): DataTab
{
@@ -401,7 +402,7 @@ final class IndexController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
* @throws NoSuchItemException
- * @throws \SP\Domain\Common\Services\ServiceException
+ * @throws ServiceException
*/
protected function getEncryptionConfig(): DataTab
{
@@ -521,9 +522,9 @@ final class IndexController extends ControllerBase
}
/**
- * @return \SP\Mvc\View\Components\DataTab
- * @throws \SP\Core\Exceptions\ConstraintException
- * @throws \SP\Core\Exceptions\QueryException
+ * @return DataTab
+ * @throws ConstraintException
+ * @throws QueryException
*/
protected function getImportConfig(): DataTab
{
@@ -546,9 +547,9 @@ final class IndexController extends ControllerBase
}
/**
- * @return \SP\Mvc\View\Components\DataTab
- * @throws \SP\Domain\Common\Services\ServiceException
- * @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException
+ * @return DataTab
+ * @throws ServiceException
+ * @throws NoSuchItemException
*/
protected function getInfo(): DataTab
{
diff --git a/app/modules/web/Controllers/ControllerBase.php b/app/modules/web/Controllers/ControllerBase.php
index 6b1af859..540d67ef 100644
--- a/app/modules/web/Controllers/ControllerBase.php
+++ b/app/modules/web/Controllers/ControllerBase.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -30,7 +30,7 @@ use Exception;
use SP\Core\Acl\Acl;
use SP\Core\Application;
use SP\Core\Bootstrap\BootstrapBase;
-use SP\Core\Context\ContextInterface;
+use SP\Core\Context\SessionContextInterface;
use SP\Core\Crypt\Hash;
use SP\Core\Events\EventDispatcher;
use SP\Core\Exceptions\FileNotFoundException;
@@ -50,6 +50,10 @@ use SP\Mvc\Controller\WebControllerHelper;
use SP\Mvc\View\TemplateInterface;
use SP\Providers\Auth\Browser\BrowserAuthInterface;
+use function SP\__;
+use function SP\logger;
+use function SP\processException;
+
/**
* Clase base para los controladores
*/
@@ -59,21 +63,21 @@ abstract class ControllerBase
protected const ERR_UNAVAILABLE = 0;
- protected EventDispatcher $eventDispatcher;
- protected ConfigFileService $config;
- protected ContextInterface $session;
- protected ThemeInterface $theme;
- protected Acl $acl;
- protected ConfigDataInterface $configData;
- protected RequestInterface $request;
- protected PhpExtensionChecker $extensionChecker;
- protected TemplateInterface $view;
- protected ?UserLoginResponse $userData = null;
- protected ?ProfileData $userProfileData = null;
- protected bool $isAjax;
- protected LayoutHelper $layoutHelper;
- private BrowserAuthInterface $browser;
- protected string $actionName;
+ protected EventDispatcher $eventDispatcher;
+ protected ConfigFileService $config;
+ protected SessionContextInterface $session;
+ protected ThemeInterface $theme;
+ protected Acl $acl;
+ protected ConfigDataInterface $configData;
+ protected RequestInterface $request;
+ protected PhpExtensionChecker $extensionChecker;
+ protected TemplateInterface $view;
+ protected ?UserLoginResponse $userData = null;
+ protected ?ProfileData $userProfileData = null;
+ protected bool $isAjax;
+ protected LayoutHelper $layoutHelper;
+ protected string $actionName;
+ private BrowserAuthInterface $browser;
public function __construct(
Application $application,
@@ -119,7 +123,7 @@ abstract class ControllerBase
$this->view->assign('timeStart', $this->request->getServer('REQUEST_TIME_FLOAT'));
$this->view->assign('queryTimeStart', microtime());
$this->view->assign('isDemo', $this->configData->isDemoEnabled());
- $this->view->assign('themeUri', $this->view->getTheme()->getThemeUri());
+ $this->view->assign('themeUri', $this->view->getTheme()->getUri());
$this->view->assign('configData', $this->configData);
if ($loggedIn) {
@@ -183,10 +187,10 @@ abstract class ControllerBase
/**
* Comprobar si el usuario está logado.
*
- * @param bool $requireAuthCompleted
+ * @param bool $requireAuthCompleted
*
- * @throws \SP\Core\Exceptions\SessionTimeout
- * @throws \SP\Domain\Auth\Services\AuthException
+ * @throws SessionTimeout
+ * @throws AuthException
*/
protected function checkLoggedIn(bool $requireAuthCompleted = true): void
{
@@ -230,7 +234,7 @@ abstract class ControllerBase
/**
* Comprobar si está permitido el acceso al módulo/página.
*
- * @param int $action La acción a comprobar
+ * @param int $action La acción a comprobar
*/
protected function checkAccess(int $action): bool
{
diff --git a/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php
index c15ef0f3..37c704a5 100644
--- a/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php
+++ b/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php
@@ -63,7 +63,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Account Details'));
$action->setTitle(__('Account Details'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconView());
+ $action->setIcon($this->icons->view());
$action->setRuntimeFilter(AccountSearchItem::class, 'isShowView');
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW));
$action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW));
@@ -75,8 +75,8 @@ final class AccountActionsHelper extends HelperBase
/**
* Set icons for view
*
- * @param AccountAcl $accountAcl
- * @param AccountActionsDto $accountActionsDto
+ * @param AccountAcl $accountAcl
+ * @param AccountActionsDto $accountActionsDto
*
* @return DataGridAction[]
*/
@@ -139,7 +139,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Back'));
$action->setTitle(__('Back'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconBack());
+ $action->setIcon($this->icons->back());
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW));
$action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW));
$action->addAttribute('type', 'button');
@@ -158,7 +158,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Edit Account Password'));
$action->setTitle(__('Edit Account Password'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconEditPass());
+ $action->setIcon($this->icons->editPass());
$action->setRuntimeFilter(AccountSearchItem::class, 'isShowViewPass');
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT_PASS));
$action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT_PASS));
@@ -178,7 +178,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Edit Account'));
$action->setTitle(__('Edit Account'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconEdit());
+ $action->setIcon($this->icons->edit());
$action->setRuntimeFilter(AccountSearchItem::class, 'isShowEdit');
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT));
$action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT));
@@ -197,7 +197,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Request Modification'));
$action->setTitle(__('Request Modification'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconEmail());
+ $action->setIcon($this->icons->email());
$action->setRuntimeFilter(AccountSearchItem::class, 'isShowRequest');
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_REQUEST));
$action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW));
@@ -217,7 +217,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Restore account from this point'));
$action->setTitle(__('Restore account from this point'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconRestore());
+ $action->setIcon($this->icons->restore());
$action->addData('action-route', 'account/saveEditRestore');
$action->addData('onclick', 'account/saveEditRestore');
$action->addAttribute('type', 'button');
@@ -236,7 +236,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Save'));
$action->setTitle(__('Save'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconSave());
+ $action->setIcon($this->icons->save());
$action->addData('action-route', 'account/save');
$action->addData('onclick', 'account/save');
$action->addAttribute('type', 'submit');
@@ -247,8 +247,8 @@ final class AccountActionsHelper extends HelperBase
/**
* Set icons for view
*
- * @param AccountAcl $accountAcl
- * @param AccountActionsDto $accountActionsDto
+ * @param AccountAcl $accountAcl
+ * @param AccountActionsDto $accountActionsDto
*
* @return DataGridAction[]
*/
@@ -262,7 +262,7 @@ final class AccountActionsHelper extends HelperBase
if ($accountAcl->isShowDelete()) {
$actions[] = $this->getDeleteAction()
- ->addData('item-id', $accountActionsDto->getAccountId());
+ ->addData('item-id', $accountActionsDto->getAccountId());
}
if ($accountActionsDto->isHistory() === false
@@ -300,14 +300,14 @@ final class AccountActionsHelper extends HelperBase
if ($accountAcl->isShowViewPass()) {
if ($accountActionsDto->isHistory()) {
$actionViewPass = $this->getViewPassHistoryAction()
- ->addData('item-id', $accountActionsDto->getAccountHistoryId());
+ ->addData('item-id', $accountActionsDto->getAccountHistoryId());
$actionCopy = $this->getCopyPassHistoryAction()
- ->addData('item-id', $accountActionsDto->getAccountHistoryId());
+ ->addData('item-id', $accountActionsDto->getAccountHistoryId());
} else {
$actionViewPass = $this->getViewPassAction()
- ->addData('item-id', $accountActionsDto->getAccountId());
+ ->addData('item-id', $accountActionsDto->getAccountId());
$actionCopy = $this->getCopyPassAction()
- ->addData('item-id', $accountActionsDto->getAccountId());
+ ->addData('item-id', $accountActionsDto->getAccountId());
}
$actionViewPass->addData('parent-id', $accountActionsDto->getAccountParentId());
@@ -319,7 +319,7 @@ final class AccountActionsHelper extends HelperBase
if ($accountAcl->isShowCopy()) {
$actions[] = $this->getCopyAction()
- ->addData('item-id', $accountActionsDto->getAccountId());
+ ->addData('item-id', $accountActionsDto->getAccountId());
}
return $actions;
@@ -336,7 +336,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Remove Account'));
$action->setTitle(__('Remove Account'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconDelete());
+ $action->setIcon($this->icons->delete());
$action->setRuntimeFilter(AccountSearchItem::class, 'isShowDelete');
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_DELETE));
$action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_DELETE));
@@ -355,7 +355,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Update Public Link'));
$action->setTitle(__('Update Public Link'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconPublicLink());
+ $action->setIcon($this->icons->publicLink());
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::PUBLICLINK_REFRESH));
$action->addData('onclick', 'link/refresh');
$action->addData('action-next', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW));
@@ -369,7 +369,7 @@ final class AccountActionsHelper extends HelperBase
*/
public function getPublicLinkDeleteAction(): DataGridAction
{
- $icon = clone $this->icons->getIconPublicLink();
+ $icon = clone $this->icons->publicLink();
$icon->setIcon('link_off');
$action = new DataGridAction();
@@ -396,7 +396,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Create Public Link'));
$action->setTitle(__('Create Public Link'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconPublicLink());
+ $action->setIcon($this->icons->publicLink());
$action->addData('action-route', 'publicLink/saveCreateFromAccount');
$action->addData('onclick', 'link/save');
$action->addData('action-next', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW));
@@ -416,7 +416,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('View password'));
$action->setTitle(__('View password'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconViewPass());
+ $action->setIcon($this->icons->viewPass());
$action->setRuntimeFilter(AccountSearchItem::class, 'isShowViewPass');
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_HISTORY_VIEW_PASS));
$action->addData('action-full', 1);
@@ -438,7 +438,7 @@ final class AccountActionsHelper extends HelperBase
$action->setTitle(__('Copy Password to Clipboard'));
$action->addClass('btn-action');
$action->addClass('clip-pass-button');
- $action->setIcon($this->icons->getIconClipboard());
+ $action->setIcon($this->icons->clipboard());
$action->setRuntimeFilter(AccountSearchItem::class, 'isShowCopyPass');
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_HISTORY_COPY_PASS));
$action->addData('action-full', 0);
@@ -459,7 +459,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('View password'));
$action->setTitle(__('View password'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconViewPass());
+ $action->setIcon($this->icons->viewPass());
$action->setRuntimeFilter(AccountSearchItem::class, 'isShowViewPass');
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW_PASS));
$action->addData('action-full', 1);
@@ -481,7 +481,7 @@ final class AccountActionsHelper extends HelperBase
$action->setTitle(__('Copy Password to Clipboard'));
$action->addClass('btn-action');
$action->addClass('clip-pass-button');
- $action->setIcon($this->icons->getIconClipboard());
+ $action->setIcon($this->icons->clipboard());
$action->setRuntimeFilter(AccountSearchItem::class, 'isShowCopyPass');
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_COPY_PASS));
$action->addData('action-full', 0);
@@ -502,7 +502,7 @@ final class AccountActionsHelper extends HelperBase
$action->setName(__('Copy Account'));
$action->setTitle(__('Copy Account'));
$action->addClass('btn-action');
- $action->setIcon($this->icons->getIconCopy());
+ $action->setIcon($this->icons->copy());
$action->setRuntimeFilter(AccountSearchItem::class, 'isShowCopy');
$action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_COPY));
$action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_COPY));
diff --git a/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php
index 3c4208c5..c98e1807 100644
--- a/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php
+++ b/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php
@@ -34,6 +34,7 @@ use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SPException;
use SP\DataModel\ProfileData;
use SP\DataModel\UserPreferencesData;
+use SP\Domain\Account\Ports\AccountSearchServiceInterface;
use SP\Domain\Account\Search\AccountSearchConstants;
use SP\Domain\Account\Search\AccountSearchFilter;
use SP\Domain\Account\Services\AccountSearchItem;
@@ -68,20 +69,20 @@ final class AccountSearchHelper extends HelperBase
private bool $isIndex;
private ?AccountSearchFilter $accountSearchFilter = null;
private ClientServiceInterface $clientService;
- private \SP\Domain\Account\Ports\AccountSearchServiceInterface $accountSearchService;
+ private AccountSearchServiceInterface $accountSearchService;
private AccountActionsHelper $accountActionsHelper;
private CategoryServiceInterface $categoryService;
private TagServiceInterface $tagService;
public function __construct(
- Application $application,
- TemplateInterface $template,
- RequestInterface $request,
- ClientServiceInterface $clientService,
- CategoryServiceInterface $categoryService,
- TagServiceInterface $tagService,
- \SP\Domain\Account\Ports\AccountSearchServiceInterface $accountSearchService,
- AccountActionsHelper $accountActionsHelper
+ Application $application,
+ TemplateInterface $template,
+ RequestInterface $request,
+ ClientServiceInterface $clientService,
+ CategoryServiceInterface $categoryService,
+ TagServiceInterface $tagService,
+ AccountSearchServiceInterface $accountSearchService,
+ AccountActionsHelper $accountActionsHelper
) {
parent::__construct($application, $template, $request);
@@ -96,11 +97,76 @@ final class AccountSearchHelper extends HelperBase
$this->setVars();
}
+ /**
+ * Establecer las variables necesarias para las plantillas
+ */
+ private function setVars(): void
+ {
+ $userData = $this->context->getUserData();
+
+ $this->view->assign('isAdmin', $userData->getIsAdminApp() || $userData->getIsAdminAcc());
+
+ $profileData = $this->context->getUserProfile() ?? new ProfileData();
+
+ $this->view->assign(
+ 'showGlobalSearch',
+ $this->configData->isGlobalSearch() && $profileData->isAccGlobalSearch()
+ );
+
+ $this->accountSearchFilter = $this->getFilters();
+
+ $this->view->assign('searchCustomer', $this->accountSearchFilter->getClientId());
+ $this->view->assign('searchCategory', $this->accountSearchFilter->getCategoryId());
+ $this->view->assign('searchTags', $this->accountSearchFilter->getTagsId());
+ $this->view->assign('searchTxt', $this->accountSearchFilter->getTxtSearch());
+ $this->view->assign('searchGlobal', $this->accountSearchFilter->getGlobalSearch());
+ $this->view->assign('searchFavorites', $this->accountSearchFilter->isSearchFavorites());
+ $this->view->assign('searchRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_SEARCH));
+ $this->view->assign('favoriteRouteOn', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FAVORITE_ADD));
+ $this->view->assign('favoriteRouteOff', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FAVORITE_DELETE));
+ $this->view->assign('viewAccountRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW));
+ }
+
+ /**
+ * Set search filters
+ *
+ * @return AccountSearchFilter
+ */
+ private function getFilters(): AccountSearchFilter
+ {
+ $accountSearchFilter = $this->context->getSearchFilters();
+
+ // Return search filters from session if accessed from menu
+ if ($accountSearchFilter !== null && $this->isIndex) {
+ return $accountSearchFilter;
+ }
+
+ $userPreferences = $this->context->getUserData()->getPreferences() ?? new UserPreferencesData();
+ $limitCount = $userPreferences->getResultsPerPage() > 0
+ ? $userPreferences->getResultsPerPage()
+ : $this->configData->getAccountCount();
+
+ $accountSearchFilter = new AccountSearchFilter();
+ $accountSearchFilter->setSortKey($this->request->analyzeInt('skey', 0));
+ $accountSearchFilter->setSortOrder($this->request->analyzeInt('sorder', 0));
+ $accountSearchFilter->setLimitStart($this->request->analyzeInt('start', 0));
+ $accountSearchFilter->setLimitCount($this->request->analyzeInt('rpp', $limitCount));
+ $accountSearchFilter->setGlobalSearch($this->request->analyzeBool('gsearch', false));
+ $accountSearchFilter->setClientId($this->request->analyzeInt('client'));
+ $accountSearchFilter->setCategoryId($this->request->analyzeInt('category'));
+ $accountSearchFilter->setTagsId($this->request->analyzeArray('tags', null, []));
+ $accountSearchFilter->setSearchFavorites($this->request->analyzeBool('searchfav', false));
+ $accountSearchFilter->setTxtSearch($this->request->analyzeString('search'));
+ $accountSearchFilter->setSortViews($userPreferences->isSortViews());
+
+ return $accountSearchFilter;
+ }
+
/**
* Obtener los datos para la caja de búsqueda
*
- * @throws \SP\Core\Exceptions\ConstraintException
- * @throws \SP\Core\Exceptions\QueryException
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getSearchBox(): void
{
@@ -109,19 +175,19 @@ final class AccountSearchHelper extends HelperBase
$this->view->assign(
'clients',
SelectItemAdapter::factory($this->clientService->getAllForUser())
- ->getItemsFromModelSelected(
- [$this->accountSearchFilter->getClientId()]
- )
+ ->getItemsFromModelSelected(
+ [$this->accountSearchFilter->getClientId()]
+ )
);
$this->view->assign(
'categories',
SelectItemAdapter::factory($this->categoryService->getAllBasic())
- ->getItemsFromModelSelected([$this->accountSearchFilter->getCategoryId()])
+ ->getItemsFromModelSelected([$this->accountSearchFilter->getCategoryId()])
);
$this->view->assign(
'tags',
SelectItemAdapter::factory($this->tagService->getAllBasic())
- ->getItemsFromModelSelected($this->accountSearchFilter->getTagsId())
+ ->getItemsFromModelSelected($this->accountSearchFilter->getTagsId())
);
}
@@ -203,7 +269,7 @@ final class AccountSearchHelper extends HelperBase
$gridActionOptional->setId(0);
$gridActionOptional->setName(__('More Actions'));
$gridActionOptional->setTitle(__('More Actions'));
- $gridActionOptional->setIcon($icons->getIconOptional());
+ $gridActionOptional->setIcon($icons->optional());
$gridActionOptional->setRuntimeFilter(
AccountSearchItem::class,
'isShowOptional'
@@ -211,10 +277,10 @@ final class AccountSearchHelper extends HelperBase
$gridActionOptional->addData('onclick', 'account/menu');
$gridPager = new DataGridPager();
- $gridPager->setIconPrev($icons->getIconNavPrev());
- $gridPager->setIconNext($icons->getIconNavNext());
- $gridPager->setIconFirst($icons->getIconNavFirst());
- $gridPager->setIconLast($icons->getIconNavLast());
+ $gridPager->setIconPrev($icons->navPrev());
+ $gridPager->setIconNext($icons->navNext());
+ $gridPager->setIconFirst($icons->navFirst());
+ $gridPager->setIconLast($icons->navLast());
$gridPager->setSortKey($this->accountSearchFilter->getSortKey());
$gridPager->setSortOrder($this->accountSearchFilter->getSortOrder());
$gridPager->setLimitStart($this->accountSearchFilter->getLimitStart());
@@ -274,111 +340,46 @@ final class AccountSearchHelper extends HelperBase
$gridSortCustomer = new DataGridSort();
$gridSortCustomer->setName(__('Client'))
- ->setTitle(__('Sort by Client'))
- ->setSortKey(AccountSearchConstants::SORT_CLIENT)
- ->setIconUp($icons->getIconUp())
- ->setIconDown($icons->getIconDown());
+ ->setTitle(__('Sort by Client'))
+ ->setSortKey(AccountSearchConstants::SORT_CLIENT)
+ ->setIconUp($icons->up())
+ ->setIconDown($icons->down());
$gridSortName = new DataGridSort();
$gridSortName->setName(__('Name'))
- ->setTitle(__('Sort by Name'))
- ->setSortKey(AccountSearchConstants::SORT_NAME)
- ->setIconUp($icons->getIconUp())
- ->setIconDown($icons->getIconDown());
+ ->setTitle(__('Sort by Name'))
+ ->setSortKey(AccountSearchConstants::SORT_NAME)
+ ->setIconUp($icons->up())
+ ->setIconDown($icons->down());
$gridSortCategory = new DataGridSort();
$gridSortCategory->setName(__('Category'))
- ->setTitle(__('Sort by Category'))
- ->setSortKey(AccountSearchConstants::SORT_CATEGORY)
- ->setIconUp($icons->getIconUp())
- ->setIconDown($icons->getIconDown());
+ ->setTitle(__('Sort by Category'))
+ ->setSortKey(AccountSearchConstants::SORT_CATEGORY)
+ ->setIconUp($icons->up())
+ ->setIconDown($icons->down());
$gridSortLogin = new DataGridSort();
$gridSortLogin->setName(__('User'))
- ->setTitle(__('Sort by Username'))
- ->setSortKey(AccountSearchConstants::SORT_LOGIN)
- ->setIconUp($icons->getIconUp())
- ->setIconDown($icons->getIconDown());
+ ->setTitle(__('Sort by Username'))
+ ->setSortKey(AccountSearchConstants::SORT_LOGIN)
+ ->setIconUp($icons->up())
+ ->setIconDown($icons->down());
$gridSortUrl = new DataGridSort();
$gridSortUrl->setName(__('URL / IP'))
- ->setTitle(__('Sort by URL / IP'))
- ->setSortKey(AccountSearchConstants::SORT_URL)
- ->setIconUp($icons->getIconUp())
- ->setIconDown($icons->getIconDown());
+ ->setTitle(__('Sort by URL / IP'))
+ ->setSortKey(AccountSearchConstants::SORT_URL)
+ ->setIconUp($icons->up())
+ ->setIconDown($icons->down());
$gridHeaderSort = new DataGridHeaderSort();
$gridHeaderSort->addSortField($gridSortCustomer)
- ->addSortField($gridSortName)
- ->addSortField($gridSortCategory)
- ->addSortField($gridSortLogin)
- ->addSortField($gridSortUrl);
+ ->addSortField($gridSortName)
+ ->addSortField($gridSortCategory)
+ ->addSortField($gridSortLogin)
+ ->addSortField($gridSortUrl);
return $gridHeaderSort;
}
-
- /**
- * Establecer las variables necesarias para las plantillas
- */
- private function setVars(): void
- {
- $userData = $this->context->getUserData();
-
- $this->view->assign('isAdmin', $userData->getIsAdminApp() || $userData->getIsAdminAcc());
-
- $profileData = $this->context->getUserProfile() ?? new ProfileData();
-
- $this->view->assign(
- 'showGlobalSearch',
- $this->configData->isGlobalSearch() && $profileData->isAccGlobalSearch()
- );
-
- $this->accountSearchFilter = $this->getFilters();
-
- $this->view->assign('searchCustomer', $this->accountSearchFilter->getClientId());
- $this->view->assign('searchCategory', $this->accountSearchFilter->getCategoryId());
- $this->view->assign('searchTags', $this->accountSearchFilter->getTagsId());
- $this->view->assign('searchTxt', $this->accountSearchFilter->getTxtSearch());
- $this->view->assign('searchGlobal', $this->accountSearchFilter->getGlobalSearch());
- $this->view->assign('searchFavorites', $this->accountSearchFilter->isSearchFavorites());
- $this->view->assign('searchRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_SEARCH));
- $this->view->assign('favoriteRouteOn', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FAVORITE_ADD));
- $this->view->assign('favoriteRouteOff', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FAVORITE_DELETE));
- $this->view->assign('viewAccountRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW));
- }
-
- /**
- * Set search filters
- *
- * @return \SP\Domain\Account\Search\AccountSearchFilter
- */
- private function getFilters(): AccountSearchFilter
- {
- $accountSearchFilter = $this->context->getSearchFilters();
-
- // Return search filters from session if accessed from menu
- if ($accountSearchFilter !== null && $this->isIndex) {
- return $accountSearchFilter;
- }
-
- $userPreferences = $this->context->getUserData()->getPreferences() ?? new UserPreferencesData();
- $limitCount = $userPreferences->getResultsPerPage() > 0
- ? $userPreferences->getResultsPerPage()
- : $this->configData->getAccountCount();
-
- $accountSearchFilter = new AccountSearchFilter();
- $accountSearchFilter->setSortKey($this->request->analyzeInt('skey', 0));
- $accountSearchFilter->setSortOrder($this->request->analyzeInt('sorder', 0));
- $accountSearchFilter->setLimitStart($this->request->analyzeInt('start', 0));
- $accountSearchFilter->setLimitCount($this->request->analyzeInt('rpp', $limitCount));
- $accountSearchFilter->setGlobalSearch($this->request->analyzeBool('gsearch', false));
- $accountSearchFilter->setClientId($this->request->analyzeInt('client'));
- $accountSearchFilter->setCategoryId($this->request->analyzeInt('category'));
- $accountSearchFilter->setTagsId($this->request->analyzeArray('tags', null, []));
- $accountSearchFilter->setSearchFavorites($this->request->analyzeBool('searchfav', false));
- $accountSearchFilter->setTxtSearch($this->request->analyzeString('search'));
- $accountSearchFilter->setSortViews($userPreferences->isSortViews());
-
- return $accountSearchFilter;
- }
}
diff --git a/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php b/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php
index 323b96d8..ea132759 100644
--- a/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php
@@ -68,15 +68,17 @@ final class AccountGrid extends GridBase
$grid->addDataAction(
$this->getBulkEditAction()
- ->setIsSelection(true),
- true);
+ ->setIsSelection(true),
+ true
+ );
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
- true);
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
+ true
+ );
$grid->setTime(round(getElapsedTime($this->queryTimeStart), 5));
@@ -163,7 +165,7 @@ final class AccountGrid extends GridBase
$gridAction->setType(DataGridActionType::VIEW_ITEM);
$gridAction->setName(__('Account Details'));
$gridAction->setTitle(__('Account Details'));
- $gridAction->setIcon($this->icons->getIconView());
+ $gridAction->setIcon($this->icons->view());
$gridAction->setOnClickFunction(Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW));
$gridAction->addData(
'action-route',
@@ -183,7 +185,7 @@ final class AccountGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Remove Account'));
$gridAction->setTitle(__('Remove Account'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
@@ -203,7 +205,7 @@ final class AccountGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Bulk Update'));
$gridAction->setTitle(__('Bulk Update'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php b/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php
index 6352e519..c2ea22f2 100644
--- a/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php
@@ -64,10 +64,11 @@ final class AccountHistoryGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
- true);
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
+ true
+ );
$grid->setTime(round(getElapsedTime($this->queryTimeStart), 5));
@@ -113,8 +114,8 @@ final class AccountHistoryGrid extends GridBase
protected function getData(): DataGridData
{
// Grid Data
- $iconEdit = clone $this->icons->getIconEdit();
- $iconDelete = clone $this->icons->getIconDelete();
+ $iconEdit = clone $this->icons->edit();
+ $iconDelete = clone $this->icons->delete();
// Grid Data
$gridData = new DataGridData();
@@ -126,12 +127,12 @@ final class AccountHistoryGrid extends GridBase
$gridData->addDataRowSourceWithIcon(
'isModify',
$iconEdit->setTitle(__('Modified'))
- ->setClass('opacity50')
+ ->setClass('opacity50')
);
$gridData->addDataRowSourceWithIcon(
'isDeleted',
$iconDelete->setTitle(__('Removed'))
- ->setClass('opacity50')
+ ->setClass('opacity50')
);
$gridData->setData($this->queryResult);
@@ -167,7 +168,7 @@ final class AccountHistoryGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Account Restore'));
$gridAction->setTitle(__('Account Restore'));
- $gridAction->setIcon($this->icons->getIconRestore());
+ $gridAction->setIcon($this->icons->restore());
$gridAction->setOnClickFunction('accountManager/restore');
$gridAction->addData(
'action-route',
@@ -187,7 +188,7 @@ final class AccountHistoryGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Remove Account'));
$gridAction->setTitle(__('Remove Account'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php b/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php
index 945281ec..683706ec 100644
--- a/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php
@@ -67,10 +67,11 @@ final class AuthTokenGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
- true);
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
+ true
+ );
$grid->setTime(round(getElapsedTime($this->queryTimeStart), 5));
@@ -158,7 +159,7 @@ final class AuthTokenGrid extends GridBase
$gridAction->setType(DataGridActionType::MENUBAR_ITEM);
$gridAction->setName(__('New Authorization'));
$gridAction->setTitle(__('New Authorization'));
- $gridAction->setIcon($this->icons->getIconAdd());
+ $gridAction->setIcon($this->icons->add());
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
@@ -179,7 +180,7 @@ final class AuthTokenGrid extends GridBase
$gridAction->setType(DataGridActionType::VIEW_ITEM);
$gridAction->setName(__('View Authorization token'));
$gridAction->setTitle(__('View Authorization token'));
- $gridAction->setIcon($this->icons->getIconView());
+ $gridAction->setIcon($this->icons->view());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -199,7 +200,7 @@ final class AuthTokenGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Edit Authorization'));
$gridAction->setTitle(__('Edit Authorization'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -219,7 +220,7 @@ final class AuthTokenGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Authorization'));
$gridAction->setTitle(__('Delete Authorization'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php b/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php
index abcb585f..23ca092e 100644
--- a/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php
@@ -66,10 +66,11 @@ final class CategoryGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
- true);
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
+ true
+ );
$grid->setTime(round(getElapsedTime($this->queryTimeStart), 5));
@@ -151,7 +152,7 @@ final class CategoryGrid extends GridBase
$gridAction->setType(DataGridActionType::MENUBAR_ITEM);
$gridAction->setName(__('New Category'));
$gridAction->setTitle(__('New Category'));
- $gridAction->setIcon($this->icons->getIconAdd());
+ $gridAction->setIcon($this->icons->add());
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
@@ -172,7 +173,7 @@ final class CategoryGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Edit Category'));
$gridAction->setTitle(__('Edit Category'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -192,7 +193,7 @@ final class CategoryGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Category'));
$gridAction->setTitle(__('Delete Category'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php b/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php
index 3b20a70b..e9c0c371 100644
--- a/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php
@@ -65,10 +65,11 @@ final class ClientGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
- true);
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
+ true
+ );
$grid->setTime(round(getElapsedTime($this->queryTimeStart), 5));
@@ -158,7 +159,7 @@ final class ClientGrid extends GridBase
$gridAction->setType(DataGridActionType::MENUBAR_ITEM);
$gridAction->setName(__('New Client'));
$gridAction->setTitle(__('New Client'));
- $gridAction->setIcon($this->icons->getIconAdd());
+ $gridAction->setIcon($this->icons->add());
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
@@ -179,7 +180,7 @@ final class ClientGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Edit Client'));
$gridAction->setTitle(__('Edit Client'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -199,7 +200,7 @@ final class ClientGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Client'));
$gridAction->setTitle(__('Delete Client'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php b/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php
index 18e6613c..eb583841 100644
--- a/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php
@@ -66,10 +66,11 @@ final class CustomFieldGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
- true);
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
+ true
+ );
$grid->setTime(round(getElapsedTime($this->queryTimeStart), 5));
@@ -128,7 +129,7 @@ final class CustomFieldGrid extends GridBase
$gridData->addDataRowSource('typeName');
$gridData->addDataRowSourceWithIcon(
'isEncrypted',
- $this->icons->getIconEditPass()->setTitle(__('Encrypted'))
+ $this->icons->editPass()->setTitle(__('Encrypted'))
);
$gridData->setData($this->queryResult);
@@ -165,7 +166,7 @@ final class CustomFieldGrid extends GridBase
$gridAction->setType(DataGridActionType::MENUBAR_ITEM);
$gridAction->setName(__('New Field'));
$gridAction->setTitle(__('New Field'));
- $gridAction->setIcon($this->icons->getIconAdd());
+ $gridAction->setIcon($this->icons->add());
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
@@ -186,7 +187,7 @@ final class CustomFieldGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Edit Field'));
$gridAction->setTitle(__('Edit Field'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -206,7 +207,7 @@ final class CustomFieldGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Field'));
$gridAction->setTitle(__('Delete Field'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php b/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php
index 7dcfe0ad..d18ec8e1 100644
--- a/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php
@@ -119,10 +119,13 @@ final class EventlogGrid extends GridBase
$gridData->addDataRowSource('level');
$gridData->addDataRowSource('action', null, null, false);
$gridData->addDataRowSource('login');
- $gridData->addDataRowSource('ipAddress', false,
+ $gridData->addDataRowSource(
+ 'ipAddress',
+ false,
function ($value) use ($isDemoMode) {
return $isDemoMode ? '*.*.*.*' : $value;
- });
+ }
+ );
$gridData->addDataRowSource(
'description',
false,
@@ -137,10 +140,11 @@ final class EventlogGrid extends GridBase
if (preg_match('/^SQL.*/m', $value)) {
$value = preg_replace([
- '/([a-zA-Z_]+),/m',
- '/(UPDATE|DELETE|TRUNCATE|INSERT|SELECT|WHERE|LEFT|ORDER|LIMIT|FROM)/m'],
- ['\\1,
', '
\\1'],
- $value
+ '/([a-zA-Z_]+),/m',
+ '/(UPDATE|DELETE|TRUNCATE|INSERT|SELECT|WHERE|LEFT|ORDER|LIMIT|FROM)/m'
+ ],
+ ['\\1,
', '
\\1'],
+ $value
);
}
@@ -189,7 +193,7 @@ final class EventlogGrid extends GridBase
$gridAction->setSkip(true);
$gridAction->setName(__('Refresh'));
$gridAction->setTitle(__('Refresh'));
- $gridAction->setIcon($this->icons->getIconRefresh());
+ $gridAction->setIcon($this->icons->refresh());
$gridAction->setOnClickFunction('eventlog/refresh');
$gridAction->addData('action-form', 'frmSearchEvent');
$gridAction->addData(
@@ -211,7 +215,7 @@ final class EventlogGrid extends GridBase
$gridAction->setSkip(true);
$gridAction->setName(__('Clear the event log out'));
$gridAction->setTitle(__('Clear the event log out'));
- $gridAction->setIcon($this->icons->getIconClear());
+ $gridAction->setIcon($this->icons->clear());
$gridAction->setOnClickFunction('eventlog/clear');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/FileGrid.php b/app/modules/web/Controllers/Helpers/Grid/FileGrid.php
index d0b6a116..a73bde4c 100644
--- a/app/modules/web/Controllers/Helpers/Grid/FileGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/FileGrid.php
@@ -65,10 +65,11 @@ final class FileGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
- true);
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
+ true
+ );
$grid->setTime(round(getElapsedTime($this->queryTimeStart), 5));
@@ -163,7 +164,7 @@ final class FileGrid extends GridBase
$gridAction->setType(DataGridActionType::VIEW_ITEM);
$gridAction->setName(__('View File'));
$gridAction->setTitle(__('View File'));
- $gridAction->setIcon($this->icons->getIconView());
+ $gridAction->setIcon($this->icons->view());
$gridAction->setOnClickFunction('file/view');
$gridAction->setFilterRowSource('type', 'application/pdf');
$gridAction->addData(
@@ -184,7 +185,7 @@ final class FileGrid extends GridBase
$gridAction->setType(DataGridActionType::VIEW_ITEM);
$gridAction->setName(__('Download File'));
$gridAction->setTitle(__('Download File'));
- $gridAction->setIcon($this->icons->getIconDownload());
+ $gridAction->setIcon($this->icons->download());
$gridAction->setOnClickFunction('file/download');
$gridAction->addData(
'action-route',
@@ -209,7 +210,7 @@ final class FileGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete File'));
$gridAction->setTitle(__('Delete File'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/GridBase.php b/app/modules/web/Controllers/Helpers/Grid/GridBase.php
index bba6c7ce..e741a2ff 100644
--- a/app/modules/web/Controllers/Helpers/Grid/GridBase.php
+++ b/app/modules/web/Controllers/Helpers/Grid/GridBase.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -52,7 +52,7 @@ abstract class GridBase extends HelperBase implements GridInterface
Application $application,
TemplateInterface $template,
RequestInterface $request,
- Acl $acl
+ Acl $acl
) {
parent::__construct($application, $template, $request);
@@ -65,8 +65,8 @@ abstract class GridBase extends HelperBase implements GridInterface
/**
* Actualizar los datos del paginador
*
- * @param DataGridInterface $dataGrid
- * @param ItemSearchData $itemSearchData
+ * @param DataGridInterface $dataGrid
+ * @param ItemSearchData $itemSearchData
*
* @return DataGridInterface
*/
@@ -75,9 +75,9 @@ abstract class GridBase extends HelperBase implements GridInterface
ItemSearchData $itemSearchData
): DataGridInterface {
$dataGrid->getPager()
- ->setLimitStart($itemSearchData->getLimitStart())
- ->setLimitCount($itemSearchData->getLimitCount())
- ->setFilterOn(!empty($itemSearchData->getSeachString()));
+ ->setLimitStart($itemSearchData->getLimitStart())
+ ->setLimitCount($itemSearchData->getLimitCount())
+ ->setFilterOn(!empty($itemSearchData->getSeachString()));
$dataGrid->updatePager();
@@ -87,7 +87,7 @@ abstract class GridBase extends HelperBase implements GridInterface
/**
* Devolver el paginador por defecto
*
- * @param DataGridActionSearch $sourceAction
+ * @param DataGridActionSearch $sourceAction
*
* @return DataGridPager
*/
@@ -99,10 +99,10 @@ abstract class GridBase extends HelperBase implements GridInterface
$gridPager->setOnClickFunction('appMgmt/nav');
$gridPager->setLimitStart(0);
$gridPager->setLimitCount($this->configData->getAccountCount());
- $gridPager->setIconPrev($this->icons->getIconNavPrev());
- $gridPager->setIconNext($this->icons->getIconNavNext());
- $gridPager->setIconFirst($this->icons->getIconNavFirst());
- $gridPager->setIconLast($this->icons->getIconNavLast());
+ $gridPager->setIconPrev($this->icons->navPrev());
+ $gridPager->setIconNext($this->icons->navNext());
+ $gridPager->setIconFirst($this->icons->navFirst());
+ $gridPager->setIconLast($this->icons->navLast());
return $gridPager;
}
@@ -121,4 +121,4 @@ abstract class GridBase extends HelperBase implements GridInterface
* @return DataGridData
*/
abstract protected function getData(): DataGridData;
-}
\ No newline at end of file
+}
diff --git a/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php b/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php
index 071062a2..a4e38caa 100644
--- a/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php
@@ -69,10 +69,11 @@ final class ItemPresetGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setTitle(__('Delete Selected'))
- ->setName(__('Delete Selected'))
- ->setIsSelection(true),
- true);
+ ->setTitle(__('Delete Selected'))
+ ->setName(__('Delete Selected'))
+ ->setIsSelection(true),
+ true
+ );
$grid->setTime(round(getElapsedTime($this->queryTimeStart), 5));
@@ -126,7 +127,7 @@ final class ItemPresetGrid extends GridBase
$gridData->addDataRowSource('userGroupName');
$gridData->addDataRowSource('userProfileName');
$gridData->addDataRowSource('priority');
- $gridData->addDataRowSourceWithIcon('fixed', $this->icons->getIconEnabled());
+ $gridData->addDataRowSourceWithIcon('fixed', $this->icons->enabled());
$gridData->setData($this->queryResult);
return $gridData;
@@ -163,13 +164,14 @@ final class ItemPresetGrid extends GridBase
$gridAction->setName(__('Permission Preset'));
$gridAction->setTitle(__('New Permission Preset'));
- $icon = clone $this->icons->getIconAdd();
+ $icon = clone $this->icons->add();
$gridAction->setIcon($icon->setIcon('add_circle'));
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
- $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PERMISSION;
+ $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' .
+ ItemPresetInterface::ITEM_TYPE_ACCOUNT_PERMISSION;
$gridAction->addData('action-route', $route);
@@ -187,13 +189,14 @@ final class ItemPresetGrid extends GridBase
$gridAction->setName(__('Private Account Preset'));
$gridAction->setTitle(__('New Private Account Preset'));
- $icon = clone $this->icons->getIconAdd();
+ $icon = clone $this->icons->add();
$gridAction->setIcon($icon->setIcon('add_circle'));
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
- $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PRIVATE;
+ $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' .
+ ItemPresetInterface::ITEM_TYPE_ACCOUNT_PRIVATE;
$gridAction->addData('action-route', $route);
@@ -211,13 +214,14 @@ final class ItemPresetGrid extends GridBase
$gridAction->setName(__('Session Timeout Preset'));
$gridAction->setTitle(__('New Session Timeout Preset'));
- $icon = clone $this->icons->getIconAdd();
+ $icon = clone $this->icons->add();
$gridAction->setIcon($icon->setIcon('add_circle'));
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
- $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_SESSION_TIMEOUT;
+ $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' .
+ ItemPresetInterface::ITEM_TYPE_SESSION_TIMEOUT;
$gridAction->addData('action-route', $route);
@@ -235,13 +239,14 @@ final class ItemPresetGrid extends GridBase
$gridAction->setName(__('Account Password Preset'));
$gridAction->setTitle(__('New Account Password Preset'));
- $icon = clone $this->icons->getIconAdd();
+ $icon = clone $this->icons->add();
$gridAction->setIcon($icon->setIcon('add_circle'));
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
- $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PASSWORD;
+ $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' .
+ ItemPresetInterface::ITEM_TYPE_ACCOUNT_PASSWORD;
$gridAction->addData('action-route', $route);
@@ -258,7 +263,7 @@ final class ItemPresetGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Edit Value'));
$gridAction->setTitle(__('Edit Value'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -278,7 +283,7 @@ final class ItemPresetGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Value'));
$gridAction->setTitle(__('Delete Value'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php b/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php
index 475c07c6..2bd730b5 100644
--- a/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php
@@ -82,10 +82,12 @@ final class NotificationGrid extends GridBase
$grid->addDataAction(
$this->setNonAdminFilter(
$this->getDeleteAction()
- ->setTitle(__('Delete Selected'))
- ->setName(__('Delete Selected'))
- ->setIsSelection(true)),
- true);
+ ->setTitle(__('Delete Selected'))
+ ->setName(__('Delete Selected'))
+ ->setIsSelection(true)
+ ),
+ true
+ );
$grid->setTime(round(getElapsedTime($this->queryTimeStart), 5));
@@ -153,15 +155,15 @@ final class NotificationGrid extends GridBase
);
$gridData->addDataRowSourceWithIcon(
'checked',
- $this->icons->getIconEnabled()->setTitle(__('Read'))
+ $this->icons->enabled()->setTitle(__('Read'))
);
$gridData->addDataRowSourceWithIcon(
'onlyAdmin',
- $this->icons->getIconAppAdmin()->setTitle(__('Only Admins'))
+ $this->icons->appAdmin()->setTitle(__('Only Admins'))
);
$gridData->addDataRowSourceWithIcon(
'sticky',
- $this->icons->getIconGroup()->setTitle(__('Global'))
+ $this->icons->group()->setTitle(__('Global'))
);
$gridData->setData($this->queryResult);
@@ -198,7 +200,7 @@ final class NotificationGrid extends GridBase
$gridAction->setType(DataGridActionType::MENUBAR_ITEM);
$gridAction->setName(__('New Notification'));
$gridAction->setTitle(__('New Notification'));
- $gridAction->setIcon($this->icons->getIconAdd());
+ $gridAction->setIcon($this->icons->add());
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('notification/show');
$gridAction->addData(
@@ -219,7 +221,7 @@ final class NotificationGrid extends GridBase
$gridAction->setType(DataGridActionType::VIEW_ITEM);
$gridAction->setName(__('View Notification'));
$gridAction->setTitle(__('View Notification'));
- $gridAction->setIcon($this->icons->getIconView());
+ $gridAction->setIcon($this->icons->view());
$gridAction->setOnClickFunction('notification/show');
$gridAction->addData(
'action-route',
@@ -236,8 +238,7 @@ final class NotificationGrid extends GridBase
*/
private function setNonAdminFilter(
DataGridActionInterface $gridAction
- ): DataGridActionInterface
- {
+ ): DataGridActionInterface {
if (!$this->isAdminApp) {
$gridAction->setFilterRowSource('sticky');
}
@@ -254,7 +255,7 @@ final class NotificationGrid extends GridBase
$gridAction->setId(AclActionsInterface::NOTIFICATION_CHECK);
$gridAction->setName(__('Checkout Notification'));
$gridAction->setTitle(__('Checkout Notification'));
- $gridAction->setIcon($this->icons->getIconEnabled());
+ $gridAction->setIcon($this->icons->enabled());
$gridAction->setOnClickFunction('notification/check');
$gridAction->setFilterRowSource('checked');
$gridAction->addData(
@@ -278,7 +279,7 @@ final class NotificationGrid extends GridBase
$gridAction->setId(AclActionsInterface::NOTIFICATION_EDIT);
$gridAction->setName(__('Edit Notification'));
$gridAction->setTitle(__('Edit Notification'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('notification/show');
$gridAction->addData(
'action-route',
@@ -298,7 +299,7 @@ final class NotificationGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Notification'));
$gridAction->setTitle(__('Delete Notification'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('notification/delete');
$gridAction->setFilterRowSource('checked', 0);
$gridAction->addData(
diff --git a/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php b/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php
index e510a290..43354eb4 100644
--- a/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php
@@ -113,16 +113,16 @@ final class PluginGrid extends GridBase
$gridData->addDataRowSource('name');
$gridData->addDataRowSourceWithIcon(
'enabled',
- $this->icons->getIconEnabled()
+ $this->icons->enabled()
);
$gridData->addDataRowSourceWithIcon(
'enabled',
- $this->icons->getIconDisabled(),
+ $this->icons->disabled(),
0
);
$gridData->addDataRowSourceWithIcon(
'available',
- $this->icons->getIconDelete()->setTitle(__('Unavailable')),
+ $this->icons->delete()->setTitle(__('Unavailable')),
0
);
$gridData->setData($this->queryResult);
@@ -160,7 +160,7 @@ final class PluginGrid extends GridBase
$gridAction->setType(DataGridActionType::VIEW_ITEM);
$gridAction->setName(__('View Plugin'));
$gridAction->setTitle(__('View Plugin'));
- $gridAction->setIcon($this->icons->getIconView());
+ $gridAction->setIcon($this->icons->view());
$gridAction->setOnClickFunction('plugin/show');
$gridAction->setFilterRowSource('available', 0);
$gridAction->addData(
@@ -180,7 +180,7 @@ final class PluginGrid extends GridBase
$gridAction->setId(AclActionsInterface::PLUGIN_ENABLE);
$gridAction->setName(__('Enable'));
$gridAction->setTitle(__('Enable'));
- $gridAction->setIcon($this->icons->getIconEnabled());
+ $gridAction->setIcon($this->icons->enabled());
$gridAction->setOnClickFunction('plugin/toggle');
$gridAction->setFilterRowSource('enabled');
$gridAction->setFilterRowSource('available', 0);
@@ -202,7 +202,7 @@ final class PluginGrid extends GridBase
$gridAction->setId(AclActionsInterface::PLUGIN_DISABLE);
$gridAction->setName(__('Disable'));
$gridAction->setTitle(__('Disable'));
- $gridAction->setIcon($this->icons->getIconDisabled());
+ $gridAction->setIcon($this->icons->disabled());
$gridAction->setOnClickFunction('plugin/toggle');
$gridAction->setFilterRowSource('enabled', 0);
$gridAction->setFilterRowSource('available', 0);
@@ -224,7 +224,7 @@ final class PluginGrid extends GridBase
$gridAction->setId(AclActionsInterface::PLUGIN_RESET);
$gridAction->setName(__('Reset Data'));
$gridAction->setTitle(__('Reset Data'));
- $gridAction->setIcon($this->icons->getIconRefresh());
+ $gridAction->setIcon($this->icons->refresh());
$gridAction->setOnClickFunction('plugin/reset');
$gridAction->setFilterRowSource('available', 0);
$gridAction->addData(
@@ -250,7 +250,7 @@ final class PluginGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Plugin'));
$gridAction->setTitle(__('Delete Plugin'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setFilterRowSource('available');
$gridAction->setOnClickFunction('plugin/delete');
$gridAction->addData(
diff --git a/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php b/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php
index 8c47bedb..b5772517 100644
--- a/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php
@@ -67,9 +67,9 @@ final class PublicLinkGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
true
);
@@ -170,7 +170,7 @@ final class PublicLinkGrid extends GridBase
$gridAction->setType(DataGridActionType::MENUBAR_ITEM);
$gridAction->setName(__('New Link'));
$gridAction->setTitle(__('New Link'));
- $gridAction->setIcon($this->icons->getIconAdd());
+ $gridAction->setIcon($this->icons->add());
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
@@ -191,7 +191,7 @@ final class PublicLinkGrid extends GridBase
$gridAction->setType(DataGridActionType::VIEW_ITEM);
$gridAction->setName(__('View Link'));
$gridAction->setTitle(__('View Link'));
- $gridAction->setIcon($this->icons->getIconView());
+ $gridAction->setIcon($this->icons->view());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -210,7 +210,7 @@ final class PublicLinkGrid extends GridBase
$gridAction->setId(AclActionsInterface::PUBLICLINK_REFRESH);
$gridAction->setName(__('Renew Link'));
$gridAction->setTitle(__('Renew Link'));
- $gridAction->setIcon($this->icons->getIconRefresh());
+ $gridAction->setIcon($this->icons->refresh());
$gridAction->setOnClickFunction('link/refresh');
$gridAction->addData(
'action-route',
@@ -230,7 +230,7 @@ final class PublicLinkGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Link'));
$gridAction->setTitle(__('Delete Link'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/TagGrid.php b/app/modules/web/Controllers/Helpers/Grid/TagGrid.php
index 111216fb..7d2ec3a1 100644
--- a/app/modules/web/Controllers/Helpers/Grid/TagGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/TagGrid.php
@@ -66,9 +66,9 @@ final class TagGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
true
);
@@ -150,7 +150,7 @@ final class TagGrid extends GridBase
$gridAction->setType(DataGridActionType::MENUBAR_ITEM);
$gridAction->setName(__('New Tag'));
$gridAction->setTitle(__('New Tag'));
- $gridAction->setIcon($this->icons->getIconAdd());
+ $gridAction->setIcon($this->icons->add());
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
@@ -171,7 +171,7 @@ final class TagGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Edit Tag'));
$gridAction->setTitle(__('Edit Tag'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -191,7 +191,7 @@ final class TagGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Tag'));
$gridAction->setTitle(__('Delete Tag'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php b/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php
index 023b5a54..3cd21409 100644
--- a/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php
@@ -190,7 +190,7 @@ final class TrackGrid extends GridBase
$gridAction->setSkip(true);
$gridAction->setName(__('Refresh'));
$gridAction->setTitle(__('Refresh'));
- $gridAction->setIcon($this->icons->getIconRefresh());
+ $gridAction->setIcon($this->icons->refresh());
$gridAction->setOnClickFunction('track/refresh');
$gridAction->addData('action-form', 'frmSearchTrack');
$gridAction->addData(
@@ -212,7 +212,7 @@ final class TrackGrid extends GridBase
$gridAction->setSkip(true);
$gridAction->setName(Acl::getActionInfo(AclActionsInterface::TRACK_CLEAR));
$gridAction->setTitle(Acl::getActionInfo(AclActionsInterface::TRACK_CLEAR));
- $gridAction->setIcon($this->icons->getIconClear());
+ $gridAction->setIcon($this->icons->clear());
$gridAction->setOnClickFunction('track/clear');
$gridAction->addData(
'action-route',
@@ -232,7 +232,7 @@ final class TrackGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(Acl::getActionInfo(AclActionsInterface::TRACK_UNLOCK));
$gridAction->setTitle(Acl::getActionInfo(AclActionsInterface::TRACK_UNLOCK));
- $gridAction->setIcon($this->icons->getIconCheck());
+ $gridAction->setIcon($this->icons->check());
$gridAction->setOnClickFunction('track/unlock');
$gridAction->setFilterRowSource('tracked', 0);
$gridAction->addData(
diff --git a/app/modules/web/Controllers/Helpers/Grid/UserGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserGrid.php
index 0e89e3aa..48fe2bbd 100644
--- a/app/modules/web/Controllers/Helpers/Grid/UserGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/UserGrid.php
@@ -68,9 +68,9 @@ final class UserGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
true
);
@@ -126,19 +126,19 @@ final class UserGrid extends GridBase
$gridData->addDataRowSource('userGroupName');
$gridData->addDataRowSourceWithIcon(
'isAdminApp',
- $this->icons->getIconAppAdmin()
+ $this->icons->appAdmin()
);
$gridData->addDataRowSourceWithIcon(
'isAdminAcc',
- $this->icons->getIconAccAdmin()
+ $this->icons->accAdmin()
);
$gridData->addDataRowSourceWithIcon(
'isLdap',
- $this->icons->getIconLdapUser()
+ $this->icons->ldapUser()
);
$gridData->addDataRowSourceWithIcon(
'isDisabled',
- $this->icons->getIconDisabled()
+ $this->icons->disabled()
);
$gridData->setData($this->queryResult);
@@ -175,7 +175,7 @@ final class UserGrid extends GridBase
$gridAction->setType(DataGridActionType::MENUBAR_ITEM);
$gridAction->setName(__('New User'));
$gridAction->setTitle(__('New User'));
- $gridAction->setIcon($this->icons->getIconAdd());
+ $gridAction->setIcon($this->icons->add());
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
@@ -196,7 +196,7 @@ final class UserGrid extends GridBase
$gridAction->setType(DataGridActionType::VIEW_ITEM);
$gridAction->setName(__('View User Details'));
$gridAction->setTitle(__('View User Details'));
- $gridAction->setIcon($this->icons->getIconView());
+ $gridAction->setIcon($this->icons->view());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -216,7 +216,7 @@ final class UserGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Edit User'));
$gridAction->setTitle(__('Edit User'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -236,7 +236,7 @@ final class UserGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Change User\'s Password'));
$gridAction->setTitle(__('Change User\'s Password'));
- $gridAction->setIcon($this->icons->getIconEditPass());
+ $gridAction->setIcon($this->icons->editPass());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->setFilterRowSource('isLdap');
$gridAction->addData(
@@ -257,7 +257,7 @@ final class UserGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete User'));
$gridAction->setTitle(__('Delete User'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php
index 8c4da938..a52e7ef4 100644
--- a/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php
@@ -67,9 +67,9 @@ final class UserGroupGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
true
);
@@ -153,7 +153,7 @@ final class UserGroupGrid extends GridBase
$gridAction->setType(DataGridActionType::MENUBAR_ITEM);
$gridAction->setName(__('New Group'));
$gridAction->setTitle(__('New Group'));
- $gridAction->setIcon($this->icons->getIconAdd());
+ $gridAction->setIcon($this->icons->add());
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
@@ -174,7 +174,7 @@ final class UserGroupGrid extends GridBase
$gridAction->setType(DataGridActionType::VIEW_ITEM);
$gridAction->setName(__('View Group'));
$gridAction->setTitle(__('View Group'));
- $gridAction->setIcon($this->icons->getIconView());
+ $gridAction->setIcon($this->icons->view());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -194,7 +194,7 @@ final class UserGroupGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Edit Group'));
$gridAction->setTitle(__('Edit Group'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -214,7 +214,7 @@ final class UserGroupGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Group'));
$gridAction->setTitle(__('Delete Group'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php
index ed0baf5e..025b56ed 100644
--- a/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php
@@ -67,9 +67,9 @@ final class UserProfileGrid extends GridBase
$grid->addDataAction($this->getDeleteAction());
$grid->addDataAction(
$this->getDeleteAction()
- ->setName(__('Delete Selected'))
- ->setTitle(__('Delete Selected'))
- ->setIsSelection(true),
+ ->setName(__('Delete Selected'))
+ ->setTitle(__('Delete Selected'))
+ ->setIsSelection(true),
true
);
@@ -151,7 +151,7 @@ final class UserProfileGrid extends GridBase
$gridAction->setType(DataGridActionType::MENUBAR_ITEM);
$gridAction->setName(__('New Profile'));
$gridAction->setTitle(__('New Profile'));
- $gridAction->setIcon($this->icons->getIconAdd());
+ $gridAction->setIcon($this->icons->add());
$gridAction->setSkip(true);
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
@@ -172,7 +172,7 @@ final class UserProfileGrid extends GridBase
$gridAction->setType(DataGridActionType::VIEW_ITEM);
$gridAction->setName(__('View Profile Details'));
$gridAction->setTitle(__('View Profile Details'));
- $gridAction->setIcon($this->icons->getIconView());
+ $gridAction->setIcon($this->icons->view());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -192,7 +192,7 @@ final class UserProfileGrid extends GridBase
$gridAction->setType(DataGridActionType::EDIT_ITEM);
$gridAction->setName(__('Edit Profile'));
$gridAction->setTitle(__('Edit Profile'));
- $gridAction->setIcon($this->icons->getIconEdit());
+ $gridAction->setIcon($this->icons->edit());
$gridAction->setOnClickFunction('appMgmt/show');
$gridAction->addData(
'action-route',
@@ -212,7 +212,7 @@ final class UserProfileGrid extends GridBase
$gridAction->setType(DataGridActionType::DELETE_ITEM);
$gridAction->setName(__('Delete Profile'));
$gridAction->setTitle(__('Delete Profile'));
- $gridAction->setIcon($this->icons->getIconDelete());
+ $gridAction->setIcon($this->icons->delete());
$gridAction->setOnClickFunction('appMgmt/delete');
$gridAction->addData(
'action-route',
diff --git a/app/modules/web/Controllers/Helpers/LayoutHelper.php b/app/modules/web/Controllers/Helpers/LayoutHelper.php
index 593f23c1..def3c6c2 100644
--- a/app/modules/web/Controllers/Helpers/LayoutHelper.php
+++ b/app/modules/web/Controllers/Helpers/LayoutHelper.php
@@ -54,12 +54,12 @@ final class LayoutHelper extends HelperBase
private bool $loggedIn;
public function __construct(
- Application $application,
+ Application $application,
TemplateInterface $template,
RequestInterface $request,
ThemeInterface $theme,
CryptPKIInterface $cryptPKI,
- PluginManager $pluginManager
+ PluginManager $pluginManager
) {
parent::__construct($application, $template, $request);
@@ -74,8 +74,8 @@ final class LayoutHelper extends HelperBase
/**
* Sets a full layout page
*
- * @param string $page Page/view name
- * @param Acl|null $acl
+ * @param string $page Page/view name
+ * @param Acl|null $acl
*
* @return LayoutHelper
*/
@@ -119,9 +119,9 @@ final class LayoutHelper extends HelperBase
$this->view->assign('app_website_url', AppInfoInterface::APP_WEBSITE_URL);
$this->view->assign('app_blog_url', AppInfoInterface::APP_BLOG_URL);
$this->view->assign('app_version', InstallerService::VERSION_TEXT);
- $this->view->assign('logo_icon', $baseUrl.'/public/images/logo_icon.png');
- $this->view->assign('logo_no_bg_color', $baseUrl.'/public/images/logo_full_nobg_outline_color.png');
- $this->view->assign('logo_no_bg', $baseUrl.'/public/images/logo_full_nobg_outline.png');
+ $this->view->assign('logo_icon', $baseUrl . '/public/images/logo_icon.png');
+ $this->view->assign('logo_no_bg_color', $baseUrl . '/public/images/logo_full_nobg_outline_color.png');
+ $this->view->assign('logo_no_bg', $baseUrl . '/public/images/logo_full_nobg_outline.png');
$this->view->assign('httpsEnabled', $this->request->isHttps());
$this->view->assign('homeRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT));
@@ -148,7 +148,7 @@ final class LayoutHelper extends HelperBase
protected function getResourcesLinks(): void
{
$version = VersionUtil::getVersionStringNormalized();
- $baseUrl = ($this->configData->getApplicationUrl() ?? BootstrapBase::$WEBURI).BootstrapBase::$SUBURI;
+ $baseUrl = ($this->configData->getApplicationUrl() ?? BootstrapBase::$WEBURI) . BootstrapBase::$SUBURI;
$jsUri = new Uri($baseUrl);
$jsUri->addParam('_r', 'resource/js');
@@ -160,12 +160,12 @@ final class LayoutHelper extends HelperBase
$this->view->append('jsLinks', $jsUri->getUriSigned($this->configData->getPasswordSalt()));
- $themeInfo = $this->theme->getThemeInfo();
+ $themeInfo = $this->theme->getInfo();
if (isset($themeInfo['js'])) {
$jsUri->resetParams()
- ->addParam('b', $this->theme->getThemePath().DIRECTORY_SEPARATOR.'js')
- ->addParam('f', implode(',', $themeInfo['js']));
+ ->addParam('b', $this->theme->getPath() . DIRECTORY_SEPARATOR . 'js')
+ ->addParam('f', implode(',', $themeInfo['js']));
$this->view->append('jsLinks', $jsUri->getUriSigned($this->configData->getPasswordSalt()));
}
@@ -174,7 +174,8 @@ final class LayoutHelper extends HelperBase
if ($this->loggedIn
&& $userPreferences
- && $userPreferences->getUserId() > 0) {
+ && $userPreferences->getUserId() > 0
+ ) {
$resultsAsCards = $userPreferences->isResultsAsCards();
} else {
$resultsAsCards = $this->configData->isResultsAsCards();
@@ -182,7 +183,7 @@ final class LayoutHelper extends HelperBase
$cssUri = (new Uri($baseUrl))
->addParam('_r', 'resource/css')
- ->addParam('_v', md5($version.$resultsAsCards));
+ ->addParam('_v', md5($version . $resultsAsCards));
$this->view->append('cssLinks', $cssUri->getUriSigned($this->configData->getPasswordSalt()));
@@ -196,8 +197,8 @@ final class LayoutHelper extends HelperBase
}
$cssUri->resetParams()
- ->addParam('b', $this->theme->getThemePath().DIRECTORY_SEPARATOR.'css')
- ->addParam('f', implode(',', $themeInfo['css']));
+ ->addParam('b', $this->theme->getPath() . DIRECTORY_SEPARATOR . 'css')
+ ->addParam('f', implode(',', $themeInfo['css']));
$this->view->append('cssLinks', $cssUri->getUriSigned($this->configData->getPasswordSalt()));
}
@@ -207,23 +208,23 @@ final class LayoutHelper extends HelperBase
foreach ($loadedPlugins as $plugin) {
$base = str_replace(APP_ROOT, '', $plugin->getBase());
- $base .= DIRECTORY_SEPARATOR.'public';
+ $base .= DIRECTORY_SEPARATOR . 'public';
$jsResources = $plugin->getJsResources();
$cssResources = $plugin->getCssResources();
if (count($jsResources) > 0) {
$jsUri->resetParams()
- ->addParam('b', $base.DIRECTORY_SEPARATOR.'js')
- ->addParam('f', implode(',', $jsResources));
+ ->addParam('b', $base . DIRECTORY_SEPARATOR . 'js')
+ ->addParam('f', implode(',', $jsResources));
$this->view->append('jsLinks', $jsUri->getUriSigned($this->configData->getPasswordSalt()));
}
if (count($cssResources) > 0) {
$cssUri->resetParams()
- ->addParam('b', $base.DIRECTORY_SEPARATOR.'css')
- ->addParam('f', implode(',', $cssResources));
+ ->addParam('b', $base . DIRECTORY_SEPARATOR . 'css')
+ ->addParam('f', implode(',', $cssResources));
$this->view->append('cssLinks', $cssUri->getUriSigned($this->configData->getPasswordSalt()));
}
@@ -254,9 +255,9 @@ final class LayoutHelper extends HelperBase
$icons = $this->theme->getIcons();
if ($userData->getIsAdminApp()) {
- $userType = $icons->getIconAppAdmin();
+ $userType = $icons->appAdmin();
} elseif ($userData->getIsAdminAcc()) {
- $userType = $icons->getIconAccAdmin();
+ $userType = $icons->accAdmin();
}
$this->view->assign('ctx_userType', $userType);
@@ -269,7 +270,7 @@ final class LayoutHelper extends HelperBase
/**
* Obtener los datos para mostrar el menú de acciones
*
- * @param Acl $acl
+ * @param Acl $acl
*/
public function getMenu(Acl $acl): void
{
@@ -279,12 +280,12 @@ final class LayoutHelper extends HelperBase
$actionSearch = new DataGridAction();
$actionSearch->setId(AclActionsInterface::ACCOUNT);
$actionSearch->setTitle(__('Search'));
- $actionSearch->setIcon($icons->getIconSearch());
+ $actionSearch->setIcon($icons->search());
$actionSearch->setData([
- 'historyReset' => 1,
- 'view' => 'search',
- 'route' => Acl::getActionRoute(AclActionsInterface::ACCOUNT),
- ]);
+ 'historyReset' => 1,
+ 'view' => 'search',
+ 'route' => Acl::getActionRoute(AclActionsInterface::ACCOUNT),
+ ]);
$actions[] = $actionSearch;
@@ -292,12 +293,12 @@ final class LayoutHelper extends HelperBase
$actionNewAccount = new DataGridAction();
$actionNewAccount->setId(AclActionsInterface::ACCOUNT_CREATE);
$actionNewAccount->setTitle(__('New Account'));
- $actionNewAccount->setIcon($icons->getIconAdd());
+ $actionNewAccount->setIcon($icons->add());
$actionNewAccount->setData([
- 'historyReset' => 0,
- 'view' => 'account',
- 'route' => Acl::getActionRoute(AclActionsInterface::ACCOUNT_CREATE),
- ]);
+ 'historyReset' => 0,
+ 'view' => 'account',
+ 'route' => Acl::getActionRoute(AclActionsInterface::ACCOUNT_CREATE),
+ ]);
$actions[] = $actionNewAccount;
}
@@ -306,12 +307,12 @@ final class LayoutHelper extends HelperBase
$actionAccessManager = new DataGridAction();
$actionAccessManager->setId(AclActionsInterface::ACCESS_MANAGE);
$actionAccessManager->setTitle(Acl::getActionInfo(AclActionsInterface::ACCESS_MANAGE));
- $actionAccessManager->setIcon($icons->getIconAccount());
+ $actionAccessManager->setIcon($icons->account());
$actionAccessManager->setData([
- 'historyReset' => 0,
- 'view' => 'datatabs',
- 'route' => Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE),
- ]);
+ 'historyReset' => 0,
+ 'view' => 'datatabs',
+ 'route' => Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE),
+ ]);
$actions[] = $actionAccessManager;
}
@@ -320,12 +321,12 @@ final class LayoutHelper extends HelperBase
$actionItemManager = new DataGridAction();
$actionItemManager->setId(AclActionsInterface::ITEMS_MANAGE);
$actionItemManager->setTitle(Acl::getActionInfo(AclActionsInterface::ITEMS_MANAGE));
- $actionItemManager->setIcon($icons->getIconGroup());
+ $actionItemManager->setIcon($icons->group());
$actionItemManager->setData([
- 'historyReset' => 0,
- 'view' => 'datatabs',
- 'route' => Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE),
- ]);
+ 'historyReset' => 0,
+ 'view' => 'datatabs',
+ 'route' => Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE),
+ ]);
$actions[] = $actionItemManager;
}
@@ -336,10 +337,10 @@ final class LayoutHelper extends HelperBase
$actionSecurityManager->setTitle(Acl::getActionInfo(AclActionsInterface::SECURITY_MANAGE));
$actionSecurityManager->setIcon($icons->getIconByName('security'));
$actionSecurityManager->setData([
- 'historyReset' => 0,
- 'view' => 'datatabs',
- 'route' => Acl::getActionRoute(AclActionsInterface::SECURITY_MANAGE),
- ]);
+ 'historyReset' => 0,
+ 'view' => 'datatabs',
+ 'route' => Acl::getActionRoute(AclActionsInterface::SECURITY_MANAGE),
+ ]);
$actions[] = $actionSecurityManager;
}
@@ -350,10 +351,10 @@ final class LayoutHelper extends HelperBase
$actionPlugins->setTitle(__('Plugins'));
$actionPlugins->setIcon($icons->getIconByName('extension'));
$actionPlugins->setData([
- 'historyReset' => 1,
- 'view' => 'plugin',
- 'route' => Acl::getActionRoute(AclActionsInterface::PLUGIN),
- ]);
+ 'historyReset' => 1,
+ 'view' => 'plugin',
+ 'route' => Acl::getActionRoute(AclActionsInterface::PLUGIN),
+ ]);
$actions[] = $actionPlugins;
}
@@ -362,12 +363,12 @@ final class LayoutHelper extends HelperBase
$actionConfigManager = new DataGridAction();
$actionConfigManager->setId('config');
$actionConfigManager->setTitle(__('Configuration'));
- $actionConfigManager->setIcon($icons->getIconSettings());
+ $actionConfigManager->setIcon($icons->settings());
$actionConfigManager->setData([
- 'historyReset' => 1,
- 'view' => 'config',
- 'route' => Acl::getActionRoute(AclActionsInterface::CONFIG),
- ]);
+ 'historyReset' => 1,
+ 'view' => 'config',
+ 'route' => Acl::getActionRoute(AclActionsInterface::CONFIG),
+ ]);
$actions[] = $actionConfigManager;
}
@@ -379,8 +380,8 @@ final class LayoutHelper extends HelperBase
/**
* Sets a full layout page
*
- * @param string $template
- * @param string $page Page/view name
+ * @param string $template
+ * @param string $page Page/view name
*
* @return LayoutHelper
*/
@@ -399,8 +400,8 @@ final class LayoutHelper extends HelperBase
/**
* Sets a custom layout page
*
- * @param string $template
- * @param string $page Page/view name
+ * @param string $template
+ * @param string $page Page/view name
*
* @return LayoutHelper
*/
diff --git a/app/modules/web/Controllers/UserSettingsManager/IndexController.php b/app/modules/web/Controllers/UserSettingsManager/IndexController.php
index e1d27c8c..8b055655 100644
--- a/app/modules/web/Controllers/UserSettingsManager/IndexController.php
+++ b/app/modules/web/Controllers/UserSettingsManager/IndexController.php
@@ -83,7 +83,7 @@ final class IndexController extends ControllerBase implements ExtensibleTabContr
}
/**
- * @param DataTab $tab
+ * @param DataTab $tab
*/
public function addTab(DataTab $tab): void
{
@@ -105,16 +105,16 @@ final class IndexController extends ControllerBase implements ExtensibleTabContr
$template->assign(
'langs',
SelectItemAdapter::factory(Language::getAvailableLanguages())
- ->getItemsFromArraySelected(
- [$userPreferences->getLang() ?: $this->configData->getSiteLang()]
- )
+ ->getItemsFromArraySelected(
+ [$userPreferences->getLang() ?: $this->configData->getSiteLang()]
+ )
);
$template->assign(
'themes',
- SelectItemAdapter::factory($this->theme->getThemesAvailable())
- ->getItemsFromArraySelected(
- [$userPreferences->getTheme() ?: $this->configData->getSiteTheme()]
- )
+ SelectItemAdapter::factory($this->theme->getAvailable())
+ ->getItemsFromArraySelected(
+ [$userPreferences->getTheme() ?: $this->configData->getSiteTheme()]
+ )
);
$template->assign('userPreferences', $userPreferences);
$template->assign('route', 'userSettingsGeneral/save');
diff --git a/app/modules/web/Init.php b/app/modules/web/Init.php
index d4dd8d24..94cf0ff3 100644
--- a/app/modules/web/Init.php
+++ b/app/modules/web/Init.php
@@ -25,23 +25,25 @@
namespace SP\Modules\Web;
use Defuse\Crypto\Exception\CryptoException;
+use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
use Exception;
+use JsonException;
use Klein\Klein;
use SP\Core\Application;
use SP\Core\Bootstrap\BootstrapBase;
-use SP\Core\Bootstrap\BootstrapWeb;
+use SP\Core\Bootstrap\UriContextInterface;
use SP\Core\Context\ContextBase;
use SP\Core\Context\SessionContext;
use SP\Core\Crypt\CryptSessionHandler;
use SP\Core\Crypt\Csrf;
use SP\Core\Crypt\CsrfInterface;
use SP\Core\Crypt\Session as CryptSession;
-use SP\Core\Crypt\UuidCookie;
use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\InitializationException;
use SP\Core\Exceptions\InvalidArgumentException;
use SP\Core\Exceptions\NoSuchPropertyException;
use SP\Core\Exceptions\QueryException;
+use SP\Core\Exceptions\SPException;
use SP\Core\HttpModuleBase;
use SP\Core\Language;
use SP\Core\LanguageInterface;
@@ -60,6 +62,7 @@ use SP\Domain\User\Services\UserProfileService;
use SP\Http\Address;
use SP\Http\RequestInterface;
use SP\Http\Uri;
+use SP\Infrastructure\Common\Repositories\NoSuchItemException;
use SP\Infrastructure\Database\DatabaseUtil;
use SP\Infrastructure\File\FileException;
use SP\Modules\Web\Controllers\Bootstrap\GetEnvironmentController;
@@ -83,6 +86,9 @@ use SP\Modules\Web\Controllers\Upgrade\UpgradeController;
use SP\Plugin\PluginManager;
use SP\Util\HttpUtil;
+use function SP\logger;
+use function SP\processException;
+
/**
* Class Init
*/
@@ -142,18 +148,19 @@ final class Init extends HttpModuleBase
private bool $isIndex = false;
public function __construct(
- Application $application,
- ProvidersHelper $providersHelper,
- RequestInterface $request,
- Klein $router,
- CsrfInterface $csrf,
- ThemeInterface $theme,
- LanguageInterface $language,
- SecureSessionServiceInterface $secureSessionService,
- PluginManager $pluginManager,
- ItemPresetService $itemPresetService,
- DatabaseUtil $databaseUtil,
- UserProfileServiceInterface $userProfileService
+ Application $application,
+ ProvidersHelper $providersHelper,
+ RequestInterface $request,
+ Klein $router,
+ CsrfInterface $csrf,
+ ThemeInterface $theme,
+ LanguageInterface $language,
+ SecureSessionServiceInterface $secureSessionService,
+ PluginManager $pluginManager,
+ ItemPresetService $itemPresetService,
+ DatabaseUtil $databaseUtil,
+ UserProfileServiceInterface $userProfileService,
+ private readonly UriContextInterface $uriContext
) {
parent::__construct(
$application,
@@ -175,17 +182,17 @@ final class Init extends HttpModuleBase
/**
* Initialize Web App
*
- * @param string $controller
+ * @param string $controller
*
- * @throws \Defuse\Crypto\Exception\EnvironmentIsBrokenException
- * @throws \JsonException
- * @throws \SP\Core\Exceptions\ConstraintException
- * @throws \SP\Core\Exceptions\InitializationException
- * @throws \SP\Core\Exceptions\QueryException
- * @throws \SP\Core\Exceptions\SPException
- * @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException
- * @throws \SP\Infrastructure\File\FileException
- * @throws \Exception
+ * @throws EnvironmentIsBrokenException
+ * @throws JsonException
+ * @throws ConstraintException
+ * @throws InitializationException
+ * @throws QueryException
+ * @throws SPException
+ * @throws NoSuchItemException
+ * @throws FileException
+ * @throws Exception
*/
public function initialize(string $controller): void
{
@@ -211,9 +218,6 @@ final class Init extends HttpModuleBase
// Setup language
$this->language->setLanguage($isReload);
- // Setup theme
- $this->theme->initTheme($isReload);
-
// Comprobar si es necesario cambiar a HTTPS
HttpUtil::checkHttps($this->configData, $this->request);
@@ -227,7 +231,7 @@ final class Init extends HttpModuleBase
if (!$this->checkInstalled()) {
logger('Not installed', 'ERROR');
- $this->router->response()->redirect(self::getUriFor(self::ROUTE_INSTALL))->send();
+ $this->router->response()->redirect($this->getUriFor(self::ROUTE_INSTALL))->send();
throw new InitializationException('Not installed');
}
@@ -236,7 +240,7 @@ final class Init extends HttpModuleBase
if (!$this->databaseUtil->checkDatabaseConnection()) {
logger('Database connection error', 'ERROR');
- $this->router->response()->redirect(self::getUriFor(self::ROUTE_ERROR_DATABASE_CONNECTION))->send();
+ $this->router->response()->redirect($this->getUriFor(self::ROUTE_ERROR_DATABASE_CONNECTION))->send();
throw new InitializationException('Database connection error');
}
@@ -245,7 +249,7 @@ final class Init extends HttpModuleBase
if ($this->checkMaintenanceMode()) {
logger('Maintenance mode', 'INFO');
- $this->router->response()->redirect(self::getUriFor(self::ROUTE_ERROR_MAINTENANCE))->send();
+ $this->router->response()->redirect($this->getUriFor(self::ROUTE_ERROR_MAINTENANCE))->send();
throw new InitializationException('Maintenance mode');
}
@@ -256,7 +260,7 @@ final class Init extends HttpModuleBase
$this->config->generateUpgradeKey();
- $this->router->response()->redirect(self::getUriFor(self::ROUTE_UPGRADE))->send();
+ $this->router->response()->redirect($this->getUriFor(self::ROUTE_UPGRADE))->send();
throw new InitializationException('Upgrade needed');
}
@@ -265,7 +269,7 @@ final class Init extends HttpModuleBase
if (!$this->databaseUtil->checkDatabaseTables($this->configData->getDbName())) {
logger('Database checking error', 'ERROR');
- $this->router->response()->redirect(self::getUriFor(self::ROUTE_ERROR_DATABASE))->send();
+ $this->router->response()->redirect($this->getUriFor(self::ROUTE_ERROR_DATABASE))->send();
throw new InitializationException('Database checking error');
}
@@ -312,7 +316,8 @@ final class Init extends HttpModuleBase
{
if ($encrypt === true
&& BootstrapBase::$checkPhpVersion
- && ($key = $this->secureSessionService->getKey()) !== false) {
+ && ($key = $this->secureSessionService->getKey()) !== false
+ ) {
session_set_save_handler(new CryptSessionHandler($key), true);
}
@@ -336,6 +341,11 @@ final class Init extends HttpModuleBase
&& $this->router->request()->param('r') !== 'install/index';
}
+ private function getUriFor(string $route): string
+ {
+ return (new Uri($this->uriContext->getWebRoot()))->addParam('r', $route)->getUri();
+ }
+
/**
* Comprobar si es necesario actualizar componentes
*
@@ -408,7 +418,7 @@ final class Init extends HttpModuleBase
if ($this->isIndex || $timeout === null) {
$userTimeout = $this->getSessionTimeoutForUser($timeout) ?: $this->configData->getSessionTimeout();
- logger('Session timeout: '.$userTimeout);
+ logger('Session timeout: ' . $userTimeout);
return $this->context->setSessionTimeout($userTimeout);
}
@@ -437,7 +447,8 @@ final class Init extends HttpModuleBase
$this->request->getClientAddress(),
$sessionTimeout->getAddress(),
$sessionTimeout->getMask()
- )) {
+ )
+ ) {
return $sessionTimeout->getTimeout();
}
}
@@ -445,9 +456,4 @@ final class Init extends HttpModuleBase
return $default;
}
-
- private static function getUriFor(string $route): string
- {
- return (new Uri(BootstrapWeb::$WEBROOT))->addParam('r', $route)->getUri();
- }
}
diff --git a/app/modules/web/themes/material-blue/views/account/account-editpass.inc b/app/modules/web/themes/material-blue/views/account/account-editpass.inc
index 7725a27c..a1dc19c8 100644
--- a/app/modules/web/themes/material-blue/views/account/account-editpass.inc
+++ b/app/modules/web/themes/material-blue/views/account/account-editpass.inc
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -23,16 +23,17 @@
*/
/**
- * @var callable $_getvar
- * @var ThemeIcons $icons
- * @var AccountExtData $accountData
- * @var AccountAcl $accountAcl
- * @var \SP\Domain\Config\Ports\ConfigDataInterface $configData
+ * @var callable $_getvar
+ * @var ThemeIconsInterface $icons
+ * @var AccountExtData $accountData
+ * @var AccountAcl $accountAcl
+ * @var ConfigDataInterface $configData
*/
-use SP\Core\UI\ThemeIcons;
+use SP\Core\UI\ThemeIconsInterface;
use SP\DataModel\AccountExtData;
use SP\Domain\Account\Services\AccountAcl;
+use SP\Domain\Config\Ports\ConfigDataInterface;
/** @var AccountExtData $accountData */
$accountData = $_getvar('accountData');
@@ -43,70 +44,87 @@ $accountAcl = $_getvar('accountAcl');