// fix norm ;)

This commit is contained in:
aFolletete committed 2011-11-09 15:21:24 +00:00
1 parent ec8a1e0dec
commit 07fb0d50f8
1 file changed
+51 -51
+51 -51
View File
@@ -25,59 +25,59 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
define('_PS_ADMIN_DIR_', getcwd()); define('_PS_ADMIN_DIR_', getcwd());
include_once('../config/config.inc.php'); include_once('../config/config.inc.php');
include_once('tabs/AdminCatalog.php'); include_once('tabs/AdminCatalog.php');
include_once('tabs/AdminProducts.php'); include_once('tabs/AdminProducts.php');
include_once('init.php'); include_once('init.php');
if (Tools::getValue('token') != Tools::getAdminTokenLite('AdminCatalog')) if (Tools::getValue('token') != Tools::getAdminTokenLite('AdminCatalog'))
die(1); die(1);
$catalog = new AdminCatalog(); $catalog = new AdminCatalog();
$adminProducts = new AdminProducts(); $adminProducts = new AdminProducts();
echo ' <tr> echo ' <tr>
<td class="col-left"><label for="id_category_default" class="t">'.$adminProducts->getL('Default category:').'</label></td> <td class="col-left"><label for="id_category_default" class="t">'.$adminProducts->getL('Default category:').'</label></td>
<td> <td>
<select id="id_category_default" name="id_category_default" onchange="checkDefaultCategory(this.value);">'; <select id="id_category_default" name="id_category_default" onchange="checkDefaultCategory(this.value);">';
$categories = Category::getCategories(Context::getContext()->language->id, false); $categories = Category::getCategories(Context::getContext()->language->id, false);
Category::recurseCategory($categories, $categories[0][1], 1, (int)(Tools::getValue('id_category_default'))); Category::recurseCategory($categories, $categories[0][1], 1, (int)(Tools::getValue('id_category_default')));
echo ' </select> echo ' </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="col-left">'.$adminProducts->getL('Catalog:').'</td> <td class="col-left">'.$adminProducts->getL('Catalog:').'</td>
<td> <td>
<div style="overflow: auto; min-height: 300px; padding-top: 0.6em;" id="categoryList"> <div style="overflow: auto; min-height: 300px; padding-top: 0.6em;" id="categoryList">
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$(\'div#categoryList input.categoryBox\').click(function (){ $(\'div#categoryList input.categoryBox\').click(function (){
if ($(this).is(\':not(:checked)\') && $(\'div#categoryList input.id_category_default\').val() == $(this).val()) if ($(this).is(\':not(:checked)\') && $(\'div#categoryList input.id_category_default\').val() == $(this).val())
alert(\''.utf8_encode(html_entity_decode($adminProducts->getL('Consider changing the default category.'))).'\'); alert(\''.utf8_encode(html_entity_decode($adminProducts->getL('Consider changing the default category.'))).'\');
});
}); });
</script> });
<table cellspacing="0" cellpadding="0" class="table"> </script>
<tr> <table cellspacing="0" cellpadding="0" class="table">
<th><input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \'categoryBox[]\', this.checked)" /></th> <tr>
<th>'.$adminProducts->getL('ID').'</th> <th><input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \'categoryBox[]\', this.checked)" /></th>
<th style="width: 600px">'.$adminProducts->getL('Name').'</th> <th>'.$adminProducts->getL('ID').'</th>
</tr>'; <th style="width: 600px">'.$adminProducts->getL('Name').'</th>
$done = array(); </tr>';
$index = array(); $done = array();
$index = array();
$categoryBox = Tools::getValue('categoryBox'); $categoryBox = Tools::getValue('categoryBox');
if ($categoryBox != '') if ($categoryBox != '')
{ {
$categoryBox = @unserialize($categoryBox); $categoryBox = @unserialize($categoryBox);
foreach ($categoryBox AS $k => $row) foreach ($categoryBox AS $k => $row)
$index[] = $row; $index[] = $row;
} }
elseif ((int)Tools::getValue('id_product')) elseif ((int)Tools::getValue('id_product'))
$index = Product::getProductCategories((int)Tools::getValue('id_product')); $index = Product::getProductCategories((int)Tools::getValue('id_product'));
$adminProducts->recurseCategoryForInclude((int)(Tools::getValue('id_product')), $index, $categories, $categories[0][1], 1, (int)(Tools::getValue('id_category_default'))); $adminProducts->recurseCategoryForInclude((int)(Tools::getValue('id_product')), $index, $categories, $categories[0][1], 1, (int)(Tools::getValue('id_category_default')));
echo ' </table> echo ' </table>
<p style="padding:0px; margin:0px 0px 10px 0px;">'.$adminProducts->getL('Mark all checkbox(es) of categories in which product is to appear').'<sup> *</sup></p> <p style="padding:0px; margin:0px 0px 10px 0px;">'.$adminProducts->getL('Mark all checkbox(es) of categories in which product is to appear').'<sup> *</sup></p>
</div> </div>
</tr>'; </tr>';