Commit 11bc2c26 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Configuration will be read from T3 and config.qfq.ini

HelperFormElement.php, SessionCookie.php, Html2Pdf.php, Store.php, Constants.php: migrate to camel case on configuration variables.
Config.php: readConfig() reads now config.qfq.ini and T3 LocalConfiguration.php.
parent 082cf6ae
This diff is collapsed.
......@@ -140,7 +140,7 @@ class AutoCron {
// If the URL does not start with 'http...': prefix with the site config.
if (substr($job[AUTOCRON_CONTENT], 0, 4) != 'http') {
// We need to prefix
$baseUrl = $this->store->getVar(SYSTEM_BASE_URL_PRINT, STORE_SYSTEM);
$baseUrl = $this->store->getVar(SYSTEM_BASE_URL, STORE_SYSTEM);
$job[AUTOCRON_CONTENT] = $baseUrl . $job[AUTOCRON_CONTENT];
}
......
......@@ -7,7 +7,8 @@
*/
const EXT_KEY = 'qfq';
const CONFIG_INI = "config.qfq.ini"; // QFQ configuration file: db access
const CONFIG_QFQ = "config.qfq.ini"; // QFQ configuration file: db access
const CONFIG_T3 = 'LocalConfiguration.php'; // T3 config file
const GFX_INFO = 'typo3conf/ext/qfq/Resources/Public/icons/note.gif';
const API_DIR = 'typo3conf/ext/qfq/qfq/api';
......@@ -384,24 +385,27 @@ const SYSTEM_DB_1_SERVER = 'DB_1_SERVER';
const SYSTEM_DB_1_PASSWORD = 'DB_1_PASSWORD';
const SYSTEM_DB_1_NAME = 'DB_1_NAME';
const SYSTEM_DB_INIT = 'DB_INIT';
const SYSTEM_DB_INIT = 'init';
const SYSTEM_DB_INDEX_DATA = "DB_INDEX_DATA";
const SYSTEM_DB_INDEX_QFQ = "DB_INDEX_QFQ";
const SYSTEM_DB_INDEX_DATA = "indexData";
const SYSTEM_DB_INDEX_QFQ = "indexQfq";
const SYSTEM_DB_INDEX_DATA_DEPRECATED = "DB_INDEX_DATA";
const SYSTEM_DB_INDEX_QFQ_DEPRECATED = "DB_INDEX_QFQ";
// Computed dynamically
const SYSTEM_DB_NAME_DATA = '_dbNameData';
const SYSTEM_DB_NAME_QFQ = '_dbNameQfq';
const SYSTEM_SQL_LOG = 'SQL_LOG'; // Logging to file
const SYSTEM_SQL_LOG = 'sqlLog'; // Logging to file
const SYSTEM_SQL_LOG_FILE = '../../sql.log';
const SYSTEM_SQL_LOG_MODE = 'SQL_LOG_MODE'; // Mode, which statements to log.
const SYSTEM_DATE_FORMAT = 'DATE_FORMAT';
const SYSTEM_REDIRECT_ALL_MAIL_TO = 'REDIRECT_ALL_MAIL_TO';
const SYSTEM_MAIL_LOG = 'MAIL_LOG';
const SYSTEM_SQL_LOG_MODE = 'sqlLogMode'; // Mode, which statements to log.
const SYSTEM_DATE_FORMAT = 'dateFormat';
const SYSTEM_REDIRECT_ALL_MAIL_TO = 'redirectAllMailTo';
const SYSTEM_MAIL_LOG = 'mailLog';
const SYSTEM_MAIL_LOG_FILE = '../../mail.log';
const SYSTEM_SHOW_DEBUG_INFO = 'SHOW_DEBUG_INFO';
const SYSTEM_SHOW_DEBUG_INFO = 'showDebugInfo';
const SYSTEM_SHOW_DEBUG_INFO_YES = 'yes';
const SYSTEM_SHOW_DEBUG_INFO_NO = 'no';
const SYSTEM_SHOW_DEBUG_INFO_AUTO = 'auto'; // Remains on value 'auto' as long as there is no BE User logged in. In other words: 'auto'='no'. #5031
......@@ -409,32 +413,29 @@ const SYSTEM_SHOW_DEBUG_INFO_DOWNLOAD = 'download';
const SYSTEM_CSS_LINK_CLASS_INTERNAL = 'CSS_LINK_CLASS_INTERNAL';
const SYSTEM_CSS_LINK_CLASS_EXTERNAL = 'CSS_LINK_CLASS_EXTERNAL';
const SYSTEM_CSS_CLASS_QFQ_CONTAINER = 'CSS_CLASS_QFQ_CONTAINER';
const SYSTEM_CSS_CLASS_QFQ_FORM = 'CSS_CLASS_QFQ_FORM';
const SYSTEM_CSS_CLASS_QFQ_FORM_PILL = 'CSS_CLASS_QFQ_FORM_PILL';
const SYSTEM_CSS_CLASS_QFQ_FORM_BODY = 'CSS_CLASS_QFQ_FORM_BODY';
const SYSTEM_CSS_CLASS_QFQ_CONTAINER = 'cssClassQfqContainer';
const SYSTEM_CSS_CLASS_QFQ_FORM = 'cssClassQfqForm';
const SYSTEM_CSS_CLASS_QFQ_FORM_PILL = 'cssClassQfqFormPill';
const SYSTEM_CSS_CLASS_QFQ_FORM_BODY = 'cssClassQfqFormBody';
// Textmessages used for Form validation.
const SYSTEM_FORM_DATA_PATTERN_ERROR = 'FORM_DATA_PATTERN_ERROR';
const SYSTEM_FORM_DATA_REQUIRED_ERROR = 'FORM_DATA_REQUIRED_ERROR';
const SYSTEM_FORM_DATA_MATCH_ERROR = 'FORM_DATA_MATCH_ERROR';
const SYSTEM_FORM_DATA_ERROR = 'FORM_DATA_ERROR';
const SYSTEM_FORM_BS_COLUMNS = 'FORM_BS_COLUMNS';
const SYSTEM_FORM_DATA_PATTERN_ERROR = 'formDataPatternError';
const SYSTEM_FORM_DATA_REQUIRED_ERROR = 'formDataRequiredError';
const SYSTEM_FORM_DATA_MATCH_ERROR = 'formDataMatchError';
const SYSTEM_FORM_DATA_ERROR = 'formDataError';
const SYSTEM_FORM_BS_LABEL_COLUMNS = 'FORM_BS_LABEL_COLUMNS';
const SYSTEM_FORM_BS_INPUT_COLUMNS = 'FORM_BS_INPUT_COLUMNS';
const SYSTEM_FORM_BS_NOTE_COLUMNS = 'FORM_BS_NOTE_COLUMNS';
const SYSTEM_FORM_BS_COLUMNS = 'formBsColumns';
const SYSTEM_FORM_BUTTON_ON_CHANGE_CLASS = 'FORM_BUTTON_ON_CHANGE_CLASS';
const SYSTEM_FORM_BS_LABEL_COLUMNS = 'formBsLabelColumns';
const SYSTEM_FORM_BS_INPUT_COLUMNS = 'formBsInputColumns';
const SYSTEM_FORM_BS_NOTE_COLUMNS = 'formBsNoteColumns';
const SYSTEM_BASE_URL_PRINT = 'BASE_URL_PRINT';
const SYSTEM_WKHTMLTOPDF = 'WKHTMLTOPDF';
const SYSTEM_BASE_URL = 'baseUrl';
const SYSTEM_SEND_E_MAIL = 'sendEmail';
const SYSTEM_SEND_E_MAIL_OPTIONS = 'SEND_E_MAIL_OPTIONS';
const SYSTEM_SEND_E_MAIL_OPTIONS = 'sendEMailOptions';
const SYSTEM_EDIT_FORM_PAGE = 'EDIT_FORM_PAGE';
const SYSTEM_EDIT_FORM_PAGE = 'editFormPage';
// computed automatically during runtime
const SYSTEM_PATH_EXT = 'EXT_PATH';
......@@ -443,74 +444,76 @@ const SYSTEM_SITE_PATH = 'SITE_PATH';
const SYSTEM_LDAP_1_RDN = 'LDAP_1_RDN'; // Credentials to access LDAP
const SYSTEM_LDAP_1_PASSWORD = 'LDAP_1_PASSWORD'; // Credentials to access LDAP
const SYSTEM_ESCAPE_TYPE_DEFAULT = 'ESCAPE_TYPE_DEFAULT';
const SYSTEM_SECURITY_VARS_HONEYPOT = 'SECURITY_VARS_HONEYPOT'; // Fake variables
const SYSTEM_SECURITY_ATTACK_DELAY = 'SECURITY_ATTACK_DELAY'; // Detected attack causes x seconds delay
const SYSTEM_ESCAPE_TYPE_DEFAULT = 'escapeTypeDefault';
const SYSTEM_SECURITY_VARS_HONEYPOT = 'securityVarsHoneypot'; // Fake variables
const SYSTEM_SECURITY_ATTACK_DELAY = 'securityAttackDelay'; // Detected attack causes x seconds delay
const SYSTEM_SECURITY_ATTACK_DELAY_DEFAULT = 5; // Detected attack causes x seconds delay
const SYSTEM_SECURITY_SHOW_MESSAGE = 'SECURITY_SHOW_MESSAGE'; // Detected attack shows an error message
const SYSTEM_SECURITY_GET_MAX_LENGTH = 'SECURITY_GET_MAX_LENGTH'; // Trim every character (before conversion) to SECURITY_GET_MAX_LENGTH chars;
const SYSTEM_SECURITY_SHOW_MESSAGE = 'securityShowMessage'; // Detected attack shows an error message
const SYSTEM_SECURITY_GET_MAX_LENGTH = 'securityGetMaxLength'; // Trim every character (before conversion) to SECURITY_GET_MAX_LENGTH chars;
const SYSTEM_SECURITY_GET_MAX_LENGTH_DEFAULT = 50; // Default max length for get variables
const GET_EXTRA_LENGTH_TOKEN = '_';
const SYSTEM_GFX_EXTRA_BUTTON_INFO_INLINE = 'GFX_EXTRA_BUTTON_INFO_INLINE';
const SYSTEM_GFX_EXTRA_BUTTON_INFO_BELOW = 'GFX_EXTRA_BUTTON_INFO_BELOW';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION = 'EXTRA_BUTTON_INFO_POSITION';
const SYSTEM_EXTRA_BUTTON_INFO_INLINE = 'extraButtonInfoInline';
const SYSTEM_EXTRA_BUTTON_INFO_BELOW = 'extraButtonInfoBelow';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION = 'extraButtonInfoPosition';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION_AUTO = 'auto';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION_BELOW = 'below';
const SYSTEM_EXTRA_BUTTON_INFO_CLASS = 'EXTRA_BUTTON_INFO_CLASS';
const SYSTEM_SAVE_BUTTON_TEXT = 'SAVE_BUTTON_TEXT';
const SYSTEM_SAVE_BUTTON_TOOLTIP = 'SAVE_BUTTON_TOOLTIP';
const SYSTEM_SAVE_BUTTON_CLASS = 'SAVE_BUTTON_CLASS';
const SYSTEM_SAVE_BUTTON_GLYPH_ICON = 'SAVE_BUTTON_GLYPH_ICON';
const SYSTEM_CLOSE_BUTTON_TEXT = 'CLOSE_BUTTON_TEXT';
const SYSTEM_CLOSE_BUTTON_TOOLTIP = 'CLOSE_BUTTON_TOOLTIP';
const SYSTEM_CLOSE_BUTTON_CLASS = 'CLOSE_BUTTON_CLASS';
const SYSTEM_CLOSE_BUTTON_GLYPH_ICON = 'CLOSE_BUTTON_GLYPH_ICON';
const SYSTEM_DELETE_BUTTON_TEXT = 'DELETE_BUTTON_TEXT';
const SYSTEM_DELETE_BUTTON_TOOLTIP = 'DELETE_BUTTON_TOOLTIP';
const SYSTEM_DELETE_BUTTON_CLASS = 'DELETE_BUTTON_CLASS';
const SYSTEM_DELETE_BUTTON_GLYPH_ICON = 'DELETE_BUTTON_GLYPH_ICON';
const SYSTEM_NEW_BUTTON_TEXT = 'NEW_BUTTON_TEXT';
const SYSTEM_NEW_BUTTON_TOOLTIP = 'NEW_BUTTON_TOOLTIP';
const SYSTEM_NEW_BUTTON_CLASS = 'NEW_BUTTON_CLASS';
const SYSTEM_NEW_BUTTON_GLYPH_ICON = 'NEW_BUTTON_GLYPH_ICON';
const SYSTEM_DB_UPDATE = 'DB_UPDATE';
const SYSTEM_EXTRA_BUTTON_INFO_CLASS = 'extraButtonInfoClass';
const SYSTEM_SAVE_BUTTON_TEXT = 'saveButtonText';
const SYSTEM_SAVE_BUTTON_TOOLTIP = 'saveButtonTooltip';
const SYSTEM_SAVE_BUTTON_CLASS = 'saveButtonClass';
const SYSTEM_SAVE_BUTTON_GLYPH_ICON = 'saveButtonGlyphIcon';
const SYSTEM_SAVE_BUTTON_CLASS_ON_CHANGE = 'saveButtonClassOnChange';
const SYSTEM_CLOSE_BUTTON_TEXT = 'closeButtonText';
const SYSTEM_CLOSE_BUTTON_TOOLTIP = 'closeButtonTooltip';
const SYSTEM_CLOSE_BUTTON_CLASS = 'closeButtonClass';
const SYSTEM_CLOSE_BUTTON_GLYPH_ICON = 'closeButtonGlyphIcon';
const SYSTEM_DELETE_BUTTON_TEXT = 'deleteButtonText';
const SYSTEM_DELETE_BUTTON_TOOLTIP = 'deleteButtonTooltip';
const SYSTEM_DELETE_BUTTON_CLASS = 'deleteButtonClass';
const SYSTEM_DELETE_BUTTON_GLYPH_ICON = 'deleteButtonGlyphIcon';
const SYSTEM_NEW_BUTTON_TEXT = 'newButtonText';
const SYSTEM_NEW_BUTTON_TOOLTIP = 'newButtonTooltip';
const SYSTEM_NEW_BUTTON_CLASS = 'newButtonClass';
const SYSTEM_NEW_BUTTON_GLYPH_ICON = 'newButtonGlyphIcon';
const SYSTEM_DB_UPDATE = 'update';
const SYSTEM_DB_UPDATE_ALWAYS = 'always';
const SYSTEM_DB_UPDATE_NEVER = 'never';
const SYSTEM_DB_UPDATE_AUTO = 'auto';
const SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS = 'RECORD_LOCK_TIMEOUT_SECONDS';
const SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS = 'recordLockTimeoutSeconds';
const SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS_DEFAULT = 900; // 15 mins
// Deprecated, replaced by SYSTEM_FILL_STORE_SYSTEM_BY_SQ
const SYSTEM_VAR_ADD_BY_SQL = 'VAR_ADD_BY_SQL'; // since 1.12.17
//const SYSTEM_VAR_ADD_BY_SQL_DEFAULT = 'SELECT id AS periodId FROM Period WHERE start<=NOW() ORDER BY start DESC LIMIT 1';
const SYSTEM_FILL_STORE_SYSTEM_BY_SQL = 'FILL_STORE_SYSTEM_BY_SQL';
const SYSTEM_FILL_STORE_SYSTEM_ERROR_MSG = 'FILL_STORE_SYSTEM_ERROR_MSG';
const SYSTEM_FILL_STORE_SYSTEM_BY_SQL = 'fillStoreSystemBySql';
const SYSTEM_FILL_STORE_SYSTEM_ERROR_MSG = 'fillStoreSystemBySqlErrorMsg';
const SYSTEM_FORM_LANGUAGE = 'FORM_LANGUAGE';
const SYSTEM_FORM_LANGUAGE = 'formLanguage';
const SYSTEM_FORM_LANGUAGE_A_ID = 'FORM_LANGUAGE_A_ID';
const SYSTEM_FORM_LANGUAGE_A_LABEL = 'FORM_LANGUAGE_A_LABEL';
const SYSTEM_FORM_LANGUAGE_A_ID = 'formLanguageAId';
const SYSTEM_FORM_LANGUAGE_A_LABEL = 'formLanguageALabel';
const SYSTEM_FORM_LANGUAGE_B_ID = 'FORM_LANGUAGE_B_ID';
const SYSTEM_FORM_LANGUAGE_B_LABEL = 'FORM_LANGUAGE_B_LABEL';
const SYSTEM_FORM_LANGUAGE_B_ID = 'formLanguageBId';
const SYSTEM_FORM_LANGUAGE_B_LABEL = 'formLanguageBLabel';
const SYSTEM_FORM_LANGUAGE_C_ID = 'FORM_LANGUAGE_C_ID';
const SYSTEM_FORM_LANGUAGE_C_LABEL = 'FORM_LANGUAGE_C_LABEL';
const SYSTEM_FORM_LANGUAGE_C_ID = 'formLanguageCId';
const SYSTEM_FORM_LANGUAGE_C_LABEL = 'formLanguageCLabel';
const SYSTEM_FORM_LANGUAGE_D_ID = 'FORM_LANGUAGE_D_ID';
const SYSTEM_FORM_LANGUAGE_D_LABEL = 'FORM_LANGUAGE_D_LABEL';
const SYSTEM_FORM_LANGUAGE_D_ID = 'formLanguageDId';
const SYSTEM_FORM_LANGUAGE_D_LABEL = 'formLanguageDLabel';
const SYSTEM_ENTER_AS_SUBMIT = 'enterAsSubmit';
const SYSTEM_CMD_WKHTMLTOPDF = 'cmdWkhtmltopdf';
// Thumbnail
const SYSTEM_CMD_INKSCAPE = 'cmdInkscape';
const SYSTEM_CMD_CONVERT = 'cmdConvert';
......@@ -519,7 +522,7 @@ const SYSTEM_THUMBNAIL_DIR_SECURE_DEFAULT = 'fileadmin/protected/qfqThumbnail';
const SYSTEM_THUMBNAIL_DIR_PUBLIC = 'thumbnailDirPublic';
const SYSTEM_THUMBNAIL_DIR_PUBLIC_DEFAULT = 'typo3temp/qfqThumbnail';
const DOCUMENTATION_QFQ = 'DOCUMENTATION_QFQ';
const DOCUMENTATION_QFQ = 'documentation';
const DOCUMENTATION_QFQ_URL = 'https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/Manual.html';
......@@ -772,7 +775,7 @@ const F_DIRTY_MODE = 'dirtyMode';
const F_SUBMIT_BUTTON_TEXT = 'submitButtonText';
const F_BUTTON_ON_CHANGE_CLASS = 'buttonOnChangeClass';
const F_ESCAPE_TYPE_DEFAULT = 'escapeTypeDefault';
const F_ESCAPE_TYPE_DEFAULT = SYSTEM_ESCAPE_TYPE_DEFAULT;
const F_CLASS = 'class';
const F_CLASS_PILL = 'classPill';
......@@ -826,25 +829,25 @@ const F_MODE_GLOBAL = 'formModeGlobal';
const F_SAVE_BUTTON_ACTIVE = 'saveButtonActive';
const F_SAVE_BUTTON_TEXT = 'saveButtonText';
const F_SAVE_BUTTON_TOOLTIP = 'saveButtonTooltip';
const F_SAVE_BUTTON_CLASS = 'saveButtonClass';
const F_SAVE_BUTTON_GLYPH_ICON = 'saveButtonGlyphIcon';
const F_SAVE_BUTTON_TEXT = SYSTEM_SAVE_BUTTON_TEXT;
const F_SAVE_BUTTON_TOOLTIP = SYSTEM_SAVE_BUTTON_TOOLTIP;
const F_SAVE_BUTTON_CLASS = SYSTEM_SAVE_BUTTON_CLASS;
const F_SAVE_BUTTON_GLYPH_ICON = SYSTEM_SAVE_BUTTON_GLYPH_ICON;
const F_CLOSE_BUTTON_TEXT = 'closeButtonText';
const F_CLOSE_BUTTON_TOOLTIP = 'closeButtonTooltip';
const F_CLOSE_BUTTON_CLASS = 'closeButtonClass';
const F_CLOSE_BUTTON_GLYPH_ICON = 'closeButtonGlyphIcon';
const F_CLOSE_BUTTON_TEXT = SYSTEM_CLOSE_BUTTON_TEXT;
const F_CLOSE_BUTTON_TOOLTIP = SYSTEM_CLOSE_BUTTON_TOOLTIP;
const F_CLOSE_BUTTON_CLASS = SYSTEM_CLOSE_BUTTON_CLASS;
const F_CLOSE_BUTTON_GLYPH_ICON = SYSTEM_CLOSE_BUTTON_GLYPH_ICON;
const F_DELETE_BUTTON_TEXT = 'deleteButtonText';
const F_DELETE_BUTTON_TOOLTIP = 'deleteButtonTooltip';
const F_DELETE_BUTTON_CLASS = 'deleteButtonClass';
const F_DELETE_BUTTON_GLYPH_ICON = 'deleteButtonGlyphIcon';
const F_DELETE_BUTTON_TEXT = SYSTEM_DELETE_BUTTON_TEXT;
const F_DELETE_BUTTON_TOOLTIP = SYSTEM_DELETE_BUTTON_TOOLTIP;
const F_DELETE_BUTTON_CLASS = SYSTEM_DELETE_BUTTON_CLASS;
const F_DELETE_BUTTON_GLYPH_ICON = SYSTEM_DELETE_BUTTON_GLYPH_ICON;
const F_NEW_BUTTON_TEXT = 'newButtonText';
const F_NEW_BUTTON_TOOLTIP = 'newButtonTooltip';
const F_NEW_BUTTON_CLASS = 'newButtonClass';
const F_NEW_BUTTON_GLYPH_ICON = 'newButtonGlyphIcon';
const F_NEW_BUTTON_TEXT = SYSTEM_NEW_BUTTON_TEXT;
const F_NEW_BUTTON_TOOLTIP = SYSTEM_NEW_BUTTON_TOOLTIP;
const F_NEW_BUTTON_CLASS = SYSTEM_NEW_BUTTON_CLASS;
const F_NEW_BUTTON_GLYPH_ICON = SYSTEM_NEW_BUTTON_GLYPH_ICON;
const F_ENTER_AS_SUBMIT = SYSTEM_ENTER_AS_SUBMIT;
......@@ -976,7 +979,7 @@ const FE_CHARACTER_COUNT_WRAP = 'characterCountWrap';
const FE_INPUT_EXTRA_BUTTON_LOCK = 'extraButtonLock';
const FE_INPUT_EXTRA_BUTTON_PASSWORD = 'extraButtonPassword';
const FE_INPUT_EXTRA_BUTTON_INFO = 'extraButtonInfo';
const FE_INPUT_EXTRA_BUTTON_INFO_CLASS = 'extraButtonInfoClass';
const FE_INPUT_EXTRA_BUTTON_INFO_CLASS = SYSTEM_EXTRA_BUTTON_INFO_CLASS;
const FE_INPUT_AUTOCOMPLETE = 'autocomplete';
const FE_TMP_EXTRA_BUTTON_HTML = '_extraButtonHtml'; // will be filled on the fly during building extrabutton
const FE_CHECKBOX_CHECKED = 'checked';
......
......@@ -249,7 +249,7 @@ class QuickFormQuery {
}
foreach (['A', 'B', 'C', 'D'] as $key) {
$languageIdx = SYSTEM_FORM_LANGUAGE . "_$key" . "_ID";
$languageIdx = SYSTEM_FORM_LANGUAGE . "$key" . "Id";
if ($this->store->getVar($languageIdx, STORE_SYSTEM) == $typo3PageLanguage) {
$this->store->setVar(SYSTEM_PARAMETER_LANGUAGE_FIELD_NAME, 'parameterLanguage' . $key, STORE_SYSTEM);
break;
......
......@@ -306,8 +306,8 @@ class HelperFormElement {
$store = Store::getInstance();
$infoSymbolInside = $store->getVar(SYSTEM_GFX_EXTRA_BUTTON_INFO_INLINE, STORE_SYSTEM);
$infoSymbolOutside = $store->getVar(SYSTEM_GFX_EXTRA_BUTTON_INFO_BELOW, STORE_SYSTEM);
$infoSymbolInside = $store->getVar(SYSTEM_EXTRA_BUTTON_INFO_INLINE, STORE_SYSTEM);
$infoSymbolOutside = $store->getVar(SYSTEM_EXTRA_BUTTON_INFO_BELOW, STORE_SYSTEM);
if (SYSTEM_EXTRA_BUTTON_INFO_POSITION_BELOW == $store->getVar(SYSTEM_EXTRA_BUTTON_INFO_POSITION, STORE_SYSTEM)) {
$showInline = false;
......
......@@ -34,7 +34,7 @@ class SessionCookie {
$this->cleanTempFiles = !Support::findInSet(SYSTEM_SHOW_DEBUG_INFO_DOWNLOAD, $config[SYSTEM_SHOW_DEBUG_INFO]);
$urlParts = parse_url($config[SYSTEM_BASE_URL_PRINT]);
$urlParts = parse_url($config[SYSTEM_BASE_URL]);
$domain = $urlParts['host'];
$path = $urlParts['path'];
......
......@@ -66,16 +66,16 @@ class Html2Pdf {
$this->config = $config;
if (!isset($config[SYSTEM_BASE_URL_PRINT]) || $config[SYSTEM_BASE_URL_PRINT] == '') {
throw new \exception(CONFIG_INI . ' - Missing ' . SYSTEM_BASE_URL_PRINT, ERROR_HTML2PDF_MISSING_CONFIG);
if (!isset($config[SYSTEM_BASE_URL]) || $config[SYSTEM_BASE_URL] == '') {
throw new \exception(CONFIG_QFQ . ' - Missing ' . SYSTEM_BASE_URL, ERROR_HTML2PDF_MISSING_CONFIG);
}
if (!isset($config[SYSTEM_WKHTMLTOPDF]) || $config[SYSTEM_WKHTMLTOPDF] == '') {
throw new \exception(CONFIG_INI . ' - Missing ' . SYSTEM_WKHTMLTOPDF, ERROR_HTML2PDF_MISSING_CONFIG);
if (!isset($config[SYSTEM_CMD_WKHTMLTOPDF]) || $config[SYSTEM_CMD_WKHTMLTOPDF] == '') {
throw new \exception(CONFIG_QFQ . ' - Missing ' . SYSTEM_CMD_WKHTMLTOPDF, ERROR_HTML2PDF_MISSING_CONFIG);
}
if (!is_executable($config[SYSTEM_WKHTMLTOPDF])) {
throw new \exception(CONFIG_INI . ' - ' . SYSTEM_WKHTMLTOPDF . '=' . $config[SYSTEM_WKHTMLTOPDF] . ' - not found or not executable.', ERROR_HTML2PDF_WKHTML_NOT_EXECUTABLE);
if (!is_executable($config[SYSTEM_CMD_WKHTMLTOPDF])) {
throw new \exception(CONFIG_QFQ . ' - ' . SYSTEM_CMD_WKHTMLTOPDF . '=' . $config[SYSTEM_CMD_WKHTMLTOPDF] . ' - not found or not executable.', ERROR_HTML2PDF_WKHTML_NOT_EXECUTABLE);
}
$this->session = Session::getInstance($phpUnit);
......@@ -178,7 +178,7 @@ class Html2Pdf {
break;
case TOKEN_URL_PARAM:
case TOKEN_PAGE:
$host = $this->config[SYSTEM_BASE_URL_PRINT];
$host = $this->config[SYSTEM_BASE_URL];
$urlParamString = $url;
break;
default:
......@@ -205,7 +205,7 @@ class Html2Pdf {
}
$urlPrint = escapeshellarg($url);
$wkhtmlToPdf = $this->config[SYSTEM_WKHTMLTOPDF];
$wkhtmlToPdf = $this->config[SYSTEM_CMD_WKHTMLTOPDF];
$filename = tempnam(sys_get_temp_dir(), TMP_FILE_PREFIX);
$filenameEscape = escapeshellarg($filename);
......
......@@ -18,28 +18,42 @@ class Config {
/**
* Read config.qfq.ini.
*
* @param string $fileConfigIni
*
* @param string $configIni
* @return array
* @throws UserFormException
* @internal param string $pathTypo3Conf
*
*/
public function readConfig($fileConfigIni = '') {
public function readConfig($configIni = '') {
$configT3qfq = array();
if ($fileConfigIni == '') {
// Production Path to CONFIG_INI
$fileConfigIni = __DIR__ . '/../../../../../' . CONFIG_INI;
if (!file_exists($fileConfigIni)) {
$pathTypo3Conf = __DIR__ . '/../../../../..';
if (!file_exists($pathTypo3Conf . '/' . CONFIG_T3)) {
// PHPUnit Path to CONFIG_INI
$fileConfigIni = __DIR__ . '/../../../' . CONFIG_INI;
$pathTypo3Conf = __DIR__ . '/../../..';
}
// In case there is a $configIni given: do not try to include T3 LocalConfiguration.php
if (empty($configIni)) {
# Read 'LocalConfiguration.php'
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][EXT_KEY])) {
$configT3qfq = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][EXT_KEY]);
} else {
$all = include_once($pathTypo3Conf . '/' . CONFIG_T3);
$configT3qfq = unserialize($all['EXT']['extConf'][EXT_KEY]);
unset($all);
}
$configIni = $pathTypo3Conf . '/' . CONFIG_QFQ;
}
try {
$config = parse_ini_file($fileConfigIni, false);
$config = parse_ini_file($configIni, false);
} catch (\Exception $e) {
throw new qfq\UserFormException ("Error read file " . $fileConfigIni . ": " . $e->getMessage(), ERROR_IO_READ_FILE);
throw new qfq\UserFormException ("Error read file " . $pathTypo3Conf . ": " . $e->getMessage(), ERROR_IO_READ_FILE);
}
// Settings in config.qfq.ini overwrite T3 settings
$config = array_merge($configT3qfq, $config);
$config = self::renameConfigElements($config);
$config = self::setDefaults($config);
......@@ -51,6 +65,8 @@ class Config {
/**
* Checks for deprecated options.
* @param array $config
* @throws UserFormException
*/
private static function checkDeprecated(array $config) {
......@@ -60,9 +76,9 @@ class Config {
$msg = '';
switch ($key) {
case SYSTEM_VAR_ADD_BY_SQL:
$msg = 'Replaced by: ' . SYSTEM_FILL_STORE_SYSTEM_BY_SQL . '_1|2|3';
$msg = 'Replaced by: ' . SYSTEM_FILL_STORE_SYSTEM_BY_SQL . '1|2|3';
}
throw new qfq\UserFormException ("Deprecated option in " . CONFIG_INI . ": " . SYSTEM_VAR_ADD_BY_SQL . " - " . $msg);
throw new qfq\UserFormException ("Deprecated option in " . CONFIG_QFQ . ": " . SYSTEM_VAR_ADD_BY_SQL . " - " . $msg);
}
}
}
......@@ -173,7 +189,7 @@ class Config {
F_BS_INPUT_COLUMNS => '6',
F_BS_NOTE_COLUMNS => '3',
SYSTEM_WKHTMLTOPDF => '/opt/wkhtmltox/bin/wkhtmltopdf',
SYSTEM_CMD_WKHTMLTOPDF => '/opt/wkhtmltox/bin/wkhtmltopdf',
F_CLASS_PILL => 'qfq-color-grey-1',
F_CLASS_BODY => 'qfq-color-grey-2',
......@@ -205,8 +221,8 @@ class Config {
SYSTEM_SECURITY_SHOW_MESSAGE => '0',
SYSTEM_SECURITY_GET_MAX_LENGTH => SYSTEM_SECURITY_GET_MAX_LENGTH_DEFAULT,
SYSTEM_ESCAPE_TYPE_DEFAULT => TOKEN_ESCAPE_MYSQL,
SYSTEM_GFX_EXTRA_BUTTON_INFO_INLINE => '<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>',
SYSTEM_GFX_EXTRA_BUTTON_INFO_BELOW => '<span class="glyphicon glyphicon-info-sign text-info" aria-hidden="true"></span>',
SYSTEM_EXTRA_BUTTON_INFO_INLINE => '<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>',
SYSTEM_EXTRA_BUTTON_INFO_BELOW => '<span class="glyphicon glyphicon-info-sign text-info" aria-hidden="true"></span>',
SYSTEM_EXTRA_BUTTON_INFO_CLASS => '',
SYSTEM_DB_UPDATE => SYSTEM_DB_UPDATE_AUTO,
......@@ -222,6 +238,10 @@ class Config {
];
// To let run legacy code
$config[SYSTEM_DB_INDEX_DATA_DEPRECATED] = $config[SYSTEM_DB_INDEX_DATA];
$config[SYSTEM_DB_INDEX_QFQ_DEPRECATED] = $config[SYSTEM_DB_INDEX_QFQ];
return array_merge($default, $config);
}
......@@ -242,37 +262,16 @@ class Config {
[SYSTEM_FORM_BS_LABEL_COLUMNS, F_BS_LABEL_COLUMNS],
[SYSTEM_FORM_BS_INPUT_COLUMNS, F_BS_INPUT_COLUMNS],
[SYSTEM_FORM_BS_NOTE_COLUMNS, F_BS_NOTE_COLUMNS],
[SYSTEM_FORM_DATA_PATTERN_ERROR, F_FE_DATA_PATTERN_ERROR],
[SYSTEM_FORM_DATA_REQUIRED_ERROR, F_FE_DATA_REQUIRED_ERROR],
[SYSTEM_FORM_DATA_MATCH_ERROR, F_FE_DATA_MATCH_ERROR],
[SYSTEM_FORM_DATA_ERROR, F_FE_DATA_ERROR],
[SYSTEM_CSS_CLASS_QFQ_FORM, F_CLASS],
[SYSTEM_CSS_CLASS_QFQ_FORM_PILL, F_CLASS_PILL],
[SYSTEM_CSS_CLASS_QFQ_FORM_BODY, F_CLASS_BODY],
[SYSTEM_FORM_BUTTON_ON_CHANGE_CLASS, F_BUTTON_ON_CHANGE_CLASS],
[SYSTEM_ESCAPE_TYPE_DEFAULT, F_ESCAPE_TYPE_DEFAULT],
[SYSTEM_SAVE_BUTTON_TEXT, F_SAVE_BUTTON_TEXT],
[SYSTEM_SAVE_BUTTON_TOOLTIP, F_SAVE_BUTTON_TOOLTIP],
[SYSTEM_SAVE_BUTTON_CLASS, F_SAVE_BUTTON_CLASS],
[SYSTEM_SAVE_BUTTON_GLYPH_ICON, F_SAVE_BUTTON_GLYPH_ICON],
[SYSTEM_CLOSE_BUTTON_TEXT, F_CLOSE_BUTTON_TEXT],
[SYSTEM_CLOSE_BUTTON_TOOLTIP, F_CLOSE_BUTTON_TOOLTIP],
[SYSTEM_CLOSE_BUTTON_CLASS, F_CLOSE_BUTTON_CLASS],
[SYSTEM_CLOSE_BUTTON_GLYPH_ICON, F_CLOSE_BUTTON_GLYPH_ICON],
[SYSTEM_DELETE_BUTTON_TEXT, F_DELETE_BUTTON_TEXT],
[SYSTEM_DELETE_BUTTON_TOOLTIP, F_DELETE_BUTTON_TOOLTIP],
[SYSTEM_DELETE_BUTTON_CLASS, F_DELETE_BUTTON_CLASS],
[SYSTEM_DELETE_BUTTON_GLYPH_ICON, F_DELETE_BUTTON_GLYPH_ICON],
[SYSTEM_NEW_BUTTON_TEXT, F_NEW_BUTTON_TEXT],
[SYSTEM_NEW_BUTTON_TOOLTIP, F_NEW_BUTTON_TOOLTIP],
[SYSTEM_NEW_BUTTON_CLASS, F_NEW_BUTTON_CLASS],
[SYSTEM_NEW_BUTTON_GLYPH_ICON, F_NEW_BUTTON_GLYPH_ICON],
[SYSTEM_EXTRA_BUTTON_INFO_CLASS, FE_INPUT_EXTRA_BUTTON_INFO_CLASS],
[SYSTEM_SAVE_BUTTON_CLASS_ON_CHANGE, F_BUTTON_ON_CHANGE_CLASS],
];
......
......@@ -299,13 +299,13 @@ class Store {
private static function checkMandatoryParameter(array $config) {
// Check mandatory config vars.
$names = array_merge(['SQL_LOG', 'SQL_LOG_MODE'],
$names = array_merge([SYSTEM_SQL_LOG, SYSTEM_SQL_LOG_MODE],
self::dbCredentialName($config[SYSTEM_DB_INDEX_DATA]),
self::dbCredentialName($config[SYSTEM_DB_INDEX_QFQ]));
foreach ($names as $name) {
if (!isset($config[$name])) {
throw new qfq\UserFormException ("Missing configuration in `" . CONFIG_INI . "`: $name", ERROR_MISSING_CONFIG_INI_VALUE);
throw new qfq\UserFormException ("Missing configuration in `" . CONFIG_QFQ . "`: $name", ERROR_MISSING_CONFIG_INI_VALUE);
}
}
}
......@@ -836,7 +836,7 @@ class Store {
$storeSystem = self::getStore(STORE_SYSTEM);
for ($ii = 1; $ii <= 3; $ii++) {
if (empty($storeSystem[SYSTEM_FILL_STORE_SYSTEM_BY_SQL . "_$ii"])) {
if (empty($storeSystem[SYSTEM_FILL_STORE_SYSTEM_BY_SQL . "$ii"])) {
continue;
}
......@@ -844,16 +844,16 @@ class Store {
$db = new qfq\Database();
}
$errMsg = "More than 1 record found. " . CONFIG_INI . ": " . SYSTEM_FILL_STORE_SYSTEM_BY_SQL . "_$ii";
$errMsg = "More than 1 record found. " . CONFIG_QFQ . ": " . SYSTEM_FILL_STORE_SYSTEM_BY_SQL . "$ii";
$mode = ROW_EXPECT_0_1;
// If there is an error message defined, this means there should be exactly one record.
if (!empty($storeSystem[SYSTEM_FILL_STORE_SYSTEM_ERROR_MSG . "_$ii"])) {
if (!empty($storeSystem[SYSTEM_FILL_STORE_SYSTEM_ERROR_MSG . "$ii"])) {
$mode = ROW_EXPECT_1;
$errMsg = $storeSystem[SYSTEM_FILL_STORE_SYSTEM_ERROR_MSG . "_$ii"];
$errMsg = $storeSystem[SYSTEM_FILL_STORE_SYSTEM_ERROR_MSG . "$ii"];
}
$storeSystemAdd = $db->sql($storeSystem[SYSTEM_FILL_STORE_SYSTEM_BY_SQL . "_$ii"], $mode, array(), $errMsg);
$storeSystemAdd = $db->sql($storeSystem[SYSTEM_FILL_STORE_SYSTEM_BY_SQL . "$ii"], $mode, array(), $errMsg);
$storeSystemAdd = OnArray::keyNameRemoveLeadingUnderscore($storeSystemAdd);
$storeSystem = array_merge($storeSystem, $storeSystemAdd);
$flagDirty = true;
......
This diff is collapsed.
......@@ -79,7 +79,7 @@ abstract class AbstractDatabaseTest extends PHPUnit_Framework_TestCase {
// $this->store->setVar('DB_1_NAME', $dbNamePhpUnit, STORE_SYSTEM);
$dbName = $this->store->getVar('DB_NAME_TEST', STORE_SYSTEM);
if ($dbName == '') {
throw new \qfq\CodeException('Missing DB_NAME_TEST in ' . CONFIG_INI, ERROR_MISSING_REQUIRED_PARAMETER);
throw new \qfq\CodeException('Missing DB_NAME_TEST in ' . CONFIG_QFQ, ERROR_MISSING_REQUIRED_PARAMETER);
} else {
$this->store->setVar('DB_1_NAME', $dbName, STORE_SYSTEM);
}
......
......@@ -295,7 +295,7 @@ EOT;
F_BS_INPUT_COLUMNS => '6',
F_BS_NOTE_COLUMNS => '3',
SYSTEM_WKHTMLTOPDF => '/opt/wkhtmltox/bin/wkhtmltopdf',
SYSTEM_CMD_WKHTMLTOPDF => '/opt/wkhtmltox/bin/wkhtmltopdf',
F_CLASS_PILL => 'qfq-color-grey-1',
F_CLASS_BODY => 'qfq-color-grey-2',
......@@ -327,8 +327,8 @@ EOT;
SYSTEM_SECURITY_SHOW_MESSAGE => '0',
SYSTEM_SECURITY_GET_MAX_LENGTH => 50,
SYSTEM_ESCAPE_TYPE_DEFAULT => 'm',
SYSTEM_GFX_EXTRA_BUTTON_INFO_INLINE => '<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>',
SYSTEM_GFX_EXTRA_BUTTON_INFO_BELOW => '<span class="glyphicon glyphicon-info-sign text-info" aria-hidden="true"></span>',
SYSTEM_EXTRA_BUTTON_INFO_INLINE => '<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>',
SYSTEM_EXTRA_BUTTON_INFO_BELOW => '<span class="glyphicon glyphicon-info-sign text-info" aria-hidden="true"></span>',
SYSTEM_EXTRA_BUTTON_INFO_CLASS => '',
SYSTEM_DB_UPDATE => SYSTEM_DB_UPDATE_AUTO,
......
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