Commit df333752 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#4606 / _link: qualifier to render bootstrap button - add tooltip to...

#4606 / _link: qualifier to render bootstrap button - add tooltip to button/text, even if there is no link
parent 6bb0927c
......@@ -281,15 +281,28 @@ class Link {
}
/**
* In render mode 3,4,5 there is no '<a href ...>'. Nevertheless, tooltip and BS Button should be displaye.
* Do this by applying a '<span>' attribute around the text.
*
* @param array $vars
* @param $keyName
*
* @return string
*/
private function checkForBootstrapButton($text, $bootstrapButtonClass) {
if ($bootstrapButtonClass == '') {
private function wrapLinkTextOnly(array $vars, $keyName) {
$text = $vars[$keyName];
if ($vars[NAME_BOOTSTRAP_BUTTON] == '' && $vars[FINAL_TOOL_TIP] == '') {
return $text;
}
$attribute = Support::doAttribute('class', [$bootstrapButtonClass, 'disabled']);
return Support::wrapTag("<span $attribute>", $text);
$attributes = Support::doAttribute('title', $vars[FINAL_TOOL_TIP]);
if ($vars[NAME_BOOTSTRAP_BUTTON] != '') {
$attributes .= Support::doAttribute('class', [$vars[NAME_BOOTSTRAP_BUTTON], 'disabled']);
}
return Support::wrapTag("<span $attributes>", $text);
}
......@@ -333,22 +346,22 @@ class Link {
// 1: 'text'
case '1':
// $link = $vars[FINAL_CONTENT];
$link = $this->checkForBootstrapButton($vars[FINAL_CONTENT], $vars[NAME_BOOTSTRAP_BUTTON]);
$link = $this->wrapLinkTextOnly($vars, FINAL_CONTENT);
break;
case '11':
// $link = $vars[FINAL_CONTENT];
$link = $this->checkForBootstrapButton($vars[FINAL_CONTENT], $vars[NAME_BOOTSTRAP_BUTTON]);
$link = $this->wrapLinkTextOnly($vars, FINAL_CONTENT);
// $link = $this->encryptMailtoJS($vars, false);
break;
// 2: 'url'
case '2':
// $link = $vars[FINAL_HREF];
$link = $this->checkForBootstrapButton($vars[FINAL_HREF], $vars[NAME_BOOTSTRAP_BUTTON]);
$link = $this->wrapLinkTextOnly($vars, FINAL_HREF);
break;
case '12':
// $link = $vars[FINAL_HREF];
$link = $this->checkForBootstrapButton($vars[FINAL_HREF], $vars[NAME_BOOTSTRAP_BUTTON]);
$link = $this->wrapLinkTextOnly($vars, FINAL_HREF);
// $link = $this->encryptMailtoJS($vars, false);
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment