/** * @inheritdoc */ public function process(array $params, \Smarty_Internal_Template $smarty) { if (isset($params['module'], $params['file']) === true && (bool) preg_match('=/=', $params['module']) === false && (bool) preg_match('=\\./=', $params['file']) === false) { // Do not include the same file multiple times $key = $params['module'] . '/' . $params['file']; if (isset($this->alreadyIncluded[$key]) === false) { if (!empty($params['depends'])) { $this->assets->enableLibraries(explode(',', $params['depends'])); } $this->alreadyIncluded[$key] = true; $script = '<script type="text/javascript" src="%s"></script>'; $module = ucfirst($params['module']); $file = $params['file']; $path = $this->fileResolver->getStaticAssetPath($module . '/Resources/', $module . '/', 'Assets/js', $file . '.js'); if (strpos($path, '/ACP3/Modules/') !== false) { $path = $this->appPath->getWebRoot() . substr($path, strpos($path, '/ACP3/Modules/') + 1); } else { $path = $this->appPath->getWebRoot() . substr($path, strlen(ACP3_ROOT_DIR)); } return sprintf($script, $path); } return ''; } throw new \Exception('Not all necessary arguments for the function ' . __FUNCTION__ . ' were passed!'); }
/** * Fetch a template's modification time from data source * * @param string $name template name * * @return integer timestamp (epoch) the template was modified */ protected function fetchTimestamp($name) { $asset = $this->fileResolver->resolveTemplatePath($name); return filemtime($asset); }
/** * @inheritdoc */ public function process(array $params, \Smarty_Internal_Template $smarty) { return $this->fileResolver->resolveTemplatePath($params['path']); }