Commit ae782037 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Store.php: TYPO3_DEBUG_SHOW_BODY_TEXT can only be set if SYSTE<_SHOW_DEBUG_INFO is set.

BodyTextParser.php, QuickFormQuery.php: replaced 'debugShowBodyText' with TYPO3_DEBUG_SHOW_BODY_TEXT, 'r' with TYPO3_RECORD_ID, 'form' with TYPO3_FORM.
parent a81b1317
......@@ -75,7 +75,7 @@ QFQ Keywords (Bodytext)
+-------------------+---------------------------------------------------------------------------------+
| <level>.althead | If <level>.sql is empty, these token will be rendered |
+-------------------+---------------------------------------------------------------------------------+
| debugShowBodyText | If ='1' and config.ini > *showDebugInfo=yes*: shows a symbols with bodytext |
| debugShowBodyText | If ='1' and config.ini:*showDebugInfo=yes*: shows a tooltip with bodytext |
+-------------------+---------------------------------------------------------------------------------+
.. _debug:
......
......@@ -61,7 +61,8 @@ class BodytextParser {
$full = '';
foreach ($bodytextArray as $row) {
// Valid 'new line' starts indicators: form, <level>, <level.sublevel>, <level>.<keyword>, {, <level> {, }
if ((1 === preg_match('/^\s*(\d*(\.)?)*\s*(head|althead|tail|sql|rbeg|rend|renr|rsep|fbeg|fend|fsep|form|debugShowBodyText|r) *=/', $row))
if ((1 === preg_match('/^\s*(\d*(\.)?)*\s*(head|althead|tail|sql|rbeg|rend|renr|rsep|fbeg|fend|fsep|' .
TYPO3_FORM . '|' . TYPO3_DEBUG_SHOW_BODY_TEXT . '|' . TYPO3_RECORD_ID . ') *=/', $row))
|| (1 === preg_match('/^\s*(\d*(\.)?)*\s*({|})\s*/', $row))
|| (1 === preg_match('/^\s*(\d+(\.)?)+/', $row))
) {
......
......@@ -213,6 +213,7 @@ const CLIENT_PHP_SELF = 'PHP_SELF';
// T3 Bodytext Keywords
const TYPO3_FORM = CLIENT_FORM;
const TYPO3_RECORD_ID = CLIENT_RECORD_ID;
const TYPO3_FE_USER = 'feUser';
const TYPO3_FE_USER_UID = 'feUserUid';
const TYPO3_FE_USER_GROUP = 'feUserGroup';
......@@ -220,6 +221,7 @@ const TYPO3_TT_CONTENT_UID = 'ttcontentUid';
const TYPO3_PAGE_ID = 'pageId';
const TYPO3_PAGE_TYPE = 'pageType';
const TYPO3_PAGE_LANGUAGE = 'pageLanguage';
const TYPO3_DEBUG_SHOW_BODY_TEXT = 'debugShowBodyText';
// System
const SYSTEM_DB_USER = 'DB_USER';
......
......@@ -158,7 +158,7 @@ class QuickFormQuery {
public function process() {
$html = '';
if ($this->store->getVar('debugShowBodyText', STORE_TYPO3) === '1') {
if ($this->store->getVar(TYPO3_DEBUG_SHOW_BODY_TEXT, STORE_TYPO3) === '1') {
$html .= Support::appendTooltip('', $this->t3data['bodytext']);
}
......
......@@ -384,6 +384,13 @@ class Store {
self::fillStoreTypo3($bodytext);
}
// Disable TYPO3_DEBUG_SHOW_BODY_TEXT=1 if SYSTEM_SHOW_DEBUG_INFO!='yes'
if (self::getVar(TYPO3_DEBUG_SHOW_BODY_TEXT, STORE_TYPO3) === '1' &&
self::getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM) !== 'yes'
) {
self::setVar(TYPO3_DEBUG_SHOW_BODY_TEXT, '0', STORE_TYPO3);
}
return self::$instance;
}
......@@ -406,6 +413,29 @@ class Store {
}
/**
* @param $key
* @param $value
* @param $store
* @param bool|true $overWrite
* @throws UserFormException
* @throws \qfq\CodeException
*/
public static function setVar($key, $value, $store, $overWrite = true) {
// Check valid Storename
if (!isset(self::$sanitizeStore))
throw new UserFormException("Unknown Store: $store", ERROR_UNNOWN_STORE);
if ($store === STORE_ZERO)
throw new CodeException("setVar() for STORE_ZERO is impossible - there are no values.", ERROR_SET_STORE_ZERO);
if ($overWrite === false && isset(self::$raw[$store][$key])) {
throw new UserFormException("Value of '$key' already be set in store '$store'.", ERROR_STORE_KEY_EXIST);
}
self::$raw[$store][$key] = $value;
}
/**
* @param $formName
* @throws CodeException
......@@ -438,29 +468,6 @@ class Store {
return self::$sip;
}
/**
* @param $key
* @param $value
* @param $store
* @param bool|true $overWrite
* @throws UserFormException
* @throws \qfq\CodeException
*/
public static function setVar($key, $value, $store, $overWrite = true) {
// Check valid Storename
if (!isset(self::$sanitizeStore))
throw new UserFormException("Unknown Store: $store", ERROR_UNNOWN_STORE);
if ($store === STORE_ZERO)
throw new CodeException("setVar() for STORE_ZERO is impossible - there are no values.", ERROR_SET_STORE_ZERO);
if ($overWrite === false && isset(self::$raw[$store][$key])) {
throw new UserFormException("Value of '$key' already be set in store '$store'.", ERROR_STORE_KEY_EXIST);
}
self::$raw[$store][$key] = $value;
}
/**
* @param $store
* @return array
......
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