Commit 84778dfa authored by Carsten  Rose's avatar Carsten Rose
Browse files

B6576 - update Manual.rst, LinkTest.php

parent 841b4da1
Pipeline #802 passed with stage
in 1 minute and 41 seconds
...@@ -5418,7 +5418,8 @@ render mode might dynamically control the rendered link. ...@@ -5418,7 +5418,8 @@ render mode might dynamically control the rendered link.
+------------+---------------------+--------------------+------------------+---------------------------------------------------------------------------+ +------------+---------------------+--------------------+------------------+---------------------------------------------------------------------------+
|2 |<a href=url>text</a> | | |no link if text is empty | |2 |<a href=url>text</a> | | |no link if text is empty |
+------------+---------------------+--------------------+------------------+---------------------------------------------------------------------------+ +------------+---------------------+--------------------+------------------+---------------------------------------------------------------------------+
|3 |text |url |text |no link, only text or image, incl. optional tooltip | |3 |text |url |text |no link, only text or image, incl. Optional tooltip. For Bootstrap buttons |
| | | | | r:3 will set the button to disable and no link/sip is rendered. |
+------------+---------------------+--------------------+------------------+---------------------------------------------------------------------------+ +------------+---------------------+--------------------+------------------+---------------------------------------------------------------------------+
|4 |url |url |text |no link, show text, if text is empty, show url, incl. optional tooltip | |4 |url |url |text |no link, show text, if text is empty, show url, incl. optional tooltip |
+------------+---------------------+--------------------+------------------+---------------------------------------------------------------------------+ +------------+---------------------+--------------------+------------------+---------------------------------------------------------------------------+
...@@ -5433,6 +5434,13 @@ render mode might dynamically control the rendered link. ...@@ -5433,6 +5434,13 @@ render mode might dynamically control the rendered link.
10.sql = SELECT CONCAT('u:', p.homepage, IF(p.showHomepage='yes', '|r:0', '|r:5') ) AS _link FROM Person AS p 10.sql = SELECT CONCAT('u:', p.homepage, IF(p.showHomepage='yes', '|r:0', '|r:5') ) AS _link FROM Person AS p
Tip:
An easy way to switch between different options of rendering a link, incl. Bootstrap buttons, is to use the render mode.
* no render mode or 'r:0' - the full functional link/button.
* 'r:3' - the link/button is rendered with text/image/glyph/tooltip ... but without a HTML a-tag! For Bootstrap button, the button get the 'disabled' class.
* 'r:5' - no link/button at all.
Link Examples Link Examples
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
......
...@@ -1396,11 +1396,24 @@ EOF; ...@@ -1396,11 +1396,24 @@ EOF;
// Download, r:3 // Download, r:3
$result = $link->renderLink('d|F:file.pdf|r:3'); $result = $link->renderLink('d|F:file.pdf|r:3');
$this->assertEquals('<span title="Download" class="btn btn-default disabled"> </span>', $result); $this->assertEquals('<span title="Download" class="btn btn-default disabled" ><span class="glyphicon glyphicon-file" ></span></span>', $result);
// Download, r:5 // Download, r:5
$result = $link->renderLink('d|F:file.pdf|r:5'); $result = $link->renderLink('d|F:file.pdf|r:5');
$this->assertEquals('', $result); $this->assertEquals('', $result);
// Single file
$result = $link->renderLink('d|F:file.pdf|t:DL|b:0');
$this->assertEquals('<a href="typo3conf/ext/qfq/qfq/api/download.php?mode=pdf&_exportFilename=&_b64_download=RjpmaWxlLnBkZg==" class="0" ><span data-toggle="modal" data-target="#qfqModal101" data-title="Download: " data-text="Please wait" data-backdrop="static" data-keyboard="false" onclick="$(\'#qfqModalTitle101\').text($(this).data(\'title\')); $(\'#qfqModalText101\').text($(this).data(\'text\'));">DL</span></a>', $result);
// Single file
$result = $link->renderLink('d|F:file.pdf|t:DL|b:0|r:3');
$this->assertEquals('<span class="0 disabled" >DL</span>', $result);
// Single file
$result = $link->renderLink('d|F:file.pdf|t:DL|b:0|r:5');
$this->assertEquals('', $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