[*] BO : Addons modules are now downloaded and installed at the same time (when you click on install button)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11567 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
fSerny
2011-12-22 09:40:29 +00:00
parent cc7584e340
commit ec93df4efa
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -66,7 +66,7 @@
<p class="desc">{l s='Description'} : {$module->description}</p>
{if isset($module->message)}<div class="conf">{$module->message}</div>{/if}
<div class="row-actions-module">
{$module->optionsHtml}
{if !isset($module->not_on_disk)}{$module->optionsHtml}{else}&nbsp;{/if}
</div>
</div>
</td>
+1
View File
@@ -1033,6 +1033,7 @@ abstract class ModuleCore
$item->limited_countries = array();
$item->is_configurable = 0;
$item->need_instance = 0;
$item->not_on_disk = 1;
$item->available_on_addons = 1;
$item->active = 0;
if (isset($modaddons->img))
+3 -4
View File
@@ -263,7 +263,7 @@ class AdminModulesControllerCore extends AdminController
return $url;
}
private function extractArchive($file)
private function extractArchive($file, $redirect = true)
{
$success = false;
if (substr($file, -4) == '.zip')
@@ -283,7 +283,7 @@ class AdminModulesControllerCore extends AdminController
}
@unlink($file);
if ($success)
if ($success && $redirect)
Tools::redirectAdmin(self::$currentIndex.'&conf=8'.'&token='.$this->token);
}
@@ -506,7 +506,7 @@ class AdminModulesControllerCore extends AdminController
foreach ($xml->module as $modaddons)
if ($name == $modaddons->name && isset($modaddons->id) && ($this->logged_on_addons || $f['loggedOnAddons'] == 0))
if (@copy($this->addons_url.'module/'.pSQL($modaddons->id).'/'.pSQL(trim($this->context->cookie->username_addons)).'/'.pSQL(trim($this->context->cookie->password_addons)), '../modules/'.$modaddons->name.'.zip'))
$this->extractArchive('../modules/'.$modaddons->name.'.zip');
$this->extractArchive('../modules/'.$modaddons->name.'.zip', false);
}
}
@@ -579,7 +579,6 @@ class AdminModulesControllerCore extends AdminController
}
// Display module configuration
// TODO : Make something cleaner
$this->context->smarty->assign('module_content', $toolbar.'<div class="clear">&nbsp;</div>'.$echo.'<div class="clear">&nbsp;</div>'.$toolbar);
}
elseif($echo === true)