mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-29 13:38:44 +02:00
Merge remote-tracking branch 'origin/support/2.7' into support/3.0
N°5741 - remove use of get_config_parameter and get_module_setting in Twig # Conflicts: # application/twigextension.class.inc.php # datamodels/2.x/itop-portal-base/portal/src/Twig/AppExtension.php # sources/application/TwigBase/Twig/Extension.php
This commit is contained in:
@@ -14,7 +14,6 @@ use Combodo\iTop\Application\UI\Base\iUIBlock;
|
||||
use Combodo\iTop\Renderer\BlockRenderer;
|
||||
use Dict;
|
||||
use Exception;
|
||||
use MetaModel;
|
||||
use Twig_Environment;
|
||||
use Twig_SimpleFilter;
|
||||
use Twig_SimpleFunction;
|
||||
@@ -143,28 +142,6 @@ class Extension
|
||||
return utils::IsDevelopmentEnvironment();
|
||||
}));
|
||||
|
||||
// Function to get configuration parameter
|
||||
// Usage in twig: {{ get_config_parameter('foo') }}
|
||||
$oTwigEnv->addFunction(new Twig_SimpleFunction('get_config_parameter', function ($sParamName) {
|
||||
$oConfig = MetaModel::GetConfig();
|
||||
|
||||
return $oConfig->Get($sParamName);
|
||||
}));
|
||||
|
||||
/**
|
||||
* Function to get a module setting
|
||||
* Usage in twig: {{ get_module_setting(<MODULE_CODE>, <PROPERTY_CODE> [, <DEFAULT_VALUE>]) }}
|
||||
*
|
||||
* @uses Config::GetModuleSetting()
|
||||
* @since 3.0.0
|
||||
*/
|
||||
$oTwigEnv->addFunction(new Twig_SimpleFunction('get_module_setting',
|
||||
function (string $sModuleCode, string $sPropertyCode, $defaultValue = null) {
|
||||
$oConfig = MetaModel::GetConfig();
|
||||
|
||||
return $oConfig->GetModuleSetting($sModuleCode, $sPropertyCode, $defaultValue);
|
||||
}));
|
||||
|
||||
// Function to get iTop's app root absolute URL (eg. https://aaa.bbb.ccc/xxx/yyy/)
|
||||
// Usage in twig: {{ get_absolute_url_app_root() }}
|
||||
/** @since 3.0.0 */
|
||||
|
||||
Reference in New Issue
Block a user