@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | if (!content_access('view', $field, NULL, $new_node)) { |
23 | 23 | continue; |
24 | 24 | } |
25 | - $function = $field_types[$field['type']]['module'] . '_content_diff_values'; |
|
25 | + $function = $field_types[$field['type']]['module'].'_content_diff_values'; |
|
26 | 26 | $function = function_exists($function) ? $function : 'content_content_diff_values'; |
27 | 27 | $old_values = array(); |
28 | 28 | $new_values = array(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | // Fetch titles we don't know yet. |
80 | 80 | $queried_ids = array_diff($ids, array_keys($titles)); |
81 | 81 | if ($queried_ids) { |
82 | - $result = db_query('SELECT uid, name FROM {users} WHERE uid IN ('. db_placeholders($queried_ids) .')', $queried_ids); |
|
82 | + $result = db_query('SELECT uid, name FROM {users} WHERE uid IN ('.db_placeholders($queried_ids).')', $queried_ids); |
|
83 | 83 | while ($row = db_fetch_array($result)) { |
84 | 84 | $titles[$row['uid']] = $row['name']; |
85 | 85 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | // Fetch titles we don't know yet. |
112 | 112 | $queried_ids = array_diff($ids, array_keys($titles)); |
113 | 113 | if ($queried_ids) { |
114 | - $result = db_query('SELECT nid, title FROM {node} WHERE nid IN ('. db_placeholders($queried_ids) .')', $queried_ids); |
|
114 | + $result = db_query('SELECT nid, title FROM {node} WHERE nid IN ('.db_placeholders($queried_ids).')', $queried_ids); |
|
115 | 115 | while ($row = db_fetch_array($result)) { |
116 | 116 | $titles[$row['nid']] = $row['title']; |
117 | 117 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $type = content_types($form['type']['#value']); |
13 | 13 | foreach ($type['fields'] as $field_name => $field) { |
14 | 14 | $form['#field_info'][$field['field_name']] = $field; |
15 | - $form += (array) content_field_form($form, $form_state, $field); |
|
15 | + $form += (array)content_field_form($form, $form_state, $field); |
|
16 | 16 | } |
17 | 17 | return $form; |
18 | 18 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | // TODO: is the "if (function_exists($function)) {" needed ? |
48 | 48 | // defining the $function here makes it unclear where it is actually called |
49 | - $function = $field['widget']['module'] .'_widget'; |
|
49 | + $function = $field['widget']['module'].'_widget'; |
|
50 | 50 | if (function_exists($function)) { |
51 | 51 | // Prepare the values to be filled in the widget. |
52 | 52 | // We look in the following places: |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | if (!empty($form_state['values'][$field['field_name']])) { |
58 | 58 | $items = $form_state['values'][$field['field_name']]; |
59 | 59 | // If there was an AHAH add more button in this field, don't save it. |
60 | - unset($items[$field['field_name'] .'_add_more']); |
|
60 | + unset($items[$field['field_name'].'_add_more']); |
|
61 | 61 | } |
62 | 62 | elseif (!empty($node->$field['field_name'])) { |
63 | 63 | $items = $node->$field['field_name']; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | // it should provide a hook_default_value() function to call, |
69 | 69 | // otherwise the content module's content_default_value() function |
70 | 70 | // will be used. |
71 | - $callback = content_callback('widget', 'default value', $field) == CONTENT_CALLBACK_CUSTOM ? $field['widget']['module'] .'_default_value' : 'content_default_value'; |
|
71 | + $callback = content_callback('widget', 'default value', $field) == CONTENT_CALLBACK_CUSTOM ? $field['widget']['module'].'_default_value' : 'content_default_value'; |
|
72 | 72 | if (function_exists($callback)) { |
73 | 73 | $items = $callback($form, $form_state, $field, 0); |
74 | 74 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | '#required' => $field['required'], |
180 | 180 | '#description' => $description, |
181 | 181 | ); |
182 | - $function = $field['widget']['module'] .'_widget'; |
|
182 | + $function = $field['widget']['module'].'_widget'; |
|
183 | 183 | |
184 | 184 | for ($delta = 0; $delta <= $max; $delta++) { |
185 | 185 | if ($element = $function($form, $form_state, $field, $items, $delta)) { |
@@ -218,9 +218,9 @@ discard block |
||
218 | 218 | $content_type = content_types($field['type_name']); |
219 | 219 | $field_name_css = str_replace('_', '-', $field_name); |
220 | 220 | |
221 | - $form_element[$field_name .'_add_more'] = array( |
|
221 | + $form_element[$field_name.'_add_more'] = array( |
|
222 | 222 | '#type' => 'submit', |
223 | - '#name' => $field_name .'_add_more', |
|
223 | + '#name' => $field_name.'_add_more', |
|
224 | 224 | '#value' => t('Add another item'), |
225 | 225 | '#weight' => $field['widget']['weight'] + $max + 1, |
226 | 226 | // Submit callback for disabled JavaScript. drupal_get_form() might get |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | // including this file. Therefore, call a proxy function to do this. |
229 | 229 | '#submit' => array('content_add_more_submit_proxy'), |
230 | 230 | '#ahah' => array( |
231 | - 'path' => 'content/js_add_more/'. $content_type['url_str'] .'/'. $field_name, |
|
232 | - 'wrapper' => $field_name_css .'-items', |
|
231 | + 'path' => 'content/js_add_more/'.$content_type['url_str'].'/'.$field_name, |
|
232 | + 'wrapper' => $field_name_css.'-items', |
|
233 | 233 | 'method' => 'replace', |
234 | 234 | 'effect' => 'fade', |
235 | 235 | ), |
@@ -240,10 +240,10 @@ discard block |
||
240 | 240 | ); |
241 | 241 | |
242 | 242 | // Add wrappers for the fields and 'more' button. |
243 | - $form_element['#prefix'] = '<div id="'. $field_name_css .'-items">'; |
|
243 | + $form_element['#prefix'] = '<div id="'.$field_name_css.'-items">'; |
|
244 | 244 | $form_element['#suffix'] = '</div>'; |
245 | - $form_element[$field_name .'_add_more']['#prefix'] = '<div class="content-add-more clear-block">'; |
|
246 | - $form_element[$field_name .'_add_more']['#suffix'] = '</div>'; |
|
245 | + $form_element[$field_name.'_add_more']['#prefix'] = '<div class="content-add-more clear-block">'; |
|
246 | + $form_element[$field_name.'_add_more']['#suffix'] = '</div>'; |
|
247 | 247 | } |
248 | 248 | return $form_element; |
249 | 249 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $type_name = $form_state['clicked_button']['#type_name']; |
261 | 261 | |
262 | 262 | // Make the changes we want to the form state. |
263 | - if ($form_state['values'][$field_name][$field_name .'_add_more']) { |
|
263 | + if ($form_state['values'][$field_name][$field_name.'_add_more']) { |
|
264 | 264 | $form_state['item_count'][$field_name] = count($form_state['values'][$field_name]); |
265 | 265 | } |
266 | 266 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | // Sort the $form_state['values'] we just built *and* the incoming $_POST data |
312 | 312 | // according to d-n-d reordering. |
313 | - unset($form_state['values'][$field_name][$field['field_name'] .'_add_more']); |
|
313 | + unset($form_state['values'][$field_name][$field['field_name'].'_add_more']); |
|
314 | 314 | foreach ($_POST[$field_name] as $delta => $item) { |
315 | 315 | $form_state['values'][$field_name][$delta]['_weight'] = $item['_weight']; |
316 | 316 | } |
@@ -356,8 +356,8 @@ discard block |
||
356 | 356 | // Render the new output. |
357 | 357 | $field_form = (!empty($group_name)) ? $form[$group_name][$field_name] : $form[$field_name]; |
358 | 358 | // We add a div around the new content to receive the ahah effect. |
359 | - $field_form[$delta]['#prefix'] = '<div class="ahah-new-content">'. (isset($field_form[$delta]['#prefix']) ? $field_form[$delta]['#prefix'] : ''); |
|
360 | - $field_form[$delta]['#suffix'] = (isset($field_form[$delta]['#suffix']) ? $field_form[$delta]['#suffix'] : '') .'</div>'; |
|
359 | + $field_form[$delta]['#prefix'] = '<div class="ahah-new-content">'.(isset($field_form[$delta]['#prefix']) ? $field_form[$delta]['#prefix'] : ''); |
|
360 | + $field_form[$delta]['#suffix'] = (isset($field_form[$delta]['#suffix']) ? $field_form[$delta]['#suffix'] : '').'</div>'; |
|
361 | 361 | // Prevent duplicate wrapper. |
362 | 362 | unset($field_form['#prefix'], $field_form['#suffix']); |
363 | 363 | |
@@ -367,14 +367,14 @@ discard block |
||
367 | 367 | // The new ones didn't exist then, so we need to update Drupal.settings |
368 | 368 | // by ourselves in order to let AHAH know about those new form elements. |
369 | 369 | $javascript = drupal_add_js(NULL, NULL); |
370 | - $output_js = isset($javascript['setting']) ? '<script type="text/javascript">jQuery.extend(Drupal.settings, '. drupal_to_js(call_user_func_array('array_merge_recursive', $javascript['setting'])) .');</script>' : ''; |
|
370 | + $output_js = isset($javascript['setting']) ? '<script type="text/javascript">jQuery.extend(Drupal.settings, '.drupal_to_js(call_user_func_array('array_merge_recursive', $javascript['setting'])).');</script>' : ''; |
|
371 | 371 | |
372 | - $output = theme('status_messages') . drupal_render($field_form) . $output_js; |
|
372 | + $output = theme('status_messages').drupal_render($field_form).$output_js; |
|
373 | 373 | |
374 | 374 | // Using drupal_json() breaks filefield's file upload, because the jQuery |
375 | 375 | // Form plugin handles file uploads in a way that is not compatible with |
376 | 376 | // 'text/javascript' response type. |
377 | - $GLOBALS['devel_shutdown'] = FALSE; |
|
377 | + $GLOBALS['devel_shutdown'] = FALSE; |
|
378 | 378 | print drupal_to_js(array('status' => TRUE, 'data' => $output)); |
379 | 379 | exit; |
380 | 380 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | for ($i = 0; $i <= $max; $i++) { |
47 | 47 | $module = $field_types[$field['type']]['module']; |
48 | - $function = $module .'_content_generate'; |
|
48 | + $function = $module.'_content_generate'; |
|
49 | 49 | if (function_exists($function)) { |
50 | 50 | $result = $function($node, $field); // $items, $teaser, $page |
51 | 51 | if (content_handle('widget', 'multiple values', $field) == CONTENT_HANDLE_MODULE) { |
@@ -155,13 +155,13 @@ discard block |
||
155 | 155 | $precision = is_numeric($field['precision']) ? $field['precision'] : 10; |
156 | 156 | $scale = is_numeric($field['scale']) ? $field['scale'] : 2; |
157 | 157 | $max = is_numeric($field['max']) ? $field['max'] : pow(10, ($precision - $scale)); |
158 | - $decimal = rand(0, (10 * $scale)) / 100; |
|
158 | + $decimal = rand(0, (10*$scale))/100; |
|
159 | 159 | break; |
160 | 160 | |
161 | 161 | case 'number_float': |
162 | 162 | $precision = rand(10, 32); |
163 | 163 | $scale = rand(0, 2); |
164 | - $decimal = rand(0, (10 * $scale)) / 100; |
|
164 | + $decimal = rand(0, (10*$scale))/100; |
|
165 | 165 | $max = is_numeric($field['max']) ? $field['max'] : pow(10, ($precision - $scale)); |
166 | 166 | break; |
167 | 167 | } |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | $field_types = _content_field_types(); |
42 | 42 | foreach ($content_type['fields'] as $field_name => $field) { |
43 | 43 | $items = isset($node->{$field_name}) ? $node->{$field_name} : array(); |
44 | - $function = $field_types[$field['type']]['module'] . '_token_values'; |
|
44 | + $function = $field_types[$field['type']]['module'].'_token_values'; |
|
45 | 45 | if (!empty($items) && function_exists($function)) { |
46 | - $token_values = (array) $function('field', $items, $options); |
|
46 | + $token_values = (array)$function('field', $items, $options); |
|
47 | 47 | foreach ($token_values as $token => $value) { |
48 | - $tokens[$field_name .'-'. $token] = $value; |
|
48 | + $tokens[$field_name.'-'.$token] = $value; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | } |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | |
62 | 62 | foreach (content_fields() as $field) { |
63 | 63 | $sub_list = array(); |
64 | - $function = $field_types[$field['type']]['module'] . '_token_list'; |
|
64 | + $function = $field_types[$field['type']]['module'].'_token_list'; |
|
65 | 65 | if (function_exists($function)) { |
66 | 66 | $sub_list = $function('field'); |
67 | 67 | foreach ($sub_list as $category => $token_list) { |
68 | 68 | foreach ($token_list as $token => $description) { |
69 | - $list['CCK '. $category][$field['field_name'] .'-'. $token] = $description; |
|
69 | + $list['CCK '.$category][$field['field_name'].'-'.$token] = $description; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $tokens['node reference']['title-raw'] = t('Referenced node unfiltered title. WARNING - raw user input.'); |
87 | 87 | $tokens['node reference']['link'] = t("Formatted html link to the referenced node."); |
88 | 88 | $tokens['node reference']['path'] = t("Relative path alias to the referenced node."); |
89 | - $tokens['node reference']['url'] = t("Absolute path alias to the referenced node."); |
|
89 | + $tokens['node reference']['url'] = t("Absolute path alias to the referenced node."); |
|
90 | 90 | |
91 | 91 | return $tokens; |
92 | 92 | } |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | $tokens['title'] = $title ? check_plain($title) : ''; |
102 | 102 | $tokens['title-raw'] = $title; |
103 | 103 | $tokens['link'] = isset($item['view']) ? $item['view'] : ''; |
104 | - $tokens['path'] = is_numeric($item['nid']) ? url('node/' . $item['nid']) : ''; |
|
105 | - $tokens['url'] = is_numeric($item['nid']) ? url('node/' . $item['nid'], array('absolute' => TRUE)) : ''; |
|
104 | + $tokens['path'] = is_numeric($item['nid']) ? url('node/'.$item['nid']) : ''; |
|
105 | + $tokens['url'] = is_numeric($item['nid']) ? url('node/'.$item['nid'], array('absolute' => TRUE)) : ''; |
|
106 | 106 | |
107 | 107 | return $tokens; |
108 | 108 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | if ($type == 'field') { |
150 | 150 | $item = $object[0]; |
151 | 151 | |
152 | - $tokens['raw'] = $item['value']; |
|
152 | + $tokens['raw'] = $item['value']; |
|
153 | 153 | $tokens['formatted'] = isset($item['view']) ? $item['view'] : ''; |
154 | 154 | return $tokens; |
155 | 155 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $tokens['user reference']['name'] = t('Referenced user name'); |
166 | 166 | $tokens['user reference']['link'] = t('Formatted HTML link to referenced user'); |
167 | 167 | $tokens['user reference']['path'] = t("Relative path alias to the referenced user."); |
168 | - $tokens['user reference']['url'] = t("Absolute path alias to the referenced user."); |
|
168 | + $tokens['user reference']['url'] = t("Absolute path alias to the referenced user."); |
|
169 | 169 | |
170 | 170 | return $tokens; |
171 | 171 | } |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | $tokens['uid'] = $item['uid']; |
179 | 179 | $tokens['name'] = isset($item['view']) ? strip_tags($item['view']) : ''; |
180 | 180 | $tokens['link'] = isset($item['view']) ? $item['view'] : ''; |
181 | - $tokens['path'] = is_numeric($item['uid']) ? url('user/' . $item['uid']) : ''; |
|
182 | - $tokens['url'] = is_numeric($item['uid']) ? url('user/' . $item['uid'], array('absolute' => TRUE)) : ''; |
|
181 | + $tokens['path'] = is_numeric($item['uid']) ? url('user/'.$item['uid']) : ''; |
|
182 | + $tokens['url'] = is_numeric($item['uid']) ? url('user/'.$item['uid'], array('absolute' => TRUE)) : ''; |
|
183 | 183 | |
184 | 184 | return $tokens; |
185 | 185 | } |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | $form['#node'] = (object)array('type' => '', $settings['field_name'] => $settings['value']); |
74 | 74 | $form['#field_info'][$field['field_name']] = $field; |
75 | 75 | // We can't put it into $form['settings'] as this would break AHAH callbacks |
76 | - $form += (array) content_field_form($form, $form_state, $field); |
|
77 | - $form[ $settings['field_name'] ]['#weight'] = 4; |
|
76 | + $form += (array)content_field_form($form, $form_state, $field); |
|
77 | + $form[$settings['field_name']]['#weight'] = 4; |
|
78 | 78 | |
79 | 79 | unset($form['#cache']); |
80 | 80 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | // Add this file to be included when the form is built by rules |
109 | 109 | // as it's needed by CCKs add more button. |
110 | 110 | // See rules_after_build_include_files(). |
111 | - $form['#includes'][] = './'. drupal_get_path('module', 'node') .'/node.pages.inc'; |
|
111 | + $form['#includes'][] = './'.drupal_get_path('module', 'node').'/node.pages.inc'; |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
@@ -135,14 +135,14 @@ discard block |
||
135 | 135 | $settings = $form_state['element']['#settings']; |
136 | 136 | $field = content_fields($settings['field_name']); |
137 | 137 | $field_types = _content_field_types(); |
138 | - $function = $field_types[$field['type']]['module'] .'_field'; |
|
138 | + $function = $field_types[$field['type']]['module'].'_field'; |
|
139 | 139 | if (function_exists($function)) { |
140 | 140 | $form['#node'] = (object)array('type' => '', $settings['field_name'] => $form_state['values'][$settings['field_name']]); |
141 | 141 | $items = isset($form['#node']->$field['field_name']) ? $form['#node']->$field['field_name'] : array(); |
142 | 142 | |
143 | 143 | //Make sure AHAH 'add more' button isn't sent to the fields |
144 | 144 | // for processing. |
145 | - unset($items[$field['field_name'] .'_add_more']); |
|
145 | + unset($items[$field['field_name'].'_add_more']); |
|
146 | 146 | |
147 | 147 | $function('validate', $form['#node'], $field, $items, $form, NULL); |
148 | 148 | content_field('validate', $form['#node'], $field, $items, $form, NULL); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | // Name the content type a combination of fieldgroup and node type names. |
36 | - $content_type_name = $group['type_name'] . ':' . $group['group_name']; |
|
36 | + $content_type_name = $group['type_name'].':'.$group['group_name']; |
|
37 | 37 | |
38 | 38 | // Assemble the information about the content type. |
39 | 39 | $info = array( |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * Implementation of hook_init(). |
17 | 17 | */ |
18 | 18 | function fieldgroup_init() { |
19 | - drupal_add_css(drupal_get_path('module', 'fieldgroup') .'/fieldgroup.css'); |
|
19 | + drupal_add_css(drupal_get_path('module', 'fieldgroup').'/fieldgroup.css'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | function fieldgroup_ctools_plugin_directory($module, $plugin) { |
26 | 26 | if ($module == 'ctools' && $plugin == 'content_types') { |
27 | - return 'panels/' . $plugin; |
|
27 | + return 'panels/'.$plugin; |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | $type_name = $type->type; |
42 | 42 | $content_type = content_types($type_name); |
43 | 43 | $type_url_str = $content_type['url_str']; |
44 | - $items['admin/content/node-type/'. $type_url_str .'/groups/%'] = array( |
|
44 | + $items['admin/content/node-type/'.$type_url_str.'/groups/%'] = array( |
|
45 | 45 | 'title' => 'Edit group', |
46 | 46 | 'page callback' => 'drupal_get_form', |
47 | 47 | 'page arguments' => array('fieldgroup_group_edit_form', $type_name, 5), |
48 | 48 | 'access arguments' => array('administer content types'), |
49 | 49 | 'type' => MENU_CALLBACK, |
50 | 50 | ); |
51 | - $items['admin/content/node-type/'. $type_url_str .'/groups/%/remove'] = array( |
|
51 | + $items['admin/content/node-type/'.$type_url_str.'/groups/%/remove'] = array( |
|
52 | 52 | 'title' => 'Edit group', |
53 | 53 | 'page callback' => 'drupal_get_form', |
54 | 54 | 'page arguments' => array('fieldgroup_remove_group', $type_name, 5), |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | function fieldgroup_content_fieldapi($op, $field) { |
95 | 95 | switch ($op) { |
96 | 96 | case 'delete instance': |
97 | - db_query("DELETE FROM {". fieldgroup_fields_tablename() ."} WHERE field_name = '%s' AND type_name = '%s'", $field['field_name'], $field['type_name']); |
|
97 | + db_query("DELETE FROM {".fieldgroup_fields_tablename()."} WHERE field_name = '%s' AND type_name = '%s'", $field['field_name'], $field['type_name']); |
|
98 | 98 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
99 | 99 | break; |
100 | 100 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $form_values = $form_state['values']; |
183 | 183 | $content_type = $form['#content_type']; |
184 | 184 | fieldgroup_save_group($content_type['type'], $form_values); |
185 | - $form_state['redirect'] = 'admin/content/node-type/'. $content_type['url_str'] .'/fields'; |
|
185 | + $form_state['redirect'] = 'admin/content/node-type/'.$content_type['url_str'].'/fields'; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | function fieldgroup_remove_group(&$form_state, $type_name, $group_name) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | return confirm_form($form, |
203 | 203 | t('Are you sure you want to remove the group %label?', |
204 | 204 | array('%label' => t($group['label']))), |
205 | - 'admin/content/node-type/'. $content_type['url_str'] .'/fields', t('This action cannot be undone.'), |
|
205 | + 'admin/content/node-type/'.$content_type['url_str'].'/fields', t('This action cannot be undone.'), |
|
206 | 206 | t('Remove'), t('Cancel')); |
207 | 207 | } |
208 | 208 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $group_name = $form['#group_name']; |
213 | 213 | fieldgroup_delete($content_type['type'], $group_name); |
214 | 214 | drupal_set_message(t('The group %group_name has been removed.', array('%group_name' => $group_name))); |
215 | - $form_state['redirect'] = 'admin/content/node-type/'. $content_type['url_str'] .'/fields'; |
|
215 | + $form_state['redirect'] = 'admin/content/node-type/'.$content_type['url_str'].'/fields'; |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -222,13 +222,13 @@ discard block |
||
222 | 222 | global $language; |
223 | 223 | static $groups, $groups_sorted; |
224 | 224 | if (!isset($groups) || $reset) { |
225 | - if ($cached = cache_get('fieldgroup_data:'. $language->language, content_cache_tablename())) { |
|
225 | + if ($cached = cache_get('fieldgroup_data:'.$language->language, content_cache_tablename())) { |
|
226 | 226 | $data = $cached->data; |
227 | 227 | $groups = $data['groups']; |
228 | 228 | $groups_sorted = $data['groups_sorted']; |
229 | 229 | } |
230 | 230 | else { |
231 | - $result = db_query("SELECT * FROM {". fieldgroup_tablename() ."} ORDER BY weight, group_name"); |
|
231 | + $result = db_query("SELECT * FROM {".fieldgroup_tablename()."} ORDER BY weight, group_name"); |
|
232 | 232 | $groups = array(); |
233 | 233 | $groups_sorted = array(); |
234 | 234 | while ($group = db_fetch_array($result)) { |
@@ -250,9 +250,9 @@ discard block |
||
250 | 250 | $groups_sorted[$group['type_name']][] = &$groups[$group['type_name']][$group['group_name']]; |
251 | 251 | } |
252 | 252 | //load fields |
253 | - $result = db_query("SELECT nfi.*, ng.group_name FROM {". fieldgroup_tablename() ."} ng ". |
|
254 | - "INNER JOIN {". fieldgroup_fields_tablename() ."} ngf ON ngf.type_name = ng.type_name AND ngf.group_name = ng.group_name ". |
|
255 | - "INNER JOIN {". content_instance_tablename() ."} nfi ON nfi.field_name = ngf.field_name AND nfi.type_name = ngf.type_name ". |
|
253 | + $result = db_query("SELECT nfi.*, ng.group_name FROM {".fieldgroup_tablename()."} ng ". |
|
254 | + "INNER JOIN {".fieldgroup_fields_tablename()."} ngf ON ngf.type_name = ng.type_name AND ngf.group_name = ng.group_name ". |
|
255 | + "INNER JOIN {".content_instance_tablename()."} nfi ON nfi.field_name = ngf.field_name AND nfi.type_name = ngf.type_name ". |
|
256 | 256 | "WHERE nfi.widget_active = 1 ORDER BY nfi.weight"); |
257 | 257 | while ($field = db_fetch_array($result)) { |
258 | 258 | // Allow external modules to translate field strings. |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | |
267 | 267 | $groups[$field['type_name']][$field['group_name']]['fields'][$field['field_name']] = $field; |
268 | 268 | } |
269 | - cache_set('fieldgroup_data:'. $language->language, array('groups' => $groups, 'groups_sorted' => $groups_sorted), content_cache_tablename()); |
|
269 | + cache_set('fieldgroup_data:'.$language->language, array('groups' => $groups, 'groups_sorted' => $groups_sorted), content_cache_tablename()); |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | if (empty($content_type)) { |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | function _fieldgroup_groups_label($content_type) { |
283 | 283 | $groups = fieldgroup_groups($content_type); |
284 | 284 | |
285 | - $labels[''] = '<'. t('none') .'>'; |
|
285 | + $labels[''] = '<'.t('none').'>'; |
|
286 | 286 | foreach ($groups as $group_name => $group) { |
287 | 287 | $labels[$group_name] = t($group['label']); |
288 | 288 | } |
@@ -290,14 +290,14 @@ discard block |
||
290 | 290 | } |
291 | 291 | |
292 | 292 | function _fieldgroup_field_get_group($content_type, $field_name) { |
293 | - return db_result(db_query("SELECT group_name FROM {". fieldgroup_fields_tablename() ."} WHERE type_name = '%s' AND field_name = '%s'", $content_type, $field_name)); |
|
293 | + return db_result(db_query("SELECT group_name FROM {".fieldgroup_fields_tablename()."} WHERE type_name = '%s' AND field_name = '%s'", $content_type, $field_name)); |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | /** |
297 | 297 | * Implementation of hook_form_alter() |
298 | 298 | */ |
299 | 299 | function fieldgroup_form_alter(&$form, $form_state, $form_id) { |
300 | - if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) { |
|
300 | + if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'].'_node_form' == $form_id) { |
|
301 | 301 | foreach (fieldgroup_groups($form['type']['#value']) as $group_name => $group) { |
302 | 302 | $form[$group_name] = array( |
303 | 303 | '#type' => 'fieldset', |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | // Can't use module_invoke_all because we want |
335 | 335 | // to be able to use a reference to $form and $form_state. |
336 | 336 | foreach (module_implements('fieldgroup_form') as $module) { |
337 | - $function = $module .'_fieldgroup_form'; |
|
337 | + $function = $module.'_fieldgroup_form'; |
|
338 | 338 | $function($form, $form_state, $form_id, $group); |
339 | 339 | } |
340 | 340 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | // Add the 'group_' prefix. |
391 | 391 | if (substr($group_name, 0, 6) != 'group_') { |
392 | - $group_name = 'group_'. $group_name; |
|
392 | + $group_name = 'group_'.$group_name; |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | // Invalid field name. |
@@ -422,10 +422,10 @@ discard block |
||
422 | 422 | foreach ($validation['errors'] as $type => $messages) { |
423 | 423 | foreach ($messages as $message) { |
424 | 424 | if ($type == 'label') { |
425 | - form_set_error('_add_new_group][label', t('Add new group:') .' '. $message); |
|
425 | + form_set_error('_add_new_group][label', t('Add new group:').' '.$message); |
|
426 | 426 | } |
427 | 427 | else { |
428 | - form_set_error('_add_new_group][group_name', t('Add new group:') .' '. $message); |
|
428 | + form_set_error('_add_new_group][group_name', t('Add new group:').' '.$message); |
|
429 | 429 | } |
430 | 430 | } |
431 | 431 | } |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | // If 'group' row: update groups weights |
491 | 491 | // (possible newly created group has already been taken care of). |
492 | 492 | elseif (in_array($key, $form['#groups'])) { |
493 | - db_query("UPDATE {". fieldgroup_tablename() ."} SET weight = %d WHERE type_name = '%s' AND group_name = '%s'", |
|
493 | + db_query("UPDATE {".fieldgroup_tablename()."} SET weight = %d WHERE type_name = '%s' AND group_name = '%s'", |
|
494 | 494 | $values['weight'], $type_name, $key); |
495 | 495 | } |
496 | 496 | } |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | // - when a (non last) field is removed from a group, a 'ghost row' remains in the fields overview |
533 | 533 | // - when the last field is removed, the group disappears |
534 | 534 | // seems to be fixed when emptying the cache. |
535 | - db_query("DELETE FROM {". fieldgroup_fields_tablename() ."} WHERE type_name = '%s' AND field_name = '%s'", $form_values['type_name'], $form_values['field_name']); |
|
535 | + db_query("DELETE FROM {".fieldgroup_fields_tablename()."} WHERE type_name = '%s' AND field_name = '%s'", $form_values['type_name'], $form_values['field_name']); |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | /** |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | $element['#collapsible'] = TRUE; |
606 | 606 | case 'fieldset': |
607 | 607 | $element['#type'] = 'fieldgroup_fieldset'; |
608 | - $element['#attributes'] = array('class' => 'fieldgroup '. strtr($group['group_name'], '_', '-')); |
|
608 | + $element['#attributes'] = array('class' => 'fieldgroup '.strtr($group['group_name'], '_', '-')); |
|
609 | 609 | break; |
610 | 610 | } |
611 | 611 | foreach ($group['fields'] as $field_name => $field) { |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | // Can't use module_invoke_all because we want |
619 | 619 | // to be able to use a reference to $node and $element. |
620 | 620 | foreach (module_implements('fieldgroup_view') as $module) { |
621 | - $function = $module .'_fieldgroup_view'; |
|
621 | + $function = $module.'_fieldgroup_view'; |
|
622 | 622 | $function($node, $element, $group, $context); |
623 | 623 | } |
624 | 624 | |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | |
696 | 696 | // One-field equivalent to _content_field_invoke('sanitize'). |
697 | 697 | $module = $field_types[$field['type']]['module']; |
698 | - $function = $module .'_field'; |
|
698 | + $function = $module.'_field'; |
|
699 | 699 | if (function_exists($function)) { |
700 | 700 | $function('sanitize', $node_copy, $field, $items, $teaser, $page); |
701 | 701 | $node_copy->{$field_name} = $items; |
@@ -755,13 +755,13 @@ discard block |
||
755 | 755 | function fieldgroup_node_type($op, $info) { |
756 | 756 | if ($op == 'update' && !empty($info->old_type) && $info->type != $info->old_type) { |
757 | 757 | // update the tables |
758 | - db_query("UPDATE {". fieldgroup_tablename() ."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
759 | - db_query("UPDATE {". fieldgroup_fields_tablename() ."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
758 | + db_query("UPDATE {".fieldgroup_tablename()."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
759 | + db_query("UPDATE {".fieldgroup_fields_tablename()."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
760 | 760 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
761 | 761 | } |
762 | 762 | elseif ($op == 'delete') { |
763 | - db_query("DELETE FROM {". fieldgroup_tablename() ."} WHERE type_name = '%s'", $info->type); |
|
764 | - db_query("DELETE FROM {". fieldgroup_fields_tablename() ."} WHERE type_name = '%s'", $info->type); |
|
763 | + db_query("DELETE FROM {".fieldgroup_tablename()."} WHERE type_name = '%s'", $info->type); |
|
764 | + db_query("DELETE FROM {".fieldgroup_fields_tablename()."} WHERE type_name = '%s'", $info->type); |
|
765 | 765 | } |
766 | 766 | } |
767 | 767 | |
@@ -800,19 +800,19 @@ discard block |
||
800 | 800 | |
801 | 801 | // Allow other modules to intervene when the group is saved. |
802 | 802 | foreach (module_implements('fieldgroup_save_group') as $module) { |
803 | - $function = $module .'_fieldgroup_save_group'; |
|
803 | + $function = $module.'_fieldgroup_save_group'; |
|
804 | 804 | $function($group); |
805 | 805 | } |
806 | 806 | |
807 | 807 | if (!isset($groups[$group['group_name']])) { |
808 | 808 | // Accept group name from programmed submissions if valid. |
809 | - db_query("INSERT INTO {". fieldgroup_tablename() ."} (group_type, type_name, group_name, label, settings, weight)". |
|
809 | + db_query("INSERT INTO {".fieldgroup_tablename()."} (group_type, type_name, group_name, label, settings, weight)". |
|
810 | 810 | " VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $group['group_type'], $type_name, $group['group_name'], $group['label'], serialize($group['settings']), $group['weight']); |
811 | 811 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
812 | 812 | return SAVED_NEW; |
813 | 813 | } |
814 | 814 | else { |
815 | - db_query("UPDATE {". fieldgroup_tablename() ."} SET group_type = '%s', label = '%s', settings = '%s', weight = %d ". |
|
815 | + db_query("UPDATE {".fieldgroup_tablename()."} SET group_type = '%s', label = '%s', settings = '%s', weight = %d ". |
|
816 | 816 | "WHERE type_name = '%s' AND group_name = '%s'", |
817 | 817 | $group['group_type'], $group['label'], serialize($group['settings']), $group['weight'], $type_name, $group['group_name']); |
818 | 818 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
@@ -825,21 +825,21 @@ discard block |
||
825 | 825 | |
826 | 826 | if ($default != $form_values['group']) { |
827 | 827 | if ($form_values['group'] && !$default) { |
828 | - db_query("INSERT INTO {". fieldgroup_fields_tablename() ."} (type_name, group_name, field_name) VALUES ('%s', '%s', '%s')", $form_values['type_name'], $form_values['group'], $form_values['field_name']); |
|
828 | + db_query("INSERT INTO {".fieldgroup_fields_tablename()."} (type_name, group_name, field_name) VALUES ('%s', '%s', '%s')", $form_values['type_name'], $form_values['group'], $form_values['field_name']); |
|
829 | 829 | } |
830 | 830 | elseif ($form_values['group']) { |
831 | - db_query("UPDATE {". fieldgroup_fields_tablename() ."} SET group_name = '%s' WHERE type_name = '%s' AND field_name = '%s'", $form_values['group'], $form_values['type_name'], $form_values['field_name']); |
|
831 | + db_query("UPDATE {".fieldgroup_fields_tablename()."} SET group_name = '%s' WHERE type_name = '%s' AND field_name = '%s'", $form_values['group'], $form_values['type_name'], $form_values['field_name']); |
|
832 | 832 | } |
833 | 833 | else { |
834 | - db_query("DELETE FROM {". fieldgroup_fields_tablename() ."} WHERE type_name = '%s' AND field_name = '%s'", $form_values['type_name'], $form_values['field_name']); |
|
834 | + db_query("DELETE FROM {".fieldgroup_fields_tablename()."} WHERE type_name = '%s' AND field_name = '%s'", $form_values['type_name'], $form_values['field_name']); |
|
835 | 835 | } |
836 | 836 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
837 | 837 | } |
838 | 838 | } |
839 | 839 | |
840 | 840 | function fieldgroup_delete($content_type, $group_name) { |
841 | - db_query("DELETE FROM {". fieldgroup_tablename() ."} WHERE type_name = '%s' AND group_name = '%s'", $content_type, $group_name); |
|
842 | - db_query("DELETE FROM {". fieldgroup_fields_tablename() ."} WHERE type_name = '%s' AND group_name = '%s'", $content_type, $group_name); |
|
841 | + db_query("DELETE FROM {".fieldgroup_tablename()."} WHERE type_name = '%s' AND group_name = '%s'", $content_type, $group_name); |
|
842 | + db_query("DELETE FROM {".fieldgroup_fields_tablename()."} WHERE type_name = '%s' AND group_name = '%s'", $content_type, $group_name); |
|
843 | 843 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
844 | 844 | } |
845 | 845 | |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | $element['#attributes']['class'] .= ' collapsed'; |
866 | 866 | } |
867 | 867 | } |
868 | - return '<fieldset'. drupal_attributes($element['#attributes']) .'>'. ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . (isset($element['#value']) ? $element['#value'] : '') ."</fieldset>\n"; |
|
868 | + return '<fieldset'.drupal_attributes($element['#attributes']).'>'.($element['#title'] ? '<legend>'.$element['#title'].'</legend>' : '').(isset($element['#description']) && $element['#description'] ? '<div class="description">'.$element['#description'].'</div>' : '').(!empty($element['#children']) ? $element['#children'] : '').(isset($element['#value']) ? $element['#value'] : '')."</fieldset>\n"; |
|
869 | 869 | } |
870 | 870 | |
871 | 871 | |
@@ -886,14 +886,14 @@ discard block |
||
886 | 886 | |
887 | 887 | $vars['group_name'] = $element['#group_name']; |
888 | 888 | $vars['group_name_css'] = strtr($element['#group_name'], '_', '-'); |
889 | - $vars['label'] = isset($element['#title']) ? $element['#title'] : '';; |
|
890 | - $vars['description'] = isset($element['#description']) ? $element['#description'] : '';; |
|
889 | + $vars['label'] = isset($element['#title']) ? $element['#title'] : ''; ; |
|
890 | + $vars['description'] = isset($element['#description']) ? $element['#description'] : ''; ; |
|
891 | 891 | $vars['content'] = isset($element['#children']) ? $element['#children'] : ''; |
892 | 892 | $vars['template_files'] = array( |
893 | 893 | 'fieldgroup-simple-', |
894 | - 'fieldgroup-simple-'. $element['#group_name'], |
|
895 | - 'fieldgroup-simple-'. $element['#node']->type, |
|
896 | - 'fieldgroup-simple-'. $element['#group_name'] .'-'. $element['#node']->type, |
|
894 | + 'fieldgroup-simple-'.$element['#group_name'], |
|
895 | + 'fieldgroup-simple-'.$element['#node']->type, |
|
896 | + 'fieldgroup-simple-'.$element['#group_name'].'-'.$element['#node']->type, |
|
897 | 897 | ); |
898 | 898 | } |
899 | 899 | |
@@ -908,6 +908,6 @@ discard block |
||
908 | 908 | |
909 | 909 | foreach (fieldgroup_groups($node->type) as $group_name => $group) { |
910 | 910 | // '#chilren' might not be set if the group is empty. |
911 | - $vars[$group_name .'_rendered'] = isset($node->content[$group_name]['#children']) ? $node->content[$group_name]['#children'] : ''; |
|
911 | + $vars[$group_name.'_rendered'] = isset($node->content[$group_name]['#children']) ? $node->content[$group_name]['#children'] : ''; |
|
912 | 912 | } |
913 | 913 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | function nodereference_ctools_plugin_directory($module, $plugin) { |
59 | 59 | if ($module == 'ctools' && $plugin == 'relationships') { |
60 | - return 'panels/' . $plugin; |
|
60 | + return 'panels/'.$plugin; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | '#title' => t('View used to select the nodes'), |
116 | 116 | '#options' => $views, |
117 | 117 | '#default_value' => isset($field['advanced_view']) ? $field['advanced_view'] : '--', |
118 | - '#description' => t('<p>Choose the "Views module" view that selects the nodes that can be referenced.<br />Note:</p>') . |
|
118 | + '#description' => t('<p>Choose the "Views module" view that selects the nodes that can be referenced.<br />Note:</p>'). |
|
119 | 119 | t('<ul><li>Only views that have fields will work for this purpose.</li><li>This will discard the "Content types" settings above. Use the view\'s "filters" section instead.</li><li>Use the view\'s "fields" section to display additional informations about candidate nodes on node creation/edition form.</li><li>Use the view\'s "sort criteria" section to determine the order in which candidate nodes will be displayed.</li></ul>'), |
120 | 120 | ); |
121 | 121 | $form['advanced']['advanced_view_args'] = array( |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | else { |
130 | 130 | $form['advanced']['no_view_help'] = array( |
131 | - '#value' => t('<p>The list of nodes that can be referenced can be based on a "Views module" view but no appropriate views were found. <br />Note:</p>') . |
|
131 | + '#value' => t('<p>The list of nodes that can be referenced can be based on a "Views module" view but no appropriate views were found. <br />Note:</p>'). |
|
132 | 132 | t('<ul><li>Only views that have fields will work for this purpose.</li><li>This will discard the "Content types" settings above. Use the view\'s "filters" section instead.</li><li>Use the view\'s "fields" section to display additional informations about candidate nodes on node creation/edition form.</li><li>Use the view\'s "sort criteria" section to determine the order in which candidate nodes will be displayed.</li></ul>'), |
133 | 133 | ); |
134 | 134 | } |
@@ -155,19 +155,19 @@ discard block |
||
155 | 155 | $table_alias = content_views_tablename($field); |
156 | 156 | |
157 | 157 | // Filter: swap the handler to the 'in' operator. |
158 | - $data[$table_alias][$field['field_name'] .'_nid']['filter']['handler'] = 'content_handler_filter_many_to_one'; |
|
158 | + $data[$table_alias][$field['field_name'].'_nid']['filter']['handler'] = 'content_handler_filter_many_to_one'; |
|
159 | 159 | // Argument: use node.title for summaries. |
160 | 160 | $data["node_$table_alias"]['table']['join']['node'] = array( |
161 | 161 | 'table' => 'node', |
162 | 162 | 'field' => 'nid', |
163 | 163 | 'left_table' => $table_alias, |
164 | - 'left_field' => $field['field_name'] .'_nid', |
|
164 | + 'left_field' => $field['field_name'].'_nid', |
|
165 | 165 | ); |
166 | - $data[$table_alias][$field['field_name'] .'_nid']['argument']['handler'] = 'content_handler_argument_reference'; |
|
167 | - $data[$table_alias][$field['field_name'] .'_nid']['argument']['name table'] = "node_$table_alias"; |
|
168 | - $data[$table_alias][$field['field_name'] .'_nid']['argument']['name field'] = 'title'; |
|
166 | + $data[$table_alias][$field['field_name'].'_nid']['argument']['handler'] = 'content_handler_argument_reference'; |
|
167 | + $data[$table_alias][$field['field_name'].'_nid']['argument']['name table'] = "node_$table_alias"; |
|
168 | + $data[$table_alias][$field['field_name'].'_nid']['argument']['name field'] = 'title'; |
|
169 | 169 | // Relationship: add a relationship for related node. |
170 | - $data[$table_alias][$field['field_name'] .'_nid']['relationship'] = array( |
|
170 | + $data[$table_alias][$field['field_name'].'_nid']['relationship'] = array( |
|
171 | 171 | 'base' => 'node', |
172 | 172 | 'field' => $db_info['columns']['nid']['column'], |
173 | 173 | 'handler' => 'content_handler_relationship', |
@@ -255,11 +255,11 @@ discard block |
||
255 | 255 | // this page request. |
256 | 256 | $missing_ids = array_diff($ids, array_keys($sanitized_nodes)); |
257 | 257 | if (!empty($missing_ids)) { |
258 | - $where = array('n.nid in ('. db_placeholders($missing_ids) . ')'); |
|
258 | + $where = array('n.nid in ('.db_placeholders($missing_ids).')'); |
|
259 | 259 | if (!user_access('administer nodes')) { |
260 | 260 | $where[] = 'n.status = 1'; |
261 | 261 | } |
262 | - $result = db_query(db_rewrite_sql('SELECT n.nid, n.title, n.status FROM {node} n WHERE '. implode(' AND ', $where)), $missing_ids); |
|
262 | + $result = db_query(db_rewrite_sql('SELECT n.nid, n.title, n.status FROM {node} n WHERE '.implode(' AND ', $where)), $missing_ids); |
|
263 | 263 | while ($row = db_fetch_array($result)) { |
264 | 264 | $sanitized_nodes[$row['nid']] = $row; |
265 | 265 | } |
@@ -318,9 +318,9 @@ discard block |
||
318 | 318 | function theme_nodereference_formatter_default($element) { |
319 | 319 | $output = ''; |
320 | 320 | if (!empty($element['#item']['safe']['nid'])) { |
321 | - $output = l($element['#item']['safe']['title'], 'node/'. $element['#item']['safe']['nid']); |
|
321 | + $output = l($element['#item']['safe']['title'], 'node/'.$element['#item']['safe']['nid']); |
|
322 | 322 | if (!$element['#item']['safe']['status']) { |
323 | - $output = '<span class="node-unpublished"> '. t('(Unpublished)') ." $output</span>"; |
|
323 | + $output = '<span class="node-unpublished"> '.t('(Unpublished)')." $output</span>"; |
|
324 | 324 | } |
325 | 325 | } |
326 | 326 | return $output; |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | if (!empty($element['#item']['safe']['nid'])) { |
335 | 335 | $output = check_plain($element['#item']['safe']['title']); |
336 | 336 | if (!$element['#item']['safe']['status']) { |
337 | - $output = '<span class="node-unpublished"> '. t('(Unpublished)') ." $output</span>"; |
|
337 | + $output = '<span class="node-unpublished"> '.t('(Unpublished)')." $output</span>"; |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | return $output; |
@@ -563,11 +563,11 @@ discard block |
||
563 | 563 | * Substitute in the node title for the node nid. |
564 | 564 | */ |
565 | 565 | function nodereference_autocomplete_value($element, $edit = FALSE) { |
566 | - $field_key = $element['#columns'][0]; |
|
566 | + $field_key = $element['#columns'][0]; |
|
567 | 567 | if (!empty($element['#default_value'][$field_key])) { |
568 | 568 | $nid = $element['#default_value'][$field_key]; |
569 | 569 | $value = db_result(db_query(db_rewrite_sql('SELECT n.title FROM {node} n WHERE n.nid = %d'), $nid)); |
570 | - $value .= ' [nid:'. $nid .']'; |
|
570 | + $value .= ' [nid:'.$nid.']'; |
|
571 | 571 | return array($field_key => $value); |
572 | 572 | } |
573 | 573 | return array($field_key => NULL); |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | // element, it can wrap around the optionwidgets_select element. |
587 | 587 | // This will create a new, nested instance of the field. |
588 | 588 | // Add a validation step where the value can be unwrapped. |
589 | - $field_key = $element['#columns'][0]; |
|
589 | + $field_key = $element['#columns'][0]; |
|
590 | 590 | $element[$field_key] = array( |
591 | 591 | '#type' => 'optionwidgets_select', |
592 | 592 | '#default_value' => isset($element['#value']) ? $element['#value'] : '', |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | // element, it can wrap around the optionwidgets_select element. |
621 | 621 | // This will create a new, nested instance of the field. |
622 | 622 | // Add a validation step where the value can be unwrapped. |
623 | - $field_key = $element['#columns'][0]; |
|
623 | + $field_key = $element['#columns'][0]; |
|
624 | 624 | $element[$field_key] = array( |
625 | 625 | '#type' => 'optionwidgets_buttons', |
626 | 626 | '#default_value' => isset($element['#value']) ? $element['#value'] : '', |
@@ -654,12 +654,12 @@ discard block |
||
654 | 654 | // element, it can wrap around the text_textfield element and add an autocomplete |
655 | 655 | // path and some extra processing to it. |
656 | 656 | // Add a validation step where the value can be unwrapped. |
657 | - $field_key = $element['#columns'][0]; |
|
657 | + $field_key = $element['#columns'][0]; |
|
658 | 658 | |
659 | 659 | $element[$field_key] = array( |
660 | 660 | '#type' => 'text_textfield', |
661 | 661 | '#default_value' => isset($element['#value']) ? $element['#value'] : '', |
662 | - '#autocomplete_path' => 'nodereference/autocomplete/'. $element['#field_name'], |
|
662 | + '#autocomplete_path' => 'nodereference/autocomplete/'.$element['#field_name'], |
|
663 | 663 | // The following values were set by the content module and need |
664 | 664 | // to be passed down to the nested element. |
665 | 665 | '#title' => $element['#title'], |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | * like optionwidgets are using #element_validate to alter the value. |
698 | 698 | */ |
699 | 699 | function nodereference_optionwidgets_validate($element, &$form_state) { |
700 | - $field_key = $element['#columns'][0]; |
|
700 | + $field_key = $element['#columns'][0]; |
|
701 | 701 | |
702 | 702 | $value = $form_state['values']; |
703 | 703 | $new_parents = array(); |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | static $results = array(); |
806 | 806 | |
807 | 807 | // Create unique id for static cache. |
808 | - $cid = $field['field_name'] .':'. $match .':'. ($string !== '' ? $string : implode('-', $ids)) .':'. $limit; |
|
808 | + $cid = $field['field_name'].':'.$match.':'.($string !== '' ? $string : implode('-', $ids)).':'.$limit; |
|
809 | 809 | if (!isset($results[$cid])) { |
810 | 810 | $references = FALSE; |
811 | 811 | if (module_exists('views') && !empty($field['advanced_view']) && $field['advanced_view'] != '--') { |
@@ -931,15 +931,15 @@ discard block |
||
931 | 931 | 'equals' => "= '%s'", |
932 | 932 | 'starts_with' => "$like '%s%%'", |
933 | 933 | ); |
934 | - $where[] = 'n.title '. (isset($match_clauses[$match]) ? $match_clauses[$match] : $match_clauses['contains']); |
|
934 | + $where[] = 'n.title '.(isset($match_clauses[$match]) ? $match_clauses[$match] : $match_clauses['contains']); |
|
935 | 935 | $args[] = $string; |
936 | 936 | } |
937 | 937 | elseif ($ids) { |
938 | - $where[] = 'n.nid IN (' . db_placeholders($ids) . ')'; |
|
938 | + $where[] = 'n.nid IN ('.db_placeholders($ids).')'; |
|
939 | 939 | $args = array_merge($args, $ids); |
940 | 940 | } |
941 | 941 | |
942 | - $where_clause = $where ? 'WHERE ('. implode(') AND (', $where) .')' : ''; |
|
942 | + $where_clause = $where ? 'WHERE ('.implode(') AND (', $where).')' : ''; |
|
943 | 943 | $sql = db_rewrite_sql("SELECT n.nid, n.title AS node_title, n.type AS node_type FROM {node} n $where_clause ORDER BY n.title, n.type"); |
944 | 944 | $result = $limit ? db_query_range($sql, $args, 0, $limit) : db_query($sql, $args); |
945 | 945 | $references = array(); |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | $references = _nodereference_potential_references($field, $string, $match, array(), 10); |
976 | 976 | foreach ($references as $id => $row) { |
977 | 977 | // Add a class wrapper for a few required CSS overrides. |
978 | - $matches[$row['title'] ." [nid:$id]"] = '<div class="reference-autocomplete">'. $row['rendered'] . '</div>'; |
|
978 | + $matches[$row['title']." [nid:$id]"] = '<div class="reference-autocomplete">'.$row['rendered'].'</div>'; |
|
979 | 979 | } |
980 | 980 | drupal_json($matches); |
981 | 981 | } |
@@ -1024,9 +1024,9 @@ discard block |
||
1024 | 1024 | $node = $vars['node']; |
1025 | 1025 | $field = $node->referencing_field; |
1026 | 1026 | $vars['template_files'][] = 'node-nodereference'; |
1027 | - $vars['template_files'][] = 'node-nodereference-'. $field['field_name']; |
|
1028 | - $vars['template_files'][] = 'node-nodereference-'. $node->type; |
|
1029 | - $vars['template_files'][] = 'node-nodereference-'. $field['field_name'] .'-'. $node->type; |
|
1027 | + $vars['template_files'][] = 'node-nodereference-'.$field['field_name']; |
|
1028 | + $vars['template_files'][] = 'node-nodereference-'.$node->type; |
|
1029 | + $vars['template_files'][] = 'node-nodereference-'.$field['field_name'].'-'.$node->type; |
|
1030 | 1030 | } |
1031 | 1031 | } |
1032 | 1032 |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $form['allowed_values_fieldset']['advanced_options']['markup_allowed_values_php'] = array( |
139 | 139 | '#type' => 'item', |
140 | 140 | '#title' => t('Code'), |
141 | - '#value' => !empty($field['allowed_values_php']) ? '<code>'. check_plain($field['allowed_values_php']) .'</code>' : t('<none>'), |
|
141 | + '#value' => !empty($field['allowed_values_php']) ? '<code>'.check_plain($field['allowed_values_php']).'</code>' : t('<none>'), |
|
142 | 142 | '#description' => empty($field['allowed_values_php']) ? t("You're not allowed to input PHP code.") : t('This PHP code was set by an administrator and will override the allowed values list above.'), |
143 | 143 | ); |
144 | 144 | } |
@@ -178,15 +178,15 @@ discard block |
||
178 | 178 | $table_alias = content_views_tablename($field); |
179 | 179 | |
180 | 180 | // Filter: Add a 'many to one' filter. |
181 | - $copy = $data[$table_alias][$field['field_name'] .'_value']; |
|
181 | + $copy = $data[$table_alias][$field['field_name'].'_value']; |
|
182 | 182 | $copy['title'] = t('@label (!name) - Allowed values', array('@label' => t($field['widget']['label']), '!name' => $field['field_name'])); |
183 | 183 | $copy['filter']['handler'] = 'content_handler_filter_many_to_one'; |
184 | 184 | $copy['filter']['numeric'] = TRUE; |
185 | 185 | unset($copy['field'], $copy['argument'], $copy['sort']); |
186 | - $data[$table_alias][$field['field_name'] .'_value_many_to_one'] = $copy; |
|
186 | + $data[$table_alias][$field['field_name'].'_value_many_to_one'] = $copy; |
|
187 | 187 | // Argument: swap the handler to the 'many to one' operator |
188 | - $data[$table_alias][$field['field_name'] .'_value']['argument']['handler'] = 'content_handler_argument_many_to_one'; |
|
189 | - $data[$table_alias][$field['field_name'] .'_value']['argument']['numeric'] = TRUE; |
|
188 | + $data[$table_alias][$field['field_name'].'_value']['argument']['handler'] = 'content_handler_argument_many_to_one'; |
|
189 | + $data[$table_alias][$field['field_name'].'_value']['argument']['numeric'] = TRUE; |
|
190 | 190 | return $data; |
191 | 191 | } |
192 | 192 | break; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | // stored as strings, and we need to compare numeric equality. |
231 | 231 | $valid = FALSE; |
232 | 232 | foreach ($allowed_values as $kay => $value) { |
233 | - if ((float) $item['value'] == (float) $kay) { |
|
233 | + if ((float)$item['value'] == (float)$kay) { |
|
234 | 234 | $valid = TRUE; |
235 | 235 | break; |
236 | 236 | } |
@@ -261,16 +261,16 @@ discard block |
||
261 | 261 | */ |
262 | 262 | function number_field_formatter_info() { |
263 | 263 | return array( |
264 | - 'default' => array('label' => '9999', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_integer', 'number_decimal', 'number_float')), |
|
265 | - 'us_0' => array('label' => '9,999', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_integer', 'number_decimal', 'number_float')), |
|
266 | - 'us_1' => array('label' => '9,999.9', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
267 | - 'us_2' => array('label' => '9,999.99', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
268 | - 'be_0' => array('label' => '9.999', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_integer', 'number_decimal', 'number_float')), |
|
269 | - 'be_1' => array('label' => '9.999,9', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
270 | - 'be_2' => array('label' => '9.999,99', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
271 | - 'fr_0' => array('label' => '9 999', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_integer', 'number_decimal', 'number_float')), |
|
272 | - 'fr_1' => array('label' => '9 999, 9', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
273 | - 'fr_2' => array('label' => '9 999, 99', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
264 | + 'default' => array('label' => '9999', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_integer', 'number_decimal', 'number_float')), |
|
265 | + 'us_0' => array('label' => '9,999', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_integer', 'number_decimal', 'number_float')), |
|
266 | + 'us_1' => array('label' => '9,999.9', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
267 | + 'us_2' => array('label' => '9,999.99', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
268 | + 'be_0' => array('label' => '9.999', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_integer', 'number_decimal', 'number_float')), |
|
269 | + 'be_1' => array('label' => '9.999,9', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
270 | + 'be_2' => array('label' => '9.999,99', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
271 | + 'fr_0' => array('label' => '9 999', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_integer', 'number_decimal', 'number_float')), |
|
272 | + 'fr_1' => array('label' => '9 999, 9', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
273 | + 'fr_2' => array('label' => '9 999, 99', 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_decimal', 'number_float')), |
|
274 | 274 | 'unformatted' => array('label' => t('unformatted'), 'multiple values' => CONTENT_HANDLE_CORE, 'field types' => array('number_integer', 'number_decimal', 'number_float')), |
275 | 275 | ); |
276 | 276 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $prefix = (count($prefixes) > 1) ? format_plural($value, $prefixes[0], $prefixes[1]) : $prefixes[0]; |
338 | 338 | $suffix = (count($suffixes) > 1) ? format_plural($value, $suffixes[0], $suffixes[1]) : $suffixes[0]; |
339 | 339 | |
340 | - return $prefix . $output . $suffix; |
|
340 | + return $prefix.$output.$suffix; |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | /** |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | $start = $value; |
513 | 513 | $value = preg_replace('@[^-0-9\.]@', '', $value); |
514 | 514 | if ($start != $value) { |
515 | - $error_field = implode('][', $element['#parents']) .']['. $field_key; |
|
515 | + $error_field = implode('][', $element['#parents']).']['.$field_key; |
|
516 | 516 | form_set_error($error_field, t('Only numbers and decimals are allowed in %field.', array('%field' => t($field['widget']['label'])))); |
517 | 517 | } |
518 | 518 | else { |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | $start = $value; |
536 | 536 | $value = preg_replace('@[^-0-9]@', '', $value); |
537 | 537 | if ($start != $value) { |
538 | - $error_field = implode('][', $element['#parents']) .']['. $field_key; |
|
538 | + $error_field = implode('][', $element['#parents']).']['.$field_key; |
|
539 | 539 | form_set_error($error_field, t('Only numbers are allowed in %field.', array('%field' => t($field['widget']['label'])))); |
540 | 540 | } |
541 | 541 | else { |
@@ -557,9 +557,9 @@ discard block |
||
557 | 557 | if (($element[$field_key]['#required'] || !empty($value))) { |
558 | 558 | $decimal = $element['#decimal'] ? $element['#decimal'] : '.'; |
559 | 559 | $start = $value; |
560 | - $value = preg_replace('@[^-0-9\\'. $decimal .']@', '', $value); |
|
560 | + $value = preg_replace('@[^-0-9\\'.$decimal.']@', '', $value); |
|
561 | 561 | if ($start != $value) { |
562 | - $error_field = implode('][', $element['#parents']) .']['. $field_key; |
|
562 | + $error_field = implode('][', $element['#parents']).']['.$field_key; |
|
563 | 563 | form_set_error($error_field, t('Only numbers and the decimal character (%decimal) are allowed in %field.', array('%decimal' => $element['#decimal'], '%field' => t($field['widget']['label'])))); |
564 | 564 | } |
565 | 565 | else { |