mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 08:14:04 +02:00
Html: upgrade to latest ipl master
This commit is contained in:
parent
0b89c222eb
commit
e8e78461f1
39
library/vendor/ipl/Html/Html.php
vendored
39
library/vendor/ipl/Html/Html.php
vendored
@ -153,6 +153,13 @@ class Html implements ValidHtml
|
|||||||
return Element::create($tag, $attributes, $content);
|
return Element::create($tag, $attributes, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* @param $name
|
||||||
|
* @param null $attributes
|
||||||
|
* @return Element
|
||||||
|
* @throws ProgrammingError
|
||||||
|
*/
|
||||||
public static function element($name, $attributes = null)
|
public static function element($name, $attributes = null)
|
||||||
{
|
{
|
||||||
// TODO: This might be anything here, add a better check
|
// TODO: This might be anything here, add a better check
|
||||||
@ -170,6 +177,38 @@ class Html implements ValidHtml
|
|||||||
return $element;
|
return $element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $name
|
||||||
|
* @param $arguments
|
||||||
|
* @return BaseElement
|
||||||
|
*/
|
||||||
|
public static function __callStatic($name, $arguments)
|
||||||
|
{
|
||||||
|
$attributes = array_shift($arguments);
|
||||||
|
$content = null;
|
||||||
|
if ($attributes instanceof ValidHtml || is_string($attributes)) {
|
||||||
|
$content = $attributes;
|
||||||
|
$attributes = null;
|
||||||
|
} elseif (is_array($attributes)) {
|
||||||
|
if (empty($attributes)) {
|
||||||
|
$attributes = null;
|
||||||
|
} elseif (is_int(key($attributes))) {
|
||||||
|
$content = $attributes;
|
||||||
|
$attributes = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($arguments)) {
|
||||||
|
if (null === $content) {
|
||||||
|
$content = $arguments;
|
||||||
|
} else {
|
||||||
|
$content = [$content, $arguments];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Element::create($name, $attributes, $content);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Exception|string $error
|
* @param Exception|string $error
|
||||||
* @return string
|
* @return string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user