first commit
This commit is contained in:
78
admininistrator/view/template/common/authorize.twig
Normal file
78
admininistrator/view/template/common/authorize.twig
Normal file
@ -0,0 +1,78 @@
|
||||
{{ header }}
|
||||
<div id="content">
|
||||
<div class="container-fluid">
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="row justify-content-sm-center">
|
||||
<div class="col-sm-10 col-md-8 col-lg-5">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-lock"></i> {{ heading_title }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-authorize" action="{{ action }}" method="post" data-oc-toggle="ajax">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> {{ error_warning }} <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> {{ success }} <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>
|
||||
{% endif %}
|
||||
<p>{{ text_security }}</p>
|
||||
<p>{{ text_code }}</p>
|
||||
<div class="mb-3">
|
||||
<label for="input-code" class="form-label">{{ entry_code }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="code" value="" placeholder="{{ entry_code }}" id="input-code" class="form-control"/>
|
||||
<button type="button" id="button-send" class="btn btn-danger"><i class="fa-solid fa-mail-bulk"></i> {{ button_resend }}</button>
|
||||
</div>
|
||||
<div id="error-code" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="submit" class="btn btn-primary"><i class="fa-solid fa-key"></i> {{ button_submit }}</button>
|
||||
</div>
|
||||
{% if redirect %}
|
||||
<input type="hidden" name="redirect" value="{{ redirect }}"/>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-send').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=common/authorize.send&user_token={{ user_token }}',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$('#button-send').button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$('#button-send').button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
console.log(json);
|
||||
|
||||
if (json['redirect']) {
|
||||
location = json['redirect'];
|
||||
}
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#button-send').trigger('click');
|
||||
//--></script>
|
||||
{{ footer }}
|
||||
|
56
admininistrator/view/template/common/authorize_unlock.twig
Normal file
56
admininistrator/view/template/common/authorize_unlock.twig
Normal file
@ -0,0 +1,56 @@
|
||||
{{ header }}
|
||||
<div id="content">
|
||||
<div class="container-fluid">
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="row justify-content-sm-center">
|
||||
<div class="col-sm-10 col-md-8 col-lg-5">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-lock"></i> {{ text_locked }}</div>
|
||||
<div class="card-body">
|
||||
<p>{{ text_unlock }}</p>
|
||||
<div class="d-grid">
|
||||
<button type="button" id="button-reset" class="btn btn-danger btn-lg"><i class="fa-solid fa-unlock"></i> {{ button_reset }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-reset').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=common/authorize.confirm&user_token={{ user_token }}',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$('#button-reset').button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$('#button-reset').button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
console.log(json);
|
||||
|
||||
if (json['redirect']) {
|
||||
location = json['redirect'];
|
||||
}
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
||||
|
74
admininistrator/view/template/common/column_left.twig
Normal file
74
admininistrator/view/template/common/column_left.twig
Normal file
@ -0,0 +1,74 @@
|
||||
<nav id="column-left">
|
||||
<div id="navigation"><span class="fa-solid fa-bars"></span> {{ text_navigation }}</div>
|
||||
<ul id="menu">
|
||||
{% set i = 0 %}
|
||||
{% for menu in menus %}
|
||||
<li id="{{ menu.id }}">
|
||||
{% if menu.href %}
|
||||
<a href="{{ menu.href }}"><i class="{{ menu.icon }}"></i> {{ menu.name }}</a>
|
||||
{% else %}
|
||||
<a href="#collapse-{{ i }}" data-bs-toggle="collapse" class="parent collapsed"><i class="{{ menu.icon }}"></i> {{ menu.name }}</a>
|
||||
{% endif %}
|
||||
{% if menu.children %}
|
||||
<ul id="collapse-{{ i }}" class="collapse">
|
||||
{% set j = 0 %}
|
||||
{% for children_1 in menu.children %}
|
||||
<li>{% if children_1.href %}
|
||||
<a href="{{ children_1.href }}">{{ children_1.name }}</a>
|
||||
{% else %}
|
||||
<a href="#collapse-{{ i }}-{{ j }}" data-bs-toggle="collapse" class="parent collapsed">{{ children_1.name }}</a>
|
||||
{% endif %}
|
||||
{% if children_1.children %}
|
||||
<ul id="collapse-{{ i }}-{{ j }}" class="collapse">
|
||||
{% set k = 0 %}
|
||||
{% for children_2 in children_1.children %}
|
||||
<li>{% if children_2.href %}
|
||||
<a href="{{ children_2.href }}">{{ children_2.name }}</a>
|
||||
{% else %}
|
||||
<a href="#collapse-{{ i }}-{{ j }}-{{ k }}" data-bs-toggle="collapse" class="parent collapsed">{{ children_2.name }}</a>
|
||||
{% endif %}
|
||||
{% if children_2.children %}
|
||||
<ul id="collapse-{{ i }}-{{ j }}-{{ k }}" class="collapse">
|
||||
{% for children_3 in children_2.children %}
|
||||
<li><a href="{{ children_3.href }}">{{ children_3.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}</li>
|
||||
{% set k = k + 1 %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% set j = j + 1 %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% set i = i + 1 %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if statistics_status %}
|
||||
<div id="stats">
|
||||
<ul>
|
||||
<li>
|
||||
<div>{{ text_complete_status }} <span class="float-end">{{ complete_status }}%</span></div>
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="{{ complete_status }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ complete_status }}%"><span class="sr-only">{{ complete_status }}%</span></div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>{{ text_processing_status }} <span class="float-end">{{ processing_status }}%</span></div>
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-warning" role="progressbar" aria-valuenow="{{ processing_status }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ processing_status }}%"><span class="sr-only">{{ processing_status }}%</span></div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>{{ text_other_status }} <span class="float-end">{{ other_status }}%</span></div>
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="{{ other_status }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ other_status }}%"><span class="sr-only">{{ other_status }}%</span></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</nav>
|
116
admininistrator/view/template/common/dashboard.twig
Normal file
116
admininistrator/view/template/common/dashboard.twig
Normal file
@ -0,0 +1,116 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
{% if developer_status %}
|
||||
<div class="float-end">
|
||||
<button type="button" id="button-setting" data-bs-toggle="tooltip" title="{{ button_developer }}" class="btn btn-info"><i class="fa-solid fa-cog"></i></button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<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">
|
||||
{% for row in rows %}
|
||||
<div class="row">
|
||||
{% for dashboard_1 in row %}
|
||||
{% set class = 'col-lg-%s %s'|format(dashboard_1.width, 'col-md-3 col-sm-6') %}
|
||||
{% for dashboard_2 in row %}
|
||||
{% if dashboard_2.width > 3 %}
|
||||
{% set class = 'col-lg-%s %s'|format(dashboard_1.width, 'col-md-12 col-sm-12') %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<div class="{{ class }} mb-3">{{ dashboard_1.output }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{{ security }}
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-setting').on('click', function () {
|
||||
$.ajax({
|
||||
url: 'index.php?route=common/developer&user_token={{ user_token }}',
|
||||
dataType: 'html',
|
||||
beforeSend: function () {
|
||||
$('#button-setting').button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$('#button-setting').button('reset');
|
||||
},
|
||||
success: function (html) {
|
||||
$('#modal-developer').remove();
|
||||
|
||||
$('body').prepend(html);
|
||||
|
||||
$('#modal-developer').modal('show');
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('input[name=\'developer_sass\']').on('change', function () {
|
||||
$.ajax({
|
||||
url: 'index.php?route=common/developer.edit&user_token={{ user_token }}',
|
||||
type: 'post',
|
||||
data: $('input[name=\'developer_sass\']:checked'),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$('input[name=\'developer_sass\']').prop('disabled', true);
|
||||
},
|
||||
complete: function () {
|
||||
$('input[name=\'developer_sass\']').prop('disabled', false);
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#modal-developer .modal-body').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
if (json['success']) {
|
||||
$('#modal-developer .modal-body').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#modal-developer table button').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=common/developer.' + $(element).attr('value') + '&user_token={{ user_token }}',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#modal-developer .modal-body').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#modal-developer .modal-body').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
95
admininistrator/view/template/common/developer.twig
Normal file
95
admininistrator/view/template/common/developer.twig
Normal file
@ -0,0 +1,95 @@
|
||||
<div id="modal-developer" class="modal fade">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa-solid fa-cog"></i> {{ heading_title }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ column_component }}</td>
|
||||
<td class="w-25">{{ entry_cache }}</td>
|
||||
<td class="text-end" style="width: 1px;">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>{{ entry_theme }}</td>
|
||||
<td></td>
|
||||
<td class="text-end"><button type="button" value="theme" data-bs-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-warning"><i class="fa-solid fa-rotate"></i></button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ entry_sass }}</td>
|
||||
<td>
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="developer_sass" value="0"/>
|
||||
<input type="checkbox" name="developer_sass" value="1" id="input-developer-sass" class="form-check-input"{% if developer_sass %} checked{% endif %}/>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-end"><button type="button" value="sass" data-bs-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-warning"><i class="fa-solid fa-rotate"></i></button></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('input[name=\'developer_sass\']').on('change', function () {
|
||||
$.ajax({
|
||||
url: 'index.php?route=common/developer.edit&user_token={{ user_token }}',
|
||||
type: 'post',
|
||||
data: $('input[name=\'developer_sass\']:checked'),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$('input[name=\'developer_sass\']').prop('disabled', true);
|
||||
},
|
||||
complete: function () {
|
||||
$('input[name=\'developer_sass\']').prop('disabled', false);
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#modal-developer table button').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=common/developer.' + $(element).attr('value') + '&user_token={{ user_token }}',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
228
admininistrator/view/template/common/filemanager.twig
Normal file
228
admininistrator/view/template/common/filemanager.twig
Normal file
@ -0,0 +1,228 @@
|
||||
<div id="modal-image" class="modal">
|
||||
<div id="filemanager" class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{{ heading_title }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#modal-image .modal-body').load('index.php?route=common/filemanager.list&user_token={{ user_token }}');
|
||||
|
||||
$('#modal-image').on('click', '#button-parent', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#modal-image .modal-body').load($(this).attr('href'));
|
||||
});
|
||||
|
||||
$('#modal-image').on('click', '#button-refresh', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#modal-image .modal-body').load($(this).attr('href'));
|
||||
});
|
||||
|
||||
$('#modal-image').on('keydown', '#input-search', function (e) {
|
||||
if (e.which == 13) {
|
||||
$('#button-search').trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
$('#modal-image').on('click', '#button-search', function (e) {
|
||||
var url = 'index.php?route=common/filemanager.list&user_token={{ user_token }}';
|
||||
|
||||
var directory = $('#input-directory').val();
|
||||
|
||||
if (directory) {
|
||||
url += '&directory=' + encodeURIComponent(directory);
|
||||
}
|
||||
|
||||
var filter_name = $('#input-search').val();
|
||||
|
||||
if (filter_name) {
|
||||
url += '&filter_name=' + encodeURIComponent(filter_name);
|
||||
}
|
||||
|
||||
{% if thumb %}
|
||||
url += '&thumb={{ thumb|escape('js') }}';
|
||||
{% endif %}
|
||||
|
||||
{% if target %}
|
||||
url += '&target={{ target|escape('js') }}';
|
||||
{% endif %}
|
||||
|
||||
{% if ckeditor %}
|
||||
url += '&ckeditor={{ ckeditor|escape('js') }}';
|
||||
{% endif %}
|
||||
|
||||
$('#modal-image .modal-body').load(url);
|
||||
});
|
||||
|
||||
$('#modal-image').on('click', '#button-upload', function () {
|
||||
$('#form-upload').remove();
|
||||
|
||||
$('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file[]" value="" multiple="multiple"/></form>');
|
||||
|
||||
$('#form-upload input[name=\'file[]\']').trigger('click');
|
||||
|
||||
$('#form-upload input[name=\'file[]\']').on('change', function () {
|
||||
for (i = 0; i < this.files.length; i++) {
|
||||
if ((this.files[0].size / 1024) > {{ config_file_max_size }}) {
|
||||
$(this).val('');
|
||||
|
||||
alert('{{ error_upload_size }}');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof timer != 'undefined') {
|
||||
clearInterval(timer);
|
||||
}
|
||||
|
||||
timer = setInterval(function () {
|
||||
if ($('#form-upload input[name=\'file[]\']').val() !== '') {
|
||||
clearInterval(timer);
|
||||
|
||||
var url = 'index.php?route=common/filemanager.upload&user_token={{ user_token }}';
|
||||
|
||||
var directory = $('#input-directory').val();
|
||||
|
||||
if (directory) {
|
||||
url += '&directory=' + encodeURIComponent(directory);
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: new FormData($('#form-upload')[0]),
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
beforeSend: function () {
|
||||
$('#button-upload').button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$('#button-upload').button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
if (json['error']) {
|
||||
alert(json['error']);
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
alert(json['success']);
|
||||
|
||||
$('#button-refresh').trigger('click');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
|
||||
$('#modal-image').on('click', '#button-folder', function () {
|
||||
$('#modal-folder').slideToggle();
|
||||
});
|
||||
|
||||
$('#modal-image').on('click', '#button-create', function () {
|
||||
var url = 'index.php?route=common/filemanager.folder&user_token={{ user_token }}';
|
||||
|
||||
var directory = $('#input-directory').val();
|
||||
|
||||
if (directory) {
|
||||
url += '&directory=' + encodeURIComponent(directory);
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: 'folder=' + encodeURIComponent($('#input-folder').val()),
|
||||
beforeSend: function () {
|
||||
$('#button-create').button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$('#button-create').button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
if (json['error']) {
|
||||
alert(json['error']);
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
alert(json['success']);
|
||||
|
||||
$('#button-refresh').trigger('click');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#modal-image').on('click', '#button-delete', function (e) {
|
||||
if (confirm('{{ text_confirm }}')) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=common/filemanager.delete&user_token={{ user_token }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: $('input[name^=\'path\']:checked'),
|
||||
beforeSend: function () {
|
||||
$('#button-delete').button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$('#button-delete').button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
if (json['error']) {
|
||||
alert(json['error']);
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
alert(json['success']);
|
||||
|
||||
$('#button-refresh').trigger('click');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#modal-image').on('click', 'a.directory', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#modal-image .modal-body').load($(this).attr('href'));
|
||||
});
|
||||
|
||||
$('#modal-image').on('click', 'a.thumbnail', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
{% if thumb %}
|
||||
$('{{ thumb|escape('js') }}').attr('src', $(this).find('img').attr('src'));
|
||||
|
||||
$('{{ target|escape('js') }}').val('catalog/' + $(this).parent().parent().find('input').val());
|
||||
{% endif %}
|
||||
|
||||
{% if ckeditor %}
|
||||
CKEDITOR.instances['{{ ckeditor|escape('js') }}'].insertHtml('<img src="' + $(this).attr('href') + '" alt="" title=""/>');
|
||||
{% endif %}
|
||||
|
||||
$('#modal-image').modal('hide');
|
||||
});
|
||||
|
||||
$('#modal-image').on('click', '.pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#modal-image .modal-body').load($(this).attr('href'));
|
||||
});
|
||||
//--></script>
|
||||
</div>
|
57
admininistrator/view/template/common/filemanager_list.twig
Normal file
57
admininistrator/view/template/common/filemanager_list.twig
Normal file
@ -0,0 +1,57 @@
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-5">
|
||||
<a href="{{ parent }}" id="button-parent" data-bs-toggle="tooltip" title="{{ button_parent }}" class="btn btn-light"><i class="fa-solid fa-level-up-alt"></i></a>
|
||||
<a href="{{ refresh }}" id="button-refresh" data-bs-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-light"><i class="fa-solid fa-rotate"></i></a>
|
||||
<button type="button" data-bs-toggle="tooltip" title="{{ button_upload }}" id="button-upload" class="btn btn-primary"><i class="fa-solid fa-upload"></i></button>
|
||||
<button type="button" data-bs-toggle="tooltip" title="{{ button_folder }}" id="button-folder" class="btn btn-light"><i class="fa-solid fa-folder"></i></button>
|
||||
<button type="button" data-bs-toggle="tooltip" title="{{ button_delete }}" id="button-delete" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
<input type="hidden" name="directory" value="{{ directory }}" id="input-directory"/>
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="input-group">
|
||||
<input type="text" name="search" value="{{ filter_name }}" placeholder="{{ entry_search }}" id="input-search" class="form-control">
|
||||
<button type="button" id="button-search" data-bs-toggle="tooltip" title="{{ button_search }}" class="btn btn-primary"><i class="fa-solid fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="modal-folder" class="row mb-3" style="display: none;">
|
||||
<div class="col-sm-12">
|
||||
<div class="input-group">
|
||||
<div class="input-group">
|
||||
<input type="text" name="folder" value="" placeholder="{{ entry_folder }}" id="input-folder" class="form-control">
|
||||
<button type="button" title="{{ button_folder }}" id="button-create" class="btn btn-primary"><i class="fa-solid fa-plus-circle"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="row row-cols-sm-3 row-cols-lg-4">
|
||||
{% set path_row = 0 %}
|
||||
{% for directory in directories %}
|
||||
<div class="mb-3">
|
||||
<div class="mb-1" style="min-height: 140px;">
|
||||
<a href="{{ directory.href }}" class="directory mb-1"><i class="fa-solid fa-folder fa-5x"></i></a>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<label for="input-path-{{ path_row }}" class="form-check-label">{{ directory.name }}</label>
|
||||
<input type="checkbox" name="path[]" value="{{ directory.path }}" id="input-path-{{ path_row }}" class="form-check-input"/>
|
||||
</div>
|
||||
</div>
|
||||
{% set path_row = path_row + 1 %}
|
||||
{% endfor %}
|
||||
{% for image in images %}
|
||||
<div class="mb-3">
|
||||
<div class="mb-1" style="min-height: 140px;">
|
||||
<a href="{{ image.href }}" class="thumbnail mb-1"><img src="{{ image.thumb }}" alt="{{ image.name }}" title="{{ image.name }}" class="img-thumbnail"/></a>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<label for="input-path-{{ path_row }}" class="form-check-label">{{ image.name }}</label>
|
||||
<input type="checkbox" name="path[]" value="{{ image.path }}" id="input-path-{{ path_row }}" class="form-check-input"/>
|
||||
</div>
|
||||
</div>
|
||||
{% set path_row = path_row + 1 %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if pagination %}
|
||||
<div class="modal-footer">{{ pagination }}</div>
|
||||
{% endif %}
|
3
admininistrator/view/template/common/footer.twig
Normal file
3
admininistrator/view/template/common/footer.twig
Normal file
@ -0,0 +1,3 @@
|
||||
<footer id="footer">{{ text_footer }}<br/>{{ text_version }}</footer></div>
|
||||
<script src="{{ bootstrap }}" type="text/javascript"></script>
|
||||
</body></html>
|
33
admininistrator/view/template/common/forgotten.twig
Normal file
33
admininistrator/view/template/common/forgotten.twig
Normal file
@ -0,0 +1,33 @@
|
||||
{{ header }}
|
||||
<div id="content">
|
||||
<div class="container-fluid">
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="row justify-content-sm-center">
|
||||
<div class="col-sm-10 col-md-8 col-lg-5">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa-solid fa-redo"></i> {{ heading_title }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="form-forgotten" action="{{ confirm }}" method="post" data-oc-toggle="ajax">
|
||||
<p>{{ text_email }}</p>
|
||||
<div class="mb-3">
|
||||
<label for="input-email" class="form-label">{{ entry_email }}</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-text"><i class="fa-solid fa-envelope"></i></div>
|
||||
<input type="text" name="email" value="" placeholder="{{ entry_email }}" id="input-email" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="submit" class="btn btn-primary"><i class="fa-solid fa-check"></i> {{ button_reset }}</button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
32
admininistrator/view/template/common/forgotten_reset.twig
Normal file
32
admininistrator/view/template/common/forgotten_reset.twig
Normal file
@ -0,0 +1,32 @@
|
||||
{{ header }}
|
||||
<div id="content">
|
||||
<div class="container">
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="row justify-content-sm-center">
|
||||
<div class="col-sm-10 col-md-8 col-lg-5">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-redo"></i> {{ heading_title }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-forgotten" action="{{ reset }}" method="post" data-oc-toggle="ajax">
|
||||
<p>{{ text_password }}</p>
|
||||
<div class="mb-3">
|
||||
<label for="input-password" class="form-label">{{ entry_password }}</label>
|
||||
<input type="password" name="password" value="" id="input-password" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-confirm" class="form-label">{{ entry_confirm }}</label>
|
||||
<input type="password" name="confirm" value="" id="input-confirm" class="form-control"/>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="submit" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i> {{ button_save }}</button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
78
admininistrator/view/template/common/header.twig
Normal file
78
admininistrator/view/template/common/header.twig
Normal file
@ -0,0 +1,78 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="{{ direction }}" lang="{{ lang }}">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>{{ title }}</title>
|
||||
<base href="{{ base }}"/>
|
||||
{% if description %}
|
||||
<meta name="description" content="{{ description }}"/>
|
||||
{% endif %}
|
||||
{% if keywords %}
|
||||
<meta name="keywords" content="{{ keywords }}"/>
|
||||
{% endif %}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link href="{{ bootstrap }}" rel="stylesheet" media="screen"/>
|
||||
<link href="{{ icons }}" rel="stylesheet" type="text/css"/>
|
||||
<link href="{{ stylesheet }}" rel="stylesheet" type="text/css"/>
|
||||
<script src="{{ jquery }}" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="view/javascript/jquery/datetimepicker/moment.min.js"></script>
|
||||
<script type="text/javascript" src="view/javascript/jquery/datetimepicker/moment-with-locales.min.js"></script>
|
||||
<script type="text/javascript" src="view/javascript/jquery/datetimepicker/daterangepicker.js"></script>
|
||||
<link href="view/javascript/jquery/datetimepicker/daterangepicker.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="view/javascript/common.js"></script>
|
||||
{% for style in styles %}
|
||||
<link type="text/css" href="{{ style.href }}" rel="{{ style.rel }}" media="{{ style.media }}"/>
|
||||
{% endfor %}
|
||||
{% for link in links %}
|
||||
<link href="{{ link.href }}" rel="{{ link.rel }}"/>
|
||||
{% endfor %}
|
||||
{% for script in scripts %}
|
||||
<script type="text/javascript" src="{{ script.href }}"></script>
|
||||
{% endfor %}
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="alert" class="toast-container position-fixed top-0 end-0 p-3"></div>
|
||||
<header id="header" class="navbar navbar-expand navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<a href="{{ home }}" class="navbar-brand d-none d-lg-block"><img src="view/image/logo.png" alt="{{ heading_title }}" title="{{ heading_title }}"/></a>
|
||||
{% if logged %}
|
||||
<button type="button" id="button-menu" class="btn btn-link d-inline-block d-lg-none"><i class="fa-solid fa-bars"></i></button>
|
||||
<ul class="nav navbar-nav">
|
||||
<li id="nav-notification" class="nav-item dropdown">
|
||||
<a href="#" data-bs-toggle="dropdown" class="nav-link dropdown-toggle"><i class="fa-regular fa-bell"></i>{% if notification_total %} <span class="badge bg-danger">{{ notification_total }}</span>{% endif %}</a>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
{% if notifications %}
|
||||
{% for notification in notifications %}
|
||||
<a href="{{ notification.href }}" data-bs-toggle="modal" class="dropdown-item">{{ notification.title }}</a>
|
||||
{% endfor %}
|
||||
<a href="{{ notification_all }}" class="dropdown-item text-center text-primary">{{ text_notification_all }}</a>
|
||||
{% else %}
|
||||
<span class="dropdown-item text-center">{{ text_no_results }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
<li id="nav-language" class="nav-item dropdown">{{ language }}</li>
|
||||
<li id="nav-profile" class="nav-item dropdown">
|
||||
<a href="#" data-bs-toggle="dropdown" class="nav-link dropdown-toggle"><img src="{{ image }}" alt="{{ firstname }} {{ lastname }}" title="{{ username }}" class="rounded-circle"/><span class="d-none d-md-inline d-lg-inline"> {{ firstname }} {{ lastname }} <i class="fa-solid fa-caret-down fa-fw"></i></span></a>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ profile }}" class="dropdown-item"><i class="fa-solid fa-user-circle fa-fw"></i> {{ text_profile }}</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><h6 class="dropdown-header">{{ text_store }}</h6></li>
|
||||
{% for store in stores %}
|
||||
<a href="{{ store.href }}" target="_blank" class="dropdown-item">{{ store.name }}</a>
|
||||
{% endfor %}
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><h6 class="dropdown-header">{{ text_help }}</h6></li>
|
||||
<li><a href="https://www.opencart.com" target="_blank" class="dropdown-item"><i class="fa-brands fa-opencart fa-fw"></i> {{ text_homepage }}</a></li>
|
||||
<li><a href="http://docs.opencart.com" target="_blank" class="dropdown-item"><i class="fa-solid fa-file fa-fw"></i> {{ text_documentation }}</a></li>
|
||||
<li><a href="https://forum.opencart.com" target="_blank" class="dropdown-item"><i class="fa-solid fa-comments fa-fw"></i> {{ text_support }}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li id="nav-logout" class="nav-item"><a href="{{ logout }}" class="nav-link"><i class="fa-solid fa-sign-out"></i> <span class="d-none d-md-inline">{{ text_logout }}</span></a></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
40
admininistrator/view/template/common/language.twig
Normal file
40
admininistrator/view/template/common/language.twig
Normal file
@ -0,0 +1,40 @@
|
||||
{% for language in languages %}
|
||||
{% if language.code == code %}
|
||||
<a href="{{ language.code }}" class="nav-link dropdown-toggle" data-bs-toggle="dropdown"><img src="{{ language.image }}" alt="{{ language.name }}" title="{{ language.name }}"/></a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<ul class="dropdown-menu">
|
||||
{% for language in languages %}
|
||||
<li><a href="{{ language.code }}" class="dropdown-item"><img src="{{ language.image }}" alt="{{ language.name }}" title="{{ language.name }}"/> {{ language.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<input type="hidden" name="redirect" value="{{ redirect }}" id="input-redirect"/>
|
||||
<script type="text/javascript"><!--
|
||||
$('#nav-language .dropdown-item').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=common/language.save&user_token={{ user_token }}',
|
||||
type: 'post',
|
||||
data: 'code=' + $(element).attr('href') + '&redirect=' + encodeURIComponent($('#input-redirect').val()),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
console.log($(element).attr('href'));
|
||||
console.log($('input-redirect').val());
|
||||
|
||||
if (json['redirect']) {
|
||||
location = json['redirect'];
|
||||
}
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
48
admininistrator/view/template/common/login.twig
Normal file
48
admininistrator/view/template/common/login.twig
Normal file
@ -0,0 +1,48 @@
|
||||
{{ header }}
|
||||
<div id="content">
|
||||
<div class="container-fluid">
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="row justify-content-sm-center">
|
||||
<div class="col-sm-10 col-md-8 col-lg-5">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-lock"></i> {{ text_login }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-login" action="{{ login }}" method="post" data-oc-toggle="ajax">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="Dfa-circle-exclamation"></i> {{ error_warning }} <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> {{ success }} <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>
|
||||
{% endif %}
|
||||
<div class="mb-3">
|
||||
<label for="input-username" class="form-label">{{ entry_username }}</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-text"><i class="fa-solid fa-user"></i></div>
|
||||
<input type="text" name="username" value="" placeholder="{{ entry_username }}" id="input-username" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-password" class="form-label">{{ entry_password }}</label>
|
||||
<div class="input-group mb-2">
|
||||
<div class="input-group-text"><i class="fa-solid fa-lock"></i></div>
|
||||
<input type="password" name="password" value="" placeholder="{{ entry_password }}" id="input-password" class="form-control"/>
|
||||
</div>
|
||||
{% if forgotten %}
|
||||
<div class="mb-3"><a href="{{ forgotten }}">{{ text_forgotten }}</a></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="submit" class="btn btn-primary"><i class="fa-solid fa-key"></i> {{ button_login }}</button>
|
||||
</div>
|
||||
{% if redirect %}
|
||||
<input type="hidden" name="redirect" value="{{ redirect }}"/>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
21
admininistrator/view/template/common/pagination.twig
Normal file
21
admininistrator/view/template/common/pagination.twig
Normal file
@ -0,0 +1,21 @@
|
||||
<ul class="pagination">
|
||||
{% if first %}
|
||||
<li class="page-item"><a href="{{ first }}" class="page-link">|<</a></li>
|
||||
{% endif %}
|
||||
{% if prev %}
|
||||
<li class="page-item"><a href="{{ prev }}" class="page-link"><</a></li>
|
||||
{% endif %}
|
||||
{% for link in links %}
|
||||
{% if link.page == page %}
|
||||
<li class="page-item active"><span class="page-link">{{ link.page }}</span></li>
|
||||
{% else %}
|
||||
<li class="page-item"><a href="{{ link.href }}" class="page-link">{{ link.page }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if next %}
|
||||
<li class="page-item"><a href="{{ next }}" class="page-link">></a></li>
|
||||
{% endif %}
|
||||
{% if last %}
|
||||
<li class="page-item"><a href="{{ last }}" class="page-link">>|</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
250
admininistrator/view/template/common/security.twig
Normal file
250
admininistrator/view/template/common/security.twig
Normal file
@ -0,0 +1,250 @@
|
||||
<div id="modal-security" class="modal show">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title text-danger"><i class="fa-solid fa-triangle-exclamation"></i> {{ heading_title }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div id="accordion" class="accordion">
|
||||
|
||||
{% if install %}
|
||||
<div id="security-install" class="accordion-item">
|
||||
<h5 class="accordion-header"><button type="button" data-bs-toggle="collapse" data-bs-target="#accordion-install" class="accordion-button collapsed"><span class="fa-solid fa-folder"></span> {{ text_install }}</button></h5>
|
||||
<div id="accordion-install" class="accordion-collapse collapse" data-bs-parent="#accordion">
|
||||
<div class="modal-body">
|
||||
<p>{{ text_install_description }}</p>
|
||||
<div class="mb-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group-text">{{ text_path }}</div>
|
||||
<input type="text" value="{{ install }}" class="form-control is-invalid bg-white" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-install" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i> {{ button_delete }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if storage %}
|
||||
<div id="security-storage" class="accordion-item">
|
||||
<h2 class="accordion-header"><button type="button" data-bs-toggle="collapse" data-bs-target="#accordion-storage" class="accordion-button collapsed"><i class="fa-solid fa-circle-right"></i> {{ text_storage }}</button></h2>
|
||||
<div id="accordion-storage" class="accordion-collapse collapse" data-bs-parent="#accordion">
|
||||
<div class="modal-body">
|
||||
<form id="form-storage">
|
||||
<p>{{ text_storage_description }}</p>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ entry_path_current }}</label>
|
||||
<input type="text" value="{{ storage }}" class="form-control is-invalid bg-white" readonly/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ entry_path_new }}</label>
|
||||
<div class="input-group dropdown">
|
||||
<button type="button" id="button-path" data-bs-toggle="dropdown" class="btn btn-outline-secondary dropdown-toggle">{{ document_root }} <span class="fa-solid fa-caret-down"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
{% for path in paths %}
|
||||
<li><a href="{{ path }}" class="dropdown-item">{{ path }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<input type="text" name="name" value="storage" placeholder="{{ text_path }}" id="input-storage" class="form-control"/>
|
||||
</div>
|
||||
<input type="hidden" name="path" value="{{ document_root }}" id="input-path"/>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-storage" class="btn btn-danger"><span class="fa-solid fa-circle-right"></span> {{ button_move }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if admin %}
|
||||
<div id="security-admin" class="accordion-item">
|
||||
<h2 class="accordion-header"><button type="button" data-bs-toggle="collapse" data-bs-target="#accordion-admin" class="accordion-button collapsed"><span class="fa-solid fa-lock"></span> {{ text_admin }}</button></h2>
|
||||
<div id="accordion-admin" class="accordion-collapse collapse" data-bs-parent="#accordion">
|
||||
<div class="modal-body">
|
||||
<form id="form-admin">
|
||||
<p>{{ text_admin_description }}</p>
|
||||
<div class="mb-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group-text">{{ text_path }}</div>
|
||||
<input type="text" name="name" value="admin" placeholder="{{ entry_name }}" id="input-admin" class="form-control is-invalid"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-admin" class="btn btn-danger"><i class="fa-solid fa-pencil"></i> {{ button_rename }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$(document).ready(function () {
|
||||
// Show modal
|
||||
var modal = new bootstrap.Modal($('#modal-security'));
|
||||
|
||||
modal.show();
|
||||
|
||||
$('#accordion .accordion-header:first button').trigger('click');
|
||||
});
|
||||
|
||||
$('#button-install').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=common/security.install&user_token={{ user_token }}',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#security-install').remove();
|
||||
|
||||
$('#accordion .accordion-header:first button').trigger('click');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#form-storage .dropdown-menu a').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#input-path').val($(this).attr('href'));
|
||||
|
||||
$('#button-path').html($(this).attr('href') + ' <span class="fa-solid fa-caret-down"></span>');
|
||||
});
|
||||
|
||||
$('#button-storage').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
$(element).button('loading');
|
||||
|
||||
var next = 'index.php?route=common/security.storage&user_token={{ user_token }}&name=' + encodeURIComponent($('#input-storage').val()) + '&path=' + encodeURIComponent($('#input-path').val());
|
||||
|
||||
var storage = function () {
|
||||
return $.ajax({
|
||||
url: next,
|
||||
dataType: 'json',
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
success: function (json) {
|
||||
console.log(json);
|
||||
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$(element).button('reset');
|
||||
}
|
||||
|
||||
if (json['text']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle-circle"></i> ' + json['text'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$(element).button('reset');
|
||||
|
||||
$('#security-storage').remove();
|
||||
|
||||
$('#accordion .accordion-header:first button').trigger('click');
|
||||
}
|
||||
|
||||
if (json['next']) {
|
||||
next = json['next'];
|
||||
|
||||
chain.attach(storage);
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
|
||||
$(element).button('reset');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
chain.attach(storage);
|
||||
});
|
||||
|
||||
$('#button-admin').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
$(element).button('loading');
|
||||
|
||||
var next = 'index.php?route=common/security.admin&user_token={{ user_token }}&name=' + encodeURIComponent($('#input-admin').val());
|
||||
|
||||
var admin = function () {
|
||||
return $.ajax({
|
||||
url: next,
|
||||
dataType: 'json',
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
success: function (json) {
|
||||
console.log(json);
|
||||
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['redirect']) {
|
||||
location = json['redirect'];
|
||||
}
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$(element).button('reset');
|
||||
}
|
||||
|
||||
if (json['text']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle-circle"></i> ' + json['text'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$(element).button('reset');
|
||||
|
||||
$('#security-admin').remove();
|
||||
|
||||
$('#accordion .accordion-header:first button').trigger('click');
|
||||
}
|
||||
|
||||
if (json['next']) {
|
||||
next = json['next'];
|
||||
|
||||
chain.attach(admin);
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
|
||||
$(element).button('reset');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
chain.attach(admin);
|
||||
});
|
||||
//--></script>
|
Reference in New Issue
Block a user