diff options
Diffstat (limited to 'public/catalog/controller/account/newsletter.php')
-rw-r--r-- | public/catalog/controller/account/newsletter.php | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/public/catalog/controller/account/newsletter.php b/public/catalog/controller/account/newsletter.php new file mode 100644 index 0000000..d19f3f8 --- /dev/null +++ b/public/catalog/controller/account/newsletter.php @@ -0,0 +1,56 @@ +<?php +class ControllerAccountNewsletter extends Controller { + public function index() { + if (!$this->customer->isLogged()) { + $this->session->data['redirect'] = $this->url->link('account/newsletter', '', true); + + $this->response->redirect($this->url->link('account/login', '', true)); + } + + $this->load->language('account/newsletter'); + + $this->document->setTitle($this->language->get('heading_title')); + + if ($this->request->server['REQUEST_METHOD'] == 'POST') { + $this->load->model('account/customer'); + + $this->model_account_customer->editNewsletter($this->request->post['newsletter']); + + $this->session->data['success'] = $this->language->get('text_success'); + + $this->response->redirect($this->url->link('account/account', '', true)); + } + + $data['breadcrumbs'] = array(); + + $data['breadcrumbs'][] = array( + 'text' => $this->language->get('text_home'), + 'href' => $this->url->link('common/home') + ); + + $data['breadcrumbs'][] = array( + 'text' => $this->language->get('text_account'), + 'href' => $this->url->link('account/account', '', true) + ); + + $data['breadcrumbs'][] = array( + 'text' => $this->language->get('text_newsletter'), + 'href' => $this->url->link('account/newsletter', '', true) + ); + + $data['action'] = $this->url->link('account/newsletter', '', true); + + $data['newsletter'] = $this->customer->getNewsletter(); + + $data['back'] = $this->url->link('account/account', '', true); + + $data['column_left'] = $this->load->controller('common/column_left'); + $data['column_right'] = $this->load->controller('common/column_right'); + $data['content_top'] = $this->load->controller('common/content_top'); + $data['content_bottom'] = $this->load->controller('common/content_bottom'); + $data['footer'] = $this->load->controller('common/footer'); + $data['header'] = $this->load->controller('common/header'); + + $this->response->setOutput($this->load->view('account/newsletter', $data)); + } +}
\ No newline at end of file |