From 48cb2f5dc50204aa31755d600207985bda435826 Mon Sep 17 00:00:00 2001 From: fSerny Date: Tue, 24 Jan 2012 15:39:10 +0000 Subject: [PATCH] [+] BO : AdminModules Preferences --- .../img/modules_view_layout_sidebar.png | Bin 0 -> 998 bytes .../img/modules_view_layout_sidebar_grey.png | Bin 0 -> 1470 bytes .../img/modules_view_table_select_row.png | Bin 0 -> 998 bytes .../modules_view_table_select_row_grey.png | Bin 0 -> 1559 bytes .../template/controllers/modules/content.tpl | 6 +- .../controllers/modules/favorites.tpl | 64 ++++++++++++++++ .../template/controllers/modules/filters.tpl | 33 +++++++++ .../template/controllers/modules/header.tpl | 30 -------- .../template/controllers/modules/js.tpl | 43 +++++++++++ .../template/controllers/modules/page.tpl | 14 +++- controllers/admin/AdminModulesController.php | 70 ++++++++++++++++-- install-new/data/db_structure.sql | 10 +++ install-new/upgrade/sql/1.5.0.4.sql | 11 +++ modules/watermark/config.xml | 2 +- 14 files changed, 243 insertions(+), 40 deletions(-) create mode 100755 admin-dev/themes/default/img/modules_view_layout_sidebar.png create mode 100755 admin-dev/themes/default/img/modules_view_layout_sidebar_grey.png create mode 100755 admin-dev/themes/default/img/modules_view_table_select_row.png create mode 100755 admin-dev/themes/default/img/modules_view_table_select_row_grey.png create mode 100755 admin-dev/themes/default/template/controllers/modules/favorites.tpl diff --git a/admin-dev/themes/default/img/modules_view_layout_sidebar.png b/admin-dev/themes/default/img/modules_view_layout_sidebar.png new file mode 100755 index 0000000000000000000000000000000000000000..fff8da0fb2d7b27954463824904d17ec4e92da51 GIT binary patch literal 998 zcmV%mhyaGNbI*g7 zw=3{{eO;zPv{-tC{(%7)JvOQd>FJS2Z{pmQ;NM_+`le#qDhi|}DLXg!5KbH)tGHG{ zz;T$0+?U|*KdiP?fg^_xs<{cHHUZ|?D(LF!w9;)V_mNc6Pr|54fGP8l5)SnC_O?_3 zniCC1O#&3`$jE+}pPP^Iuns|(oHjFtheycrbre7b=f=;&#feKsdNl9>_(2IuK@ltk zOjU#Gi@fC*i?s>3+=It29>L2m%W{4v^1Kgc_m9K1@f)!A^)nO-8>!2b;_2@0f&RX} zI0AYyPZC)Ev;_BV9gwHEQ9xe965M{U1lK2~p|G(5liA582q5J1c^KR~5S6963b=|~ zNbo1m7gb6E5x~_8S#{oVxOMiskE^;{VzT^{wxfr18B#x}(+BiL6bKnNBOU8N5cukU zSf(L!x|flzNo6WQgNRy*Wf-QZYitHO+Y!l=<`mqgV23_4h13PJ^> z;WU9jFQsO!sOXvv5{Onz{S-JX6hM_E0#i*$SWvXqPEWv?H?|dvDu>DkT+S^4tsfCI z8w(?4qw7>CKbU1Xidm%qTDe{60ig0jVT}o_a_MerQHt|`%@8X$50{#bAyCc%L=2gp zfNDh6XE6$d1Sncs7li6{p(d5183J+2{ZGIcMkx@f-zW#Qvq?!Htc1E{7?oy+=f>>_ z6hCr5m8ocO*GM{s6@v~Y5D+D4MjzVS$_mhb0i}u(bgKv^4SGhakU$_imW7%7i}E&Z zGeF?klb6-?!F_{}%jKHN|IpA-?D^eoGr4VlGa^jFR!(x8tm(~+5L2a~gTt@x+5FC; zFJGOu_~n$kIe`=APveMPv|*J;&n7m!>0cEA3i4PZK(ccOtv}nGg}?In{ZD`a08&IK Unde2pv;Y7A07*qoM6N<$f=lwsFaQ7m literal 0 HcmV?d00001 diff --git a/admin-dev/themes/default/img/modules_view_layout_sidebar_grey.png b/admin-dev/themes/default/img/modules_view_layout_sidebar_grey.png new file mode 100755 index 0000000000000000000000000000000000000000..4d8964a31c9b3f40a5315b3179c66e847767ff16 GIT binary patch literal 1470 zcmV;v1ws0WP)kdg00009a7bBm000XU z000XU0RWnu7ytkR7->U8P*7-ZbZ>KLZ*U+lnSp_Ufq@}0xwybFAi#%#fq@|}KQEO56)-X|e7nZL z$iTqBa9P*U#mSX{G{Bl%P*lRez;J+pfx##xwK$o9f#C}S14DXwNkIt%17i#W1A|CX zc0maP17iUL1A|C*NRTrF17iyV0~1e4YDEbH0|SF|enDkXW_m`6f}y3Q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zDFBQiD=1+2oI1hMJ4LWnRQBmGLXANEI9UN;3|U3fTV2}HQYSG+YdM67AD`M$NeBcC zpTMdz4%wb&zqIQR56J^5n<*x3?76WDt43@{L03$S9#Bjk{mXP%LL^HY$wR|e6rKnj zdVqLwR^?oakSHoJRY6Js!?9I4=h$p=Fs@wc7%Kq|c$P2&_kn%hR#BHD&A45h>>aQD zWjZ$Yl%;h2KXEaH;o`}aMHQzsgLO(|`Oe`kK-l31yGuU-{}SUT--LlJHr9;cH^2T2 Y0Ip##qEtDr*#H0l07*qoM6N<$g0wVzjQ{`u literal 0 HcmV?d00001 diff --git a/admin-dev/themes/default/img/modules_view_table_select_row.png b/admin-dev/themes/default/img/modules_view_table_select_row.png new file mode 100755 index 0000000000000000000000000000000000000000..7ae398042bccb77f53e71053f527ae05466d5f28 GIT binary patch literal 998 zcmV4wrKfq1|i2<#Qm6aVD6SW{Dc$gT$h6I0rg4)nfNJXM@AbUIG zdo#1UGkX^jh7%{5+uLt;=6(C#_ukAh01zi1)Mo1m8;B)$QHEG3CP`y5hRMM`sE*CU_QQb_B6l^w@TERYi8~4;@-vHHVfgZCXxLDN zVkGd)+t#LV+yOFCIv$w^k&TSd4>G|qGp?Tt#H6IPO&C&}!cDm-Gn`*38qCVWMkXA~ zC6G1YBrFPsq5D}*fJjA%BeNs;q_6{_m_*k~zrYv*DXE!-&n5{VXAp6Y3vrC)DkRcO z55+M3@d|MF+PTc8$mIYqa@7nl$4vs?;?2SeT)%P#8p**hio5b8n1;aKsl+JN)qu3+ zzz8X;4nY_>CVRP-BII6p^uv@&5h{qT*`z>B76h1Uzz%d(ae_+#%zalyKsQ#>BqbV% zkw+3JWExe%>R4@KYqB5Mjaeu~`OalhiRrgUFgDUAZwRI=7Gph7uZEy=d>-mkwi2dn zO6aSXcg~|=OwnLA3zomE!-cb_Jaz9EBT@oi?&gzEo(DV)5XTs6=58Y=fNQ`X#CCA| zl6K(`j69%}@7*Q>G)j}mFyna@i)6 zGZ&%bc3Jo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673|eYwDTj_Bo^8C=32b7^Co|hIDzHl z?(EFD=bn4VNKg0ky^Qm(%W%Lj(#N+CV0FtcySALw#8L)66ENNIlN$wHS9FN|;3nW? z?vPC}MEn!Y$R~ z8*4a;mqQ9Y`8jhPFy}~{2hbOr*gaS1&{kaXOsH zADk8nvML6R*p+PRx$I^7E~W&sPhSDAHK@jdDr;)!2BXm=98f5&Upeue?&*7BN|xf& z(#})0cpu9ck9Ei?5w{DPo`JTjoll%e;MAKm{GZQ2CwB)bS6%d+ogbb2*V8sh5D&Ii z>c`dOiQyTo$q&Vi!~-y{aE+_yaJ+aqzxib}j2Uscb;RM{0RVHO&tdDr$yERV002ov JPDHLkV1j88udV<9 literal 0 HcmV?d00001 diff --git a/admin-dev/themes/default/template/controllers/modules/content.tpl b/admin-dev/themes/default/template/controllers/modules/content.tpl index 0accbb124..1ef1591e6 100644 --- a/admin-dev/themes/default/template/controllers/modules/content.tpl +++ b/admin-dev/themes/default/template/controllers/modules/content.tpl @@ -29,5 +29,9 @@ {$module_content} {else} {include file='controllers/modules/js.tpl'} - {include file='controllers/modules/page.tpl'} + {if isset($smarty.get.select) && $smarty.get.select eq 'favorites'} + {include file='controllers/modules/favorites.tpl'} + {else} + {include file='controllers/modules/page.tpl'} + {/if} {/if} diff --git a/admin-dev/themes/default/template/controllers/modules/favorites.tpl b/admin-dev/themes/default/template/controllers/modules/favorites.tpl new file mode 100755 index 000000000..d4f26f938 --- /dev/null +++ b/admin-dev/themes/default/template/controllers/modules/favorites.tpl @@ -0,0 +1,64 @@ +
+ + {include file='controllers/modules/header.tpl'} + + {l s='Normal view'} + {l s='Favorites view'}
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + {foreach from=$modules key=km item=module} + + + + + + + + + + + {/foreach} + +
LogoNom du moduleDescriptionEtatCatégoriesIntérêtFavori 
{$module->displayName}{$module->description|truncate:80:'…'}{if isset($module->id) && $module->id gt 0}{l s='Installed'}{else}{l s='Not Installed'}{/if}{$module->categoryName} + + + +  
+ +
+
+
\ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/modules/filters.tpl b/admin-dev/themes/default/template/controllers/modules/filters.tpl index 7a4dae8be..d2755dde6 100644 --- a/admin-dev/themes/default/template/controllers/modules/filters.tpl +++ b/admin-dev/themes/default/template/controllers/modules/filters.tpl @@ -24,6 +24,39 @@ * International Registered Trademark & Property of PrestaShop SA *} + + {if !isset($logged_on_addons)} + + {if $check_url_fopen eq 'ko' OR $check_curl eq 'ko' OR $check_openssl eq 'ko'} + +
+ {l s='If you want to be able to fully use the AdminModules pannel and have free modules available, you should enable the following configuration on your server :'}
+ {if $check_url_fopen eq 'ko'}- {l s='Enable allow_url_fopen'}
{/if} + {if $check_curl eq 'ko'}- {l s='Enable php curl extension'}
{/if} + {if $check_openssl eq 'ko'}- {l s='Enable php openssl extension'}
{/if} +
+ + {else} + + +
+ +

{l s='You have a PrestaShop Addons account ?'}

+
+ + + + +
+ +
+ + + {/if} + + {/if} + +
diff --git a/admin-dev/themes/default/template/controllers/modules/header.tpl b/admin-dev/themes/default/template/controllers/modules/header.tpl index 76ec66a71..97238daf0 100644 --- a/admin-dev/themes/default/template/controllers/modules/header.tpl +++ b/admin-dev/themes/default/template/controllers/modules/header.tpl @@ -70,34 +70,4 @@
- {if !isset($logged_on_addons)} - - {if $check_url_fopen eq 'ko' OR $check_curl eq 'ko' OR $check_openssl eq 'ko'} - -
- {l s='If you want to be able to fully use the AdminModules pannel and have free modules available, you should enable the following configuration on your server :'}
- {if $check_url_fopen eq 'ko'}- {l s='Enable allow_url_fopen'}
{/if} - {if $check_curl eq 'ko'}- {l s='Enable php curl extension'}
{/if} - {if $check_openssl eq 'ko'}- {l s='Enable php openssl extension'}
{/if} -
- - {else} - - -
- -

{l s='You have a PrestaShop Addons account ?'}

-
- - - - -
- -
- - - {/if} - - {/if} diff --git a/admin-dev/themes/default/template/controllers/modules/js.tpl b/admin-dev/themes/default/template/controllers/modules/js.tpl index 2908d0081..64cf060af 100644 --- a/admin-dev/themes/default/template/controllers/modules/js.tpl +++ b/admin-dev/themes/default/template/controllers/modules/js.tpl @@ -36,6 +36,7 @@ var ajaxCurrentIndex = '{$ajaxCurrentIndex}'; var by = '{l s='by'}'; var errorLogin = '{l s='Could not login to Addons'}'; + var confirmPreferencesSaved = '{l s='Preferences saved'}'; {if isset($smarty.get.anchor)}var anchor = '{$smarty.get.anchor|htmlentities|replace:'(':''|replace:')':''|replace:'{':''|replace:'}':''}';{else}var anchor = '';{/if} @@ -279,6 +280,48 @@ + + // Method to save favorites preferences + $('.moduleFavorite').change(function() + { + var value_pref = $(this).val(); + var module_pref = $(this).attr('name'); + var action_pref = module_pref.substring(0, 1); + module_pref = module_pref.substring(2, module_pref.length); + 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') + $('#r_' + module_pref).html(confirmPreferencesSaved); + }, + error: function(res,textStatus,jqXHR) + { + //jAlert("TECHNICAL ERROR"+res); + } + }); + } + catch(e){} + return false; + }); + + + + }); {/literal} diff --git a/admin-dev/themes/default/template/controllers/modules/page.tpl b/admin-dev/themes/default/template/controllers/modules/page.tpl index 1e4a98124..e1c21ddfb 100644 --- a/admin-dev/themes/default/template/controllers/modules/page.tpl +++ b/admin-dev/themes/default/template/controllers/modules/page.tpl @@ -29,13 +29,25 @@ {include file='controllers/modules/header.tpl'} {include file='controllers/modules/filters.tpl'} +
+ {l s='Normal view'} + {l s='Favorites view'}
+