📝 Change packages for auto-documentation

This commit is contained in:
Eric Espie
2022-12-29 12:38:31 +01:00
parent 23b4d4cb6b
commit 88d9a29599
24 changed files with 305 additions and 53 deletions

View File

@@ -30,18 +30,40 @@
/**
* Element of the response formed by RestResultWithObjects
*
* @package REST Services
* @package RESTExtensibilityAPI
* @api
*/
class ObjectResult
{
/**
* @var int
* @api
*/
public $code;
/**
* @var string
* @api
*/
public $message;
/**
* @var mixed|null
* @api
*/
public $class;
/**
* @var mixed|null
* @api
*/
public $key;
/**
* @var array
* @api
*/
public $fields;
/**
* Default constructor
* @api
*/
public function __construct($sClass = null, $iId = null)
{
@@ -54,11 +76,17 @@ class ObjectResult
/**
* Helper to make an output value for a given attribute
*
*
* @api
* @param DBObject $oObject The object being reported
* @param string $sAttCode The attribute code (must be valid)
* @param boolean $bExtendedOutput Output all of the link set attributes ?
*
* @return string A scalar representation of the value
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/
protected function MakeResultValue(DBObject $oObject, $sAttCode, $bExtendedOutput = false)
{
@@ -112,11 +140,17 @@ class ObjectResult
/**
* Report the value for the given object attribute
*
*
* @api
* @param DBObject $oObject The object being reported
* @param string $sAttCode The attribute code (must be valid)
* @param boolean $bExtendedOutput Output all of the link set attributes ?
*
* @return void
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/
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
*
* @package RESTExtensibilityAPI
* @package REST Services
* @package RESTExtensibilityAPI
* @api
*/
class RestResultWithObjects extends RestResult
@@ -139,13 +172,19 @@ class RestResultWithObjects extends RestResult
/**
* 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 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 ?
*
* @return void
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/
public function AddObject($iCode, $sMessage, $oObject, $aFieldSpec = null, $bExtendedOutput = false)
{
@@ -183,16 +222,30 @@ class RestResultWithObjects extends RestResult
}
}
/**
* @package RESTExtensibilityAPI
* @api
*/
class RestResultWithRelations extends RestResultWithObjects
{
public $relations;
/**
* @api
*/
public function __construct()
{
parent::__construct();
$this->relations = array();
}
/**
* @param $sSrcKey
* @param $sDestKey
*
* @return void
* @api
*/
public function AddRelation($sSrcKey, $sDestKey)
{
if (!array_key_exists($sSrcKey, $this->relations))
@@ -214,30 +267,37 @@ class RestDelete
{
/**
* Result: Object deleted as per the initial request
* @api
*/
const OK = 0;
/**
* Result: general issue (user rights or ... ?)
* Result: general issue (user rights or ... ?)
* @api
*/
const ISSUE = 1;
/**
* Result: Must be deleted to preserve database integrity
* Result: Must be deleted to preserve database integrity
* @api
*/
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;
/**
* 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;
/**
* Result: Must be updated to preserve database integrity
* @api
*/
const AUTO_UPDATE = 5;
/**
* Result: Must be updated to preserve database integrity, but that is NOT possible
* @api
*/
const AUTO_UPDATE_ISSUE = 6;
}

View File

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

View File

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

View File

@@ -27,9 +27,9 @@ use utils;
* Class ButtonUIBlockFactory
*
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Button
* @since 3.0.0
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
*
* @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
*
* @api
* @param string $sLabel
* @param string|null $sName See {@link Button::$sName}
* @param string|null $sId

View File

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

View File

@@ -6,8 +6,8 @@
namespace Combodo\iTop\Application\UI\Base\Component\DataTable;
use ApplicationException;
use ApplicationContext;
use ApplicationException;
use appUserPreferences;
use AttributeLinkedSet;
use cmdbAbstractObject;
@@ -35,9 +35,9 @@ use WebPage;
* Class DataTableUIBlockFactory
*
* @author Anne-Catherine Cognet <anne-catherine.cognet@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\DataTable
* @since 3.0.0
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
*/
class DataTableUIBlockFactory extends AbstractUIBlockFactory
{
@@ -47,6 +47,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
public const UI_BLOCK_CLASS_NAME = DataTable::class;
/**
* @api
* @param \WebPage $oPage
* @param string $sListId
* @param \DBObjectSet $oSet
@@ -71,6 +72,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
}
/**
* @api
* @param \WebPage $oPage
* @param string $sListId
* @param DBObjectSet $oSet
@@ -183,6 +185,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
/**
* Make a basis Panel component
*
* @api
* @param string $sListId
* @param \DBObjectSet $oSet
* @param array $aExtraParams
@@ -479,6 +482,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
}
/**
* @api
* @param string $sListId
* @param DBObjectSet $oSet
* @param array $aExtraParams
@@ -721,7 +725,9 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
* @param string $sSelectMode
* @param string $sFilter
* @param int $iLength
* @param array $aClassAliases
* @param array $aExtraParams
* @param string $sTableId
*
* @return array
* @throws \Exception
@@ -901,6 +907,7 @@ JS;
}
/**
* @api
* @param string $sTitle
* @param array $aColumns
* @param array $aData
@@ -936,6 +943,7 @@ JS;
}
/**
* @api
* @param string $sRef
* @param array $aColumns
* @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)
*
* @api
* @package UIBlockExtensibilityAPI
* @author Pierre Goiffon <pierre.goiffon@combodo.com>
* @since 3.0.0
* @internal
*/
class FieldUIBlockFactory extends AbstractUIBlockFactory
{
@@ -27,6 +28,12 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */
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)
{
$oValue = new Html($aParams['value']);
@@ -75,6 +82,14 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
$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)
{
$oField = new Field($sLabel, $oInput);
@@ -86,6 +101,13 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
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 = '')
{
$oField = new Field($sLabel, new Html($sValueHtml));
@@ -93,6 +115,13 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
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 = '')
{
$oField = new Field($sLabel, new Html($sValueHtml));
@@ -100,6 +129,14 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
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)
{
$oField = new Field($sLabel, null, $sId);

View File

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

View File

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

View File

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

View File

@@ -15,9 +15,9 @@ use Combodo\iTop\Application\UI\Base\Component\Field\Field;
* Class InputUIBlockFactory
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Input
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
* @internal
*/
class InputUIBlockFactory extends AbstractUIBlockFactory
{
@@ -26,6 +26,14 @@ class InputUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */
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)
{
$oInput = new Input($sId);
@@ -37,6 +45,15 @@ class InputUIBlockFactory extends AbstractUIBlockFactory
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)
{
$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
*
* @param string $sLabel
@@ -71,6 +89,15 @@ class InputUIBlockFactory extends AbstractUIBlockFactory
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)
{
$oInput->SetName($sName);

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class SelectOptionUIBlockFactory
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Input\Select
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
* @internal
*/
class SelectOptionUIBlockFactory extends AbstractUIBlockFactory
{
@@ -25,6 +25,15 @@ class SelectOptionUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */
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)
{
$oInput = new SelectOption($sId);

View File

@@ -15,9 +15,9 @@ use Combodo\iTop\Application\UI\Base\Component\Input\Select\Select;
* Class SelectUIBlockFactory
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Input
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
* @internal
*/
class SelectUIBlockFactory extends AbstractUIBlockFactory
{
@@ -29,6 +29,7 @@ class SelectUIBlockFactory extends AbstractUIBlockFactory
/**
* Create a default Select input
*
* @api
* @param string $sName {@see Select::$sName}
* @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
*
* @api
* @param string $sName {@see Select::$sName}
* @param string $sLabel {@see Select::$sLabel}
* @param string|null $sId {@see UIBlock::$sId}

View File

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

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class SpinnerUIBlockFactory
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Spinner
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
* @internal
*/
class SpinnerUIBlockFactory extends AbstractUIBlockFactory
{
@@ -25,6 +25,12 @@ class SpinnerUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */
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)
{
return new Spinner($sId);

View File

@@ -16,9 +16,9 @@ use Combodo\iTop\Application\UI\Base\UIBlock;
* Class TitleUIBlockFactory
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Title
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
* @internal
*/
class TitleUIBlockFactory extends AbstractUIBlockFactory
{
@@ -27,11 +27,28 @@ class TitleUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */
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)
{
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(
string $sTitle, string $sIconUrl, string $sIconCoverMethod = Title::DEFAULT_ICON_COVER_METHOD, bool $bIsMedallion = true,
?string $sId = null
@@ -43,11 +60,27 @@ class TitleUIBlockFactory extends AbstractUIBlockFactory
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)
{
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)
{
return new Title($oTitle, $iLevel, $sId);

View File

@@ -14,9 +14,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class ToolbarSeparatorUIBlockFactory
*
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Toolbar\Separator
* @since 3.0.0
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
*/
class ToolbarSeparatorUIBlockFactory extends AbstractUIBlockFactory
{
@@ -26,6 +26,7 @@ class ToolbarSeparatorUIBlockFactory extends AbstractUIBlockFactory
public const UI_BLOCK_CLASS_NAME = Toolbar::class;
/**
* @api
* @param string|null $sId
*
* @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
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarSpacer
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
* @internal
*/
class ToolbarSpacerUIBlockFactory extends AbstractUIBlockFactory
{
@@ -26,6 +26,7 @@ class ToolbarSpacerUIBlockFactory extends AbstractUIBlockFactory
public const UI_BLOCK_CLASS_NAME = ToolbarSpacer::class;
/**
* @api
* @param string|null $sId
*
* @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
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Toolbar
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
* @internal
*/
class ToolbarUIBlockFactory extends AbstractUIBlockFactory
{
@@ -25,16 +25,36 @@ class ToolbarUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */
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)
{
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 = [])
{
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 = [])
{
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
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column
* @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api
*/
@@ -26,6 +26,12 @@ class ColumnUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */
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)
{
$oInput = new Column($sId);
@@ -33,6 +39,13 @@ class ColumnUIBlockFactory extends AbstractUIBlockFactory
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)
{
$oInput = new Column($sId);

View File

@@ -13,7 +13,7 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class MultiColumnUIBlockFactory
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Layout\MultiColumn
* @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api
*/
@@ -24,6 +24,12 @@ class MultiColumnUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */
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)
{
$oInput = new MultiColumn($sId);

View File

@@ -15,7 +15,8 @@ use Combodo\iTop\Application\UI\Base\Component\Html\Html;
* Class UIContentBlockUIBlockFactory
*
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Layout
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
*/
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.
*
* @api
* @param string|null $sId
* @param array $aContainerClasses
*
@@ -42,6 +44,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
* Used to display a block of code like <pre> but allows line break.
* The \n are replaced by <br>
*
* @api
* @param string $sCode
* @param string|null $sId
*
@@ -59,6 +62,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
/**
* Used to display a block of preformatted text in a <pre> tag.
*
* @api
* @param string $sCode
* @param string|null $sId
*