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

Feature #5321 / Plain Link - render mode- only url - fixed wrong mode number, add doc

parent 95dc5843
......@@ -4888,21 +4888,25 @@ Column: _link
Render mode
^^^^^^^^^^^
+-----------+--------------------+-------------------+----------+-------------------------------------------------------------------+
|Mode |Both: url & text |Only: url |Only: text|Description |
+===========+====================+===================+==========+===================================================================+
|0 (default)|<a href=url>text</a>|<a href=url>url</a>| |text or image will be shown, only if there is a url, page or mailto|
+-----------+--------------------+-------------------+----------+-------------------------------------------------------------------+
|1 |<a href=url>text</a>|<a href=url>url</a>|text |Text or image will be shown, independet of there is a url |
+-----------+--------------------+-------------------+----------+-------------------------------------------------------------------+
|2 |<a href=url>text</a>| | |no link if text is empty |
+-----------+--------------------+-------------------+----------+-------------------------------------------------------------------+
|3 |text |url |text |no link, only text or image |
+-----------+--------------------+-------------------+----------+-------------------------------------------------------------------+
|4 |url |url |text |no link, show text, if text is empty, show url |
+-----------+--------------------+-------------------+----------+-------------------------------------------------------------------+
|5 | | | |nothing at all |
+-----------+--------------------+-------------------+----------+-------------------------------------------------------------------+
+-----------+--------------------+-------------------+----------+-----------------------------------------------------------------------+
|Mode |Both: url & text |Only: url |Only: text|Description |
+===========+====================+===================+==========+=======================================================================+
|0 (default)|<a href=url>text</a>|<a href=url>url</a>| |text or image will be shown, only if there is a url, page or mailto |
+-----------+--------------------+-------------------+----------+-----------------------------------------------------------------------+
|1 |<a href=url>text</a>|<a href=url>url</a>|text |Text or image will be shown, independet of there is a url |
+-----------+--------------------+-------------------+----------+-----------------------------------------------------------------------+
|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 |
+-----------+--------------------+-------------------+----------+-----------------------------------------------------------------------+
|4 |url |url |text |no link, show text, if text is empty, show url, incl. optional tooltip |
+-----------+--------------------+-------------------+----------+-----------------------------------------------------------------------+
|5 | | | |nothing at all |
+-----------+--------------------+-------------------+----------+-----------------------------------------------------------------------+
|6 | pure text | |pure text |no link, pure text |
+-----------+--------------------+-------------------+----------+-----------------------------------------------------------------------+
|7 | pure url |pure url | |no link, pure url |
+-----------+--------------------+-------------------+----------+-----------------------------------------------------------------------+
Link Examples
......
......@@ -287,10 +287,10 @@ class Link {
$this->renderControl[6][1][0] = 0;
$this->renderControl[6][1][1] = 5;
$this->renderControl[6][0][0] = 0;
$this->renderControl[6][0][1] = 0;
$this->renderControl[6][1][0] = 6;
$this->renderControl[6][1][1] = 6;
$this->renderControl[7][0][0] = 0;
$this->renderControl[7][0][1] = 0;
$this->renderControl[7][1][0] = 6;
$this->renderControl[7][1][1] = 6;
}
......@@ -332,6 +332,7 @@ class Link {
public function renderLink($str) {
$tokenGiven = array();
$link = "";
if (empty($str)) {
return '';
......@@ -345,8 +346,6 @@ class Link {
$this->store->setVar(SYSTEM_DOWNLOAD_POPUP, DOWNLOAD_POPUP_REQUEST, STORE_SYSTEM);
}
$link = '';
// 0-6 URL, plain email
// 10-14 encrypted email
// 20-24 delete / ajax
......@@ -355,7 +354,6 @@ class Link {
case '0':
case '10':
case '20':
$link = "";
break;
// 1: 'text'
......@@ -399,6 +397,7 @@ class Link {
$link = Support::wrapTag($vars[FINAL_ANCHOR], $vars[FINAL_CONTENT]);
// $link = $this->encryptMailtoJS($vars, true);
break;
case '21':
case '22':
case '23':
......@@ -410,20 +409,24 @@ class Link {
// 5: plain text, no <span> around
case '5':
$link = $vars[FINAL_CONTENT];
$link = $vars[NAME_TEXT];
break;
case '15':
case '25':
throw new UserReportException ("Mode not implemented. internal render mode=$mode", ERROR_UNKNOWN_MODE);
// 5: plain text, no <span> around
// 6: plain url, no <span> around
case '6':
$link = $vars[FINAL_HREF];
break;
case '16':
case '26':
throw new UserReportException ("Mode not implemented. internal render mode=$mode", ERROR_UNKNOWN_MODE);
break;
default:
throw new UserReportException ("Mode not implemented. internal render mode=$mode", ERROR_UNKNOWN_MODE);
}
return $link;
......
Markdown is supported
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