mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-02 15:44:11 +01:00
Move dashboard blocks to itop project and keep demonstrator one
This commit is contained in:
@@ -130,6 +130,9 @@ return array(
|
||||
'CheckableExpression' => $baseDir . '/core/oql/oqlquery.class.inc.php',
|
||||
'Collator' => $vendorDir . '/symfony/polyfill-intl-icu/Resources/stubs/Collator.php',
|
||||
'Combodo\\iTop\\Application\\Branding' => $baseDir . '/sources/Application/Branding.php',
|
||||
'Combodo\\iTop\\Application\\Dashboard\\FormBlock\\DashboardFormBlock' => $baseDir . '/sources/Application/Dashboard/FormBlock/DashboardFormBlock.php',
|
||||
'Combodo\\iTop\\Application\\Dashboard\\FormBlock\\DashletFormBlock' => $baseDir . '/sources/Application/Dashboard/FormBlock/DashletFormBlock.php',
|
||||
'Combodo\\iTop\\Application\\Dashboard\\FormBlock\\DashletPropertiesFormBlock' => $baseDir . '/sources/Application/Dashboard/FormBlock/DashletPropertiesFormBlock.php',
|
||||
'Combodo\\iTop\\Application\\EventRegister\\ApplicationEvents' => $baseDir . '/sources/Application/EventRegister/ApplicationEvents.php',
|
||||
'Combodo\\iTop\\Application\\Helper\\CKEditorHelper' => $baseDir . '/sources/Application/Helper/CKEditorHelper.php',
|
||||
'Combodo\\iTop\\Application\\Helper\\ExportHelper' => $baseDir . '/sources/Application/Helper/ExportHelper.php',
|
||||
|
||||
@@ -28,12 +28,12 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'T' =>
|
||||
'T' =>
|
||||
array (
|
||||
'Twig\\' => 5,
|
||||
'TheNetworg\\OAuth2\\Client\\' => 25,
|
||||
),
|
||||
'S' =>
|
||||
'S' =>
|
||||
array (
|
||||
'Symfony\\Polyfill\\Php83\\' => 23,
|
||||
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
||||
@@ -82,7 +82,7 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
||||
'ScssPhp\\ScssPhp\\' => 16,
|
||||
'Sabberworm\\CSS\\' => 15,
|
||||
),
|
||||
'P' =>
|
||||
'P' =>
|
||||
array (
|
||||
'Psr\\Log\\' => 8,
|
||||
'Psr\\Http\\Message\\' => 17,
|
||||
@@ -93,298 +93,298 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
||||
'PhpParser\\' => 10,
|
||||
'Pelago\\Emogrifier\\' => 18,
|
||||
),
|
||||
'L' =>
|
||||
'L' =>
|
||||
array (
|
||||
'League\\OAuth2\\Client\\' => 21,
|
||||
),
|
||||
'G' =>
|
||||
'G' =>
|
||||
array (
|
||||
'GuzzleHttp\\Psr7\\' => 16,
|
||||
'GuzzleHttp\\Promise\\' => 19,
|
||||
'GuzzleHttp\\' => 11,
|
||||
),
|
||||
'F' =>
|
||||
'F' =>
|
||||
array (
|
||||
'Firebase\\JWT\\' => 13,
|
||||
),
|
||||
'E' =>
|
||||
'E' =>
|
||||
array (
|
||||
'Egulias\\EmailValidator\\' => 23,
|
||||
),
|
||||
'D' =>
|
||||
'D' =>
|
||||
array (
|
||||
'Doctrine\\Common\\Lexer\\' => 22,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'Twig\\' =>
|
||||
'Twig\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/twig/twig/src',
|
||||
),
|
||||
'TheNetworg\\OAuth2\\Client\\' =>
|
||||
'TheNetworg\\OAuth2\\Client\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/thenetworg/oauth2-azure/src',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php83\\' =>
|
||||
'Symfony\\Polyfill\\Php83\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php83',
|
||||
),
|
||||
'Symfony\\Polyfill\\Mbstring\\' =>
|
||||
'Symfony\\Polyfill\\Mbstring\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
|
||||
),
|
||||
'Symfony\\Polyfill\\Intl\\Normalizer\\' =>
|
||||
'Symfony\\Polyfill\\Intl\\Normalizer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer',
|
||||
),
|
||||
'Symfony\\Polyfill\\Intl\\Idn\\' =>
|
||||
'Symfony\\Polyfill\\Intl\\Idn\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn',
|
||||
),
|
||||
'Symfony\\Polyfill\\Intl\\Icu\\' =>
|
||||
'Symfony\\Polyfill\\Intl\\Icu\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-icu',
|
||||
),
|
||||
'Symfony\\Polyfill\\Intl\\Grapheme\\' =>
|
||||
'Symfony\\Polyfill\\Intl\\Grapheme\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme',
|
||||
),
|
||||
'Symfony\\Polyfill\\Ctype\\' =>
|
||||
'Symfony\\Polyfill\\Ctype\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
|
||||
),
|
||||
'Symfony\\Contracts\\Translation\\' =>
|
||||
'Symfony\\Contracts\\Translation\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/translation-contracts',
|
||||
),
|
||||
'Symfony\\Contracts\\Service\\' =>
|
||||
'Symfony\\Contracts\\Service\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/service-contracts',
|
||||
),
|
||||
'Symfony\\Contracts\\EventDispatcher\\' =>
|
||||
'Symfony\\Contracts\\EventDispatcher\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts',
|
||||
),
|
||||
'Symfony\\Contracts\\Cache\\' =>
|
||||
'Symfony\\Contracts\\Cache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/cache-contracts',
|
||||
),
|
||||
'Symfony\\Component\\Yaml\\' =>
|
||||
'Symfony\\Component\\Yaml\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/yaml',
|
||||
),
|
||||
'Symfony\\Component\\VarExporter\\' =>
|
||||
'Symfony\\Component\\VarExporter\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/var-exporter',
|
||||
),
|
||||
'Symfony\\Component\\VarDumper\\' =>
|
||||
'Symfony\\Component\\VarDumper\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/var-dumper',
|
||||
),
|
||||
'Symfony\\Component\\Validator\\' =>
|
||||
'Symfony\\Component\\Validator\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/validator',
|
||||
),
|
||||
'Symfony\\Component\\String\\' =>
|
||||
'Symfony\\Component\\String\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/string',
|
||||
),
|
||||
'Symfony\\Component\\Stopwatch\\' =>
|
||||
'Symfony\\Component\\Stopwatch\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/stopwatch',
|
||||
),
|
||||
'Symfony\\Component\\Security\\Csrf\\' =>
|
||||
'Symfony\\Component\\Security\\Csrf\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/security-csrf',
|
||||
),
|
||||
'Symfony\\Component\\Security\\Core\\' =>
|
||||
'Symfony\\Component\\Security\\Core\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/security-core',
|
||||
),
|
||||
'Symfony\\Component\\Routing\\' =>
|
||||
'Symfony\\Component\\Routing\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/routing',
|
||||
),
|
||||
'Symfony\\Component\\PropertyInfo\\' =>
|
||||
'Symfony\\Component\\PropertyInfo\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/property-info',
|
||||
),
|
||||
'Symfony\\Component\\PropertyAccess\\' =>
|
||||
'Symfony\\Component\\PropertyAccess\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/property-access',
|
||||
),
|
||||
'Symfony\\Component\\PasswordHasher\\' =>
|
||||
'Symfony\\Component\\PasswordHasher\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/password-hasher',
|
||||
),
|
||||
'Symfony\\Component\\OptionsResolver\\' =>
|
||||
'Symfony\\Component\\OptionsResolver\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/options-resolver',
|
||||
),
|
||||
'Symfony\\Component\\Mime\\' =>
|
||||
'Symfony\\Component\\Mime\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/mime',
|
||||
),
|
||||
'Symfony\\Component\\Mailer\\' =>
|
||||
'Symfony\\Component\\Mailer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/mailer',
|
||||
),
|
||||
'Symfony\\Component\\HttpKernel\\' =>
|
||||
'Symfony\\Component\\HttpKernel\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/http-kernel',
|
||||
),
|
||||
'Symfony\\Component\\HttpFoundation\\' =>
|
||||
'Symfony\\Component\\HttpFoundation\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/http-foundation',
|
||||
),
|
||||
'Symfony\\Component\\Form\\' =>
|
||||
'Symfony\\Component\\Form\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/form',
|
||||
),
|
||||
'Symfony\\Component\\Finder\\' =>
|
||||
'Symfony\\Component\\Finder\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/finder',
|
||||
),
|
||||
'Symfony\\Component\\Filesystem\\' =>
|
||||
'Symfony\\Component\\Filesystem\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/filesystem',
|
||||
),
|
||||
'Symfony\\Component\\EventDispatcher\\' =>
|
||||
'Symfony\\Component\\EventDispatcher\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/event-dispatcher',
|
||||
),
|
||||
'Symfony\\Component\\ErrorHandler\\' =>
|
||||
'Symfony\\Component\\ErrorHandler\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/error-handler',
|
||||
),
|
||||
'Symfony\\Component\\Dotenv\\' =>
|
||||
'Symfony\\Component\\Dotenv\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/dotenv',
|
||||
),
|
||||
'Symfony\\Component\\DependencyInjection\\' =>
|
||||
'Symfony\\Component\\DependencyInjection\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/dependency-injection',
|
||||
),
|
||||
'Symfony\\Component\\CssSelector\\' =>
|
||||
'Symfony\\Component\\CssSelector\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/css-selector',
|
||||
),
|
||||
'Symfony\\Component\\Console\\' =>
|
||||
'Symfony\\Component\\Console\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/console',
|
||||
),
|
||||
'Symfony\\Component\\Config\\' =>
|
||||
'Symfony\\Component\\Config\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/config',
|
||||
),
|
||||
'Symfony\\Component\\Cache\\' =>
|
||||
'Symfony\\Component\\Cache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/cache',
|
||||
),
|
||||
'Symfony\\Bundle\\WebProfilerBundle\\' =>
|
||||
'Symfony\\Bundle\\WebProfilerBundle\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/web-profiler-bundle',
|
||||
),
|
||||
'Symfony\\Bundle\\TwigBundle\\' =>
|
||||
'Symfony\\Bundle\\TwigBundle\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/twig-bundle',
|
||||
),
|
||||
'Symfony\\Bundle\\FrameworkBundle\\' =>
|
||||
'Symfony\\Bundle\\FrameworkBundle\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/framework-bundle',
|
||||
),
|
||||
'Symfony\\Bridge\\Twig\\' =>
|
||||
'Symfony\\Bridge\\Twig\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/twig-bridge',
|
||||
),
|
||||
'Soundasleep\\' =>
|
||||
'Soundasleep\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/soundasleep/html2text/src',
|
||||
),
|
||||
'ScssPhp\\ScssPhp\\' =>
|
||||
'ScssPhp\\ScssPhp\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/scssphp/scssphp/src',
|
||||
),
|
||||
'Sabberworm\\CSS\\' =>
|
||||
'Sabberworm\\CSS\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/sabberworm/php-css-parser/src',
|
||||
),
|
||||
'Psr\\Log\\' =>
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log/src',
|
||||
),
|
||||
'Psr\\Http\\Message\\' =>
|
||||
'Psr\\Http\\Message\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/http-factory/src',
|
||||
1 => __DIR__ . '/..' . '/psr/http-message/src',
|
||||
),
|
||||
'Psr\\Http\\Client\\' =>
|
||||
'Psr\\Http\\Client\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/http-client/src',
|
||||
),
|
||||
'Psr\\EventDispatcher\\' =>
|
||||
'Psr\\EventDispatcher\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/event-dispatcher/src',
|
||||
),
|
||||
'Psr\\Container\\' =>
|
||||
'Psr\\Container\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/container/src',
|
||||
),
|
||||
'Psr\\Cache\\' =>
|
||||
'Psr\\Cache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/cache/src',
|
||||
),
|
||||
'PhpParser\\' =>
|
||||
'PhpParser\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser',
|
||||
),
|
||||
'Pelago\\Emogrifier\\' =>
|
||||
'Pelago\\Emogrifier\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/pelago/emogrifier/src',
|
||||
),
|
||||
'League\\OAuth2\\Client\\' =>
|
||||
'League\\OAuth2\\Client\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/league/oauth2-google/src',
|
||||
1 => __DIR__ . '/..' . '/league/oauth2-client/src',
|
||||
),
|
||||
'GuzzleHttp\\Psr7\\' =>
|
||||
'GuzzleHttp\\Psr7\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
|
||||
),
|
||||
'GuzzleHttp\\Promise\\' =>
|
||||
'GuzzleHttp\\Promise\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
|
||||
),
|
||||
'GuzzleHttp\\' =>
|
||||
'GuzzleHttp\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
|
||||
),
|
||||
'Firebase\\JWT\\' =>
|
||||
'Firebase\\JWT\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/firebase/php-jwt/src',
|
||||
),
|
||||
'Egulias\\EmailValidator\\' =>
|
||||
'Egulias\\EmailValidator\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/egulias/email-validator/src',
|
||||
),
|
||||
'Doctrine\\Common\\Lexer\\' =>
|
||||
'Doctrine\\Common\\Lexer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/lexer/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'C' =>
|
||||
'C' =>
|
||||
array (
|
||||
'Console' =>
|
||||
'Console' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/pear/console_getopt',
|
||||
),
|
||||
),
|
||||
'A' =>
|
||||
'A' =>
|
||||
array (
|
||||
'Archive_Tar' =>
|
||||
'Archive_Tar' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/pear/archive_tar',
|
||||
),
|
||||
@@ -516,6 +516,9 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
||||
'CheckableExpression' => __DIR__ . '/../..' . '/core/oql/oqlquery.class.inc.php',
|
||||
'Collator' => __DIR__ . '/..' . '/symfony/polyfill-intl-icu/Resources/stubs/Collator.php',
|
||||
'Combodo\\iTop\\Application\\Branding' => __DIR__ . '/../..' . '/sources/Application/Branding.php',
|
||||
'Combodo\\iTop\\Application\\Dashboard\\FormBlock\\DashboardFormBlock' => __DIR__ . '/../..' . '/sources/Application/Dashboard/FormBlock/DashboardFormBlock.php',
|
||||
'Combodo\\iTop\\Application\\Dashboard\\FormBlock\\DashletFormBlock' => __DIR__ . '/../..' . '/sources/Application/Dashboard/FormBlock/DashletFormBlock.php',
|
||||
'Combodo\\iTop\\Application\\Dashboard\\FormBlock\\DashletPropertiesFormBlock' => __DIR__ . '/../..' . '/sources/Application/Dashboard/FormBlock/DashletPropertiesFormBlock.php',
|
||||
'Combodo\\iTop\\Application\\EventRegister\\ApplicationEvents' => __DIR__ . '/../..' . '/sources/Application/EventRegister/ApplicationEvents.php',
|
||||
'Combodo\\iTop\\Application\\Helper\\CKEditorHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/CKEditorHelper.php',
|
||||
'Combodo\\iTop\\Application\\Helper\\ExportHelper' => __DIR__ . '/../..' . '/sources/Application/Helper/ExportHelper.php',
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Application\Dashboard\FormBlock;
|
||||
|
||||
use Combodo\iTop\Forms\Block\Base\ChoiceFormBlock;
|
||||
use Combodo\iTop\Forms\Block\Base\CollectionBlock;
|
||||
use Combodo\iTop\Forms\Block\Base\FormBlock;
|
||||
use Combodo\iTop\Forms\Block\Base\TextFormBlock;
|
||||
|
||||
class DashboardFormBlock extends FormBlock
|
||||
{
|
||||
protected function BuildForm(): void
|
||||
{
|
||||
// Label
|
||||
$this->Add('title', TextFormBlock::class, [
|
||||
'label' => 'Title',
|
||||
]);
|
||||
|
||||
// Refresh
|
||||
$this->Add('refresh', ChoiceFormBlock::class, [
|
||||
'label' => 'Refresh',
|
||||
'choices' => [
|
||||
'Never' => 0,
|
||||
'Every 5 minutes' => 5,
|
||||
'Every 15 minutes' => 15,
|
||||
'Every 30 minutes' => 30,
|
||||
'Every hour' => 60,
|
||||
],
|
||||
]);
|
||||
|
||||
$this->Add('dashlets_list', CollectionBlock::class, [
|
||||
'label' => 'Dashlets List',
|
||||
'block_entry_type' => DashletFormBlock::class,
|
||||
'block_entry_options' => [],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
48
sources/Application/Dashboard/FormBlock/DashletFormBlock.php
Normal file
48
sources/Application/Dashboard/FormBlock/DashletFormBlock.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Application\Dashboard\FormBlock;
|
||||
|
||||
use Combodo\iTop\Forms\Block\Base\ChoiceFormBlock;
|
||||
use Combodo\iTop\Forms\Block\Base\FormBlock;
|
||||
use Combodo\iTop\Forms\Block\Base\IntegerFormBlock;
|
||||
use Combodo\iTop\PropertyType\PropertyTypeService;
|
||||
|
||||
class DashletFormBlock extends FormBlock
|
||||
{
|
||||
protected function BuildForm(): void
|
||||
{
|
||||
// type
|
||||
$aPropertyTypes = PropertyTypeService::GetInstance()->ListPropertyTypesByType('Dashlet');
|
||||
$this->Add('class', ChoiceFormBlock::class, [
|
||||
'label' => 'Class',
|
||||
'choices' => array_combine($aPropertyTypes, $aPropertyTypes),
|
||||
]);
|
||||
|
||||
// column
|
||||
$this->Add('position_x', IntegerFormBlock::class, [
|
||||
'label' => 'Position X',
|
||||
]);
|
||||
|
||||
// row
|
||||
$this->Add('position_y', IntegerFormBlock::class, [
|
||||
'label' => 'Position Y',
|
||||
]);
|
||||
|
||||
// column
|
||||
$this->Add('height', IntegerFormBlock::class, [
|
||||
'label' => 'Height',
|
||||
]);
|
||||
|
||||
// row
|
||||
$this->Add('width', IntegerFormBlock::class, [
|
||||
'label' => 'Width',
|
||||
]);
|
||||
|
||||
// dashlet
|
||||
$this->Add('dashlet', DashletPropertiesFormBlock::class, [
|
||||
'label' => 'Dashlet',
|
||||
])
|
||||
->InputDependsOn(DashletPropertiesFormBlock::INPUT_DASHLET_TYPE, 'class', ChoiceFormBlock::OUTPUT_VALUE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Application\Dashboard\FormBlock;
|
||||
|
||||
use Combodo\iTop\Forms\Block\Base\FormBlock;
|
||||
use Combodo\iTop\Forms\IO\Format\StringIOFormat;
|
||||
use Combodo\iTop\Forms\Register\IORegister;
|
||||
use Combodo\iTop\PropertyType\PropertyTypeService;
|
||||
|
||||
class DashletPropertiesFormBlock extends FormBlock
|
||||
{
|
||||
// inputs
|
||||
public const INPUT_DASHLET_TYPE = 'dashlet_type';
|
||||
|
||||
protected function RegisterIO(IORegister $oIORegister): void
|
||||
{
|
||||
parent::RegisterIO($oIORegister);
|
||||
$oIORegister->AddInput(self::INPUT_DASHLET_TYPE, StringIOFormat::class);
|
||||
}
|
||||
|
||||
public function GetFormType(): string
|
||||
{
|
||||
$sDashletType = strval($this->GetInputValue(self::INPUT_DASHLET_TYPE));
|
||||
$oDashlet = PropertyTypeService::GetInstance()->GetFormBlockById($sDashletType, 'Dashlet');
|
||||
|
||||
return $oDashlet->GetFormType();
|
||||
}
|
||||
|
||||
public function GetOptions(): array
|
||||
{
|
||||
$sDashletType = strval($this->GetInputValue(self::INPUT_DASHLET_TYPE));
|
||||
$oDashlet = PropertyTypeService::GetInstance()->GetFormBlockById($sDashletType, 'Dashlet');
|
||||
|
||||
return $oDashlet->GetOptions();
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ use Combodo\iTop\Forms\Block\Base\TextFormBlock;
|
||||
use Combodo\iTop\Forms\Block\FormBlockException;
|
||||
use Combodo\iTop\Forms\Block\IFormBlock;
|
||||
use Combodo\iTop\Forms\Forms;
|
||||
use Combodo\iTop\ItopSdkFormDemonstrator\Form\Block\Dashboard\GenericDashlet;
|
||||
use Combodo\iTop\ItopSdkFormDemonstrator\Form\Block\Dashboard\DashletPropertiesFormBlock;
|
||||
use Combodo\iTop\Service\InterfaceDiscovery\InterfaceDiscovery;
|
||||
use Combodo\iTop\Test\UnitTest\sources\Forms\AbstractFormsTest;
|
||||
use OutOfBoundsException;
|
||||
@@ -39,7 +39,7 @@ class BlockTest extends AbstractFormsTest
|
||||
foreach ($aFormBlocks as $sFormBlock) {
|
||||
$oChoiceBlock = new ($sFormBlock)($sFormBlock);
|
||||
if ($oChoiceBlock instanceof AbstractTypeFormBlock) {
|
||||
if (!$oChoiceBlock instanceof GenericDashlet) {
|
||||
if (!$oChoiceBlock instanceof DashletPropertiesFormBlock) {
|
||||
$oClass = new \ReflectionClass($oChoiceBlock->GetFormType());
|
||||
$this->assertTrue($oClass->isSubclassOf(AbstractType::class));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user