-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a806fda
commit 7daf262
Showing
8 changed files
with
572 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
class ControllerExtensionModuleGDPR extends Controller { | ||
private $error = array(); | ||
|
||
public function index() { | ||
$this->load->language('extension/module/gdpr'); | ||
|
||
$this->document->setTitle($this->language->get('heading_title')); | ||
|
||
$this->load->model('setting/setting'); | ||
|
||
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { | ||
$this->model_setting_setting->editSetting('module_gdpr', $_POST); | ||
|
||
$this->session->data['success'] = $this->language->get('text_success'); | ||
|
||
$this->response->redirect($this->url->link('extension/module/gdpr', 'user_token=' . $this->session->data['user_token'])); | ||
} | ||
|
||
if (isset($this->error['warning'])) { | ||
$data['error_warning'] = $this->error['warning']; | ||
} else { | ||
$data['error_warning'] = ''; | ||
} | ||
|
||
if (isset($this->error['code'])) { | ||
$data['error_code'] = $this->error['code']; | ||
} else { | ||
$data['error_code'] = ''; | ||
} | ||
|
||
$data['breadcrumbs'] = array(); | ||
|
||
$data['breadcrumbs'][] = array( | ||
'text' => $this->language->get('text_home'), | ||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token']) | ||
); | ||
|
||
$data['breadcrumbs'][] = array( | ||
'text' => $this->language->get('text_extension'), | ||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module') | ||
); | ||
|
||
$data['breadcrumbs'][] = array( | ||
'text' => $this->language->get('heading_title'), | ||
'href' => $this->url->link('extension/module/gdpr', 'user_token=' . $this->session->data['user_token']) | ||
); | ||
|
||
$data['action'] = $this->url->link('extension/module/gdpr', 'user_token=' . $this->session->data['user_token']); | ||
|
||
$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module'); | ||
|
||
if (isset($this->request->post['module_gdpr_status'])) { | ||
$data['module_gdpr_policy_url'] = $this->request->post['module_gdpr_policy_url']; | ||
$data['module_gdpr_status'] = $this->request->post['module_gdpr_status']; | ||
} else { | ||
$data['module_gdpr_policy_url'] = $this->config->get('module_gdpr_policy_url'); | ||
$data['module_gdpr_status'] = $this->config->get('module_gdpr_status'); | ||
} | ||
|
||
$data['header'] = $this->load->controller('common/header'); | ||
$data['column_left'] = $this->load->controller('common/column_left'); | ||
$data['footer'] = $this->load->controller('common/footer'); | ||
|
||
$this->response->setOutput($this->load->view('extension/module/gdpr', $data)); | ||
} | ||
|
||
protected function validate() { | ||
if (!$this->user->hasPermission('modify', 'extension/module/gdpr')) { | ||
$this->error['warning'] = $this->language->get('error_permission'); | ||
} | ||
|
||
return !$this->error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
// Heading | ||
$_['heading_title'] = 'GDPR'; | ||
|
||
// Text | ||
$_['text_extension'] = 'Extensions'; | ||
$_['text_success'] = 'Success: You have modified GDPR module!'; | ||
$_['text_edit'] = 'Edit GDPR Module'; | ||
|
||
// Entry | ||
$_['entry_policy_url'] = 'Cookie Policy URL'; | ||
$_['entry_status'] = 'Status'; | ||
|
||
|
||
// Error | ||
$_['error_permission'] = 'Warning: You do not have permission to modify GDPR module!'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{{ header }}{{ column_left }} | ||
<div id="content"> | ||
<div class="page-header"> | ||
<div class="container-fluid"> | ||
<div class="float-right"> | ||
<button type="submit" form="form-module" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fas fa-save"></i></button> | ||
<a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-light"><i class="fas fa-reply"></i></a></div> | ||
<h1>{{ heading_title }}</h1> | ||
<ol class="breadcrumb"> | ||
{% for breadcrumb in breadcrumbs %} | ||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li> | ||
{% endfor %} | ||
</ol> | ||
</div> | ||
</div> | ||
<div class="container-fluid"> | ||
{% if error_warning %} | ||
<div class="alert alert-danger alert-dismissible"><i class="fas fa-exclamation-circle"></i> {{ error_warning }} | ||
<button type="button" class="close" data-dismiss="alert">×</button> | ||
</div> | ||
{% endif %} | ||
<div class="card"> | ||
<div class="card-header"><i class="fas fa-pencil-alt"></i> {{ text_edit }}</div> | ||
<div class="card-body"> | ||
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-module"> | ||
<div class="form-group row"> | ||
<label class="col-sm-2 col-form-label" for="input-status">{{ entry_policy_url }}</label> | ||
<div class="col-sm-10"> | ||
<input name="module_gdpr_policy_url" id="input-policy-url" class="form-control" value="{{ module_gdpr_policy_url }}"/> | ||
</div> | ||
</div> | ||
<div class="form-group row"> | ||
<label class="col-sm-2 col-form-label" for="input-status">{{ entry_status }}</label> | ||
<div class="col-sm-10"> | ||
<select name="module_gdpr_status" id="input-status" class="form-control"> | ||
{% if module_gdpr_status %} | ||
<option value="1" selected="selected">{{ text_enabled }}</option> | ||
<option value="0">{{ text_disabled }}</option> | ||
{% else %} | ||
<option value="1">{{ text_enabled }}</option> | ||
<option value="0" selected="selected">{{ text_disabled }}</option> | ||
{% endif %} | ||
</select> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{{ footer }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.