Merge branch 'bootstrap' of https://github.com/PrestaShop/PrestaShop into bootstrap
Conflicts: classes/helper/HelperForm.php classes/helper/HelperUploader.php
This commit is contained in:
commit
39f6a2354a
14 files changed
+238
-238
No files matched your search
@@ -1085,20 +1085,34 @@
|
|||||||
|
|
||||||
<ul id="old_carts_orders_navtab" class="nav nav-tabs">
|
<ul id="old_carts_orders_navtab" class="nav nav-tabs">
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a href="#lastOrders" data-toggle="tab">
|
|
||||||
<i class="icon-credit-card"></i>
|
|
||||||
{l s='Orders'}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#nonOrderedCarts" data-toggle="tab">
|
<a href="#nonOrderedCarts" data-toggle="tab">
|
||||||
<i class="icon-shopping-cart"></i>
|
<i class="icon-shopping-cart"></i>
|
||||||
{l s='Carts'}
|
{l s='Carts'}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#lastOrders" data-toggle="tab">
|
||||||
|
<i class="icon-credit-card"></i>
|
||||||
|
{l s='Orders'}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="old_carts_orders" class="tab-content panel collapse in">
|
<div id="old_carts_orders" class="tab-content panel collapse in">
|
||||||
<div id="lastOrders" class="tab-pane active">
|
<div id="nonOrderedCarts" class="tab-pane active">
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><span class="title_box">{l s='ID'}</span></th>
|
||||||
|
<th><span class="title_box">{l s='Date'}</span></th>
|
||||||
|
<th><span class="title_box">{l s='Total'}</span></th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="lastOrders" class="tab-pane">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -1115,20 +1129,6 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div id="nonOrderedCarts" class="tab-pane">
|
|
||||||
<table class="table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><span class="title_box">{l s='ID'}</span></th>
|
|
||||||
<th><span class="title_box">{l s='Date'}</span></th>
|
|
||||||
<th><span class="title_box">{l s='Total'}</span></th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+4
-2
@@ -22,8 +22,10 @@
|
|||||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*}
|
*}
|
||||||
{if isset($actions)}
|
<div class="tree-actions col-lg-12">
|
||||||
|
{if isset($actions)}
|
||||||
{foreach from=$actions item=action}
|
{foreach from=$actions item=action}
|
||||||
{$action->render()}
|
{$action->render()}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
|
</div>
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
{if $key == 'legend'}
|
{if $key == 'legend'}
|
||||||
<h3>
|
<h3>
|
||||||
{if isset($field.image)}<img src="{$field.image}" alt="{$field.title|escape:'htmlall':'UTF-8'}" />{/if}
|
{if isset($field.image)}<img src="{$field.image}" alt="{$field.title|escape:'htmlall':'UTF-8'}" />{/if}
|
||||||
{if isset($field.icon)}<i class="{$field.icon}"/></i>{/if}
|
{if isset($field.icon)}<i class="{$field.icon}"></i>{/if}
|
||||||
{$field.title}
|
{$field.title}
|
||||||
</h3>
|
</h3>
|
||||||
{elseif $key == 'description' && $field}
|
{elseif $key == 'description' && $field}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*}
|
*}
|
||||||
<div class="panel-heading">
|
<div class="tree-panel-heading-controls">
|
||||||
<!-- <i class="icon-tag"></i> {l s=$title} -->
|
<!-- <i class="icon-tag"></i> {l s=$title} -->
|
||||||
{if isset($toolbar)}{$toolbar}{/if}
|
{if isset($toolbar)}{$toolbar}{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -26,27 +26,33 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
{foreach $images as $image}
|
{foreach $images as $image}
|
||||||
|
{if isset($image.image)}
|
||||||
<div class="img-thumbnail text-center">
|
<div class="img-thumbnail text-center">
|
||||||
{$image}
|
<p>{$image.image}</p>
|
||||||
{if isset($size)}<p>{l s='File size'} {$size}kb</p>{/if}
|
{if isset($image.size)}<p>{l s='File size'} {$image.size}kb</p>{/if}
|
||||||
{if isset($delete_url)}
|
{if isset($image.delete_url)}
|
||||||
<a class="btn btn-default" href="{$delete_url}">
|
<p>
|
||||||
|
<a class="btn btn-default" href="{$image.delete_url}">
|
||||||
<i class="icon-trash"></i> {l s='Delete'}
|
<i class="icon-trash"></i> {l s='Delete'}
|
||||||
</a>
|
</a>
|
||||||
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input id="{$id}" type="file" name="{$name}[]"{if isset($url)} data-url="{$url}"{/if}{if isset($multiple) && $multiple} multiple="multiple"{/if} class="hide" />
|
<div class="col-lg-12">
|
||||||
<button class="btn btn-default" data-style="expand-right" data-size="s" type="button" id="{$id}-add-button">
|
<input id="{$id}" type="file" name="{$name}[]"{if isset($url)} data-url="{$url}"{/if}{if isset($multiple) && $multiple} multiple="multiple"{/if} class="hide" />
|
||||||
<i class="icon-plus-sign"></i> {if isset($multiple) && $multiple}{l s='Add files'}{else}{l s='Add file'}{/if}
|
<button class="btn btn-default" data-style="expand-right" data-size="s" type="button" id="{$id}-add-button">
|
||||||
</button>
|
<i class="icon-plus-sign"></i> {if isset($multiple) && $multiple}{l s='Add files'}{else}{l s='Add file'}{/if}
|
||||||
<button class="ladda-button" data-style="expand-right" data-size="s" type="button" id="{$id}-upload-button" style="display:none;">
|
</button>
|
||||||
<i class="icon-cloud-upload"></i> <span class="ladda-label">{if isset($multiple) && $multiple}{l s='Upload files'}{else}{l s='Upload file'}{/if}</span>
|
<button class="ladda-button" data-style="expand-right" data-size="s" type="button" id="{$id}-upload-button" style="display:none;">
|
||||||
</button>
|
<i class="icon-cloud-upload"></i> <span class="ladda-label">{if isset($multiple) && $multiple}{l s='Upload files'}{else}{l s='Upload file'}{/if}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" style="display:none">
|
<div class="row" style="display:none">
|
||||||
<div class="alert alert-info" id="{$id}-files-list">
|
<div class="alert alert-info" id="{$id}-files-list">
|
||||||
@@ -81,6 +87,7 @@ $( document ).ready(function() {
|
|||||||
previewMaxWidth: 100,
|
previewMaxWidth: 100,
|
||||||
previewMaxHeight: 100,
|
previewMaxHeight: 100,
|
||||||
previewCrop: false,
|
previewCrop: false,
|
||||||
|
limitMultiFileUploads: 3,
|
||||||
start: function () {
|
start: function () {
|
||||||
upload_button.start();
|
upload_button.start();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,22 +22,26 @@
|
|||||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*}
|
*}
|
||||||
{if isset($display_image) && $display_image}
|
{if isset($images) && $images}
|
||||||
{if isset($image) && $image}
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<div class="col-lg-12">
|
||||||
<div class="col-lg-12">
|
{foreach $images as $image}
|
||||||
<div class="img-thumbnail text-center">
|
{if isset($image.image)}
|
||||||
{$image}
|
<div class="img-thumbnail text-center">
|
||||||
{if isset($size)}<p>{l s='File size'} {$size}kb</p>{/if}
|
<p>{$image.image}</p>
|
||||||
{if isset($delete_url)}
|
{if isset($image.size)}<p>{l s='File size'} {$image.size}kb</p>{/if}
|
||||||
<a class="btn btn-default" href="{$delete_url}">
|
{if isset($image.delete_url)}
|
||||||
<i class="icon-trash"></i> {l s='Delete'}
|
<p>
|
||||||
|
<a class="btn btn-default" href="{$image.delete_url}">
|
||||||
|
<i class="icon-trash"></i> {l s='Delete'}
|
||||||
</a>
|
</a>
|
||||||
{/if}
|
</p>
|
||||||
</div>
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{if isset($thumb) && $thumb}
|
{if isset($thumb) && $thumb}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -69,23 +73,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script type="text/javascript">
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$('#{$id}-selectbutton').click(function(e) {
|
$('#{$id}-selectbutton').click(function(e) {
|
||||||
$('#{$id}').trigger('click');
|
$('#{$id}').trigger('click');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#{$id}-name').click(function(e) {
|
$('#{$id}-name').click(function(e) {
|
||||||
$('#{$id}').trigger('click');
|
$('#{$id}').trigger('click');
|
||||||
});
|
});
|
||||||
$('#{$id}').change(function(e) {
|
|
||||||
var files = $(this)[0].files;
|
|
||||||
var name = '';
|
|
||||||
|
|
||||||
$.each(files, function(index, value) {
|
$('#{$id}').change(function(e) {
|
||||||
name += value.name+', ';
|
if ($(this)[0].files !== undefined)
|
||||||
});
|
{
|
||||||
|
var files = $(this)[0].files;
|
||||||
$('#{$id}-name').val(name.slice(0, -2));
|
var name = '';
|
||||||
|
|
||||||
|
$.each(files, function(index, value) {
|
||||||
|
name += value.name+', ';
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#{$id}-name').val(name.slice(0, -2));
|
||||||
|
}
|
||||||
|
else // Internet Explorer 9 Compatibility
|
||||||
|
{
|
||||||
|
var name = $(this).val().split(/[\\/]/);
|
||||||
|
$('#{$id}-name').val(name[name.length-1]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*}
|
*}
|
||||||
|
{$header}
|
||||||
{if isset($conf)}
|
{if isset($conf)}
|
||||||
<div class="alert alert-success">
|
<div class="alert alert-success">
|
||||||
{$conf}
|
{$conf}
|
||||||
@@ -91,3 +91,4 @@
|
|||||||
{if !$bootstrap}<div id="nobootstrap">{/if}
|
{if !$bootstrap}<div id="nobootstrap">{/if}
|
||||||
{$page}
|
{$page}
|
||||||
{if !$bootstrap}</div>{/if}
|
{if !$bootstrap}</div>{/if}
|
||||||
|
{$footer}
|
||||||
@@ -396,8 +396,10 @@ class DispatcherCore
|
|||||||
$this->default_routes[$route] = array_merge($this->default_routes[$route], $route_details);
|
$this->default_routes[$route] = array_merge($this->default_routes[$route], $route_details);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!in_array($context->language->id, $languages = Language::getLanguages()))
|
||||||
|
$languages[] = (int)$context->language->id;
|
||||||
// Set default routes
|
// Set default routes
|
||||||
foreach (Language::getLanguages() as $lang)
|
foreach ($languages as $lang)
|
||||||
foreach ($this->default_routes as $id => $route)
|
foreach ($this->default_routes as $id => $route)
|
||||||
$this->addRoute(
|
$this->addRoute(
|
||||||
$id,
|
$id,
|
||||||
@@ -441,7 +443,10 @@ class DispatcherCore
|
|||||||
// Load custom routes
|
// Load custom routes
|
||||||
foreach ($this->default_routes as $route_id => $route_data)
|
foreach ($this->default_routes as $route_id => $route_data)
|
||||||
if ($custom_route = Configuration::get('PS_ROUTE_'.$route_id, null, null, $id_shop))
|
if ($custom_route = Configuration::get('PS_ROUTE_'.$route_id, null, null, $id_shop))
|
||||||
foreach (Language::getLanguages() as $lang)
|
{
|
||||||
|
if (!in_array($context->language->id, $languages = Language::getLanguages()))
|
||||||
|
$languages[] = (int)$context->language->id;
|
||||||
|
foreach ($languages as $lang)
|
||||||
$this->addRoute(
|
$this->addRoute(
|
||||||
$route_id,
|
$route_id,
|
||||||
$custom_route,
|
$custom_route,
|
||||||
@@ -451,6 +456,7 @@ class DispatcherCore
|
|||||||
isset($route_data['params']) ? $route_data['params'] : array(),
|
isset($route_data['params']) ? $route_data['params'] : array(),
|
||||||
$id_shop
|
$id_shop
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,7 +599,7 @@ class DispatcherCore
|
|||||||
$id_lang = (int)Context::getContext()->language->id;
|
$id_lang = (int)Context::getContext()->language->id;
|
||||||
if ($id_shop === null)
|
if ($id_shop === null)
|
||||||
$id_shop = (int)Context::getContext()->shop->id;
|
$id_shop = (int)Context::getContext()->shop->id;
|
||||||
|
|
||||||
if (!isset($this->routes[$id_shop]))
|
if (!isset($this->routes[$id_shop]))
|
||||||
$this->loadRoutes($id_shop);
|
$this->loadRoutes($id_shop);
|
||||||
|
|
||||||
|
|||||||
@@ -682,6 +682,7 @@ class AdminControllerCore extends Controller
|
|||||||
'export_content' => $content
|
'export_content' => $content
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->layout = 'layout-export.tpl';
|
$this->layout = 'layout-export.tpl';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1372,12 +1373,14 @@ class AdminControllerCore extends Controller
|
|||||||
foreach (array('errors', 'warnings', 'informations', 'confirmations') as $type)
|
foreach (array('errors', 'warnings', 'informations', 'confirmations') as $type)
|
||||||
$this->context->smarty->assign($type, $this->json ? Tools::jsonEncode(array_unique($this->$type)) : array_unique($this->$type));
|
$this->context->smarty->assign($type, $this->json ? Tools::jsonEncode(array_unique($this->$type)) : array_unique($this->$type));
|
||||||
|
|
||||||
$this->context->smarty->assign('page', $this->json ? Tools::jsonEncode($page) : $page);
|
$this->context->smarty->assign(array(
|
||||||
|
'page' => $this->json ? Tools::jsonEncode($page) : $page,
|
||||||
if (!$this->ajax)
|
'header' => $this->context->smarty->fetch($header_tpl),
|
||||||
$this->smartyOutputContent(array($header_tpl, $this->layout, $footer_tpl));
|
'footer' => $this->context->smarty->fetch($footer_tpl)
|
||||||
else
|
)
|
||||||
$this->smartyOutputContent($this->layout);
|
);
|
||||||
|
|
||||||
|
$this->smartyOutputContent($this->layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -118,13 +118,20 @@ class HelperFormCore extends Helper
|
|||||||
$uploader->setUrl(isset($params['url'])?$params['url']:null);
|
$uploader->setUrl(isset($params['url'])?$params['url']:null);
|
||||||
$uploader->setMultiple(isset($params['multiple'])?$params['multiple']:false);
|
$uploader->setMultiple(isset($params['multiple'])?$params['multiple']:false);
|
||||||
$uploader->setUseAjax(isset($params['ajax'])?$params['ajax']:false);
|
$uploader->setUseAjax(isset($params['ajax'])?$params['ajax']:false);
|
||||||
$uploader->setDisplayImage(isset($params['display_image'])?$params['display_image']:false);
|
|
||||||
$uploader->setImage(isset($params['image'])?$params['image']:null);
|
if (isset($params['images']))
|
||||||
|
$uploader->setImages($params['images']);
|
||||||
|
elseif (isset($params['image'])) // Use for retrocompatibility
|
||||||
|
$uploader->setImages(array(
|
||||||
|
0 => array(
|
||||||
|
'image' => isset($params['image'])?$params['image']:null,
|
||||||
|
'size' => isset($params['size'])?$params['size']:null,
|
||||||
|
'delete_url' => isset($params['delete_url'])?$params['delete_url']:null
|
||||||
|
)));
|
||||||
|
|
||||||
$uploader->setThumb(isset($params['thumb'])?$params['thumb']:null);
|
$uploader->setThumb(isset($params['thumb'])?$params['thumb']:null);
|
||||||
$uploader->setSize(isset($params['size'])?$params['size']:null);
|
|
||||||
$uploader->setFile(isset($params['file'])?$params['file']:null);
|
$uploader->setFile(isset($params['file'])?$params['file']:null);
|
||||||
$uploader->setTitle(isset($params['title'])?$params['title']:null);
|
$uploader->setTitle(isset($params['title'])?$params['title']:null);
|
||||||
$uploader->setDeleteUrl(isset($params['delete_url'])?$params['delete_url']:null);
|
|
||||||
|
|
||||||
$params['file'] = $uploader->render();
|
$params['file'] = $uploader->render();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -104,16 +104,22 @@ class HelperOptionsCore extends Helper
|
|||||||
$uploader->setUrl(isset($field['url'])?$field['url']:null);
|
$uploader->setUrl(isset($field['url'])?$field['url']:null);
|
||||||
$uploader->setMultiple(isset($field['multiple'])?$field['multiple']:false);
|
$uploader->setMultiple(isset($field['multiple'])?$field['multiple']:false);
|
||||||
$uploader->setUseAjax(isset($field['ajax'])?$field['ajax']:false);
|
$uploader->setUseAjax(isset($field['ajax'])?$field['ajax']:false);
|
||||||
$uploader->setDisplayImage(isset($field['display_image'])?$field['display_image']:false);
|
|
||||||
$uploader->setImage(isset($field['image'])?$field['image']:null);
|
|
||||||
$uploader->setThumb(isset($field['thumb'])?$field['thumb']:null);
|
|
||||||
$uploader->setSize(isset($field['size'])?$field['size']:null);
|
|
||||||
$uploader->setTitle(isset($field['title'])?$field['title']:null);
|
|
||||||
$uploader->setDeleteUrl(isset($field['delete_url'])?$field['delete_url']:null);
|
|
||||||
|
|
||||||
|
if (isset($field['images']))
|
||||||
|
$uploader->setImages($field['images']);
|
||||||
|
elseif (isset($field['image'])) // Use for retrocompatibility
|
||||||
|
$uploader->setImages(array(
|
||||||
|
0 => array(
|
||||||
|
'image' => isset($field['image'])?$field['image']:null,
|
||||||
|
'size' => isset($field['size'])?$field['size']:null,
|
||||||
|
'delete_url' => isset($field['delete_url'])?$field['delete_url']:null
|
||||||
|
)));
|
||||||
|
|
||||||
|
$uploader->setThumb(isset($field['thumb'])?$field['thumb']:null);
|
||||||
|
$uploader->setTitle(isset($field['title'])?$field['title']:null);
|
||||||
$field['file'] = $uploader->render();
|
$field['file'] = $uploader->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cast options values if specified
|
// Cast options values if specified
|
||||||
if ($field['type'] == 'select' && isset($field['cast']))
|
if ($field['type'] == 'select' && isset($field['cast']))
|
||||||
foreach ($field['list'] as $option_key => $option)
|
foreach ($field['list'] as $option_key => $option)
|
||||||
|
|||||||
@@ -31,13 +31,10 @@ class HelperUploaderCore extends Uploader
|
|||||||
const DEFAULT_AJAX_TEMPLATE = 'ajax.tpl';
|
const DEFAULT_AJAX_TEMPLATE = 'ajax.tpl';
|
||||||
|
|
||||||
private $_context;
|
private $_context;
|
||||||
private $_delete_url;
|
|
||||||
private $_display_image;
|
|
||||||
private $_id;
|
private $_id;
|
||||||
private $_image;
|
private $_images;
|
||||||
private $_name;
|
private $_name;
|
||||||
private $_multiple;
|
private $_multiple;
|
||||||
private $_size;
|
|
||||||
private $_file;
|
private $_file;
|
||||||
protected $_template;
|
protected $_template;
|
||||||
private $_template_directory;
|
private $_template_directory;
|
||||||
@@ -60,23 +57,6 @@ class HelperUploaderCore extends Uploader
|
|||||||
return $this->_context;
|
return $this->_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDeleteUrl($value)
|
|
||||||
{
|
|
||||||
$this->_delete_url = $value;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDeleteUrl()
|
|
||||||
{
|
|
||||||
return $this->_delete_url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setDisplayImage($value)
|
|
||||||
{
|
|
||||||
$this->_display_image = $value;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setId($value)
|
public function setId($value)
|
||||||
{
|
{
|
||||||
$this->_id = (string)$value;
|
$this->_id = (string)$value;
|
||||||
@@ -91,15 +71,18 @@ class HelperUploaderCore extends Uploader
|
|||||||
return $this->_id;
|
return $this->_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setImage($value)
|
public function setImages($value)
|
||||||
{
|
{
|
||||||
$this->_image = $value;
|
$this->_images = $value;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getImage()
|
public function getImages()
|
||||||
{
|
{
|
||||||
return $this->_image;
|
if (!isset($this->_images))
|
||||||
|
$this->_images = array();
|
||||||
|
|
||||||
|
return $this->_images;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($value)
|
public function setName($value)
|
||||||
@@ -119,17 +102,6 @@ class HelperUploaderCore extends Uploader
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSize($value)
|
|
||||||
{
|
|
||||||
$this->_size = $value;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSize()
|
|
||||||
{
|
|
||||||
return $this->_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setTemplate($value)
|
public function setTemplate($value)
|
||||||
{
|
{
|
||||||
$this->_template = $value;
|
$this->_template = $value;
|
||||||
@@ -246,11 +218,6 @@ class HelperUploaderCore extends Uploader
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayImage()
|
|
||||||
{
|
|
||||||
return (isset($this->_display_image) && $this->_display_image);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isMultiple()
|
public function isMultiple()
|
||||||
{
|
{
|
||||||
return (isset($this->_multiple) && $this->_multiple);
|
return (isset($this->_multiple) && $this->_multiple);
|
||||||
@@ -297,7 +264,6 @@ class HelperUploaderCore extends Uploader
|
|||||||
|
|
||||||
$this->getContext()->controller->addJs(__PS_BASE_URI__.'/js/vendor/spin.js');
|
$this->getContext()->controller->addJs(__PS_BASE_URI__.'/js/vendor/spin.js');
|
||||||
$this->getContext()->controller->addJs(__PS_BASE_URI__.'/js/vendor/ladda.js');
|
$this->getContext()->controller->addJs(__PS_BASE_URI__.'/js/vendor/ladda.js');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->useAjax())
|
if ($this->useAjax())
|
||||||
@@ -312,12 +278,9 @@ class HelperUploaderCore extends Uploader
|
|||||||
'name' => $this->getName(),
|
'name' => $this->getName(),
|
||||||
'url' => $this->getUrl(),
|
'url' => $this->getUrl(),
|
||||||
'multiple' => $this->isMultiple(),
|
'multiple' => $this->isMultiple(),
|
||||||
'display_image' => $this->displayImage(),
|
'images' => $this->getImages(),
|
||||||
'image' => $this->getImage(),
|
|
||||||
'thumb' => $this->getThumb(),
|
'thumb' => $this->getThumb(),
|
||||||
'file' => $this->getFile(),
|
'file' => $this->getFile(),
|
||||||
'size' => $this->getSize(),
|
|
||||||
'delete_url' => $this->getDeleteUrl(),
|
|
||||||
'title' => $this->getTitle()
|
'title' => $this->getTitle()
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
@@ -70,26 +70,33 @@ class AdminCmsControllerCore extends AdminController
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function initPageHeaderToolbar()
|
||||||
|
{
|
||||||
|
$this->page_header_toolbar_btn['save-and-preview'] = array(
|
||||||
|
'href' => '#',
|
||||||
|
'desc' => $this->l('Save and preview')
|
||||||
|
);
|
||||||
|
$this->page_header_toolbar_btn['save-and-stay'] = array(
|
||||||
|
'short' => 'SaveAndStay',
|
||||||
|
'href' => '#',
|
||||||
|
'desc' => $this->l('Save and stay'),
|
||||||
|
);
|
||||||
|
|
||||||
|
return parent::initPageHeaderToolbar();
|
||||||
|
}
|
||||||
|
|
||||||
public function renderForm()
|
public function renderForm()
|
||||||
{
|
{
|
||||||
if (!$this->loadObject(true))
|
if (!$this->loadObject(true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Validate::isLoadedObject($this->object))
|
if (Validate::isLoadedObject($this->object))
|
||||||
$this->display = 'edit';
|
$this->display = 'edit';
|
||||||
else
|
else
|
||||||
$this->display = 'add';
|
$this->display = 'add';
|
||||||
|
|
||||||
$this->toolbar_btn['save-and-preview'] = array(
|
|
||||||
'href' => '#',
|
|
||||||
'desc' => $this->l('Save and preview')
|
|
||||||
);
|
|
||||||
$this->toolbar_btn['save-and-stay'] = array(
|
|
||||||
'short' => 'SaveAndStay',
|
|
||||||
'href' => '#',
|
|
||||||
'desc' => $this->l('Save and stay'),
|
|
||||||
);
|
|
||||||
$this->initToolbar();
|
$this->initToolbar();
|
||||||
|
$this->initPageHeaderToolbar();
|
||||||
|
|
||||||
$categories = CMSCategory::getCategories($this->context->language->id, false);
|
$categories = CMSCategory::getCategories($this->context->language->id, false);
|
||||||
$html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_cms_category'), 1);
|
$html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_cms_category'), 1);
|
||||||
@@ -226,16 +233,7 @@ class AdminCmsControllerCore extends AdminController
|
|||||||
public function postProcess()
|
public function postProcess()
|
||||||
{
|
{
|
||||||
if (Tools::isSubmit('viewcms') && ($id_cms = (int)Tools::getValue('id_cms')) && ($cms = new CMS($id_cms, $this->context->language->id)) && Validate::isLoadedObject($cms))
|
if (Tools::isSubmit('viewcms') && ($id_cms = (int)Tools::getValue('id_cms')) && ($cms = new CMS($id_cms, $this->context->language->id)) && Validate::isLoadedObject($cms))
|
||||||
{
|
$this->redirect_after = $this->getPreviewUrl($cms);
|
||||||
$redir = $this->context->link->getCMSLink($cms);
|
|
||||||
if (!$cms->active)
|
|
||||||
{
|
|
||||||
$admin_dir = dirname($_SERVER['PHP_SELF']);
|
|
||||||
$admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1);
|
|
||||||
$redir .= '?adtoken='.Tools::getAdminTokenLite('AdminCmsContent').'&ad='.$admin_dir.'&id_employee='.(int)$this->context->employee->id;
|
|
||||||
}
|
|
||||||
Tools::redirectAdmin($redir);
|
|
||||||
}
|
|
||||||
elseif (Tools::isSubmit('deletecms'))
|
elseif (Tools::isSubmit('deletecms'))
|
||||||
{
|
{
|
||||||
if (Tools::getValue('id_cms') == Configuration::get('PS_CONDITIONS_CMS_ID'))
|
if (Tools::getValue('id_cms') == Configuration::get('PS_CONDITIONS_CMS_ID'))
|
||||||
@@ -301,27 +299,7 @@ class AdminCmsControllerCore extends AdminController
|
|||||||
$this->updateAssoShop($cms->id);
|
$this->updateAssoShop($cms->id);
|
||||||
}
|
}
|
||||||
if (Tools::isSubmit('submitAddcmsAndPreview'))
|
if (Tools::isSubmit('submitAddcmsAndPreview'))
|
||||||
{
|
$this->redirect_after = $this->previewUrl($cms);
|
||||||
$alias = $this->getFieldValue($cms, 'link_rewrite', $this->context->language->id);
|
|
||||||
$preview_url = $this->context->link->getCMSLink($cms, $alias, $this->context->language->id);
|
|
||||||
|
|
||||||
if (!$cms->active)
|
|
||||||
{
|
|
||||||
$admin_dir = dirname($_SERVER['PHP_SELF']);
|
|
||||||
$admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1);
|
|
||||||
$params = http_build_query(array(
|
|
||||||
'adtoken' => Tools::getAdminTokenLite('AdminCmsContent'),
|
|
||||||
'ad' => $admin_dir,
|
|
||||||
'id_employee' => (int)$this->context->employee->id)
|
|
||||||
);
|
|
||||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
|
||||||
$params = '?'.$params;
|
|
||||||
else
|
|
||||||
$params = '&'.$params;
|
|
||||||
$preview_url .= $cms->active ? '' : $params;
|
|
||||||
}
|
|
||||||
Tools::redirectAdmin($preview_url);
|
|
||||||
}
|
|
||||||
elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
|
elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
|
||||||
Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$cms->id.'&conf=4&update'.$this->table.'&token='.Tools::getAdminTokenLite('AdminCmsContent'));
|
Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$cms->id.'&conf=4&update'.$this->table.'&token='.Tools::getAdminTokenLite('AdminCmsContent'));
|
||||||
else
|
else
|
||||||
@@ -380,6 +358,23 @@ class AdminCmsControllerCore extends AdminController
|
|||||||
else
|
else
|
||||||
parent::postProcess(true);
|
parent::postProcess(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPreviewUrl(CMS $cms)
|
||||||
|
{
|
||||||
|
$preview_url = $this->context->link->getCMSLink($cms, null, null, $this->context->language->id);
|
||||||
|
if (!$cms->active)
|
||||||
|
{
|
||||||
|
$params = http_build_query(array(
|
||||||
|
'adtoken' => Tools::getAdminTokenLite('AdminCmsContent'),
|
||||||
|
'ad' => substr(dirname($_SERVER['PHP_SELF']), strrpos(dirname($_SERVER['PHP_SELF']), '/') + 1),
|
||||||
|
'id_employee' => (int)$this->context->employee->id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$preview_url .= (strpos($preview_url, '?') === false ? '?' : '&').$params;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $preview_url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2430,11 +2430,58 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
if (empty($this->display))
|
if (empty($this->display))
|
||||||
$this->page_header_toolbar_btn['new_product'] = array(
|
$this->page_header_toolbar_btn['new_product'] = array(
|
||||||
'href' => self::$currentIndex.'&addproduct&token='.$this->token,
|
'href' => self::$currentIndex.'&addproduct&token='.$this->token,
|
||||||
'desc' => $this->l('Add new product'),
|
'desc' => $this->l('Add new product'),
|
||||||
'icon' => 'process-icon-new'
|
'icon' => 'process-icon-new'
|
||||||
);
|
);
|
||||||
|
if ($this->display == 'edit' || $this->display == 'add')
|
||||||
|
{
|
||||||
|
if (($product = $this->loadObject(true)))
|
||||||
|
{
|
||||||
|
// adding button for duplicate this product
|
||||||
|
if ($this->tabAccess['add'] && $this->display != 'add')
|
||||||
|
$this->page_header_toolbar_btn['duplicate'] = array(
|
||||||
|
'short' => 'Duplicate',
|
||||||
|
'desc' => $this->l('Duplicate'),
|
||||||
|
'confirm' => 1,
|
||||||
|
'js' => 'if (confirm(\''.$this->l('Also copy images').' ?\')) document.location = \''.$this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&duplicateproduct\'; else document.location = \''.$this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&duplicateproduct&noimage=1\';'
|
||||||
|
);
|
||||||
|
|
||||||
|
// adding button for preview this product
|
||||||
|
if ($url_preview = $this->getPreviewUrl($product))
|
||||||
|
$this->page_header_toolbar_btn['preview'] = array(
|
||||||
|
'short' => 'Preview',
|
||||||
|
'href' => $url_preview,
|
||||||
|
'desc' => $this->l('Preview'),
|
||||||
|
'target' => true,
|
||||||
|
'class' => 'previewUrl'
|
||||||
|
);
|
||||||
|
|
||||||
|
// adding button for preview this product statistics
|
||||||
|
if (file_exists(_PS_MODULE_DIR_.'statsproduct/statsproduct.php') && $this->display != 'add')
|
||||||
|
$this->page_header_toolbar_btn['stats'] = array(
|
||||||
|
'short' => 'Statistics',
|
||||||
|
'href' => $this->context->link->getAdminLink('AdminStats').'&module=statsproduct&id_product='.(int)$product->id,
|
||||||
|
'desc' => $this->l('Product sales'),
|
||||||
|
);
|
||||||
|
|
||||||
|
// adding button for delete this product
|
||||||
|
if ($this->tabAccess['delete'] && $this->display != 'add')
|
||||||
|
$this->page_header_toolbar_btn['delete'] = array(
|
||||||
|
'short' => 'Delete',
|
||||||
|
'href' => $this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&deleteproduct',
|
||||||
|
'desc' => $this->l('Delete this product'),
|
||||||
|
'confirm' => 1,
|
||||||
|
'js' => 'if (confirm(\''.$this->l('Delete product?').'\')){return true;}else{event.preventDefault();}'
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->page_header_toolbar_btn['save-and-stay'] = array(
|
||||||
|
'short' => 'SaveAndStay',
|
||||||
|
'href' => '#',
|
||||||
|
'desc' => $this->l('Save and stay'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
parent::initPageHeaderToolbar();
|
parent::initPageHeaderToolbar();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2443,76 +2490,25 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
parent::initToolbar();
|
parent::initToolbar();
|
||||||
if ($this->display == 'edit' || $this->display == 'add')
|
if ($this->display == 'edit' || $this->display == 'add')
|
||||||
{
|
{
|
||||||
if ($product = $this->loadObject(true))
|
$this->toolbar_btn['save'] = array(
|
||||||
{
|
'short' => 'Save',
|
||||||
if ($this->tabAccess['edit'])
|
'href' => '#',
|
||||||
{
|
'desc' => $this->l('Save'),
|
||||||
$this->toolbar_btn['save'] = array(
|
);
|
||||||
'short' => 'Save',
|
|
||||||
'href' => '#',
|
|
||||||
'desc' => $this->l('Save'),
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->toolbar_btn['save-and-stay'] = array(
|
$this->toolbar_btn['save-and-stay'] = array(
|
||||||
'short' => 'SaveAndStay',
|
'short' => 'SaveAndStay',
|
||||||
'href' => '#',
|
'href' => '#',
|
||||||
'desc' => $this->l('Save and stay'),
|
'desc' => $this->l('Save and stay'),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
if ((bool)$product->id)
|
// adding button for adding a new combination in Combination tab
|
||||||
{
|
$this->toolbar_btn['newCombination'] = array(
|
||||||
// adding button for duplicate this product
|
'short' => 'New combination',
|
||||||
if ($this->tabAccess['add'] && $this->display != 'add')
|
'desc' => $this->l('New combination'),
|
||||||
$this->toolbar_btn['duplicate'] = array(
|
'class' => 'toolbar-new'
|
||||||
'short' => 'Duplicate',
|
);
|
||||||
'desc' => $this->l('Duplicate'),
|
|
||||||
'confirm' => 1,
|
|
||||||
'js' => 'if (confirm(\''.$this->l('Also copy images').' ?\')) document.location = \''.$this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&duplicateproduct\'; else document.location = \''.$this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&duplicateproduct&noimage=1\';'
|
|
||||||
);
|
|
||||||
|
|
||||||
// adding button for preview this product
|
|
||||||
if ($url_preview = $this->getPreviewUrl($product))
|
|
||||||
$this->toolbar_btn['preview'] = array(
|
|
||||||
'short' => 'Preview',
|
|
||||||
'href' => $url_preview,
|
|
||||||
'desc' => $this->l('Preview'),
|
|
||||||
'target' => true,
|
|
||||||
'class' => 'previewUrl'
|
|
||||||
);
|
|
||||||
|
|
||||||
// adding button for preview this product statistics
|
|
||||||
if (file_exists(_PS_MODULE_DIR_.'statsproduct/statsproduct.php') && $this->display != 'add')
|
|
||||||
$this->toolbar_btn['stats'] = array(
|
|
||||||
'short' => 'Statistics',
|
|
||||||
'href' => $this->context->link->getAdminLink('AdminStats').'&module=statsproduct&id_product='.(int)$product->id,
|
|
||||||
'desc' => $this->l('Product sales'),
|
|
||||||
);
|
|
||||||
|
|
||||||
// adding button for adding a new combination in Combination tab
|
|
||||||
$this->toolbar_btn['newCombination'] = array(
|
|
||||||
'short' => 'New combination',
|
|
||||||
'desc' => $this->l('New combination'),
|
|
||||||
'class' => 'toolbar-new'
|
|
||||||
);
|
|
||||||
|
|
||||||
// adding button for delete this product
|
|
||||||
if ($this->tabAccess['delete'] && $this->display != 'add')
|
|
||||||
$this->toolbar_btn['delete'] = array(
|
|
||||||
'short' => 'Delete',
|
|
||||||
'href' => $this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&deleteproduct',
|
|
||||||
'desc' => $this->l('Delete this product'),
|
|
||||||
'confirm' => 1,
|
|
||||||
'js' => 'if (confirm(\''.$this->l('Delete product?').'\')){return true;}else{event.preventDefault();}'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$this->toolbar_btn['import'] = array(
|
|
||||||
'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type=products',
|
|
||||||
'desc' => $this->l('Import')
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->context->smarty->assign('toolbar_scroll', 1);
|
$this->context->smarty->assign('toolbar_scroll', 1);
|
||||||
$this->context->smarty->assign('show_toolbar', 1);
|
$this->context->smarty->assign('show_toolbar', 1);
|
||||||
|
|||||||
Reference in new issue
Block a user