From af832a5a9018c7dcc2f24111d82049902269fc53 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 18 Oct 2006 01:38:47 +0000 Subject: merge from 3.0 branch till 1463. --- buildscripts/chmbuilder/ChmQuickstartBuilder.php | 435 ++++++++++++++ buildscripts/chmbuilder/build.php | 80 +++ buildscripts/chmbuilder/build_child.php | 7 + buildscripts/chmbuilder/chm_style.css | 629 ++++++++++++++++++++ buildscripts/chmbuilder/classes/application.xml | 12 + .../chmbuilder/classes/pages/ClassDoc.page | 30 + buildscripts/chmbuilder/classes/pages/ClassDoc.php | 228 ++++++++ buildscripts/chmbuilder/classes/pages/Classes.page | 9 + buildscripts/chmbuilder/classes/pages/Classes.php | 19 + .../chmbuilder/classes/pages/MainLayout.php | 8 + .../chmbuilder/classes/pages/MainLayout.tpl | 33 ++ buildscripts/chmbuilder/classes/pages/style.css | 647 +++++++++++++++++++++ 12 files changed, 2137 insertions(+) create mode 100644 buildscripts/chmbuilder/ChmQuickstartBuilder.php create mode 100644 buildscripts/chmbuilder/build.php create mode 100644 buildscripts/chmbuilder/build_child.php create mode 100644 buildscripts/chmbuilder/chm_style.css create mode 100644 buildscripts/chmbuilder/classes/application.xml create mode 100644 buildscripts/chmbuilder/classes/pages/ClassDoc.page create mode 100644 buildscripts/chmbuilder/classes/pages/ClassDoc.php create mode 100644 buildscripts/chmbuilder/classes/pages/Classes.page create mode 100644 buildscripts/chmbuilder/classes/pages/Classes.php create mode 100644 buildscripts/chmbuilder/classes/pages/MainLayout.php create mode 100644 buildscripts/chmbuilder/classes/pages/MainLayout.tpl create mode 100644 buildscripts/chmbuilder/classes/pages/style.css (limited to 'buildscripts/chmbuilder') diff --git a/buildscripts/chmbuilder/ChmQuickstartBuilder.php b/buildscripts/chmbuilder/ChmQuickstartBuilder.php new file mode 100644 index 00000000..6087d5d8 --- /dev/null +++ b/buildscripts/chmbuilder/ChmQuickstartBuilder.php @@ -0,0 +1,435 @@ +base = $base; + $this->output_dir = $output.'/quickstart'; + + if(!is_dir($this->output_dir)) + { + mkdir($this->output_dir); + mkdir($this->output_dir.'/assets/'); + copy(dirname(__FILE__).'/chm_style.css', $this->output_dir.'/assets/chm_style.css'); + } + + Prado::setPathOfAlias('Output', realpath($this->output_dir)); + } + + public function buildDoc($pages) + { + foreach($pages as $section) + { + foreach($section as $page) + { + $this->parsePage($page); + } + } + } + + protected function initApp() + { + $this->app = new TApplication($this->base); + $response = new THttpResponse(); + $response->setBufferOutput(false); + $this->app->setResponse($response); + $assets = new TAssetManager(); + $assets->setBasePath('Output.assets.*'); + $this->app->setAssetManager($assets); + } + + public function parsePage($page) + { + $_GET['page'] = str_replace(array('/','.page'),array('.',''),$page); + $_GET['notheme'] = 'true'; + + $html = $this->parseHtmlContent($this->getApplicationContent()); + $file = str_replace(array('/','.page'), array('_','.html'),$page); + echo 'writing file '.$file."\n"; + file_put_contents($this->output_dir.'/'.$file, $html); + } + + protected function getApplicationContent() + { + ob_start(); + $this->initApp(); + $this->app->run(); + $content = ob_get_contents(); + ob_end_clean(); + return $content; + } + + protected function parseHtmlContent($content) + { + $html = preg_replace('/]+\/>/m', '', $content); +$html = str_replace('', '', $html); +$html = preg_replace('/