64 if (!checkRole(
$page->role))
70 echo $pageView->drawView();
103 global $menu_identifier;
106 global $css_cache_timestamp;
134 include
$page->server_path;
140 catch (DataNotFoundException $e)
152 $this->
page->page_title = $this->
page->getTitle();
154 $bodyClass = $this->
page->getBodyClass();
168 $qs = $_SERVER[
'QUERY_STRING'];
171 $qs = preg_replace(
"/identifier=[\\w_]+&*/",
"",
$qs);
172 $qs = preg_replace(
"/_style=\\w+&*/",
"",
$qs);
175 $printLink =
"{$this->page->identifier}".appendToQueryString(
$qs,
"_style=print");
178 "<a href='$printLink' target='_blank'><img src='/fakoli/images/print.gif' style='display: inline-block; vertical-align: middle;border: none'></a> <a href='$printLink' target='_blank'>Print this Page</a>",
183 $menuPositions = array();
185 preg_match_all(
"/\{menu:(.*?)\}/",
$template, $menuPositions, PREG_SET_ORDER);
187 $menus = indexedQuery(
Menu,
"WHERE site_id={$site->site_id}",
"identifier");
189 foreach($menuPositions as $position)
193 trace(
"Substituting Menu at Position {$position[0]} {$position[1]}", 3);
195 if (array_key_exists($position[1], $menus))
198 $menuBody =
$view->drawView();
201 $menuCSSClass = $menus[$position[1]]->container_css_class;;
202 $menuCSSClass = $menuCSSClass ?
" class='{$menuCSSClass}'" :
"";
203 $output .=
"<div id='$position[1]'{$menuCSSClass}>";
226 trace(
"Substituting at Position {$position[0]} {$position[1]}", 3);
228 if (array_key_exists($position[1],
$modules))
230 $output .=
"<div id='$position[1]'>";
247 $inclusions = array();
248 preg_match_all(
"/\{include:(.*?\.inc)\}/",
$template, $inclusions, PREG_SET_ORDER);
250 foreach($inclusions as $inclusion)
252 trace(
"Substituting include $inclusion[1]",1);
259 if ($_REQUEST[
"_style"] !=
"nude")
272 preg_match_all(
"/\{var:(.*?)\}/",
$template, $vars, PREG_SET_ORDER);
274 foreach($vars as $var)
287 preg_match_all(
"/\{get:(.*?)\}/",
$template, $gets, PREG_SET_ORDER);
288 foreach($gets as $get)
297 if (
$config[
'prettyURLs'] ===
false)
299 $template = preg_replace(
"/(href|src|action)=(['\"])\\/?([\\w\\d_]+?)\\?/i",
"$1=$2/page.php?identifier=$3&",
$template);
300 $template = preg_replace(
"/(href|src|action)=(['\"])\\/?([\\w\\d_]+?)[\"']/i",
"$1=$2/page.php?identifier=$3$2",
$template);
301 $template = preg_replace(
"/go\\(([\"'])\\/?([\\w\\d_]+?)\\?/",
"go($1/page.php?identifier=$2&",
$template);
302 $template = preg_replace(
"/go\\(([\"'])\\/?([\\w\\d_]+?)[\"']/",
"go($1/page.php?identifier=$2$1",
$template);
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
static findByIdentifier($identifier, $constraint="")
ComponentPageView generates the page content for a component page, substituting page fields,...
$template
The layout template used to render the page.
__construct($page, $template="")
Creates a new ComponentPageView object.
drawView()
Renders the page.
static renderPage($identifier)
Renders the component page that matches the specified identifier.
$page
The ComponentPage object that we are viewing.
FakoliException is the base exception class for all Fakoli errors.
static getStyles()
Returns the HTML link tags for CSS files specified by the registered components in their manifest fil...
static coreTraceLevel()
Change to the configured trace level for Fakoli core code.
static get($key)
Retrieves the value or object at the given key.
static getScripts()
Returns the HTML scripts tags for Javascript files specified by the registered components in their ma...
static applicationTraceLevel()
Change to the configured trace level for application code.
static using()
Import the datamodels, views and manifest for the specified component(s).
static evaluateFile($filePath)
Evaluates a PHP include file and returns the generated content.
static storeRedirectPage()
Store the page from which a user has been redirected when prompted to login or create an account.
static getSite()
Returns the Site object that describes the currently active site (i.e.
$method
Pull out a simple reference to the request method.