Fix helplink
This commit is contained in:
parent
7c1adb2aba
commit
02595c339e
@ -28,6 +28,9 @@ class Base
|
||||
if(isset($this->node['help'])) {
|
||||
$this->element->setHelp((string)$this->node['help']);
|
||||
}
|
||||
if(isset($this->node['helplink'])) {
|
||||
$this->element->setHelpLink((string)$this->node['helplink']);
|
||||
}
|
||||
if(isset($this->node['exportAjax']) && (string)$this->node['exportAjax'] == 1) {
|
||||
$this->element->setIsAjaxExport(true);
|
||||
}
|
||||
|
||||
@ -17,7 +17,9 @@ class Base
|
||||
protected $default = null;
|
||||
|
||||
/** @var string $help */
|
||||
protected $help = '';
|
||||
protected ?string $help = null;
|
||||
|
||||
protected ?string $helpLink = null;
|
||||
|
||||
/** @var boolean $require */
|
||||
protected $require = false;
|
||||
@ -144,22 +146,26 @@ class Base
|
||||
$this->default = $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getHelp()
|
||||
public function getHelp(): string
|
||||
{
|
||||
return $this->help;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $help
|
||||
*/
|
||||
public function setHelp($help)
|
||||
public function setHelp(string $help): void
|
||||
{
|
||||
$this->help = $help;
|
||||
}
|
||||
|
||||
public function setHelpLink(string $var): void
|
||||
{
|
||||
$this->helpLink = $var;
|
||||
}
|
||||
|
||||
public function getHelpLink(): string
|
||||
{
|
||||
return $this->helpLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@ -47,6 +47,13 @@ class CalcTest extends TestCase
|
||||
|
||||
}
|
||||
|
||||
public function testHelpTextAndLink(): void
|
||||
{
|
||||
$article = $this->engine->getArticle();
|
||||
$this->assertSame("Hello World", $article->getOptionById('breite_frei')->getHelp());
|
||||
$this->assertSame("cms/test", $article->getOptionById('breite_frei')->getHelpLink());
|
||||
}
|
||||
|
||||
public function testMaxBreite(): void
|
||||
{
|
||||
$article = $this->engine->getArticle();
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
<opt id="9" name="Freies Format"></opt>
|
||||
</option>
|
||||
|
||||
<option id="breite_frei" name="Breite (in mm)" type="Input" default="100" min="30" max="480" helplink="/cms/breitaufkl?show=2&help=1">
|
||||
<option id="breite_frei" name="Breite (in mm)" type="Input" default="100" min="30" max="480" help="Hello World" helplink="cms/test">
|
||||
<format1>
|
||||
<grenze>9</grenze>
|
||||
</format1>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user