1<?php
2	class banshee_page_controller extends controller {
3		public function execute() {
4			if (($page = $this->model->get_page($this->page->url)) == false) {
5				$this->output->add_tag("website_error", 500);
6				return;
7			}
8
9			/* Page header
10			 */
11			if (trim($page["description"]) != "") {
12				$this->output->description = $page["description"];
13			}
14			if (trim($page["keywords"]) != "") {
15				$this->output->keywords = $page["keywords"];
16			}
17			$this->output->title = $page["title"];
18			if ($page["style"] != null) {
19				$this->output->inline_css = $page["style"];
20			}
21			$this->output->language = $page["language"];
22
23			$this->output->set_layout($page["layout"]);
24
25			$this->output->allow_hiawatha_cache();
26
27			/* Page content
28			 */
29			$this->output->open_tag("page");
30
31			$this->output->add_tag("title", $page["title"]);
32			$page["content"] = $this->output->secure_string($page["content"]);
33			$this->output->add_tag("content", $page["content"]);
34
35			if (is_true($page["back"])) {
36				$parts = explode("/", $this->page->page);
37				array_pop($parts);
38				$this->output->add_tag("back", implode("/", $parts));
39			}
40
41			$this->output->close_tag();
42		}
43	}
44?>
45