@@ -168,10 +168,10 @@ discard block |
||
168 | 168 | foreach ($db_info['columns'] as $column => $attributes) { |
169 | 169 | $query_columns[] = "$attributes[column] AS $column"; |
170 | 170 | } |
171 | - $query = 'SELECT '. implode(', ', $query_columns) . |
|
172 | - ' FROM {'. $db_info['table'] ."}". |
|
173 | - " WHERE vid IN (". implode(',', $vids) .')'. |
|
174 | - " ORDER BY _nid ASC, _delta ". ($options['multiple']['multiple_reversed'] ? 'DESC' : 'ASC'); |
|
171 | + $query = 'SELECT '.implode(', ', $query_columns). |
|
172 | + ' FROM {'.$db_info['table']."}". |
|
173 | + " WHERE vid IN (".implode(',', $vids).')'. |
|
174 | + " ORDER BY _nid ASC, _delta ".($options['multiple']['multiple_reversed'] ? 'DESC' : 'ASC'); |
|
175 | 175 | $result = db_query($query); |
176 | 176 | |
177 | 177 | while ($item = db_fetch_array($result)) { |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | foreach ($items as $item) { |
274 | 274 | $output = content_format($field, $item, $formatter_name, $node); |
275 | 275 | if (!empty($output)) { |
276 | - $rendered[] = $this->render_link($output, (object) array('nid' => $nid)); |
|
276 | + $rendered[] = $this->render_link($output, (object)array('nid' => $nid)); |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | // Multiple values formatter. |
282 | 282 | $output = content_format($field, $items, $formatter_name, $values); |
283 | 283 | if (!empty($output)) { |
284 | - $rendered[] = $this->render_link($output, (object) array('nid' => $nid)); |
|
284 | + $rendered[] = $this->render_link($output, (object)array('nid' => $nid)); |
|
285 | 285 | } |
286 | 286 | } |
287 | 287 | |
@@ -307,11 +307,11 @@ discard block |
||
307 | 307 | if (method_exists('render_as_link', 'views_handler_field')) { |
308 | 308 | // Views 2.3+ |
309 | 309 | $this->options['alter']['make_link'] = TRUE; |
310 | - $this->options['alter']['path'] = "node/" . $values->{$this->aliases['nid']}; |
|
310 | + $this->options['alter']['path'] = "node/".$values->{$this->aliases['nid']}; |
|
311 | 311 | } |
312 | 312 | else { |
313 | 313 | // Views up to 2.2 |
314 | - return l($data, "node/" . $values->nid, array('html' => TRUE)); |
|
314 | + return l($data, "node/".$values->nid, array('html' => TRUE)); |
|
315 | 315 | } |
316 | 316 | } |
317 | 317 | else { |
@@ -36,7 +36,7 @@ |
||
36 | 36 | } |
37 | 37 | elseif ($options['ids']) { |
38 | 38 | $alias = $this->view->query->ensure_table($options['table']); |
39 | - $this->view->query->add_where(NULL, "$alias.$options[field_id] IN (" . db_placeholders($options['ids']) . ')', $options['ids']); |
|
39 | + $this->view->query->add_where(NULL, "$alias.$options[field_id] IN (".db_placeholders($options['ids']).')', $options['ids']); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
@@ -208,7 +208,7 @@ |
||
208 | 208 | $item[$column] = $values->{$this->aliases[$attributes['column']]}; |
209 | 209 | } |
210 | 210 | |
211 | - $item['#delta'] = $field['multiple'] ? $values->{$this->aliases['delta']} : 0; |
|
211 | + $item['#delta'] = $field['multiple'] ? $values->{$this->aliases['delta']} : 0; |
|
212 | 212 | |
213 | 213 | // Render items. |
214 | 214 | $formatter_name = $options['format']; |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | // Make the description smaller |
28 | 28 | $row[] = array('data' => filter_xss_admin($type->description), 'class' => 'description'); |
29 | 29 | // Set the edit column. |
30 | - $row[] = array('data' => l(t('edit'), 'admin/content/node-type/'. $type_url_str)); |
|
30 | + $row[] = array('data' => l(t('edit'), 'admin/content/node-type/'.$type_url_str)); |
|
31 | 31 | // Set links for managing fields. |
32 | 32 | // TODO: a hook to allow other content modules to add more stuff? |
33 | - $row[] = array('data' => l(t('manage fields'), 'admin/content/node-type/'. $type_url_str .'/fields')); |
|
33 | + $row[] = array('data' => l(t('manage fields'), 'admin/content/node-type/'.$type_url_str.'/fields')); |
|
34 | 34 | // Set the delete column. |
35 | 35 | if ($type->custom) { |
36 | - $row[] = array('data' => l(t('delete'), 'admin/content/node-type/'. $type_url_str .'/delete')); |
|
36 | + $row[] = array('data' => l(t('delete'), 'admin/content/node-type/'.$type_url_str.'/delete')); |
|
37 | 37 | } |
38 | 38 | else { |
39 | 39 | $row[] = array('data' => ''); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | // Allow external modules alter the table headers and rows. |
47 | 47 | foreach (module_implements('content_types_overview_alter') as $module) { |
48 | - $function = $module .'_content_types_overview_alter'; |
|
48 | + $function = $module.'_content_types_overview_alter'; |
|
49 | 49 | $function($header, $rows); |
50 | 50 | } |
51 | 51 | |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | $rows[] = array(array('data' => t('No content types available.'), 'colspan' => '7', 'class' => 'message')); |
54 | 54 | } |
55 | 55 | |
56 | - return theme('table', $header, $rows) .theme('content_overview_links'); |
|
56 | + return theme('table', $header, $rows).theme('content_overview_links'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | function theme_content_overview_links() { |
60 | - return '<div class="content-overview-links">'. l(t('» Add a new content type'), 'admin/content/types/add') .'</div>'; |
|
60 | + return '<div class="content-overview-links">'.l(t('» Add a new content type'), 'admin/content/types/add').'</div>'; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $row[] = t($field_types[$field['type']]['label']); |
79 | 79 | |
80 | 80 | $types = array(); |
81 | - $result = db_query("SELECT nt.name, nt.type FROM {". content_instance_tablename() ."} nfi ". |
|
81 | + $result = db_query("SELECT nt.name, nt.type FROM {".content_instance_tablename()."} nfi ". |
|
82 | 82 | "LEFT JOIN {node_type} nt ON nt.type = nfi.type_name ". |
83 | 83 | "WHERE nfi.field_name = '%s' ". |
84 | 84 | // Keep disabled modules out of table. |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | "ORDER BY nt.name ASC", $field['field_name']); |
87 | 87 | while ($type = db_fetch_array($result)) { |
88 | 88 | $content_type = content_types($type['type']); |
89 | - $types[] = l($type['name'], 'admin/content/node-type/'. $content_type['url_str'] .'/fields'); |
|
89 | + $types[] = l($type['name'], 'admin/content/node-type/'.$content_type['url_str'].'/fields'); |
|
90 | 90 | } |
91 | 91 | $row[] = implode(', ', $types); |
92 | 92 | |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | 'label' => array('#value' => check_plain($field['widget']['label'])), |
174 | 174 | 'field_name' => array('#value' => $field['field_name']), |
175 | 175 | 'type' => array('#value' => t($field_types[$field['type']]['label'])), |
176 | - 'configure' => array('#value' => l(t('Configure'), 'admin/content/node-type/'. $type['url_str'] .'/fields/'. $field['field_name'])), |
|
177 | - 'remove' => array('#value' => l(t('Remove'), 'admin/content/node-type/'. $type['url_str'] .'/fields/'. $field['field_name'] .'/remove')), |
|
176 | + 'configure' => array('#value' => l(t('Configure'), 'admin/content/node-type/'.$type['url_str'].'/fields/'.$field['field_name'])), |
|
177 | + 'remove' => array('#value' => l(t('Remove'), 'admin/content/node-type/'.$type['url_str'].'/fields/'.$field['field_name'].'/remove')), |
|
178 | 178 | 'weight' => array('#type' => 'textfield', '#default_value' => $weight, '#size' => 3), |
179 | 179 | 'parent' => array('#type' => 'select', '#options' => $group_options, '#default_value' => ''), |
180 | 180 | 'prev_parent' => array('#type' => 'hidden', '#value' => ''), |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | 'label' => array('#value' => check_plain($group['label'])), |
200 | 200 | 'group_name' => array('#value' => $group['group_name']), |
201 | 201 | 'group_type' => array('#value' => t($group_types[$group['group_type']])), |
202 | - 'configure' => array('#value' => l(t('Configure'), 'admin/content/node-type/'. $type['url_str'] .'/groups/'. $group['group_name'])), |
|
203 | - 'remove' => array('#value' => l(t('Remove'), 'admin/content/node-type/'. $type['url_str'] .'/groups/'. $group['group_name'] .'/remove')), |
|
202 | + 'configure' => array('#value' => l(t('Configure'), 'admin/content/node-type/'.$type['url_str'].'/groups/'.$group['group_name'])), |
|
203 | + 'remove' => array('#value' => l(t('Remove'), 'admin/content/node-type/'.$type['url_str'].'/groups/'.$group['group_name'].'/remove')), |
|
204 | 204 | 'weight' => array('#type' => 'textfield', '#default_value' => $weight, '#size' => 3), |
205 | 205 | 'parent' => array('#type' => 'hidden', '#default_value' => ''), |
206 | 206 | 'hidden_name' => array('#type' => 'hidden', '#default_value' => $group['group_name']), |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | 'type' => array( |
267 | 267 | '#type' => 'select', |
268 | 268 | '#options' => $field_type_options, |
269 | - '#description' => theme('advanced_help_topic', 'content', 'fields') . t('Type of data to store.'), |
|
269 | + '#description' => theme('advanced_help_topic', 'content', 'fields').t('Type of data to store.'), |
|
270 | 270 | ), |
271 | 271 | 'widget_type' => array( |
272 | 272 | '#type' => 'select', |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | |
398 | 398 | // Add the 'field_' prefix. |
399 | 399 | if (substr($field_name, 0, 6) != 'field_') { |
400 | - $field_name = 'field_'. $field_name; |
|
400 | + $field_name = 'field_'.$field_name; |
|
401 | 401 | form_set_value($form['_add_new_field']['field_name'], $field_name, $form_state); |
402 | 402 | } |
403 | 403 | |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | foreach ($form_values as $key => $values) { |
495 | 495 | // Groups are handled in fieldgroup_content_overview_form_submit(). |
496 | 496 | if (in_array($key, $form['#fields'])) { |
497 | - db_query("UPDATE {". content_instance_tablename() ."} SET weight = %d WHERE type_name = '%s' AND field_name = '%s'", |
|
497 | + db_query("UPDATE {".content_instance_tablename()."} SET weight = %d WHERE type_name = '%s' AND field_name = '%s'", |
|
498 | 498 | $values['weight'], $type_name, $key); |
499 | 499 | } |
500 | 500 | elseif (in_array($key, $form['#extra'])) { |
@@ -503,10 +503,10 @@ discard block |
||
503 | 503 | } |
504 | 504 | |
505 | 505 | if ($extra) { |
506 | - variable_set('content_extra_weights_'. $type_name, $extra); |
|
506 | + variable_set('content_extra_weights_'.$type_name, $extra); |
|
507 | 507 | } |
508 | 508 | else { |
509 | - variable_del('content_extra_weights_'. $type_name); |
|
509 | + variable_del('content_extra_weights_'.$type_name); |
|
510 | 510 | } |
511 | 511 | |
512 | 512 | content_clear_type_cache(); |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | if (content_field_instance_create($field)) { |
523 | 523 | // Store new field information for fieldgroup submit handler. |
524 | 524 | $form_state['fields_added']['_add_new_field'] = $field['field_name']; |
525 | - $destinations[] = 'admin/content/node-type/'. $type['url_str'] .'/fields/'. $field['field_name']; |
|
525 | + $destinations[] = 'admin/content/node-type/'.$type['url_str'].'/fields/'.$field['field_name']; |
|
526 | 526 | } |
527 | 527 | else { |
528 | 528 | drupal_set_message(t('There was a problem creating field %label.', array( |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | if (content_field_instance_create($field)) { |
545 | 545 | // Store new field information for fieldgroup submit handler. |
546 | 546 | $form_state['fields_added']['_add_existing_field'] = $field['field_name']; |
547 | - $destinations[] = 'admin/content/node-type/'. $type['url_str'] .'/fields/'. $field['field_name']; |
|
547 | + $destinations[] = 'admin/content/node-type/'.$type['url_str'].'/fields/'.$field['field_name']; |
|
548 | 548 | } |
549 | 549 | else { |
550 | 550 | drupal_set_message(t('There was a problem adding field %label.', array('%label' => $field['field_name']))); |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | |
591 | 591 | if (empty($fields)) { |
592 | 592 | drupal_set_message(t('There are no fields configured for this content type. You can add new fields on the <a href="@link">Manage fields</a> page.', array( |
593 | - '@link' => url('admin/content/node-type/'. $type['url_str'] .'/fields'))), 'warning'); |
|
593 | + '@link' => url('admin/content/node-type/'.$type['url_str'].'/fields'))), 'warning'); |
|
594 | 594 | return $form; |
595 | 595 | } |
596 | 596 | |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | if (!isset($type['fields'][$field['field_name']]) && !$field['locked']) { |
784 | 784 | $field_type = $field_types[$field['type']]; |
785 | 785 | $text = t('@type: @field (@label)', array('@type' => t($field_type['label']), '@label' => t($field['widget']['label']), '@field' => $field['field_name'])); |
786 | - $options[$field['field_name']] = (drupal_strlen($text) > 80) ? truncate_utf8($text, 77) . '...' : $text; |
|
786 | + $options[$field['field_name']] = (drupal_strlen($text) > 80) ? truncate_utf8($text, 77).'...' : $text; |
|
787 | 787 | } |
788 | 788 | } |
789 | 789 | // Sort the list by type, then by field name, then by label. |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | } |
886 | 886 | |
887 | 887 | $type = content_types($form_values['type_name']); |
888 | - $form_state['redirect'] = 'admin/content/node-type/'. $type['url_str'] .'/fields/'. $form_values['field_name']; |
|
888 | + $form_state['redirect'] = 'admin/content/node-type/'.$type['url_str'].'/fields/'.$form_values['field_name']; |
|
889 | 889 | $form_state['rebuild'] = FALSE; |
890 | 890 | } |
891 | 891 | |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | |
909 | 909 | $output = confirm_form($form, |
910 | 910 | t('Are you sure you want to remove the field %field?', array('%field' => $field['widget']['label'])), |
911 | - 'admin/content/node-type/'. $type['url_str'] .'/fields', |
|
911 | + 'admin/content/node-type/'.$type['url_str'].'/fields', |
|
912 | 912 | t('If you have any content left in this field, it will be lost. This action cannot be undone.'), |
913 | 913 | t('Remove'), t('Cancel'), |
914 | 914 | 'confirm' |
@@ -946,7 +946,7 @@ discard block |
||
946 | 946 | '%field' => $field['widget']['label'], |
947 | 947 | '%type' => $type['name']))); |
948 | 948 | } |
949 | - $form_state['redirect'] = 'admin/content/node-type/'. $type['url_str'] .'/fields'; |
|
949 | + $form_state['redirect'] = 'admin/content/node-type/'.$type['url_str'].'/fields'; |
|
950 | 950 | } |
951 | 951 | } |
952 | 952 | |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | '#default_value' => $field['widget']['weight'], |
1043 | 1043 | ); |
1044 | 1044 | |
1045 | - $additions = (array) module_invoke($widget_type['module'], 'widget_settings', 'form', $field['widget']); |
|
1045 | + $additions = (array)module_invoke($widget_type['module'], 'widget_settings', 'form', $field['widget']); |
|
1046 | 1046 | drupal_alter('widget_settings', $additions, 'form', $field['widget']); |
1047 | 1047 | $form['widget'] = array_merge($form['widget'], $additions); |
1048 | 1048 | |
@@ -1083,7 +1083,7 @@ discard block |
||
1083 | 1083 | ); |
1084 | 1084 | |
1085 | 1085 | // Default value widget. |
1086 | - $widget_form = array('#node' => (object) array('type' => $type_name)); |
|
1086 | + $widget_form = array('#node' => (object)array('type' => $type_name)); |
|
1087 | 1087 | $widget_form_state = array('values' => array($field['field_name'] => $default_value)); |
1088 | 1088 | // Make sure the default value is not a required field. |
1089 | 1089 | $widget_field = $field; |
@@ -1127,7 +1127,7 @@ discard block |
||
1127 | 1127 | $form['widget']['default_value_fieldset']['advanced_options']['markup_default_value_php'] = array( |
1128 | 1128 | '#type' => 'item', |
1129 | 1129 | '#title' => t('Code'), |
1130 | - '#value' => !empty($field['widget']['default_value_php']) ? '<code>'. check_plain($field['widget']['default_value_php']) .'</code>' : t('<none>'), |
|
1130 | + '#value' => !empty($field['widget']['default_value_php']) ? '<code>'.check_plain($field['widget']['default_value_php']).'</code>' : t('<none>'), |
|
1131 | 1131 | '#description' => empty($field['widget']['default_value_php']) ? t("You're not allowed to input PHP code.") : t('This PHP code was set by an administrator and will override any value specified above.'), |
1132 | 1132 | ); |
1133 | 1133 | } |
@@ -1145,9 +1145,9 @@ discard block |
||
1145 | 1145 | ); |
1146 | 1146 | $description = t('Maximum number of values users can enter for this field.'); |
1147 | 1147 | if (content_handle('widget', 'multiple values', $field) == CONTENT_HANDLE_CORE) { |
1148 | - $description .= '<br/>'. t("'Unlimited' will provide an 'Add more' button so the users can add as many values as they like."); |
|
1148 | + $description .= '<br/>'.t("'Unlimited' will provide an 'Add more' button so the users can add as many values as they like."); |
|
1149 | 1149 | } |
1150 | - $description .= '<br/><strong>'. t('Warning! Changing this setting after data has been created could result in the loss of data!') .'</strong>'; |
|
1150 | + $description .= '<br/><strong>'.t('Warning! Changing this setting after data has been created could result in the loss of data!').'</strong>'; |
|
1151 | 1151 | $form['field']['multiple'] = array( |
1152 | 1152 | '#type' => 'select', |
1153 | 1153 | '#title' => t('Number of values'), |
@@ -1161,7 +1161,7 @@ discard block |
||
1161 | 1161 | '#value' => serialize($field), |
1162 | 1162 | ); |
1163 | 1163 | |
1164 | - $additions = (array) module_invoke($field_type['module'], 'field_settings', 'form', $field); |
|
1164 | + $additions = (array)module_invoke($field_type['module'], 'field_settings', 'form', $field); |
|
1165 | 1165 | drupal_alter('field_settings', $additions, 'form', $field); |
1166 | 1166 | $form['field'] = array_merge($form['field'], $additions); |
1167 | 1167 | |
@@ -1290,7 +1290,7 @@ discard block |
||
1290 | 1290 | $node = array(); |
1291 | 1291 | $node[$form_values['field_name']] = $default_value; |
1292 | 1292 | $field['required'] = FALSE; |
1293 | - $field_function = $field_type['module'] .'_field'; |
|
1293 | + $field_function = $field_type['module'].'_field'; |
|
1294 | 1294 | |
1295 | 1295 | $errors_before = form_get_errors(); |
1296 | 1296 | |
@@ -1341,7 +1341,7 @@ discard block |
||
1341 | 1341 | else { |
1342 | 1342 | drupal_set_message(t('Saved field %label.', array('%label' => $form_values['label']))); |
1343 | 1343 | $type = content_types($form_values['type_name']); |
1344 | - $form_state['redirect'] = 'admin/content/node-type/'. $type['url_str'] .'/fields'; |
|
1344 | + $form_state['redirect'] = 'admin/content/node-type/'.$type['url_str'].'/fields'; |
|
1345 | 1345 | } |
1346 | 1346 | } |
1347 | 1347 | |
@@ -1518,7 +1518,7 @@ discard block |
||
1518 | 1518 | // drop all delta values higher than the new maximum delta value. |
1519 | 1519 | // Not needed if the new multiple is unlimited or if the new table is the content table. |
1520 | 1520 | if ($new_table != $base_tablename && $new_field['multiple'] < $previous_field['multiple'] && $new_field['multiple'] != 1) { |
1521 | - db_query("DELETE FROM {". $new_table ."} WHERE delta >= ". max(1, $new_field['multiple'])); |
|
1521 | + db_query("DELETE FROM {".$new_table."} WHERE delta >= ".max(1, $new_field['multiple'])); |
|
1522 | 1522 | } |
1523 | 1523 | |
1524 | 1524 | // If going from multiple to non-multiple, make sure the field tables have |
@@ -1548,12 +1548,12 @@ discard block |
||
1548 | 1548 | $new_field['db_storage'] == CONTENT_DB_STORAGE_PER_FIELD) { |
1549 | 1549 | $columns = array_keys($migrate_columns); |
1550 | 1550 | if ($new_field['multiple']) { |
1551 | - db_query('INSERT INTO {'. $new_table .'} (vid, nid, delta, '. implode(', ', $columns) .') '. |
|
1552 | - ' SELECT vid, nid, 0, '. implode(', ', $columns) .' FROM {'. $previous_table .'}'); |
|
1551 | + db_query('INSERT INTO {'.$new_table.'} (vid, nid, delta, '.implode(', ', $columns).') '. |
|
1552 | + ' SELECT vid, nid, 0, '.implode(', ', $columns).' FROM {'.$previous_table.'}'); |
|
1553 | 1553 | } |
1554 | 1554 | else { |
1555 | - db_query('INSERT INTO {'. $new_table .'} (vid, nid, '. implode(', ', $columns) .') '. |
|
1556 | - ' SELECT vid, nid, '. implode(', ', $columns) .' FROM {'. $previous_table .'}'); |
|
1555 | + db_query('INSERT INTO {'.$new_table.'} (vid, nid, '.implode(', ', $columns).') '. |
|
1556 | + ' SELECT vid, nid, '.implode(', ', $columns).' FROM {'.$previous_table.'}'); |
|
1557 | 1557 | } |
1558 | 1558 | foreach ($columns as $column_name) { |
1559 | 1559 | db_drop_field($ret, $previous_table, $column_name); |
@@ -1567,10 +1567,10 @@ discard block |
||
1567 | 1567 | // rebuild the schema now. |
1568 | 1568 | content_alter_db_cleanup(); |
1569 | 1569 | if ($previous_field['multiple']) { |
1570 | - $result = db_query("SELECT * FROM {". $previous_table ."} c JOIN {node} n ON c.nid = n.nid WHERE delta = 0 AND n.type = '%s'", $new_field['type_name']); |
|
1570 | + $result = db_query("SELECT * FROM {".$previous_table."} c JOIN {node} n ON c.nid = n.nid WHERE delta = 0 AND n.type = '%s'", $new_field['type_name']); |
|
1571 | 1571 | } |
1572 | 1572 | else { |
1573 | - $result = db_query("SELECT * FROM {". $previous_table ."} c JOIN {node} n ON c.nid = n.nid WHERE n.type = '%s'", $new_field['type_name']); |
|
1573 | + $result = db_query("SELECT * FROM {".$previous_table."} c JOIN {node} n ON c.nid = n.nid WHERE n.type = '%s'", $new_field['type_name']); |
|
1574 | 1574 | } |
1575 | 1575 | $record = array(); |
1576 | 1576 | while ($data = db_fetch_array($result)) { |
@@ -1591,7 +1591,7 @@ discard block |
||
1591 | 1591 | } |
1592 | 1592 | } |
1593 | 1593 | } |
1594 | - if (db_result(db_query('SELECT COUNT(*) FROM {'. $new_table . |
|
1594 | + if (db_result(db_query('SELECT COUNT(*) FROM {'.$new_table. |
|
1595 | 1595 | '} WHERE vid = %d AND nid = %d', $data['vid'], $data['nid']))) { |
1596 | 1596 | $keys = $new_field['multiple'] ? array('vid', 'delta') : array('vid'); |
1597 | 1597 | drupal_write_record($new_table, $record, $keys); |
@@ -1656,12 +1656,12 @@ discard block |
||
1656 | 1656 | // Group rows: account for weight. |
1657 | 1657 | if (module_exists('fieldgroup')) { |
1658 | 1658 | foreach ($group_rows as $name) { |
1659 | - $dummy[$name] = array('#weight' => $form[$name]['weight']['#value'], '#value' => $name .' '); |
|
1659 | + $dummy[$name] = array('#weight' => $form[$name]['weight']['#value'], '#value' => $name.' '); |
|
1660 | 1660 | } |
1661 | 1661 | } |
1662 | 1662 | // Field rows : account for weight and parenting. |
1663 | 1663 | foreach ($field_rows as $name) { |
1664 | - $dummy[$name] = array('#weight' => $form[$name]['weight']['#value'], '#value' => $name .' '); |
|
1664 | + $dummy[$name] = array('#weight' => $form[$name]['weight']['#value'], '#value' => $name.' '); |
|
1665 | 1665 | if (module_exists('fieldgroup')) { |
1666 | 1666 | if ($parent = $form[$name]['parent']['#value']) { |
1667 | 1667 | $form[$name]['#depth'] = 1; |
@@ -1706,7 +1706,7 @@ discard block |
||
1706 | 1706 | 'finished' => '_content_alter_fields_finished', |
1707 | 1707 | 'title' => t('Processing'), |
1708 | 1708 | 'error_message' => t('The update has encountered an error.'), |
1709 | - 'file' => './'. drupal_get_path('module', 'content') .'/includes/content.admin.inc', |
|
1709 | + 'file' => './'.drupal_get_path('module', 'content').'/includes/content.admin.inc', |
|
1710 | 1710 | ); |
1711 | 1711 | batch_set($batch); |
1712 | 1712 | if (!empty($url)) { |
@@ -1802,7 +1802,7 @@ discard block |
||
1802 | 1802 | return $context['finished'] = 1; |
1803 | 1803 | } |
1804 | 1804 | $nodes = array(); |
1805 | - $result = db_query("SELECT nid FROM {". $db_info['table'] ."}"); |
|
1805 | + $result = db_query("SELECT nid FROM {".$db_info['table']."}"); |
|
1806 | 1806 | while ($node = db_fetch_array($result)) { |
1807 | 1807 | $nodes[] = $node['nid']; |
1808 | 1808 | } |
@@ -1821,7 +1821,7 @@ discard block |
||
1821 | 1821 | $node = content_field_replace($nid, array($updates)); |
1822 | 1822 | |
1823 | 1823 | // Store result for post-processing in the finished callback. |
1824 | - $context['results'][] = l($node->title, 'node/'. $node->nid); |
|
1824 | + $context['results'][] = l($node->title, 'node/'.$node->nid); |
|
1825 | 1825 | |
1826 | 1826 | // Update our progress information. |
1827 | 1827 | $context['sandbox']['progress']++; |
@@ -1831,7 +1831,7 @@ discard block |
||
1831 | 1831 | // Inform the batch engine that we are not finished, |
1832 | 1832 | // and provide an estimation of the completion level we reached. |
1833 | 1833 | if ($context['sandbox']['progress'] != $context['sandbox']['max']) { |
1834 | - $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max']; |
|
1834 | + $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max']; |
|
1835 | 1835 | } |
1836 | 1836 | } |
1837 | 1837 |
@@ -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); |