| // +---------------------------------------------------------------------------+ // $Id$ require_once SGL_CORE_DIR . '/Item.php'; require_once SGL_MOD_DIR . '/publisher/classes/ArticleMgr.php'; require_once SGL_MOD_DIR . '/navigation/classes/MenuBuilder.php'; /** * Creates simple list of anchors and relevant content paragraphs. * * @package documentor * @author Demian Turner * @version $Revision: 1.12 $ * @access public * @since PHP 4.1 * @see ArticleMgr() */ class DocumentorMgr extends SGL_Manager { function DocumentorMgr() { SGL::logMessage(null, PEAR_LOG_DEBUG); parent::SGL_Manager(); $this->pageTitle = 'Manual Generator'; $this->template = 'manual.html'; $this->_aActionsMapping = array( 'list' => array('list'), ); } function validate($req, &$input) { SGL::logMessage(null, PEAR_LOG_DEBUG); $this->validated = true; $input->error = array(); $input->action = ($req->get('action')) ? $req->get('action') : 'list'; $input->pageTitle = $this->pageTitle; $input->masterTemplate = $this->masterTemplate; $input->template = $this->template; } function _cmd_list(&$input, &$output) { $output->template = 'manual.html'; // build TOC $table = 'category'; $menu = & new MenuBuilder('AnchorTOC', $table); $output->bulletList = $menu->toHtml(); $output->lastUpdated = date("l dS of F Y h:i:s A"); // retrieve articles $articles = & new ArticleMgr(); // grab article with template type from session preselected $aResult = $articles->retrieveAll($dataTypeID = 1, $queryRange = 'all'); $articles->add($aResult); $output->articles = $articles->aElements; for ($x = 0; $x < count($output->articles); $x++) { $item = & new SGL_Item($output->articles[$x]->item_id); $preview = $item->manualPreview(); $link = str_replace(' ', '_', $preview['title']); $title = $preview['title']; $preview['title'] = "

$title

"; $preview['bodyHtml'] = $preview['bodyHtml'] . '
'; $output->preview[] = (object)$preview; unset($item); } } } ?>