46 "identifier" => String,
47 "page_title" => String,
48 "description" => HTML,
51 "meta_tag_description" => Text,
52 "meta_tag_keyword" => String,
53 "php_code_file" => String,
55 "published" => Boolean,
56 "exclude_from_search" => Boolean,
57 "created_date" => Date,
58 "edited_date" => Timestamp,
68 var
$versioned_fields = array(
"page_title",
"description",
"meta_tag_description",
"meta_tag_keyword",
"author");
82 return $this->getRelated(
Site);
87 $match = Query::create(
Page,
"WHERE identifier=:id")
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;
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}");
195 $positionMatches = array();
197 preg_match_all(
"/\{position:(.*?)\}/", $template, $positionMatches, PREG_PATTERN_ORDER);
234 $this->primary_key =
"page_id";
235 $this->table =
"page";
237 $this->default_format =
"{page_title}";
239 $this->DataItem(func_get_args());
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)
295 function prettifyClassName($plural =
false) {
return $this->item->prettifyClassName($plural =
false); }
305 return $this->item->page_title;
310 return $this->item->created_date;
315 $img = $this->
formatIcon(
'/fakoli/richtext/images/hyperlink.gif',
'cms_page');
319 return $this->item->format(
"{$img}<h4>{page_title}</h4><p>{description:300}</p><a href='{identifier}'>Read More</a>");
324 return $this->item->format(
"{$img}<h4><a href='{identifier}'>{page_title}</a></h4>");
334 "module_id" => Number,
335 "position" => String,
336 "sort_order" => Number);
345 return $this->getRelated(
Page);
350 return $this->getRelated(
Module);
355 $this->table =
"page_module_xref";
356 $this->primary_key =
"join_id";
358 $this->DataItem(func_get_args());
372 return "WHERE published=1 AND exclude_from_search=0";
377 return "{page_title:xml}";
382 return "{description:xml}";
387 return "{author:xml}";
392 return "{meta_tag_keyword:xml}";
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
static $bodyClass
Override for the body class of the page currently being served.
static using()
Import the datamodels, views and manifest for the specified component(s).
static usingFile()
Uses the specified framework file(s) from the framework directory.
Defines the Module class.
getPositions()
Retrieves an array of the position names defined in the template for this page.
search($params, $range=null)
DataItems must implement this method to provide search functionality.
PageModuleXrefs($constraint="ORDER BY position, sort_order")
getTemplate()
Loads the template associated with this page.
static findByIdentifier($identifier)
Modules($constraint="ORDER BY position, sort_order")
getModulesByPosition($constraint="ORDER BY position, sort_order")
prettifyClassName($plural=false)
summary()
Display the item title and any other essential details for the item such as author and a create date.
static wrap($items, $resultClass)
static getValue($component, $name)
Retrieve the value of the specified Setting.
static getSite()
Returns the Site object that describes the currently active site (i.e.
The Searchable interface must be implemented by any DataItem classes that want to be searchable via t...
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content