mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 14:08:46 +02:00
Reformat code
This commit is contained in:
@@ -29,13 +29,12 @@ use Combodo\iTop\Application\UI\UIBlock;
|
||||
/**
|
||||
* Class PageContent
|
||||
*
|
||||
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
|
||||
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
|
||||
* @package Combodo\iTop\Application\UI\Layout\PageContent
|
||||
* @internal
|
||||
* @since 2.8.0
|
||||
* @since 2.8.0
|
||||
*/
|
||||
class PageContent extends UIBlock implements iUIContentBlock
|
||||
{
|
||||
class PageContent extends UIBlock implements iUIContentBlock {
|
||||
use tUIContentAreas;
|
||||
|
||||
// Overloaded constants
|
||||
@@ -53,8 +52,7 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @param string|null $sId
|
||||
*/
|
||||
public function __construct(?string $sId = null)
|
||||
{
|
||||
public function __construct(?string $sId = null) {
|
||||
parent::__construct($sId);
|
||||
|
||||
$this->SetMainBlocks([]);
|
||||
@@ -71,8 +69,7 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function SetMainBlocks(array $aBlocks)
|
||||
{
|
||||
public function SetMainBlocks(array $aBlocks) {
|
||||
$this->SetContentAreaBlocks(static::ENUM_CONTENT_AREA_MAIN, $aBlocks);
|
||||
|
||||
return $this;
|
||||
@@ -84,8 +81,7 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
* @return \Combodo\iTop\Application\UI\iUIBlock[]
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function GetMainBlocks()
|
||||
{
|
||||
public function GetMainBlocks() {
|
||||
return $this->GetContentAreaBlocks(static::ENUM_CONTENT_AREA_MAIN);
|
||||
}
|
||||
|
||||
@@ -97,9 +93,9 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function AddMainBlock(iUIBlock $oBlock)
|
||||
{
|
||||
public function AddMainBlock(iUIBlock $oBlock) {
|
||||
$this->AddBlockToContentArea(static::ENUM_CONTENT_AREA_MAIN, $oBlock);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -111,8 +107,7 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function RemoveMainBlock(string $sBlockId)
|
||||
{
|
||||
public function RemoveMainBlock(string $sBlockId) {
|
||||
$this->RemoveBlockFromContentArea(static::ENUM_CONTENT_AREA_MAIN, $sBlockId);
|
||||
|
||||
return $this;
|
||||
@@ -125,8 +120,7 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function SetExtraHtmlContent(string $sExtraHtmlContent)
|
||||
{
|
||||
public function SetExtraHtmlContent(string $sExtraHtmlContent) {
|
||||
$this->sExtraHtmlContent = $sExtraHtmlContent;
|
||||
|
||||
return $this;
|
||||
@@ -137,8 +131,7 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetExtraHtmlContent()
|
||||
{
|
||||
public function GetExtraHtmlContent() {
|
||||
return $this->sExtraHtmlContent;
|
||||
}
|
||||
|
||||
@@ -149,8 +142,7 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function AddHtml(string $sHtml)
|
||||
{
|
||||
public function AddHtml(string $sHtml) {
|
||||
$oBlock = new Html($sHtml);
|
||||
$this->AddMainBlock($oBlock);
|
||||
|
||||
@@ -162,8 +154,7 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function AddSubBlock(iUIBlock $oSubBlock)
|
||||
{
|
||||
public function AddSubBlock(iUIBlock $oSubBlock) {
|
||||
$this->AddMainBlock($oSubBlock);
|
||||
|
||||
return $this;
|
||||
@@ -176,11 +167,11 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function RemoveSubBlock(string $sId)
|
||||
{
|
||||
public function RemoveSubBlock(string $sId) {
|
||||
foreach ($this->GetContentAreas() as $oContentArea) {
|
||||
$oContentArea->RemoveSubBlock($sId);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -191,8 +182,7 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function HasSubBlock(string $sId): bool
|
||||
{
|
||||
public function HasSubBlock(string $sId): bool {
|
||||
foreach ($this->GetContentAreas() as $oContentArea) {
|
||||
if ($oContentArea->HasSubBlock($sId)) {
|
||||
return true;
|
||||
@@ -207,8 +197,7 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function GetSubBlock(string $sId): ?iUIBlock
|
||||
{
|
||||
public function GetSubBlock(string $sId): ?iUIBlock {
|
||||
foreach ($this->GetContentAreas() as $oContentArea) {
|
||||
$oSubBlock = $oContentArea->GetSubBlock($sId);
|
||||
if (!is_null($oSubBlock)) {
|
||||
@@ -225,9 +214,9 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
* @inheritDoc
|
||||
* @return $this|\Combodo\iTop\Application\UI\Layout\iUIContentBlock
|
||||
*/
|
||||
public function SetSubBlocks(array $aSubBlocks): iUIContentBlock
|
||||
{
|
||||
public function SetSubBlocks(array $aSubBlocks): iUIContentBlock {
|
||||
$this->SetMainBlocks($aSubBlocks);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -236,12 +225,12 @@ class PageContent extends UIBlock implements iUIContentBlock
|
||||
*
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function GetSubBlocks(): array
|
||||
{
|
||||
public function GetSubBlocks(): array {
|
||||
$aSubBlocks = [];
|
||||
foreach ($this->GetContentAreas() as $oContentArea) {
|
||||
$aSubBlocks = array_merge($aSubBlocks, $oContentArea->GetSubBlocks());
|
||||
}
|
||||
|
||||
return $aSubBlocks;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user