N°5658 - Fix spinning wheel appearing on all application upgrade buttons - move twig_base and itop-core-update to new router

This commit is contained in:
Eric Espie
2023-04-28 16:02:43 +02:00
parent d91fafb2af
commit e960d20826
16 changed files with 191 additions and 400 deletions

View File

@@ -22,6 +22,7 @@ namespace Combodo\iTop\Application\TwigBase\Controller;
use AjaxPage;
use ApplicationMenu;
use Combodo\iTop\Application\TwigBase\Twig\TwigHelper;
use Combodo\iTop\Controller\AbstractController;
use Dict;
use ErrorPage;
use Exception;
@@ -38,7 +39,7 @@ use utils;
use WebPage;
use ZipArchive;
abstract class Controller
abstract class Controller extends AbstractController
{
const ENUM_PAGE_TYPE_HTML = 'html';
const ENUM_PAGE_TYPE_BASIC_HTML = 'basic_html';
@@ -85,7 +86,7 @@ abstract class Controller
* @param string $sViewPath Path of the twig files
* @param string $sModuleName name of the module (or 'core' if not a module)
*/
public function __construct($sViewPath, $sModuleName = 'core', $aAdditionalPaths = [])
public function __construct($sViewPath = '', $sModuleName = 'core', $aAdditionalPaths = [])
{
$this->m_aLinkedScripts = [];
$this->m_aLinkedStylesheets = [];
@@ -93,14 +94,16 @@ abstract class Controller
$this->m_aAjaxTabs = [];
$this->m_aDefaultParams = [];
$this->m_aBlockParams = [];
$this->SetViewPath($sViewPath, $aAdditionalPaths);
$this->SetModuleName($sModuleName);
if ($sModuleName != 'core') {
try {
$this->m_aDefaultParams = ['sIndexURL' => utils::GetAbsoluteUrlModulePage($this->m_sModule, 'index.php')];
}
catch (Exception $e) {
IssueLog::Error($e->getMessage());
if (strlen($sViewPath) > 0) {
$this->SetViewPath($sViewPath, $aAdditionalPaths);
if ($sModuleName != 'core') {
try {
$this->m_aDefaultParams = ['sIndexURL' => utils::GetAbsoluteUrlModulePage($this->m_sModule, 'index.php')];
}
catch (Exception $e) {
IssueLog::Error($e->getMessage());
}
}
}
}
@@ -240,7 +243,7 @@ abstract class Controller
/**
* @throws \Exception
*/
private function CheckAccess()
protected function CheckAccess()
{
if ($this->m_bCheckDemoMode && MetaModel::GetConfig()->Get('demo_mode'))
{