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';
......@@ -170,6 +172,7 @@ class Link {
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,
......@@ -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
*
......@@ -488,6 +495,7 @@ class Link {
NAME_TEXT => '',
NAME_ALT_TEXT => '',
NAME_BOOTSTRAP_BUTTON => '',
NAME_IMAGE => '',
NAME_IMAGE_TITLE => '',
NAME_GLYPH => '',
......@@ -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