diff --git a/_build/build.config.php b/_build/build.config.php index 2e45db8a..df8b6d35 100644 --- a/_build/build.config.php +++ b/_build/build.config.php @@ -4,7 +4,7 @@ define('PKG_NAME', 'pdoTools'); define('PKG_NAME_LOWER', strtolower(PKG_NAME)); -define('PKG_VERSION', '2.12.3'); +define('PKG_VERSION', '2.13.0'); define('PKG_RELEASE', 'pl'); define('PKG_AUTO_INSTALL', true); diff --git a/_build/data/transport.settings.php b/_build/data/transport.settings.php index e8ff5fcf..c4fdf1c8 100644 --- a/_build/data/transport.settings.php +++ b/_build/data/transport.settings.php @@ -58,6 +58,10 @@ 'xtype' => 'combo-boolean', 'value' => false, ), + 'fenom_soft_mode' => array( + 'xtype' => 'combo-boolean', + 'value' => true, + ), 'elements_path' => array( 'xtype' => 'textfield', diff --git a/core/components/pdotools/docs/changelog.txt b/core/components/pdotools/docs/changelog.txt index 313b3e72..cbc3ac0d 100644 --- a/core/components/pdotools/docs/changelog.txt +++ b/core/components/pdotools/docs/changelog.txt @@ -1,5 +1,9 @@ Changelog for pdoTools. +2.13.0 pl +============== +- Add Fenom soft mode. This option, when compiling a Fenom tag error, enables the output of this tag as is. To inverse JS / JSON. + 2.12.3 pl ============== - Fixed E_NOTICE introduced in #285. diff --git a/core/components/pdotools/lexicon/de/default.inc.php b/core/components/pdotools/lexicon/de/default.inc.php index 48b62392..65cd59e4 100644 --- a/core/components/pdotools/lexicon/de/default.inc.php +++ b/core/components/pdotools/lexicon/de/default.inc.php @@ -42,4 +42,6 @@ $_lang['setting_pdotools_fenom_cache'] = 'Caching verarbeiteter Chunks'; $_lang['setting_pdotools_fenom_cache_desc'] = 'Wenn Sie große und komplexe Fenom-Chunks verwenden, können Sie das Caching der verarbeiteten Versionen aktivieren. Diese werden nur aktualisiert, wenn Sie den System-Cache leeren. Nicht empfohlen während der Entwicklung der Website.'; $_lang['setting_pdotools_fenom_save_on_errors'] = 'Fehlermeldungen speichern'; -$_lang['setting_pdotools_fenom_save_on_errors_desc'] = 'Aktivieren Sie diese Einstellung, um die Fenom-Compiler-Fehlermeldungen im Verzeichnis "core/cache/default/pdotools/error" zum späteren Debuggen zu speichern.'; \ No newline at end of file +$_lang['setting_pdotools_fenom_save_on_errors_desc'] = 'Aktivieren Sie diese Einstellung, um die Fenom-Compiler-Fehlermeldungen im Verzeichnis "core/cache/default/pdotools/error" zum späteren Debuggen zu speichern.'; +$_lang['setting_pdotools_fenom_soft_mode'] = 'Fenom soft mode'; +$_lang['setting_pdotools_fenom_soft_mode_desc'] = 'Diese Option aktiviert beim Kompilieren eines Fenom-Tag-Fehlers die Ausgabe dieses Tags wie sie ist. Um JS / JSON zu invertieren.'; \ No newline at end of file diff --git a/core/components/pdotools/lexicon/en/default.inc.php b/core/components/pdotools/lexicon/en/default.inc.php index 4f34a9e3..97804fa7 100644 --- a/core/components/pdotools/lexicon/en/default.inc.php +++ b/core/components/pdotools/lexicon/en/default.inc.php @@ -42,4 +42,6 @@ $_lang['setting_pdotools_fenom_cache'] = 'Caching compiled chunks'; $_lang['setting_pdotools_fenom_cache_desc'] = 'If you use large and complex Fenom chunks, you can enable caching of its compiled versions. They will be updated only when you clear the system cache. Not recommended for the development of the site.'; $_lang['setting_pdotools_fenom_save_on_errors'] = 'Save errors'; -$_lang['setting_pdotools_fenom_save_on_errors_desc'] = 'Enable this option to save Fenom compilation errors to the "core/cache/default/pdotools/error" directory for later debugging.'; \ No newline at end of file +$_lang['setting_pdotools_fenom_save_on_errors_desc'] = 'Enable this option to save Fenom compilation errors to the "core/cache/default/pdotools/error" directory for later debugging.'; +$_lang['setting_pdotools_fenom_soft_mode'] = 'Fenom soft mode'; +$_lang['setting_pdotools_fenom_soft_mode_desc'] = 'This option, when compiling a Fenom tag error, enables the output of this tag as is. To inverse JS / JSON.'; \ No newline at end of file diff --git a/core/components/pdotools/lexicon/ru/default.inc.php b/core/components/pdotools/lexicon/ru/default.inc.php index 358d766c..28121c5d 100644 --- a/core/components/pdotools/lexicon/ru/default.inc.php +++ b/core/components/pdotools/lexicon/ru/default.inc.php @@ -42,4 +42,6 @@ $_lang['setting_pdotools_fenom_cache'] = 'Кэширование скомпилированных чанков'; $_lang['setting_pdotools_fenom_cache_desc'] = 'Если вы используете большие и сложные чанки Fenom, то можно включить кэширование их скомпилированных версий. Они будут обновляться только при очистке системного кэша. Не рекомендуется при разработке сайта.'; $_lang['setting_pdotools_fenom_save_on_errors'] = 'Сохранять ошибки'; -$_lang['setting_pdotools_fenom_save_on_errors_desc'] = 'Включите эту опцию, чтобы сохранять ошибки компиляции Fenom в директорию "core/cache/default/pdotools/error" для последующей отладки.'; \ No newline at end of file +$_lang['setting_pdotools_fenom_save_on_errors_desc'] = 'Включите эту опцию, чтобы сохранять ошибки компиляции Fenom в директорию "core/cache/default/pdotools/error" для последующей отладки.'; +$_lang['setting_pdotools_fenom_soft_mode'] = 'Fenom soft mode'; +$_lang['setting_pdotools_fenom_soft_mode_desc'] = 'Эта опция, при ошибки компиляции тега Fenom, включает вывод этого тега как есть. Для иногрирования JS/JSON.'; \ No newline at end of file diff --git a/core/components/pdotools/model/pdotools/_fenom.php b/core/components/pdotools/model/pdotools/_fenom.php index 16033dc0..c87c40a8 100644 --- a/core/components/pdotools/model/pdotools/_fenom.php +++ b/core/components/pdotools/model/pdotools/_fenom.php @@ -47,6 +47,9 @@ public function __construct(pdoTools $pdoTools) if (!$pdoTools->config['useFenomPHP']) { $this->removeAccessor('php'); $options['disable_native_funcs'] = true; + } + if ($pdoTools->config['useFenomSoftMode']) { + $options['modx_soft_mode'] = $pdoTools->config['useFenomSoftMode']; } $this->setOptions($options); diff --git a/core/components/pdotools/model/pdotools/pdotools.class.php b/core/components/pdotools/model/pdotools/pdotools.class.php index 8389ce0c..ba5371d3 100644 --- a/core/components/pdotools/model/pdotools/pdotools.class.php +++ b/core/components/pdotools/model/pdotools/pdotools.class.php @@ -88,7 +88,8 @@ public function setConfig(array $config = array(), $clean_timings = true) $this->config['useFenomCache'] = $this->modx->getOption('pdotools_fenom_cache', null, false); $this->config['useFenomMODX'] = $this->modx->getOption('pdotools_fenom_modx', null, false); $this->config['useFenomPHP'] = $this->modx->getOption('pdotools_fenom_php', null, false); - + $this->config['useFenomSoftMode'] = $this->modx->getOption('pdotools_fenom_soft_mode', null, false); + // Prepare paths $pl = array( 'core_path' => MODX_CORE_PATH, @@ -984,6 +985,13 @@ protected function _compileChunk($content, $name = '') } try { $tpl = $fenom->getRawTemplate()->source($name, $content, true); + if($this->config['useFenomSoftMode']){ + if($tpl->getError()){ + if($this->modx->getOption('pdotools_fenom_save_on_errors')) + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Error compile Fenom chunk with name "' . $name . '": ' . $tpl->getError()); + $this->addTime('Error compile Fenom chunk with name "' . $name . '": ' . $tpl->getError()); + } + } $this->addTime('Compiled Fenom chunk with name "' . $name . '"'); } catch (Exception $e) { $this->modx->log(modX::LOG_LEVEL_ERROR, $e->getMessage());