Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -321,6 +321,46 @@
|
||||
catch(e){}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.toggle_favorite').live('click', function(event)
|
||||
{
|
||||
var el = $(this);
|
||||
var value_pref = el.data('value');
|
||||
var module_pref = el.data('module');
|
||||
var action_pref = 'f';
|
||||
try
|
||||
{
|
||||
resAjax = $.ajax({
|
||||
type:"POST",
|
||||
url : ajaxCurrentIndex,
|
||||
async: true,
|
||||
data : {
|
||||
ajax : "1",
|
||||
token : token,
|
||||
controller : "AdminModules",
|
||||
action : "saveFavoritePreferences",
|
||||
action_pref : action_pref,
|
||||
module_pref : module_pref,
|
||||
value_pref : value_pref
|
||||
},
|
||||
success : function(data)
|
||||
{
|
||||
// res.status = cache or refresh
|
||||
if (data == 'OK')
|
||||
{
|
||||
el.parent('div').find('.toggle_favorite').toggle();
|
||||
}
|
||||
|
||||
},
|
||||
error: function(res,textStatus,jqXHR)
|
||||
{
|
||||
//jAlert("TECHNICAL ERROR"+res);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(e){}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
{/literal}
|
||||
|
||||
@@ -79,7 +79,18 @@
|
||||
<p class="desc">{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else} {/if}</p>
|
||||
{if isset($module->message)}<div class="conf">{$module->message}</div>{/if}
|
||||
<div class="row-actions-module">
|
||||
{if !isset($module->not_on_disk)}{$module->optionsHtml}{else} {/if}
|
||||
{if !isset($module->not_on_disk)}
|
||||
{$module->optionsHtml}
|
||||
{if isset($module->preferences) && $module->preferences['favorite'] == 1}
|
||||
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">{l s='Remove from Favorites'}</a>
|
||||
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#" style="display: none;">{l s='Mark as Favorite'}</a>
|
||||
{else}
|
||||
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">{l s='Remove from Favorites'}</a>
|
||||
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#">{l s='Mark as Favorite'}</a>
|
||||
{/if}
|
||||
{else}
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
+6
-6
@@ -2347,16 +2347,16 @@ exit;
|
||||
$addons_url = 'api.addons.prestashop.com';
|
||||
$postData = '';
|
||||
$postDataArray = array(
|
||||
'version' => _PS_VERSION_,
|
||||
'iso_lang' => strtolower(Context::getContext()->language->iso_code),
|
||||
'iso_code' => strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
|
||||
'shop_url' => urlencode(Tools::getShopDomain()),
|
||||
'mail' => urlencode(Configuration::get('PS_SHOP_EMAIL'))
|
||||
'version' => isset($params['version']) ? $params['version'] : _PS_VERSION_,
|
||||
'iso_lang' => Tools::strtolower(isset($params['iso_lang']) ? $params['iso_lang'] : Context::getContext()->language->iso_code),
|
||||
'iso_code' => Tools::strtolower(isset($params['iso_country']) ? $params['iso_country'] : Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
|
||||
'shop_url' => urlencode(isset($params['shop_url']) ? $params['shop_url'] : Tools::getShopDomain()),
|
||||
'mail' => urlencode(isset($params['email']) ? $params['email'] : Configuration::get('email'))
|
||||
);
|
||||
foreach ($postDataArray as $postDataKey => $postDataValue)
|
||||
$postData .= '&'.$postDataKey.'='.$postDataValue;
|
||||
$postData = ltrim($postData, '&');
|
||||
|
||||
|
||||
// Config for each request
|
||||
if ($request == 'native')
|
||||
{
|
||||
|
||||
@@ -331,8 +331,6 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
*/
|
||||
public function display()
|
||||
{
|
||||
$this->initializeContext();
|
||||
|
||||
// The installer SHOULD take less than 32M, but may take up to 35/36M sometimes. So 42M is a good value :)
|
||||
$low_memory = Tools::getMemoryLimit() < Tools::getOctets('42M');
|
||||
|
||||
@@ -361,8 +359,15 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
$this->process_steps[] = $install_modules;
|
||||
|
||||
$install_modules = array('key' => 'installModulesAddons', 'lang' => $this->l('Install modules Addons'));
|
||||
|
||||
$params = array('iso_lang' => $this->language->getLanguageIso(),
|
||||
'iso_country' => $this->session->shop_country,
|
||||
'email' => $this->session->admin_email,
|
||||
'shop_url' => Tools::getHttpHost(),
|
||||
'version' => _PS_INSTALL_VERSION_);
|
||||
|
||||
if ($low_memory)
|
||||
foreach ($this->model_install->getAddonsModulesList() as $module)
|
||||
foreach ($this->model_install->getAddonsModulesList($params) as $module)
|
||||
$install_modules['subtasks'][] = array('module' => (string)$module['name'], 'id_module' => (string)$module['id_module']);
|
||||
$this->process_steps[] = $install_modules;
|
||||
|
||||
|
||||
@@ -587,10 +587,10 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
return $modules;
|
||||
}
|
||||
|
||||
public function getAddonsModulesList()
|
||||
public function getAddonsModulesList($params = array())
|
||||
{
|
||||
$addons_modules = array();
|
||||
$content = Tools::addonsRequest('install-modules');
|
||||
$content = Tools::addonsRequest('install-modules', $params);
|
||||
$xml = @simplexml_load_string($content, null, LIBXML_NOCDATA);
|
||||
|
||||
if ($xml !== false and isset($xml->module))
|
||||
|
||||
Reference in New Issue
Block a user