Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions upload/admin/controller/marketplace/modification.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ public function add() {

public function restore() {
$this->load->language('marketplace/extension');
$this->load->language('marketplace/modification');

$this->load->model('setting/modification');
$this->load->model('setting/modification');

$this->document->setTitle($this->language->get('heading_title'));

Expand Down Expand Up @@ -148,6 +149,8 @@ public function restore() {
$this->model_setting_modification->editModification($modification_id, $data);
}

$this->session->data['success'] = $this->language->get('text_success');

$this->response->redirect($this->url->link('marketplace/modification/edit', 'user_token=' . $this->session->data['user_token'] . '&modification_id=' . $this->request->get['modification_id'], true));
}

Expand Down Expand Up @@ -196,7 +199,7 @@ public function upload() {
$json['error'] = $this->language->get('error_permission');
}

if($modification) {
if ($modification) {
if (!$json) {
if (!empty($this->request->files['file']['name'])) {
if ($this->request->files['file']['name'] != $modification['code'].".ocmod.xml") {
Expand Down Expand Up @@ -449,7 +452,6 @@ public function remove($path = '') {
$this->response->setOutput(json_encode($json));
}


public function delete() {
$this->load->language('marketplace/modification');

Expand Down Expand Up @@ -1147,10 +1149,10 @@ protected function getList() {
'status' => $result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled'),
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'link' => $result['link'],
'edit' => $this->url->link('marketplace/modification/edit', 'user_token=' . $this->session->data['user_token'] . '&modification_id=' . $result['modification_id'], true),
'edit' => $this->url->link('marketplace/modification/edit', 'user_token=' . $this->session->data['user_token'] . '&modification_id=' . $result['modification_id'] . $url, true),
'download' => $this->url->link('marketplace/modification/download', 'user_token=' . $this->session->data['user_token'] . '&modification_id=' . $result['modification_id'], true),
'enable' => $this->url->link('marketplace/modification/enable', 'user_token=' . $this->session->data['user_token'] . '&modification_id=' . $result['modification_id'], true),
'disable' => $this->url->link('marketplace/modification/disable', 'user_token=' . $this->session->data['user_token'] . '&modification_id=' . $result['modification_id'], true),
'enable' => $this->url->link('marketplace/modification/enable', 'user_token=' . $this->session->data['user_token'] . '&modification_id=' . $result['modification_id'] . $url, true),
'disable' => $this->url->link('marketplace/modification/disable', 'user_token=' . $this->session->data['user_token'] . '&modification_id=' . $result['modification_id'] . $url, true),
'enabled' => $result['status']
);
}
Expand Down Expand Up @@ -1269,6 +1271,20 @@ protected function getForm() {
$this->document->addScript('view/javascript/codemirror/lib/xml.js');
$this->document->addScript('view/javascript/codemirror/lib/formatting.js');

$url = '';

if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}

if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}

if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}

$data['breadcrumbs'] = [];

$data['breadcrumbs'][] = [
Expand All @@ -1278,7 +1294,7 @@ protected function getForm() {

$data['breadcrumbs'][] = [
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('marketplace/modification', 'user_token=' . $this->session->data['user_token'], true)
'href' => $this->url->link('marketplace/modification', 'user_token=' . $this->session->data['user_token'] . $url, true)
];

$data['user_token'] = $this->session->data['user_token'];
Expand All @@ -1295,8 +1311,6 @@ protected function getForm() {
$is_create = empty($this->request->get['modification_id']);
$modification_id = $is_create ? 0 : (int)$this->request->get['modification_id'];

$url = '';

if ($is_create) {
$data['action'] = $this->url->link('marketplace/modification/add', 'user_token=' . $this->session->data['user_token'] . $url, true);
} else {
Expand Down
9 changes: 7 additions & 2 deletions upload/admin/view/template/marketplace/modification_form.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
<button type="button" class="close" data-dismiss="alert">&times;</button>
</div>
{% endif %}
{% if success %}
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
<button type="button" class="close" data-dismiss="alert">&times;</button>
</div>
{% endif %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
Expand Down Expand Up @@ -52,7 +57,7 @@
<td class="text-left">{{ column_id }}</td>
<td class="text-left">{{ column_code }}</td>
<td class="text-left">{{ column_date_added }}</td>
<td class="text-right">{{ column_restore }} <a type="button" href="{{ history }}" data-toggle="tooltip" title="{{ button_history }}" class="btn btn-default"><i class="fa fa-trash"></i></a></td>
<td class="text-right">{{ column_restore }} {% if backups %}<a type="button" href="{{ history }}" onclick="return confirm('{{ text_confirm }}');" data-toggle="tooltip" title="{{ button_history }}" class="btn btn-default"><i class="fa fa-trash"></i></a>{% endif %}</td>
</tr>
</thead>
<tbody>
Expand All @@ -62,7 +67,7 @@
<td class="text-left">{{ backup['backup_id'] }}</td>
<td class="text-left">{{ backup['code'] }}</td>
<td class="text-left">{{ backup['date_added'] }}</td>
<td class="text-right"><a href="{{ backup['restore'] }}" data-toggle="tooltip" title="{{ button_restore }}" class="btn btn-primary"><i class="fa fa-share-square"></i></a></td>
<td class="text-right"><a href="{{ backup['restore'] }}" onclick="return confirm('{{ text_confirm }}');" data-toggle="tooltip" title="{{ button_restore }}" class="btn btn-primary"><i class="fa fa-share-square"></i></a></td>
</tr>
{% endfor %}
{% else %}
Expand Down