From d6b524e39a8ce6be4aa95c2a51a0707e0fa27b15 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 17 Dec 2013 10:21:18 +0100 Subject: [PATCH 1/6] add a new entry point in each pages in bo for js include --- templates/backOffice/default/admin-layout.tpl | 2 +- templates/backOffice/default/admin-logs.html | 4 ++++ templates/backOffice/default/administrators.html | 4 ++++ templates/backOffice/default/attribute-edit.html | 4 ++++ templates/backOffice/default/attributes.html | 4 ++++ templates/backOffice/default/categories.html | 4 ++++ templates/backOffice/default/category-edit.html | 4 ++++ templates/backOffice/default/config-store.html | 4 ++++ templates/backOffice/default/configuration.html | 4 ++++ templates/backOffice/default/content-edit.html | 4 ++++ templates/backOffice/default/countries.html | 4 ++++ templates/backOffice/default/country-edit.html | 4 ++++ templates/backOffice/default/coupon-create.html | 4 ++++ templates/backOffice/default/coupon-list.html | 4 ++++ templates/backOffice/default/coupon-read.html | 4 ++++ templates/backOffice/default/coupon-update.html | 4 ++++ templates/backOffice/default/currencies.html | 4 ++++ templates/backOffice/default/currency-edit.html | 4 ++++ templates/backOffice/default/customer-edit.html | 4 ++++ templates/backOffice/default/customers.html | 4 ++++ templates/backOffice/default/document-edit.html | 4 ++++ templates/backOffice/default/feature-edit.html | 4 ++++ templates/backOffice/default/features.html | 4 ++++ templates/backOffice/default/folder-edit.html | 4 ++++ templates/backOffice/default/folders.html | 4 ++++ templates/backOffice/default/home.html | 4 ++++ templates/backOffice/default/image-edit.html | 4 ++++ templates/backOffice/default/languages.html | 4 ++++ templates/backOffice/default/mailing-system.html | 4 ++++ templates/backOffice/default/message-edit.html | 4 ++++ templates/backOffice/default/messages.html | 4 ++++ templates/backOffice/default/module-configure.html | 4 ++++ templates/backOffice/default/module-edit.html | 6 ++---- templates/backOffice/default/modules.html | 4 ++++ templates/backOffice/default/order-edit.html | 4 ++++ templates/backOffice/default/orders.html | 4 ++++ templates/backOffice/default/product-edit.html | 4 ++++ templates/backOffice/default/profile-edit.html | 4 ++++ templates/backOffice/default/profiles.html | 4 ++++ templates/backOffice/default/search.html | 4 ++++ .../backOffice/default/shipping-configuration-edit.html | 4 ++++ templates/backOffice/default/shipping-configuration.html | 4 ++++ templates/backOffice/default/shipping-zones-edit.html | 4 ++++ templates/backOffice/default/shipping-zones.html | 4 ++++ templates/backOffice/default/system-logs.html | 4 ++++ templates/backOffice/default/tax-edit.html | 4 ++++ templates/backOffice/default/tax-rule-edit.html | 4 ++++ templates/backOffice/default/taxes-rules.html | 4 ++++ templates/backOffice/default/template-edit.html | 4 ++++ templates/backOffice/default/templates.html | 4 ++++ templates/backOffice/default/translations.html | 4 ++++ templates/backOffice/default/variable-edit.html | 4 ++++ templates/backOffice/default/variables.html | 4 ++++ 53 files changed, 207 insertions(+), 5 deletions(-) diff --git a/templates/backOffice/default/admin-layout.tpl b/templates/backOffice/default/admin-layout.tpl index da4cdc3e6..6876b5dd5 100755 --- a/templates/backOffice/default/admin-layout.tpl +++ b/templates/backOffice/default/admin-layout.tpl @@ -267,6 +267,6 @@ {* Modules scripts are included now *} {module_include location='footer_js'} - + {block name="javascript-last-call"}{/block} diff --git a/templates/backOffice/default/admin-logs.html b/templates/backOffice/default/admin-logs.html index 80eadbbe5..5ca9f9399 100755 --- a/templates/backOffice/default/admin-logs.html +++ b/templates/backOffice/default/admin-logs.html @@ -231,4 +231,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='admin-logs-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/administrators.html b/templates/backOffice/default/administrators.html index a02846c0f..73fd9724d 100755 --- a/templates/backOffice/default/administrators.html +++ b/templates/backOffice/default/administrators.html @@ -355,4 +355,8 @@ jQuery(function($) { }) +{/block} + +{block name="javascript-last-call"} + {module_include location='administrators-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/attribute-edit.html b/templates/backOffice/default/attribute-edit.html index 5952f8b8f..7c82d8b9d 100755 --- a/templates/backOffice/default/attribute-edit.html +++ b/templates/backOffice/default/attribute-edit.html @@ -317,4 +317,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='attribute-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/attributes.html b/templates/backOffice/default/attributes.html index ae86c74f6..2fcb8b0ed 100755 --- a/templates/backOffice/default/attributes.html +++ b/templates/backOffice/default/attributes.html @@ -327,4 +327,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='attributes-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/categories.html b/templates/backOffice/default/categories.html index e25b79f1e..ecf8c52ec 100755 --- a/templates/backOffice/default/categories.html +++ b/templates/backOffice/default/categories.html @@ -709,4 +709,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='categories-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/category-edit.html b/templates/backOffice/default/category-edit.html index 5003824c1..4bd5d81ad 100755 --- a/templates/backOffice/default/category-edit.html +++ b/templates/backOffice/default/category-edit.html @@ -393,4 +393,8 @@ $(function() { }); +{/block} + +{block name="javascript-last-call"} + {module_include location='category-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/config-store.html b/templates/backOffice/default/config-store.html index 2355f3b66..14f4bef81 100755 --- a/templates/backOffice/default/config-store.html +++ b/templates/backOffice/default/config-store.html @@ -168,3 +168,7 @@ {/block} + +{block name="javascript-last-call"} + {module_include location='config-store-js'} +{/block} diff --git a/templates/backOffice/default/configuration.html b/templates/backOffice/default/configuration.html index debaaa6fb..ae6ce634c 100755 --- a/templates/backOffice/default/configuration.html +++ b/templates/backOffice/default/configuration.html @@ -189,4 +189,8 @@ +{/block} + +{block name="javascript-last-call"} + {module_include location='configuration-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/content-edit.html b/templates/backOffice/default/content-edit.html index 92b59b533..1014d512c 100755 --- a/templates/backOffice/default/content-edit.html +++ b/templates/backOffice/default/content-edit.html @@ -264,4 +264,8 @@ form_content = {$smarty.capture.delete_folder_dialog nofilter} }); +{/block} + +{block name="javascript-last-call"} + {module_include location='content-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/countries.html b/templates/backOffice/default/countries.html index 5f820956a..6682097b0 100755 --- a/templates/backOffice/default/countries.html +++ b/templates/backOffice/default/countries.html @@ -261,4 +261,8 @@ {/javascripts} +{/block} + +{block name="javascript-last-call"} + {module_include location='countries-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/country-edit.html b/templates/backOffice/default/country-edit.html index fa4f756ad..0eaa7fd4c 100755 --- a/templates/backOffice/default/country-edit.html +++ b/templates/backOffice/default/country-edit.html @@ -124,4 +124,8 @@ +{/block} + +{block name="javascript-last-call"} + {module_include location='country-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/coupon-create.html b/templates/backOffice/default/coupon-create.html index 66636df47..691067be2 100755 --- a/templates/backOffice/default/coupon-create.html +++ b/templates/backOffice/default/coupon-create.html @@ -62,3 +62,7 @@ {/block} + +{block name="javascript-last-call"} + {module_include location='coupon-create-js'} +{/block} diff --git a/templates/backOffice/default/coupon-list.html b/templates/backOffice/default/coupon-list.html index fb4005fb1..5ed255cb1 100755 --- a/templates/backOffice/default/coupon-list.html +++ b/templates/backOffice/default/coupon-list.html @@ -162,3 +162,7 @@ {/javascripts} {/block} + +{block name="javascript-last-call"} + {module_include location='coupon-list-js'} +{/block} diff --git a/templates/backOffice/default/coupon-read.html b/templates/backOffice/default/coupon-read.html index 8bc91f67e..a4f67c9f2 100755 --- a/templates/backOffice/default/coupon-read.html +++ b/templates/backOffice/default/coupon-read.html @@ -165,3 +165,7 @@ {/javascripts} {/block} + +{block name="javascript-last-call"} + {module_include location='coupon-read-js'} +{/block} diff --git a/templates/backOffice/default/coupon-update.html b/templates/backOffice/default/coupon-update.html index 138ed28aa..68cfb6a90 100755 --- a/templates/backOffice/default/coupon-update.html +++ b/templates/backOffice/default/coupon-update.html @@ -147,3 +147,7 @@ }); {/block} + +{block name="javascript-last-call"} + {module_include location='coupon-update-js'} +{/block} diff --git a/templates/backOffice/default/currencies.html b/templates/backOffice/default/currencies.html index c35b1a39f..21784fd3b 100755 --- a/templates/backOffice/default/currencies.html +++ b/templates/backOffice/default/currencies.html @@ -358,4 +358,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='currencies-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/currency-edit.html b/templates/backOffice/default/currency-edit.html index 51dcea985..92ff36649 100755 --- a/templates/backOffice/default/currency-edit.html +++ b/templates/backOffice/default/currency-edit.html @@ -123,4 +123,8 @@ +{/block} + +{block name="javascript-last-call"} + {module_include location='currency-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/customer-edit.html b/templates/backOffice/default/customer-edit.html index 24087a756..d5b48f3d6 100755 --- a/templates/backOffice/default/customer-edit.html +++ b/templates/backOffice/default/customer-edit.html @@ -423,4 +423,8 @@ {/if} }); +{/block} + +{block name="javascript-last-call"} + {module_include location='customer-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/customers.html b/templates/backOffice/default/customers.html index 9dff5e9c3..eccb6e63e 100755 --- a/templates/backOffice/default/customers.html +++ b/templates/backOffice/default/customers.html @@ -371,4 +371,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='customers-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/document-edit.html b/templates/backOffice/default/document-edit.html index bc556da31..f8f6fd17d 100755 --- a/templates/backOffice/default/document-edit.html +++ b/templates/backOffice/default/document-edit.html @@ -160,4 +160,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='document-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/feature-edit.html b/templates/backOffice/default/feature-edit.html index cc8b3788e..0f9d2d652 100755 --- a/templates/backOffice/default/feature-edit.html +++ b/templates/backOffice/default/feature-edit.html @@ -317,4 +317,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='feature-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/features.html b/templates/backOffice/default/features.html index 04a4d7c2a..281b06eb1 100755 --- a/templates/backOffice/default/features.html +++ b/templates/backOffice/default/features.html @@ -327,4 +327,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='features-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/folder-edit.html b/templates/backOffice/default/folder-edit.html index 29e4bb165..88f7f42ba 100755 --- a/templates/backOffice/default/folder-edit.html +++ b/templates/backOffice/default/folder-edit.html @@ -347,4 +347,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='folder-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/folders.html b/templates/backOffice/default/folders.html index d1689608b..264bab81f 100755 --- a/templates/backOffice/default/folders.html +++ b/templates/backOffice/default/folders.html @@ -627,4 +627,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='folders-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/home.html b/templates/backOffice/default/home.html index dcfe59a92..e943e05c8 100755 --- a/templates/backOffice/default/home.html +++ b/templates/backOffice/default/home.html @@ -408,4 +408,8 @@ jQuery(function($){ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='home-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/image-edit.html b/templates/backOffice/default/image-edit.html index 362d10adb..316c8c4ff 100755 --- a/templates/backOffice/default/image-edit.html +++ b/templates/backOffice/default/image-edit.html @@ -165,4 +165,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='image-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/languages.html b/templates/backOffice/default/languages.html index dc337efe2..5d14da4a8 100755 --- a/templates/backOffice/default/languages.html +++ b/templates/backOffice/default/languages.html @@ -306,4 +306,8 @@ }); }); +{/block} + +{block name="javascript-last-call"} + {module_include location='languages-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/mailing-system.html b/templates/backOffice/default/mailing-system.html index 92d205289..0162dc8e6 100755 --- a/templates/backOffice/default/mailing-system.html +++ b/templates/backOffice/default/mailing-system.html @@ -140,4 +140,8 @@ jQuery(function($) { }); +{/block} + +{block name="javascript-last-call"} + {module_include location='mainling-system-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/message-edit.html b/templates/backOffice/default/message-edit.html index 9033c2432..6de72a897 100755 --- a/templates/backOffice/default/message-edit.html +++ b/templates/backOffice/default/message-edit.html @@ -234,3 +234,7 @@ })(jQuery); {/block} + +{block name="javascript-last-call"} + {module_include location='message-edit-js'} +{/block} diff --git a/templates/backOffice/default/messages.html b/templates/backOffice/default/messages.html index ea4b0371a..e64f81d87 100755 --- a/templates/backOffice/default/messages.html +++ b/templates/backOffice/default/messages.html @@ -213,4 +213,8 @@ } }); +{/block} + +{block name="javascript-last-call"} + {module_include location='messages-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/module-configure.html b/templates/backOffice/default/module-configure.html index 4074b00fc..9ed9fa924 100755 --- a/templates/backOffice/default/module-configure.html +++ b/templates/backOffice/default/module-configure.html @@ -22,4 +22,8 @@ +{/block} + +{block name="javascript-last-call"} + {module_include location='module-config-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/module-edit.html b/templates/backOffice/default/module-edit.html index 755a50826..ab1edc9d0 100755 --- a/templates/backOffice/default/module-edit.html +++ b/templates/backOffice/default/module-edit.html @@ -75,8 +75,6 @@ {/block} -{block name="javascript-initialization"} - - - +{block name="javascript-last-call"} + {module_include location='module-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/modules.html b/templates/backOffice/default/modules.html index 12d918efc..43db83c4a 100755 --- a/templates/backOffice/default/modules.html +++ b/templates/backOffice/default/modules.html @@ -103,4 +103,8 @@ }); }); +{/block} + +{block name="javascript-last-call"} + {module_include location='modules-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/order-edit.html b/templates/backOffice/default/order-edit.html index 1d5abf358..96f92464b 100755 --- a/templates/backOffice/default/order-edit.html +++ b/templates/backOffice/default/order-edit.html @@ -509,4 +509,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='order-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/orders.html b/templates/backOffice/default/orders.html index 6299341a7..808bd8c8d 100755 --- a/templates/backOffice/default/orders.html +++ b/templates/backOffice/default/orders.html @@ -164,4 +164,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='orders-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/product-edit.html b/templates/backOffice/default/product-edit.html index 617ba3b2d..a75bdcb0f 100755 --- a/templates/backOffice/default/product-edit.html +++ b/templates/backOffice/default/product-edit.html @@ -416,4 +416,8 @@ $(function() { +{/block} + +{block name="javascript-last-call"} + {module_include location='product-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/profile-edit.html b/templates/backOffice/default/profile-edit.html index 8eb104cd0..7e4d57a27 100755 --- a/templates/backOffice/default/profile-edit.html +++ b/templates/backOffice/default/profile-edit.html @@ -303,4 +303,8 @@ {/javascripts} +{/block} + +{block name="javascript-last-call"} + {module_include location='profile-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/profiles.html b/templates/backOffice/default/profiles.html index 418037cc1..0cbc2b123 100755 --- a/templates/backOffice/default/profiles.html +++ b/templates/backOffice/default/profiles.html @@ -208,4 +208,8 @@ jQuery(function($) { }) +{/block} + +{block name="javascript-last-call"} + {module_include location='profiles-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/search.html b/templates/backOffice/default/search.html index d96558ea9..af3ec743d 100755 --- a/templates/backOffice/default/search.html +++ b/templates/backOffice/default/search.html @@ -235,4 +235,8 @@ +{/block} + +{block name="javascript-last-call"} + {module_include location='search-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/shipping-configuration-edit.html b/templates/backOffice/default/shipping-configuration-edit.html index 8c24d2ff7..1cb53d4c7 100755 --- a/templates/backOffice/default/shipping-configuration-edit.html +++ b/templates/backOffice/default/shipping-configuration-edit.html @@ -165,4 +165,8 @@ }); }); +{/block} + +{block name="javascript-last-call"} + {module_include location='shipping-configuration-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/shipping-configuration.html b/templates/backOffice/default/shipping-configuration.html index 2f0892c1f..e65b1ad28 100755 --- a/templates/backOffice/default/shipping-configuration.html +++ b/templates/backOffice/default/shipping-configuration.html @@ -139,4 +139,8 @@ }); }); +{/block} + +{block name="javascript-last-call"} + {module_include location='shipping-configuration-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/shipping-zones-edit.html b/templates/backOffice/default/shipping-zones-edit.html index d18c4eea2..6d76bc5eb 100755 --- a/templates/backOffice/default/shipping-zones-edit.html +++ b/templates/backOffice/default/shipping-zones-edit.html @@ -137,4 +137,8 @@ }); }); +{/block} + +{block name="javascript-last-call"} + {module_include location='shipping-zones-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/shipping-zones.html b/templates/backOffice/default/shipping-zones.html index 29e2ba346..e86dcb0b8 100755 --- a/templates/backOffice/default/shipping-zones.html +++ b/templates/backOffice/default/shipping-zones.html @@ -63,4 +63,8 @@ +{/block} + +{block name="javascript-last-call"} + {module_include location='shipping-zones-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/system-logs.html b/templates/backOffice/default/system-logs.html index 92e59c730..9cf7f64fe 100755 --- a/templates/backOffice/default/system-logs.html +++ b/templates/backOffice/default/system-logs.html @@ -210,4 +210,8 @@ $(function() { }); }); +{/block} + +{block name="javascript-last-call"} + {module_include location='system-logs-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/tax-edit.html b/templates/backOffice/default/tax-edit.html index 03c40b0a5..4e77024ac 100755 --- a/templates/backOffice/default/tax-edit.html +++ b/templates/backOffice/default/tax-edit.html @@ -157,4 +157,8 @@ +{/block} + +{block name="javascript-last-call"} + {module_include location='tax-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/tax-rule-edit.html b/templates/backOffice/default/tax-rule-edit.html index 0af295e63..9b9d44d20 100755 --- a/templates/backOffice/default/tax-rule-edit.html +++ b/templates/backOffice/default/tax-rule-edit.html @@ -422,4 +422,8 @@ +{/block} + +{block name="javascript-last-call"} + {module_include location='tax-rule-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/taxes-rules.html b/templates/backOffice/default/taxes-rules.html index 0ef8ce7f2..e9d80efed 100755 --- a/templates/backOffice/default/taxes-rules.html +++ b/templates/backOffice/default/taxes-rules.html @@ -378,4 +378,8 @@ form_content = {$smarty.capture.tax_rule_delete_dialog nofilter} }) +{/block} + +{block name="javascript-last-call"} + {module_include location='taxes-rules-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/template-edit.html b/templates/backOffice/default/template-edit.html index 265ef2173..5c0fc8114 100755 --- a/templates/backOffice/default/template-edit.html +++ b/templates/backOffice/default/template-edit.html @@ -119,4 +119,8 @@ $('#attribute_list_management').load("{url noamp='1' path='/admin/configuration/templates/attributes/list' template_id=$template_id}"); }); +{/block} + +{block name="javascript-last-call"} + {module_include location='template-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/templates.html b/templates/backOffice/default/templates.html index a56568920..880c35747 100755 --- a/templates/backOffice/default/templates.html +++ b/templates/backOffice/default/templates.html @@ -211,4 +211,8 @@ } }); +{/block} + +{block name="javascript-last-call"} + {module_include location='templates-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/translations.html b/templates/backOffice/default/translations.html index 5a48e5277..e209dcfcf 100755 --- a/templates/backOffice/default/translations.html +++ b/templates/backOffice/default/translations.html @@ -317,3 +317,7 @@ }); {/block} + +{block name="javascript-last-call"} + {module_include location='translations-js'} +{/block} diff --git a/templates/backOffice/default/variable-edit.html b/templates/backOffice/default/variable-edit.html index ca57774dd..e5c801ee5 100755 --- a/templates/backOffice/default/variable-edit.html +++ b/templates/backOffice/default/variable-edit.html @@ -114,4 +114,8 @@ +{/block} + +{block name="javascript-last-call"} + {module_include location='variable-edit-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/variables.html b/templates/backOffice/default/variables.html index 8ea90e85e..89f0a423c 100755 --- a/templates/backOffice/default/variables.html +++ b/templates/backOffice/default/variables.html @@ -279,4 +279,8 @@ }); +{/block} + +{block name="javascript-last-call"} + {module_include location='variables-js'} {/block} \ No newline at end of file From ade8ac6f2af8f94176a0a76cd6c60e59e9e10ab2 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 17 Dec 2013 14:46:36 +0100 Subject: [PATCH 2/6] add documentation URL in readme --- Readme.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Readme.md b/Readme.md index fe90c50cc..e6d83a43e 100755 --- a/Readme.md +++ b/Readme.md @@ -58,6 +58,14 @@ $ php Thelia thelia:install You just have to follow all instructions. +Documentation +------------- + +Thelia documentation is available at http://doc.thelia.net + +The documentation is also in beta version and some part can be obsolete cause to some refactor. + + Contribute ---------- From e7a564b2dfdb8205147c8e922ac09ae573578e10 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 17 Dec 2013 14:47:31 +0100 Subject: [PATCH 3/6] use composer create-project instead of git --- Readme.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index e6d83a43e..4651523e2 100755 --- a/Readme.md +++ b/Readme.md @@ -44,10 +44,8 @@ Installation ------------ ``` bash -$ git clone https://github.com/thelia/thelia.git -$ cd thelia $ curl -sS https://getcomposer.org/installer | php -$ php composer.phar install --prefer-dist --optimize-autoloader +$ php composer.phar create-project thelia/thelia path/ dev-master ``` Finish the installation using cli tools : From d0e5d189d2c2600c283acde29cc0ac91fe679ded Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 18 Dec 2013 09:39:23 +0100 Subject: [PATCH 4/6] change memory_limit value, 128 MB is enough --- Readme.md | 2 +- core/lib/Thelia/Install/CheckPermission.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 4651523e2..abb8ccd30 100755 --- a/Readme.md +++ b/Readme.md @@ -22,7 +22,7 @@ Requirements * gd * curl * safe_mode off - * memory_limit at least 150M, preferably 256. + * memory_limit at least 128M, preferably 256. * post_max_size 20M * upload_max_filesize 2M * apache 2 diff --git a/core/lib/Thelia/Install/CheckPermission.php b/core/lib/Thelia/Install/CheckPermission.php index 6a9a5245e..efdaf6f04 100644 --- a/core/lib/Thelia/Install/CheckPermission.php +++ b/core/lib/Thelia/Install/CheckPermission.php @@ -58,7 +58,7 @@ class CheckPermission extends BaseInstall /** @var array Minimum server configuration necessary */ protected $minServerConfigurationNecessary = array( - 'memory_limit' => 157286400, + 'memory_limit' => 134217728, 'post_max_size' => 20971520, 'upload_max_filesize' => 2097152 ); From 2f4158d1f68e2721ad00f40c45033842959b2bf6 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 18 Dec 2013 10:04:13 +0100 Subject: [PATCH 5/6] fix cs --- core/lib/Thelia/Action/BaseAction.php | 7 +- core/lib/Thelia/Action/Coupon.php | 1 - core/lib/Thelia/Action/MailingSystem.php | 2 +- core/lib/Thelia/Action/Order.php | 2 +- core/lib/Thelia/Action/Product.php | 1 - core/lib/Thelia/Action/ProductSaleElement.php | 18 +-- .../Command/AdminUpdatePasswordCommand.php | 5 - core/lib/Thelia/Config/I18n/en_US.php | 20 +-- core/lib/Thelia/Config/I18n/es_ES.php | 64 ++++---- core/lib/Thelia/Config/I18n/fr_FR.php | 2 +- core/lib/Thelia/Config/I18n/it_IT.php | 2 +- .../Admin/AbstractCrudController.php | 1 - .../Admin/AbstractSeoCrudController.php | 7 +- .../Controller/Admin/AddressController.php | 5 +- .../Controller/Admin/AttributeController.php | 1 - .../Controller/Admin/BaseAdminController.php | 5 +- .../Controller/Admin/CategoryController.php | 7 +- .../Admin/ConfigStoreController.php | 4 +- .../Controller/Admin/CustomerController.php | 7 +- .../Controller/Admin/FeatureController.php | 1 - .../Controller/Admin/FileController.php | 6 +- .../Controller/Admin/HomeController.php | 3 +- .../Controller/Admin/MessageController.php | 5 +- .../Controller/Admin/ModuleController.php | 4 +- .../Controller/Admin/OrderController.php | 7 +- .../Controller/Admin/ProductController.php | 14 +- .../Controller/Admin/SystemLogController.php | 11 +- .../Admin/TranslationsController.php | 11 +- core/lib/Thelia/Controller/BaseController.php | 7 +- .../Controller/Front/BaseFrontController.php | 6 +- .../Compiler/TranslatorPass.php | 5 +- .../AdministratorUpdatePasswordEvent.php | 2 - .../Customer/CustomerCreateOrUpdateEvent.php | 1 - .../Event/Customer/CustomerLoginEvent.php | 1 - .../Core/Event/Message/MessageUpdateEvent.php | 2 +- .../ProductCombinationGenerationEvent.php | 11 +- .../Event/Product/ProductSetTemplateEvent.php | 2 +- .../ProductSaleElementDeleteEvent.php | 1 - core/lib/Thelia/Core/Event/UpdateSeoEvent.php | 1 - .../Core/EventListener/ViewListener.php | 2 - .../Thelia/Core/HttpFoundation/Response.php | 4 +- .../Core/HttpKernel/HttpCache/HttpCache.php | 3 +- .../Thelia/Core/Security/SecurityContext.php | 2 +- .../Template/Assets/AssetManagerInterface.php | 21 +-- .../Template/Assets/AsseticAssetManager.php | 59 ++++---- .../Thelia/Core/Template/Element/BaseLoop.php | 31 ++-- core/lib/Thelia/Core/Template/Loop/Admin.php | 1 - .../Core/Template/Loop/AssociatedContent.php | 2 +- core/lib/Thelia/Core/Template/Loop/Auth.php | 2 +- .../Core/Template/Loop/BaseSpecificModule.php | 1 - core/lib/Thelia/Core/Template/Loop/Cart.php | 4 +- .../Core/Template/Loop/CategoryPath.php | 4 +- .../Core/Template/Loop/CategoryTree.php | 4 +- core/lib/Thelia/Core/Template/Loop/Coupon.php | 1 - .../Thelia/Core/Template/Loop/Currency.php | 1 + .../Thelia/Core/Template/Loop/Customer.php | 4 - .../Thelia/Core/Template/Loop/Delivery.php | 4 +- core/lib/Thelia/Core/Template/Loop/Folder.php | 1 - .../Thelia/Core/Template/Loop/FolderPath.php | 4 +- .../Thelia/Core/Template/Loop/FolderTree.php | 4 +- core/lib/Thelia/Core/Template/Loop/Image.php | 1 - core/lib/Thelia/Core/Template/Loop/Module.php | 10 +- core/lib/Thelia/Core/Template/Loop/Order.php | 2 +- .../Core/Template/Loop/OrderProduct.php | 2 +- .../Loop/OrderProductAttributeCombination.php | 2 +- .../Core/Template/Loop/ProductTemplate.php | 2 +- .../lib/Thelia/Core/Template/Loop/Profile.php | 1 - .../Thelia/Core/Template/Loop/Template.php | 12 +- .../Smarty/Assets/SmartyAssetsManager.php | 11 +- .../Smarty/Plugins/AdminUtilities.php | 7 +- .../Core/Template/Smarty/Plugins/Assets.php | 5 +- .../Smarty/Plugins/DataAccessFunctions.php | 30 ++-- .../Core/Template/Smarty/Plugins/Esi.php | 5 +- .../Core/Template/Smarty/Plugins/Module.php | 6 +- .../Core/Template/Smarty/SmartyParser.php | 32 ++-- .../Core/Template/TemplateDefinition.php | 20 ++- .../Thelia/Core/Template/TemplateHelper.php | 65 ++++---- core/lib/Thelia/Core/Thelia.php | 4 +- core/lib/Thelia/Core/TheliaHttpKernel.php | 2 +- .../Thelia/Core/Translation/Translator.php | 2 +- .../Thelia/Form/CustomerProfileUpdateForm.php | 1 - .../Form/MailingSystemModificationForm.php | 1 - .../Form/ProductCombinationGenerationForm.php | 3 +- .../Thelia/Form/ProductModificationForm.php | 1 - core/lib/Thelia/Form/SeoFieldsTrait.php | 2 +- .../Form/SystemLogConfigurationForm.php | 2 - .../Log/Destination/TlogDestinationFile.php | 2 +- .../TlogDestinationJavascriptConsole.php | 38 ++--- .../Log/Destination/TlogDestinationPopup.php | 142 +++++++++--------- core/lib/Thelia/Log/Tlog.php | 3 +- core/lib/Thelia/Log/TlogDestinationConfig.php | 1 - core/lib/Thelia/Module/BaseModule.php | 24 +-- .../lib/Thelia/Module/BaseModuleInterface.php | 2 - core/lib/Thelia/Tests/Action/ContentTest.php | 2 +- core/lib/Thelia/Tests/Action/FolderTest.php | 5 +- core/lib/Thelia/Tests/Action/OrderTest.php | 1 - .../Tests/Action/RewrittenUrlTestTrait.php | 12 +- .../Condition/ConditionCollectionTest.php | 1 - .../Tests/Condition/ConditionFactoryTest.php | 2 - .../Implementation/MatchForEveryoneTest.php | 1 - .../MatchForTotalAmountTest.php | 6 - .../Tests/Core/Template/Loop/CategoryTest.php | 2 +- .../Tests/Core/Template/Loop/ContentTest.php | 2 +- .../Tests/Core/Template/Loop/FolderTest.php | 2 +- .../Tests/Core/Template/Loop/ProductTest.php | 2 +- .../Tests/Core/Template/Loop/TaxRuleTest.php | 2 +- .../Thelia/Tests/Coupon/CouponFactoryTest.php | 9 -- .../Thelia/Tests/Coupon/CouponManagerTest.php | 10 -- core/lib/Thelia/Tests/Model/Message.php | 5 +- core/lib/Thelia/Tools/FileManager.php | 1 - core/lib/Thelia/Tools/NumberFormat.php | 7 +- core/lib/Thelia/Tools/Password.php | 15 +- 112 files changed, 425 insertions(+), 526 deletions(-) diff --git a/core/lib/Thelia/Action/BaseAction.php b/core/lib/Thelia/Action/BaseAction.php index 1f04e12f6..c376a78b7 100755 --- a/core/lib/Thelia/Action/BaseAction.php +++ b/core/lib/Thelia/Action/BaseAction.php @@ -30,7 +30,6 @@ use Thelia\Core\Event\UpdateSeoEvent; use Thelia\Exception\UrlRewritingException; use Thelia\Form\Exception\FormValidationException; -use \Thelia\Model\Tools\UrlRewritingTrait; class BaseAction { @@ -82,8 +81,8 @@ class BaseAction /** * Changes SEO Fields for an object. * - * @param ModelCriteria $query - * @param UpdateSeoEvent $event + * @param ModelCriteria $query + * @param UpdateSeoEvent $event * * @return mixed */ @@ -105,7 +104,7 @@ class BaseAction // Update the rewritten URL, if required try { $object->setRewrittenUrl($event->getLocale(), $event->getUrl()); - } catch(UrlRewritingException $e) { + } catch (UrlRewritingException $e) { throw new FormValidationException($e->getMessage(), $e->getCode()); } diff --git a/core/lib/Thelia/Action/Coupon.php b/core/lib/Thelia/Action/Coupon.php index 1b77eb488..efda81229 100755 --- a/core/lib/Thelia/Action/Coupon.php +++ b/core/lib/Thelia/Action/Coupon.php @@ -138,7 +138,6 @@ class Coupon extends BaseAction implements EventSubscriberInterface } } - $event->setIsValid($isValid); $event->setDiscount($totalDiscount); } diff --git a/core/lib/Thelia/Action/MailingSystem.php b/core/lib/Thelia/Action/MailingSystem.php index f46352d53..2f62d749b 100644 --- a/core/lib/Thelia/Action/MailingSystem.php +++ b/core/lib/Thelia/Action/MailingSystem.php @@ -35,7 +35,7 @@ class MailingSystem extends BaseAction implements EventSubscriberInterface */ public function update(MailingSystemEvent $event) { - if($event->getEnabled()) { + if ($event->getEnabled()) { ConfigQuery::enableSmtp(); } else { ConfigQuery::disableSmtp(); diff --git a/core/lib/Thelia/Action/Order.php b/core/lib/Thelia/Action/Order.php index 0699c14d1..88cf4218a 100755 --- a/core/lib/Thelia/Action/Order.php +++ b/core/lib/Thelia/Action/Order.php @@ -290,7 +290,7 @@ class Order extends BaseAction implements EventSubscriberInterface { $contact_email = ConfigQuery::read('contact_email'); - if($contact_email) { + if ($contact_email) { $message = MessageQuery::create() ->filterByName('order_confirmation') diff --git a/core/lib/Thelia/Action/Product.php b/core/lib/Thelia/Action/Product.php index 6d477855b..a5defe5cb 100644 --- a/core/lib/Thelia/Action/Product.php +++ b/core/lib/Thelia/Action/Product.php @@ -131,7 +131,6 @@ class Product extends BaseAction implements EventSubscriberInterface return $this->genericUpdateSeo(ProductQuery::create(), $event); } - /** * Delete a product entry * diff --git a/core/lib/Thelia/Action/ProductSaleElement.php b/core/lib/Thelia/Action/ProductSaleElement.php index cad3be374..875dbcc1d 100644 --- a/core/lib/Thelia/Action/ProductSaleElement.php +++ b/core/lib/Thelia/Action/ProductSaleElement.php @@ -209,8 +209,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface if ($product->countSaleElements() <= 0) { // If we just deleted the last PSE, create a default one $product->createProductSaleElement($con, 0, 0, 0, $event->getCurrencyId(), true); - } - elseif ($pse->getIsDefault()) { + } elseif ($pse->getIsDefault()) { // If we deleted the default PSE, make the last created one the default $pse = ProductSaleElementsQuery::create() @@ -238,8 +237,8 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface * * @param ProductCombinationGenerationEvent $event */ - public function generateCombinations(ProductCombinationGenerationEvent $event) { - + public function generateCombinations(ProductCombinationGenerationEvent $event) + { $con = Propel::getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME); $con->beginTransaction(); @@ -252,7 +251,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface $isDefault = true; // Create all combinations - foreach($event->getCombinations() as $combinationAttributesAvIds) { + foreach ($event->getCombinations() as $combinationAttributesAvIds) { // Create the PSE $saleElement = $event->getProduct()->createProductSaleElement( @@ -276,8 +275,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface // Store all the stuff ! $con->commit(); - } - catch (\Exception $ex) { + } catch (\Exception $ex) { $con->rollback(); @@ -288,9 +286,9 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface /** * Create a combination for a given product sale element * - * @param ConnectionInterface $con the Propel connection - * @param ProductSaleElement $salesElement the product sale element - * @param unknown $combinationAttributes an array oif attributes av IDs + * @param ConnectionInterface $con the Propel connection + * @param ProductSaleElement $salesElement the product sale element + * @param unknown $combinationAttributes an array oif attributes av IDs */ protected function createCombination(ConnectionInterface $con, ProductSaleElements $salesElement, $combinationAttributes) { diff --git a/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php b/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php index cab25d13f..690f4362b 100644 --- a/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php +++ b/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php @@ -32,7 +32,6 @@ use Thelia\Core\Event\TheliaEvents; use Thelia\Model\AdminQuery; use Thelia\Tools\Password; - /** * command line for updating admin password * @@ -72,18 +71,15 @@ class AdminUpdatePasswordCommand extends ContainerAwareCommand { $login = $input->getArgument('login'); - if (null === $admin = AdminQuery::create()->filterByLogin($login)->findOne()) { throw new \RuntimeException(sprintf('Admin with login %s does not exists', $login)); } - $password = $input->getOption('password') ?: Password::generateRandom(); $event = new AdministratorUpdatePasswordEvent($admin); $event->setPassword($password); - $this-> getContainer() ->get('event_dispatcher') @@ -99,4 +95,3 @@ class AdminUpdatePasswordCommand extends ContainerAwareCommand } } - diff --git a/core/lib/Thelia/Config/I18n/en_US.php b/core/lib/Thelia/Config/I18n/en_US.php index ce333ddb4..2b8b661c2 100644 --- a/core/lib/Thelia/Config/I18n/en_US.php +++ b/core/lib/Thelia/Config/I18n/en_US.php @@ -1,14 +1,14 @@ 'Delivery module', - 'Quantity' => 'Quantity', - 'Product' => 'Product', - 'Unit. price' => 'Unit. price', - 'Tax' => 'Tax', - 'Unit taxed price' => 'Unit taxed price', - 'Taxed total' => 'Taxed total', - 'Payment module' => 'Payment module', - 'Postage' => 'Postage', - 'Total' => 'Total', + 'Delivery module' => 'Delivery module', + 'Quantity' => 'Quantity', + 'Product' => 'Product', + 'Unit. price' => 'Unit. price', + 'Tax' => 'Tax', + 'Unit taxed price' => 'Unit taxed price', + 'Taxed total' => 'Taxed total', + 'Payment module' => 'Payment module', + 'Postage' => 'Postage', + 'Total' => 'Total', ); diff --git a/core/lib/Thelia/Config/I18n/es_ES.php b/core/lib/Thelia/Config/I18n/es_ES.php index f1a85bd6a..0a749d4c1 100644 --- a/core/lib/Thelia/Config/I18n/es_ES.php +++ b/core/lib/Thelia/Config/I18n/es_ES.php @@ -1,36 +1,36 @@ 'Combination builder', - 'Title' => 'Title', - 'City' => 'City', - 'Zip code' => 'Zip code', - 'Country' => 'Country', - 'Phone' => 'Phone', - 'Login' => 'Login', - 'Password' => 'Password', - 'Profile' => 'Profile', - 'Postage' => 'Postage', - 'Add to all product templates' => 'Add to all product templates', - 'Quantity' => 'Quantity', - 'Name' => 'Name', - 'Value' => 'Value', - 'Subject' => 'Subject', - 'Company' => 'Company', - 'Description' => 'Description', - 'Language name' => 'Language name', - 'ISO 639 Code' => 'ISO 639 Code', - 'If a translation is missing or incomplete :' => 'If a translation is missing or incomplete :', - 'Host' => 'Host', - 'Port' => 'Port', - 'Encryption' => 'Encryption', - 'Username' => 'Username', - 'Timeout' => 'Timeout', - 'Source IP' => 'Source IP', - 'Email address' => 'Email address', - 'Firstname' => 'Firstname', - 'Lastname' => 'Lastname', - 'Additional address' => 'Additional address', - 'Reference' => 'Reference', - 'EAN Code' => 'EAN Code', + 'Combination builder' => 'Combination builder', + 'Title' => 'Title', + 'City' => 'City', + 'Zip code' => 'Zip code', + 'Country' => 'Country', + 'Phone' => 'Phone', + 'Login' => 'Login', + 'Password' => 'Password', + 'Profile' => 'Profile', + 'Postage' => 'Postage', + 'Add to all product templates' => 'Add to all product templates', + 'Quantity' => 'Quantity', + 'Name' => 'Name', + 'Value' => 'Value', + 'Subject' => 'Subject', + 'Company' => 'Company', + 'Description' => 'Description', + 'Language name' => 'Language name', + 'ISO 639 Code' => 'ISO 639 Code', + 'If a translation is missing or incomplete :' => 'If a translation is missing or incomplete :', + 'Host' => 'Host', + 'Port' => 'Port', + 'Encryption' => 'Encryption', + 'Username' => 'Username', + 'Timeout' => 'Timeout', + 'Source IP' => 'Source IP', + 'Email address' => 'Email address', + 'Firstname' => 'Firstname', + 'Lastname' => 'Lastname', + 'Additional address' => 'Additional address', + 'Reference' => 'Reference', + 'EAN Code' => 'EAN Code', ); diff --git a/core/lib/Thelia/Config/I18n/fr_FR.php b/core/lib/Thelia/Config/I18n/fr_FR.php index 7eb24949a..188d6f90a 100644 --- a/core/lib/Thelia/Config/I18n/fr_FR.php +++ b/core/lib/Thelia/Config/I18n/fr_FR.php @@ -23,4 +23,4 @@ return array( -); \ No newline at end of file +); diff --git a/core/lib/Thelia/Config/I18n/it_IT.php b/core/lib/Thelia/Config/I18n/it_IT.php index 7eb24949a..188d6f90a 100644 --- a/core/lib/Thelia/Config/I18n/it_IT.php +++ b/core/lib/Thelia/Config/I18n/it_IT.php @@ -23,4 +23,4 @@ return array( -); \ No newline at end of file +); diff --git a/core/lib/Thelia/Controller/Admin/AbstractCrudController.php b/core/lib/Thelia/Controller/Admin/AbstractCrudController.php index 028d5ab15..7e3f936fc 100644 --- a/core/lib/Thelia/Controller/Admin/AbstractCrudController.php +++ b/core/lib/Thelia/Controller/Admin/AbstractCrudController.php @@ -443,7 +443,6 @@ abstract class AbstractCrudController extends BaseAdminController $ex ); - //return $this->renderEditionTemplate(); } diff --git a/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php b/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php index 9918f8a2f..52c4bbda4 100644 --- a/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php +++ b/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php @@ -53,7 +53,7 @@ abstract class AbstractSeoCrudController extends AbstractCrudController * * @param string $visibilityToggleEventIdentifier the dispatched visibility toggle TheliaEvent identifier, or null if the object has no visible options. Example: TheliaEvents::MESSAGE_TOGGLE_VISIBILITY * @param string $changePositionEventIdentifier the dispatched position change TheliaEvent identifier, or null if the object has no position. Example: TheliaEvents::MESSAGE_UPDATE_POSITION - * @param string $updateSeoEventIdentifier the dispatched update SEO change TheliaEvent identifier, or null if the object has no SEO. Example: TheliaEvents::MESSAGE_UPDATE_SEO + * @param string $updateSeoEventIdentifier the dispatched update SEO change TheliaEvent identifier, or null if the object has no SEO. Example: TheliaEvents::MESSAGE_UPDATE_SEO */ public function __construct( $objectName, @@ -134,7 +134,8 @@ abstract class AbstractSeoCrudController extends AbstractCrudController * * @param unknown $object */ - protected function hydrateSeoForm($object){ + protected function hydrateSeoForm($object) + { // The "SEO" tab form $locale = $object->getLocale(); $data = array( @@ -227,8 +228,6 @@ abstract class AbstractSeoCrudController extends AbstractCrudController $ex ); - - // At this point, the form has errors, and should be redisplayed. return $this->renderEditionTemplate(); } diff --git a/core/lib/Thelia/Controller/Admin/AddressController.php b/core/lib/Thelia/Controller/Admin/AddressController.php index 3e2812bd0..c818ba492 100644 --- a/core/lib/Thelia/Controller/Admin/AddressController.php +++ b/core/lib/Thelia/Controller/Admin/AddressController.php @@ -98,7 +98,7 @@ class AddressController extends AbstractCrudController /** * Fills in the form data array * - * @param unknown $object + * @param unknown $object * @return multitype:NULL */ protected function createFormDataArray($object) @@ -309,7 +309,8 @@ class AddressController extends AbstractCrudController $this->redirectToEditionTemplate(); } - protected function getCustomerId() { + protected function getCustomerId() + { if (null !== $address = $this->getExistingObject()) return $address->getCustomerId(); else diff --git a/core/lib/Thelia/Controller/Admin/AttributeController.php b/core/lib/Thelia/Controller/Admin/AttributeController.php index ce1ca3072..b058f060d 100644 --- a/core/lib/Thelia/Controller/Admin/AttributeController.php +++ b/core/lib/Thelia/Controller/Admin/AttributeController.php @@ -34,7 +34,6 @@ use Thelia\Form\AttributeModificationForm; use Thelia\Form\AttributeCreationForm; use Thelia\Core\Event\UpdatePositionEvent; use Thelia\Model\AttributeAv; -use Thelia\Model\AttributeAvQuery; use Thelia\Core\Event\Attribute\AttributeAvUpdateEvent; use Thelia\Core\Event\Attribute\AttributeEvent; diff --git a/core/lib/Thelia/Controller/Admin/BaseAdminController.php b/core/lib/Thelia/Controller/Admin/BaseAdminController.php index 65d2e07fb..5ec95fa0c 100755 --- a/core/lib/Thelia/Controller/Admin/BaseAdminController.php +++ b/core/lib/Thelia/Controller/Admin/BaseAdminController.php @@ -309,6 +309,7 @@ class BaseAdminController extends BaseController { // Check if the functionality is activated if(!ConfigQuery::read("one_domain_foreach_lang", false)) + return; // If we don't have a locale value, use the locale value in the session @@ -390,8 +391,8 @@ class BaseAdminController extends BaseController * Render the given template, and returns the result as an Http Response. * * @param $templateName the complete template name, with extension - * @param array $args the template arguments - * @param int $status http code status + * @param array $args the template arguments + * @param int $status http code status * @return \Thelia\Core\HttpFoundation\Response */ protected function render($templateName, $args = array(), $status = 200) diff --git a/core/lib/Thelia/Controller/Admin/CategoryController.php b/core/lib/Thelia/Controller/Admin/CategoryController.php index 4f789244b..d2e0a0e9c 100755 --- a/core/lib/Thelia/Controller/Admin/CategoryController.php +++ b/core/lib/Thelia/Controller/Admin/CategoryController.php @@ -201,15 +201,12 @@ class CategoryController extends AbstractSeoCrudController protected function redirectToListTemplateWithId($category_id) { - if($category_id > 0) - { + if ($category_id > 0) { $this->redirectToRoute( 'admin.categories.default', array('category_id' => $category_id) ); - } - else - { + } else { $this->redirectToRoute( 'admin.catalog' ); diff --git a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php index 1a9172ec1..95d425edb 100644 --- a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php +++ b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php @@ -23,11 +23,9 @@ namespace Thelia\Controller\Admin; - use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\AccessManager; use Thelia\Form\ConfigStoreForm; -use Thelia\Log\Tlog; use Thelia\Model\ConfigQuery; /** * Class ConfigStoreController @@ -80,7 +78,7 @@ class ConfigStoreController extends BaseAdminController $data = $form->getData(); // Update store - foreach($data as $name => $value) { + foreach ($data as $name => $value) { if(! in_array($name , array('success_url', 'error_message'))) ConfigQuery::write($name, $value, false); } diff --git a/core/lib/Thelia/Controller/Admin/CustomerController.php b/core/lib/Thelia/Controller/Admin/CustomerController.php index a3239542c..95f6451c9 100644 --- a/core/lib/Thelia/Controller/Admin/CustomerController.php +++ b/core/lib/Thelia/Controller/Admin/CustomerController.php @@ -23,19 +23,14 @@ namespace Thelia\Controller\Admin; -use Propel\Runtime\Exception\PropelException; use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent; use Thelia\Core\Event\Customer\CustomerEvent; use Thelia\Core\Event\TheliaEvents; -use Thelia\Core\Security\AccessManager; use Thelia\Form\CustomerCreateForm; use Thelia\Form\CustomerUpdateForm; -use Thelia\Form\Exception\FormValidationException; use Thelia\Model\CustomerQuery; -use Thelia\Core\Translation\Translator; use Thelia\Tools\Password; -use Thelia\Model\AddressQuery; use Thelia\Model\Address; /** @@ -208,4 +203,4 @@ class CustomerController extends AbstractCrudController { $this->redirectToRoute("admin.customer.update.view", $this->getEditionArguments()); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Controller/Admin/FeatureController.php b/core/lib/Thelia/Controller/Admin/FeatureController.php index 8ff3a972e..5ae0aae7d 100644 --- a/core/lib/Thelia/Controller/Admin/FeatureController.php +++ b/core/lib/Thelia/Controller/Admin/FeatureController.php @@ -34,7 +34,6 @@ use Thelia\Form\FeatureModificationForm; use Thelia\Form\FeatureCreationForm; use Thelia\Core\Event\UpdatePositionEvent; use Thelia\Model\FeatureAv; -use Thelia\Model\FeatureAvQuery; use Thelia\Core\Event\Feature\FeatureAvUpdateEvent; use Thelia\Core\Event\Feature\FeatureEvent; diff --git a/core/lib/Thelia/Controller/Admin/FileController.php b/core/lib/Thelia/Controller/Admin/FileController.php index aff1c2d63..f123bfb94 100755 --- a/core/lib/Thelia/Controller/Admin/FileController.php +++ b/core/lib/Thelia/Controller/Admin/FileController.php @@ -584,7 +584,7 @@ class FileController extends BaseAdminController ); } - if(null === $message) { + if (null === $message) { $message = $this->getTranslator() ->trans( 'Images deleted successfully', @@ -638,7 +638,7 @@ class FileController extends BaseAdminController ) . $e->getMessage(); } - if(null === $message) { + if (null === $message) { $message = $this->getTranslator() ->trans( 'Image position updated', @@ -692,7 +692,7 @@ class FileController extends BaseAdminController ) . $e->getMessage(); } - if(null === $message) { + if (null === $message) { $message = $this->getTranslator() ->trans( 'Document position updated', diff --git a/core/lib/Thelia/Controller/Admin/HomeController.php b/core/lib/Thelia/Controller/Admin/HomeController.php index 0fcee29ca..d4458843d 100644 --- a/core/lib/Thelia/Controller/Admin/HomeController.php +++ b/core/lib/Thelia/Controller/Admin/HomeController.php @@ -42,7 +42,7 @@ class HomeController extends BaseAdminController public function loadStatsAjaxAction() { if (null !== $response = $this->checkAuth(self::RESOURCE_CODE, array(), AccessManager::VIEW)) return $response; - + $data = new \stdClass(); $data->title = "Stats on " . $this->getRequest()->query->get('month', date('m')) . "/" . $this->getRequest()->query->get('year', date('Y')); @@ -88,7 +88,6 @@ class HomeController extends BaseAdminController array(5) ); - $data->series = array( $saleSeries, $newCustomerSeries, diff --git a/core/lib/Thelia/Controller/Admin/MessageController.php b/core/lib/Thelia/Controller/Admin/MessageController.php index fe8b655c7..aebf29d04 100644 --- a/core/lib/Thelia/Controller/Admin/MessageController.php +++ b/core/lib/Thelia/Controller/Admin/MessageController.php @@ -31,7 +31,6 @@ use Thelia\Model\MessageQuery; use Thelia\Form\MessageModificationForm; use Thelia\Form\MessageCreationForm; use Symfony\Component\Finder\Finder; -use Thelia\Model\ConfigQuery; use Thelia\Core\Template\TemplateHelper; /** @@ -164,8 +163,8 @@ class MessageController extends AbstractCrudController return $this->render('messages'); } - protected function listDirectoryContent($requiredExtension) { - + protected function listDirectoryContent($requiredExtension) + { $list = array(); $dir = TemplateHelper::getInstance()->getActiveMailTemplate()->getAbsolutePath(); diff --git a/core/lib/Thelia/Controller/Admin/ModuleController.php b/core/lib/Thelia/Controller/Admin/ModuleController.php index 74fc1d760..2f80160aa 100644 --- a/core/lib/Thelia/Controller/Admin/ModuleController.php +++ b/core/lib/Thelia/Controller/Admin/ModuleController.php @@ -123,7 +123,6 @@ class ModuleController extends AbstractCrudController ->findOneById($this->getRequest()->get('module_id')); } - protected function getObjectLabel($object) { return $object->getTitle(); @@ -192,12 +191,11 @@ class ModuleController extends AbstractCrudController { $module = ModuleQuery::create()->findOneByCode($module_code); - if(null === $module) { + if (null === $module) { throw new \InvalidArgumentException(sprintf("Module `%s` does not exists", $module_code)); } if (null !== $response = $this->checkAuth(array(), $module_code, AccessManager::VIEW)) return $response; - return $this->render( "module-configure", array( diff --git a/core/lib/Thelia/Controller/Admin/OrderController.php b/core/lib/Thelia/Controller/Admin/OrderController.php index 56d130f5d..c04e2c93e 100644 --- a/core/lib/Thelia/Controller/Admin/OrderController.php +++ b/core/lib/Thelia/Controller/Admin/OrderController.php @@ -27,7 +27,6 @@ use Thelia\Core\HttpFoundation\Response; use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Event\Order\OrderAddressEvent; use Thelia\Core\Event\Order\OrderEvent; -use Thelia\Core\Event\PdfEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Security\AccessManager; use Thelia\Form\OrderUpdateAddress; @@ -36,7 +35,6 @@ use Thelia\Model\Base\OrderAddressQuery; use Thelia\Model\OrderQuery; use Thelia\Model\OrderStatusQuery; use Thelia\Tools\URL; -use Thelia\Core\Template\TemplateHelper; /** * Class OrderController @@ -203,20 +201,18 @@ class OrderController extends BaseAdminController public function generateInvoicePdf($order_id) { if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::UPDATE)) return $response; - return $this->generateBackOfficeOrderPdf($order_id, ConfigQuery::read('pdf_invoice_file', 'invoice')); } public function generateDeliveryPdf($order_id) { if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::UPDATE)) return $response; - return $this->generateBackOfficeOrderPdf($order_id, ConfigQuery::read('pdf_delivery_file', 'delivery')); } private function generateBackOfficeOrderPdf($order_id, $fileName) { - if(null === $response = $this->generateOrderPdf($order_id, $fileName)){ + if (null === $response = $this->generateOrderPdf($order_id, $fileName)) { $this->redirect(URL::getInstance()->absoluteUrl($this->getRoute("admin.order.update.view", array( 'order_id' => $order_id )))); @@ -225,5 +221,4 @@ class OrderController extends BaseAdminController return $response; } - } diff --git a/core/lib/Thelia/Controller/Admin/ProductController.php b/core/lib/Thelia/Controller/Admin/ProductController.php index b971f00c2..9d1daae06 100644 --- a/core/lib/Thelia/Controller/Admin/ProductController.php +++ b/core/lib/Thelia/Controller/Admin/ProductController.php @@ -72,7 +72,6 @@ use Thelia\Form\ProductCombinationGenerationForm; use Thelia\TaxEngine\Calculator; use Thelia\Tools\NumberFormat; - /** * Manages products * @@ -1037,17 +1036,18 @@ class ProductController extends AbstractSeoCrudController } // Create combinations - protected function combine($input, &$output, &$tmp) { + protected function combine($input, &$output, &$tmp) + { $current = array_shift($input); if (count($input) > 0) { - foreach($current as $element) { + foreach ($current as $element) { $tmp[] = $element; $this->combine($input, $output, $tmp); array_pop($tmp); } } else { - foreach($current as $element) { + foreach ($current as $element) { $tmp[] = $element; $output[] = $tmp; array_pop($tmp); @@ -1058,8 +1058,8 @@ class ProductController extends AbstractSeoCrudController /** * Build combinations from the combination output builder */ - public function buildCombinationsAction() { - + public function buildCombinationsAction() + { // Check current user authorization if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response; @@ -1082,7 +1082,7 @@ class ProductController extends AbstractSeoCrudController // from the list of attribute_id:attributes_av ID from the form. $combinations = $attributes_av_list = array(); - foreach($data['attribute_av'] as $item) { + foreach ($data['attribute_av'] as $item) { list($attribute_id, $attribute_av_id) = explode(':', $item); if (! isset($attributes_av_list[$attribute_id])) diff --git a/core/lib/Thelia/Controller/Admin/SystemLogController.php b/core/lib/Thelia/Controller/Admin/SystemLogController.php index e61d619f0..9dafd78f6 100644 --- a/core/lib/Thelia/Controller/Admin/SystemLogController.php +++ b/core/lib/Thelia/Controller/Admin/SystemLogController.php @@ -23,7 +23,6 @@ namespace Thelia\Controller\Admin; - use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\AccessManager; use Thelia\Form\SystemLogConfigurationForm; @@ -43,7 +42,7 @@ class SystemLogController extends BaseAdminController $destination_directories = Tlog::getInstance()->getDestinationsDirectories(); - foreach($destination_directories as $dir) { + foreach ($destination_directories as $dir) { $this->loadDefinedDestinations($dir, $destinations); } @@ -58,8 +57,8 @@ class SystemLogController extends BaseAdminController ); } - protected function loadDefinedDestinations($directory, &$destinations) { - + protected function loadDefinedDestinations($directory, &$destinations) + { try { foreach (new \DirectoryIterator($directory) as $fileInfo) { @@ -144,7 +143,7 @@ class SystemLogController extends BaseAdminController $active_destinations = array(); - foreach($destinations as $classname => $destination) { + foreach ($destinations as $classname => $destination) { if (isset($destination['active'])) { $active_destinations[] = $destination['classname']; @@ -153,7 +152,7 @@ class SystemLogController extends BaseAdminController if (isset($configs[$classname])) { // Update destinations configuration - foreach($configs[$classname] as $var => $value) { + foreach ($configs[$classname] as $var => $value) { ConfigQuery::write($var, $value, true, true); } } diff --git a/core/lib/Thelia/Controller/Admin/TranslationsController.php b/core/lib/Thelia/Controller/Admin/TranslationsController.php index cb7c3f072..e4fcfed23 100644 --- a/core/lib/Thelia/Controller/Admin/TranslationsController.php +++ b/core/lib/Thelia/Controller/Admin/TranslationsController.php @@ -23,12 +23,8 @@ namespace Thelia\Controller\Admin; - use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\AccessManager; -use Thelia\Form\SystemLogConfigurationForm; -use Thelia\Log\Tlog; -use Thelia\Model\ConfigQuery; use Thelia\Model\ModuleQuery; use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateDefinition; @@ -67,7 +63,7 @@ class TranslationsController extends BaseAdminController if (! empty($item_id) || $item_to_translate == 'co') { - switch($item_to_translate) { + switch ($item_to_translate) { case 'mo' : if (null !== $module = ModuleQuery::create()->findPk($item_id)) { @@ -149,8 +145,7 @@ class TranslationsController extends BaseAdminController $templateArguments['max_input_vars_warning'] = true; $templateArguments['required_max_input_vars'] = $stringsCount; $templateArguments['current_max_input_vars'] = ini_get('max_input_vars'); - } - else { + } else { $templateArguments['all_strings'] = $all_strings; } } @@ -162,14 +157,12 @@ class TranslationsController extends BaseAdminController public function defaultAction() { if (null !== $response = $this->checkAuth(AdminResources::TRANSLATIONS, array(), AccessManager::VIEW)) return $response; - return $this->renderTemplate(); } public function updateAction() { if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, array(), AccessManager::UPDATE)) return $response; - return $this->renderTemplate(); } } diff --git a/core/lib/Thelia/Controller/BaseController.php b/core/lib/Thelia/Controller/BaseController.php index 775861c32..b90d98462 100755 --- a/core/lib/Thelia/Controller/BaseController.php +++ b/core/lib/Thelia/Controller/BaseController.php @@ -61,7 +61,7 @@ abstract class BaseController extends ContainerAware /** * Return an empty response (after an ajax request, for example) - * @param int $status + * @param int $status * @return \Thelia\Core\HttpFoundation\Response */ protected function nullResponse($status = 200) @@ -252,7 +252,6 @@ abstract class BaseController extends ContainerAware } - } /** @@ -367,8 +366,8 @@ abstract class BaseController extends ContainerAware * Render the given template, and returns the result as an Http Response. * * @param $templateName the complete template name, with extension - * @param array $args the template arguments - * @param int $status http code status + * @param array $args the template arguments + * @param int $status http code status * @return \Thelia\Core\HttpFoundation\Response */ abstract protected function render($templateName, $args = array(), $status = 200); diff --git a/core/lib/Thelia/Controller/Front/BaseFrontController.php b/core/lib/Thelia/Controller/Front/BaseFrontController.php index e0f4ce105..0bf23ff62 100755 --- a/core/lib/Thelia/Controller/Front/BaseFrontController.php +++ b/core/lib/Thelia/Controller/Front/BaseFrontController.php @@ -25,10 +25,8 @@ namespace Thelia\Controller\Front; use Symfony\Component\Routing\Router; use Thelia\Controller\BaseController; use Thelia\Core\HttpFoundation\Response; -use Thelia\Core\Security\Exception\AuthenticationException; use Thelia\Core\Template\TemplateHelper; use Thelia\Model\AddressQuery; -use Thelia\Model\ConfigQuery; use Thelia\Model\ModuleQuery; use Thelia\Tools\Redirect; use Thelia\Tools\URL; @@ -106,8 +104,8 @@ class BaseFrontController extends BaseController * Render the given template, and returns the result as an Http Response. * * @param $templateName the complete template name, with extension - * @param array $args the template arguments - * @param int $status http code status + * @param array $args the template arguments + * @param int $status http code status * @return \Thelia\Core\HttpFoundation\Response */ protected function render($templateName, $args = array(), $status = 200) diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php index e007f9961..43f84ebd5 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php @@ -26,7 +26,6 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; - /** * Class TranslatorPass * @package Thelia\Core\DependencyInjection\Compiler @@ -50,11 +49,11 @@ class TranslatorPass implements CompilerPassInterface $translator = $container->getDefinition('thelia.translator'); - foreach($container->findTaggedServiceIds('translation.loader') as $id => $attributes) { + foreach ($container->findTaggedServiceIds('translation.loader') as $id => $attributes) { $translator->addMethodCall('addLoader', array($attributes[0]['alias'], new Reference($id))); if (isset($attributes[0]['legacy-alias'])) { $translator->addMethodCall('addLoader', array($attributes[0]['legacy-alias'], new Reference($id))); } } } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php b/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php index f155a9dce..8cfe1ee02 100644 --- a/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php +++ b/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php @@ -25,7 +25,6 @@ namespace Thelia\Core\Event\Administrator; use Thelia\Core\Event\ActionEvent; use Thelia\Model\Admin; - /** * Class AdministratorUpdatePasswordEvent * @package Thelia\Core\Event\Administrator @@ -82,4 +81,3 @@ class AdministratorUpdatePasswordEvent extends ActionEvent } } - diff --git a/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php index 2c45942f3..f35430c36 100755 --- a/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Customer; use Symfony\Component\EventDispatcher\Event; -use Thelia\Core\Event\ActionEvent; use Thelia\Model\Customer; /** diff --git a/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php b/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php index 0a046177e..943eb5b64 100755 --- a/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php +++ b/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Customer; -use Thelia\Core\Event\ActionEvent; use Thelia\Model\Customer; class CustomerLoginEvent extends CustomerEvent diff --git a/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php b/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php index 6630b7c13..b1446bfce 100644 --- a/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php @@ -138,4 +138,4 @@ class MessageUpdateEvent extends MessageCreateEvent return $this; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php b/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php index 05b55d733..ba0fccb68 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php @@ -65,6 +65,7 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setReference($reference) { $this->reference = $reference; + return $this; } @@ -76,6 +77,7 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setPrice($price) { $this->price = $price; + return $this; } @@ -87,6 +89,7 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setWeight($weight) { $this->weight = $weight; + return $this; } @@ -98,6 +101,7 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setQuantity($quantity) { $this->quantity = $quantity; + return $this; } @@ -109,6 +113,7 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setSalePrice($sale_price) { $this->sale_price = $sale_price; + return $this; } @@ -120,6 +125,7 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setOnsale($onsale) { $this->onsale = $onsale; + return $this; } @@ -131,6 +137,7 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setIsnew($isnew) { $this->isnew = $isnew; + return $this; } @@ -142,6 +149,7 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setEanCode($ean_code) { $this->ean_code = $ean_code; + return $this; return $this; } @@ -154,6 +162,7 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setCombinations($combinations) { $this->combinations = $combinations; + return $this; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php b/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php index af28ca73f..0e95abfba 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php @@ -60,4 +60,4 @@ class ProductSetTemplateEvent extends ProductEvent return $this; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php index 811b02fca..8f94b254b 100644 --- a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php @@ -22,7 +22,6 @@ /*************************************************************************************/ namespace Thelia\Core\Event\ProductSaleElement; -use Thelia\Model\Product; class ProductSaleElementDeleteEvent extends ProductSaleElementEvent { diff --git a/core/lib/Thelia/Core/Event/UpdateSeoEvent.php b/core/lib/Thelia/Core/Event/UpdateSeoEvent.php index caf46c1aa..cb287b869 100644 --- a/core/lib/Thelia/Core/Event/UpdateSeoEvent.php +++ b/core/lib/Thelia/Core/Event/UpdateSeoEvent.php @@ -184,5 +184,4 @@ class UpdateSeoEvent extends ActionEvent return $this->object; } - } diff --git a/core/lib/Thelia/Core/EventListener/ViewListener.php b/core/lib/Thelia/Core/EventListener/ViewListener.php index 022043bee..4c85f4bb7 100755 --- a/core/lib/Thelia/Core/EventListener/ViewListener.php +++ b/core/lib/Thelia/Core/EventListener/ViewListener.php @@ -30,12 +30,10 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Thelia\Core\HttpFoundation\Response; use Symfony\Component\Routing\Router; -use Thelia\Core\HttpKernel\Exception\NotFountHttpException; use Thelia\Core\Template\Exception\ResourceNotFoundException; use Thelia\Core\Template\ParserInterface; use Thelia\Core\Template\TemplateHelper; use Thelia\Exception\OrderException; -use Thelia\Model\ConfigQuery; use Thelia\Tools\Redirect; use Thelia\Tools\URL; use Thelia\Core\Security\Exception\AuthenticationException; diff --git a/core/lib/Thelia/Core/HttpFoundation/Response.php b/core/lib/Thelia/Core/HttpFoundation/Response.php index 277c16cc2..e279215b8 100644 --- a/core/lib/Thelia/Core/HttpFoundation/Response.php +++ b/core/lib/Thelia/Core/HttpFoundation/Response.php @@ -39,8 +39,8 @@ class Response extends BaseResponse * * @see \Thelia\Core\HttpFoundation\Response::sendContent() */ - public function sendContent() { - + public function sendContent() + { Tlog::getInstance()->write($this->content); parent::sendContent(); diff --git a/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php b/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php index b45f0f812..aceb6235f 100644 --- a/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php +++ b/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php @@ -65,7 +65,8 @@ class HttpCache extends BaseHttpCache implements HttpKernelInterface $request->getContent() ); } + return parent::handle($request, $type, $catch); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Security/SecurityContext.php b/core/lib/Thelia/Core/Security/SecurityContext.php index e97a19877..8512fac0e 100755 --- a/core/lib/Thelia/Core/Security/SecurityContext.php +++ b/core/lib/Thelia/Core/Security/SecurityContext.php @@ -177,7 +177,7 @@ class SecurityContext continue; } - if(!array_key_exists('module', $userPermissions)) { + if (!array_key_exists('module', $userPermissions)) { return false; } diff --git a/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php b/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php index d9109b2c8..d70da5759 100644 --- a/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php +++ b/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php @@ -23,12 +23,13 @@ namespace Thelia\Core\Template\Assets; -interface AssetManagerInterface { +interface AssetManagerInterface +{ /** * Prepare an asset directory. * - * @param string $source_assets_directory the full path to the source asstes directory - * @param string $web_assets_directory_base the base directory of the web based asset directory + * @param string $source_assets_directory the full path to the source asstes directory + * @param string $web_assets_directory_base the base directory of the web based asset directory * @throws \RuntimeException if something goes wrong. */ public function prepareAssets($source_assets_directory, $web_assets_directory_base); @@ -36,18 +37,18 @@ interface AssetManagerInterface { /** * Generates assets from $asset_path in $output_path, using $filters. * - * @param string $asset_path the full path to the asset file (or file collection, e.g. *.less) + * @param string $asset_path the full path to the asset file (or file collection, e.g. *.less) * - * @param string $web_assets_directory_base the full disk path to the base assets output directory in the web space - * @param string $output_url the URL to the base assets output directory in the web space + * @param string $web_assets_directory_base the full disk path to the base assets output directory in the web space + * @param string $output_url the URL to the base assets output directory in the web space * - * @param string $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. - * @param array $filters a list of filters, as defined below (see switch($filter_name) ...) + * @param string $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. + * @param array $filters a list of filters, as defined below (see switch($filter_name) ...) * - * @param boolean $debug the debug mode, true or false + * @param boolean $debug the debug mode, true or false * * @throws \InvalidArgumentException if an invalid filter name is found * @return string The URL to the generated asset file. */ public function processAsset($asset_path, $web_assets_directory_base, $output_url, $asset_type, $filters, $debug); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php b/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php index 146a5791d..3157a3fa8 100755 --- a/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php +++ b/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php @@ -52,7 +52,7 @@ class AsseticAssetManager implements AssetManagerInterface /** * Create a stamp form the modification time of the content of the given directory and all of its subdirectories * - * @param string $directory ther directory name + * @param string $directory ther directory name * @return string the stamp of this directory */ protected function getStamp($directory) @@ -75,7 +75,8 @@ class AsseticAssetManager implements AssetManagerInterface * * @param \DirectoryIterator $fileInfo */ - protected function isSourceFile(\SplFileInfo $fileInfo) { + protected function isSourceFile(\SplFileInfo $fileInfo) + { return in_array($fileInfo->getExtension(), $this->source_file_extensions); } @@ -83,8 +84,8 @@ class AsseticAssetManager implements AssetManagerInterface * Recursively copy assets from the source directory to the destination * directory in the web space, ommiting source files. * - * @param string $from_directory the source - * @param string $to_directory the destination + * @param string $from_directory the source + * @param string $to_directory the destination * @throws \RuntimeException if a problem occurs. */ protected function copyAssets(Filesystem $fs, $from_directory, $to_directory) @@ -124,9 +125,9 @@ class AsseticAssetManager implements AssetManagerInterface /** * Compite the assets path relative to the base template directory * - * @param string $source_assets_directory the source directory - * @param string $web_assets_directory_base base directory of the web assets - * @return the full path of the destination directory + * @param string $source_assets_directory the source directory + * @param string $web_assets_directory_base base directory of the web assets + * @return the full path of the destination directory */ protected function getRelativeDirectoryPath($source_assets_directory, $web_assets_directory_base) { @@ -145,9 +146,9 @@ class AsseticAssetManager implements AssetManagerInterface * Compute the destination directory path, from the source directory and the * base directory of the web assets * - * @param string $source_assets_directory the source directory - * @param string $web_assets_directory_base base directory of the web assets - * @return the full path of the destination directory + * @param string $source_assets_directory the source directory + * @param string $web_assets_directory_base base directory of the web assets + * @return the full path of the destination directory */ protected function getDestinationDirectory($source_assets_directory, $web_assets_directory_base) { @@ -160,12 +161,12 @@ class AsseticAssetManager implements AssetManagerInterface * the source directory. If any change is detected, the whole asset directory * is copied in the web space. * - * @param string $source_assets_directory the full path to the source asstes directory - * @param string $web_assets_directory_base the base directory of the web based asset directory + * @param string $source_assets_directory the full path to the source asstes directory + * @param string $web_assets_directory_base the base directory of the web based asset directory * @throws \RuntimeException if something goes wrong. */ - public function prepareAssets($source_assets_directory, $web_assets_directory_base) { - + public function prepareAssets($source_assets_directory, $web_assets_directory_base) + { // Compute the absolute path of the output directory $to_directory = $this->getDestinationDirectory($source_assets_directory, $web_assets_directory_base); @@ -217,8 +218,7 @@ class AsseticAssetManager implements AssetManagerInterface throw new \RuntimeException( "Failed to create asset stamp file $stamp_file_path. Please check that your web server has the proper access rights to do that."); } -/* } - else { +/* } else { @fclose($fp); } */ @@ -228,13 +228,13 @@ class AsseticAssetManager implements AssetManagerInterface /** * Decode the filters names, and initialize the Assetic FilterManager * - * @param FilterManager $filterManager the Assetic filter manager - * @param string $filters a comma separated list of filter names + * @param FilterManager $filterManager the Assetic filter manager + * @param string $filters a comma separated list of filter names * @throws \InvalidArgumentException if a wrong filter is passed - * @return an array of filter names + * @return an array of filter names */ - protected function decodeAsseticFilters(FilterManager $filterManager, $filters) { - + protected function decodeAsseticFilters(FilterManager $filterManager, $filters) + { if (!empty($filters)) { $filter_list = explode(',', $filters); @@ -273,8 +273,7 @@ class AsseticAssetManager implements AssetManagerInterface break; } } - } - else { + } else { $filter_list = array(); } @@ -284,15 +283,15 @@ class AsseticAssetManager implements AssetManagerInterface /** * Generates assets from $asset_path in $output_path, using $filters. * - * @param string $asset_path the full path to the asset file (or file collection, e.g. *.less) + * @param string $asset_path the full path to the asset file (or file collection, e.g. *.less) * - * @param string $web_assets_directory_base the full disk path to the base assets output directory in the web space - * @param string $output_url the URL to the base assets output directory in the web space + * @param string $web_assets_directory_base the full disk path to the base assets output directory in the web space + * @param string $output_url the URL to the base assets output directory in the web space * - * @param string $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. - * @param array $filters a list of filters, as defined below (see switch($filter_name) ...) + * @param string $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. + * @param array $filters a list of filters, as defined below (see switch($filter_name) ...) * - * @param boolean $debug true / false + * @param boolean $debug true / false * @throws \InvalidArgumentException if an invalid filter name is found * @return string The URL to the generated asset file. */ @@ -347,4 +346,4 @@ class AsseticAssetManager implements AssetManagerInterface return rtrim($output_url, '/') . '/' . ltrim($output_relative_web_path, '/') . $asset_target_filename; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index 6d4e6ed92..db61c20c1 100755 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -277,7 +277,6 @@ abstract class BaseLoop } } - protected function searchArray(array $search, &$pagination = null) { if (false === $this->countable) { @@ -286,7 +285,7 @@ abstract class BaseLoop if ($this->getArgValue('page') !== null) { $nbPage = ceil(count($search)/$this->getArgValue('limit')); - if($this->getArgValue('page') > $nbPage || $this->getArgValue('page') <= 0) { + if ($this->getArgValue('page') > $nbPage || $this->getArgValue('page') <= 0) { return array(); } @@ -338,9 +337,9 @@ abstract class BaseLoop */ public function exec(&$pagination) { - if($this instanceof PropelSearchLoopInterface) { + if ($this instanceof PropelSearchLoopInterface) { $searchModelCriteria = $this->buildModelCriteria(); - if(null === $searchModelCriteria) { + if (null === $searchModelCriteria) { $results = array(); } else { $results = $this->search( @@ -350,7 +349,7 @@ abstract class BaseLoop } } elseif ($this instanceof ArraySearchLoopInterface) { $searchArray = $this->buildArray(); - if(null === $searchArray) { + if (null === $searchArray) { $results = array(); } else { $results = $this->searchArray( @@ -362,13 +361,13 @@ abstract class BaseLoop $loopResult = new LoopResult($results); - if(true === $this->countable) { + if (true === $this->countable) { $loopResult->setCountable(); } - if(true === $this->timestampable) { + if (true === $this->timestampable) { $loopResult->setTimestamped(); } - if(true === $this->versionable) { + if (true === $this->versionable) { $loopResult->setVersioned(); } @@ -382,29 +381,29 @@ abstract class BaseLoop * - ArraySearchLoopInterface */ $searchInterface = false; - if($this instanceof PropelSearchLoopInterface) { - if(true === $searchInterface) { + if ($this instanceof PropelSearchLoopInterface) { + if (true === $searchInterface) { throw new LoopException('Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::MULTIPLE_SEARCH_INTERFACE); } $searchInterface = true; } - if($this instanceof ArraySearchLoopInterface) { - if(true === $searchInterface) { + if ($this instanceof ArraySearchLoopInterface) { + if (true === $searchInterface) { throw new LoopException('Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::MULTIPLE_SEARCH_INTERFACE); } $searchInterface = true; } - if(false === $searchInterface) { + if (false === $searchInterface) { throw new LoopException('Loop must implements one of the following interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::SEARCH_INTERFACE_NOT_FOUND); } /* Only PropelSearch allows timestamp and version */ - if(!$this instanceof PropelSearchLoopInterface) { - if(true === $this->timestampable) { + if (!$this instanceof PropelSearchLoopInterface) { + if (true === $this->timestampable) { throw new LoopException("Loop must implements 'PropelSearchLoopInterface' to be timestampable", LoopException::NOT_TIMESTAMPED); } - if(true === $this->versionable) { + if (true === $this->versionable) { throw new LoopException("Loop must implements 'PropelSearchLoopInterface' to be versionable", LoopException::NOT_VERSIONED); } } diff --git a/core/lib/Thelia/Core/Template/Loop/Admin.php b/core/lib/Thelia/Core/Template/Loop/Admin.php index ef5ce7e1f..d9c49ef80 100755 --- a/core/lib/Thelia/Core/Template/Loop/Admin.php +++ b/core/lib/Thelia/Core/Template/Loop/Admin.php @@ -33,7 +33,6 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Model\AdminQuery; -use Thelia\Type; /** * diff --git a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php index 9411b1dbd..4ae41c3b6 100755 --- a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php +++ b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php @@ -48,7 +48,7 @@ class AssociatedContent extends Content { protected $contentId; protected $contentPosition; - + /** * @return ArgumentCollection */ diff --git a/core/lib/Thelia/Core/Template/Loop/Auth.php b/core/lib/Thelia/Core/Template/Loop/Auth.php index 072193f34..0cb7a5e88 100755 --- a/core/lib/Thelia/Core/Template/Loop/Auth.php +++ b/core/lib/Thelia/Core/Template/Loop/Auth.php @@ -88,7 +88,7 @@ class Auth extends BaseLoop implements ArraySearchLoopInterface $module = $this->getModule(); $access = $this->getAccess(); - if(null !== $module) { + if (null !== $module) { $in = true; } diff --git a/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php b/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php index c1bc483f9..ae7226152 100644 --- a/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php +++ b/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php @@ -24,7 +24,6 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Thelia\Core\Template\Element\BaseI18nLoop; -use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; diff --git a/core/lib/Thelia/Core/Template/Loop/Cart.php b/core/lib/Thelia/Core/Template/Loop/Cart.php index b2121757a..b3cdf194d 100755 --- a/core/lib/Thelia/Core/Template/Loop/Cart.php +++ b/core/lib/Thelia/Core/Template/Loop/Cart.php @@ -57,7 +57,7 @@ class Cart extends BaseLoop implements ArraySearchLoopInterface { $cart = $this->getCart($this->request); - if(null === $cart) { + if (null === $cart) { return array(); } @@ -80,7 +80,7 @@ class Cart extends BaseLoop implements ArraySearchLoopInterface { $taxCountry = CountryQuery::create()->findPk(64); // @TODO : make it magic; - foreach($loopResult->getResultDataCollection() as $cartItem) { + foreach ($loopResult->getResultDataCollection() as $cartItem) { $product = $cartItem->getProduct(); $productSaleElement = $cartItem->getProductSaleElements(); diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php index 1b7f68f22..d70654d0b 100755 --- a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php +++ b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php @@ -125,9 +125,9 @@ class CategoryPath extends BaseI18nLoop implements ArraySearchLoopInterface public function parseResults(LoopResult $loopResult) { - foreach($loopResult->getResultDataCollection() as $result) { + foreach ($loopResult->getResultDataCollection() as $result) { $loopResultRow = new LoopResultRow($result); - foreach($result as $output => $outputValue) { + foreach ($result as $output => $outputValue) { $loopResultRow->set($output, $outputValue); } $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php index 3c3c3ffe0..35a9569f9 100755 --- a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php +++ b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php @@ -99,9 +99,9 @@ class CategoryTree extends BaseI18nLoop implements ArraySearchLoopInterface public function parseResults(LoopResult $loopResult) { - foreach($loopResult->getResultDataCollection() as $result) { + foreach ($loopResult->getResultDataCollection() as $result) { $loopResultRow = new LoopResultRow($result); - foreach($result as $output => $outputValue) { + foreach ($result as $output => $outputValue) { $loopResultRow->set($output, $outputValue); } $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/Coupon.php b/core/lib/Thelia/Core/Template/Loop/Coupon.php index e211103da..622a3a18c 100755 --- a/core/lib/Thelia/Core/Template/Loop/Coupon.php +++ b/core/lib/Thelia/Core/Template/Loop/Coupon.php @@ -24,7 +24,6 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; -use Propel\Runtime\Util\PropelModelPager; use Thelia\Condition\ConditionFactory; use Thelia\Condition\Implementation\ConditionInterface; use Thelia\Core\HttpFoundation\Request; diff --git a/core/lib/Thelia/Core/Template/Loop/Currency.php b/core/lib/Thelia/Core/Template/Loop/Currency.php index 82aebeb32..3d7a5631e 100755 --- a/core/lib/Thelia/Core/Template/Loop/Currency.php +++ b/core/lib/Thelia/Core/Template/Loop/Currency.php @@ -158,6 +158,7 @@ class Currency extends BaseI18nLoop implements PropelSearchLoopInterface } /* perform search */ + return $search; } diff --git a/core/lib/Thelia/Core/Template/Loop/Customer.php b/core/lib/Thelia/Core/Template/Loop/Customer.php index f955cd217..d4b8effb0 100755 --- a/core/lib/Thelia/Core/Template/Loop/Customer.php +++ b/core/lib/Thelia/Core/Template/Loop/Customer.php @@ -36,9 +36,6 @@ use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Model\CustomerQuery; use Thelia\Type\TypeCollection; use Thelia\Type; -use Thelia\Model\OrderQuery; -use Thelia\Model\Map\OrderAddressTableMap; -use Thelia\Model\Map\OrderTableMap; /** * @@ -208,7 +205,6 @@ class Customer extends BaseLoop implements SearchLoopInterface, PropelSearchLoop $search->orderByCreatedAt(Criteria::DESC); break; - } } diff --git a/core/lib/Thelia/Core/Template/Loop/Delivery.php b/core/lib/Thelia/Core/Template/Loop/Delivery.php index 5211d3a79..5e916f654 100644 --- a/core/lib/Thelia/Core/Template/Loop/Delivery.php +++ b/core/lib/Thelia/Core/Template/Loop/Delivery.php @@ -73,8 +73,8 @@ class Delivery extends BaseSpecificModule try { $postage = $moduleInstance->getPostage($country); - } catch(OrderException $e) { - switch($e->getCode()) { + } catch (OrderException $e) { + switch ($e->getCode()) { case OrderException::DELIVERY_MODULE_UNAVAILABLE: /* do not show this delivery module */ continue(2); diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index 84dee9f82..fa561b3fb 100755 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -126,7 +126,6 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface if ($visible !== BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0); - $orders = $this->getOrder(); foreach ($orders as $order) { diff --git a/core/lib/Thelia/Core/Template/Loop/FolderPath.php b/core/lib/Thelia/Core/Template/Loop/FolderPath.php index 92c42f890..b50d7c55d 100644 --- a/core/lib/Thelia/Core/Template/Loop/FolderPath.php +++ b/core/lib/Thelia/Core/Template/Loop/FolderPath.php @@ -135,9 +135,9 @@ class FolderPath extends BaseI18nLoop implements ArraySearchLoopInterface public function parseResults(LoopResult $loopResult) { - foreach($loopResult->getResultDataCollection() as $result) { + foreach ($loopResult->getResultDataCollection() as $result) { $loopResultRow = new LoopResultRow($result); - foreach($result as $output => $outputValue) { + foreach ($result as $output => $outputValue) { $loopResultRow->set($output, $outputValue); } $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/FolderTree.php b/core/lib/Thelia/Core/Template/Loop/FolderTree.php index 9598f7a5c..851b6d8ff 100644 --- a/core/lib/Thelia/Core/Template/Loop/FolderTree.php +++ b/core/lib/Thelia/Core/Template/Loop/FolderTree.php @@ -100,9 +100,9 @@ class FolderTree extends BaseI18nLoop implements ArraySearchLoopInterface public function parseResults(LoopResult $loopResult) { - foreach($loopResult->getResultDataCollection() as $result) { + foreach ($loopResult->getResultDataCollection() as $result) { $loopResultRow = new LoopResultRow($result); - foreach($result as $output => $outputValue) { + foreach ($result as $output => $outputValue) { $loopResultRow->set($output, $outputValue); } $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/Image.php b/core/lib/Thelia/Core/Template/Loop/Image.php index b207deb29..def24ae2a 100755 --- a/core/lib/Thelia/Core/Template/Loop/Image.php +++ b/core/lib/Thelia/Core/Template/Loop/Image.php @@ -236,7 +236,6 @@ class Image extends BaseI18nLoop implements PropelSearchLoopInterface $search->filterById($exclude, Criteria::NOT_IN); // echo "sql=".$search->toString(); - return $search; } diff --git a/core/lib/Thelia/Core/Template/Loop/Module.php b/core/lib/Thelia/Core/Template/Loop/Module.php index 0b10517b2..552a3219d 100755 --- a/core/lib/Thelia/Core/Template/Loop/Module.php +++ b/core/lib/Thelia/Core/Template/Loop/Module.php @@ -153,19 +153,19 @@ class Module extends BaseI18nLoop implements PropelSearchLoopInterface /* first test if module defines it's own config route */ $routerId = "router." . $module->getBaseDir(); - if($this->container->has($routerId)) { + if ($this->container->has($routerId)) { try { - if($this->container->get($routerId)->match('/admin/module/' . $module->getCode())) { + if ($this->container->get($routerId)->match('/admin/module/' . $module->getCode())) { $hasConfigurationInterface = true; } - } catch(ResourceNotFoundException $e) { + } catch (ResourceNotFoundException $e) { /* $hasConfigurationInterface stays false */ } } /* if not ; test if it uses admin inclusion : module_configuration.html */ - if(false === $hasConfigurationInterface) { - if(file_exists( sprintf("%s/AdminIncludes/%s.html", $module->getAbsoluteBaseDir(), "module_configuration"))) { + if (false === $hasConfigurationInterface) { + if (file_exists( sprintf("%s/AdminIncludes/%s.html", $module->getAbsoluteBaseDir(), "module_configuration"))) { $hasConfigurationInterface = true; } } diff --git a/core/lib/Thelia/Core/Template/Loop/Order.php b/core/lib/Thelia/Core/Template/Loop/Order.php index 5f12fa1eb..7c080aa54 100755 --- a/core/lib/Thelia/Core/Template/Loop/Order.php +++ b/core/lib/Thelia/Core/Template/Loop/Order.php @@ -46,7 +46,7 @@ use Thelia\Type; */ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInterface { - protected $countable = true; + protected $countable = true; protected $timestampable = true; protected $versionable = false; diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProduct.php b/core/lib/Thelia/Core/Template/Loop/OrderProduct.php index f36162099..8e201f31c 100755 --- a/core/lib/Thelia/Core/Template/Loop/OrderProduct.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderProduct.php @@ -72,7 +72,7 @@ class OrderProduct extends BaseLoop implements PropelSearchLoopInterface $search->orderById(Criteria::ASC); return $search; - + } public function parseResults(LoopResult $loopResult) diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php index f248159c5..bb018ec98 100755 --- a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php @@ -87,7 +87,7 @@ class OrderProductAttributeCombination extends BaseI18nLoop implements PropelSea } return $search; - + } public function parseResults(LoopResult $loopResult) diff --git a/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php b/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php index ea1d94262..4d6491509 100644 --- a/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php +++ b/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php @@ -103,4 +103,4 @@ class ProductTemplate extends BaseI18nLoop implements PropelSearchLoopInterface return $loopResult; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/Profile.php b/core/lib/Thelia/Core/Template/Loop/Profile.php index bddcf856c..8b21d2fe0 100755 --- a/core/lib/Thelia/Core/Template/Loop/Profile.php +++ b/core/lib/Thelia/Core/Template/Loop/Profile.php @@ -33,7 +33,6 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Model\ProfileQuery; -use Thelia\Type; /** * diff --git a/core/lib/Thelia/Core/Template/Loop/Template.php b/core/lib/Thelia/Core/Template/Loop/Template.php index fc9505449..518f4319f 100644 --- a/core/lib/Thelia/Core/Template/Loop/Template.php +++ b/core/lib/Thelia/Core/Template/Loop/Template.php @@ -23,19 +23,12 @@ namespace Thelia\Core\Template\Loop; -use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Core\Security\AccessManager; -use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; -use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; -use Thelia\Model\ModuleQuery; - -use Thelia\Module\BaseModule; use Thelia\Type; use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateDefinition; @@ -72,7 +65,8 @@ class Template extends BaseLoop implements ArraySearchLoopInterface ); } - public function buildArray() { + public function buildArray() + { $type = $this->getArg(template_type); if ($type == 'front-office') @@ -104,4 +98,4 @@ class Template extends BaseLoop implements ArraySearchLoopInterface return $loopResult; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php index dd8491bb2..e229d754c 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php +++ b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Template\Smarty\Assets; -use Thelia\Core\Template\Assets\AsseticHelper; use Thelia\Tools\URL; use Thelia\Core\Template\Assets\AssetManagerInterface; @@ -39,9 +38,9 @@ class SmartyAssetsManager /** * Creates a new SmartyAssetsManager instance * - * @param AssetManagerInterface $assetsManager an asset manager instance - * @param string $web_root the disk path to the web root (with final /) - * @param string $path_relative_to_web_root the path (relative to web root) where the assets will be generated + * @param AssetManagerInterface $assetsManager an asset manager instance + * @param string $web_root the disk path to the web root (with final /) + * @param string $path_relative_to_web_root the path (relative to web root) where the assets will be generated */ public function __construct(AssetManagerInterface $assetsManager, $web_root, $path_relative_to_web_root) { @@ -51,8 +50,8 @@ class SmartyAssetsManager $this->assetsManager = $assetsManager; } - public function prepareAssets($assets_directory, \Smarty_Internal_Template $template) { - + public function prepareAssets($assets_directory, \Smarty_Internal_Template $template) + { $tpl_dir = dirname($template->source->filepath); $asset_dir_absolute_path = realpath($tpl_dir . DS . $assets_directory); diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php index 78e1c8f5b..8b8ee8ef1 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php @@ -27,8 +27,6 @@ use Thelia\Core\Template\Smarty\SmartyPluginDescriptor; use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Tools\URL; use Thelia\Core\Security\SecurityContext; -use Thelia\Model\Config; -use Thelia\Model\ConfigQuery; use Thelia\Core\Template\TemplateHelper; /** @@ -45,8 +43,8 @@ class AdminUtilities extends AbstractSmartyPlugin $this->securityContext = $securityContext; } - protected function fetch_snippet($smarty, $templateName, $variablesArray) { - + protected function fetch_snippet($smarty, $templateName, $variablesArray) + { $data = ''; $snippet_path = sprintf('%s/%s/%s.html', @@ -99,7 +97,6 @@ class AdminUtilities extends AbstractSmartyPlugin $module === null ? array() : array($module), array($access)) ) { - return $this->fetch_snippet($smarty, 'includes/admin-utilities-position-block', array( 'admin_utilities_go_up_url' => URL::getInstance()->absoluteUrl($path, array('mode' => 'up', $url_parameter => $id)), 'admin_utilities_in_place_edit_class' => $in_place_edit_class, diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php index e4c220ed5..e4a5c866f 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php @@ -56,10 +56,11 @@ class Assets extends AbstractSmartyPlugin { try { return $this->assetManager->processSmartyPluginCall('js', $params, $content, $template, $repeat); - } catch(\Exception $e) { + } catch (\Exception $e) { $catchException = $this->getNormalizedParam($params, array('catchException')); - if($catchException == "true") { + if ($catchException == "true") { $repeat = false; + return null; } else { throw $e; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php index 8cea3c60d..a9ca6be6d 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php @@ -266,69 +266,69 @@ class DataAccessFunctions extends AbstractSmartyPlugin $includeShipping = true; } - if($params['startDate'] == 'today') { + if ($params['startDate'] == 'today') { $startDate = new \DateTime(); $startDate->setTime(0, 0, 0); - } elseif($params['startDate'] == 'yesterday') { + } elseif ($params['startDate'] == 'yesterday') { $startDate = new \DateTime(); $startDate->setTime(0, 0, 0); $startDate->modify('-1 day'); - } elseif($params['startDate'] == 'this_month') { + } elseif ($params['startDate'] == 'this_month') { $startDate = new \DateTime(); $startDate->modify('first day of this month'); $startDate->setTime(0, 0, 0); - } elseif($params['startDate'] == 'last_month') { + } elseif ($params['startDate'] == 'last_month') { $startDate = new \DateTime(); $startDate->modify('first day of last month'); $startDate->setTime(0, 0, 0); - } elseif($params['startDate'] == 'this_year') { + } elseif ($params['startDate'] == 'this_year') { $startDate = new \DateTime(); $startDate->modify('first day of January this year'); $startDate->setTime(0, 0, 0); - } elseif($params['startDate'] == 'last_year') { + } elseif ($params['startDate'] == 'last_year') { $startDate = new \DateTime(); $startDate->modify('first day of December last year'); $startDate->setTime(0, 0, 0); } else { try { $startDate = new \DateTime($params['startDate']); - } catch(\Exception $e) { + } catch (\Exception $e) { throw new \InvalidArgumentException(sprintf("invalid startDate attribute '%s' in stats access function", $params['startDate'])); } } - if($params['endDate'] == 'today') { + if ($params['endDate'] == 'today') { $endDate = new \DateTime(); $endDate->setTime(0, 0, 0); - } elseif($params['endDate'] == 'yesterday') { + } elseif ($params['endDate'] == 'yesterday') { $endDate = new \DateTime(); $endDate->setTime(0, 0, 0); $endDate->modify('-1 day'); - } elseif($params['endDate'] == 'this_month') { + } elseif ($params['endDate'] == 'this_month') { $endDate = new \DateTime(); $endDate->modify('last day of this month'); $endDate->setTime(0, 0, 0); - } elseif($params['endDate'] == 'last_month') { + } elseif ($params['endDate'] == 'last_month') { $endDate = new \DateTime(); $endDate->modify('last day of last month'); $endDate->setTime(0, 0, 0); - } elseif($params['endDate'] == 'this_year') { + } elseif ($params['endDate'] == 'this_year') { $endDate = new \DateTime(); $endDate->modify('last day of December this year'); $endDate->setTime(0, 0, 0); - } elseif($params['endDate'] == 'last_year') { + } elseif ($params['endDate'] == 'last_year') { $endDate = new \DateTime(); $endDate->modify('last day of January last year'); $endDate->setTime(0, 0, 0); } else { try { $endDate = new \DateTime($params['endDate']); - } catch(\Exception $e) { + } catch (\Exception $e) { throw new \InvalidArgumentException(sprintf("invalid endDate attribute '%s' in stats access function", $params['endDate'])); } } - switch( $params['key'] ) { + switch ($params['key']) { case 'sales' : return OrderQuery::getSaleStats($startDate, $endDate, $includeShipping); case 'orders' : diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php index 453335740..cfa3788bd 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php @@ -28,7 +28,6 @@ use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Core\Template\Smarty\an; use Thelia\Core\Template\Smarty\SmartyPluginDescriptor; - /** * Class Esi * @package Thelia\Core\Template\Smarty\Plugins @@ -53,7 +52,7 @@ class Esi extends AbstractSmartyPlugin $ignore_errors = $this->getParam($params, 'ignore_errors'); $comment = $this->getParam($params, 'comment'); - if(null === $path) { + if (null === $path) { return; } @@ -79,4 +78,4 @@ class Esi extends AbstractSmartyPlugin new SmartyPluginDescriptor('function', 'render_esi', $this, 'renderEsi') ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php index 9b86410de..4c92ee85c 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php @@ -48,7 +48,7 @@ class Module extends AbstractSmartyPlugin /** * Process theliaModule template inclusion function * - * @param unknown $params + * @param unknown $params * @param \Smarty_Internal_Template $template * @internal param \Thelia\Core\Template\Smarty\Plugins\unknown $smarty * @@ -60,7 +60,7 @@ class Module extends AbstractSmartyPlugin if (false !== $location = $this->getParam($params, 'location', false)) { - if($this->debug === true && $this->request->get('SHOW_INCLUDE')) { + if ($this->debug === true && $this->request->get('SHOW_INCLUDE')) { echo sprintf('
%s
', $location); } @@ -70,7 +70,7 @@ class Module extends AbstractSmartyPlugin foreach ($modules as $module) { - if(null !== $moduleLimit && $moduleLimit != $module->getCode()) { + if (null !== $moduleLimit && $moduleLimit != $module->getCode()) { continue; } diff --git a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php index 2e52e21e0..ca1e3cb7b 100755 --- a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php +++ b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php @@ -14,8 +14,6 @@ use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Core\Template\Exception\ResourceNotFoundException; use Thelia\Core\Template\ParserContext; use Thelia\Core\Template\TemplateDefinition; -use Thelia\Model\ConfigQuery; -use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Translation\Translator; /** @@ -66,7 +64,6 @@ class SmartyParser extends Smarty implements ParserInterface $this->setCompileDir($compile_dir); $this->setCacheDir($cache_dir); - $this->debugging = $debug; // Prevent smarty ErrorException: Notice: Undefined index bla bla bla... @@ -74,7 +71,7 @@ class SmartyParser extends Smarty implements ParserInterface // Si on n'est pas en mode debug, activer le cache, avec une lifetime de 15mn, et en vérifiant que les templates sources n'ont pas été modifiés. - if($debug) { + if ($debug) { $this->setCaching(Smarty::CACHING_OFF); $this->setForceCompile(true); } else { @@ -83,7 +80,6 @@ class SmartyParser extends Smarty implements ParserInterface //$this->enableSecurity(); - // The default HTTP status $this->status = 200; @@ -133,11 +129,11 @@ class SmartyParser extends Smarty implements ParserInterface $this->setConfigDir($configDirectory); /* add modules template directories */ - switch($templateDefinition->getType()) { + switch ($templateDefinition->getType()) { case TemplateDefinition::FRONT_OFFICE: /* do not pass array directly to addTemplateDir since we cant control on keys */ - if(isset($this->frontOfficeTemplateDirectories[$templateDefinition->getName()])) { - foreach($this->frontOfficeTemplateDirectories[$templateDefinition->getName()] as $key => $directory) { + if (isset($this->frontOfficeTemplateDirectories[$templateDefinition->getName()])) { + foreach ($this->frontOfficeTemplateDirectories[$templateDefinition->getName()] as $key => $directory) { $this->addTemplateDir($directory, $key); } } @@ -145,8 +141,8 @@ class SmartyParser extends Smarty implements ParserInterface case TemplateDefinition::BACK_OFFICE: /* do not pass array directly to addTemplateDir since we cant control on keys */ - if(isset($this->backOfficeTemplateDirectories[$templateDefinition->getName()])) { - foreach($this->backOfficeTemplateDirectories[$templateDefinition->getName()] as $key => $directory) { + if (isset($this->backOfficeTemplateDirectories[$templateDefinition->getName()])) { + foreach ($this->backOfficeTemplateDirectories[$templateDefinition->getName()] as $key => $directory) { $this->addTemplateDir($directory, $key); } } @@ -168,9 +164,9 @@ class SmartyParser extends Smarty implements ParserInterface /** * Return a rendered template, either from file or ftom a string * - * @param string $resourceType either 'string' (rendering from a string) or 'file' (rendering a file) - * @param string $resourceContent the resource content (a text, or a template file name) - * @param array $parameters an associative array of names / value pairs + * @param string $resourceType either 'string' (rendering from a string) or 'file' (rendering a file) + * @param string $resourceContent the resource content (a text, or a template file name) + * @param array $parameters an associative array of names / value pairs * * @return string the rendered template text */ @@ -186,7 +182,6 @@ class SmartyParser extends Smarty implements ParserInterface return $this->fetch(sprintf("%s:%s", $resourceType, $resourceContent)); } - /** * Return a rendered template file * @@ -194,9 +189,9 @@ class SmartyParser extends Smarty implements ParserInterface * @param array $parameters an associative array of names / value pairs * @return string the rendered template text */ - public function render($realTemplateName, array $parameters = array()) { - - if(false === $this->templateExists($realTemplateName)) { + public function render($realTemplateName, array $parameters = array()) + { + if (false === $this->templateExists($realTemplateName)) { throw new ResourceNotFoundException(Translator::getInstance()->trans("Template file %file cannot be found.", array('%file', $realTemplateName))); } @@ -210,7 +205,8 @@ class SmartyParser extends Smarty implements ParserInterface * @param array $parameters an associative array of names / value pairs * @return string the rendered template text */ - public function renderString($templateText, array $parameters = array()) { + public function renderString($templateText, array $parameters = array()) + { return $this->internalRenderer('string', $templateText, $parameters); } diff --git a/core/lib/Thelia/Core/Template/TemplateDefinition.php b/core/lib/Thelia/Core/Template/TemplateDefinition.php index 14dcdca93..57c4af89e 100644 --- a/core/lib/Thelia/Core/Template/TemplateDefinition.php +++ b/core/lib/Thelia/Core/Template/TemplateDefinition.php @@ -50,13 +50,12 @@ class TemplateDefinition */ protected $type; - public function __construct($name, $type) { $this->name = $name; $this->type = $type; - switch($type) { + switch ($type) { case TemplateDefinition::FRONT_OFFICE: $this->path = self::FRONT_OFFICE_SUBDIR . $name; break; @@ -83,14 +82,17 @@ class TemplateDefinition public function setName($name) { $this->name = $name; + return $this; } - public function getI18nPath() { + public function getI18nPath() + { return $this->getPath() . DS . 'I18n'; } - public function getAbsoluteI18nPath() { + public function getAbsoluteI18nPath() + { return THELIA_TEMPLATE_DIR . $this->getI18nPath(); } @@ -99,7 +101,8 @@ class TemplateDefinition return $this->path; } - public function getAbsolutePath() { + public function getAbsolutePath() + { return THELIA_TEMPLATE_DIR . $this->getPath(); } @@ -108,13 +111,15 @@ class TemplateDefinition return $this->getPath() . DS . 'configs'; } - public function getAbsoluteConfigPath() { + public function getAbsoluteConfigPath() + { return THELIA_TEMPLATE_DIR . $this->getConfigPath(); } public function setPath($path) { $this->path = $path; + return $this; } @@ -126,6 +131,7 @@ class TemplateDefinition public function setType($type) { $this->type = $type; + return $this; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/TemplateHelper.php b/core/lib/Thelia/Core/Template/TemplateHelper.php index 4fb83d740..7510bce65 100644 --- a/core/lib/Thelia/Core/Template/TemplateHelper.php +++ b/core/lib/Thelia/Core/Template/TemplateHelper.php @@ -40,16 +40,17 @@ class TemplateHelper private function __construct() {} - public static function getInstance() { + public static function getInstance() + { if (self::$instance == null) self::$instance = new TemplateHelper(); - return self::$instance; } /** * @return TemplateDefinition */ - public function getActiveMailTemplate() { + public function getActiveMailTemplate() + { return new TemplateDefinition( ConfigQuery::read('active-mail-template', 'default'), TemplateDefinition::EMAIL @@ -59,7 +60,8 @@ class TemplateHelper /** * @return TemplateDefinition */ - public function getActivePdfTemplate() { + public function getActivePdfTemplate() + { return new TemplateDefinition( ConfigQuery::read('active-pdf-template', 'default'), TemplateDefinition::PDF @@ -69,7 +71,8 @@ class TemplateHelper /** * @return TemplateDefinition */ - public function getActiveAdminTemplate() { + public function getActiveAdminTemplate() + { return new TemplateDefinition( ConfigQuery::read('active-admin-template', 'default'), TemplateDefinition::BACK_OFFICE @@ -79,24 +82,23 @@ class TemplateHelper /** * @return TemplateDefinition */ - public function getActiveFrontTemplate() { + public function getActiveFrontTemplate() + { return new TemplateDefinition( ConfigQuery::read('active-front-template', 'default'), TemplateDefinition::FRONT_OFFICE ); } - public function getList($templateType) { - + public function getList($templateType) + { $list = $exclude = array(); if ($templateType == TemplateDefinition::BACK_OFFICE) { $baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::BACK_OFFICE_SUBDIR; - } - else if ($templateType == TemplateDefinition::PDF) { + } elseif ($templateType == TemplateDefinition::PDF) { $baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::PDF_SUBDIR; - } - else { + } else { $baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::FRONT_OFFICE_SUBDIR; $exclude = array(TemplateDefinition::BACK_OFFICE_SUBDIR, TemplateDefinition::PDF_SUBDIR); @@ -118,7 +120,6 @@ class TemplateHelper return $list; } - protected function normalize_path($path) { $path = str_replace( @@ -139,28 +140,27 @@ class TemplateHelper * 'translation' => the text translation, or an empty string if none available. * 'dollar' => true if the translatable text contains a $ * - * @param string $directory the path to the directory to examine - * @param string $walkMode type of file scanning: WALK_MODE_PHP or WALK_MODE_TEMPLATE - * @param \Thelia\Core\Translation\Translator $translator the current translator - * @param string $currentLocale the current locale - * @param array $strings the list of strings - * @throws \InvalidArgumentException if $walkMode contains an invalid value - * @return number the total number of translatable texts + * @param string $directory the path to the directory to examine + * @param string $walkMode type of file scanning: WALK_MODE_PHP or WALK_MODE_TEMPLATE + * @param \Thelia\Core\Translation\Translator $translator the current translator + * @param string $currentLocale the current locale + * @param array $strings the list of strings + * @throws \InvalidArgumentException if $walkMode contains an invalid value + * @return number the total number of translatable texts */ - public function walkDir($directory, $walkMode, Translator $translator, $currentLocale, &$strings) { - + public function walkDir($directory, $walkMode, Translator $translator, $currentLocale, &$strings) + { $num_texts = 0; if ($walkMode == self::WALK_MODE_PHP) { $prefix = '\-\>[\s]*trans[\s]*\('; $allowed_exts = array('php'); - } else if ($walkMode == self::WALK_MODE_TEMPLATE) { + } elseif ($walkMode == self::WALK_MODE_TEMPLATE) { $prefix = '\{intl[\s]l='; $allowed_exts = array('html', 'tpl', 'xml'); - } - else { + } else { throw new \InvalidArgumentException( Translator::getInstance()->trans('Invalid value for walkMode parameter: %value', array('%value' => $walkMode)) ); @@ -194,18 +194,15 @@ class TemplateHelper Tlog::getInstance()->debug("Strings found: ", $matches[2]); - foreach($matches[2] as $match) { + foreach ($matches[2] as $match) { $hash = md5($match); - if (isset($strings[$hash])) - { - if (! in_array($short_path, $strings[$hash]['files'])) - { + if (isset($strings[$hash])) { + if (! in_array($short_path, $strings[$hash]['files'])) { $strings[$hash]['files'][] = $short_path; } - } - else { + } else { $num_texts++; // remove \' @@ -257,9 +254,7 @@ class TemplateHelper fwrite($fp, ");\n"); @fclose($fp); - } - else - { + } else { throw new \RuntimeException( Translator::getInstance()->trans( 'Failed to open translation file %file. Please be sure that this file is writable by your Web server', diff --git a/core/lib/Thelia/Core/Thelia.php b/core/lib/Thelia/Core/Thelia.php index e5fc0cd75..f1a6bdfe4 100755 --- a/core/lib/Thelia/Core/Thelia.php +++ b/core/lib/Thelia/Core/Thelia.php @@ -49,7 +49,6 @@ use Thelia\Config\DefinePropel; use Thelia\Core\Template\TemplateDefinition; use Thelia\Core\TheliaContainerBuilder; use Thelia\Core\DependencyInjection\Loader\XmlFileLoader; -use Thelia\Model\ConfigQuery; use Symfony\Component\Config\FileLocator; use Propel\Runtime\Propel; @@ -120,7 +119,7 @@ class Thelia extends Kernel ->depth(0) ->in(THELIA_ROOT . "/core/lib/Thelia/Config/Resources"); - foreach($finder as $file) { + foreach ($finder as $file) { $loader->load($file->getBaseName()); } @@ -142,7 +141,6 @@ class Thelia extends Kernel $defintion ); - $code = ucfirst($module->getCode()); $loader = new XmlFileLoader($container, new FileLocator($module->getAbsoluteConfigPath())); diff --git a/core/lib/Thelia/Core/TheliaHttpKernel.php b/core/lib/Thelia/Core/TheliaHttpKernel.php index ed4dd672b..6449d0648 100755 --- a/core/lib/Thelia/Core/TheliaHttpKernel.php +++ b/core/lib/Thelia/Core/TheliaHttpKernel.php @@ -215,7 +215,7 @@ class TheliaHttpKernel extends HttpKernel protected function initSession(Request $request) { - if(null === self::$session) { + if (null === self::$session) { $storage = new Session\Storage\NativeSessionStorage(); if (Model\ConfigQuery::read("session_config.default")) { diff --git a/core/lib/Thelia/Core/Translation/Translator.php b/core/lib/Thelia/Core/Translation/Translator.php index 775ef7ad8..fc1c75de2 100755 --- a/core/lib/Thelia/Core/Translation/Translator.php +++ b/core/lib/Thelia/Core/Translation/Translator.php @@ -40,7 +40,7 @@ class Translator extends BaseTranslator public function getLocale() { - if($this->container->isScopeActive('request') && $this->container->has('request')) { + if ($this->container->isScopeActive('request') && $this->container->has('request')) { return $this->container->get('request')->getSession()->getLang()->getLocale(); } diff --git a/core/lib/Thelia/Form/CustomerProfileUpdateForm.php b/core/lib/Thelia/Form/CustomerProfileUpdateForm.php index 3bf0c372a..6f44ecc92 100755 --- a/core/lib/Thelia/Form/CustomerProfileUpdateForm.php +++ b/core/lib/Thelia/Form/CustomerProfileUpdateForm.php @@ -23,7 +23,6 @@ namespace Thelia\Form; use Symfony\Component\Validator\ExecutionContextInterface; -use Thelia\Core\Translation\Translator; use Thelia\Model\CustomerQuery; /** diff --git a/core/lib/Thelia/Form/MailingSystemModificationForm.php b/core/lib/Thelia/Form/MailingSystemModificationForm.php index 8334777ab..709c19144 100644 --- a/core/lib/Thelia/Form/MailingSystemModificationForm.php +++ b/core/lib/Thelia/Form/MailingSystemModificationForm.php @@ -23,7 +23,6 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints; -use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\ExecutionContextInterface; use Thelia\Core\Translation\Translator; use Thelia\Model\ProfileQuery; diff --git a/core/lib/Thelia/Form/ProductCombinationGenerationForm.php b/core/lib/Thelia/Form/ProductCombinationGenerationForm.php index 8e4b155b9..1ca633ccd 100644 --- a/core/lib/Thelia/Form/ProductCombinationGenerationForm.php +++ b/core/lib/Thelia/Form/ProductCombinationGenerationForm.php @@ -23,7 +23,6 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; -use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Model\Currency; use Thelia\Core\Translation\Translator; @@ -88,4 +87,4 @@ class ProductCombinationGenerationForm extends BaseForm { return 'thelia_product_combination_generation_form'; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Form/ProductModificationForm.php b/core/lib/Thelia/Form/ProductModificationForm.php index 9dce2e4e5..d2819737c 100644 --- a/core/lib/Thelia/Form/ProductModificationForm.php +++ b/core/lib/Thelia/Form/ProductModificationForm.php @@ -25,7 +25,6 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; use Thelia\Core\Translation\Translator; - class ProductModificationForm extends ProductCreationForm { use StandardDescriptionFieldsTrait; diff --git a/core/lib/Thelia/Form/SeoFieldsTrait.php b/core/lib/Thelia/Form/SeoFieldsTrait.php index 5b3270793..95ce487fc 100644 --- a/core/lib/Thelia/Form/SeoFieldsTrait.php +++ b/core/lib/Thelia/Form/SeoFieldsTrait.php @@ -35,7 +35,7 @@ trait SeoFieldsTrait /** * Add seo meta title, meta description and meta keywords fields * - * @param array $exclude name of the fields that should not be added to the form + * @param array $exclude name of the fields that should not be added to the form */ protected function addSeoFields($exclude = array()) { diff --git a/core/lib/Thelia/Form/SystemLogConfigurationForm.php b/core/lib/Thelia/Form/SystemLogConfigurationForm.php index 9ba9e6cf2..f4eb62285 100644 --- a/core/lib/Thelia/Form/SystemLogConfigurationForm.php +++ b/core/lib/Thelia/Form/SystemLogConfigurationForm.php @@ -23,8 +23,6 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints; -use Thelia\Model\ConfigQuery; -use Symfony\Component\Validator\ExecutionContextInterface; use Thelia\Log\Tlog; use Thelia\Core\Translation\Translator; diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationFile.php b/core/lib/Thelia/Log/Destination/TlogDestinationFile.php index 80aa3ec25..08b7aab66 100755 --- a/core/lib/Thelia/Log/Destination/TlogDestinationFile.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationFile.php @@ -138,4 +138,4 @@ class TlogDestinationFile extends AbstractTlogDestination $this->fh = false; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php b/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php index 546ab488c..e1f3444a5 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php @@ -25,27 +25,29 @@ namespace Thelia\Log\Destination; use Thelia\Log\AbstractTlogDestination; -class TlogDestinationJavascriptConsole extends AbstractTlogDestination { +class TlogDestinationJavascriptConsole extends AbstractTlogDestination +{ + public function getTitle() + { + return "Browser's Javascript console"; + } - public function getTitle() { - return "Browser's Javascript console"; - } + public function getDescription() + { + return "The Thelia logs are displayed in your browser's Javascript console."; + } - public function getDescription() { - return "The Thelia logs are displayed in your browser's Javascript console."; - } + public function write(&$res) + { + $content = ''."\n"; - foreach($this->_logs as $line) { - $content .= "console.log('".str_replace("'", "\\'", str_replace(array("\r\n", "\r", "\n"), '\\n', $line))."');\n"; - } - - $content .= '} catch(ex) { alert("Les logs Thelia ne peuvent être affichés dans la console javascript:" + ex); }'."\n"; - - if (preg_match("||i", $res)) - $res = preg_replace("||i", "$content", $res); + if (preg_match("||i", $res)) + $res = preg_replace("||i", "$content", $res); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php b/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php index 1734e2f43..547a24c85 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php @@ -26,86 +26,88 @@ namespace Thelia\Log\Destination; use Thelia\Log\AbstractTlogDestination; use Thelia\Log\TlogDestinationConfig; -class TlogDestinationPopup extends AbstractTlogDestination { +class TlogDestinationPopup extends AbstractTlogDestination +{ + // Nom des variables de configuration + // ---------------------------------- + const VAR_POPUP_WIDTH = "tlog_destinationpopup_width"; + const VALEUR_POPUP_WIDTH_DEFAUT = "600"; - // Nom des variables de configuration - // ---------------------------------- - const VAR_POPUP_WIDTH = "tlog_destinationpopup_width"; - const VALEUR_POPUP_WIDTH_DEFAUT = "600"; + const VAR_POPUP_HEIGHT = "tlog_destinationpopup_height"; + const VALEUR_POPUP_HEIGHT_DEFAUT = "600"; - const VAR_POPUP_HEIGHT = "tlog_destinationpopup_height"; - const VALEUR_POPUP_HEIGHT_DEFAUT = "600"; + const VAR_POPUP_TPL = "tlog_destinationpopup_template"; + // Ce fichier doit se trouver dans le même répertoire que TlogDestinationPopup.class.php + const VALEUR_POPUP_TPL_DEFAUT = "TlogDestinationPopup.tpl"; - const VAR_POPUP_TPL = "tlog_destinationpopup_template"; - // Ce fichier doit se trouver dans le même répertoire que TlogDestinationPopup.class.php - const VALEUR_POPUP_TPL_DEFAUT = "TlogDestinationPopup.tpl"; + public function getTitle() + { + return "Javascript popup window"; + } - public function getTitle() { - return "Javascript popup window"; - } + public function getDescription() + { + return "Display logs in a popup window, separate from the main window ."; + } - public function getDescription() { - return "Display logs in a popup window, separate from the main window ."; - } + public function getConfigs() + { + return array( + new TlogDestinationConfig( + self::VAR_POPUP_TPL, + "Popup windows template", + "Put #LOGTEXT in the template text where you want to display logs..", + file_get_contents(__DIR__.DS. self::VALEUR_POPUP_TPL_DEFAUT), + TlogDestinationConfig::TYPE_TEXTAREA + ), + new TlogDestinationConfig( + self::VAR_POPUP_HEIGHT, + "Height of the popup window", + "In pixels", + self::VALEUR_POPUP_HEIGHT_DEFAUT, + TlogDestinationConfig::TYPE_TEXTFIELD + ), + new TlogDestinationConfig( + self::VAR_POPUP_WIDTH, + "Width of the popup window", + "In pixels", + self::VALEUR_POPUP_WIDTH_DEFAUT, + TlogDestinationConfig::TYPE_TEXTFIELD + ) + ); + } - public function getConfigs() { - return array( - new TlogDestinationConfig( - self::VAR_POPUP_TPL, - "Popup windows template", - "Put #LOGTEXT in the template text where you want to display logs..", - file_get_contents(__DIR__.DS. self::VALEUR_POPUP_TPL_DEFAUT), - TlogDestinationConfig::TYPE_TEXTAREA - ), - new TlogDestinationConfig( - self::VAR_POPUP_HEIGHT, - "Height of the popup window", - "In pixels", - self::VALEUR_POPUP_HEIGHT_DEFAUT, - TlogDestinationConfig::TYPE_TEXTFIELD - ), - new TlogDestinationConfig( - self::VAR_POPUP_WIDTH, - "Width of the popup window", - "In pixels", - self::VALEUR_POPUP_WIDTH_DEFAUT, - TlogDestinationConfig::TYPE_TEXTFIELD - ) - ); - } + public function write(&$res) + { + $content = ""; $count = 1; - public function write(&$res) { + foreach ($this->_logs as $line) { + $content .= "
".htmlspecialchars($line)."
"; + } - $content = ""; $count = 1; + $tpl = $this->getConfig(self::VAR_POPUP_TPL); - foreach($this->_logs as $line) { - $content .= "
".htmlspecialchars($line)."
"; - } + $tpl = str_replace('#LOGTEXT', $content, $tpl); + $tpl = str_replace(array("\r\n", "\r", "\n"), '\\n', $tpl); - $tpl = $this->getConfig(self::VAR_POPUP_TPL); + $wop = sprintf(' + ', + $this->getConfig(self::VAR_POPUP_WIDTH), + $this->getConfig(self::VAR_POPUP_HEIGHT), + str_replace('"', '\\"', $tpl) + ); - $tpl = str_replace('#LOGTEXT', $content, $tpl); - $tpl = str_replace(array("\r\n", "\r", "\n"), '\\n', $tpl); - - $wop = sprintf(' - ', - $this->getConfig(self::VAR_POPUP_WIDTH), - $this->getConfig(self::VAR_POPUP_HEIGHT), - str_replace('"', '\\"', $tpl) - ); - - if (preg_match("||i", $res)) - $res = preg_replace("||i", "$wop\n", $res); - else - $res .= $wop; + if (preg_match("||i", $res)) + $res = preg_replace("||i", "$wop\n", $res); + else + $res .= $wop; } } diff --git a/core/lib/Thelia/Log/Tlog.php b/core/lib/Thelia/Log/Tlog.php index 86bd8bb29..139de9f26 100755 --- a/core/lib/Thelia/Log/Tlog.php +++ b/core/lib/Thelia/Log/Tlog.php @@ -171,7 +171,8 @@ class Tlog Implements LoggerInterface * * @return array of directories */ - public function getDestinationsDirectories() { + public function getDestinationsDirectories() + { return $this->dir_destinations; } diff --git a/core/lib/Thelia/Log/TlogDestinationConfig.php b/core/lib/Thelia/Log/TlogDestinationConfig.php index 01c8fbe4f..cbc56fd33 100755 --- a/core/lib/Thelia/Log/TlogDestinationConfig.php +++ b/core/lib/Thelia/Log/TlogDestinationConfig.php @@ -22,7 +22,6 @@ /*************************************************************************************/ namespace Thelia\Log; -use Thelia\Model\Config; use Thelia\Model\ConfigQuery; class TlogDestinationConfig diff --git a/core/lib/Thelia/Module/BaseModule.php b/core/lib/Thelia/Module/BaseModule.php index 4575f5aac..7a29c7e6a 100755 --- a/core/lib/Thelia/Module/BaseModule.php +++ b/core/lib/Thelia/Module/BaseModule.php @@ -39,7 +39,6 @@ use Thelia\Model\Module; use Thelia\Model\ModuleImage; use Thelia\Model\ModuleQuery; - class BaseModule extends ContainerAware implements BaseModuleInterface { const CLASSIC_MODULE_TYPE = 1; @@ -115,16 +114,18 @@ class BaseModule extends ContainerAware implements BaseModuleInterface return $this->container; } - - public function hasRequest() { + public function hasRequest() + { return null !== $this->request; } - public function setRequest(Request $request) { + public function setRequest(Request $request) + { $this->request = $request; } - public function getRequest() { + public function getRequest() + { if ($this->hasRequest() === false) { throw new \RuntimeException("Sorry, the request is not available in this context"); } @@ -132,16 +133,18 @@ class BaseModule extends ContainerAware implements BaseModuleInterface return $this->request; } - - public function hasDispatcher() { + public function hasDispatcher() + { return null !== $this->dispatcher; } - public function setDispatcher(EventDispatcherInterface $dispatcher) { + public function setDispatcher(EventDispatcherInterface $dispatcher) + { $this->dispatcher = $dispatcher; } - public function getDispatcher() { + public function getDispatcher() + { if ($this->hasDispatcher() === false) { throw new \RuntimeException("Sorry, the dispatcher is not available in this context"); } @@ -149,7 +152,6 @@ class BaseModule extends ContainerAware implements BaseModuleInterface return $this->dispatcher; } - public function setTitle(Module $module, $titles) { if (is_array($titles)) { @@ -289,4 +291,4 @@ class BaseModule extends ContainerAware implements BaseModuleInterface { // Implement this method to do something useful. } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Module/BaseModuleInterface.php b/core/lib/Thelia/Module/BaseModuleInterface.php index 694a4082c..be7b30a12 100644 --- a/core/lib/Thelia/Module/BaseModuleInterface.php +++ b/core/lib/Thelia/Module/BaseModuleInterface.php @@ -24,8 +24,6 @@ namespace Thelia\Module; use Propel\Runtime\Connection\ConnectionInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpFoundation\Request; interface BaseModuleInterface { diff --git a/core/lib/Thelia/Tests/Action/ContentTest.php b/core/lib/Thelia/Tests/Action/ContentTest.php index 8db9c08dc..1eca7d2ea 100644 --- a/core/lib/Thelia/Tests/Action/ContentTest.php +++ b/core/lib/Thelia/Tests/Action/ContentTest.php @@ -47,7 +47,7 @@ class ContentTest extends TestCaseWithURLToolSetup public function getUpdateEvent(&$content) { - if(!$content instanceof \Thelia\Model\Content) { + if (!$content instanceof \Thelia\Model\Content) { $content = $this->getRandomContent(); } diff --git a/core/lib/Thelia/Tests/Action/FolderTest.php b/core/lib/Thelia/Tests/Action/FolderTest.php index 09307edd5..2c30e491c 100644 --- a/core/lib/Thelia/Tests/Action/FolderTest.php +++ b/core/lib/Thelia/Tests/Action/FolderTest.php @@ -45,7 +45,7 @@ class FolderTest extends TestCaseWithURLToolSetup public function getUpdateEvent(&$folder) { - if(!$folder instanceof \Thelia\Model\Folder) { + if (!$folder instanceof \Thelia\Model\Folder) { $folder = $this->getRandomFolder(); } @@ -65,7 +65,7 @@ class FolderTest extends TestCaseWithURLToolSetup public function getUpdateSeoEvent(&$folder) { - if(!$folder instanceof \Thelia\Model\Folder) { + if (!$folder instanceof \Thelia\Model\Folder) { $folder = $this->getRandomFolder(); } @@ -83,6 +83,7 @@ class FolderTest extends TestCaseWithURLToolSetup public function processUpdateSeoAction($event) { $contentAction = new Folder($this->getContainer()); + return $contentAction->updateSeo($event); } diff --git a/core/lib/Thelia/Tests/Action/OrderTest.php b/core/lib/Thelia/Tests/Action/OrderTest.php index 64a92fd40..f2fd00a32 100644 --- a/core/lib/Thelia/Tests/Action/OrderTest.php +++ b/core/lib/Thelia/Tests/Action/OrderTest.php @@ -24,7 +24,6 @@ namespace Thelia\Tests\Action; use Propel\Runtime\ActiveQuery\Criteria; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Thelia\Core\Event\Order\OrderAddressEvent; use Thelia\Core\Event\Order\OrderEvent; diff --git a/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php b/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php index e5899dbc5..327e722ea 100644 --- a/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php +++ b/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php @@ -38,7 +38,7 @@ trait RewrittenUrlTestTrait ->filterByView(ConfigQuery::getObsoleteRewrittenUrlView(), Criteria::NOT_EQUAL) ->findOne(); - if(null === $existingUrl) { + if (null === $existingUrl) { $this->fail('use fixtures before launching test, there is not enough rewritten url'); } @@ -56,12 +56,12 @@ trait RewrittenUrlTestTrait /* get a brand new URL */ $exist = true; - while(true === $exist) { + while (true === $exist) { $newUrl = md5(rand(1, 999999)) . ".html"; try { new RewritingResolver($newUrl); - } catch(UrlRewritingException $e) { - if($e->getCode() === UrlRewritingException::URL_NOT_FOUND) { + } catch (UrlRewritingException $e) { + if ($e->getCode() === UrlRewritingException::URL_NOT_FOUND) { /* It's all good if URL is not found */ $exist = false; } else { @@ -92,9 +92,9 @@ trait RewrittenUrlTestTrait try { $aRandomProduct->setRewrittenUrl($aRandomProduct->getLocale(), $currentUrl); $failReassign = false; - } catch(\Exception $e) { + } catch (\Exception $e) { } $this->assertFalse($failReassign); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php b/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php index 46f639521..de715e499 100644 --- a/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php +++ b/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php @@ -52,7 +52,6 @@ class ConditionCollectionTest extends \PHPUnit_Framework_TestCase { } - /** * Generate adapter stub * diff --git a/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php b/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php index 37fde4cea..824592f77 100644 --- a/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php +++ b/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php @@ -431,12 +431,10 @@ class ConditionFactoryTest extends \PHPUnit_Framework_TestCase ->method('getContainer') ->will($this->returnValue($stubContainer)); - $conditions = new ConditionCollection(); $conditionFactory = new ConditionFactory($stubContainer); - $conditionNone = new MatchForEveryone($stubFacade); $expectedCollection = new ConditionCollection(); $expectedCollection->add($conditionNone); diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php index f59fe04ef..c7e15af87 100644 --- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php +++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php @@ -197,6 +197,5 @@ class MatchForEveryoneTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expected1, $actual1); $this->assertEquals($expected2, $actual2); - } } diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php index d28bf198d..1c61ed1f2 100644 --- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php +++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php @@ -633,7 +633,6 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase ->method('getAvailableCurrencies') ->will($this->returnValue($currencies)); - $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::EQUAL, @@ -644,7 +643,6 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase MatchForTotalAmount::INPUT2 => 'UNK'); $condition1->setValidatorsFromForm($operators, $values); - $stubContainer = $this->getMockBuilder('\Symfony\Component\DependencyInjection\Container') ->disableOriginalConstructor() ->getMock(); @@ -700,7 +698,6 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase ->method('getAvailableCurrencies') ->will($this->returnValue($currencies)); - $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::EQUAL, @@ -711,7 +708,6 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase MatchForTotalAmount::INPUT2 => 'EUR'); $condition1->setValidatorsFromForm($operators, $values); - $stubContainer = $this->getMockBuilder('\Symfony\Component\DependencyInjection\Container') ->disableOriginalConstructor() ->getMock(); @@ -767,7 +763,6 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase ->method('getAvailableCurrencies') ->will($this->returnValue($currencies)); - $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::EQUAL, @@ -778,7 +773,6 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase MatchForTotalAmount::INPUT2 => 'EUR'); $condition1->setValidatorsFromForm($operators, $values); - $stubContainer = $this->getMockBuilder('\Symfony\Component\DependencyInjection\Container') ->disableOriginalConstructor() ->getMock(); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php index c4bf8f3a6..ac371e71f 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php @@ -53,7 +53,7 @@ class CategoryTest extends BaseLoopTestor public function testSearchById() { $category = CategoryQuery::create()->findOne(); - if(null === $category) { + if (null === $category) { $category = new \Thelia\Model\Category(); $category->setParent(0); $category->setVisible(1); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php index 3d5329a66..0009b90d8 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php @@ -53,7 +53,7 @@ class ContentTest extends BaseLoopTestor public function testSearchById() { $content = ContentQuery::create()->findOne(); - if(null === $content) { + if (null === $content) { $content = new \Thelia\Model\Content(); $content->setDefaultFolder(0); $content->setVisible(1); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php index 87c078e16..0dd3b6b0d 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php @@ -53,7 +53,7 @@ class FolderTest extends BaseLoopTestor public function testSearchById() { $folder = FolderQuery::create()->findOne(); - if(null === $folder) { + if (null === $folder) { $folder = new \Thelia\Model\Folder(); $folder->setParent(0); $folder->setVisible(1); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php index 66081caa5..b071bde9c 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php @@ -54,7 +54,7 @@ class ProductTest extends BaseLoopTestor public function testSearchById() { $product = ProductQuery::create()->orderById(Criteria::ASC)->findOne(); - if(null === $product) { + if (null === $product) { $product = new \Thelia\Model\Product(); $product->setDefaultCategory(0); $product->setVisible(1); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php index 7e2da4b26..dd42a343e 100644 --- a/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php @@ -53,7 +53,7 @@ class TaxRuleTest extends BaseLoopTestor public function testSearchById() { $tr = TaxRuleQuery::create()->findOne(); - if(null === $tr) { + if (null === $tr) { $tr = new \Thelia\Model\TaxRule(); $tr->setTitle('foo'); $tr->save(); diff --git a/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php b/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php index b70bdf247..b5d073c87 100644 --- a/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php +++ b/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php @@ -156,7 +156,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $serializedConditions = $conditionFactory->serializeConditionCollection($conditions); $coupon1->setSerializedConditions($serializedConditions); - $coupon1->setMaxUsage(40); $coupon1->setIsCumulative(true); $coupon1->setIsRemovingPostage(false); @@ -190,7 +189,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $couponManager = new RemoveXAmount($stubFacade); - $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::SUPERIOR, @@ -223,7 +221,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('unserializeConditionCollection') ->will($this->returnValue($conditions)); - $stubContainer->expects($this->any()) ->method('get') ->will($this->onConsecutiveCalls($stubFacade, $couponManager, $stubConditionFactory)); @@ -255,8 +252,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $couponManager = new RemoveXAmount($stubFacade); - - $stubContainer->expects($this->any()) ->method('get') ->will($this->onConsecutiveCalls($stubFacade, $couponManager)); @@ -293,7 +288,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $couponManager = new RemoveXAmount($stubFacade); - $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::SUPERIOR, @@ -326,7 +320,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('unserializeConditionCollection') ->will($this->returnValue($conditions)); - $stubContainer->expects($this->any()) ->method('get') ->will($this->onConsecutiveCalls($stubFacade, $couponManager, $stubConditionFactory)); @@ -358,7 +351,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $couponManager = new RemoveXAmount($stubFacade); - $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::SUPERIOR, @@ -389,7 +381,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('unserializeConditionCollection') ->will($this->returnValue($conditions)); - $stubContainer->expects($this->any()) ->method('get') ->will($this->onConsecutiveCalls($stubFacade, $couponManager, $stubConditionFactory)); diff --git a/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php b/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php index bf4b9f1e9..02cdee87b 100644 --- a/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php +++ b/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php @@ -62,7 +62,6 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase { } - /** * Generate a valid Coupon model */ @@ -118,7 +117,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $serializedConditions = $conditionFactory->serializeConditionCollection($conditions); $coupon1->setSerializedConditions($serializedConditions); - $coupon1->setMaxUsage(40); $coupon1->setIsCumulative(true); $coupon1->setIsRemovingPostage(true); @@ -307,8 +305,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $conditionFactory = new ConditionFactory($stubContainer); - - $stubFacade->expects($this->any()) ->method('getCurrentCoupons') ->will($this->returnValue(array())); @@ -334,7 +330,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $coupon1 = $couponFactory->buildCouponFromModel($model1); $coupon2 = clone $coupon1; - $couponManager = new CouponManager($stubContainer); $couponManager->addAvailableCoupon($coupon1); $couponManager->addAvailableCoupon($coupon2); @@ -387,7 +382,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('get') ->will($this->onConsecutiveCalls($stubFacade)); - $couponManager = new CouponManager($stubContainer); $couponManager->addAvailableCondition($condition1); $couponManager->addAvailableCondition($condition2); @@ -444,10 +438,8 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('get') ->will($this->onConsecutiveCalls($stubFacade)); - $couponManager = new CouponManager($stubContainer); - $stubModel = $this->getMockBuilder('\Thelia\Model\Coupon') ->disableOriginalConstructor() ->getMock(); @@ -511,10 +503,8 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('get') ->will($this->onConsecutiveCalls($stubFacade)); - $couponManager = new CouponManager($stubContainer); - $stubModel = $this->getMockBuilder('\Thelia\Model\Coupon') ->disableOriginalConstructor() ->getMock(); diff --git a/core/lib/Thelia/Tests/Model/Message.php b/core/lib/Thelia/Tests/Model/Message.php index 1b7cd5716..661ec68e0 100644 --- a/core/lib/Thelia/Tests/Model/Message.php +++ b/core/lib/Thelia/Tests/Model/Message.php @@ -23,7 +23,6 @@ namespace Thelia\Tests\Model; - use Thelia\Model\ConfigQuery; use Symfony\Component\Filesystem\Filesystem; use Thelia\Model\Message; @@ -324,8 +323,8 @@ class MessageTest extends \PHPUnit_Framework_TestCase $this->assertEquals("TEXT Layout 6: TEXT