// delete ajax_send_mail_test.php

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16074 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-06-19 08:40:44 +00:00
parent d1a6dc44bb
commit a8faffe2ce
3 changed files with 46 additions and 70 deletions
+23 -20
View File
@@ -473,30 +473,33 @@ class AdminFeaturesControllerCore extends AdminController
public function ajaxProcessUpdatePositions()
{
$way = (int)Tools::getValue('way');
$id_feature = (int)Tools::getValue('id');
$positions = Tools::getValue('feature');
$new_positions = array();
foreach ($positions as $k => $v)
if (!empty($v))
$new_positions[] = $v;
foreach ($new_positions as $position => $value)
if ($this->tabAccess['edit'] === '1')
{
$pos = explode('_', $value);
$way = (int)Tools::getValue('way');
$id_feature = (int)Tools::getValue('id');
$positions = Tools::getValue('feature');
if (isset($pos[2]) && (int)$pos[2] === $id_feature)
$new_positions = array();
foreach ($positions as $k => $v)
if (!empty($v))
$new_positions[] = $v;
foreach ($new_positions as $position => $value)
{
if ($feature = new Feature((int)$pos[2]))
if (isset($position) && $feature->updatePosition($way, $position, $id_feature))
echo 'ok position '.(int)$position.' for feature '.(int)$pos[1].'\r\n';
else
echo '{"hasError" : true, "errors" : "Can not update feature '.(int)$id_feature.' to position '.(int)$position.' "}';
else
echo '{"hasError" : true, "errors" : "This feature ('.(int)$id_feature.') can t be loaded"}';
$pos = explode('_', $value);
break;
if (isset($pos[2]) && (int)$pos[2] === $id_feature)
{
if ($feature = new Feature((int)$pos[2]))
if (isset($position) && $feature->updatePosition($way, $position, $id_feature))
echo 'ok position '.(int)$position.' for feature '.(int)$pos[1].'\r\n';
else
echo '{"hasError" : true, "errors" : "Can not update feature '.(int)$id_feature.' to position '.(int)$position.' "}';
else
echo '{"hasError" : true, "errors" : "This feature ('.(int)$id_feature.') can t be loaded"}';
break;
}
}
}
}