// Context part 25

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7794 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-07-28 14:17:58 +00:00
parent a1a32714ab
commit d3b2ff2664
55 changed files with 432 additions and 535 deletions
+5 -8
View File
@@ -101,8 +101,7 @@ class AdminAttributeGenerator extends AdminTab
static private function displayAndReturnAttributeJs()
{
$context = Context::getContext();
$attributes = Attribute::getAttributes($context->language->id, true);
$attributes = Attribute::getAttributes($this->context->language->id, true);
$attributeJs = array();
foreach ($attributes AS $k => $attribute)
$attributeJs[$attribute['id_attribute_group']][$attribute['id_attribute']] = $attribute['name'];
@@ -175,9 +174,8 @@ class AdminAttributeGenerator extends AdminTab
private function displayGroupeTable($attributeJs, $attributesGroups)
{
$context = Context::getContext();
$combinationsGroups = $this->product->getAttributesGroups($context->language->id);
$combinationsGroups = $this->product->getAttributesGroups($this->context->language->id);
$attributes = array();
$impacts = self::getAttributesImpacts($this->product->id);
foreach ($combinationsGroups AS &$combination)
@@ -202,7 +200,7 @@ class AdminAttributeGenerator extends AdminTab
<thead>
<tr>
<th id="tab_h1" style="width: 150px">'.htmlspecialchars(stripslashes($attributeGroup['name'])).'</th>
<th id="tab_h2" style="width: 350px" colspan="2">'.$this->l('Price impact').' ('.$context->currency->sign.')'.'</th>
<th id="tab_h2" style="width: 350px" colspan="2">'.$this->l('Price impact').' ('.$this->context->currency->sign.')'.'</th>
<th style="width: 150px">'.$this->l('Weight impact').' ('.Configuration::get('PS_WEIGHT_UNIT').')'.'</th>
</tr>
</thead>
@@ -218,11 +216,10 @@ class AdminAttributeGenerator extends AdminTab
public function displayForm($isMainTab = true)
{
$context = Context::getContext();
parent::displayForm();
$jsAttributes = self::displayAndReturnAttributeJs();
$attributesGroups = AttributeGroup::getAttributesGroups($context->language->id);
$attributesGroups = AttributeGroup::getAttributesGroups($this->context->language->id);
$this->product = new Product((int)(Tools::getValue('id_product')));
// JS Init
@@ -272,7 +269,7 @@ class AdminAttributeGenerator extends AdminTab
<script type="text/javascript" src="../js/attributesBack.js"></script>
<form enctype="multipart/form-data" method="post" id="generator" action="'.self::$currentIndex.'&&id_product='.(int)(Tools::getValue('id_product')).'&id_category='.(int)(Tools::getValue('id_category')).'&attributegenerator&token='.Tools::getValue('token').'">
<fieldset style="margin-bottom: 35px;"><legend><img src="../img/admin/asterisk.gif" />'.$this->l('Attributes generator').'</legend>'.
$this->l('Add or modify attributes for product:').' <b>'.$this->product->name[$context->language->id].'</b>
$this->l('Add or modify attributes for product:').' <b>'.$this->product->name[$this->context->language->id].'</b>
<br /><br />
';
echo '