diff options
Diffstat (limited to 'inc/Menu')
-rw-r--r-- | inc/Menu/Item/AbstractItem.php | 20 | ||||
-rw-r--r-- | inc/Menu/Item/Top.php | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/inc/Menu/Item/AbstractItem.php b/inc/Menu/Item/AbstractItem.php index 1f3574776..03ec29afb 100644 --- a/inc/Menu/Item/AbstractItem.php +++ b/inc/Menu/Item/AbstractItem.php @@ -167,6 +167,26 @@ abstract class AbstractItem { } /** + * Convenience method to create a <button> element inside it's own form element + * + * Uses html_btn() + * + * @todo this does currently not support the SVG icon + * @return string + */ + public function asHtmlButton() { + return html_btn( + $this->getType(), + $this->id, + $this->getAccesskey(), + $this->getParams(), + $this->method, + $this->getTitle(), + $this->getLabel() + ); + } + + /** * Should this item be shown in the given context * * @param int $ctx the current context diff --git a/inc/Menu/Item/Top.php b/inc/Menu/Item/Top.php index a7e4cb24b..a05c4f119 100644 --- a/inc/Menu/Item/Top.php +++ b/inc/Menu/Item/Top.php @@ -21,4 +21,16 @@ class Top extends AbstractItem { $this->context = self::CTX_DESKTOP; } + /** + * Convenience method to create a <button> element + * + * Uses html_topbtn() + * + * @todo this does currently not support the SVG icon + * @return string + */ + public function asHtmlButton() { + return html_topbtn(); + } + } |