mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
change turbo for form errors
This commit is contained in:
@@ -9,20 +9,27 @@ namespace Combodo\iTop\Application\UI\Base\Component\TurboUpdate;
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
|
||||
|
||||
class TurboUpdate extends UIContentBlock
|
||||
class TurboStream extends UIContentBlock
|
||||
{
|
||||
// Overloaded constants
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/turbo-update/layout';
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/turbo-stream/layout';
|
||||
private string $sTarget;
|
||||
private string $sAction;
|
||||
|
||||
public function __construct(string $sTarget, string $sId = null)
|
||||
public function __construct(string $sTarget, string $sAction, string $sId = null)
|
||||
{
|
||||
parent::__construct($sId);
|
||||
$this->sTarget = $sTarget;
|
||||
$this->sAction = $sAction;
|
||||
}
|
||||
|
||||
public function GetTarget(): string
|
||||
{
|
||||
return $this->sTarget;
|
||||
}
|
||||
|
||||
public function GetAction(): string
|
||||
{
|
||||
return $this->sAction;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Application\UI\Base\Component\TurboUpdate;
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
|
||||
|
||||
/**
|
||||
* Class TurboUpdateUIBlockFactory
|
||||
*
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
* @package UIBlockAPI
|
||||
*/
|
||||
class TurboStreamUIBlockFactory extends AbstractUIBlockFactory
|
||||
{
|
||||
/** @inheritDoc */
|
||||
public const TWIG_TAG_NAME = 'UITurboStream';
|
||||
/** @inheritDoc */
|
||||
public const UI_BLOCK_CLASS_NAME = TurboStream::class;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* @param string $sTarget Id of the block to update
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks
|
||||
*/
|
||||
public static function MakeUpdate(string $sTarget, string $sId = null): TurboStream
|
||||
{
|
||||
return new TurboStream($sTarget, 'update', $sId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* @param string $sTarget Id of the block to update
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks
|
||||
*/
|
||||
public static function MakeReplace(string $sTarget, string $sId = null): TurboStream
|
||||
{
|
||||
return new TurboStream($sTarget, 'replace', $sId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* @param string $sTarget Id of the block to update
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks
|
||||
*/
|
||||
public static function MakePrepend(string $sTarget, string $sId = null): TurboStream
|
||||
{
|
||||
return new TurboStream($sTarget, 'prepend', $sId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* @param string $sTarget Id of the block to update
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks
|
||||
*/
|
||||
public static function MakeAppend(string $sTarget, string $sId = null): TurboStream
|
||||
{
|
||||
return new TurboStream($sTarget, 'append', $sId);
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Application\UI\Base\Component\TurboUpdate;
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
|
||||
|
||||
/**
|
||||
* Class TurboUpdateUIBlockFactory
|
||||
*
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
* @package UIBlockAPI
|
||||
*/
|
||||
class TurboUpdateUIBlockFactory extends AbstractUIBlockFactory
|
||||
{
|
||||
/** @inheritDoc */
|
||||
public const TWIG_TAG_NAME = 'UITurboUpdate';
|
||||
/** @inheritDoc */
|
||||
public const UI_BLOCK_CLASS_NAME = TurboUpdate::class;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* @param string $sTarget Id of the block to update
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboUpdate An HTML form in which you can add UIBlocks
|
||||
*/
|
||||
public static function MakeStandard(string $sTarget, string $sId = null): TurboUpdate
|
||||
{
|
||||
return new TurboUpdate($sTarget, $sId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user