X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=CRM%2FCore%2FSmarty%2Fplugins%2Ffunction.crmResPath.php;h=01b47198a2c38a8f1ce3f093ec7921cac778c078;hb=016d95d3fe033f468b551b42bdc96e194f73e553;hp=dd91bae3351030f6aa2a6f4859d277780ac4ac13;hpb=b1a57b5955fedd37edd8a3fd0f334831b49dcd60;p=civicrm-core.git diff --git a/CRM/Core/Smarty/plugins/function.crmResPath.php b/CRM/Core/Smarty/plugins/function.crmResPath.php index dd91bae335..01b47198a2 100644 --- a/CRM/Core/Smarty/plugins/function.crmResPath.php +++ b/CRM/Core/Smarty/plugins/function.crmResPath.php @@ -21,14 +21,21 @@ * Determine the path of a resource file * * @param array $params + * Identify the resource by either 'ext'+'file' or 'expr'. + * * Array with keys: * - ext: string, extension name. see CRM_Core_Resources::getPath * - file: string, relative file path. see CRM_Core_Resources::getPath + * - expr: string, a dynamic path expression. See: \Civi\Core\Paths::getPath() * @param CRM_Core_Smarty $smarty * * @return string */ function smarty_function_crmResPath($params, &$smarty) { + if (!empty($params['expr'])) { + return Civi::paths()->getPath($params['expr']); + } + $res = CRM_Core_Resources::singleton(); if (!array_key_exists('ext', $params)) { $params['ext'] = 'civicrm';