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

Link.php: #2037 - Bei _link mit Grafik wird das Argument o: (tooltip)...

Link.php: #2037 - Bei _link mit Grafik wird das Argument o: (tooltip) ignoriert - FIXED. 'title' are rendered now in '<a>' and '<img>'.
parent a9061f93
...@@ -712,7 +712,7 @@ class Link { ...@@ -712,7 +712,7 @@ class Link {
if ($vars[NAME_IMAGE] !== '') { if ($vars[NAME_IMAGE] !== '') {
$tags .= Support::doAttribute('alt', $vars[NAME_ALT_TEXT]); $tags .= Support::doAttribute('alt', $vars[NAME_ALT_TEXT]);
$tags .= Support::doAttribute('src', $vars[NAME_IMAGE]); $tags .= Support::doAttribute('src', $vars[NAME_IMAGE]);
$tags .= Support::doAttribute('title', $vars[NAME_IMAGE_TITLE]); $tags .= Support::doAttribute('title', $vars[FINAL_TOOL_TIP] === '' ? $vars[NAME_IMAGE_TITLE] : $vars[FINAL_TOOL_TIP]);
$html .= '<img ' . $tags . '>'; $html .= '<img ' . $tags . '>';
} }
......
...@@ -565,6 +565,9 @@ class LinkTest extends \PHPUnit_Framework_TestCase { ...@@ -565,6 +565,9 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$result = $link->renderLink('u:http://example.com|S'); $result = $link->renderLink('u:http://example.com|S');
$this->assertEquals('<a href="http://example.com" class="btn btn-default" title="Details" ><span class="glyphicon glyphicon glyphicon-search" ></span></a>', $result); $this->assertEquals('<a href="http://example.com" class="btn btn-default" title="Details" ><span class="glyphicon glyphicon glyphicon-search" ></span></a>', $result);
$result = $link->renderLink('u:http://example.com|E|o:specific');
$this->assertEquals('<a href="http://example.com" class="btn btn-default" title="specific" ><span class="glyphicon glyphicon-pencil" ></span></a>', $result);
} }
/** /**
...@@ -594,6 +597,8 @@ class LinkTest extends \PHPUnit_Framework_TestCase { ...@@ -594,6 +597,8 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$result = $link->renderLink('u:http://example.com|B:yellow'); $result = $link->renderLink('u:http://example.com|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" ></a>', $result); $this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" ></a>', $result);
$result = $link->renderLink('u:http://example.com|B|o:specific');
$this->assertEquals('<a href="http://example.com" title="specific" ><img alt="Bullet green" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-green.gif" title="specific" ></a>', $result);
} }
/** /**
...@@ -622,6 +627,9 @@ class LinkTest extends \PHPUnit_Framework_TestCase { ...@@ -622,6 +627,9 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$result = $link->renderLink('u:http://example.com|C:yellow'); $result = $link->renderLink('u:http://example.com|C:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Checked yellow" src="typo3conf/ext/qfq/Resources/Public/icons/checked-yellow.gif" title="yellow" ></a>', $result); $this->assertEquals('<a href="http://example.com" ><img alt="Checked yellow" src="typo3conf/ext/qfq/Resources/Public/icons/checked-yellow.gif" title="yellow" ></a>', $result);
$result = $link->renderLink('u:http://example.com|C|o:specific');
$this->assertEquals('<a href="http://example.com" title="specific" ><img alt="Checked green" src="typo3conf/ext/qfq/Resources/Public/icons/checked-green.gif" title="specific" ></a>', $result);
} }
/** /**
......
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