Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -24,7 +24,20 @@
|
||||
*}
|
||||
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="input"}
|
||||
{if $input.name == "link_rewrite"}
|
||||
<script type="text/javascript">
|
||||
{if isset($PS_ALLOW_ACCENTED_CHARS_URL) && $PS_ALLOW_ACCENTED_CHARS_URL}
|
||||
var PS_ALLOW_ACCENTED_CHARS_URL = 1;
|
||||
{else}
|
||||
var PS_ALLOW_ACCENTED_CHARS_URL = 0;
|
||||
{/if}
|
||||
</script>
|
||||
{$smarty.block.parent}
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{/block}
|
||||
{block name="script"}
|
||||
$(document).ready(function() {
|
||||
if (btn_submit.length > 0)
|
||||
|
||||
@@ -24,7 +24,20 @@
|
||||
*}
|
||||
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="input"}
|
||||
{if $input.name == "link_rewrite"}
|
||||
<script type="text/javascript">
|
||||
{if isset($PS_ALLOW_ACCENTED_CHARS_URL) && $PS_ALLOW_ACCENTED_CHARS_URL}
|
||||
var PS_ALLOW_ACCENTED_CHARS_URL = 1;
|
||||
{else}
|
||||
var PS_ALLOW_ACCENTED_CHARS_URL = 0;
|
||||
{/if}
|
||||
</script>
|
||||
{$smarty.block.parent}
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{/block}
|
||||
{block name="input"}
|
||||
{if $input.type == 'select_category'}
|
||||
<select name="id_parent">
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2012 PrestaShop SA␍
|
||||
* @copyright 2007-2012 PrestaShop SA
|
||||
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
@@ -34,7 +35,7 @@ class PrestaShopExceptionCore extends Exception
|
||||
*/
|
||||
public function displayMessage()
|
||||
{
|
||||
if (_PS_MODE_DEV_)
|
||||
if (_PS_MODE_DEV_ || defined('_PS_ADMIN_DIR_'))
|
||||
{
|
||||
// Display error message
|
||||
echo '<style>
|
||||
@@ -140,4 +141,4 @@ class PrestaShopExceptionCore extends Exception
|
||||
}
|
||||
echo '</pre>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ class AdminCmsCategoriesControllerCore extends AdminController
|
||||
'class' => 'button'
|
||||
)
|
||||
);
|
||||
|
||||
$this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
|
||||
return parent::renderForm();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,9 +180,9 @@ class AdminCmsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$this->tpl_form_vars = array(
|
||||
'active' => $this->object->active
|
||||
'active' => $this->object->active,
|
||||
'PS_ALLOW_ACCENTED_CHARS_URL', (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL')
|
||||
);
|
||||
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
|
||||
@@ -340,6 +340,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
|
||||
protected function extractArchive($file, $redirect = true)
|
||||
{
|
||||
$pathinfo = pathinfo($file);
|
||||
$success = false;
|
||||
if (substr($file, -4) == '.zip')
|
||||
{
|
||||
@@ -356,9 +357,13 @@ class AdminModulesControllerCore extends AdminController
|
||||
else
|
||||
$this->errors[] = Tools::displayError('Error while extracting module (file may be corrupted).');
|
||||
}
|
||||
//check if it's a real module
|
||||
if (!Module::getInstanceByName($pathinfo['filename']))
|
||||
$this->errors[] = Tools::displayError('The Zip file you uploaded is not a module');
|
||||
|
||||
|
||||
@unlink($file);
|
||||
if ($success && $redirect)
|
||||
if (!count($this->errors) && $success && $redirect)
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=8'.'&token='.$this->token);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@ function str2url(str,encoding,ucfirst)
|
||||
|
||||
function copy2friendlyURL()
|
||||
{
|
||||
if (typeof(id_product) == 'undefined')
|
||||
id_product = false;
|
||||
|
||||
if (!$('#link_rewrite_' + id_language).val().length || !id_product)//check if user didn't type anything in rewrite field, to prevent overwriting
|
||||
{
|
||||
$('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8').replace('%', ''));
|
||||
|
||||
Reference in New Issue
Block a user