public function sitemap() { $this->base_url = 'http://' . $_SERVER['HTTP_HOST']; $section = new CmsSection(); $this->sections = $section->all(); $content = new CmsContent("published"); $this->pages = $content->all(); if ($this->use_format == "xml") { header("Content-type: application/xml"); $this->use_layout = false; } }
public function create() { $this->display_action_name = 'Create'; $model = $this->model; $this->model = new Campaign(); $this->model->ClientID = $this->cm_conf['campaign_monitor_ClientID']; Session::unset_var('user_errors'); //remove old errors; if ($this->model->is_posted()) { $this->model = $this->model->handle_post(); $errors = ""; if (count($this->model->errors)) { $errors .= "<br />" . implode("<br />", $this->model->errors); } if (strlen($errors) > 0) { $errors .= ":"; foreach ($this->model->errors as $k => $val) { $errors .= $val . "<br />"; } Session::add_message('There was an error creating you campaign.' . $errors); } else { Session::add_message('Your campaign has been created!'); $this->redirect_to('/admin/email'); } } $lists = $model->GetLists(); $this->mail_lists = array_merge(array('' => array('ListID' => '', 'Name' => 'None')), $lists->rowset); $segments = $model->GetSegments(); $this->segments = array_merge(array('' => array('ListID' => '', 'Name' => 'None')), $segments->rowset); $cont = new CmsContent("published"); $this->contents = $cont->all(); $this->form = $this->render_partial("form"); }