public function transform() { //// // fetch attributes from taglib tag // navigation level $level = $this->getAttribute('level', '0'); // navigation is relative (in respect to level of current page) $rellevel = $this->getAttribute('rellevel', 'false'); // depth of levels (how many levels are displayed (in submenus)) $depth = $this->getAttribute('depth', '1'); // base page id $basePageId = $this->getAttribute('basePageId'); // keep request parameters $keepRequestParams = $this->getAttribute('keepRequestParams'); //// // fetch template name and namespace $tmplName = $this->getAttribute('template', 'navTaglib'); $tmplNamespace = $this->getAttribute('namespace', 'APF\\extensions\\apfelsms\\pres\\templates'); $page = new Page(); $page->setContext($this->getContext()); $page->setLanguage($this->getLanguage()); $page->loadDesign($tmplNamespace, $tmplName); $rootDoc = $page->getRootDocument(); $rootDoc->setAttribute('SMSNavLevel', $level); $rootDoc->setAttribute('SMSNavRelLevel', $rellevel); $rootDoc->setAttribute('SMSNavDepth', $depth); $rootDoc->setAttribute('SMSNavBasePageId', $basePageId); $rootDoc->setAttribute('SMSBaseNavKeepRequestParams', $keepRequestParams); return $page->transform(); }
public function transform() { //// // fetch attributes from taglib tag // fetch basePageId $basePageId = $this->getAttribute('basePageId'); // fetch basePageIdTitle $basePageIdTitle = $this->getAttribute('basePageIdTitle'); // keep request parameters $keepRequestParams = $this->getAttribute('keepRequestParams'); //// // fetch template name and namespace $tmplName = $this->getAttribute('template', 'breadcrumbNavTaglib'); $tmplNamespace = $this->getAttribute('namespace', 'APF\\extensions\\apfelsms\\pres\\templates'); $page = new Page(); $page->setContext($this->getContext()); $page->setLanguage($this->getLanguage()); $page->loadDesign($tmplNamespace, $tmplName); $rootDoc = $page->getRootDocument(); $rootDoc->setAttribute('SMSBreadcrumbNavBasePageId', $basePageId); $rootDoc->setAttribute('SMSBreadcrumbNavBasePageIdTitle', $basePageIdTitle); $rootDoc->setAttribute('SMSBaseNavKeepRequestParams', $keepRequestParams); return $page->transform(); }
/** * @param string $stringPager name of the pager * * @return string The HTML representation of the pager * @throws Exception In case no pager configuration can be found. * * @author Lutz Mahlstedt * @version * Version 0.1, 21.12.2009<br /> */ public function getPager($stringPager) { $stringOutput = ''; $objectArrayPagerMapper = $this->getDataMapper(); $arrayData = $objectArrayPagerMapper->loadEntries($stringPager); if (is_array($arrayData) === true) { if (is_array($arrayData) === true and count($arrayData) > 0) { // create pager page $pager = new Page(); // apply context and language (form configuration purposes!) $pager->setLanguage($this->getLanguage()); $pager->setContext($this->getContext()); // load the configured design $pager->loadDesign($this->pagerConfig['DesignNamespace'], $this->pagerConfig['DesignTemplate']); // add the necessary config params and pages $rootDoc = $pager->getRootDocument(); $rootDoc->setAttribute('Config', ['ParameterPage' => $this->pagerConfig['ParameterPage'], 'ParameterEntries' => $this->pagerConfig['ParameterEntries'], 'Entries' => intval($this->getRequest()->getParameter($this->pagerConfig['ParameterEntries'], $this->pagerConfig['Entries'])), 'EntriesPossible' => $this->pagerConfig['EntriesPossible'], 'EntriesChangeable' => $this->pagerConfig['EntriesChangeable']]); $rootDoc->setAttribute('DataCount', count($arrayData)); // add the anchor if desired if ($this->anchorName !== null) { $rootDoc->setAttribute('AnchorName', $this->anchorName); } $stringOutput = $pager->transform(); } } else { throw new Exception('[ArrayPagerManager->getPager()] There is no pager named "' . $stringPager . '" registered!', E_USER_WARNING); } return $stringOutput; }
/** * Creates the exception page. * * @return string the exception page content. * * @author Christian Achatz * @version * Version 0.1, 21.02.2009<br /> */ protected function buildExceptionPage() { // at this point we have to re-include the benchmark timer, because PHP // sometimes forgets about this import and throws a // Fatal error: Exception thrown without a stack frame in Unknown on line 0 // exception. // create page $stackTrace = new Page(); $stackTrace->setContext('APF\\core\\exceptionhandler'); $stackTrace->loadDesign('APF\\core\\exceptionhandler\\templates', 'exceptionpage'); // inject exception information into the document attributes array $doc = $stackTrace->getRootDocument(); $doc->setAttribute('id', $this->generateExceptionID()); $doc->setAttribute('message', $this->exceptionMessage); $doc->setAttribute('number', $this->exceptionNumber); $doc->setAttribute('file', $this->exceptionFile); $doc->setAttribute('line', $this->exceptionLine); $doc->setAttribute('trace', array_reverse($this->exceptionTrace)); $doc->setAttribute('type', $this->exceptionType); // create exception page return $stackTrace->transform(); }
/** * Creates the graphical output of the pagerc concerning the configured presentation layer template. * * @param array $addStmtParams list of additional statement params * * @return string The HTML representation of the pager * * @author Christian Achatz * @version * Version 0.1, 05.08.2006<br /> * Version 0.2, 11.03.2007 (Ported to new document controller, removed MessageQueue)<br /> * Version 0.3, 29.08.2007 (Anchor name is not set as the document's attribute)<br /> * Version 0.4, 02.03.2008 (The page is now applied the context and language)<br /> */ public function getPager($addStmtParams = []) { $pager = new Page(); // apply context and language (form configuration purposes!) $pager->setLanguage($this->language); $pager->setContext($this->context); // load the configured design $pager->loadDesign($this->pagerUiNamespace, $this->pagerUiTemplate); // add the necessary config params and pages $document = $pager->getRootDocument(); $document->setAttribute('Pages', $this->createPages4PagerDisplay($addStmtParams)); $document->setAttribute('PageUrlParameterName', $this->pageUrlParameterName); $document->setAttribute('CountUrlParameterName', $this->countUrlParameterName); $document->setAttribute('EntriesPerPage', $this->entriesPerPage); $document->setAttribute('DynamicPageSizeActivated', $this->isDynamicPageSizeActivated()); // add the anchor if desired if ($this->anchorName !== null) { $document->setAttribute('AnchorName', $this->anchorName); } return $pager->transform(); }