From 970da9fd7273827357100f89e5de33b55cf44d71 Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 23 Apr 2016 00:53:14 +0200 Subject: * moving stuff around (general classes from components to web) --- app/php/web/TemplateControl.php | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/php/web/TemplateControl.php (limited to 'app/php/web/TemplateControl.php') diff --git a/app/php/web/TemplateControl.php b/app/php/web/TemplateControl.php new file mode 100644 index 0000000..e3c9e26 --- /dev/null +++ b/app/php/web/TemplateControl.php @@ -0,0 +1,53 @@ +_getControlScriptPath(get_class($this)); + if (file_exists($scriptFile)) { + foreach ($this->getPradoScriptDependencies() as $dependency) { + $this->Page->ClientScript->registerPradoScript($dependency); + } + foreach ($this->getControlScriptDependencies() as $dependency) { + $this->Page->ClientScript->registerScriptFile( + 'TemplateControl.' . $dependency, + $this->Application->AssetManager->publishFilePath( + $this->_getControlScriptPath($dependency) + ) + ); + } + foreach ($this->getExternalScriptDependencies() as $dependency) { + $this->Page->ClientScript->registerHeadScriptFile( + $dependency, $dependency + ); + } + $this->Page->ClientScript->registerScriptFile( + 'TemplateControl.' . get_class($this), + $this->Application->AssetManager->publishFilePath($scriptFile) + ); + } + } + + protected function getPradoScriptDependencies() { + return []; + } + + protected function getControlScriptDependencies() { + return []; + } + + protected function getExternalScriptDependencies() { + return []; + } + +} + +?> -- cgit v1.2.3