config = new Config(); $this->url = new URL(); $this->format = new Format(); $this->template = new Template($this->getDirTmpl()); $this->message = new Message(); $this->setMessage(); $this->date = $this->format->xss($_REQUEST); $this->template->set("action", $this->url->action()); $this->template->set("content", $this->getContent()); $this->template->set("title", $this->title); $this->template->set("meta_desc", $this->meta_desc); $this->template->set("meta_key", $this->meta_key); $this->template->set("index", $this->url->index()); $this->template->set("link_delivery", $this->url->delivery()); $this->template->set("link_contacts", $this->url->contacts()); $this->template->set("link_search", $this->url->search()); } protected function getSortLink(){ $this->template->set("link_sort_price_down", $this->url->sort_price_down()); $this->template->set("link_sort_price_up", $this->url->link_sort_price_up()); $this->template->set("link_sort_title_down", $this->url->link_sort_title_down()); $this->template->set("link_sort_title_up", $this->url->link_sort_title_up()); } protected function notFound(){ $this->redirect($this->url->notFound()); } protected function redirect($link){ header("Location: $link"); exit(); } protected function setMessage(){ if($_SESSION["message"]){ $text = $this->message->get($_SESSION["message"]); $_SESSION["a"] = $text; $this->template->set("message", $text); unset($_SESSION["message"]); } } abstract protected function getDirTmpl(); } ?>