mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-27 12:38:44 +02:00
N°2847 - Tab Management - iTop Pages refactoring - introduction of UIContentBlock as base block
This commit is contained in:
118
sources/application/UI/Layout/TabContainer/Tab/AjaxTab.php
Normal file
118
sources/application/UI/Layout/TabContainer/Tab/AjaxTab.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2013-2020 Combodo SARL
|
||||
*
|
||||
* This file is part of iTop.
|
||||
*
|
||||
* iTop is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* iTop is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Application\UI\Layout\TabContainer\Tab;
|
||||
|
||||
|
||||
use Combodo\iTop\Application\UI\iUIBlock;
|
||||
use Combodo\iTop\Application\UI\Layout\iUIContentBlock;
|
||||
use Combodo\iTop\Application\UI\UIException;
|
||||
use Dict;
|
||||
use TabManager;
|
||||
|
||||
/**
|
||||
* Class AjaxTab
|
||||
*
|
||||
* @package Combodo\iTop\Application\UI\Layout\TabContainer\Tab
|
||||
*/
|
||||
class AjaxTab extends Tab
|
||||
{
|
||||
// Overloaded constants
|
||||
public const BLOCK_CODE = 'ibo-ajaxtab';
|
||||
public const HTML_TEMPLATE_REL_PATH = 'layouts/tabcontainer/ajaxtab/layout';
|
||||
public const JS_TEMPLATE_REL_PATH = 'layouts/tabcontainer/ajaxtab/layout';
|
||||
|
||||
private $sURL;
|
||||
private $bCache;
|
||||
|
||||
public function GetType(): string
|
||||
{
|
||||
return TabManager::ENUM_TAB_TYPE_AJAX;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sHtml
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\iUIBlock
|
||||
* @throws \Combodo\iTop\Application\UI\UIException
|
||||
*/
|
||||
public function AddHtml(string $sHtml): iUIBlock
|
||||
{
|
||||
throw new UIException($this, Dict::Format('UIBlock:Error:AddBlockForbidden', $this->GetId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Combodo\iTop\Application\UI\iUIBlock $oSubBlock
|
||||
*
|
||||
* @return iUIContentBlock
|
||||
* @throws \Combodo\iTop\Application\UI\UIException
|
||||
*/
|
||||
public function AddSubBlock(iUIBlock $oSubBlock): iUIContentBlock
|
||||
{
|
||||
throw new UIException($this, Dict::Format('UIBlock:Error:AddBlockForbidden', $this->GetId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|\Combodo\iTop\Application\UI\iUIBlock[]
|
||||
*/
|
||||
public function GetSubBlocks(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $sURL
|
||||
*
|
||||
* @return AjaxTab
|
||||
*/
|
||||
public function SetURL(string $sURL): self
|
||||
{
|
||||
$this->sURL = $sURL;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $bCache
|
||||
*
|
||||
* @return AjaxTab
|
||||
*/
|
||||
public function SetCache(string $bCache): self
|
||||
{
|
||||
$this->bCache = $bCache;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function GetURL()
|
||||
{
|
||||
return $this->sURL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function GetCache()
|
||||
{
|
||||
return $this->bCache ? 'true' : 'false';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user