// Merge -> revision 9061
This commit is contained in:
@@ -38,4 +38,4 @@ if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab']))
|
||||
$_REQUEST['controller'] = strtolower($_REQUEST['tab']);
|
||||
|
||||
Dispatcher::getInstance()->setControllerDirectories(array(_PS_ADMIN_DIR_.'/tabs/', _PS_ADMIN_CONTROLLER_DIR_));
|
||||
Dispatcher::getInstance()->dispatch();
|
||||
Dispatcher::getInstance()->dispatch();
|
||||
@@ -559,9 +559,13 @@ if (Tools::isSubmit('helpAccess'))
|
||||
|
||||
if (Tools::isSubmit('getHookableList'))
|
||||
{
|
||||
if (!strlen(Tools::getValue('hooks_list')))
|
||||
die('{"hasError" : true, "errors" : ["Live Edit : no module on this page"]}');
|
||||
|
||||
$modules_list = explode(',', Tools::getValue('modules_list'));
|
||||
$hooks_list = explode(',', Tools::getValue('hooks_list'));
|
||||
$hookableList = array();
|
||||
|
||||
foreach ($modules_list as $module)
|
||||
{
|
||||
$module = trim($module);
|
||||
@@ -581,6 +585,7 @@ if (Tools::isSubmit('getHookableList'))
|
||||
}
|
||||
|
||||
}
|
||||
$hookableList['hasError'] = false;
|
||||
die(Tools::jsonEncode($hookableList));
|
||||
}
|
||||
|
||||
|
||||
@@ -275,11 +275,11 @@ class AdminCarriers extends AdminTab
|
||||
private function changeGroups($id_carrier, $delete = true)
|
||||
{
|
||||
if ($delete)
|
||||
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier='.(int)($id_carrier));
|
||||
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$id_carrier);
|
||||
$groups = Db::getInstance()->ExecuteS('SELECT id_group FROM `'._DB_PREFIX_.'group`');
|
||||
foreach ($groups as $group)
|
||||
if (Tools::getIsset('groupBox') && in_array($group['id_group'], Tools::getValue('groupBox')))
|
||||
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'carrier_group (id_group, id_carrier) VALUES('.(int)($group['id_group']).','.(int)($id_carrier).')');
|
||||
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'carrier_group (id_group, id_carrier) VALUES('.(int)$group['id_group'].','.(int)$id_carrier.')');
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
@@ -300,7 +300,7 @@ class AdminCarriers extends AdminTab
|
||||
$object = new $this->className($id);
|
||||
if (Validate::isLoadedObject($object))
|
||||
{
|
||||
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier='.(int)($id));
|
||||
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$id);
|
||||
$object->deleted = 1;
|
||||
$object->update();
|
||||
$objectNew = new $this->className();
|
||||
@@ -348,6 +348,18 @@ class AdminCarriers extends AdminTab
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ((isset($_GET['status'.$this->table]) OR isset($_GET['status'])) AND Tools::getValue($this->identifier))
|
||||
{
|
||||
if ($this->tabAccess['edit'] === '1')
|
||||
{
|
||||
if (Tools::getValue('id_carrier') == Configuration::get('PS_CARRIER_DEFAULT'))
|
||||
$this->_errors[] = Tools::displayError('You can\'t disable the default carrier, please change your default carrier first.');
|
||||
else
|
||||
parent::postProcess();
|
||||
}
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((Tools::isSubmit('submitDel'.$this->table) && in_array(Configuration::get('PS_CARRIER_DEFAULT'), Tools::getValue('carrierBox')))
|
||||
@@ -383,5 +395,4 @@ class AdminCarriers extends AdminTab
|
||||
$this->_list[$key]['name'] = Configuration::get('PS_SHOP_NAME');
|
||||
parent::displayListContent($token);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -47,7 +47,7 @@ class AdminCategories extends AdminTab
|
||||
'description' => array('title' => $this->l('Description'), 'width' => 500, 'maxlength' => 90, 'callback' => 'getDescriptionClean', 'orderby' => false),
|
||||
'position' => array('title' => $this->l('Position'), 'width' => 40,'filter_key' => 'position', 'align' => 'center', 'position' => 'position'),
|
||||
'active' => array('title' => $this->l('Displayed'), 'active' => 'status', 'align' => 'center', 'type' => 'bool', 'orderby' => false));
|
||||
|
||||
|
||||
$this->_category = AdminCatalog::getCurrentCategory();
|
||||
$this->_filter = 'AND `id_parent` = '.(int)($this->_category->id);
|
||||
$this->_select = 'position ';
|
||||
@@ -76,6 +76,7 @@ class AdminCategories extends AdminTab
|
||||
echo '<h3>'.(!$this->_listTotal ? ($this->l('There are no subcategories')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('subcategories') : $this->l('subcategory')))).' '.$this->l('in category').' "'.stripslashes($this->_category->getName()).'"</h3>';
|
||||
if ($this->tabAccess['add'] === '1')
|
||||
echo '<a href="'.__PS_BASE_URI__.substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__)).'?tab=AdminCatalog&add'.$this->table.'&id_parent='.$this->_category->id.'&token='.($token!=NULL ? $token : $this->token).'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add a new subcategory').'</a>';
|
||||
|
||||
echo '<div style="margin:10px;">';
|
||||
$this->displayList($token);
|
||||
echo '</div>';
|
||||
@@ -215,9 +216,9 @@ class AdminCategories extends AdminTab
|
||||
<div class="margin-form">';
|
||||
// Translations are not automatic for the moment ;)
|
||||
$trads = array(
|
||||
'Home' => $this->l('Home'),
|
||||
'selected' => $this->l('selected'),
|
||||
'Collapse All' => $this->l('Collapse All'),
|
||||
'Home' => $this->l('Home'),
|
||||
'selected' => $this->l('selected'),
|
||||
'Collapse All' => $this->l('Collapse All'),
|
||||
'Expand All' => $this->l('Expand All')
|
||||
);
|
||||
echo Helper::renderAdminCategorieTree($trads, array(isset($obj->id_parent) ? $obj->id_parent : Tools::getValue('id_parent', 1)), 'id_parent', true);
|
||||
@@ -237,7 +238,7 @@ class AdminCategories extends AdminTab
|
||||
echo ' <br /><input type="file" name="image" />
|
||||
<p>'.$this->l('Upload category logo from your computer').'</p>
|
||||
</div>
|
||||
<div class="clear"><br /></div>
|
||||
<div class="clear"><br /></div>
|
||||
<label>'.$this->l('Meta title:').' </label>
|
||||
<div class="margin-form translatable">';
|
||||
foreach ($this->_languages AS $language)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -34,18 +34,20 @@ class AdminLanguages extends AdminTab
|
||||
$this->lang = false;
|
||||
$this->edit = true;
|
||||
$this->delete = true;
|
||||
|
||||
|
||||
$this->fieldImageSettings = array(array('name' => 'flag', 'dir' => 'l'), array('name' => 'no-picture', 'dir' => 'p'));
|
||||
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'id_lang' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'flag' => array('title' => $this->l('Logo'), 'align' => 'center', 'image' => 'l', 'orderby' => false, 'search' => false),
|
||||
'name' => array('title' => $this->l('Name'), 'width' => 120),
|
||||
'iso_code' => array('title' => $this->l('ISO code'), 'width' => 70, 'align' => 'center'),
|
||||
'language_code' => array('title' => $this->l('Language code'), 'width' => 70, 'align' => 'center'),
|
||||
'date_format_lite' => array('title' => $this->l('Date format')),
|
||||
'date_format_full' => array('title' => $this->l('Date format (full)')),
|
||||
'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool'),
|
||||
);
|
||||
|
||||
|
||||
$this->optionsList = array(
|
||||
'general' => array(
|
||||
'title' => $this->l('Languages options'),
|
||||
@@ -57,7 +59,7 @@ class AdminLanguages extends AdminTab
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copy a no-product image
|
||||
*
|
||||
@@ -79,7 +81,7 @@ class AdminLanguages extends AdminTab
|
||||
if (!imageResize($tmpName, _PS_IMG_DIR_.'m/'.$language.'.jpg'))
|
||||
$this->_errors[] = Tools::displayError('An error occurred while copying no-picture image to your manufacturer folder');
|
||||
else
|
||||
{
|
||||
{
|
||||
$imagesTypes = ImageType::getImagesTypes('products');
|
||||
foreach ($imagesTypes AS $k => $imageType)
|
||||
{
|
||||
@@ -94,11 +96,11 @@ class AdminLanguages extends AdminTab
|
||||
unlink($tmpName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* deleteNoPictureImages will delete all default image created for the language id_language
|
||||
*
|
||||
* @param string $id_language
|
||||
*
|
||||
* @param string $id_language
|
||||
* @return boolean true if no error
|
||||
*/
|
||||
private function deleteNoPictureImages($id_language)
|
||||
@@ -133,7 +135,7 @@ class AdminLanguages extends AdminTab
|
||||
{
|
||||
if (isset($_GET['delete'.$this->table]))
|
||||
{
|
||||
if ($this->tabAccess['delete'] === '1')
|
||||
if ($this->tabAccess['delete'] === '1')
|
||||
{
|
||||
if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings))
|
||||
{
|
||||
@@ -242,26 +244,26 @@ class AdminLanguages extends AdminTab
|
||||
else
|
||||
return parent::postProcess();
|
||||
}
|
||||
|
||||
|
||||
public function beforeUpdateOptions()
|
||||
{
|
||||
$lang = new Language((int)Tools::getValue('PS_LANG_DEFAULT'));
|
||||
if (!$lang->active)
|
||||
$this->_errors[] = Tools::displayError('You cannot set this language as default language because it\'s disabled');
|
||||
}
|
||||
|
||||
|
||||
public function displayList()
|
||||
{
|
||||
$this->displayWarning($this->l('When you delete a language, all related translations in the database will be deleted.'));
|
||||
parent::displayList();
|
||||
$languages = Language::getLanguages(false);
|
||||
}
|
||||
|
||||
|
||||
public function displayListContent($token=NULL)
|
||||
{
|
||||
$irow = 0;
|
||||
if ($this->_list)
|
||||
|
||||
|
||||
foreach ($this->_list AS $tr)
|
||||
{
|
||||
$id = $tr[$this->identifier];
|
||||
@@ -314,11 +316,11 @@ class AdminLanguages extends AdminTab
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function displayForm($isMainTab = true)
|
||||
{
|
||||
parent::displayForm();
|
||||
|
||||
|
||||
if (!($obj = $this->loadObject(true)))
|
||||
return;
|
||||
|
||||
@@ -337,18 +339,28 @@ class AdminLanguages extends AdminTab
|
||||
<input type="hidden" value="'._PS_VERSION_.'" name="ps_version" id="ps_version" />
|
||||
<label>'.$this->l('Name:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="8" maxlength="32" name="name" value="'.htmlentities($this->getFieldValue($obj, 'name'), ENT_COMPAT, 'UTF-8').'" /> <sup>*</sup>
|
||||
<input type="text" size="8" maxlength="32" name="name" value="'.Tools::htmlentitiesUTF8($this->getFieldValue($obj, 'name')).'" /> <sup>*</sup>
|
||||
</div>
|
||||
<label>'.$this->l('ISO code:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="4" maxlength="2" name="iso_code" id="iso_code" value="'.htmlentities($this->getFieldValue($obj, 'iso_code'), ENT_COMPAT, 'UTF-8').'" onKeyUp="checkLangPack();" /> <sup>*</sup>
|
||||
<input type="text" size="4" maxlength="2" name="iso_code" id="iso_code" value="'.Tools::htmlentitiesUTF8($this->getFieldValue($obj, 'iso_code')).'" onKeyUp="checkLangPack();" /> <sup>*</sup>
|
||||
<p>'.$this->l('2-letter ISO code (e.g., fr, en, de)').'</p>
|
||||
</div>
|
||||
<label>'.$this->l('Language code:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="10" maxlength="5" name="language_code" id="language_code" value="'.htmlentities($this->getFieldValue($obj, 'language_code'), ENT_COMPAT, 'UTF-8').'"/> <sup>*</sup>
|
||||
<input type="text" size="10" maxlength="5" name="language_code" id="language_code" value="'.Tools::htmlentitiesUTF8($this->getFieldValue($obj, 'language_code')).'"/> <sup>*</sup>
|
||||
<p>'.$this->l('Full language code (e.g., en-us, pt-br)').'</p>
|
||||
</div>
|
||||
<label>'.$this->l('Date format:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="15" name="date_format_lite" id="date_format_lite" value="'.Tools::htmlentitiesUTF8($this->getFieldValue($obj, 'date_format_lite')).'"/> <sup>*</sup>
|
||||
<p>'.$this->l('Date format, lite (e.g., Y-m-d, d/m/Y)').'</p>
|
||||
</div>
|
||||
<label>'.$this->l('Date format (full):').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="25" name="date_format_full" id="date_format_full" value="'.Tools::htmlentitiesUTF8($this->getFieldValue($obj, 'date_format_full')).'"/> <sup>*</sup>
|
||||
<p>'.$this->l('Date format, full (e.g., Y-m-d H:i:s, d/m/Y H:i)').'</p>
|
||||
</div>
|
||||
<label>'.$this->l('Flag:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="file" name="flag" /> <sup>*</sup>
|
||||
@@ -389,7 +401,7 @@ class AdminLanguages extends AdminTab
|
||||
<div class="small"><sup>*</sup> '.$this->l('Required field').'</div>
|
||||
</fieldset>
|
||||
</form>';
|
||||
|
||||
|
||||
if ($obj->id AND !$obj->checkFiles())
|
||||
{
|
||||
echo '
|
||||
@@ -420,7 +432,7 @@ class AdminLanguages extends AdminTab
|
||||
</fieldset>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function displayFilesList($files)
|
||||
{
|
||||
foreach ($files as $key => $file)
|
||||
|
||||
@@ -3340,15 +3340,15 @@ class AdminProducts extends AdminTab
|
||||
<td style="padding-bottom:5px;">
|
||||
<div id="divAccessories">';
|
||||
foreach ($accessories as $accessory)
|
||||
echo $accessory['name'].(!empty($accessory['reference']) ? ' ('.$accessory['reference'].')' : '').' <span onclick="delAccessory('.$accessory['id_product'].');" style="cursor: pointer;"><img src="../img/admin/delete.gif" class="middle" alt="" /></span><br />';
|
||||
echo htmlentities($accessory['name'], ENT_COMPAT, 'UTF-8').(!empty($accessory['reference']) ? ' ('.$accessory['reference'].')' : '').' <span onclick="delAccessory('.$accessory['id_product'].');" style="cursor: pointer;"><img src="../img/admin/delete.gif" class="middle" alt="" /></span><br />';
|
||||
echo '</div>
|
||||
<input type="hidden" name="inputAccessories" id="inputAccessories" value="';
|
||||
foreach ($accessories as $accessory)
|
||||
echo $accessory['id_product'].'-';
|
||||
echo (int)$accessory['id_product'].'-';
|
||||
echo '" />
|
||||
<input type="hidden" name="nameAccessories" id="nameAccessories" value="';
|
||||
foreach ($accessories as $accessory)
|
||||
echo $accessory['name'].'¤';
|
||||
echo htmlentities($accessory['name'], ENT_COMPAT, 'UTF-8').'¤';
|
||||
|
||||
echo '" />
|
||||
<script type="text/javascript">
|
||||
|
||||
Reference in New Issue
Block a user