information.php (2605B)
1 <?php 2 class ControllerExtensionModuleInformation extends Controller { 3 private $error = array(); 4 5 public function index() { 6 $this->load->language('extension/module/information'); 7 8 $this->document->setTitle($this->language->get('heading_title')); 9 10 $this->load->model('setting/setting'); 11 12 if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { 13 $this->model_setting_setting->editSetting('module_information', $this->request->post); 14 15 $this->session->data['success'] = $this->language->get('text_success'); 16 17 $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module', true)); 18 } 19 20 if (isset($this->error['warning'])) { 21 $data['error_warning'] = $this->error['warning']; 22 } else { 23 $data['error_warning'] = ''; 24 } 25 26 $data['breadcrumbs'] = array(); 27 28 $data['breadcrumbs'][] = array( 29 'text' => $this->language->get('text_home'), 30 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true) 31 ); 32 33 $data['breadcrumbs'][] = array( 34 'text' => $this->language->get('text_extension'), 35 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module', true) 36 ); 37 38 $data['breadcrumbs'][] = array( 39 'text' => $this->language->get('heading_title'), 40 'href' => $this->url->link('extension/module/information', 'user_token=' . $this->session->data['user_token'], true) 41 ); 42 43 $data['action'] = $this->url->link('extension/module/information', 'user_token=' . $this->session->data['user_token'], true); 44 45 $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module', true); 46 47 if (isset($this->request->post['module_information_status'])) { 48 $data['module_information_status'] = $this->request->post['module_information_status']; 49 } else { 50 $data['module_information_status'] = $this->config->get('module_information_status'); 51 } 52 53 $data['header'] = $this->load->controller('common/header'); 54 $data['column_left'] = $this->load->controller('common/column_left'); 55 $data['footer'] = $this->load->controller('common/footer'); 56 57 $this->response->setOutput($this->load->view('extension/module/information', $data)); 58 } 59 60 protected function validate() { 61 if (!$this->user->hasPermission('modify', 'extension/module/information')) { 62 $this->error['warning'] = $this->language->get('error_permission'); 63 } 64 65 return !$this->error; 66 } 67 }