Commit 80f7d843 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Link class: unit tests extended

UsersManual/index.rst: cleanup of _link, _pagex, _PageX description.
Link.php, Report.php: Hard coded token names replaced by constants. Name of token 'h' (HASH) changed to 's' (SIP).
Report.php: Removed code for column '_F'.
parent 8ee21588
......@@ -57,7 +57,7 @@ require_once(__DIR__ . '/../exceptions/UserReportExtension.php');
* P:picture [file]
* C:checkbox [name]
* R:right
* h:hash
* s:sip
*
* A: A:[u:p:m]
* G: G:[N|..]
......@@ -82,12 +82,44 @@ const NAME_LINK_CLASS = 'linkClass';
const NAME_LINK_CLASS_DEFAULT = 'linkClassDefault';
const NAME_QUESTION = 'question';
const NAME_ENCRYPTION = 'encryption';
const NAME_HASH = 'hash';
const NAME_SIP = 'sip';
const NAME_URL_PARAM = 'param';
const NAME_RIGHT_PICTURE_POSITION = 'picturePosition';
const TOKEN_URL = 'u';
const TOKEN_MAIL = 'm';
const TOKEN_PAGE = 'p';
const TOKEN_TEXT = 't';
const TOKEN_ALT_TEXT = 'a';
const TOKEN_TOOL_TIP = 'o';
const TOKEN_PICTURE = 'P';
const TOKEN_BULLET = 'B';
const TOKEN_CHECK = 'C';
const TOKEN_DELETE = 'D';
const TOKEN_EDIT = 'E';
const TOKEN_HELP = 'H';
const TOKEN_INFO = 'I';
const TOKEN_NEW = 'N';
const TOKEN_SHOW = 'S';
const TOKEN_RENDER = 'r';
const TOKEN_TARGET = 'g';
const TOKEN_CLASS = 'c';
const TOKEN_QUESTION = 'q';
const TOKEN_ENCRYPTION = 'e';
const TOKEN_SIP = 's';
const TOKEN_URL_PARAM = 'U';
const TOKEN_RIGHT = 'R';
const TOKEN_CLASS_NONE = 'n';
const TOKEN_CLASS_INTERNAL = 'i';
const TOKEN_CLASS_EXTERNAL = 'e';
const NO_CLASS = 'no_class';
const DEFAULT_BULLET_COLOR = 'green';
const DEFAULT_CHECK_COLOR = 'green';
/**
* Class Link
* @package qfq
......@@ -118,50 +150,50 @@ class Link {
* @var array
*/
private $renderControl = array();
private $linkClassSelector = array("i" => "internal", "e" => "external");
private $linkClassSelector = array(TOKEN_CLASS_INTERNAL => "internal", TOKEN_CLASS_EXTERNAL => "external");
private $cssLinkClassInternal = '';
private $cssLinkClassExternal = '';
private $callTable = [
'u' => 'buildUrl',
'm' => 'buildMail',
'p' => 'buildPage',
'o' => 'buildToolTip',
'P' => 'buildPicture',
'B' => 'buildBullet',
'C' => 'buildCheck',
'D' => 'buildDelete',
'E' => 'buildEdit',
'H' => 'buildHelp',
'I' => 'buildInfo',
'N' => 'buildNew',
'S' => 'buildShow',
TOKEN_URL => 'buildUrl',
TOKEN_MAIL => 'buildMail',
TOKEN_PAGE => 'buildPage',
TOKEN_TOOL_TIP => 'buildToolTip',
TOKEN_PICTURE => 'buildPicture',
TOKEN_BULLET => 'buildBullet',
TOKEN_CHECK => 'buildCheck',
TOKEN_DELETE => 'buildDelete',
TOKEN_EDIT => 'buildEdit',
TOKEN_HELP => 'buildHelp',
TOKEN_INFO => 'buildInfo',
TOKEN_NEW => 'buildNew',
TOKEN_SHOW => 'buildShow',
];
private $tableVarName = [
'u' => NAME_URL,
'm' => NAME_MAIL,
'p' => NAME_PAGE,
't' => NAME_TEXT,
'a' => NAME_ALT_TEXT,
'o' => NAME_TOOL_TIP,
'P' => NAME_IMAGE,
'B' => NAME_IMAGE,
'C' => NAME_IMAGE,
'D' => NAME_IMAGE,
'E' => NAME_IMAGE,
'H' => NAME_IMAGE,
'I' => NAME_IMAGE,
'N' => NAME_IMAGE,
'S' => NAME_IMAGE,
'r' => NAME_RENDER,
'g' => NAME_TARGET,
'c' => NAME_LINK_CLASS,
'q' => NAME_QUESTION,
'e' => NAME_ENCRYPTION,
'h' => NAME_HASH,
'U' => NAME_URL_PARAM,
'R' => NAME_RIGHT_PICTURE_POSITION,
TOKEN_URL => NAME_URL,
TOKEN_MAIL => NAME_MAIL,
TOKEN_PAGE => NAME_PAGE,
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_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_PICTURE_POSITION,
];
private $varsDefault = array();
......@@ -186,7 +218,7 @@ class Link {
$this->varsDefault[NAME_ENCRYPTION] = '0';
$this->varsDefault[NAME_RIGHT_PICTURE_POSITION] = 'l';
$this->varsDefault[NAME_RENDER] = 0;
$this->varsDefault[NAME_HASH] = 0;
$this->varsDefault[NAME_SIP] = 0;
/*
* mode:
......@@ -259,14 +291,13 @@ class Link {
$this->parseItem($vars, $item);
}
$necessaryDefaults = [NAME_RENDER, NAME_RIGHT_PICTURE_POSITION, NAME_HASH, NAME_ENCRYPTION];
$necessaryDefaults = [NAME_RENDER, NAME_RIGHT_PICTURE_POSITION, NAME_SIP, NAME_ENCRYPTION];
foreach ($necessaryDefaults AS $keyName) {
if ($vars[$keyName] == '') {
$vars[$keyName] = $this->varsDefault[$keyName];
}
}
// if there is no url or mailto definition: {{global.pageId}}
// if ($vars[NAME_URL] == '' && $vars[NAME_MAIL] == '') {
// $vars[NAME_URL] = "?" . $this->store->getVar(TYPO3_PAGE_ID, STORE_TYPO3);
......@@ -346,7 +377,8 @@ class Link {
// 3: <a href=url>url</a>
case '3':
$link = $htmlUrl . $vars[NAME_URL] . '</a>' . $vars[NAME_TOOL_TIP_JS][1];
// $link = $htmlUrl . $vars[NAME_URL] . '</a>' . $vars[NAME_TOOL_TIP_JS][1];
$link = $htmlUrl . $vars[NAME_URL] . '</a>';
break;
case '13':
$vars[NAME_TEXT] = $vars[NAME_MAIL];
......@@ -355,7 +387,8 @@ class Link {
// 4: <a href=url>Text</a>
case '4':
$link = $htmlUrl . $vars[NAME_TEXT] . '</a>' . $vars[NAME_TOOL_TIP_JS][1];
// $link = $htmlUrl . $vars[NAME_TEXT] . '</a>' . $vars[NAME_TOOL_TIP_JS][1];
$link = $htmlUrl . $vars[NAME_TEXT] . '</a>';
break;
case '14':
$link = $this->encryptMailtoJS($vars, TRUE);
......@@ -365,7 +398,7 @@ class Link {
case '23':
case '24':
//TODO: Alter Code, umstellen auf JS Client von RO. Vorlage koennte 'Delete' in Subrecord sein.
$link = "<a href=\"javascript: void(0);\" onClick=\"var del = new FR.Delete({recordId:'',hash:'',forward:'" .
$link = "<a href=\"javascript: void(0);\" onClick=\"var del = new FR.Delete({recordId:'',sip:'',forward:'" .
$vars[NAME_PAGE] . "'});\" " . $vars[NAME_LINK_CLASS] . ">" . $vars[NAME_TEXT] . "</a>";
}
......@@ -400,7 +433,7 @@ class Link {
$vars[NAME_RENDER] = '';
$vars[NAME_RIGHT_PICTURE_POSITION] = '';
$vars[NAME_HASH] = '';
$vars[NAME_SIP] = '';
$vars[NAME_ENCRYPTION] = '';
$vars[NAME_DELETE] = '';
......@@ -425,10 +458,10 @@ class Link {
$value = isset($arr[1]) ? $arr[1] : '';
// Superclass
if ($key === 'A' || $key === 'G') {
$this->parseItem($vars, $value);
return;
}
// if ($key === 'A' || $key === 'G') {
// $this->parseItem($vars, $value);
// return;
// }
if (!isset($this->tableVarName[$key])) {
throw new UserReportException ("Unknown link qualifier: '$key'", ERROR_UNKNOWN_LINK_QUALIFIER);
......@@ -439,13 +472,13 @@ class Link {
// A few keys do not have necessarily a value: fake the definition by manual creating a value.
if ($value == '') {
switch ($key) {
case 'R':
case TOKEN_RIGHT:
$value = 'r';
break;
case 'h':
case TOKEN_SIP:
$value = '1';
break;
case 'p':
case TOKEN_PAGE:
$value = $this->store->getVar(TYPO3_PAGE_ID, STORE_TYPO3); // If no pageid|pagealias is defined, take current page
break;
default:
......@@ -459,7 +492,9 @@ class Link {
}
// Check for empty values. Respect: some keys are allowed to be empty.
if ($value === '' && strpos('uENDHIS', $key) === false) {
$emptyOk = TOKEN_ALT_TEXT . TOKEN_TARGET . TOKEN_TOOL_TIP . TOKEN_URL . TOKEN_BULLET . TOKEN_CHECK .
TOKEN_EDIT . TOKEN_NEW . TOKEN_DELETE . TOKEN_HELP . TOKEN_INFO . TOKEN_SHOW;
if ($value === '' && strpos($emptyOk, $key) === false) {
throw new UserReportException ("Missing value for '$key'", ERROR_MISSING_VALUE);
}
......@@ -492,12 +527,12 @@ class Link {
$class = '';
switch ($vars[NAME_LINK_CLASS]) {
case 'n':
case TOKEN_CLASS_NONE:
$vars[NAME_LINK_CLASS] = '';
break;
case 'i':
case 'e':
$vars[NAME_LINK_CLASS] = $this->linkClassSelector[$vars[NAME_LINK_CLASS]];
case TOKEN_CLASS_INTERNAL:
case TOKEN_CLASS_EXTERNAL:
$vars[NAME_LINK_CLASS] = $this->linkClassSelector[$vars[NAME_LINK_CLASS]];
break;
default:
$vars[NAME_LINK_CLASS] = ($vars[NAME_LINK_CLASS] == '') ? $vars[NAME_LINK_CLASS_DEFAULT] : $vars[NAME_LINK_CLASS];
......@@ -513,7 +548,7 @@ class Link {
* Create the HTML anchor.
* - <a href="mailto:info@example.com" title=".." class="..">
* - <a href="http://example.com" title=".." class="..">
* - If $this->modeHash is set, create a hash (sip)
* - If $vars[NAME_SIP] === "1", create a sip
*
* @param array $vars
* @return string
......@@ -527,14 +562,14 @@ class Link {
// Link: URL
if ($vars[NAME_URL] !== '') {
if ($vars[NAME_HASH] === "1") {
if ($vars[NAME_SIP] === "1") {
$paramArray = $this->sip->queryStringToSip(Support::concatUrlParam($vars[NAME_URL], $vars[NAME_URL_PARAM]), RETURN_ARRAY);
$vars[NAME_URL] = $paramArray['_url'];
if ($this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM) === 'yes') {
$vars[NAME_TOOL_TIP] .= PHP_EOL . PHP_EOL . OnArray::toString($paramArray, ' = ', PHP_EOL, "'");
$this->buildToolTip($vars, 'o', $vars[NAME_TOOL_TIP]);
$this->buildToolTip($vars, TOKEN_TOOL_TIP, $vars[NAME_TOOL_TIP]);
}
} else {
......@@ -568,28 +603,17 @@ class Link {
$attributes .= Support::doAttribute('href', $vars[NAME_URL]);
$attributes .= Support::doAttribute('class', $vars[NAME_LINK_CLASS]);
$attributes .= Support::doAttribute('target', $vars[NAME_TARGET]);
// $attributes .= Support::doAttribute('title', $anchorTitle);
$attributes .= Support::doAttribute('title', $vars[NAME_TOOL_TIP]);
if ($vars[NAME_QUESTION]) {
$attributes .= Support::doAttribute('onclick', 'confirm(\'' . $vars[NAME_QUESTION] . '\')');
}
// $anchor = '<a ' . $attributes . $vars[NAME_TOOL_TIP_JS][0] . '>';
$anchor = '<a ' . $attributes . '>';
return ($anchor);
}
//
//<a class="btn btn-default" href="index.php?id=2&s=56fbdd30a0cd2" title='comment'>
// <span class='glyphicon glyphicon-plus'></span>
//</a>
//
//<a href="index.php?id=2&s=56fb7f7703692" class="internal" >
// <img src="typo3conf/ext/qfq/Resources/Public/icons/edit.gif" title="Edit" >
//</a>
/**
* Create a ToolTip: $toolTip[0] and $toolTip[1] have to inserted in HTML code accordingly.
* $vars[NAME_TOOL_TIP_JS][0]: JS to show '$toolTip[1]'.
......@@ -602,7 +626,9 @@ class Link {
private function buildToolTip(&$vars, $key, $value) {
static $count = 0;
$toolTipIndex = 'tooltip.' . $GLOBALS["TSFE"]->currentRecord . '.' . ++$count;
// $toolTipIndex = 'tooltip.' . $GLOBALS["TSFE"]->currentRecord . '.' . ++$count;
$toolTipIndex = 'fake';
$vars[NAME_TOOL_TIP_JS] = array();
// Expample: <img src="fileadmin/icons/bullet-gray.gif" onmouseover="document.getElementById('gm167979').style.
......@@ -762,7 +788,7 @@ class Link {
private function buildPage(&$vars, $key, $value) {
if ($vars[NAME_URL] != '') {
throw new UserReportException ("Multiple definitions for key 'p'", ERROR_MULTIPLE_DEFINITION);
throw new UserReportException ("Multiple definitions for token '" . TOKEN_PAGE . "'", ERROR_MULTIPLE_DEFINITION);
}
if (substr($value, 0, 3) !== 'id=') {
......@@ -781,7 +807,9 @@ class Link {
* @param $value
*/
private function buildPicture(&$vars, $key, $value) {
$vars[NAME_ALT_TEXT] = "Grafic: " . $value;
if ($vars[NAME_ALT_TEXT] == '') {
$vars[NAME_ALT_TEXT] = "Grafic: " . $value;
}
$vars[NAME_IMAGE_TITLE] = $value;
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
......@@ -794,6 +822,10 @@ class Link {
* @param $value
*/
private function buildBullet(&$vars, $key, $value) {
if ($value == '') {
$value = DEFAULT_BULLET_COLOR;
}
$vars[NAME_IMAGE] = PATH_ICONS . "bullet-" . $value . '.gif';
$vars[NAME_IMAGE_TITLE] = $value;
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
......@@ -807,6 +839,9 @@ class Link {
* @param $value
*/
private function buildCheck(&$vars, $key, $value) {
if ($value == '') {
$value = DEFAULT_CHECK_COLOR;
}
$vars[NAME_IMAGE] = PATH_ICONS . "checked-" . $value . '.gif';
$vars[NAME_IMAGE_TITLE] = $value;
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
......@@ -820,16 +855,21 @@ class Link {
* @param $value
*/
private function buildDelete(&$vars, $key, $value) {
// $vars[NAME_IMAGE] = PATH_ICONS . 'delete.gif';
// $vars[NAME_IMAGE_TITLE] = "Delete";
$vars[NAME_DELETE] = true;
// TODO: zur Zeit auskommentiert damit die Tests laufen. Aktuell nicht klar ob es sinnvoll ist die spezielle
// 'DELETE' Funktionalitet hier an das ICON zu knuepfen. Was ist wenn das Icon benutzt werden soll OHNE die SIP Funktion?
// Vermutlich ist es sonnvoller das `_paged` das Flag setzt. Gibt es / soll es eine anderer Moeglichkeit geben, ausser _paged,
// die Delete Funktionalitaet zu trigger?
//
// $vars[NAME_DELETE] = true;
$vars[NAME_GLYPH] = GLYPH_ICON_DELETE;
$vars[NAME_GLYPH_TITLE] = "Delete";
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
// Include Extjs library
$this->utils->loadJSlib($this->fr_error);
// $this->utils->loadJSlib($this->fr_error);
}
/**
......@@ -840,8 +880,7 @@ class Link {
* @param $value
*/
private function buildEdit(&$vars, $key, $value) {
// $vars[NAME_IMAGE] = PATH_ICONS . 'edit.gif';
// $vars[NAME_IMAGE_TITLE] = "Edit";
$vars[NAME_GLYPH] = GLYPH_ICON_EDIT;
$vars[NAME_GLYPH_TITLE] = "Edit";
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
......@@ -855,8 +894,7 @@ class Link {
* @param $value
*/
private function buildHelp(&$vars, $key, $value) {
// $vars[NAME_IMAGE] = PATH_ICONS . 'help.gif';
// $vars[NAME_IMAGE_TITLE] = "Help";
$vars[NAME_GLYPH] = GLYPH_ICON_HELP;
$vars[NAME_GLYPH_TITLE] = "Help";
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
......@@ -871,8 +909,6 @@ class Link {
* @param $value
*/
private function buildInfo(&$vars, $key, $value) {
// $vars[NAME_IMAGE] = PATH_ICONS . 'info.gif';
// $vars[NAME_IMAGE_TITLE] = "Information";
$vars[NAME_GLYPH] = GLYPH_ICON_INFO;
$vars[NAME_GLYPH_TITLE] = "Information";
......@@ -888,8 +924,6 @@ class Link {
* @param $value
*/
private function buildNew(&$vars, $key, $value) {
// $vars[NAME_IMAGE] = PATH_ICONS . 'new.gif';
// $vars[NAME_IMAGE_TITLE] = "New";
$vars[NAME_GLYPH] = GLYPH_ICON_NEW;
$vars[NAME_GLYPH_TITLE] = "New";
......@@ -905,8 +939,6 @@ class Link {
* @param $value
*/
private function buildShow(&$vars, $key, $value) {
// $vars[NAME_IMAGE] = PATH_ICONS . 'show.gif';
// $vars[NAME_IMAGE_TITLE] = "Details";
$vars[NAME_GLYPH] = GLYPH_ICON_SHOW;
$vars[NAME_GLYPH_TITLE] = "Details";
......
......@@ -102,16 +102,16 @@ class Report {
$this->page_control["msgbox"]["pagec"] = "Please confirm!";
$this->page_control["hash"]["paged"] = "h";
$this->page_control["hash"]["pagee"] = "h";
$this->page_control["hash"]["pagen"] = "h";
$this->page_control["sip"]["paged"] = TOKEN_SIP;
$this->page_control["sip"]["pagee"] = TOKEN_SIP;
$this->page_control["sip"]["pagen"] = TOKEN_SIP;
$this->page_control["icon"]["paged"] = "D";
$this->page_control["icon"]["pagee"] = "E";
$this->page_control["icon"]["pageh"] = "H";
$this->page_control["icon"]["pagei"] = "I";
$this->page_control["icon"]["pagen"] = "N";
$this->page_control["icon"]["pages"] = "S";
$this->page_control["icon"]["paged"] = TOKEN_DELETE;
$this->page_control["icon"]["pagee"] = TOKEN_EDIT;
$this->page_control["icon"]["pageh"] = TOKEN_HELP;
$this->page_control["icon"]["pagei"] = TOKEN_INFO;
$this->page_control["icon"]["pagen"] = TOKEN_NEW;
$this->page_control["icon"]["pages"] = TOKEN_SHOW;
$this->db = new Database();
$this->utils = new Utils();
......@@ -575,7 +575,8 @@ class Report {
if ($columnValue === '')
break;
$linkValue = "r:3|B:" . $columnValue;
// r:3|B:
$linkValue = TOKEN_RENDER . ":3|" . TOKEN_BULLET . ":" . $columnValue;
$link = new Link($this->fr_error, $this->sip);
$content .= $link->renderLink($linkValue);
break;
......@@ -584,14 +585,17 @@ class Report {
if ($columnValue === '')
break;
$linkValue = "r:3|C:" . $columnValue;
// "r:3|C:
$linkValue = TOKEN_RENDER . ":3|" . TOKEN_CHECK . ":" . $columnValue;
$link = new Link($this->fr_error, $this->sip);
$content .= $link->renderLink($linkValue);
break;
case "img":
// "<path to image>|[alttext]|[text behind]" renders to: <img src="<path to image>" alt="[alttext]">[text behind]
if (empty($columnValue)) break;
if (empty($columnValue))
break;
$tmp = explode("|", $columnValue, 3);
if ($tmp[0] == "") break;
$content .= '<img src="' . $tmp[0] . '" alt="' . $tmp[1] . '">' . $tmp[2];
......@@ -659,80 +663,6 @@ class Report {
#$style = "line-height: 1.5em; background:#eee; display: block; white-space: nowrap; padding-left: 3px; writing-mode: tb-rl; filter: flipv fliph; transform: rotate(270deg) translate(-10em,0); transform-origin: 0 0; -moz-transform: rotate(270deg) translate(-10em,0); -moz-transform-origin: 0 0; -webkit-transform: rotate(270deg) translate(-10em,0); -webkit-transform-origin: 0 0;";
$content = $tag_open . 'style="' . $style . '">' . $arr[0] . $tag_close;
break;
case "F":
$newColumnName = "";
$newFinalColumnName = "";
$remain = array();
$striptags = false;
$tag = "";
# 'Q:mailto|Z|V:mail_first|support@example.com'
$arr = explode("|", $columnValue);
foreach ($arr as $value) {
$kv = explode(":", $value);
switch ($kv[0]) {
case "Q":
$newColumnName = $kv[1];
#if(!$newColumnName) throw new syntaxException ( "Missing a 'reserved column name' for parameter 'Q' in column 'F': $columnValue","",__FILE__,__LINE__,$this->fr_error);
if ($newColumnName == 'F')
throw new SyntaxReportException ("Not allowed: 'F' as 'reserved column name' for parameter 'Q': $columnValue",
"", __FILE__, __LINE__, $this->fr_error);
break;
case "Z":
// $show = false;
break;
case "T":
$striptags = TRUE;
break;
case "X":
$tag = $kv[1];
if (!$tag)
throw new SyntaxReportException ("Missing the 'tag' parameter for 'X'): $columnValue",
"", __FILE__, __LINE__, $this->fr_error);
break;
case "V":
$newFinalColumnName = $kv[1];
if (!$newFinalColumnName)
throw new SyntaxReportException ("Missing the 'name' parameter for 'V': $columnValue",
"", __FILE__, __LINE__, $this->fr_error);
break;
case 'F':
throw new SyntaxReportException ("Qualifier 'F' is not allowed inside of a column with column name 'F': $columnValue",
"", __FILE__, __LINE__, $this->fr_error);
break;
# Save every non 'F' qualifier for later usage
default:
$remain[] = $value;
break;
}
}
# Check for needed action
# if(!$newColumnName) throw new syntaxException ( "Missing parameter 'Q' in column 'F': $columnValue","",__FILE__,__LINE__,$this->fr_error);
if ($newColumnName)
$columnName = $newColumnName;
else
$columnName = "no column name defined";
# reconstruct remaining parameters
$arr = implode("|", $remain);
# render
$content = $this->renderColumn($columnIndex, $columnName, $arr, $full_level, $rowIndex, $flagOutput);
if ($newFinalColumnName)
$columnName = $newFinalColumnName;
# striptags
if ($striptags) $content = strip_tags($content);
# tag
if ($tag) {
$arr = explode(" ", $tag);
$content = "<" . $tag . ">" . $content . "</" . $arr[0] . ">";
}
break;
default :
......@@ -806,28 +736,30 @@ class Report {
// Split definition
$param = explode('|', $columnValue);
if (count($param) > 9)
throw new SyntaxReportException ("Too many parameter (max=9): $columnValue", "", __FILE__, __LINE__, $this->fr_error);
if (count($param) > 8)
throw new SyntaxReportException ("Too many parameter (max=8): $columnValue", "", null, __FILE__, __LINE__, $this->fr_error);
// make first 'P' lowercase
$columnName = 'p' . substr($columnName, 1);
$columnName[0] = 'p';
// -- Page --
// Split PageId|PageAlias and URL Params
$tmparr = explode('&', $param[0], 2);
$link .= $this->composeLinkPart('p', $tmparr[0]); // -- PageID --
$link .= $this->composeLinkPart('U', $tmparr[1]); // -- URL Params --
$link .= $this->composeLinkPart('i', $param[1]); // -- record id --
$link .= $this->composeLinkPart('t', $param[2]); // -- Text --
$link .= $this->composeLinkPart('o', $param[3]); // -- tooltip --
$link .= $this->composeLinkPart('q', $param[4], $this->page_control["msgbox"][$columnName]); // -- msgbox
$link .= $this->composeLinkPart('c', $param[5]); // -- class --
$link .= $this->composeLinkPart('g', $param[6]); // -- target --
$link .= $this->composeLinkPart('r', $param[7]); // -- render mode --
$link .= $this->composeLinkPart(TOKEN_PAGE, $tmparr[0]); // -- PageID --
$link .= $this->composeLinkPart(TOKEN_URL_PARAM, $tmparr[1]);
$link .= $this->composeLinkPart(TOKEN_TEXT, $param[1]); // -- Text --
$link .= $this->composeLinkPart(TOKEN_TOOL_TIP, $param[2]); // -- tooltip --
$link .= $this->composeLinkPart(TOKEN_QUESTION, $param[3], $this->page_control["msgbox"][$columnName]); // -- msgbox
$link .= $this->composeLinkPart(TOKEN_CLASS, $param[4]); // -- class --
$link .= $this->composeLinkPart(TOKEN_TARGET, $param[5]); // -- target --
$link .= $this->composeLinkPart(TOKEN_RENDER, $param[6]); // -- render mode --
if (!$param[7])