Commit 312ac1c6 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Bug: custom variables enclosed in ticks now are now stripped of the ticks.

parent 2a8cfbf1
......@@ -437,6 +437,8 @@ Extension Manager: QFQ Configuration
+-------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| showIdInFormTitle | 0 (off), 1 (on) | Append at the form title the current record id. |
+-------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| cssClassColumnId | text-muted | A column in a subrecord with the name id|ID|Id gets this class. |
+-------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
.. _config-qfq-php:
......
......@@ -123,7 +123,8 @@ formDataError = error
# cat=form-config/config; type=boolean; label=Show record-id in form title:Default is off (0). If on (1), append the current record id on the title. New records get '(new)'.
showIdInFormTitle = 0
# cat=form-config/config; type=string; label=Wrap the subrecord column 'id|ID|Id' with the given class. E.g. 'text-muted' is rendered as ...<span class="text-muted">value</span>.
cssClassColumnId = text-muted
......
......@@ -2378,6 +2378,7 @@ abstract class AbstractBuildForm {
$control = array();
$primaryRecord = $this->store->getStore(STORE_RECORD);
$cssClassColumnId = $this->store->getVar(SYSTEM_CSS_CLASS_COLUMN_ID, STORE_SYSTEM . STORE_EMPTY);
if (!$this->prepareSubrecord($formElement, $primaryRecord, $rcText, $nameColumnId)) {
return $rcText;
......@@ -2414,7 +2415,7 @@ abstract class AbstractBuildForm {
// All columns
foreach ($row as $columnName => $value) {
if (isset($control[SUBRECORD_COLUMN_TITLE][$columnName])) {
$rowHtml .= Support::wrapTag("<td>", $this->renderCell($control, $columnName, $value));
$rowHtml .= Support::wrapTag("<td>", $this->renderCell($control, $columnName, $value, $cssClassColumnId));
}
}
......@@ -2701,13 +2702,14 @@ abstract class AbstractBuildForm {
* @param array $control
* @param string $columnName
* @param string $columnValue
* @param string $cssClassColumnId
*
* @return string
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
private function renderCell(array $control, $columnName, $columnValue) {
private function renderCell(array $control, $columnName, $columnValue, $cssClassColumnId) {
$link = null;
switch ($columnName) {
......@@ -2753,6 +2755,9 @@ abstract class AbstractBuildForm {
$cell = $link->renderLink($columnValue);
}
if(strcasecmp($columnName, 'id')==0){
$cell = Support::wrapTag('<span class="'. $cssClassColumnId .'">', $cell,true);
}
return $cell;
}
......
......@@ -422,6 +422,8 @@ const SYSTEM_CSS_CLASS_QFQ_FORM = 'cssClassQfqForm';
const SYSTEM_CSS_CLASS_QFQ_FORM_PILL = 'cssClassQfqFormPill';
const SYSTEM_CSS_CLASS_QFQ_FORM_BODY = 'cssClassQfqFormBody';
const SYSTEM_CSS_CLASS_COLUMN_ID = 'cssClassColumnId';
// Textmessages used for Form validation.
const SYSTEM_FORM_DATA_PATTERN_ERROR = 'formDataPatternError';
const SYSTEM_FORM_DATA_REQUIRED_ERROR = 'formDataRequiredError';
......
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