From 348f4491ff3171d06888a868b22868ce2b8b1eab Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 8 Jan 2017 11:29:41 -0500 Subject: Make icons clickable in menus --- app/Helper/ModalHelper.php | 15 ++++++++++----- app/Helper/UrlHelper.php | 29 ++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 8 deletions(-) (limited to 'app/Helper') diff --git a/app/Helper/ModalHelper.php b/app/Helper/ModalHelper.php index e6037a8c..b3241b9d 100644 --- a/app/Helper/ModalHelper.php +++ b/app/Helper/ModalHelper.php @@ -43,31 +43,36 @@ class ModalHelper extends Base public function large($icon, $label, $controller, $action, array $params = array()) { - $html = ' '.$label; + $html = ''.$label; return $this->helper->url->link($html, $controller, $action, $params, false, 'js-modal-large'); } public function medium($icon, $label, $controller, $action, array $params = array()) { - $html = ' '.$label; + $html = ''.$label; return $this->helper->url->link($html, $controller, $action, $params, false, 'js-modal-medium'); } public function small($icon, $label, $controller, $action, array $params = array()) { - $html = ' '.$label; + $html = ''.$label; return $this->helper->url->link($html, $controller, $action, $params, false, 'js-modal-small'); } public function mediumButton($icon, $label, $controller, $action, array $params = array()) { - $html = ' '.$label; + $html = ''.$label; return $this->helper->url->link($html, $controller, $action, $params, false, 'js-modal-medium btn'); } public function confirm($icon, $label, $controller, $action, array $params = array()) { - $html = ' '.$label; + $html = ''.$label; return $this->helper->url->link($html, $controller, $action, $params, false, 'js-modal-confirm'); } + + public function confirmLink($label, $controller, $action, array $params = array()) + { + return $this->helper->url->link($label, $controller, $action, $params, false, 'js-modal-confirm'); + } } diff --git a/app/Helper/UrlHelper.php b/app/Helper/UrlHelper.php index bfcf07e6..94412cf5 100644 --- a/app/Helper/UrlHelper.php +++ b/app/Helper/UrlHelper.php @@ -47,6 +47,29 @@ class UrlHelper extends Base return $this->link($html, $controller, $action, $params, false, $class); } + /** + * Link element with icon + * + * @access public + * @param string $icon Icon name + * @param string $label Link label + * @param string $controller Controller name + * @param string $action Action name + * @param array $params Url parameters + * @param boolean $csrf Add a CSRF token + * @param string $class CSS class attribute + * @param string $title Link title + * @param boolean $newTab Open the link in a new tab + * @param string $anchor Link Anchor + * @param bool $absolute + * @return string + */ + public function icon($icon, $label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $newTab = false, $anchor = '', $absolute = false) + { + $html = ''.$label; + return $this->helper->url->link($html, $controller, $action, $params, $csrf, $class, $title, $newTab, $anchor, $absolute); + } + /** * Link element * @@ -58,14 +81,14 @@ class UrlHelper extends Base * @param boolean $csrf Add a CSRF token * @param string $class CSS class attribute * @param string $title Link title - * @param boolean $new_tab Open the link in a new tab + * @param boolean $newTab Open the link in a new tab * @param string $anchor Link Anchor * @param bool $absolute * @return string */ - public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false, $anchor = '', $absolute = false) + public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $newTab = false, $anchor = '', $absolute = false) { - return ''.$label.''; + return ''.$label.''; } /** -- cgit v1.2.3