69 global $menu_identifier;
72 global $css_cache_timestamp;
80 $bodyClass = $this->
page->getBodyClass();
82 $template = $this->
page->getTemplate();
92 if ($this->
page->php_code_file)
104 $versioningEnabled =
Settings::getValue(
"settings",
"enable_content_versioning") ?
"1" :
"0";
106 $this->
page->description .=
"<p id='inline_editing' class='inline_editor_toolbar'><a href='#' class='edit' onclick='new PageManager().editPage({$this->page->page_id}, $versioningEnabled); return false;'>Edit</a>{$versioningControls}</p>";
116 $qs = $_SERVER[
'QUERY_STRING'];
119 $qs = preg_replace(
"/identifier=[\\w_]+&*/",
"",
$qs);
120 $qs = preg_replace(
"/_style=\\w+&*/",
"",
$qs);
123 $printLink =
"{$this->page->identifier}".appendToQueryString(
$qs,
"_style=print");
125 $template = str_replace(
"{_{_[printIcon]_}_}",
126 "<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>",
131 $menuPositions = array();
133 preg_match_all(
"/\\{_\\{_\\[menu:(.*?)\\]_\\}_\\}/",
$template, $menuPositions, PREG_SET_ORDER);
135 $menus = indexedQuery(
Menu,
"WHERE site_id={$this->page->site_id}",
"identifier");
137 foreach($menuPositions as $position)
141 trace(
"Substituting Menu at Position {$position[0]} {$position[1]}", 3);
143 if (array_key_exists($position[1], $menus))
146 $menuBody =
$view->drawView();
149 $menuCSSClass = $menus[$position[1]]->container_css_class;;
150 $menuCSSClass = $menuCSSClass ?
" class='{$menuCSSClass}'" :
"";
151 $output .=
"<div id='$position[1]'{$menuCSSClass}>";
166 preg_match_all(
"/\\{_\\{_\\[position:(.*?)\\]_\\}_\\}/",
$template,
$positions, PREG_SET_ORDER);
174 trace(
"Substituting at Position {$position[0]} {$position[1]}", 3);
176 if (array_key_exists($position[1],
$modules))
178 $output .=
"<div id='$position[1]'>";
195 $inclusions = array();
196 preg_match_all(
"/\{include:(.*?\.inc)\}/",
$template, $inclusions, PREG_SET_ORDER);
198 foreach($inclusions as $inclusion)
216 preg_match_all(
"/\\{_\\{_\\[var:(.*?)\\]_\\}_\\}/",
$template, $vars, PREG_SET_ORDER);
218 foreach($vars as $var)
229 preg_match_all(
"/\\{_\\{_\\[get:(.*?)\\]_\\}_\\}/",
$template, $gets, PREG_SET_ORDER);
230 foreach($gets as $get)
245 if (
$config[
'prettyURLs'] ===
false)
247 $template = preg_replace(
"/(href|src|action)=(['\"])\\/?([\\w\\d_]+?)\\?/i",
"$1=$2/page.php?identifier=$3&",
$template);
248 $template = preg_replace(
"/(href|src|action)=(['\"])\\/?([\\w\\d_]+?)[\"']/i",
"$1=$2/page.php?identifier=$3$2",
$template);
249 $template = preg_replace(
"/go\\(([\"'])\\/?([\\w\\d_]+?)\\?/",
"go($1/page.php?identifier=$2&",
$template);
250 $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 getStyles()
Returns the HTML link tags for CSS files specified by the registered components in their manifest fil...
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 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.
PageView generates the page content, substituting page fields, menus and associated modules into an H...
$page
The Page object that we are viewing.
PageView($page, $template)
$template
The layout template used to render the page.
static getValue($component, $name)
Retrieve the value of the specified Setting.
static checkPermission($component, $name, $account=null)
Check whether a user has a specific permission.
static getSite()
Returns the Site object that describes the currently active site (i.e.
$method
Pull out a simple reference to the request method.