Commit 128f22e2 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#4606 / _link: qualifier to render bootstrap button - in progress

parent b5d0a87d
...@@ -4518,6 +4518,8 @@ Column: _link ...@@ -4518,6 +4518,8 @@ Column: _link
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| | |Render |r:<mode> |r:[0-5] |See: `render-mode`_, Default: 0 | | | |Render |r:<mode> |r:[0-5] |See: `render-mode`_, Default: 0 |
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| | |Button |b[:0|1] |b, b:0, b:1 |If 'b' or 'b:1' a bootstrap button is created |
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| |x |Picture |P:<filename> |P:bullet-red.gif |Picture '<img src="bullet-red.gif"alt="....">', default link class: internal. | | |x |Picture |P:<filename> |P:bullet-red.gif |Picture '<img src="bullet-red.gif"alt="....">', default link class: internal. |
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| |x |Edit |E |E |Show 'edit' icon as image | | |x |Edit |E |E |Show 'edit' icon as image |
......
...@@ -1109,6 +1109,7 @@ const TOKEN_DOWNLOAD = 'd'; ...@@ -1109,6 +1109,7 @@ const TOKEN_DOWNLOAD = 'd';
const TOKEN_TEXT = 't'; const TOKEN_TEXT = 't';
const TOKEN_ALT_TEXT = 'a'; const TOKEN_ALT_TEXT = 'a';
const TOKEN_TOOL_TIP = 'o'; const TOKEN_TOOL_TIP = 'o';
const TOKEN_BOOTSTRAP_BUTTON = 'b';
const TOKEN_PICTURE = 'P'; const TOKEN_PICTURE = 'P';
const TOKEN_BULLET = 'B'; const TOKEN_BULLET = 'B';
const TOKEN_CHECK = 'C'; const TOKEN_CHECK = 'C';
......
...@@ -46,6 +46,7 @@ require_once(__DIR__ . '/../helper/KeyValueStringParser.php'); ...@@ -46,6 +46,7 @@ require_once(__DIR__ . '/../helper/KeyValueStringParser.php');
* c:class [n|i|e|<class>] * c:class [n|i|e|<class>]
* q:question <text> * q:question <text>
* e:encryption 0|1 * e:encryption 0|1
* b:bootstrap button
* *
* E:edit * E:edit
* N:new * N:new
...@@ -71,6 +72,7 @@ const NAME_TEXT = 'text'; ...@@ -71,6 +72,7 @@ const NAME_TEXT = 'text';
const NAME_DOWNLOAD = DOWNLOAD_EXPORT_FILENAME; const NAME_DOWNLOAD = DOWNLOAD_EXPORT_FILENAME;
const NAME_DOWNLOAD_ELEMENTS = 'downloadElements'; // array with element sources const NAME_DOWNLOAD_ELEMENTS = 'downloadElements'; // array with element sources
const NAME_DOWNLOAD_MODE = 'mode'; const NAME_DOWNLOAD_MODE = 'mode';
const NAME_BOOTSTRAP_BUTTON = 'bootstrapButton';
const NAME_ALT_TEXT = 'altText'; const NAME_ALT_TEXT = 'altText';
const NAME_TOOL_TIP = 'toolTip'; const NAME_TOOL_TIP = 'toolTip';
const NAME_TOOL_TIP_JS = 'toolTipJs'; const NAME_TOOL_TIP_JS = 'toolTipJs';
...@@ -143,73 +145,74 @@ class Link { ...@@ -143,73 +145,74 @@ class Link {
private $ttContentUid = ''; private $ttContentUid = '';
private $callTable = [ private $callTable = [
TOKEN_URL => 'buildUrl', TOKEN_URL => 'buildUrl',
TOKEN_MAIL => 'buildMail', TOKEN_MAIL => 'buildMail',
TOKEN_PAGE => 'buildPage', TOKEN_PAGE => 'buildPage',
TOKEN_DOWNLOAD => 'buildDownload', TOKEN_DOWNLOAD => 'buildDownload',
TOKEN_TOOL_TIP => 'buildToolTip', TOKEN_TOOL_TIP => 'buildToolTip',
TOKEN_PICTURE => 'buildPicture', TOKEN_PICTURE => 'buildPicture',
TOKEN_BULLET => 'buildBullet', TOKEN_BULLET => 'buildBullet',
TOKEN_CHECK => 'buildCheck', TOKEN_CHECK => 'buildCheck',
TOKEN_DELETE => 'buildDeleteIcon', TOKEN_DELETE => 'buildDeleteIcon',
TOKEN_ACTION_DELETE => 'buildActionDelete', TOKEN_ACTION_DELETE => 'buildActionDelete',
TOKEN_EDIT => 'buildEdit', TOKEN_EDIT => 'buildEdit',
TOKEN_HELP => 'buildHelp', TOKEN_HELP => 'buildHelp',
TOKEN_INFO => 'buildInfo', TOKEN_INFO => 'buildInfo',
TOKEN_NEW => 'buildNew', TOKEN_NEW => 'buildNew',
TOKEN_SHOW => 'buildShow', TOKEN_SHOW => 'buildShow',
TOKEN_FILE => 'buildFile', TOKEN_FILE => 'buildFile',
TOKEN_GLYPH => 'buildGlyph', TOKEN_GLYPH => 'buildGlyph',
]; ];
private $tableVarName = [ private $tableVarName = [
TOKEN_URL => NAME_URL, TOKEN_URL => NAME_URL,
TOKEN_MAIL => NAME_MAIL, TOKEN_MAIL => NAME_MAIL,
TOKEN_PAGE => NAME_PAGE, TOKEN_PAGE => NAME_PAGE,
TOKEN_DOWNLOAD => NAME_DOWNLOAD, TOKEN_DOWNLOAD => NAME_DOWNLOAD,
TOKEN_DOWNLOAD_MODE => NAME_DOWNLOAD_MODE, TOKEN_DOWNLOAD_MODE => NAME_DOWNLOAD_MODE,
TOKEN_TEXT => NAME_TEXT, TOKEN_TEXT => NAME_TEXT,
TOKEN_ALT_TEXT => NAME_ALT_TEXT, TOKEN_ALT_TEXT => NAME_ALT_TEXT,
TOKEN_TOOL_TIP => NAME_TOOL_TIP, TOKEN_BOOTSTRAP_BUTTON => NAME_BOOTSTRAP_BUTTON,
TOKEN_PICTURE => NAME_IMAGE, TOKEN_TOOL_TIP => NAME_TOOL_TIP,
TOKEN_BULLET => NAME_IMAGE, TOKEN_PICTURE => NAME_IMAGE,
TOKEN_CHECK => NAME_IMAGE, TOKEN_BULLET => NAME_IMAGE,
TOKEN_DELETE => NAME_IMAGE, TOKEN_CHECK => NAME_IMAGE,
TOKEN_EDIT => NAME_IMAGE, TOKEN_DELETE => NAME_IMAGE,
TOKEN_HELP => NAME_IMAGE, TOKEN_EDIT => NAME_IMAGE,
TOKEN_INFO => NAME_IMAGE, TOKEN_HELP => NAME_IMAGE,
TOKEN_NEW => NAME_IMAGE, TOKEN_INFO => NAME_IMAGE,
TOKEN_SHOW => NAME_IMAGE, TOKEN_NEW => NAME_IMAGE,
TOKEN_GLYPH => NAME_IMAGE, TOKEN_SHOW => NAME_IMAGE,
TOKEN_RENDER => NAME_RENDER, TOKEN_GLYPH => NAME_IMAGE,
TOKEN_TARGET => NAME_TARGET, TOKEN_RENDER => NAME_RENDER,
TOKEN_CLASS => NAME_LINK_CLASS, TOKEN_TARGET => NAME_TARGET,
TOKEN_QUESTION => NAME_QUESTION, TOKEN_CLASS => NAME_LINK_CLASS,
TOKEN_ENCRYPTION => NAME_ENCRYPTION, TOKEN_QUESTION => NAME_QUESTION,
TOKEN_SIP => NAME_SIP, TOKEN_ENCRYPTION => NAME_ENCRYPTION,
TOKEN_URL_PARAM => NAME_URL_PARAM, TOKEN_SIP => NAME_SIP,
TOKEN_RIGHT => NAME_RIGHT, TOKEN_URL_PARAM => NAME_URL_PARAM,
TOKEN_ACTION_DELETE => NAME_ACTION_DELETE, TOKEN_RIGHT => NAME_RIGHT,
TOKEN_FILE => NAME_FILE, TOKEN_ACTION_DELETE => NAME_ACTION_DELETE,
TOKEN_FILE => NAME_FILE,
]; ];
// Used to find double definitions. // Used to find double definitions.
private $tokenMapping = [ private $tokenMapping = [
TOKEN_URL => LINK_ANCHOR, TOKEN_URL => LINK_ANCHOR,
TOKEN_MAIL => LINK_ANCHOR, TOKEN_MAIL => LINK_ANCHOR,
TOKEN_PAGE => LINK_ANCHOR, TOKEN_PAGE => LINK_ANCHOR,
TOKEN_DOWNLOAD => LINK_ANCHOR, TOKEN_DOWNLOAD => LINK_ANCHOR,
TOKEN_PICTURE => LINK_PICTURE, TOKEN_PICTURE => LINK_PICTURE,
TOKEN_BULLET => LINK_PICTURE, TOKEN_BULLET => LINK_PICTURE,
TOKEN_CHECK => LINK_PICTURE, TOKEN_CHECK => LINK_PICTURE,
TOKEN_DELETE => LINK_PICTURE, TOKEN_DELETE => LINK_PICTURE,
TOKEN_EDIT => LINK_PICTURE, TOKEN_EDIT => LINK_PICTURE,
TOKEN_HELP => LINK_PICTURE, TOKEN_HELP => LINK_PICTURE,
TOKEN_INFO => LINK_PICTURE, TOKEN_INFO => LINK_PICTURE,
TOKEN_NEW => LINK_PICTURE, TOKEN_NEW => LINK_PICTURE,
TOKEN_SHOW => LINK_PICTURE, TOKEN_SHOW => LINK_PICTURE,
TOKEN_GLYPH => LINK_PICTURE, TOKEN_GLYPH => LINK_PICTURE,
]; ];
/** /**
...@@ -315,19 +318,23 @@ class Link { ...@@ -315,19 +318,23 @@ class Link {
// 1: 'text' // 1: 'text'
case '1': case '1':
$link = $vars[FINAL_CONTENT]; $link = Support::wrapTag($vars[FINAL_ANCHOR], $vars[FINAL_CONTENT]);
// $link = $vars[FINAL_CONTENT];
break; break;
case '11': case '11':
$link = $vars[FINAL_CONTENT]; $link = Support::wrapTag($vars[FINAL_ANCHOR], $vars[FINAL_CONTENT]);
// $link = $vars[FINAL_CONTENT];
// $link = $this->encryptMailtoJS($vars, false); // $link = $this->encryptMailtoJS($vars, false);
break; break;
// 2: 'url' // 2: 'url'
case '2': case '2':
$link = $vars[FINAL_HREF]; $link = Support::wrapTag($vars[FINAL_ANCHOR], $vars[FINAL_HREF]);
// $link = $vars[FINAL_HREF];
break; break;
case '12': case '12':
$link = $vars[FINAL_HREF]; $link = Support::wrapTag($vars[FINAL_ANCHOR], $vars[FINAL_HREF]);
// $link = $vars[FINAL_HREF];
// $link = $this->encryptMailtoJS($vars, false); // $link = $this->encryptMailtoJS($vars, false);
break; break;
...@@ -363,7 +370,7 @@ class Link { ...@@ -363,7 +370,7 @@ class Link {
} }
/** /**
* Order $param. Parameter with Priotrity are hardcoded at the moment. * Order $param. Parameter with priority are hardcoded at the moment.
* *
* @param array $param * @param array $param
* *
...@@ -482,42 +489,43 @@ class Link { ...@@ -482,42 +489,43 @@ class Link {
private function initVars() { private function initVars() {
return [ return [
NAME_MAIL => '', NAME_MAIL => '',
NAME_URL => '', NAME_URL => '',
NAME_PAGE => '', NAME_PAGE => '',
NAME_TEXT => '', NAME_TEXT => '',
NAME_ALT_TEXT => '', NAME_ALT_TEXT => '',
NAME_IMAGE => '', NAME_BOOTSTRAP_BUTTON => '',
NAME_IMAGE_TITLE => '', NAME_IMAGE => '',
NAME_GLYPH => '', NAME_IMAGE_TITLE => '',
NAME_GLYPH_TITLE => '', NAME_GLYPH => '',
NAME_QUESTION => '', NAME_GLYPH_TITLE => '',
NAME_TARGET => '', NAME_QUESTION => '',
NAME_TOOL_TIP => '', NAME_TARGET => '',
NAME_TOOL_TIP_JS => '', NAME_TOOL_TIP => '',
NAME_URL_PARAM => '', NAME_TOOL_TIP_JS => '',
NAME_URL_PARAM => '',
NAME_EXTRA_CONTENT_WRAP => '', NAME_EXTRA_CONTENT_WRAP => '',
NAME_DOWNLOAD_MODE => '', NAME_DOWNLOAD_MODE => '',
NAME_DOWNLOAD_ELEMENTS => array(), NAME_DOWNLOAD_ELEMENTS => array(),
NAME_RENDER => '0', NAME_RENDER => '0',
NAME_RIGHT => 'l', NAME_RIGHT => 'l',
NAME_SIP => '0', NAME_SIP => '0',
NAME_ENCRYPTION => '0', NAME_ENCRYPTION => '0',
NAME_DELETE => '', NAME_DELETE => '',
NAME_LINK_CLASS => '', // class name NAME_LINK_CLASS => '', // class name
NAME_LINK_CLASS_DEFAULT => '', // Depending of 'as page' or 'as url'. Only used if class is not explizit set. NAME_LINK_CLASS_DEFAULT => '', // Depending of 'as page' or 'as url'. Only used if class is not explizit set.
NAME_ACTION_DELETE => '', NAME_ACTION_DELETE => '',
FINAL_HREF => '', FINAL_HREF => '',
FINAL_CONTENT => '', FINAL_CONTENT => '',
FINAL_SYMBOL => '', FINAL_SYMBOL => '',
FINAL_TOOL_TIP => '', FINAL_TOOL_TIP => '',
FINAL_CLASS => '', FINAL_CLASS => '',
FINAL_QUESTION => '', FINAL_QUESTION => '',
]; ];
} }
...@@ -556,6 +564,9 @@ class Link { ...@@ -556,6 +564,9 @@ class Link {
case TOKEN_SIP: case TOKEN_SIP:
$value = '1'; $value = '1';
break; break;
case TOKEN_BOOTSTRAP_BUTTON:
$value = '1';
break;
case TOKEN_QUESTION: case TOKEN_QUESTION:
$value = DEFAULT_QUESTION_TEXT; $value = DEFAULT_QUESTION_TEXT;
break; break;
......
...@@ -23,6 +23,7 @@ require_once(__DIR__ . '/../helper/KeyValueStringParser.php'); ...@@ -23,6 +23,7 @@ require_once(__DIR__ . '/../helper/KeyValueStringParser.php');
const DEFAULT_QUESTION = 'question'; const DEFAULT_QUESTION = 'question';
const DEFAULT_ICON = 'icon'; const DEFAULT_ICON = 'icon';
const DEFAULT_BOOTSTRAP_BUTTON = 'bootstrapButton';
class Report { class Report {
...@@ -120,6 +121,12 @@ class Report { ...@@ -120,6 +121,12 @@ class Report {
$this->pageDefaults[DEFAULT_ICON]["pagen"] = TOKEN_NEW; $this->pageDefaults[DEFAULT_ICON]["pagen"] = TOKEN_NEW;
$this->pageDefaults[DEFAULT_ICON]["pages"] = TOKEN_SHOW; $this->pageDefaults[DEFAULT_ICON]["pages"] = TOKEN_SHOW;
$this->pageDefaults[DEFAULT_BOOTSTRAP_BUTTON]["pagec"] = TOKEN_BOOTSTRAP_BUTTON;
$this->pageDefaults[DEFAULT_BOOTSTRAP_BUTTON]["paged"] = TOKEN_BOOTSTRAP_BUTTON;
$this->pageDefaults[DEFAULT_BOOTSTRAP_BUTTON]["pagee"] = TOKEN_BOOTSTRAP_BUTTON;
$this->pageDefaults[DEFAULT_BOOTSTRAP_BUTTON]["pagen"] = TOKEN_BOOTSTRAP_BUTTON;
$this->pageDefaults[DEFAULT_BOOTSTRAP_BUTTON]["pages"] = TOKEN_BOOTSTRAP_BUTTON;
$this->db = new Database(); $this->db = new Database();
$this->variables = new Variables($eval, $t3data["uid"]); $this->variables = new Variables($eval, $t3data["uid"]);
...@@ -1030,6 +1037,8 @@ class Report { ...@@ -1030,6 +1037,8 @@ class Report {
$defaultActionDelete = TOKEN_ACTION_DELETE . ':' . TOKEN_ACTION_DELETE_REPORT; $defaultActionDelete = TOKEN_ACTION_DELETE . ':' . TOKEN_ACTION_DELETE_REPORT;
} }
$defaultBootstrapButton = isset($this->pageDefaults[DEFAULT_BOOTSTRAP_BUTTON][$columnName]) ? $this->pageDefaults[DEFAULT_BOOTSTRAP_BUTTON][$columnName] : '';
# define default question only, if pagetype needs a question # define default question only, if pagetype needs a question
if (!empty($this->pageDefaults[DEFAULT_QUESTION][$columnName])) { if (!empty($this->pageDefaults[DEFAULT_QUESTION][$columnName])) {
$defaultQuestion = 'q:' . $this->pageDefaults[DEFAULT_QUESTION][$columnName]; $defaultQuestion = 'q:' . $this->pageDefaults[DEFAULT_QUESTION][$columnName];
...@@ -1057,6 +1066,9 @@ class Report { ...@@ -1057,6 +1066,9 @@ class Report {
case TOKEN_ACTION_DELETE: case TOKEN_ACTION_DELETE:
$defaultActionDelete = ''; $defaultActionDelete = '';
break; break;
case TOKEN_BOOTSTRAP_BUTTON: // if a bootstrapButton setting is given: no default
$defaultBootstrapButton = '';
break;
default: default:
break; break;
} }
...@@ -1081,6 +1093,11 @@ class Report { ...@@ -1081,6 +1093,11 @@ class Report {
$columnValue .= $defaultQuestion . "|"; $columnValue .= $defaultQuestion . "|";
} }
if ($defaultBootstrapButton !== '') {
$columnValue .= $defaultBootstrapButton . "|";
}
// if ($columnName === 'paged') { // if ($columnName === 'paged') {
// $columnValue = $this->adjustDeleteParameter($columnValue); // $columnValue = $this->adjustDeleteParameter($columnValue);
// } // }
......
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