39 require_once realpath(dirname(__FILE__).
"/../../../../framework/data_item.inc");
49 var
$fields = array(
"component_page_id" => Number,
50 "identifier" => String,
51 "server_path" => String,
52 "component" => String,
53 "page_title" => String,
74 return $this->getRelated(
Site);
93 $join =
new InnerJoin();
97 $result = $join->groupedQuery(
"WHERE component_page_id={$this->component_page_id} $constraint",
"ComponentPageModuleXref.position");
113 $globals = groupedQuery(
Module,
"WHERE global=1",
"global_position");
114 foreach($globals as $position => $modulesAtPosition)
116 if (array_key_exists($position,
$modules))
118 $modules[$position] = removeDuplicates(array_merge($modulesAtPosition,
$modules[$position]));
122 $modules[$position] = $modulesAtPosition;
131 trace(
"TITLE: $this->page_title", 3);
144 trace(
"TITLE: $title", 3);
171 $style = $_REQUEST[
"_style"];
183 $templateFile =
$site->print_template;
187 $templateFile =
$site->popup_template;
191 $templateFile =
$site->mobile_template;
194 return "{var:script}\n{description}";
199 if (!$templateFile) $templateFile =
$section->getTemplateFile($this->identifier);
202 if (!$templateFile) $templateFile = $this->template;
203 if (!$templateFile) $templateFile =
$site->default_template;
208 trace(
"{$base}/{$templateFile}", 3);
209 $template = file_get_contents(
"{$base}/{$templateFile}");
223 $positionMatches = array();
225 preg_match_all(
"/\{position:(.*?)\}/", $template, $positionMatches, PREG_PATTERN_ORDER);
236 $match = Query::create(
ComponentPage,
"WHERE identifier=:id $constraint")
248 var
$table =
"component_page_module_xref";
253 "component_page_id" => Number,
254 "module_id" => Number,
255 "position" => String,
256 "sort_order" => Number);
265 return $this->getRelated(
Page);
270 return $this->getRelated(
Module);
static getComponent($name)
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
ComponentPageModuleXrefs($constraint="ORDER BY position, sort_order")
getModulesByPosition($constraint="ORDER BY position, sort_order")
Modules($constraint="ORDER BY position, sort_order")
getTemplate()
Loads the template associated with this page.
getPositions()
Retrieves an array of the position names defined in the template for this page.
static findByIdentifier($identifier, $constraint="")
static $bodyClass
Override for the body class of the page currently being served.
Defines the Module class.
static getSite()
Returns the Site object that describes the currently active site (i.e.
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content