From dc3bf922d9715bfd1b2105be04a9aabc84a1d7d4 Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 12 Apr 2007 08:05:03 +0000 Subject: Refactor and add TTableGateway, System.Data.Common, System.Data.DataGateway --- .../features/protected/pages/ClientScripts.page | 6 ++++ .../features/protected/pages/MyJavascriptLib.php | 32 ++++++++++++++++++++++ .../features/protected/pages/TestComp.php | 20 ++++++++++++++ .../protected/pages/myscripts/packages.php | 10 +++++++ 4 files changed, 68 insertions(+) create mode 100644 tests/FunctionalTests/features/protected/pages/ClientScripts.page create mode 100644 tests/FunctionalTests/features/protected/pages/MyJavascriptLib.php create mode 100644 tests/FunctionalTests/features/protected/pages/TestComp.php create mode 100644 tests/FunctionalTests/features/protected/pages/myscripts/packages.php (limited to 'tests/FunctionalTests/features/protected/pages') diff --git a/tests/FunctionalTests/features/protected/pages/ClientScripts.page b/tests/FunctionalTests/features/protected/pages/ClientScripts.page new file mode 100644 index 00000000..18aca48b --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/ClientScripts.page @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/pages/MyJavascriptLib.php b/tests/FunctionalTests/features/protected/pages/MyJavascriptLib.php new file mode 100644 index 00000000..964b48a5 --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/MyJavascriptLib.php @@ -0,0 +1,32 @@ +_manager = $owner->getClientScript(); + $owner->onPreRenderComplete = array($this, 'registerScriptLoader'); + } + + public static function registerPackage(TControl $control, $name) + { + static $instance; + if($instance===null) + $instance=new self($control->getPage()); + $instance->_packages[$name]=true; + } + + protected function registerScriptLoader() + { + $dir = dirname(__FILE__).'/myscripts'; //contains my javascript files + $scripts = array_keys($this->_packages); + $url = $this->_manager->registerJavascriptPackages($dir, $scripts); + $this->_manager->registerScriptFile($url,$url); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/pages/TestComp.php b/tests/FunctionalTests/features/protected/pages/TestComp.php new file mode 100644 index 00000000..f9d02c77 --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/TestComp.php @@ -0,0 +1,20 @@ +_class=$value; + } + + public function onPreRender($param) + { + parent::onPreRender($param); + MyJavascriptLib::registerPackage($this,$this->_class); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/pages/myscripts/packages.php b/tests/FunctionalTests/features/protected/pages/myscripts/packages.php new file mode 100644 index 00000000..41561a71 --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/myscripts/packages.php @@ -0,0 +1,10 @@ + \ No newline at end of file -- cgit v1.2.3