// Fixed modules list icons retrieval

This commit is contained in:
Damien Metzger committed 2013-03-08 11:53:25 +01:00
1 parent c7da54fe0e
commit 7ec0f0e391
8 files changed
+27 -108

No files matched your search

@@ -23,7 +23,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
{if isset($module_content)} {if isset($module_content)}
{$module_content} {$module_content}
{else} {else}
@@ -25,36 +25,26 @@
{if $add_permission eq '1'} {if $add_permission eq '1'}
{if isset($logged_on_addons)} {if isset($logged_on_addons)}
<!--start addons login--> <!--start addons login-->
<div class="filter-module" id="addons_login_div"> <div class="filter-module" id="addons_login_div">
<p>{l s='You are logged into PrestaShop Addons.'}</p> <p>{l s='You are logged into PrestaShop Addons.'}</p>
<div style="float:right"> <div style="float:right">
<label><img src="themes/default/img/module-profile.png" /> {l s='Welcome'} {$username_addons}</label> <label><img src="themes/default/img/module-profile.png" /> {l s='Welcome'} {$username_addons}</label>
<label>|</label> <label>|</label>
<label><a href="#" id="addons_logout_button"><img src="themes/default/img/module-logout.png" /> {l s='Log out from PrestaShop Addons.'}</a></label> <label><a href="#" id="addons_logout_button"><img src="themes/default/img/module-logout.png" /> {l s='Log out from PrestaShop Addons.'}</a></label>
</div> </div>
</div> </div>
<!--end addons login--> <!--end addons login-->
{else} {else}
{if $check_url_fopen eq 'ko' OR $check_openssl eq 'ko'} {if $check_url_fopen eq 'ko' OR $check_openssl eq 'ko'}
<div class="warn"> <div class="warn">
<b>{l s='If you want to be able to fully use the AdminModules panel and have free modules available, you should enable the following configuration on your server:'}</b><br /> <b>{l s='If you want to be able to fully use the AdminModules panel and have free modules available, you should enable the following configuration on your server:'}</b><br />
{if $check_url_fopen eq 'ko'}- {l s='Enable allow_url_fopen'}<br />{/if} {if $check_url_fopen eq 'ko'}- {l s='Enable allow_url_fopen'}<br />{/if}
{if $check_openssl eq 'ko'}- {l s='Enable php openSSL extension'}<br />{/if} {if $check_openssl eq 'ko'}- {l s='Enable php openSSL extension'}<br />{/if}
</div> </div>
{else} {else}
<!--start addons login--> <!--start addons login-->
<div class="filter-module" id="addons_login_div"> <div class="filter-module" id="addons_login_div">
<p>{l s='Do you have a %s account?' sprintf='<a href="http://addons.prestashop.com/">PrestaShop Addons</a>'}</p> <p>{l s='Do you have a %s account?' sprintf='<a href="http://addons.prestashop.com/">PrestaShop Addons</a>'}</p>
<form id="addons_login_form" method="post"> <form id="addons_login_form" method="post">
<label>{l s='Login to Addons'} :</label> <input type="text" value="" id="username_addons" autocomplete="off" class="ac_input"> <label>{l s='Login to Addons'} :</label> <input type="text" value="" id="username_addons" autocomplete="off" class="ac_input">
@@ -62,25 +52,21 @@
<input type="submit" class="button" id="addons_login_button" value="{l s='Log in'}"> <input type="submit" class="button" id="addons_login_button" value="{l s='Log in'}">
<br /><span id="addons_loading" style="color:red"></span> <br /><span id="addons_loading" style="color:red"></span>
</form> </form>
</div> </div>
<!--end addons login--> <!--end addons login-->
{/if} {/if}
{/if} {/if}
<div class="clear">&nbsp;</div>
{/if} {/if}
<!--start filter module--> <!--start filter module-->
<style>.ac_results { border:1px solid #C2C4D9; }</style> <style>.ac_results { border:1px solid #C2C4D9; }</style>
<div class="filter-module"> <div class="filter-module">
<form id="filternameForm" method="post"> <form id="filternameForm" method="post">
<input type="text" value="" name="filtername" autocomplete="off" class="ac_input"> <input type="text" value="" name="filtername" autocomplete="off" class="ac_input">
<input type="submit" class="button" value="{l s='Search:'}"> <input type="submit" class="button" value="{l s='Search:'}">
</form> </form>
<form method="post"> <form method="post">
<div class="select-filter"> <div class="select-filter">
<label class="search-filter">{l s='Sort by'}:</label> <label class="search-filter">{l s='Sort by'}:</label>
@@ -114,15 +100,11 @@
<option value="0" >{l s='All countries'}</option> <option value="0" >{l s='All countries'}</option>
<option value="1" {if $showCountryModules eq 1}selected="selected"{/if}>{l s='Current country:'} {$nameCountryDefault}</option> <option value="1" {if $showCountryModules eq 1}selected="selected"{/if}>{l s='Current country:'} {$nameCountryDefault}</option>
</select> </select>
</div> </div>
<div class="button-filter"> <div class="button-filter">
<input type="submit" value="{l s='Reset'}" name="resetFilterModules" class="button" /> <input type="submit" value="{l s='Reset'}" name="resetFilterModules" class="button" />
<input type="submit" value="{l s='Filter'}" id="filterModulesButton" name="filterModules" class="button" /> <input type="submit" value="{l s='Filter'}" id="filterModulesButton" name="filterModules" class="button" />
</div> </div>
</form> </form>
</div>
</div> <!--end filter module-->
<!--end filter module-->
@@ -23,9 +23,8 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<div class="toolbar-placeholder"> <div class="toolbar-placeholder">
<div class="toolbarBox toolbarHead"> <div class="toolbarBox toolbarHead">
<ul class="cc_button"> <ul class="cc_button">
{if $add_permission eq '1'} {if $add_permission eq '1'}
<li> <li>
@@ -36,14 +35,11 @@
</li> </li>
{/if} {/if}
</ul> </ul>
<div class="pageTitle"> <div class="pageTitle">
<h3><span id="current_obj" style="font-weight: normal;"><span class="breadcrumb item-0">Module</span> : <span class="breadcrumb item-1">{l s='List of modules'}</span></span></h3> <h3><span id="current_obj" style="font-weight: normal;"><span class="breadcrumb item-0">Module</span> : <span class="breadcrumb item-1">{l s='List of modules'}</span></span></h3>
</div> </div>
</div>
</div> </div>
</div>
{if $add_permission eq '1'} {if $add_permission eq '1'}
<div id="module_install" style="width:500px;margin-top:5px;{if !isset($smarty.post.downloadflag)}display: none;{/if}"> <div id="module_install" style="width:500px;margin-top:5px;{if !isset($smarty.post.downloadflag)}display: none;{/if}">
@@ -121,17 +121,11 @@
controller : "AdminModules", controller : "AdminModules",
action : "reloadModulesList" action : "reloadModulesList"
}, },
beforeSend: function(xhr) beforeSend: function(xhr){
{
$('#moduleContainer').html('<img src="../img/loader.gif" alt="" border="0" />'); $('#moduleContainer').html('<img src="../img/loader.gif" alt="" border="0" />');
}, },
success : function(data) success: function(data){
{
$('#moduleContainer').html(data); $('#moduleContainer').html(data);
},
error: function(res,textStatus,jqXHR)
{
//jAlert("TECHNICAL ERROR"+res);
} }
}); });
} }
@@ -144,24 +138,18 @@
{ {
resAjax = $.ajax({ resAjax = $.ajax({
type:"POST", type:"POST",
url : ajaxCurrentIndex, url: ajaxCurrentIndex,
async: true, async: true,
data : { data: {
ajaxMode : "1", ajaxMode : "1",
ajax : "1", ajax : "1",
token : token, token : token,
controller : "AdminModules", controller : "AdminModules",
action : "refreshModuleList" action : "refreshModuleList"
}, },
success : function(data) success: function(data){
{
// res.status = cache or refresh
if (data == '{"status":"refresh"}') if (data == '{"status":"refresh"}')
window.location.href = window.location.href; window.location.href = window.location.href;
},
error: function(res,textStatus,jqXHR)
{
//jAlert("TECHNICAL ERROR"+res);
} }
}); });
} }
@@ -186,13 +174,10 @@
username_addons : username_addons, username_addons : username_addons,
password_addons : password_addons password_addons : password_addons
}, },
beforeSend: function(xhr) beforeSend: function(xhr){
{
$('#addons_loading').html('<img src="../img/loader.gif" alt="" border="0" />'); $('#addons_loading').html('<img src="../img/loader.gif" alt="" border="0" />');
}, },
success : function(data) success : function(data){
{
// res.status = cache or refresh
if (data == 'OK') if (data == 'OK')
{ {
$('#addons_loading').html(''); $('#addons_loading').html('');
@@ -201,10 +186,6 @@
} }
else else
$('#addons_loading').html(errorLogin); $('#addons_loading').html(errorLogin);
},
error: function(res,textStatus,jqXHR)
{
//jAlert("TECHNICAL ERROR"+res);
} }
}); });
} }
@@ -227,13 +208,10 @@
controller : "AdminModules", controller : "AdminModules",
action : "logOutAddonsWebservices" action : "logOutAddonsWebservices"
}, },
beforeSend: function(xhr) beforeSend: function(xhr){
{
$('#addons_loading').html('<img src="../img/loader.gif" alt="" border="0" />'); $('#addons_loading').html('<img src="../img/loader.gif" alt="" border="0" />');
}, },
success : function(data) success: function(data) {
{
// res.status = cache or refresh
if (data == 'OK') if (data == 'OK')
{ {
$('#addons_loading').html(''); $('#addons_loading').html('');
@@ -242,10 +220,6 @@
} }
else else
$('#addons_loading').html(errorLogin); $('#addons_loading').html(errorLogin);
},
error: function(res,textStatus,jqXHR)
{
//jAlert("TECHNICAL ERROR"+res);
} }
}); });
} }
@@ -277,15 +251,9 @@
country_module_value : country_module_value, country_module_value : country_module_value,
filterModules : 'Filter' filterModules : 'Filter'
}, },
success : function(data) success : function(data){
{
// res.status = cache or refresh
if (data == 'OK') if (data == 'OK')
window.location.href = currentIndexWithToken; window.location.href = currentIndexWithToken;
},
error: function(res,textStatus,jqXHR)
{
//jAlert("TECHNICAL ERROR"+res);
} }
}); });
} }
@@ -297,7 +265,6 @@
$('#module_status_filter').change(function() { setFilter(); }); $('#module_status_filter').change(function() { setFilter(); });
$('#country_module_value_filter').change(function() { setFilter(); }); $('#country_module_value_filter').change(function() { setFilter(); });
$('.moduleTabPreferencesChoise').change(function() $('.moduleTabPreferencesChoise').change(function()
{ {
var value_pref = $(this).val(); var value_pref = $(this).val();
@@ -316,17 +283,10 @@
module_pref : module_pref, module_pref : module_pref,
value_pref : value_pref value_pref : value_pref
}, },
success : function(data) success : function(data){
{
// res.status = cache or refresh
if (data == 'OK') if (data == 'OK')
$('#r_' + module_pref).html(confirmPreferencesSaved); $('#r_' + module_pref).html(confirmPreferencesSaved);
},
error: function(res,textStatus,jqXHR)
{
//jAlert("TECHNICAL ERROR"+res);
} }
}); });
}); });
@@ -352,15 +312,9 @@
module_pref : module_pref, module_pref : module_pref,
value_pref : value_pref value_pref : value_pref
}, },
success : function(data) success : function(data){
{
// res.status = cache or refresh
if (data == 'OK') if (data == 'OK')
$('#r_' + module_pref).html(confirmPreferencesSaved); $('#r_' + module_pref).html(confirmPreferencesSaved);
},
error: function(res,textStatus,jqXHR)
{
//jAlert("TECHNICAL ERROR"+res);
} }
}); });
} }
@@ -23,14 +23,8 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
{if count($modules)} {if count($modules)}
<table cellspacing="0" cellpadding="0" style="width: 100%; margin-bottom:10px;" class="table" id=""> <table cellspacing="0" cellpadding="0" style="width: 100%; margin-bottom:10px;" class="table" id="">
<col width="20px">
<col width="40px">
<col>
<col width="150px">
</colgroup>
<thead> <thead>
<tr class="nodrag nodrop"> <tr class="nodrag nodrop">
<th class="center"> <th class="center">
@@ -116,7 +110,6 @@
<input type="button" class="button big" value="{l s='Install the selection'}" onclick="modules_management('install')"/> <input type="button" class="button big" value="{l s='Install the selection'}" onclick="modules_management('install')"/>
<input type="button" class="button big" value="{l s='Uninstall the selection'}" onclick="modules_management('uninstall')" /> <input type="button" class="button big" value="{l s='Uninstall the selection'}" onclick="modules_management('uninstall')" />
</div> </div>
{else} {else}
<div style="margin-top: 12px;color: #585A69;font-size: 16px;"><p align="center">{l s='No modules available in this section.'}</p></div> <div style="margin-top: 12px;color: #585A69;font-size: 16px;"><p align="center">{l s='No modules available in this section.'}</p></div>
{/if} {/if}
@@ -24,14 +24,12 @@
*} *}
<div id="productBox"> <div id="productBox">
{include file='controllers/modules/header.tpl'} {include file='controllers/modules/header.tpl'}
{include file='controllers/modules/filters.tpl'} {include file='controllers/modules/filters.tpl'}
<ul class="view-modules"> <ul class="view-modules">
<li class="button normal-view-disabled"><img src="themes/default/img/modules_view_layout_sidebar.png" alt="{l s='Normal view'}" border="0" /><span>{l s='Normal view'}</span></li> <li class="button normal-view-disabled"><img src="themes/default/img/modules_view_layout_sidebar.png" alt="{l s='Normal view'}" border="0" /><span>{l s='Normal view'}</span></li>
<li class="button favorites-view"><a href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}&select=favorites"><img src="themes/default/img/modules_view_table_select_row.png" alt="{l s='Favorites view'}" border="0" /><span>{l s='Favorites view'}</span></a></li> <li class="button favorites-view"><a href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}&select=favorites"><img src="themes/default/img/modules_view_table_select_row.png" alt="{l s='Favorites view'}" border="0" /><span>{l s='Favorites view'}</span></a></li>
</ul> </ul>
<div id="container"> <div id="container">
@@ -58,10 +56,8 @@
</ul> </ul>
</div> </div>
</div> </div>
<div id="moduleContainer"> <div id="moduleContainer">
{include file='controllers/modules/list.tpl'} {include file='controllers/modules/list.tpl'}
</div> </div>
</div> </div>
</div> </div>
+4 -4
View File
@@ -1164,10 +1164,10 @@ abstract class ModuleCore
$item->active = 0; $item->active = 0;
if (isset($modaddons->img)) if (isset($modaddons->img))
{ {
if (!file_exists('../img/tmp/'.md5($modaddons->name).'.jpg')) if (!file_exists(_PS_TMP_IMG_DIR_.md5($modaddons->name).'.jpg'))
if (!@copy($modaddons->img, '../img/tmp/'.md5($modaddons->name).'.jpg')) if (!file_put_contents(_PS_TMP_IMG_DIR_.md5($modaddons->name).'.jpg', Tools::file_get_contents($modaddons->img)))
@copy('../img/404.gif', '../img/tmp/'.md5($modaddons->name).'.jpg'); copy(_PS_IMG_DIR_.'404.gif', _PS_TMP_IMG_DIR_.md5($modaddons->name).'.jpg');
if (file_exists('../img/tmp/'.md5($modaddons->name).'.jpg')) if (file_exists(_PS_TMP_IMG_DIR_.md5($modaddons->name).'.jpg'))
$item->image = '../img/tmp/'.md5($modaddons->name).'.jpg'; $item->image = '../img/tmp/'.md5($modaddons->name).'.jpg';
} }
if ($item->type == 'addonsMustHave') if ($item->type == 'addonsMustHave')
@@ -26,7 +26,6 @@
class AdminModulesControllerCore extends AdminController class AdminModulesControllerCore extends AdminController
{ {
/* /*
** @var array map with $_GET keywords and their callback ** @var array map with $_GET keywords and their callback
*/ */