N°3565 - Migrate backoffice pages to new UIBlock system : Setup

This commit is contained in:
Eric
2021-02-01 16:28:10 +01:00
parent 664dd12241
commit 2f68be14f8
16 changed files with 756 additions and 248 deletions

View File

@@ -17,6 +17,10 @@
* You should have received a copy of the GNU Affero General Public License
*/
use Combodo\iTop\Application\UI\Base\Component\Title\Title;
use Combodo\iTop\Application\UI\Base\Component\Title\TitleUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
require_once(APPROOT.'setup/modulediscovery.class.inc.php');
require_once(APPROOT.'setup/runtimeenv.class.inc.php');
require_once(APPROOT.'core/log.class.inc.php');
@@ -29,11 +33,16 @@ SetupLog::Enable(APPROOT.'/log/setup.log');
*/
class SetupPage extends NiceWebPage
{
const DEFAULT_PAGE_TEMPLATE_REL_PATH = 'pages/backoffice/setuppage/layout';
public function __construct($sTitle)
{
parent::__construct($sTitle);
$this->add_linked_script("../js/jquery.blockUI.js");
$this->add_linked_script("../setup/setup.js");
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-awesome/css/all.min.css');
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-combodo/font-combodo.css');
$this->LoadTheme();
$this->add_saas("css/setup.scss");
}
@@ -143,9 +152,17 @@ class SetupPage extends NiceWebPage
public function output()
{
$sLogo = utils::GetAbsoluteUrlAppRoot(true).'/images/itop-logo.png';
$this->s_content = "<div id=\"header\"><h1><a href=\"http://www.combodo.com/itop\" target=\"_blank\"><img title=\"iTop by Combodo\" alt=\" \" src=\"{$sLogo}?t=".utils::GetCacheBusterTimestamp()."\"></a>&nbsp;".htmlentities($this->s_title,
ENT_QUOTES, self::PAGES_CHARSET)."</h1>\n</div><div id=\"setup\">{$this->s_content}\n</div>\n";
$sLogo = utils::GetAbsoluteUrlAppRoot(true).'/images/itop-logo.png?t='.utils::GetCacheBusterTimestamp();
$oSetupPage = UIContentBlockUIBlockFactory::MakeStandard();
$oHeader = UIContentBlockUIBlockFactory::MakeStandard('header', ['ibo-setup--header']);
$oSetupPage->AddSubBlock($oHeader);
$oTitle = TitleUIBlockFactory::MakeForPageWithIcon($this->s_title, $sLogo, Title::DEFAULT_ICON_COVER_METHOD, false);
$oHeader->AddSubBlock($oTitle);
$oSetup = UIContentBlockUIBlockFactory::MakeStandard('setup', ['ibo-setup--body']);
$oSetupPage->AddSubBlock($oSetup);
$oSetup->AddSubBlock($this->oContentLayout);
$this->oContentLayout = $oSetupPage;
return parent::output();
}