Definition at line 42 of file page.inc.
◆ findByIdentifier()
static Page::findByIdentifier |
( |
|
$identifier | ) |
|
|
static |
Definition at line 85 of file page.inc.
87 $match = Query::create(
Page,
"WHERE identifier=:id")
◆ getBodyClass()
Definition at line 204 of file page.inc.
static $bodyClass
Override for the body class of the page currently being served.
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content
◆ getModulesByPosition()
Page::getModulesByPosition |
( |
|
$constraint = "ORDER BY position, sort_order" | ) |
|
Definition at line 94 of file page.inc.
99 $join =
new InnerJoin();
103 $result = $join->groupedQuery(
"WHERE page_id={$this->page_id} $constraint",
"PageModuleXref.position");
119 $globals = groupedQuery(
Module,
"WHERE global=1",
"global_position");
120 foreach($globals as $position => $modulesAtPosition)
122 if (array_key_exists($position,
$modules))
124 $modules[$position] = removeDuplicates(array_merge($modulesAtPosition,
$modules[$position]));
128 $modules[$position] = $modulesAtPosition;
Defines the Module class.
◆ getPositions()
Retrieves an array of the position names defined in the template for this page.
- Returns
- array the positions defined in the template (sorted alphabetically)
Definition at line 191 of file page.inc.
195 $positionMatches = array();
197 preg_match_all(
"/\{position:(.*?)\}/", $template, $positionMatches, PREG_PATTERN_ORDER);
getTemplate()
Loads the template associated with this page.
◆ getTemplate()
Loads the template associated with this page.
- Returns
- string the contents of the template for this page.
Definition at line 140 of file page.inc.
145 $style = $_REQUEST[
"_style"];
157 $templateFile =
$site->print_template;
161 $templateFile =
$site->popup_template;
165 $templateFile =
$site->mobile_template;
168 return "<h2>{page_title}</h2>{description}";
173 if (!$templateFile) $templateFile =
$section->getTemplateFile($this->identifier);
176 if (!$templateFile) $templateFile = $this->template;
177 if (!$templateFile) $templateFile =
$site->default_template;
182 $template = file_get_contents(
"{$base}/{$templateFile}");
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
static getSite()
Returns the Site object that describes the currently active site (i.e.
◆ Modules()
Page::Modules |
( |
|
$constraint = "ORDER BY position, sort_order" | ) |
|
◆ Page()
Definition at line 232 of file page.inc.
234 $this->primary_key =
"page_id";
235 $this->table =
"page";
237 $this->default_format =
"{page_title}";
239 $this->DataItem(func_get_args());
◆ PageModuleXrefs()
Page::PageModuleXrefs |
( |
|
$constraint = "ORDER BY position, sort_order" | ) |
|
◆ search()
Page::search |
( |
|
$params, |
|
|
|
$range = null |
|
) |
| |
DataItems must implement this method to provide search functionality.
- Parameters
-
mixed | $params | either search text or a SearchParameters object |
array | $range | an array of primary key IDs to which the search must be constrained |
Implements Searchable.
Definition at line 242 of file page.inc.
244 trace(
"Searching Pages", 3);
248 $range =
" AND {$this->primary_key} IN (".implode(
$range,
", ").
")";
251 if (is_object($params))
255 $search->remapField(
"title",
"page_title");
256 $search->remapField(
"keywords",
"meta_tag_keyword");
257 $search->remapField(
"publication_date",
"created_date");
259 if (!
$search->get(
"text",
"like"))
261 $search->secondaryFields(
"meta_tag_keyword",
"description");
266 $constraint .=
$constraint ?
" AND published=1 AND exclude_from_search=0" :
" WHERE published=1 AND exclude_from_search=0";
274 $params =
"%$params%";
275 $pages = Query::create(
Page,
"WHERE (page_title like :a OR description LIKE :b) AND published=1 AND exclude_from_search=0 $range")
276 ->bind(
":a", $params,
":b", $params)
static wrap($items, $resultClass)
◆ Site()
Definition at line 80 of file page.inc.
82 return $this->getRelated(
Site);
◆ $fields
Initial value:= array("page_id" => Number,
"identifier" => String,
"page_title" => String,
"description" => HTML,
"site_id" => Number,
"template" => String,
"meta_tag_description" => Text,
"meta_tag_keyword" => String,
"php_code_file" => String,
"role" => String,
"published" => Boolean,
"exclude_from_search" => Boolean,
"created_date" => Date,
"edited_date" => Timestamp,
"author" => String
)
Definition at line 45 of file page.inc.
◆ $relations
Initial value:
Definition at line 64 of file page.inc.
◆ $versioned_fields
Page::$versioned_fields = array("page_title", "description", "meta_tag_description", "meta_tag_keyword", "author") |
The documentation for this class was generated from the following file:
- C:/code/cms.sonjara.com/cms/components/page/datamodel/page.inc