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
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| | |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 |Edit |E |E |Show 'edit' icon as image |
......
......@@ -1109,6 +1109,7 @@ const TOKEN_DOWNLOAD = 'd';
const TOKEN_TEXT = 't';
const TOKEN_ALT_TEXT = 'a';
const TOKEN_TOOL_TIP = 'o';
const TOKEN_BOOTSTRAP_BUTTON = 'b';
const TOKEN_PICTURE = 'P';
const TOKEN_BULLET = 'B';
const TOKEN_CHECK = 'C';
......
......@@ -46,6 +46,7 @@ require_once(__DIR__ . '/../helper/KeyValueStringParser.php');
* c:class [n|i|e|<class>]
* q:question <text>
* e:encryption 0|1
* b:bootstrap button
*
* E:edit
* N:new
......@@ -71,6 +72,7 @@ const NAME_TEXT = 'text';
const NAME_DOWNLOAD = DOWNLOAD_EXPORT_FILENAME;
const NAME_DOWNLOAD_ELEMENTS = 'downloadElements'; // array with element sources
const NAME_DOWNLOAD_MODE = 'mode';
const NAME_BOOTSTRAP_BUTTON = 'bootstrapButton';
const NAME_ALT_TEXT = 'altText';
const NAME_TOOL_TIP = 'toolTip';
const NAME_TOOL_TIP_JS = 'toolTipJs';
......@@ -143,73 +145,74 @@ class Link {
private $ttContentUid = '';
private $callTable = [
TOKEN_URL => 'buildUrl',
TOKEN_MAIL => 'buildMail',
TOKEN_PAGE => 'buildPage',
TOKEN_URL => 'buildUrl',
TOKEN_MAIL => 'buildMail',
TOKEN_PAGE => 'buildPage',
TOKEN_DOWNLOAD => 'buildDownload',
TOKEN_TOOL_TIP => 'buildToolTip',
TOKEN_PICTURE => 'buildPicture',
TOKEN_BULLET => 'buildBullet',
TOKEN_CHECK => 'buildCheck',
TOKEN_DELETE => 'buildDeleteIcon',
TOKEN_PICTURE => 'buildPicture',
TOKEN_BULLET => 'buildBullet',
TOKEN_CHECK => 'buildCheck',
TOKEN_DELETE => 'buildDeleteIcon',
TOKEN_ACTION_DELETE => 'buildActionDelete',
TOKEN_EDIT => 'buildEdit',
TOKEN_HELP => 'buildHelp',
TOKEN_INFO => 'buildInfo',
TOKEN_NEW => 'buildNew',
TOKEN_SHOW => 'buildShow',
TOKEN_FILE => 'buildFile',
TOKEN_GLYPH => 'buildGlyph',
TOKEN_EDIT => 'buildEdit',
TOKEN_HELP => 'buildHelp',
TOKEN_INFO => 'buildInfo',
TOKEN_NEW => 'buildNew',
TOKEN_SHOW => 'buildShow',
TOKEN_FILE => 'buildFile',
TOKEN_GLYPH => 'buildGlyph',
];
private $tableVarName = [
TOKEN_URL => NAME_URL,
TOKEN_MAIL => NAME_MAIL,
TOKEN_PAGE => NAME_PAGE,
TOKEN_DOWNLOAD => NAME_DOWNLOAD,
TOKEN_DOWNLOAD_MODE => NAME_DOWNLOAD_MODE,
TOKEN_TEXT => NAME_TEXT,
TOKEN_ALT_TEXT => NAME_ALT_TEXT,
TOKEN_TOOL_TIP => NAME_TOOL_TIP,
TOKEN_PICTURE => NAME_IMAGE,
TOKEN_BULLET => NAME_IMAGE,
TOKEN_CHECK => NAME_IMAGE,
TOKEN_DELETE => NAME_IMAGE,
TOKEN_EDIT => NAME_IMAGE,
TOKEN_HELP => NAME_IMAGE,
TOKEN_INFO => NAME_IMAGE,
TOKEN_NEW => NAME_IMAGE,
TOKEN_SHOW => NAME_IMAGE,
TOKEN_GLYPH => NAME_IMAGE,
TOKEN_RENDER => NAME_RENDER,
TOKEN_TARGET => NAME_TARGET,
TOKEN_CLASS => NAME_LINK_CLASS,
TOKEN_QUESTION => NAME_QUESTION,
TOKEN_ENCRYPTION => NAME_ENCRYPTION,
TOKEN_SIP => NAME_SIP,
TOKEN_URL_PARAM => NAME_URL_PARAM,
TOKEN_RIGHT => NAME_RIGHT,
TOKEN_ACTION_DELETE => NAME_ACTION_DELETE,
TOKEN_FILE => NAME_FILE,
TOKEN_URL => NAME_URL,
TOKEN_MAIL => NAME_MAIL,
TOKEN_PAGE => NAME_PAGE,
TOKEN_DOWNLOAD => NAME_DOWNLOAD,
TOKEN_DOWNLOAD_MODE => NAME_DOWNLOAD_MODE,
TOKEN_TEXT => NAME_TEXT,
TOKEN_ALT_TEXT => NAME_ALT_TEXT,
TOKEN_BOOTSTRAP_BUTTON => NAME_BOOTSTRAP_BUTTON,
TOKEN_TOOL_TIP => NAME_TOOL_TIP,
TOKEN_PICTURE => NAME_IMAGE,
TOKEN_BULLET => NAME_IMAGE,
TOKEN_CHECK => NAME_IMAGE,
TOKEN_DELETE => NAME_IMAGE,
TOKEN_EDIT => NAME_IMAGE,
TOKEN_HELP => NAME_IMAGE,
TOKEN_INFO => NAME_IMAGE,
TOKEN_NEW => NAME_IMAGE,
TOKEN_SHOW => NAME_IMAGE,
TOKEN_GLYPH => NAME_IMAGE,
TOKEN_RENDER => NAME_RENDER,
TOKEN_TARGET => NAME_TARGET,
TOKEN_CLASS => NAME_LINK_CLASS,
TOKEN_QUESTION => NAME_QUESTION,
TOKEN_ENCRYPTION => NAME_ENCRYPTION,
TOKEN_SIP => NAME_SIP,
TOKEN_URL_PARAM => NAME_URL_PARAM,
TOKEN_RIGHT => NAME_RIGHT,
TOKEN_ACTION_DELETE => NAME_ACTION_DELETE,
TOKEN_FILE => NAME_FILE,
];
// Used to find double definitions.
private $tokenMapping = [
TOKEN_URL => LINK_ANCHOR,
TOKEN_MAIL => LINK_ANCHOR,
TOKEN_PAGE => LINK_ANCHOR,
TOKEN_URL => LINK_ANCHOR,
TOKEN_MAIL => LINK_ANCHOR,
TOKEN_PAGE => LINK_ANCHOR,
TOKEN_DOWNLOAD => LINK_ANCHOR,
TOKEN_PICTURE => LINK_PICTURE,
TOKEN_BULLET => LINK_PICTURE,
TOKEN_CHECK => LINK_PICTURE,
TOKEN_DELETE => LINK_PICTURE,
TOKEN_EDIT => LINK_PICTURE,
TOKEN_HELP => LINK_PICTURE,
TOKEN_INFO => LINK_PICTURE,
TOKEN_NEW => LINK_PICTURE,
TOKEN_SHOW => LINK_PICTURE,
TOKEN_GLYPH => LINK_PICTURE,
TOKEN_BULLET => LINK_PICTURE,
TOKEN_CHECK => LINK_PICTURE,
TOKEN_DELETE => LINK_PICTURE,
TOKEN_EDIT => LINK_PICTURE,
TOKEN_HELP => LINK_PICTURE,
TOKEN_INFO => LINK_PICTURE,
TOKEN_NEW => LINK_PICTURE,
TOKEN_SHOW => LINK_PICTURE,
TOKEN_GLYPH => LINK_PICTURE,
];
/**
......@@ -315,19 +318,23 @@ class Link {
// 1: 'text'
case '1':
$link = $vars[FINAL_CONTENT];
$link = Support::wrapTag($vars[FINAL_ANCHOR], $vars[FINAL_CONTENT]);
// $link = $vars[FINAL_CONTENT];
break;
case '11':
$link = $vars[FINAL_CONTENT];
$link = Support::wrapTag($vars[FINAL_ANCHOR], $vars[FINAL_CONTENT]);
// $link = $vars[FINAL_CONTENT];
// $link = $this->encryptMailtoJS($vars, false);
break;
// 2: 'url'
case '2':
$link = $vars[FINAL_HREF];
$link = Support::wrapTag($vars[FINAL_ANCHOR], $vars[FINAL_HREF]);
// $link = $vars[FINAL_HREF];
break;
case '12':
$link = $vars[FINAL_HREF];
$link = Support::wrapTag($vars[FINAL_ANCHOR], $vars[FINAL_HREF]);
// $link = $vars[FINAL_HREF];
// $link = $this->encryptMailtoJS($vars, false);
break;
......@@ -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
*
......@@ -482,42 +489,43 @@ class Link {
private function initVars() {
return [
NAME_MAIL => '',
NAME_URL => '',
NAME_PAGE => '',
NAME_TEXT => '',
NAME_ALT_TEXT => '',
NAME_IMAGE => '',
NAME_IMAGE_TITLE => '',
NAME_GLYPH => '',
NAME_GLYPH_TITLE => '',
NAME_QUESTION => '',
NAME_TARGET => '',
NAME_TOOL_TIP => '',
NAME_TOOL_TIP_JS => '',
NAME_URL_PARAM => '',
NAME_MAIL => '',
NAME_URL => '',
NAME_PAGE => '',
NAME_TEXT => '',
NAME_ALT_TEXT => '',
NAME_BOOTSTRAP_BUTTON => '',
NAME_IMAGE => '',
NAME_IMAGE_TITLE => '',
NAME_GLYPH => '',
NAME_GLYPH_TITLE => '',
NAME_QUESTION => '',
NAME_TARGET => '',
NAME_TOOL_TIP => '',
NAME_TOOL_TIP_JS => '',
NAME_URL_PARAM => '',
NAME_EXTRA_CONTENT_WRAP => '',
NAME_DOWNLOAD_MODE => '',
NAME_DOWNLOAD_MODE => '',
NAME_DOWNLOAD_ELEMENTS => array(),
NAME_RENDER => '0',
NAME_RIGHT => 'l',
NAME_SIP => '0',
NAME_ENCRYPTION => '0',
NAME_DELETE => '',
NAME_RENDER => '0',
NAME_RIGHT => 'l',
NAME_SIP => '0',
NAME_ENCRYPTION => '0',
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_ACTION_DELETE => '',
NAME_ACTION_DELETE => '',
FINAL_HREF => '',
FINAL_CONTENT => '',
FINAL_SYMBOL => '',
FINAL_TOOL_TIP => '',
FINAL_CLASS => '',
FINAL_QUESTION => '',
FINAL_HREF => '',
FINAL_CONTENT => '',
FINAL_SYMBOL => '',
FINAL_TOOL_TIP => '',
FINAL_CLASS => '',
FINAL_QUESTION => '',
];
}
......@@ -556,6 +564,9 @@ class Link {
case TOKEN_SIP:
$value = '1';
break;
case TOKEN_BOOTSTRAP_BUTTON:
$value = '1';
break;
case TOKEN_QUESTION:
$value = DEFAULT_QUESTION_TEXT;
break;
......
......@@ -23,6 +23,7 @@ require_once(__DIR__ . '/../helper/KeyValueStringParser.php');
const DEFAULT_QUESTION = 'question';
const DEFAULT_ICON = 'icon';
const DEFAULT_BOOTSTRAP_BUTTON = 'bootstrapButton';
class Report {
......@@ -120,6 +121,12 @@ class Report {
$this->pageDefaults[DEFAULT_ICON]["pagen"] = TOKEN_NEW;
$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->variables = new Variables($eval, $t3data["uid"]);
......@@ -1030,6 +1037,8 @@ class 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
if (!empty($this->pageDefaults[DEFAULT_QUESTION][$columnName])) {
$defaultQuestion = 'q:' . $this->pageDefaults[DEFAULT_QUESTION][$columnName];
......@@ -1057,6 +1066,9 @@ class Report {
case TOKEN_ACTION_DELETE:
$defaultActionDelete = '';
break;
case TOKEN_BOOTSTRAP_BUTTON: // if a bootstrapButton setting is given: no default
$defaultBootstrapButton = '';
break;
default:
break;
}
......@@ -1081,6 +1093,11 @@ class Report {
$columnValue .= $defaultQuestion . "|";
}
if ($defaultBootstrapButton !== '') {
$columnValue .= $defaultBootstrapButton . "|";
}
// if ($columnName === 'paged') {
// $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