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:
@@ -396,8 +396,10 @@ class DispatcherCore
|
||||
$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
|
||||
foreach (Language::getLanguages() as $lang)
|
||||
foreach ($languages as $lang)
|
||||
foreach ($this->default_routes as $id => $route)
|
||||
$this->addRoute(
|
||||
$id,
|
||||
@@ -441,7 +443,10 @@ class DispatcherCore
|
||||
// Load custom routes
|
||||
foreach ($this->default_routes as $route_id => $route_data)
|
||||
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(
|
||||
$route_id,
|
||||
$custom_route,
|
||||
@@ -451,6 +456,7 @@ class DispatcherCore
|
||||
isset($route_data['params']) ? $route_data['params'] : array(),
|
||||
$id_shop
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -593,7 +599,7 @@ class DispatcherCore
|
||||
$id_lang = (int)Context::getContext()->language->id;
|
||||
if ($id_shop === null)
|
||||
$id_shop = (int)Context::getContext()->shop->id;
|
||||
|
||||
|
||||
if (!isset($this->routes[$id_shop]))
|
||||
$this->loadRoutes($id_shop);
|
||||
|
||||
|
||||
@@ -682,6 +682,7 @@ class AdminControllerCore extends Controller
|
||||
'export_content' => $content
|
||||
)
|
||||
);
|
||||
|
||||
$this->layout = 'layout-export.tpl';
|
||||
}
|
||||
|
||||
@@ -1372,12 +1373,14 @@ class AdminControllerCore extends Controller
|
||||
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('page', $this->json ? Tools::jsonEncode($page) : $page);
|
||||
|
||||
if (!$this->ajax)
|
||||
$this->smartyOutputContent(array($header_tpl, $this->layout, $footer_tpl));
|
||||
else
|
||||
$this->smartyOutputContent($this->layout);
|
||||
$this->context->smarty->assign(array(
|
||||
'page' => $this->json ? Tools::jsonEncode($page) : $page,
|
||||
'header' => $this->context->smarty->fetch($header_tpl),
|
||||
'footer' => $this->context->smarty->fetch($footer_tpl)
|
||||
)
|
||||
);
|
||||
|
||||
$this->smartyOutputContent($this->layout);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -118,13 +118,20 @@ class HelperFormCore extends Helper
|
||||
$uploader->setUrl(isset($params['url'])?$params['url']:null);
|
||||
$uploader->setMultiple(isset($params['multiple'])?$params['multiple']: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->setSize(isset($params['size'])?$params['size']:null);
|
||||
$uploader->setFile(isset($params['file'])?$params['file']:null);
|
||||
$uploader->setTitle(isset($params['title'])?$params['title']:null);
|
||||
$uploader->setDeleteUrl(isset($params['delete_url'])?$params['delete_url']:null);
|
||||
|
||||
$params['file'] = $uploader->render();
|
||||
break;
|
||||
|
||||
@@ -104,16 +104,22 @@ class HelperOptionsCore extends Helper
|
||||
$uploader->setUrl(isset($field['url'])?$field['url']:null);
|
||||
$uploader->setMultiple(isset($field['multiple'])?$field['multiple']: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();
|
||||
}
|
||||
|
||||
|
||||
// Cast options values if specified
|
||||
if ($field['type'] == 'select' && isset($field['cast']))
|
||||
foreach ($field['list'] as $option_key => $option)
|
||||
|
||||
@@ -31,13 +31,10 @@ class HelperUploaderCore extends Uploader
|
||||
const DEFAULT_AJAX_TEMPLATE = 'ajax.tpl';
|
||||
|
||||
private $_context;
|
||||
private $_delete_url;
|
||||
private $_display_image;
|
||||
private $_id;
|
||||
private $_image;
|
||||
private $_images;
|
||||
private $_name;
|
||||
private $_multiple;
|
||||
private $_size;
|
||||
private $_file;
|
||||
protected $_template;
|
||||
private $_template_directory;
|
||||
@@ -60,23 +57,6 @@ class HelperUploaderCore extends Uploader
|
||||
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)
|
||||
{
|
||||
$this->_id = (string)$value;
|
||||
@@ -91,15 +71,18 @@ class HelperUploaderCore extends Uploader
|
||||
return $this->_id;
|
||||
}
|
||||
|
||||
public function setImage($value)
|
||||
public function setImages($value)
|
||||
{
|
||||
$this->_image = $value;
|
||||
$this->_images = $value;
|
||||
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)
|
||||
@@ -119,17 +102,6 @@ class HelperUploaderCore extends Uploader
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSize($value)
|
||||
{
|
||||
$this->_size = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSize()
|
||||
{
|
||||
return $this->_size;
|
||||
}
|
||||
|
||||
public function setTemplate($value)
|
||||
{
|
||||
$this->_template = $value;
|
||||
@@ -246,11 +218,6 @@ class HelperUploaderCore extends Uploader
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function displayImage()
|
||||
{
|
||||
return (isset($this->_display_image) && $this->_display_image);
|
||||
}
|
||||
|
||||
public function isMultiple()
|
||||
{
|
||||
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/ladda.js');
|
||||
|
||||
}
|
||||
|
||||
if ($this->useAjax())
|
||||
@@ -312,12 +278,9 @@ class HelperUploaderCore extends Uploader
|
||||
'name' => $this->getName(),
|
||||
'url' => $this->getUrl(),
|
||||
'multiple' => $this->isMultiple(),
|
||||
'display_image' => $this->displayImage(),
|
||||
'image' => $this->getImage(),
|
||||
'images' => $this->getImages(),
|
||||
'thumb' => $this->getThumb(),
|
||||
'file' => $this->getFile(),
|
||||
'size' => $this->getSize(),
|
||||
'delete_url' => $this->getDeleteUrl(),
|
||||
'title' => $this->getTitle()
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user