public function index() { $this->data = $this->load->language('module/cackle_comment'); $this->document->setTitle($this->language->get('heading_title')); $this->load->model('setting/setting'); if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) { $this->load->library('cackle/comment'); $cackle = new CackleComment($this->db, $this->request->post['cackle_comment_site_id'], $this->request->post['cackle_comment_account_api_key'], $this->request->post['cackle_comment_site_api_key']); $cackle->install(); $this->model_setting_setting->editSetting('cackle_comment', $this->request->post); $this->session->data['success'] = $this->language->get('text_success'); $this->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL')); } if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning']; } else { $this->data['error_warning'] = ''; } if (isset($this->error['error_site_id'])) { $this->data['error_site_id'] = $this->error['error_site_id']; } else { $this->data['error_site_id'] = ''; } if (isset($this->error['error_account_api_key'])) { $this->data['error_account_api_key'] = $this->error['error_account_api_key']; } else { $this->data['error_account_api_key'] = ''; } if (isset($this->error['error_site_api_key'])) { $this->data['error_site_api_key'] = $this->error['error_site_api_key']; } else { $this->data['error_site_api_key'] = ''; } if (isset($this->request->post['cackle_comment_site_id'])) { $this->data['cackle_comment_site_id'] = $this->request->post['cackle_comment_site_id']; } else { $this->data['cackle_comment_site_id'] = $this->config->get('cackle_comment_site_id'); } if (isset($this->request->post['cackle_comment_account_api_key'])) { $this->data['cackle_comment_account_api_key'] = $this->request->post['cackle_comment_account_api_key']; } else { $this->data['cackle_comment_account_api_key'] = $this->config->get('cackle_comment_account_api_key'); } if (isset($this->request->post['cackle_comment_site_api_key'])) { $this->data['cackle_comment_site_api_key'] = $this->request->post['cackle_comment_site_api_key']; } else { $this->data['cackle_comment_site_api_key'] = $this->config->get('cackle_comment_site_api_key'); } $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_module'), 'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: '); $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('module/cackle_comment', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: '); $this->data['action'] = $this->url->link('module/cackle_comment', 'token=' . $this->session->data['token'], 'SSL'); $this->data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'); $this->data['modules'] = array(); if (isset($this->request->post['cackle_comment_module'])) { $this->data['modules'] = $this->request->post['cackle_comment_module']; } elseif ($this->config->get('cackle_comment_module')) { $this->data['modules'] = $this->config->get('cackle_comment_module'); } $this->load->model('design/layout'); $this->data['layouts'] = $this->model_design_layout->getLayouts(); $this->template = 'module/cackle_comment.tpl'; $this->children = array('common/header', 'common/footer'); $this->response->setOutput($this->render()); }