summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Lindsay2012-07-02 22:55:06 (GMT)
committerAnthony Lindsay2012-07-02 22:55:06 (GMT)
commit163bf5e77a6f6cb571aec91d94ba73035aea397b (patch)
treeda079946450f2bc3958cd0442743e5895453e6ec
parent0bb0f27b40b88affef3e72a106983f41bd06ddee (diff)
Fixed coding style errors.
-rw-r--r--commerce_popular_products.module31
1 files changed, 15 insertions, 16 deletions
diff --git a/commerce_popular_products.module b/commerce_popular_products.module
index 6da4f49..19288d9 100644
--- a/commerce_popular_products.module
+++ b/commerce_popular_products.module
@@ -10,7 +10,7 @@ function commerce_popular_products_get_product() {
$time = variable_get('commerce_popular_products_time', $default = 'month');
$number = variable_get('commerce_popular_products_number', $default = '1');
$products = variable_get('commerce_popular_products_products');
-
+
if (isset($products)) {
// Gather information on all the Commerce product reference fields in use.
$fields = field_info_fields();
@@ -22,7 +22,7 @@ function commerce_popular_products_get_product() {
}
}
}
-
+
// Turn the time period into something we can use with FROM_UNIXTIME().
$time_period = '';
switch ($time) {
@@ -44,7 +44,7 @@ function commerce_popular_products_get_product() {
}
// Create an array to hold all our results for different product types.
- $all_results = array();
+ $all_results = array();
// For each product reference type.
foreach ($product_references as $table) {
// Build query to find the most bought product for the current month.
@@ -69,7 +69,7 @@ function commerce_popular_products_get_product() {
);
$query->condition(
'co.status',
- array('pending', 'complete', 'checkout_complete'),
+ array('pending', 'complete', 'checkout_complete'),
'in',
);
$product_types = array();
@@ -80,18 +80,18 @@ function commerce_popular_products_get_product() {
// Deal with the different time periods.
switch ($time) {
case 'day':
- $query->where("co.changed > (unix_timestamp(now()) - 86400) ");
+ $query->where("co.changed > (unix_timestamp(now()) - 86400) ");
break;
case 'week':
- $query->where("co.changed > (unix_timestamp(now()) - 604800) ");
+ $query->where("co.changed > (unix_timestamp(now()) - 604800) ");
break;
case 'month':
- $query->where("co.changed > (unix_timestamp(now()) - 2629743) ");
+ $query->where("co.changed > (unix_timestamp(now()) - 2629743) ");
break;
- }
+ }
$query->groupBy('order_time');
$query->groupBy('cp.product_id');
$query->groupBy('cp.title');
@@ -144,7 +144,7 @@ function commerce_popular_products_block_info() {
/**
* Implements hook_block_view().
*/
-function commerce_popular_products_block_view($delta='') {
+function commerce_popular_products_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'popular-product-block':
@@ -187,7 +187,6 @@ function commerce_popular_products_settings() {
* Produces the Settings Page form.
*/
function commerce_popular_products_settings_form($form, &$form_state) {
- // variable_get($name, $default = NULL)
$time = variable_get('commerce_popular_products_time', $default = 'month');
$number = variable_get('commerce_popular_products_number', $default = '1');
$products = variable_get('commerce_popular_products_products');
@@ -197,13 +196,13 @@ function commerce_popular_products_settings_form($form, &$form_state) {
'#title' => t('Block title.'),
'#description' => t('The title of the "popular products" block as shown to users.'),
'#default_value' => $title,
- );
+ );
$form['product_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Product Types.'),
'#description' => t('Product nodes to include in the popularity check.'),
'#default_value' => $products,
- );
+ );
$product_types = commerce_popular_products_get_product_types();
$options = array();
foreach ($product_types as $type) {
@@ -221,7 +220,7 @@ function commerce_popular_products_settings_form($form, &$form_state) {
'year' => t('Year'),
),
'#default_value' => $time,
- );
+ );
$form['number_display'] = array(
'#type' => 'select',
'#title' => t('Display.'),
@@ -234,7 +233,7 @@ function commerce_popular_products_settings_form($form, &$form_state) {
'5' => '5',
),
'#default_value' => $number,
- );
+ );
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'));;
return $form;
}
@@ -270,10 +269,10 @@ function commerce_popular_products_get_product_types() {
*
* Makes hooking into Views possible.
*/
-function commerce_popular_products_views_api() {
+function commerce_popular_products_views_api() {
return array(
'api' => 3,
'path' => drupal_get_path('module', 'commerce_popular_products'),
);
-} \ No newline at end of file
+}