@@ -104,8 +104,8 @@ |
||
| 104 | 104 | $products = entity_load('commerce_product'); |
| 105 | 105 | $products_key = array_keys($products); |
| 106 | 106 | $products_number = count($products_key); |
| 107 | - $count = $products_number < $items_number ? $products_number: $items_number; |
|
| 108 | - for($i = 0; $i < $count; $i++) { |
|
| 107 | + $count = $products_number < $items_number ? $products_number : $items_number; |
|
| 108 | + for ($i = 0; $i < $count; $i++) { |
|
| 109 | 109 | $product = $products[$products_key[rand(0, $products_number - 1)]]; |
| 110 | 110 | $line_item = commerce_product_line_item_new($product, 1, $order->order_id); |
| 111 | 111 | commerce_line_item_save($line_item); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | drupal_set_message(t('No Demo Framework Scenario is currently installed.')); |
| 24 | 24 | return FALSE; |
| 25 | 25 | } |
| 26 | - else{ |
|
| 26 | + else { |
|
| 27 | 27 | drupal_set_message(t('Uninstalling Demo Framework Scenario @scenario', array('@scenario' => $scenario))); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | if (!$scenario = variable_get('df_admin_installed_scenario', FALSE)) { |
| 23 | 23 | drupal_set_message(t('No Demo Framework Scenario is currently installed.')); |
| 24 | 24 | return FALSE; |
| 25 | - } |
|
| 26 | - else{ |
|
| 25 | + } else{ |
|
| 27 | 26 | drupal_set_message(t('Uninstalling Demo Framework Scenario @scenario', array('@scenario' => $scenario))); |
| 28 | 27 | } |
| 29 | 28 | |
@@ -111,13 +110,11 @@ discard block |
||
| 111 | 110 | if ($enable_module) { |
| 112 | 111 | $options = array('query' => array('token' => drupal_get_token(DRUPAL_ROOT . '/df/enable/' . $enable_module))); |
| 113 | 112 | $path = array('admin/df/enable/' . $enable_module, $options); |
| 114 | - } |
|
| 115 | - else { |
|
| 113 | + } else { |
|
| 116 | 114 | $path = ''; |
| 117 | 115 | } |
| 118 | 116 | batch_process($path); |
| 119 | - } |
|
| 120 | - else { |
|
| 117 | + } else { |
|
| 121 | 118 | drush_backend_batch_process(); |
| 122 | 119 | } |
| 123 | 120 | |
@@ -76,8 +76,7 @@ |
||
| 76 | 76 | watchdog('demo framework', 'Enabled module: ' . $module); |
| 77 | 77 | drupal_set_message(t('@module enabled.', array('@module' => $module)), 'status'); |
| 78 | 78 | return TRUE; |
| 79 | - } |
|
| 80 | - else { |
|
| 79 | + } else { |
|
| 81 | 80 | drupal_set_message(t('@module does not exist or dependencies are missing.', array('@module' => $module)), 'error'); |
| 82 | 81 | return FALSE; |
| 83 | 82 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | /** |
| 64 | 64 | * Implements hook_theme(). |
| 65 | 65 | */ |
| 66 | -function df_admin_theme(){ |
|
| 66 | +function df_admin_theme() { |
|
| 67 | 67 | return array( |
| 68 | 68 | 'df_admin_page_template' => array( |
| 69 | 69 | 'template' => 'df-admin-page', |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | unset($items['administration']['tray']['navbar_administration']['administration_menu'][$mid]); |
| 94 | 94 | } |
| 95 | 95 | // Shorten "Demo Framework" to "Demo" on the Navbar. |
| 96 | - if(isset($item['#href']) && $item['#href'] == 'admin/df') { |
|
| 96 | + if (isset($item['#href']) && $item['#href'] == 'admin/df') { |
|
| 97 | 97 | $items['administration']['tray']['navbar_administration']['administration_menu'][$mid]['#title'] = 'Demo'; |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -111,8 +111,12 @@ |
||
| 111 | 111 | $modules = system_rebuild_module_data(); |
| 112 | 112 | foreach ($modules as $index => $module) { |
| 113 | 113 | // Process only modules that are Scenarios and are not enabled. |
| 114 | - if ($module->info['package'] != 'Demo Framework Scenarios') continue; |
|
| 115 | - if ($module->status) continue; |
|
| 114 | + if ($module->info['package'] != 'Demo Framework Scenarios') { |
|
| 115 | + continue; |
|
| 116 | + } |
|
| 117 | + if ($module->status) { |
|
| 118 | + continue; |
|
| 119 | + } |
|
| 116 | 120 | |
| 117 | 121 | // Functionality taken from _advanced_help_parse_ini(). |
| 118 | 122 | $module_path = drupal_get_path('module', $module->name); |
@@ -108,8 +108,7 @@ discard block |
||
| 108 | 108 | foreach ($messages as $message) { |
| 109 | 109 | $operations[] = array('drupal_get_messages', array($message, TRUE)); |
| 110 | 110 | } |
| 111 | - } |
|
| 112 | - else { |
|
| 111 | + } else { |
|
| 113 | 112 | // Determine the current alias |
| 114 | 113 | $alias_context = drush_get_context('alias'); |
| 115 | 114 | $alias = !empty($alias_context) ? $alias_context : '@self'; |
@@ -139,8 +138,7 @@ discard block |
||
| 139 | 138 | $options = array('query' => array('token' => drupal_get_token(DRUPAL_ROOT . '/df/imagestyles'))); |
| 140 | 139 | // The ability to send an array for $redirect is undocumented on Drupal.org, yay! |
| 141 | 140 | batch_process(array('admin/df/imagestyles', $options)); |
| 142 | - } |
|
| 143 | - else { |
|
| 141 | + } else { |
|
| 144 | 142 | drush_backend_batch_process(); |
| 145 | 143 | } |
| 146 | 144 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | $vars['content'][$field_name][0]['file']['#muted'] = TRUE; |
| 52 | 52 | $vars['content'][$field_name][0]['file']['#autoplay'] = 'auto'; |
| 53 | 53 | } |
| 54 | - } |
|
| 55 | - else if ($field_name != 'title') { |
|
| 54 | + } else if ($field_name != 'title') { |
|
| 56 | 55 | $container[$field_name] = $field_value; |
| 57 | 56 | unset($vars['content'][$field_name]); |
| 58 | 57 | } |
@@ -34,8 +34,7 @@ |
||
| 34 | 34 | // Create a MigrateSource object. |
| 35 | 35 | if (isset($arguments['path'])) { |
| 36 | 36 | $import_path = $arguments['path']; |
| 37 | - } |
|
| 38 | - else { |
|
| 37 | + } else { |
|
| 39 | 38 | $import_path = drupal_get_path('module', 'df_tools_hero') . '/import/df_tools_hero.fpp.hero.csv'; |
| 40 | 39 | } |
| 41 | 40 | $this->source = new MigrateSourceCSV($import_path, array(), array('header_rows' => 1)); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | // have control over that file via build scripts. |
| 18 | 18 | // If RestWS had a real way to deal with CORS/preflight, we would use that. |
| 19 | 19 | if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { |
| 20 | - echo "";die; |
|
| 20 | + echo ""; die; |
|
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | |
| 85 | 85 | // Query the database for files that match this pattern. |
| 86 | 86 | $query = db_select('file_managed', 'f') |
| 87 | - ->condition('filemime', $mimetypes , 'IN') |
|
| 87 | + ->condition('filemime', $mimetypes, 'IN') |
|
| 88 | 88 | ->condition('uri', $regex, 'REGEXP'); |
| 89 | 89 | $total_count = $query->countQuery()->execute()->fetchField(); |
| 90 | 90 | |
@@ -55,8 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | drupal_set_message(t('Successfully exported Panelizer display for Node @nid to @panels_file', ['@nid' => $node->id(), '@panels_file' => $panels_file])); |
| 57 | 57 | return TRUE; |
| 58 | - } |
|
| 59 | - else { |
|
| 58 | + } else { |
|
| 60 | 59 | drupal_set_message(t('The given Node is not Panelized.'), 'error'); |
| 61 | 60 | return FALSE; |
| 62 | 61 | } |