destdir = $destdir; } function setPages($page) { $this->page = $page; } /** * Main entrypoint of the task */ function main() { $output = $this->destdir->getAbsolutePath(); $base = dirname(__FILE__).'/../../../demos/quickstart/protected/'; error_reporting(0); $quickstart= new ChmQuickstartBuilder($base,$output); foreach(preg_split('/\s*[, ]+\s*/', $this->page) as $page) { $file = str_replace(array('/','.page'), array('_','.html'),$page); $this->log("Parsing $page"); file_put_contents($output.'/'.$file, $this->parsePage($quickstart,$page)); $this->log("Writing $file"); } } protected function parsePage($quickstart, $page) { $_GET['page'] = str_replace(array('/','.page'),array('.',''),$page); $_GET['notheme'] = 'true'; $content = $quickstart->parseHtmlContent($quickstart->getApplicationContent()); //hide prado specific content $content = str_replace('', '', $content); return $content; } } ?>