Merge branch 'support/3.0' into develop

# Conflicts:
#	application/applicationextension.inc.php
This commit is contained in:
Eric Espie
2022-12-29 14:40:26 +01:00
25 changed files with 321 additions and 64 deletions

View File

@@ -29,14 +29,14 @@ require_once(APPROOT.'application/newsroomprovider.class.inc.php');
* Definition of interfaces that can be implemented to customize iTop. * Definition of interfaces that can be implemented to customize iTop.
* You may implement such interfaces in a module file (e.g. main.mymodule.php) * You may implement such interfaces in a module file (e.g. main.mymodule.php)
* *
* @api
* @copyright Copyright (C) 2010-2021 Combodo SARL * @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0 * @license http://opensource.org/licenses/AGPL-3.0
* @package Extensibility
* @since 2.7.0 * @since 2.7.0
*/ */
/** /**
* @api
* @package LoginExtensibilityAPI
* @since 2.7.0 * @since 2.7.0
*/ */
interface iLoginExtension interface iLoginExtension
@@ -51,6 +51,8 @@ interface iLoginExtension
} }
/** /**
* @api
* @package LoginExtensibilityAPI
* @since 2.7.0 * @since 2.7.0
*/ */
interface iLoginFSMExtension extends iLoginExtension interface iLoginFSMExtension extends iLoginExtension
@@ -62,6 +64,7 @@ interface iLoginFSMExtension extends iLoginExtension
* if LoginWebPage::LOGIN_FSM_RETURN_OK is returned then the login is OK and terminated * if LoginWebPage::LOGIN_FSM_RETURN_OK is returned then the login is OK and terminated
* if LoginWebPage::LOGIN_FSM_RETURN_IGNORE is returned then the FSM will proceed to next plugin or state * if LoginWebPage::LOGIN_FSM_RETURN_IGNORE is returned then the FSM will proceed to next plugin or state
* *
* @api
* @param string $sLoginState (see LoginWebPage::LOGIN_STATE_...) * @param string $sLoginState (see LoginWebPage::LOGIN_STATE_...)
* @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...) * @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...)
* *
@@ -837,7 +840,7 @@ abstract class ApplicationPopupMenuItem
/** @ignore */ /** @ignore */
protected $sLabel; protected $sLabel;
/** @ignore */ /** @ignore */
protected $sTooltip; protected $sTooltip;
/** @ignore */ /** @ignore */
protected $sIconClass; protected $sIconClass;
/** @ignore */ /** @ignore */
@@ -934,7 +937,7 @@ abstract class ApplicationPopupMenuItem
{ {
return $this->sTooltip; return $this->sTooltip;
} }
/** /**
* @param $sIconClass * @param $sIconClass
* *
@@ -944,8 +947,8 @@ abstract class ApplicationPopupMenuItem
public function SetIconClass($sIconClass) public function SetIconClass($sIconClass)
{ {
$this->sIconClass = $sIconClass; $this->sIconClass = $sIconClass;
} }
/** /**
* @return string * @return string
* *
@@ -956,7 +959,7 @@ abstract class ApplicationPopupMenuItem
{ {
return $this->sIconClass; return $this->sIconClass;
} }
/** /**
* Returns the components to create a popup menu item in HTML * Returns the components to create a popup menu item in HTML
* *
@@ -1015,7 +1018,7 @@ class URLPopupMenuItem extends ApplicationPopupMenuItem
'tooltip' => $this->sTooltip 'tooltip' => $this->sTooltip
); );
} }
/** @ignore */ /** @ignore */
public function GetUrl() public function GetUrl()
{ {
@@ -1084,13 +1087,13 @@ class JSPopupMenuItem extends ApplicationPopupMenuItem
{ {
return $this->aIncludeJSFiles; return $this->aIncludeJSFiles;
} }
/** @ignore */ /** @ignore */
public function GetJsCode() public function GetJsCode()
{ {
return $this->sJsCode; return $this->sJsCode;
} }
/** @ignore */ /** @ignore */
public function GetUrl() public function GetUrl()
{ {
@@ -1915,6 +1918,7 @@ class RestUtils
/** /**
* Read and interpret object search criteria from a Rest/Json structure * Read and interpret object search criteria from a Rest/Json structure
* *
* @api
* @param string $sClass Name of the class * @param string $sClass Name of the class
* @param StdClass $oCriteria Hash of attribute code => value (can be a substructure or a scalar, depending on the nature of the * @param StdClass $oCriteria Hash of attribute code => value (can be a substructure or a scalar, depending on the nature of the
* attriute) * attriute)
@@ -2023,6 +2027,7 @@ class RestUtils
/** /**
* Search objects from a polymorph search specification (Rest/Json) * Search objects from a polymorph search specification (Rest/Json)
* *
* @api
* @param string $sClass Name of the class * @param string $sClass Name of the class
* @param mixed $key Either search criteria (substructure), or an object or an OQL string. * @param mixed $key Either search criteria (substructure), or an object or an OQL string.
* @param int $iLimit The limit of results to return * @param int $iLimit The limit of results to return

View File

@@ -30,18 +30,40 @@
/** /**
* Element of the response formed by RestResultWithObjects * Element of the response formed by RestResultWithObjects
* *
* @package REST Services * @package RESTExtensibilityAPI
* @api
*/ */
class ObjectResult class ObjectResult
{ {
/**
* @var int
* @api
*/
public $code; public $code;
/**
* @var string
* @api
*/
public $message; public $message;
/**
* @var mixed|null
* @api
*/
public $class; public $class;
/**
* @var mixed|null
* @api
*/
public $key; public $key;
/**
* @var array
* @api
*/
public $fields; public $fields;
/** /**
* Default constructor * Default constructor
* @api
*/ */
public function __construct($sClass = null, $iId = null) public function __construct($sClass = null, $iId = null)
{ {
@@ -54,11 +76,17 @@ class ObjectResult
/** /**
* Helper to make an output value for a given attribute * Helper to make an output value for a given attribute
* *
* @api
* @param DBObject $oObject The object being reported * @param DBObject $oObject The object being reported
* @param string $sAttCode The attribute code (must be valid) * @param string $sAttCode The attribute code (must be valid)
* @param boolean $bExtendedOutput Output all of the link set attributes ? * @param boolean $bExtendedOutput Output all of the link set attributes ?
*
* @return string A scalar representation of the value * @return string A scalar representation of the value
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/ */
protected function MakeResultValue(DBObject $oObject, $sAttCode, $bExtendedOutput = false) protected function MakeResultValue(DBObject $oObject, $sAttCode, $bExtendedOutput = false)
{ {
@@ -112,11 +140,17 @@ class ObjectResult
/** /**
* Report the value for the given object attribute * Report the value for the given object attribute
* *
* @api
* @param DBObject $oObject The object being reported * @param DBObject $oObject The object being reported
* @param string $sAttCode The attribute code (must be valid) * @param string $sAttCode The attribute code (must be valid)
* @param boolean $bExtendedOutput Output all of the link set attributes ? * @param boolean $bExtendedOutput Output all of the link set attributes ?
*
* @return void * @return void
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/ */
public function AddField(DBObject $oObject, $sAttCode, $bExtendedOutput = false) public function AddField(DBObject $oObject, $sAttCode, $bExtendedOutput = false)
{ {
@@ -129,8 +163,7 @@ class ObjectResult
/** /**
* REST response for services managing objects. Derive this structure to add information and/or constants * REST response for services managing objects. Derive this structure to add information and/or constants
* *
* @package Extensibility * @package RESTExtensibilityAPI
* @package REST Services
* @api * @api
*/ */
class RestResultWithObjects extends RestResult class RestResultWithObjects extends RestResult
@@ -140,13 +173,19 @@ class RestResultWithObjects extends RestResult
/** /**
* Report the given object * Report the given object
* *
* @param int An error code (RestResult::OK is no issue has been found) * @api
* @param $iCode
* @param string $sMessage Description of the error if any, an empty string otherwise * @param string $sMessage Description of the error if any, an empty string otherwise
* @param DBObject $oObject The object being reported * @param DBObject $oObject The object being reported
* @param array $aFieldSpec An array of class => attribute codes (Cf. RestUtils::GetFieldList). List of the attributes to be reported. * @param null $aFieldSpec An array of class => attribute codes (Cf. RestUtils::GetFieldList). List of the attributes to be reported.
* @param boolean $bExtendedOutput Output all of the link set attributes ? * @param boolean $bExtendedOutput Output all of the link set attributes ?
*
* @return void * @return void
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/ */
public function AddObject($iCode, $sMessage, $oObject, $aFieldSpec = null, $bExtendedOutput = false) public function AddObject($iCode, $sMessage, $oObject, $aFieldSpec = null, $bExtendedOutput = false)
{ {
@@ -184,16 +223,30 @@ class RestResultWithObjects extends RestResult
} }
} }
/**
* @package RESTExtensibilityAPI
* @api
*/
class RestResultWithRelations extends RestResultWithObjects class RestResultWithRelations extends RestResultWithObjects
{ {
public $relations; public $relations;
/**
* @api
*/
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->relations = array(); $this->relations = array();
} }
/**
* @param $sSrcKey
* @param $sDestKey
*
* @return void
* @api
*/
public function AddRelation($sSrcKey, $sDestKey) public function AddRelation($sSrcKey, $sDestKey)
{ {
if (!array_key_exists($sSrcKey, $this->relations)) if (!array_key_exists($sSrcKey, $this->relations))
@@ -207,7 +260,7 @@ class RestResultWithRelations extends RestResultWithObjects
/** /**
* Deletion result codes for a target object (either deleted or updated) * Deletion result codes for a target object (either deleted or updated)
* *
* @package Extensibility * @package RESTExtensibilityAPI
* @api * @api
* @since 2.0.1 * @since 2.0.1
*/ */
@@ -215,30 +268,37 @@ class RestDelete
{ {
/** /**
* Result: Object deleted as per the initial request * Result: Object deleted as per the initial request
* @api
*/ */
const OK = 0; const OK = 0;
/** /**
* Result: general issue (user rights or ... ?) * Result: general issue (user rights or ... ?)
* @api
*/ */
const ISSUE = 1; const ISSUE = 1;
/** /**
* Result: Must be deleted to preserve database integrity * Result: Must be deleted to preserve database integrity
* @api
*/ */
const AUTO_DELETE = 2; const AUTO_DELETE = 2;
/** /**
* Result: Must be deleted to preserve database integrity, but that is NOT possible * Result: Must be deleted to preserve database integrity, but that is NOT possible
* @api
*/ */
const AUTO_DELETE_ISSUE = 3; const AUTO_DELETE_ISSUE = 3;
/** /**
* Result: Must be deleted to preserve database integrity, but this must be requested explicitely * Result: Must be deleted to preserve database integrity, but this must be requested explicitly
* @api
*/ */
const REQUEST_EXPLICITELY = 4; const REQUEST_EXPLICITELY = 4;
/** /**
* Result: Must be updated to preserve database integrity * Result: Must be updated to preserve database integrity
* @api
*/ */
const AUTO_UPDATE = 5; const AUTO_UPDATE = 5;
/** /**
* Result: Must be updated to preserve database integrity, but that is NOT possible * Result: Must be updated to preserve database integrity, but that is NOT possible
* @api
*/ */
const AUTO_UPDATE_ISSUE = 6; const AUTO_UPDATE_ISSUE = 6;
} }

View File

@@ -11,7 +11,7 @@ namespace Combodo\iTop\Application\UI\Base;
/** /**
* Class AbstractUIBlockFactory * Class AbstractUIBlockFactory
* *
* @package Combodo\iTop\Application\UI\Base * @package UIBlockExtensibilityAPI
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @since 3.0.0 * @since 3.0.0
* @api * @api
@@ -19,11 +19,13 @@ namespace Combodo\iTop\Application\UI\Base;
abstract class AbstractUIBlockFactory implements iUIBlockFactory abstract class AbstractUIBlockFactory implements iUIBlockFactory
{ {
/** /**
* @api
* @var string * @var string
* @see static::GetTwigTagName() * @see static::GetTwigTagName()
*/ */
public const TWIG_TAG_NAME = 'UIBlock'; public const TWIG_TAG_NAME = 'UIBlock';
/** /**
* @api
* @var string * @var string
* @see static::GetUIBlockClassName() * @see static::GetUIBlockClassName()
*/ */

View File

@@ -25,7 +25,7 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class AlertUIBlockFactory * Class AlertUIBlockFactory
* *
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com> * @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Alert * @package UIBlockExtensibilityAPI
* @since 3.0.0 * @since 3.0.0
* @api * @api
* *
@@ -41,6 +41,7 @@ class AlertUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a basis Alert component * Make a basis Alert component
* *
* @api
* @param string $sTitle Title of the alert * @param string $sTitle Title of the alert
* @param string $sContent The raw HTML content, must be already sanitized * @param string $sContent The raw HTML content, must be already sanitized
* @param string|null $sId id of the html block * @param string|null $sId id of the html block
@@ -55,6 +56,7 @@ class AlertUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make an Alert component for informational messages * Make an Alert component for informational messages
* *
* @api
* @param string $sTitle Title of the alert * @param string $sTitle Title of the alert
* @param string $sContent The raw HTML content, must be already sanitized * @param string $sContent The raw HTML content, must be already sanitized
* @param string|null $sId id of the html block * @param string|null $sId id of the html block
@@ -70,6 +72,7 @@ class AlertUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make an Alert component for successful messages * Make an Alert component for successful messages
* *
* @api
* @param string $sTitle Title of the alert * @param string $sTitle Title of the alert
* @param string $sContent The raw HTML content, must be already sanitized * @param string $sContent The raw HTML content, must be already sanitized
* @param string|null $sId * @param string|null $sId
@@ -84,6 +87,7 @@ class AlertUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make an Alert component for warning messages * Make an Alert component for warning messages
* *
* @api
* @param string $sTitle Title of the alert * @param string $sTitle Title of the alert
* @param string $sContent The raw HTML content, must be already sanitized * @param string $sContent The raw HTML content, must be already sanitized
* @param string|null $sId id of the html block * @param string|null $sId id of the html block
@@ -98,6 +102,7 @@ class AlertUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make an Alert component for danger messages * Make an Alert component for danger messages
* *
* @api
* @param string $sTitle Title of the alert * @param string $sTitle Title of the alert
* @param string $sContent The raw HTML content, must be already sanitized * @param string $sContent The raw HTML content, must be already sanitized
* @param string|null $sId id of the html block * @param string|null $sId id of the html block
@@ -112,6 +117,7 @@ class AlertUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make an Alert component for failure messages * Make an Alert component for failure messages
* *
* @api
* @param string $sTitle Title of the alert * @param string $sTitle Title of the alert
* @param string $sContent The raw HTML content, must be already sanitized * @param string $sContent The raw HTML content, must be already sanitized
* @param string|null $sId id of the html block * @param string|null $sId id of the html block
@@ -126,6 +132,7 @@ class AlertUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make an Alert component with primary color scheme * Make an Alert component with primary color scheme
* *
* @api
* @param string $sTitle Title of the alert * @param string $sTitle Title of the alert
* @param string $sContent The raw HTML content, must be already sanitized * @param string $sContent The raw HTML content, must be already sanitized
* @param string|null $sId id of the html block * @param string|null $sId id of the html block
@@ -140,6 +147,7 @@ class AlertUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make an Alert component with secondary color scheme * Make an Alert component with secondary color scheme
* *
* @api
* @param string $sTitle Title of the alert * @param string $sTitle Title of the alert
* @param string $sContent The raw HTML content, must be already sanitized * @param string $sContent The raw HTML content, must be already sanitized
* @param string|null $sId id of the html block * @param string|null $sId id of the html block

View File

@@ -27,9 +27,9 @@ use utils;
* Class ButtonUIBlockFactory * Class ButtonUIBlockFactory
* *
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com> * @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Button * @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api * @api
* @since 3.0.0
* *
* @link <itop_url>/test/VisualTest/Backoffice/RenderAllUiBlocks.php#title-buttons to see live examples * @link <itop_url>/test/VisualTest/Backoffice/RenderAllUiBlocks.php#title-buttons to see live examples
*/ */
@@ -47,6 +47,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a basis Button component for any purpose * Make a basis Button component for any purpose
* *
* @api
* @param string $sLabel * @param string $sLabel
* @param string|null $sName See {@link Button::$sName} * @param string|null $sName See {@link Button::$sName}
* @param string|null $sId * @param string|null $sId

View File

@@ -15,9 +15,9 @@ use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
* Class ButtonGroupUIBlockFactory * Class ButtonGroupUIBlockFactory
* *
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com> * @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Button * @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api * @api
* @since 3.0.0
*/ */
class ButtonGroupUIBlockFactory extends AbstractUIBlockFactory class ButtonGroupUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -29,6 +29,7 @@ class ButtonGroupUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a button that has a primary action ($oButton) but also an options menu ($oMenu) on the side * Make a button that has a primary action ($oButton) but also an options menu ($oMenu) on the side
* *
* @api
* @param \Combodo\iTop\Application\UI\Base\Component\Button\Button $oButton * @param \Combodo\iTop\Application\UI\Base\Component\Button\Button $oButton
* @param \Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu $oMenu * @param \Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu $oMenu
* *

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class CollapsibleSectionUIBlockFactory * Class CollapsibleSectionUIBlockFactory
* *
* @author Pierre Goiffon <pierre.goiffon@combodo.com> * @author Pierre Goiffon <pierre.goiffon@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\CollapsibleSection * @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api * @api
* @since 3.0.0
*/ */
class CollapsibleSectionUIBlockFactory extends AbstractUIBlockFactory class CollapsibleSectionUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -26,6 +26,7 @@ class CollapsibleSectionUIBlockFactory extends AbstractUIBlockFactory
public const UI_BLOCK_CLASS_NAME = CollapsibleSection::class; public const UI_BLOCK_CLASS_NAME = CollapsibleSection::class;
/** /**
* @api
* @param string $sTitle * @param string $sTitle
* @param string|null $sId * @param string|null $sId
* *

View File

@@ -6,8 +6,8 @@
namespace Combodo\iTop\Application\UI\Base\Component\DataTable; namespace Combodo\iTop\Application\UI\Base\Component\DataTable;
use ApplicationException;
use ApplicationContext; use ApplicationContext;
use ApplicationException;
use appUserPreferences; use appUserPreferences;
use AttributeLinkedSet; use AttributeLinkedSet;
use cmdbAbstractObject; use cmdbAbstractObject;
@@ -38,9 +38,9 @@ use WebPage;
* Class DataTableUIBlockFactory * Class DataTableUIBlockFactory
* *
* @author Anne-Catherine Cognet <anne-catherine.cognet@combodo.com> * @author Anne-Catherine Cognet <anne-catherine.cognet@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\DataTable * @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api * @api
* @since 3.0.0
*/ */
class DataTableUIBlockFactory extends AbstractUIBlockFactory class DataTableUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -50,6 +50,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
public const UI_BLOCK_CLASS_NAME = DataTable::class; public const UI_BLOCK_CLASS_NAME = DataTable::class;
/** /**
* @api
* @param \WebPage $oPage * @param \WebPage $oPage
* @param string $sListId * @param string $sListId
* @param \DBObjectSet $oSet * @param \DBObjectSet $oSet
@@ -74,6 +75,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
} }
/** /**
* @api
* @param \WebPage $oPage * @param \WebPage $oPage
* @param string $sListId * @param string $sListId
* @param DBObjectSet $oSet * @param DBObjectSet $oSet
@@ -225,6 +227,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a basis Panel component * Make a basis Panel component
* *
* @api
* @param string $sListId * @param string $sListId
* @param \DBObjectSet $oSet * @param \DBObjectSet $oSet
* @param array $aExtraParams * @param array $aExtraParams
@@ -525,6 +528,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
} }
/** /**
* @api
* @param string $sListId * @param string $sListId
* @param DBObjectSet $oSet * @param DBObjectSet $oSet
* @param array $aExtraParams * @param array $aExtraParams
@@ -773,7 +777,9 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
* @param string $sSelectMode * @param string $sSelectMode
* @param string $sFilter * @param string $sFilter
* @param int $iLength * @param int $iLength
* @param array $aClassAliases
* @param array $aExtraParams * @param array $aExtraParams
* @param string $sTableId
* *
* @return array * @return array
* @throws \Exception * @throws \Exception
@@ -953,6 +959,7 @@ JS;
} }
/** /**
* @api
* @param string $sTitle * @param string $sTitle
* @param array $aColumns * @param array $aColumns
* @param array $aData * @param array $aData
@@ -996,6 +1003,7 @@ JS;
} }
/** /**
* @api
* @param string $sRef * @param string $sRef
* @param array $aColumns * @param array $aColumns
* @param array $aData * @param array $aData

View File

@@ -16,9 +16,10 @@ use Combodo\iTop\Application\UI\Base\UIBlock;
* *
* Use it to make a "field" which is composed of a label and a value (which can be read-only or editable) * Use it to make a "field" which is composed of a label and a value (which can be read-only or editable)
* *
* @api
* @package UIBlockExtensibilityAPI
* @author Pierre Goiffon <pierre.goiffon@combodo.com> * @author Pierre Goiffon <pierre.goiffon@combodo.com>
* @since 3.0.0 * @since 3.0.0
* @internal
*/ */
class FieldUIBlockFactory extends AbstractUIBlockFactory class FieldUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -27,6 +28,12 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */ /** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = Field::class; public const UI_BLOCK_CLASS_NAME = Field::class;
/**
* @api
* @param $aParams
*
* @return \Combodo\iTop\Application\UI\Base\Component\Field\Field
*/
public static function MakeFromParams($aParams) public static function MakeFromParams($aParams)
{ {
$oValue = new Html($aParams['value']); $oValue = new Html($aParams['value']);
@@ -75,6 +82,14 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
$oField->$sMethodName((($iParamsFlags & $iConstant) === $iConstant)); $oField->$sMethodName((($iParamsFlags & $iConstant) === $iConstant));
} }
/**
* @api
* @param string $sLabel
* @param \Combodo\iTop\Application\UI\Base\UIBlock $oInput
* @param string|null $sLayout
*
* @return \Combodo\iTop\Application\UI\Base\Component\Field\Field
*/
public static function MakeFromObject(string $sLabel, UIBlock $oInput, ?string $sLayout = null) public static function MakeFromObject(string $sLabel, UIBlock $oInput, ?string $sLayout = null)
{ {
$oField = new Field($sLabel, $oInput); $oField = new Field($sLabel, $oInput);
@@ -86,6 +101,13 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
return $oField; return $oField;
} }
/**
* @api
* @param string $sLabel
* @param string $sValueHtml
*
* @return \Combodo\iTop\Application\UI\Base\Component\Field\Field
*/
public static function MakeLarge(string $sLabel, string $sValueHtml = '') public static function MakeLarge(string $sLabel, string $sValueHtml = '')
{ {
$oField = new Field($sLabel, new Html($sValueHtml)); $oField = new Field($sLabel, new Html($sValueHtml));
@@ -93,6 +115,13 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
return $oField; return $oField;
} }
/**
* @api
* @param string $sLabel
* @param string $sValueHtml
*
* @return \Combodo\iTop\Application\UI\Base\Component\Field\Field
*/
public static function MakeSmall(string $sLabel, string $sValueHtml = '') public static function MakeSmall(string $sLabel, string $sValueHtml = '')
{ {
$oField = new Field($sLabel, new Html($sValueHtml)); $oField = new Field($sLabel, new Html($sValueHtml));
@@ -100,6 +129,14 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
return $oField; return $oField;
} }
/**
* @api
* @param string $sLabel
* @param string $sLayout
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Field\Field
*/
public static function MakeStandard(string $sLabel = '', string $sLayout = Field::ENUM_FIELD_LAYOUT_SMALL, ?string $sId = null) public static function MakeStandard(string $sLabel = '', string $sLayout = Field::ENUM_FIELD_LAYOUT_SMALL, ?string $sId = null)
{ {
$oField = new Field($sLabel, null, $sId); $oField = new Field($sLabel, null, $sId);

View File

@@ -16,7 +16,7 @@ use utils;
* Class FieldBadgeUIBlockFactory * Class FieldBadgeUIBlockFactory
* *
* @author Eric espie <eric.espie@combodo.com> * @author Eric espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\FieldBadge * @package UIBlockExtensibilityAPI
* @since 3.0.0 * @since 3.0.0
* @internal * @internal
*/ */

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class FieldSetUIBlockFactory * Class FieldSetUIBlockFactory
* *
* @author eric Espie <eric.espie@combodo.com> * @author eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\FieldSet * @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api * @api
* @since 3.0.0
*/ */
class FieldSetUIBlockFactory extends AbstractUIBlockFactory class FieldSetUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -26,6 +26,7 @@ class FieldSetUIBlockFactory extends AbstractUIBlockFactory
public const UI_BLOCK_CLASS_NAME = FieldSet::class; public const UI_BLOCK_CLASS_NAME = FieldSet::class;
/** /**
* @api
* @param string $sLegend * @param string $sLegend
* @param string|null $sId * @param string|null $sId
* *

View File

@@ -14,7 +14,7 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class FormUIBlockFactory * Class FormUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Form * @package UUIBlockExtensibilityAPI
* @since 3.0.0 * @since 3.0.0
* @api * @api
*/ */
@@ -26,6 +26,7 @@ class FormUIBlockFactory extends AbstractUIBlockFactory
public const UI_BLOCK_CLASS_NAME = Form::class; public const UI_BLOCK_CLASS_NAME = Form::class;
/** /**
* @api
* @param string|null $sId * @param string|null $sId
* *
* @return \Combodo\iTop\Application\UI\Base\Component\Form\Form An HTML form in which you can add UIBlocks * @return \Combodo\iTop\Application\UI\Base\Component\Form\Form An HTML form in which you can add UIBlocks

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class FileSelectUIBlockFactory * Class FileSelectUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Input\FileSelect * @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api * @api
* @since 3.0.0
*/ */
class FileSelectUIBlockFactory extends AbstractUIBlockFactory class FileSelectUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -26,6 +26,7 @@ class FileSelectUIBlockFactory extends AbstractUIBlockFactory
public const UI_BLOCK_CLASS_NAME = FileSelect::class; public const UI_BLOCK_CLASS_NAME = FileSelect::class;
/** /**
* @api
* @param string $sName * @param string $sName
* @param string|null $sId * @param string|null $sId
* *

View File

@@ -15,9 +15,9 @@ use Combodo\iTop\Application\UI\Base\Component\Field\Field;
* Class InputUIBlockFactory * Class InputUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Input * @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0 * @since 3.0.0
* @internal
*/ */
class InputUIBlockFactory extends AbstractUIBlockFactory class InputUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -26,6 +26,14 @@ class InputUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */ /** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = Input::class; public const UI_BLOCK_CLASS_NAME = Input::class;
/**
* @api
* @param string $sName
* @param string $sValue
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Input\Input
*/
public static function MakeForHidden(string $sName, string $sValue, ?string $sId = null) public static function MakeForHidden(string $sName, string $sValue, ?string $sId = null)
{ {
$oInput = new Input($sId); $oInput = new Input($sId);
@@ -37,6 +45,15 @@ class InputUIBlockFactory extends AbstractUIBlockFactory
return $oInput; return $oInput;
} }
/**
* @api
* @param string $sType
* @param string $sName
* @param string $sValue
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Input\Input
*/
public static function MakeStandard(string $sType, string $sName, string $sValue, ?string $sId = null) public static function MakeStandard(string $sType, string $sName, string $sValue, ?string $sId = null)
{ {
$oInput = new Input($sId); $oInput = new Input($sId);
@@ -49,6 +66,7 @@ class InputUIBlockFactory extends AbstractUIBlockFactory
} }
/** /**
* @api
* @see Field component that is better adapter when dealing with a standard iTop form * @see Field component that is better adapter when dealing with a standard iTop form
* *
* @param string $sLabel * @param string $sLabel
@@ -71,6 +89,15 @@ class InputUIBlockFactory extends AbstractUIBlockFactory
return static::MakeInputWithLabel($sInputName, $sLabel, $oInput, $sInputId); return static::MakeInputWithLabel($sInputName, $sLabel, $oInput, $sInputId);
} }
/**
* @api
* @param string $sName
* @param string $sLabel
* @param \Combodo\iTop\Application\UI\Base\Component\Input\Input $oInput
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Input\InputWithLabel
*/
private static function MakeInputWithLabel(string $sName, string $sLabel, Input $oInput, ?string $sId = null) private static function MakeInputWithLabel(string $sName, string $sLabel, Input $oInput, ?string $sId = null)
{ {
$oInput->SetName($sName); $oInput->SetName($sName);

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class SelectOptionUIBlockFactory * Class SelectOptionUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Input\Select * @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0 * @since 3.0.0
* @internal
*/ */
class SelectOptionUIBlockFactory extends AbstractUIBlockFactory class SelectOptionUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -25,6 +25,15 @@ class SelectOptionUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */ /** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = SelectOption::class; public const UI_BLOCK_CLASS_NAME = SelectOption::class;
/**
* @api
* @param string $sValue
* @param string $sLabel
* @param bool $bSelected
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOption
*/
public static function MakeForSelectOption(string $sValue, string $sLabel, bool $bSelected, ?string $sId = null) public static function MakeForSelectOption(string $sValue, string $sLabel, bool $bSelected, ?string $sId = null)
{ {
$oInput = new SelectOption($sId); $oInput = new SelectOption($sId);

View File

@@ -15,9 +15,9 @@ use Combodo\iTop\Application\UI\Base\Component\Input\Select\Select;
* Class SelectUIBlockFactory * Class SelectUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Input * @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0 * @since 3.0.0
* @internal
*/ */
class SelectUIBlockFactory extends AbstractUIBlockFactory class SelectUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -29,6 +29,7 @@ class SelectUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Create a default Select input * Create a default Select input
* *
* @api
* @param string $sName {@see Select::$sName} * @param string $sName {@see Select::$sName}
* @param string|null $sId {@see UIBlock::$sId} * @param string|null $sId {@see UIBlock::$sId}
* *
@@ -47,6 +48,7 @@ class SelectUIBlockFactory extends AbstractUIBlockFactory
* *
* If you need to have a real field with a label, you might use a {@link Field} component instead * If you need to have a real field with a label, you might use a {@link Field} component instead
* *
* @api
* @param string $sName {@see Select::$sName} * @param string $sName {@see Select::$sName}
* @param string $sLabel {@see Select::$sLabel} * @param string $sLabel {@see Select::$sLabel}
* @param string|null $sId {@see UIBlock::$sId} * @param string|null $sId {@see UIBlock::$sId}

View File

@@ -25,9 +25,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class PanelUIBlockFactory * Class PanelUIBlockFactory
* *
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com> * @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Panel * @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api * @api
* @since 3.0.0
* *
* @link <itop_url>/test/VisualTest/Backoffice/RenderAllUiBlocks.php#title-panels to see live examples * @link <itop_url>/test/VisualTest/Backoffice/RenderAllUiBlocks.php#title-panels to see live examples
*/ */
@@ -41,6 +41,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a basis Panel component * Make a basis Panel component
* *
* @api
* @param string $sTitle * @param string $sTitle
* @param string|null $sSubTitle * @param string|null $sSubTitle
* *
@@ -60,6 +61,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a Panel component for informational messages * Make a Panel component for informational messages
* *
* @api
* @param string $sTitle * @param string $sTitle
* @param string|null $sSubTitle * @param string|null $sSubTitle
* *
@@ -79,6 +81,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a Panel component for successful messages * Make a Panel component for successful messages
* *
* @api
* @param string $sTitle * @param string $sTitle
* @param string|null $sSubTitle * @param string|null $sSubTitle
* *
@@ -98,6 +101,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a Panel component for warning messages * Make a Panel component for warning messages
* *
* @api
* @param string $sTitle * @param string $sTitle
* @param string|null $sSubTitle * @param string|null $sSubTitle
* *
@@ -117,6 +121,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a Panel component for danger messages * Make a Panel component for danger messages
* *
* @api
* @param string $sTitle * @param string $sTitle
* @param string|null $sSubTitle * @param string|null $sSubTitle
* *
@@ -136,6 +141,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a Panel component for failure messages * Make a Panel component for failure messages
* *
* @api
* @param string $sTitle * @param string $sTitle
* @param string|null $sSubTitle * @param string|null $sSubTitle
* *
@@ -155,6 +161,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a Panel component with primary color scheme * Make a Panel component with primary color scheme
* *
* @api
* @param string $sTitle * @param string $sTitle
* @param string|null $sSubTitle * @param string|null $sSubTitle
* *
@@ -174,6 +181,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a Panel component with secondary color scheme * Make a Panel component with secondary color scheme
* *
* @api
* @param string $sTitle * @param string $sTitle
* @param string|null $sSubTitle * @param string|null $sSubTitle
* *
@@ -193,6 +201,7 @@ class PanelUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make a Panel component with the specific $sClass color scheme * Make a Panel component with the specific $sClass color scheme
* *
* @api
* @param string $sClass Class of the object the panel is for * @param string $sClass Class of the object the panel is for
* @param string $sTitle * @param string $sTitle
* @param string|null $sSubTitle * @param string|null $sSubTitle

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class SpinnerUIBlockFactory * Class SpinnerUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Spinner * @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0 * @since 3.0.0
* @internal
*/ */
class SpinnerUIBlockFactory extends AbstractUIBlockFactory class SpinnerUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -25,6 +25,12 @@ class SpinnerUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */ /** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = Spinner::class; public const UI_BLOCK_CLASS_NAME = Spinner::class;
/**
* @api
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Spinner\Spinner
*/
public static function MakeStandard(?string $sId = null) public static function MakeStandard(?string $sId = null)
{ {
return new Spinner($sId); return new Spinner($sId);

View File

@@ -16,9 +16,9 @@ use Combodo\iTop\Application\UI\Base\UIBlock;
* Class TitleUIBlockFactory * Class TitleUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Title * @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0 * @since 3.0.0
* @internal
*/ */
class TitleUIBlockFactory extends AbstractUIBlockFactory class TitleUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -27,11 +27,28 @@ class TitleUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */ /** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = Title::class; public const UI_BLOCK_CLASS_NAME = Title::class;
/**
* @api
* @param string $sTitle
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Title\Title
*/
public static function MakeForPage(string $sTitle, ?string $sId = null) public static function MakeForPage(string $sTitle, ?string $sId = null)
{ {
return new Title(new Text($sTitle), 1, $sId); return new Title(new Text($sTitle), 1, $sId);
} }
/**
* @api
* @param string $sTitle
* @param string $sIconUrl
* @param string $sIconCoverMethod
* @param bool $bIsMedallion
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Title\Title
*/
public static function MakeForPageWithIcon( public static function MakeForPageWithIcon(
string $sTitle, string $sIconUrl, string $sIconCoverMethod = Title::DEFAULT_ICON_COVER_METHOD, bool $bIsMedallion = true, string $sTitle, string $sIconUrl, string $sIconCoverMethod = Title::DEFAULT_ICON_COVER_METHOD, bool $bIsMedallion = true,
?string $sId = null ?string $sId = null
@@ -43,11 +60,27 @@ class TitleUIBlockFactory extends AbstractUIBlockFactory
return $oTitle; return $oTitle;
} }
/**
* @api
* @param string $sTitle
* @param int $iLevel
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Title\Title
*/
public static function MakeNeutral(string $sTitle, int $iLevel = 1, ?string $sId = null) public static function MakeNeutral(string $sTitle, int $iLevel = 1, ?string $sId = null)
{ {
return new Title(new Text($sTitle), $iLevel, $sId); return new Title(new Text($sTitle), $iLevel, $sId);
} }
/**
* @api
* @param \Combodo\iTop\Application\UI\Base\UIBlock $oTitle
* @param int $iLevel
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Title\Title
*/
public static function MakeStandard(UIBlock $oTitle, int $iLevel = 1, ?string $sId = null) public static function MakeStandard(UIBlock $oTitle, int $iLevel = 1, ?string $sId = null)
{ {
return new Title($oTitle, $iLevel, $sId); return new Title($oTitle, $iLevel, $sId);

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class ToolbarSeparatorUIBlockFactory * Class ToolbarSeparatorUIBlockFactory
* *
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com> * @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Toolbar\Separator * @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api * @api
* @since 3.0.0
*/ */
class ToolbarSeparatorUIBlockFactory extends AbstractUIBlockFactory class ToolbarSeparatorUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -26,6 +26,7 @@ class ToolbarSeparatorUIBlockFactory extends AbstractUIBlockFactory
public const UI_BLOCK_CLASS_NAME = Toolbar::class; public const UI_BLOCK_CLASS_NAME = Toolbar::class;
/** /**
* @api
* @param string|null $sId * @param string|null $sId
* *
* @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\Separator\VerticalSeparator * @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\Separator\VerticalSeparator

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class ToolbarSpacerUIBlockFactory * Class ToolbarSpacerUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarSpacer * @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0 * @since 3.0.0
* @internal
*/ */
class ToolbarSpacerUIBlockFactory extends AbstractUIBlockFactory class ToolbarSpacerUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -26,6 +26,7 @@ class ToolbarSpacerUIBlockFactory extends AbstractUIBlockFactory
public const UI_BLOCK_CLASS_NAME = ToolbarSpacer::class; public const UI_BLOCK_CLASS_NAME = ToolbarSpacer::class;
/** /**
* @api
* @param string|null $sId * @param string|null $sId
* *
* @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarSpacer\ToolbarSpacer * @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarSpacer\ToolbarSpacer

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class ToolbarUIBlockFactory * Class ToolbarUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Toolbar * @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0 * @since 3.0.0
* @internal
*/ */
class ToolbarUIBlockFactory extends AbstractUIBlockFactory class ToolbarUIBlockFactory extends AbstractUIBlockFactory
{ {
@@ -25,16 +25,36 @@ class ToolbarUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */ /** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = Toolbar::class; public const UI_BLOCK_CLASS_NAME = Toolbar::class;
/**
* @api
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\Toolbar
*/
public static function MakeForAction(string $sId = null) public static function MakeForAction(string $sId = null)
{ {
return new Toolbar($sId, ['ibo-toolbar--action']); return new Toolbar($sId, ['ibo-toolbar--action']);
} }
/**
* @api
* @param string|null $sId
* @param array $aContainerClasses
*
* @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\Toolbar
*/
public static function MakeStandard(string $sId = null, array $aContainerClasses = []) public static function MakeStandard(string $sId = null, array $aContainerClasses = [])
{ {
return new Toolbar($sId, $aContainerClasses); return new Toolbar($sId, $aContainerClasses);
} }
/**
* @api
* @param string|null $sId
* @param array $aContainerClasses
*
* @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\Toolbar
*/
public static function MakeForButton(string $sId = null, array $aContainerClasses = []) public static function MakeForButton(string $sId = null, array $aContainerClasses = [])
{ {
return new Toolbar($sId, array_merge($aContainerClasses, ['ibo-toolbar--button'])); return new Toolbar($sId, array_merge($aContainerClasses, ['ibo-toolbar--button']));

View File

@@ -15,7 +15,7 @@ use Combodo\iTop\Application\UI\Base\UIBlock;
* Class ColumnUIBlockFactory * Class ColumnUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column * @package UIBlockExtensibilityAPI
* @since 3.0.0 * @since 3.0.0
* @api * @api
*/ */
@@ -26,6 +26,12 @@ class ColumnUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */ /** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = Column::class; public const UI_BLOCK_CLASS_NAME = Column::class;
/**
* @api
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\Column
*/
public static function MakeStandard(?string $sId = null) public static function MakeStandard(?string $sId = null)
{ {
$oInput = new Column($sId); $oInput = new Column($sId);
@@ -33,6 +39,13 @@ class ColumnUIBlockFactory extends AbstractUIBlockFactory
return $oInput; return $oInput;
} }
/**
* @api
* @param \Combodo\iTop\Application\UI\Base\UIBlock $oBlock
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\Column
*/
public static function MakeForBlock(UIBlock $oBlock, ?string $sId = null) public static function MakeForBlock(UIBlock $oBlock, ?string $sId = null)
{ {
$oInput = new Column($sId); $oInput = new Column($sId);

View File

@@ -13,7 +13,7 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class MultiColumnUIBlockFactory * Class MultiColumnUIBlockFactory
* *
* @author Eric Espie <eric.espie@combodo.com> * @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Layout\MultiColumn * @package UIBlockExtensibilityAPI
* @since 3.0.0 * @since 3.0.0
* @api * @api
*/ */
@@ -24,6 +24,12 @@ class MultiColumnUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */ /** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = MultiColumn::class; public const UI_BLOCK_CLASS_NAME = MultiColumn::class;
/**
* @api
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumn
*/
public static function MakeStandard(?string $sId = null) public static function MakeStandard(?string $sId = null)
{ {
$oInput = new MultiColumn($sId); $oInput = new MultiColumn($sId);

View File

@@ -15,7 +15,8 @@ use Combodo\iTop\Application\UI\Base\Component\Html\Html;
* Class UIContentBlockUIBlockFactory * Class UIContentBlockUIBlockFactory
* *
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com> * @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Layout * @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0 * @since 3.0.0
*/ */
class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
@@ -28,6 +29,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Make an empty UIContentBlock which can be used to embed anything or to surround another block with specific CSS classes. * Make an empty UIContentBlock which can be used to embed anything or to surround another block with specific CSS classes.
* *
* @api
* @param string|null $sId * @param string|null $sId
* @param array $aContainerClasses * @param array $aContainerClasses
* *
@@ -42,6 +44,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
* Used to display a block of code like <pre> but allows line break. * Used to display a block of code like <pre> but allows line break.
* The \n are replaced by <br> * The \n are replaced by <br>
* *
* @api
* @param string $sCode * @param string $sCode
* @param string|null $sId * @param string|null $sId
* *
@@ -59,6 +62,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
/** /**
* Used to display a block of preformatted text in a <pre> tag. * Used to display a block of preformatted text in a <pre> tag.
* *
* @api
* @param string $sCode * @param string $sCode
* @param string|null $sId * @param string|null $sId
* *