@@ -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 |
@@ -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 | } |
@@ -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 |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | 'category' => 'Add HTML', |
22 | 22 | 'reusable' => false, |
23 | 23 | 'uuid' => $uuid, |
24 | - 'field_raw_html' => array ( |
|
25 | - 'und' => array ( |
|
26 | - 0 => array ( |
|
24 | + 'field_raw_html' => array( |
|
25 | + 'und' => array( |
|
26 | + 0 => array( |
|
27 | 27 | 'value' => $html, |
28 | 28 | 'format' => 'raw_html', |
29 | 29 | ), |
@@ -50,16 +50,16 @@ discard block |
||
50 | 50 | 'category' => 'Add Map', |
51 | 51 | 'reusable' => false, |
52 | 52 | 'uuid' => $uuid, |
53 | - 'field_map_address' => array ( |
|
54 | - 'und' => array ( |
|
55 | - 0 => array ( |
|
53 | + 'field_map_address' => array( |
|
54 | + 'und' => array( |
|
55 | + 0 => array( |
|
56 | 56 | 'value' => $address, |
57 | 57 | ), |
58 | 58 | ), |
59 | 59 | ), |
60 | - 'field_map_information' => array ( |
|
61 | - 'und' => array ( |
|
62 | - 0 => array ( |
|
60 | + 'field_map_information' => array( |
|
61 | + 'und' => array( |
|
62 | + 0 => array( |
|
63 | 63 | 'value' => $info, |
64 | 64 | 'format' => 'full_html', |
65 | 65 | ), |
@@ -132,17 +132,17 @@ |
||
132 | 132 | */ |
133 | 133 | function df_tools_slideshow_form_after_build($form) { |
134 | 134 | // Make the previews for media images larger than the default media_thumbnail |
135 | - for ($i=0; $i<=max(array_keys($form['field_media'][LANGUAGE_NONE])); ++$i) { |
|
135 | + for ($i = 0; $i <= max(array_keys($form['field_media'][LANGUAGE_NONE])); ++$i) { |
|
136 | 136 | // The slick image style is provided by the slick module, and formats images to match hero proportions |
137 | 137 | // We do not currently use this image style as the default for the slideshow fpp |
138 | 138 | $form['field_media'][LANGUAGE_NONE][$i]['preview']['content']['#image_style'] = 'slick'; |
139 | 139 | } |
140 | 140 | // Remove the formatting tips for the text fields |
141 | - for ($i=0; $i<=max(array_keys($form['field_body'][LANGUAGE_NONE])); ++$i) { |
|
141 | + for ($i = 0; $i <= max(array_keys($form['field_body'][LANGUAGE_NONE])); ++$i) { |
|
142 | 142 | unset($form['field_body'][LANGUAGE_NONE][$i]['format']['help']); |
143 | 143 | unset($form['field_body'][LANGUAGE_NONE][$i]['format']['guidelines']); |
144 | 144 | } |
145 | - for ($i=0; $i<=max(array_keys($form['field_title'][LANGUAGE_NONE])); ++$i) { |
|
145 | + for ($i = 0; $i <= max(array_keys($form['field_title'][LANGUAGE_NONE])); ++$i) { |
|
146 | 146 | unset($form['field_title'][LANGUAGE_NONE][$i]['format']['help']); |
147 | 147 | unset($form['field_title'][LANGUAGE_NONE][$i]['format']['guidelines']); |
148 | 148 | } |
@@ -10,11 +10,11 @@ discard block |
||
10 | 10 | function df_tools_menu_child_add_node($parent_path, $entity, $menu = 'main-menu') { |
11 | 11 | // Remove orphaned menu links if any exist. |
12 | 12 | $menu_info = db_select('menu_links', 'ml') |
13 | - ->condition('ml.link_title' , $entity->title) |
|
13 | + ->condition('ml.link_title', $entity->title) |
|
14 | 14 | ->fields('ml', array('mlid')) |
15 | 15 | ->execute() |
16 | 16 | ->fetchAll(); |
17 | - foreach($menu_info as $key => $value) { |
|
17 | + foreach ($menu_info as $key => $value) { |
|
18 | 18 | menu_link_delete($menu_info[$key]->mlid); |
19 | 19 | } |
20 | 20 | $parent = df_tools_menu_parent($parent_path); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | function df_tools_menu_parent($parent_path) { |
40 | 40 | // Get the parent menu_link mlid. |
41 | 41 | $parent = db_select('menu_links', 'ml') |
42 | - ->condition('ml.link_path' , $parent_path) |
|
42 | + ->condition('ml.link_path', $parent_path) |
|
43 | 43 | ->fields('ml', array('mlid')) |
44 | 44 | ->execute() |
45 | 45 | ->fetch(); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $this->destination = new MigrateDestinationFieldablePanelsPanes('commerce_product'); |
41 | 41 | |
42 | 42 | $source_migration = isset($arguments['source_migration']) ? $arguments['source_migration'] : 'DemoFrameworkBaseCommerceNodes'; |
43 | - $this->addFieldMapping('field_commerce_product_reference', 'Product')->separator(',')->sourceMigration($source_migration);; |
|
43 | + $this->addFieldMapping('field_commerce_product_reference', 'Product')->separator(',')->sourceMigration($source_migration); ; |
|
44 | 44 | |
45 | 45 | $this->addFieldMapping('title', 'Title'); |
46 | 46 | $this->addFieldMapping('category', 'Category')->defaultValue('Reusable panes'); |