@@ -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 { |
@@ -16,13 +16,13 @@ discard block |
||
16 | 16 | $field_type = $form['#field']['type']; |
17 | 17 | $label = $form['#field']['widget']['label']; |
18 | 18 | |
19 | - $output = '<p>'. t('Create a list of options as a list in <strong>Allowed values list</strong> or as an array in PHP code. These values will be the same for %field in all content types.', array('%field' => $label)) .'</p>'; |
|
19 | + $output = '<p>'.t('Create a list of options as a list in <strong>Allowed values list</strong> or as an array in PHP code. These values will be the same for %field in all content types.', array('%field' => $label)).'</p>'; |
|
20 | 20 | |
21 | 21 | if ($widget_type == 'optionwidgets_onoff') { |
22 | - $output .= '<p>'. t("For a 'single on/off checkbox' widget, define the 'off' value first, then the 'on' value in the <strong>Allowed values</strong> section. Note that the checkbox will be labeled with the label of the 'on' value.") .'</p>'; |
|
22 | + $output .= '<p>'.t("For a 'single on/off checkbox' widget, define the 'off' value first, then the 'on' value in the <strong>Allowed values</strong> section. Note that the checkbox will be labeled with the label of the 'on' value.").'</p>'; |
|
23 | 23 | } |
24 | 24 | elseif ($widget_type == 'optionwidgets_buttons') { |
25 | - $output .= '<p>'. t("The 'checkboxes/radio buttons' widget will display checkboxes if the multiple values option is selected for this field, otherwise radios will be displayed.") .'</p>'; |
|
25 | + $output .= '<p>'.t("The 'checkboxes/radio buttons' widget will display checkboxes if the multiple values option is selected for this field, otherwise radios will be displayed.").'</p>'; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | if (in_array($field_type, array('text', 'number_integer', 'number_float', 'number_decimal')) |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | unset($items[0]); |
330 | 330 | } |
331 | 331 | if (count($items) > $field['multiple']) { |
332 | - $field_key = $element['#columns'][0]; |
|
332 | + $field_key = $element['#columns'][0]; |
|
333 | 333 | form_error($element[$field_key], t('%name: this field cannot hold more than @count values.', array('%name' => t($field['widget']['label']), '@count' => $field['multiple']))); |
334 | 334 | } |
335 | 335 | } |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | */ |
369 | 369 | function optionwidgets_form2data($element, $field) { |
370 | 370 | $field_key = $element['#columns'][0]; |
371 | - $items = (array) $element[$field_key]['#value']; |
|
371 | + $items = (array)$element[$field_key]['#value']; |
|
372 | 372 | $options = optionwidgets_options($field); |
373 | 373 | |
374 | 374 | $values = array_values($items); |
@@ -399,8 +399,8 @@ discard block |
||
399 | 399 | * when allowed values list is generated using PHP code. |
400 | 400 | */ |
401 | 401 | function optionwidgets_options($field, $flatten = TRUE) { |
402 | - $function = $field['module'] .'_allowed_values'; |
|
403 | - $options = function_exists($function) ? $function($field) : (array) content_allowed_values($field, $flatten); |
|
402 | + $function = $field['module'].'_allowed_values'; |
|
403 | + $options = function_exists($function) ? $function($field) : (array)content_allowed_values($field, $flatten); |
|
404 | 404 | // Add an empty choice for : |
405 | 405 | // - non required radios |
406 | 406 | // - non required selects |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | * A form to export field definitions. |
70 | 70 | */ |
71 | 71 | function content_copy_export_form(&$form_state) { |
72 | - include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc'); |
|
73 | - include_once('./'. drupal_get_path('module', 'node') .'/content_types.inc'); |
|
72 | + include_once('./'.drupal_get_path('module', 'content').'/includes/content.admin.inc'); |
|
73 | + include_once('./'.drupal_get_path('module', 'node').'/content_types.inc'); |
|
74 | 74 | |
75 | 75 | $form_values = isset($form_state['values']) ? $form_state['values'] : array(); |
76 | 76 | $step = isset($form_state['storage']['step']) ? $form_state['storage']['step'] + 1 : 1; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | switch ($step) { |
100 | 100 | case 1: // Select a content type. |
101 | - $types = content_copy_types(); |
|
101 | + $types = content_copy_types(); |
|
102 | 102 | $form['type_name'] = array( |
103 | 103 | '#title' => t('Types'), |
104 | 104 | '#type' => 'radios', |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | $output = content_copy_get_macro(); |
264 | 264 | |
265 | 265 | // Add weights of non-CCK fields. |
266 | - if ($extra = variable_get('content_extra_weights_'. $form_values['type_name'], array())) { |
|
267 | - $output .= "\$content['extra'] = ". var_export((array) $extra, TRUE) .";\n"; |
|
266 | + if ($extra = variable_get('content_extra_weights_'.$form_values['type_name'], array())) { |
|
267 | + $output .= "\$content['extra'] = ".var_export((array)$extra, TRUE).";\n"; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | return $output; |
@@ -294,8 +294,8 @@ discard block |
||
294 | 294 | * } |
295 | 295 | */ |
296 | 296 | function content_copy_import_form(&$form_state, $type_name = '') { |
297 | - include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc'); |
|
298 | - include_once('./'. drupal_get_path('module', 'node') .'/content_types.inc'); |
|
297 | + include_once('./'.drupal_get_path('module', 'content').'/includes/content.admin.inc'); |
|
298 | + include_once('./'.drupal_get_path('module', 'node').'/content_types.inc'); |
|
299 | 299 | |
300 | 300 | $form['#prefix'] = t('This form will import field definitions exported from another content type or another database.<br/>Note that fields cannot be duplicated within the same content type, so imported fields will be added only if they do not already exist in the selected type.'); |
301 | 301 | $form['type_name'] = array( |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | if (isset($_REQUEST['type_name'])) { |
323 | 323 | $form['type_name']['#default_value'] = $_REQUEST['type_name']; |
324 | 324 | } |
325 | - $form['#prefix'] .= '<p class="error">'. t('A file has been pre-loaded for import.') .'</p>'; |
|
325 | + $form['#prefix'] .= '<p class="error">'.t('A file has been pre-loaded for import.').'</p>'; |
|
326 | 326 | } |
327 | 327 | return $form; |
328 | 328 | } |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | // If there are groups in the import, make sure the fieldgroup module is enabled. |
374 | 374 | $imported_groups = array(); |
375 | 375 | if (isset($content['groups']) && module_exists('fieldgroup')) { |
376 | - $imported_groups = (array) $content['groups']; |
|
376 | + $imported_groups = (array)$content['groups']; |
|
377 | 377 | } |
378 | 378 | elseif (isset($content['groups']) && is_array($content['groups'])) { |
379 | 379 | $not_enabled[] = 'fieldgroup'; |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | // Create the content type, if requested. |
420 | 420 | if ($form_values['type_name'] == '<create>') { |
421 | 421 | |
422 | - $type = (object) $imported_type; |
|
422 | + $type = (object)$imported_type; |
|
423 | 423 | $values = $imported_type; |
424 | 424 | // Prevent a warning in node/content_types.inc |
425 | 425 | $type->has_title = TRUE; |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | |
459 | 459 | // Make sure the field doesn't already exist in the type. |
460 | 460 | // If so, do nothing, fields can't be duplicated within a content type. |
461 | - $field_name = $field['field_name']; |
|
461 | + $field_name = $field['field_name']; |
|
462 | 462 | |
463 | 463 | // Might need to overwrite the content type name if a new type was created. |
464 | 464 | $field['type_name'] = $type_name; |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | |
493 | 493 | // Import weights of non-CCK fields. |
494 | 494 | if (isset($content['extra'])) { |
495 | - variable_set('content_extra_weights_'. $type_name, $content['extra']); |
|
495 | + variable_set('content_extra_weights_'.$type_name, $content['extra']); |
|
496 | 496 | } |
497 | 497 | } |
498 | 498 | |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | $types = array(); |
539 | 539 | $content_info = _content_type_info(); |
540 | 540 | foreach ($content_info['content types'] as $type_name => $val) { |
541 | - $types[$type_name] = check_plain($val['name']) .' ('. $type_name .')'; |
|
541 | + $types[$type_name] = check_plain($val['name']).' ('.$type_name.')'; |
|
542 | 542 | } |
543 | 543 | return $types; |
544 | 544 | } |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | // The display settings are being fetched directly from the DB. During import, |
582 | 582 | // we'll re-insert the data directly as well. |
583 | 583 | // |
584 | - $query = 'SELECT display_settings FROM {'. content_instance_tablename() .'} WHERE field_name = \'%s\''; |
|
584 | + $query = 'SELECT display_settings FROM {'.content_instance_tablename().'} WHERE field_name = \'%s\''; |
|
585 | 585 | $row_info = db_fetch_array(db_query($query, $field_name)); |
586 | 586 | |
587 | 587 | // If an error occurs, notify the user. |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | $string = ""; |
615 | 615 | if (array_key_exists('submissions', $GLOBALS['content_copy'])) { |
616 | 616 | foreach ($GLOBALS['content_copy']['submissions'] as $form_type => $form) { |
617 | - $string .= "\$content['$form_type'] = ". var_export((array) $form, TRUE) .";\n"; |
|
617 | + $string .= "\$content['$form_type'] = ".var_export((array)$form, TRUE).";\n"; |
|
618 | 618 | } |
619 | 619 | return $string; |
620 | 620 | } |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | function content_permissions_perm() { |
8 | 8 | $perms = array(); |
9 | 9 | foreach (content_fields() as $field) { |
10 | - $perms[] = 'edit '. $field['field_name']; |
|
11 | - $perms[] = 'view '. $field['field_name']; |
|
10 | + $perms[] = 'edit '.$field['field_name']; |
|
11 | + $perms[] = 'view '.$field['field_name']; |
|
12 | 12 | } |
13 | 13 | return $perms; |
14 | 14 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | switch ($op) { |
23 | 23 | case 'view': |
24 | 24 | case 'edit': |
25 | - return user_access($op .' '. $field['field_name'], $account); |
|
25 | + return user_access($op.' '.$field['field_name'], $account); |
|
26 | 26 | } |
27 | 27 | return TRUE; |
28 | 28 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $form['allowed_values_fieldset']['advanced_options']['markup_allowed_values_php'] = array( |
101 | 101 | '#type' => 'item', |
102 | 102 | '#title' => t('Code'), |
103 | - '#value' => !empty($field['allowed_values_php']) ? '<code>'. check_plain($field['allowed_values_php']) .'</code>' : t('<none>'), |
|
103 | + '#value' => !empty($field['allowed_values_php']) ? '<code>'.check_plain($field['allowed_values_php']).'</code>' : t('<none>'), |
|
104 | 104 | '#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.'), |
105 | 105 | ); |
106 | 106 | } |
@@ -129,13 +129,13 @@ discard block |
||
129 | 129 | $table_alias = content_views_tablename($field); |
130 | 130 | |
131 | 131 | // Filter: Add a 'many to one' filter. |
132 | - $copy = $data[$table_alias][$field['field_name'] .'_value']; |
|
132 | + $copy = $data[$table_alias][$field['field_name'].'_value']; |
|
133 | 133 | $copy['title'] = t('@label (!name) - Allowed values', array('@label' => t($field['widget']['label']), '!name' => $field['field_name'])); |
134 | 134 | $copy['filter']['handler'] = 'content_handler_filter_many_to_one'; |
135 | 135 | unset($copy['field'], $copy['argument'], $copy['sort']); |
136 | - $data[$table_alias][$field['field_name'] .'_value_many_to_one'] = $copy; |
|
136 | + $data[$table_alias][$field['field_name'].'_value_many_to_one'] = $copy; |
|
137 | 137 | // Argument : swap the handler to the 'many to one' operator. |
138 | - $data[$table_alias][$field['field_name'] .'_value']['argument']['handler'] = 'content_handler_argument_many_to_one'; |
|
138 | + $data[$table_alias][$field['field_name'].'_value']['argument']['handler'] = 'content_handler_argument_many_to_one'; |
|
139 | 139 | return $data; |
140 | 140 | } |
141 | 141 | } |
@@ -214,14 +214,14 @@ discard block |
||
214 | 214 | * Theme function for 'default' text field formatter. |
215 | 215 | */ |
216 | 216 | function theme_text_formatter_default($element) { |
217 | - return ($allowed =_text_allowed_values($element)) ? $allowed : $element['#item']['safe']; |
|
217 | + return ($allowed = _text_allowed_values($element)) ? $allowed : $element['#item']['safe']; |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | /** |
221 | 221 | * Theme function for 'plain' text field formatter. |
222 | 222 | */ |
223 | 223 | function theme_text_formatter_plain($element) { |
224 | - return ($allowed =_text_allowed_values($element)) ? $allowed : strip_tags($element['#item']['safe']); |
|
224 | + return ($allowed = _text_allowed_values($element)) ? $allowed : strip_tags($element['#item']['safe']); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | function theme_text_formatter_trimmed($element) { |
231 | 231 | $field = content_fields($element['#field_name'], $element['#type_name']); |
232 | - return ($allowed =_text_allowed_values($element)) ? $allowed : node_teaser($element['#item']['safe'], $field['text_processing'] ? $element['#item']['format'] : NULL); |
|
232 | + return ($allowed = _text_allowed_values($element)) ? $allowed : node_teaser($element['#item']['safe'], $field['text_processing'] ? $element['#item']['format'] : NULL); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | function _text_allowed_values($element) { |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | if (!empty($field['text_processing'])) { |
410 | 410 | $filter_key = $element['#columns'][1]; |
411 | 411 | $format = isset($element['#value'][$filter_key]) ? $element['#value'][$filter_key] : FILTER_FORMAT_DEFAULT; |
412 | - $parents = array_merge($element['#parents'] , array($filter_key)); |
|
412 | + $parents = array_merge($element['#parents'], array($filter_key)); |
|
413 | 413 | $element[$filter_key] = filter_form($format, 1, $parents); |
414 | 414 | } |
415 | 415 | |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | */ |
433 | 433 | function text_textarea_process($element, $edit, $form_state, $form) { |
434 | 434 | $field = $form['#field_info'][$element['#field_name']]; |
435 | - $field_key = $element['#columns'][0]; |
|
435 | + $field_key = $element['#columns'][0]; |
|
436 | 436 | $element[$field_key] = array( |
437 | 437 | '#type' => 'textarea', |
438 | 438 | '#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : NULL, |
@@ -450,9 +450,9 @@ discard block |
||
450 | 450 | ); |
451 | 451 | |
452 | 452 | if (!empty($field['text_processing'])) { |
453 | - $filter_key = (count($element['#columns']) == 2) ? $element['#columns'][1] : 'format'; |
|
453 | + $filter_key = (count($element['#columns']) == 2) ? $element['#columns'][1] : 'format'; |
|
454 | 454 | $format = isset($element['#value'][$filter_key]) ? $element['#value'][$filter_key] : FILTER_FORMAT_DEFAULT; |
455 | - $parents = array_merge($element['#parents'] , array($filter_key)); |
|
455 | + $parents = array_merge($element['#parents'], array($filter_key)); |
|
456 | 456 | $element[$filter_key] = filter_form($format, 1, $parents); |
457 | 457 | } |
458 | 458 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | function userreference_ctools_plugin_directory($module, $plugin) { |
50 | 50 | if ($module == 'ctools' && $plugin == 'relationships') { |
51 | - return 'panels/' . $plugin; |
|
51 | + return 'panels/'.$plugin; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | '#title' => t('View used to select the users'), |
112 | 112 | '#options' => $views, |
113 | 113 | '#default_value' => isset($field['advanced_view']) ? $field['advanced_view'] : '--', |
114 | - '#description' => t('<p>Choose the "Views module" view that selects the users that can be referenced.<br />Note:</p>') . |
|
114 | + '#description' => t('<p>Choose the "Views module" view that selects the users that can be referenced.<br />Note:</p>'). |
|
115 | 115 | t('<ul><li>Only views that have fields will work for this purpose.</li><li>This will discard the "Referenceable Roles" and "Referenceable Status" settings above. Use the view\'s "filters" section instead.</li><li>Use the view\'s "fields" section to display additional informations about candidate users on user creation/edition form.</li><li>Use the view\'s "sort criteria" section to determine the order in which candidate users will be displayed.</li></ul>'), |
116 | 116 | ); |
117 | 117 | $form['advanced']['advanced_view_args'] = array( |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | else { |
126 | 126 | $form['advanced']['no_view_help'] = array( |
127 | - '#value' => t('<p>The list of user that can be referenced can be based on a "Views module" view but no appropriate views were found. <br />Note:</p>') . |
|
127 | + '#value' => t('<p>The list of user that can be referenced can be based on a "Views module" view but no appropriate views were found. <br />Note:</p>'). |
|
128 | 128 | t('<ul><li>Only views that have fields will work for this purpose.</li><li>This will discard the "Referenceable Roles" and "Referenceable Status" settings above. Use the view\'s "filters" section instead.</li><li>Use the view\'s "fields" section to display additional informations about candidate users on user creation/edition form.</li><li>Use the view\'s "sort criteria" section to determine the order in which candidate users will be displayed.</li></ul>'), |
129 | 129 | ); |
130 | 130 | } |
@@ -151,20 +151,20 @@ discard block |
||
151 | 151 | $table_alias = content_views_tablename($field); |
152 | 152 | |
153 | 153 | // Filter : swap the handler to the 'in' operator. |
154 | - $data[$table_alias][$field['field_name'] .'_uid']['filter']['handler'] = 'content_handler_filter_many_to_one'; |
|
154 | + $data[$table_alias][$field['field_name'].'_uid']['filter']['handler'] = 'content_handler_filter_many_to_one'; |
|
155 | 155 | // Argument: get the user name for summaries. |
156 | 156 | // We need to join a new instance of the users table. |
157 | 157 | $data["users_$table_alias"]['table']['join']['node'] = array( |
158 | 158 | 'table' => 'users', |
159 | 159 | 'field' => 'uid', |
160 | 160 | 'left_table' => $table_alias, |
161 | - 'left_field' => $field['field_name'] .'_uid', |
|
161 | + 'left_field' => $field['field_name'].'_uid', |
|
162 | 162 | ); |
163 | - $data[$table_alias][$field['field_name'] .'_uid']['argument']['handler'] = 'content_handler_argument_reference'; |
|
164 | - $data[$table_alias][$field['field_name'] .'_uid']['argument']['name table'] = "users_$table_alias"; |
|
165 | - $data[$table_alias][$field['field_name'] .'_uid']['argument']['name field'] = 'name'; |
|
163 | + $data[$table_alias][$field['field_name'].'_uid']['argument']['handler'] = 'content_handler_argument_reference'; |
|
164 | + $data[$table_alias][$field['field_name'].'_uid']['argument']['name table'] = "users_$table_alias"; |
|
165 | + $data[$table_alias][$field['field_name'].'_uid']['argument']['name field'] = 'name'; |
|
166 | 166 | // Relationship: Add a relationship for related user. |
167 | - $data[$table_alias][$field['field_name'] .'_uid']['relationship'] = array( |
|
167 | + $data[$table_alias][$field['field_name'].'_uid']['relationship'] = array( |
|
168 | 168 | 'base' => 'users', |
169 | 169 | 'field' => $db_info['columns']['uid']['column'], |
170 | 170 | 'handler' => 'content_handler_relationship', |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | * Substitute in the user name for the uid. |
450 | 450 | */ |
451 | 451 | function userreference_autocomplete_value($element, $edit = FALSE) { |
452 | - $field_key = $element['#columns'][0]; |
|
452 | + $field_key = $element['#columns'][0]; |
|
453 | 453 | if (!empty($element['#default_value'][$field_key])) { |
454 | 454 | $value = db_result(db_query("SELECT name FROM {users} WHERE uid = '%d'", $element['#default_value'][$field_key])); |
455 | 455 | return array($field_key => $value); |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | // The userreference_select widget doesn't need to create its own |
470 | 470 | // element, it can wrap around the optionwidgets_select element. |
471 | 471 | // Add a validation step where the value can be unwrapped. |
472 | - $field_key = $element['#columns'][0]; |
|
472 | + $field_key = $element['#columns'][0]; |
|
473 | 473 | $element[$field_key] = array( |
474 | 474 | '#type' => 'optionwidgets_select', |
475 | 475 | '#default_value' => isset($element['#value']) ? $element['#value'] : '', |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | // The userreference_select widget doesn't need to create its own |
503 | 503 | // element, it can wrap around the optionwidgets_select element. |
504 | 504 | // Add a validation step where the value can be unwrapped. |
505 | - $field_key = $element['#columns'][0]; |
|
505 | + $field_key = $element['#columns'][0]; |
|
506 | 506 | $element[$field_key] = array( |
507 | 507 | '#type' => 'optionwidgets_buttons', |
508 | 508 | '#default_value' => isset($element['#value']) ? $element['#value'] : '', |
@@ -535,12 +535,12 @@ discard block |
||
535 | 535 | // element, it can wrap around the text_textfield element and add an autocomplete |
536 | 536 | // path and some extra processing to it. |
537 | 537 | // Add a validation step where the value can be unwrapped. |
538 | - $field_key = $element['#columns'][0]; |
|
538 | + $field_key = $element['#columns'][0]; |
|
539 | 539 | |
540 | 540 | $element[$field_key] = array( |
541 | 541 | '#type' => 'text_textfield', |
542 | 542 | '#default_value' => isset($element['#value']) ? $element['#value'] : '', |
543 | - '#autocomplete_path' => 'userreference/autocomplete/'. $element['#field_name'], |
|
543 | + '#autocomplete_path' => 'userreference/autocomplete/'.$element['#field_name'], |
|
544 | 544 | // The following values were set by the content module and need |
545 | 545 | // to be passed down to the nested element. |
546 | 546 | '#title' => $element['#title'], |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | * like optionwidgets are using #element_validate to alter the value. |
579 | 579 | */ |
580 | 580 | function userreference_optionwidgets_validate($element, &$form_state) { |
581 | - $field_key = $element['#columns'][0]; |
|
581 | + $field_key = $element['#columns'][0]; |
|
582 | 582 | |
583 | 583 | $value = $form_state['values']; |
584 | 584 | $new_parents = array(); |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | static $results = array(); |
671 | 671 | |
672 | 672 | // Create unique id for static cache. |
673 | - $cid = $field['field_name'] .':'. $match .':'. ($string !== '' ? $string : implode('-', $ids)) .':'. $limit; |
|
673 | + $cid = $field['field_name'].':'.$match.':'.($string !== '' ? $string : implode('-', $ids)).':'.$limit; |
|
674 | 674 | if (!isset($results[$cid])) { |
675 | 675 | $references = FALSE; |
676 | 676 | if (module_exists('views') && !empty($field['advanced_view']) && $field['advanced_view'] != '--') { |
@@ -783,11 +783,11 @@ discard block |
||
783 | 783 | 'equals' => "= '%s'", |
784 | 784 | 'starts_with' => "$like '%s%%'", |
785 | 785 | ); |
786 | - $where[] = 'u.name '. (isset($match_clauses[$match]) ? $match_clauses[$match] : $match_clauses['contains']); |
|
786 | + $where[] = 'u.name '.(isset($match_clauses[$match]) ? $match_clauses[$match] : $match_clauses['contains']); |
|
787 | 787 | $args[] = $string; |
788 | 788 | } |
789 | 789 | elseif ($ids) { |
790 | - $where[] = 'u.uid IN (' . db_placeholders($ids) . ')'; |
|
790 | + $where[] = 'u.uid IN ('.db_placeholders($ids).')'; |
|
791 | 791 | $args = array_merge($args, $ids); |
792 | 792 | } |
793 | 793 | else { |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | $roles = array_intersect(array_keys(user_roles(1)), $roles); |
803 | 803 | } |
804 | 804 | if (!empty($roles) && !in_array(DRUPAL_AUTHENTICATED_RID, $roles)) { |
805 | - $where[] = "r.rid IN (". implode($roles, ',') .")"; |
|
805 | + $where[] = "r.rid IN (".implode($roles, ',').")"; |
|
806 | 806 | $join[] = 'LEFT JOIN {users_roles} r ON u.uid = r.uid'; |
807 | 807 | } |
808 | 808 | |
@@ -812,8 +812,8 @@ discard block |
||
812 | 812 | } |
813 | 813 | |
814 | 814 | $users = array(); |
815 | - $where_clause = $where ? 'WHERE ('. implode(') AND (', $where) .')' : ''; |
|
816 | - $result = db_query('SELECT u.name, u.uid FROM {users} u '. implode(' ', $join) ." $where_clause ORDER BY u.name ASC", $args); |
|
815 | + $where_clause = $where ? 'WHERE ('.implode(') AND (', $where).')' : ''; |
|
816 | + $result = db_query('SELECT u.name, u.uid FROM {users} u '.implode(' ', $join)." $where_clause ORDER BY u.name ASC", $args); |
|
817 | 817 | while ($user = db_fetch_object($result)) { |
818 | 818 | $users[$user->uid] = array( |
819 | 819 | 'title' => $user->name, |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | $references = _userreference_potential_references($field, $string, $match, array(), 10); |
836 | 836 | foreach ($references as $id => $row) { |
837 | 837 | // Add a class wrapper for a few required CSS overrides. |
838 | - $matches[$row['title']] = '<div class="reference-autocomplete">'. $row['rendered'] . '</div>'; |
|
838 | + $matches[$row['title']] = '<div class="reference-autocomplete">'.$row['rendered'].'</div>'; |
|
839 | 839 | } |
840 | 840 | drupal_json($matches); |
841 | 841 | } |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | } |
871 | 871 | foreach ($search_tables as $table => $columns) { |
872 | 872 | foreach ($columns as $column) { |
873 | - $ids = db_query(db_rewrite_sql("SELECT DISTINCT(n.nid), n.title, n.type FROM {node} n LEFT JOIN {". $table ."} f ON n.vid = f.vid WHERE f.". $column ."=". $account->uid. " AND n.status = 1")); |
|
873 | + $ids = db_query(db_rewrite_sql("SELECT DISTINCT(n.nid), n.title, n.type FROM {node} n LEFT JOIN {".$table."} f ON n.vid = f.vid WHERE f.".$column."=".$account->uid." AND n.status = 1")); |
|
874 | 874 | while ($data = db_fetch_object($ids)) { |
875 | 875 | $additions[$data->type][$data->nid] = $data->title; |
876 | 876 | } |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | $values = array(); |
887 | 887 | foreach ($account->userreference as $node_type => $nodes) { |
888 | 888 | foreach ($nodes as $nid => $title) { |
889 | - $values[$node_type][] = l($title, 'node/'. $nid); |
|
889 | + $values[$node_type][] = l($title, 'node/'.$nid); |
|
890 | 890 | } |
891 | 891 | if (isset($values[$node_type])) { |
892 | 892 | $additions[] = array( |
@@ -8,12 +8,12 @@ discard block |
||
8 | 8 | function template_preprocess_content_field_overview_form(&$vars) { |
9 | 9 | $form = &$vars['form']; |
10 | 10 | |
11 | - $vars['help'] = theme('advanced_help_topic', 'content', 'manage-fields') . t('Add fields and groups to the content type, and arrange them on content display and input forms.'); |
|
11 | + $vars['help'] = theme('advanced_help_topic', 'content', 'manage-fields').t('Add fields and groups to the content type, and arrange them on content display and input forms.'); |
|
12 | 12 | if (module_exists('fieldgroup')) { |
13 | - $vars['help'] .= '<br/>'. t('You can add a field to a group by dragging it below and to the right of the group.'); |
|
13 | + $vars['help'] .= '<br/>'.t('You can add a field to a group by dragging it below and to the right of the group.'); |
|
14 | 14 | } |
15 | 15 | if (!module_exists('advanced_help')) { |
16 | - $vars['help'] .= '<br/>' . t('Note: Installing the <a href="!adv_help">Advanced help</a> module will let you access more and better help.', array('!adv_help' => 'http://drupal.org/project/advanced_help')); |
|
16 | + $vars['help'] .= '<br/>'.t('Note: Installing the <a href="!adv_help">Advanced help</a> module will let you access more and better help.', array('!adv_help' => 'http://drupal.org/project/advanced_help')); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | $order = _content_overview_order($form, $form['#field_rows'], $form['#group_rows']); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | foreach (element_children($element) as $child) { |
67 | 67 | $row->{$child} = drupal_render($element[$child]); |
68 | 68 | } |
69 | - $row->label_class = 'label-'. strtr($element['#row_type'], '_', '-'); |
|
69 | + $row->label_class = 'label-'.strtr($element['#row_type'], '_', '-'); |
|
70 | 70 | $row->row_type = $element['#row_type']; |
71 | 71 | $row->indentation = theme('indentation', isset($element['#depth']) ? $element['#depth'] : 0); |
72 | 72 | $row->class = 'draggable'; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $js_fields[$field_name] = array('label' => $field['widget']['label'], 'type' => $field['type'], 'widget' => $field['widget']['type']); |
95 | 95 | } |
96 | 96 | drupal_add_js(array('contentWidgetTypes' => content_widget_type_options(), 'contentFields' => $js_fields), 'setting'); |
97 | - drupal_add_js(drupal_get_path('module', 'content') .'/content.js'); |
|
97 | + drupal_add_js(drupal_get_path('module', 'content').'/content.js'); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | else { |
114 | 114 | $help = t("Configure how this content type's fields should be displayed when it's rendered in the following contexts."); |
115 | 115 | } |
116 | - $help .= ' '. t("Use the 'Exclude' checkbox to exclude an item from the !content value passed to the node template.", array('!content' => '$content')); |
|
116 | + $help .= ' '.t("Use the 'Exclude' checkbox to exclude an item from the !content value passed to the node template.", array('!content' => '$content')); |
|
117 | 117 | $vars['help'] = $help; |
118 | 118 | |
119 | 119 | $order = _content_overview_order($form, $form['#fields'], $form['#groups']); |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | function content_help($path, $arg) { |
19 | 19 | switch ($path) { |
20 | 20 | case 'admin/help#content': |
21 | - $output = '<p>'. t('The content module, a required component of the Content Construction Kit (CCK), allows administrators to associate custom fields with content types. In Drupal, content types are used to define the characteristics of a post, including the title and description of the fields displayed on its add and edit pages. Using the content module (and the other helper modules included in CCK), custom fields beyond the default "Title" and "Body" may be added. CCK features are accessible through tabs on the <a href="@content-types">content types administration page</a>. (See the <a href="@node-help">node module help page</a> for more information about content types.)', array('@content-types' => url('admin/content/types'), '@node-help' => url('admin/help/node'))) .'</p>'; |
|
22 | - $output .= '<p>'. t('When adding a custom field to a content type, you determine its type (whether it will contain text, numbers, or references to other objects) and how it will be displayed (either as a text field or area, a select box, checkbox, radio button, or autocompleting field). A field may have multiple values (i.e., a "person" may have multiple e-mail addresses) or a single value (i.e., an "employee" has a single employee identification number). As you add and edit fields, CCK automatically adjusts the structure of the database as necessary. CCK also provides a number of other features, including intelligent caching for your custom data, an import and export facility for content type definitions, and integration with other contributed modules.') .'</p>'; |
|
23 | - $output .= '<p>'. t('Custom field types are provided by a set of optional modules included with CCK (each module provides a different type). The <a href="@modules">modules page</a> allows you to enable or disable CCK components. A default installation of CCK includes:', array('@modules' => url('admin/build/modules'))) .'</p>'; |
|
21 | + $output = '<p>'.t('The content module, a required component of the Content Construction Kit (CCK), allows administrators to associate custom fields with content types. In Drupal, content types are used to define the characteristics of a post, including the title and description of the fields displayed on its add and edit pages. Using the content module (and the other helper modules included in CCK), custom fields beyond the default "Title" and "Body" may be added. CCK features are accessible through tabs on the <a href="@content-types">content types administration page</a>. (See the <a href="@node-help">node module help page</a> for more information about content types.)', array('@content-types' => url('admin/content/types'), '@node-help' => url('admin/help/node'))).'</p>'; |
|
22 | + $output .= '<p>'.t('When adding a custom field to a content type, you determine its type (whether it will contain text, numbers, or references to other objects) and how it will be displayed (either as a text field or area, a select box, checkbox, radio button, or autocompleting field). A field may have multiple values (i.e., a "person" may have multiple e-mail addresses) or a single value (i.e., an "employee" has a single employee identification number). As you add and edit fields, CCK automatically adjusts the structure of the database as necessary. CCK also provides a number of other features, including intelligent caching for your custom data, an import and export facility for content type definitions, and integration with other contributed modules.').'</p>'; |
|
23 | + $output .= '<p>'.t('Custom field types are provided by a set of optional modules included with CCK (each module provides a different type). The <a href="@modules">modules page</a> allows you to enable or disable CCK components. A default installation of CCK includes:', array('@modules' => url('admin/build/modules'))).'</p>'; |
|
24 | 24 | $output .= '<ul>'; |
25 | - $output .= '<li>'. t('<em>number</em>, which adds numeric field types, in integer, decimal or floating point form. You may define a set of allowed inputs, or specify an allowable range of values. A variety of common formats for displaying numeric data are available.') .'</li>'; |
|
26 | - $output .= '<li>'. t("<em>text</em>, which adds text field types. A text field may contain plain text only, or optionally, may use Drupal's input format filters to securely manage rich text input. Text input fields may be either a single line (text field), multiple lines (text area), or for greater input control, a select box, checkbox, or radio buttons. If desired, CCK can validate the input to a set of allowed values.") .'</li>'; |
|
27 | - $output .= '<li>'. t('<em>nodereference</em>, which creates custom references between Drupal nodes. By adding a <em>nodereference</em> field and two different content types, for instance, you can easily create complex parent/child relationships between data (multiple "employee" nodes may contain a <em>nodereference</em> field linking to an "employer" node).') .'</li>'; |
|
28 | - $output .= '<li>'. t('<em>userreference</em>, which creates custom references to your sites\' user accounts. By adding a <em>userreference</em> field, you can create complex relationships between your site\'s users and posts. To track user involvement in a post beyond Drupal\'s standard <em>Authored by</em> field, for instance, add a <em>userreference</em> field named "Edited by" to a content type to store a link to an editor\'s user account page.') .'</li>'; |
|
29 | - $output .= '<li>'. t('<em>fieldgroup</em>, which creates collapsible fieldsets to hold a group of related fields. A fieldset may either be open or closed by default. The order of your fieldsets, and the order of fields within a fieldset, is managed via a drag-and-drop interface provided by content module.') .'</li>'; |
|
25 | + $output .= '<li>'.t('<em>number</em>, which adds numeric field types, in integer, decimal or floating point form. You may define a set of allowed inputs, or specify an allowable range of values. A variety of common formats for displaying numeric data are available.').'</li>'; |
|
26 | + $output .= '<li>'.t("<em>text</em>, which adds text field types. A text field may contain plain text only, or optionally, may use Drupal's input format filters to securely manage rich text input. Text input fields may be either a single line (text field), multiple lines (text area), or for greater input control, a select box, checkbox, or radio buttons. If desired, CCK can validate the input to a set of allowed values.").'</li>'; |
|
27 | + $output .= '<li>'.t('<em>nodereference</em>, which creates custom references between Drupal nodes. By adding a <em>nodereference</em> field and two different content types, for instance, you can easily create complex parent/child relationships between data (multiple "employee" nodes may contain a <em>nodereference</em> field linking to an "employer" node).').'</li>'; |
|
28 | + $output .= '<li>'.t('<em>userreference</em>, which creates custom references to your sites\' user accounts. By adding a <em>userreference</em> field, you can create complex relationships between your site\'s users and posts. To track user involvement in a post beyond Drupal\'s standard <em>Authored by</em> field, for instance, add a <em>userreference</em> field named "Edited by" to a content type to store a link to an editor\'s user account page.').'</li>'; |
|
29 | + $output .= '<li>'.t('<em>fieldgroup</em>, which creates collapsible fieldsets to hold a group of related fields. A fieldset may either be open or closed by default. The order of your fieldsets, and the order of fields within a fieldset, is managed via a drag-and-drop interface provided by content module.').'</li>'; |
|
30 | 30 | $output .= '</ul>'; |
31 | - $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@handbook-cck">CCK</a> or the <a href="@project-cck">CCK project page</a>.', array('@handbook-cck' => 'http://drupal.org/handbook/modules/cck', '@project-cck' => 'http://drupal.org/project/cck')) .'</p>'; |
|
31 | + $output .= '<p>'.t('For more information, see the online handbook entry for <a href="@handbook-cck">CCK</a> or the <a href="@project-cck">CCK project page</a>.', array('@handbook-cck' => 'http://drupal.org/handbook/modules/cck', '@project-cck' => 'http://drupal.org/project/cck')).'</p>'; |
|
32 | 32 | return $output; |
33 | 33 | } |
34 | 34 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * Implementation of hook_init(). |
45 | 45 | */ |
46 | 46 | function content_init() { |
47 | - drupal_add_css(drupal_get_path('module', 'content') .'/theme/content-module.css'); |
|
47 | + drupal_add_css(drupal_get_path('module', 'content').'/theme/content-module.css'); |
|
48 | 48 | if (module_exists('token') && !function_exists('content_token_values')) { |
49 | 49 | module_load_include('inc', 'content', 'includes/content.token'); |
50 | 50 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | // Customize the content types page with our own callback |
68 | 68 | $items['admin/content/types']['page callback'] = 'content_types_overview'; |
69 | 69 | $items['admin/content/types']['file'] = 'content.admin.inc'; |
70 | - $items['admin/content/types']['file path'] = drupal_get_path('module', 'content') .'/includes'; |
|
70 | + $items['admin/content/types']['file path'] = drupal_get_path('module', 'content').'/includes'; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $type_name = $type->type; |
98 | 98 | $content_type = content_types($type_name); |
99 | 99 | $type_url_str = $content_type['url_str']; |
100 | - $items['admin/content/node-type/'. $type_url_str .'/fields'] = array( |
|
100 | + $items['admin/content/node-type/'.$type_url_str.'/fields'] = array( |
|
101 | 101 | 'title' => 'Manage fields', |
102 | 102 | 'page callback' => 'drupal_get_form', |
103 | 103 | 'page arguments' => array('content_field_overview_form', $type_name), |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | 'type' => MENU_LOCAL_TASK, |
107 | 107 | 'weight' => 1, |
108 | 108 | ); |
109 | - $items['admin/content/node-type/'. $type_url_str .'/display'] = array( |
|
109 | + $items['admin/content/node-type/'.$type_url_str.'/display'] = array( |
|
110 | 110 | 'title' => 'Display fields', |
111 | 111 | 'page callback' => 'drupal_get_form', |
112 | 112 | 'page arguments' => array('content_display_overview_form', $type_name), |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | ); |
118 | 118 | $contexts = content_build_modes('_tabs'); |
119 | 119 | foreach ($contexts as $key => $tab) { |
120 | - $items['admin/content/node-type/'. $type_url_str .'/display/'. $key] = array( |
|
120 | + $items['admin/content/node-type/'.$type_url_str.'/display/'.$key] = array( |
|
121 | 121 | 'title' => $tab['title'], |
122 | 122 | 'page arguments' => array('content_display_overview_form', $type_name, $key), |
123 | 123 | 'access arguments' => array('administer content types'), |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | } |
128 | 128 | // Cast as an array in case this is called before any fields have |
129 | 129 | // been added, like when a new content type is created. |
130 | - foreach ((array) $content_type['fields'] as $field) { |
|
130 | + foreach ((array)$content_type['fields'] as $field) { |
|
131 | 131 | $field_name = $field['field_name']; |
132 | - $items['admin/content/node-type/'. $type_url_str .'/fields/'. $field_name] = array( |
|
132 | + $items['admin/content/node-type/'.$type_url_str.'/fields/'.$field_name] = array( |
|
133 | 133 | 'title' => $field['widget']['label'], |
134 | 134 | 'page callback' => 'drupal_get_form', |
135 | 135 | 'page arguments' => array('content_field_edit_form', $type_name, $field_name), |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | 'file' => 'includes/content.admin.inc', |
138 | 138 | 'type' => MENU_LOCAL_TASK, |
139 | 139 | ); |
140 | - $items['admin/content/node-type/'. $type_url_str .'/fields/'. $field_name .'/remove'] = array( |
|
140 | + $items['admin/content/node-type/'.$type_url_str.'/fields/'.$field_name.'/remove'] = array( |
|
141 | 141 | 'title' => 'Remove field', |
142 | 142 | 'page callback' => 'drupal_get_form', |
143 | 143 | 'page arguments' => array('content_field_remove_form', $type_name, $field_name), |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * Implementation of hook_theme(). |
174 | 174 | */ |
175 | 175 | function content_theme() { |
176 | - $path = drupal_get_path('module', 'content') .'/theme'; |
|
176 | + $path = drupal_get_path('module', 'content').'/theme'; |
|
177 | 177 | require_once "./$path/theme.inc"; |
178 | 178 | |
179 | 179 | return array( |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | function content_views_api() { |
216 | 216 | return array( |
217 | 217 | 'api' => 2, |
218 | - 'path' => drupal_get_path('module', 'content') . '/includes/views', |
|
218 | + 'path' => drupal_get_path('module', 'content').'/includes/views', |
|
219 | 219 | ); |
220 | 220 | } |
221 | 221 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | function content_ctools_plugin_directory($module, $plugin) { |
226 | 226 | if ($module == 'ctools' && $plugin == 'content_types') { |
227 | - return 'includes/panels/' . $plugin; |
|
227 | + return 'includes/panels/'.$plugin; |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * cache the loaded object structure and invalidate it during the update process. |
238 | 238 | */ |
239 | 239 | function content_load(&$node) { |
240 | - $cid = 'content:'. $node->nid .':'. $node->vid; |
|
240 | + $cid = 'content:'.$node->nid.':'.$node->vid; |
|
241 | 241 | if ($cached = cache_get($cid, content_cache_tablename())) { |
242 | 242 | foreach ($cached->data as $key => $value) { |
243 | 243 | $node->$key = $value; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | function content_update(&$node) { |
298 | 298 | _content_field_invoke('update', $node); |
299 | 299 | _content_field_invoke_default('update', $node); |
300 | - cache_clear_all('content:'. $node->nid .':'. $node->vid, content_cache_tablename()); |
|
300 | + cache_clear_all('content:'.$node->nid.':'.$node->vid, content_cache_tablename()); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | function content_delete(&$node) { |
309 | 309 | _content_field_invoke('delete', $node); |
310 | 310 | _content_field_invoke_default('delete', $node); |
311 | - cache_clear_all('content:'. $node->nid .':', content_cache_tablename(), TRUE); |
|
311 | + cache_clear_all('content:'.$node->nid.':', content_cache_tablename(), TRUE); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | function content_delete_revision(&$node) { |
320 | 320 | _content_field_invoke('delete revision', $node); |
321 | 321 | _content_field_invoke_default('delete revision', $node); |
322 | - cache_clear_all('content:'. $node->nid .':'. $node->vid, content_cache_tablename()); |
|
322 | + cache_clear_all('content:'.$node->nid.':'.$node->vid, content_cache_tablename()); |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | |
334 | 334 | // Merge fields. |
335 | 335 | $additions = _content_field_invoke_default('view', $node, $teaser, $page); |
336 | - $node->content = array_merge((array) $node->content, $additions); |
|
336 | + $node->content = array_merge((array)$node->content, $additions); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | /** |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | // One-field equivalent to _content_field_invoke('sanitize'). |
372 | 372 | $field_types = _content_field_types(); |
373 | 373 | $module = $field_types[$field['type']]['module']; |
374 | - $function = $module .'_field'; |
|
374 | + $function = $module.'_field'; |
|
375 | 375 | if (function_exists($function)) { |
376 | 376 | $function('sanitize', $node, $field, $items, $teaser, $page); |
377 | 377 | $node->$field['field_name'] = $items; |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $additions = _content_field_invoke('prepare translation', $node); |
406 | 406 | // Merge module additions after the default ones to enable overriding |
407 | 407 | // of field values. |
408 | - $node = (object) array_merge((array) $node, $default_additions, $additions); |
|
408 | + $node = (object)array_merge((array)$node, $default_additions, $additions); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | $type = content_types($node->type); |
418 | 418 | // Save cycles if the type has no CCK fields. |
419 | 419 | if (!empty($type['fields'])) { |
420 | - $callback = 'content_'. str_replace(' ', '_', $op); |
|
420 | + $callback = 'content_'.str_replace(' ', '_', $op); |
|
421 | 421 | if (function_exists($callback)) { |
422 | 422 | $callback($node, $a3, $a4); |
423 | 423 | } |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | * Implementation of hook_form_alter(). |
437 | 437 | */ |
438 | 438 | function content_form_alter(&$form, $form_state, $form_id) { |
439 | - if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) { |
|
439 | + if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'].'_node_form' == $form_id) { |
|
440 | 440 | $type = content_types($form['#node']->type); |
441 | 441 | if (!empty($type['fields'])) { |
442 | 442 | module_load_include('inc', 'content', 'includes/content.node_form'); |
@@ -487,9 +487,9 @@ discard block |
||
487 | 487 | $output = ''; |
488 | 488 | |
489 | 489 | if ($field['multiple'] >= 1) { |
490 | - $table_id = $element['#field_name'] .'_values'; |
|
491 | - $order_class = $element['#field_name'] .'-delta-order'; |
|
492 | - $required = !empty($element['#required']) ? '<span class="form-required" title="'. t('This field is required.') .'">*</span>' : ''; |
|
490 | + $table_id = $element['#field_name'].'_values'; |
|
491 | + $order_class = $element['#field_name'].'-delta-order'; |
|
492 | + $required = !empty($element['#required']) ? '<span class="form-required" title="'.t('This field is required.').'">*</span>' : ''; |
|
493 | 493 | |
494 | 494 | $header = array( |
495 | 495 | array( |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | // preview or failed validation) |
505 | 505 | $items = array(); |
506 | 506 | foreach (element_children($element) as $key) { |
507 | - if ($key !== $element['#field_name'] .'_add_more') { |
|
507 | + if ($key !== $element['#field_name'].'_add_more') { |
|
508 | 508 | $items[] = &$element[$key]; |
509 | 509 | } |
510 | 510 | } |
@@ -526,8 +526,8 @@ discard block |
||
526 | 526 | } |
527 | 527 | |
528 | 528 | $output .= theme('table', $header, $rows, array('id' => $table_id, 'class' => 'content-multiple-table')); |
529 | - $output .= $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : ''; |
|
530 | - $output .= drupal_render($element[$element['#field_name'] .'_add_more']); |
|
529 | + $output .= $element['#description'] ? '<div class="description">'.$element['#description'].'</div>' : ''; |
|
530 | + $output .= drupal_render($element[$element['#field_name'].'_add_more']); |
|
531 | 531 | |
532 | 532 | drupal_add_tabledrag($table_id, 'order', 'sibling', $order_class); |
533 | 533 | } |
@@ -570,8 +570,8 @@ discard block |
||
570 | 570 | if (variable_get('content_schema_version', -1) < 6007) { |
571 | 571 | return FALSE; |
572 | 572 | } |
573 | - db_query("UPDATE {". content_field_tablename() ."} SET active=0 WHERE module='%s'", $module); |
|
574 | - db_query("UPDATE {". content_instance_tablename() ."} SET widget_active=0 WHERE widget_module='%s'", $module); |
|
573 | + db_query("UPDATE {".content_field_tablename()."} SET active=0 WHERE module='%s'", $module); |
|
574 | + db_query("UPDATE {".content_instance_tablename()."} SET widget_active=0 WHERE widget_module='%s'", $module); |
|
575 | 575 | content_clear_type_cache(TRUE); |
576 | 576 | break; |
577 | 577 | } |
@@ -593,14 +593,14 @@ discard block |
||
593 | 593 | if ($module_fields) { |
594 | 594 | foreach ($module_fields as $name => $field_info) { |
595 | 595 | watchdog('content', 'Updating field type %type with module %module.', array('%type' => $name, '%module' => $module)); |
596 | - db_query("UPDATE {". content_field_tablename() ."} SET module = '%s', active = %d WHERE type = '%s'", $module, 1, $name); |
|
596 | + db_query("UPDATE {".content_field_tablename()."} SET module = '%s', active = %d WHERE type = '%s'", $module, 1, $name); |
|
597 | 597 | } |
598 | 598 | } |
599 | 599 | $module_widgets = module_invoke($module, 'widget_info'); |
600 | 600 | if ($module_widgets) { |
601 | 601 | foreach ($module_widgets as $name => $widget_info) { |
602 | 602 | watchdog('content', 'Updating widget type %type with module %module.', array('%type' => $name, '%module' => $module)); |
603 | - db_query("UPDATE {". content_instance_tablename() ."} SET widget_module = '%s', widget_active = %d WHERE widget_type = '%s'", $module, 1, $name); |
|
603 | + db_query("UPDATE {".content_instance_tablename()."} SET widget_module = '%s', widget_active = %d WHERE widget_type = '%s'", $module, 1, $name); |
|
604 | 604 | } |
605 | 605 | } |
606 | 606 | // This is called from updates and installs, so get the install-safe |
@@ -611,8 +611,8 @@ discard block |
||
611 | 611 | foreach ($types as $type_name => $fields) { |
612 | 612 | foreach ($fields as $field) { |
613 | 613 | if ($field['module'] == $module && !in_array($field['field_name'], $fields_set)) { |
614 | - $columns = (array) module_invoke($field['module'], 'field_settings', 'database columns', $field); |
|
615 | - db_query("UPDATE {". content_field_tablename() ."} SET db_columns = '%s' WHERE field_name = '%s'", serialize($columns), $field['field_name']); |
|
614 | + $columns = (array)module_invoke($field['module'], 'field_settings', 'database columns', $field); |
|
615 | + db_query("UPDATE {".content_field_tablename()."} SET db_columns = '%s' WHERE field_name = '%s'", serialize($columns), $field['field_name']); |
|
616 | 616 | $fields_set[] = $field['field_name']; |
617 | 617 | } |
618 | 618 | } |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | |
697 | 697 | case 'presave': |
698 | 698 | if (!empty($node->devel_generate)) { |
699 | - include_once('./'. drupal_get_path('module', 'content') .'/includes/content.devel.inc'); |
|
699 | + include_once('./'.drupal_get_path('module', 'content').'/includes/content.devel.inc'); |
|
700 | 700 | content_generate_fields($node, $field); |
701 | 701 | $items = $node->{$field['field_name']}; |
702 | 702 | } |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | |
716 | 716 | // If there was an AHAH add more button in this field, don't save it. |
717 | 717 | // TODO: is it still needed ? |
718 | - unset($items[$field['field_name'] .'_add_more']); |
|
718 | + unset($items[$field['field_name'].'_add_more']); |
|
719 | 719 | |
720 | 720 | if (content_handle('widget', 'multiple values', $field) == CONTENT_HANDLE_CORE) { |
721 | 721 | // Reorder items to account for drag-n-drop reordering. |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | // enabled after the field was last edited. |
753 | 753 | $formatter_name = isset($field['display_settings'][$context]) && isset($field['display_settings'][$context]['format']) ? $field['display_settings'][$context]['format'] : 'default'; |
754 | 754 | if ($formatter = _content_get_formatter($formatter_name, $field['type'])) { |
755 | - $theme = $formatter['module'] .'_formatter_'. $formatter_name; |
|
755 | + $theme = $formatter['module'].'_formatter_'.$formatter_name; |
|
756 | 756 | $single = (content_handle('formatter', 'multiple values', $formatter) == CONTENT_HANDLE_CORE); |
757 | 757 | |
758 | 758 | $label_display = isset($field['display_settings']['label']['format']) ? $field['display_settings']['label']['format'] : 'above'; |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | $items[$delta]['view'] = isset($element['items'][$delta]['#children']) ? $element['items'][$delta]['#children'] : ''; |
846 | 846 | } |
847 | 847 | } |
848 | - elseif (isset($element['items']['#children'])) { |
|
848 | + elseif (isset($element['items']['#children'])) { |
|
849 | 849 | // Multiple values formatter. |
850 | 850 | $items[0]['view'] = $element['items']['#children']; |
851 | 851 | } |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | |
874 | 874 | if ($wrapper) { |
875 | 875 | // '#chilren' is not set if the field is empty. |
876 | - $addition[$field['field_name'] .'_rendered'] = isset($wrapper['#children']) ? $wrapper['#children'] : ''; |
|
876 | + $addition[$field['field_name'].'_rendered'] = isset($wrapper['#children']) ? $wrapper['#children'] : ''; |
|
877 | 877 | } |
878 | 878 | |
879 | 879 | return $addition; |
@@ -901,8 +901,8 @@ discard block |
||
901 | 901 | function content_set_empty($field, $items) { |
902 | 902 | // Filter out empty values. |
903 | 903 | $filtered = array(); |
904 | - $function = $field['module'] .'_content_is_empty'; |
|
905 | - foreach ((array) $items as $delta => $item) { |
|
904 | + $function = $field['module'].'_content_is_empty'; |
|
905 | + foreach ((array)$items as $delta => $item) { |
|
906 | 906 | if (!$function($item, $field)) { |
907 | 907 | $filtered[] = $item; |
908 | 908 | } |
@@ -985,12 +985,12 @@ discard block |
||
985 | 985 | if (!$schema['content fields']) { |
986 | 986 | continue; |
987 | 987 | } |
988 | - $query = 'SELECT * FROM {'. $table .'} WHERE vid = %d'; |
|
988 | + $query = 'SELECT * FROM {'.$table.'} WHERE vid = %d'; |
|
989 | 989 | |
990 | 990 | // If we're loading a table for a multiple field, |
991 | 991 | // we fetch all rows (values) ordered by delta, |
992 | 992 | // else we only fetch one row. |
993 | - $result = isset($schema['fields']['delta']) ? db_query($query .' ORDER BY delta', $node->vid) : db_query_range($query, $node->vid, 0, 1); |
|
993 | + $result = isset($schema['fields']['delta']) ? db_query($query.' ORDER BY delta', $node->vid) : db_query_range($query, $node->vid, 0, 1); |
|
994 | 994 | |
995 | 995 | // For each table row, populate the fields. |
996 | 996 | while ($row = db_fetch_array($result)) { |
@@ -1048,7 +1048,7 @@ discard block |
||
1048 | 1048 | // fields are added to content types -- either a NULL value |
1049 | 1049 | // or the default value? May need to offer the user an option of |
1050 | 1050 | // how to handle that. |
1051 | - if (db_result(db_query("SELECT COUNT(*) FROM {". $table ."} WHERE vid = %d", $node->vid))) { |
|
1051 | + if (db_result(db_query("SELECT COUNT(*) FROM {".$table."} WHERE vid = %d", $node->vid))) { |
|
1052 | 1052 | content_write_record($table, $record, array('vid')); |
1053 | 1053 | } |
1054 | 1054 | else { |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | $db_info = content_database_info($field); |
1064 | 1064 | // Delete and insert, rather than update, in case a value was added. |
1065 | 1065 | if ($op == 'update') { |
1066 | - db_query('DELETE FROM {'. $db_info['table'] .'} WHERE vid = %d', $node->vid); |
|
1066 | + db_query('DELETE FROM {'.$db_info['table'].'} WHERE vid = %d', $node->vid); |
|
1067 | 1067 | } |
1068 | 1068 | foreach ($node->$field['field_name'] as $delta => $item) { |
1069 | 1069 | $record = array(); |
@@ -1081,13 +1081,13 @@ discard block |
||
1081 | 1081 | |
1082 | 1082 | case 'delete': |
1083 | 1083 | foreach ($type['tables'] as $table) { |
1084 | - db_query('DELETE FROM {'. $table .'} WHERE nid = %d', $node->nid); |
|
1084 | + db_query('DELETE FROM {'.$table.'} WHERE nid = %d', $node->nid); |
|
1085 | 1085 | } |
1086 | 1086 | break; |
1087 | 1087 | |
1088 | 1088 | case 'delete revision': |
1089 | 1089 | foreach ($type['tables'] as $table) { |
1090 | - db_query('DELETE FROM {'. $table .'} WHERE vid = %d', $node->vid); |
|
1090 | + db_query('DELETE FROM {'.$table.'} WHERE vid = %d', $node->vid); |
|
1091 | 1091 | } |
1092 | 1092 | break; |
1093 | 1093 | } |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | |
1133 | 1133 | // Convert to an object if needed. |
1134 | 1134 | if (is_array($object)) { |
1135 | - $object = (object) $object; |
|
1135 | + $object = (object)$object; |
|
1136 | 1136 | $array = TRUE; |
1137 | 1137 | } |
1138 | 1138 | else { |
@@ -1188,7 +1188,7 @@ discard block |
||
1188 | 1188 | // Build the SQL. |
1189 | 1189 | $query = ''; |
1190 | 1190 | if (!count($update)) { |
1191 | - $query = "INSERT INTO {". $table ."} (". implode(', ', $fields) .') VALUES ('. implode(', ', $placeholders) .')'; |
|
1191 | + $query = "INSERT INTO {".$table."} (".implode(', ', $fields).') VALUES ('.implode(', ', $placeholders).')'; |
|
1192 | 1192 | $return = SAVED_NEW; |
1193 | 1193 | } |
1194 | 1194 | else { |
@@ -1197,15 +1197,15 @@ discard block |
||
1197 | 1197 | if ($query) { |
1198 | 1198 | $query .= ', '; |
1199 | 1199 | } |
1200 | - $query .= $field .' = '. $placeholders[$id]; |
|
1200 | + $query .= $field.' = '.$placeholders[$id]; |
|
1201 | 1201 | } |
1202 | 1202 | |
1203 | 1203 | foreach ($update as $key) { |
1204 | - $conditions[] = "$key = ". db_type_placeholder($schema['fields'][$key]['type']); |
|
1204 | + $conditions[] = "$key = ".db_type_placeholder($schema['fields'][$key]['type']); |
|
1205 | 1205 | $values[] = $object->$key; |
1206 | 1206 | } |
1207 | 1207 | |
1208 | - $query = "UPDATE {". $table ."} SET $query WHERE ". implode(' AND ', $conditions); |
|
1208 | + $query = "UPDATE {".$table."} SET $query WHERE ".implode(' AND ', $conditions); |
|
1209 | 1209 | $return = SAVED_UPDATED; |
1210 | 1210 | } |
1211 | 1211 | |
@@ -1220,7 +1220,7 @@ discard block |
||
1220 | 1220 | |
1221 | 1221 | // If we began with an array, convert back so we don't surprise the caller. |
1222 | 1222 | if ($array) { |
1223 | - $object = (array) $object; |
|
1223 | + $object = (array)$object; |
|
1224 | 1224 | } |
1225 | 1225 | |
1226 | 1226 | return $return; |
@@ -1245,10 +1245,10 @@ discard block |
||
1245 | 1245 | $items = isset($node->$field['field_name']) ? $node->$field['field_name'] : array(); |
1246 | 1246 | |
1247 | 1247 | // Make sure AHAH 'add more' button isn't sent to the fields for processing. |
1248 | - unset($items[$field['field_name'] .'_add_more']); |
|
1248 | + unset($items[$field['field_name'].'_add_more']); |
|
1249 | 1249 | |
1250 | 1250 | $module = $field_types[$field['type']]['module']; |
1251 | - $function = $module .'_field'; |
|
1251 | + $function = $module.'_field'; |
|
1252 | 1252 | if (function_exists($function)) { |
1253 | 1253 | $result = $function($op, $node, $field, $items, $teaser, $page); |
1254 | 1254 | if (is_array($result)) { |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | return array(); |
1409 | 1409 | } |
1410 | 1410 | |
1411 | - if (!$reset && $cached = cache_get('content_type_info:'. $language->language, content_cache_tablename())) { |
|
1411 | + if (!$reset && $cached = cache_get('content_type_info:'.$language->language, content_cache_tablename())) { |
|
1412 | 1412 | $info = $cached->data; |
1413 | 1413 | } |
1414 | 1414 | else { |
@@ -1469,7 +1469,7 @@ discard block |
||
1469 | 1469 | // Populate actual field instances. |
1470 | 1470 | module_load_include('inc', 'content', 'includes/content.crud'); |
1471 | 1471 | foreach (node_get_types('types', NULL, TRUE) as $type_name => $data) { |
1472 | - $type = (array) $data; |
|
1472 | + $type = (array)$data; |
|
1473 | 1473 | $type['url_str'] = str_replace('_', '-', $type['type']); |
1474 | 1474 | $type['fields'] = array(); |
1475 | 1475 | $type['tables'] = array(); |
@@ -1502,7 +1502,7 @@ discard block |
||
1502 | 1502 | $extra = module_invoke_all('content_extra_fields', $type_name); |
1503 | 1503 | drupal_alter('content_extra_fields', $extra, $type_name); |
1504 | 1504 | // Add saved weights. |
1505 | - foreach (variable_get('content_extra_weights_'. $type_name, array()) as $key => $value) { |
|
1505 | + foreach (variable_get('content_extra_weights_'.$type_name, array()) as $key => $value) { |
|
1506 | 1506 | // Some stored entries might not exist anymore, for instance if uploads |
1507 | 1507 | // have been disabled, or vocabularies removed... |
1508 | 1508 | if (isset($extra[$key])) { |
@@ -1514,7 +1514,7 @@ discard block |
||
1514 | 1514 | $info['content types'][$type_name] = $type; |
1515 | 1515 | } |
1516 | 1516 | |
1517 | - cache_set('content_type_info:'. $language->language, $info, content_cache_tablename()); |
|
1517 | + cache_set('content_type_info:'.$language->language, $info, content_cache_tablename()); |
|
1518 | 1518 | } |
1519 | 1519 | } |
1520 | 1520 | return $info; |
@@ -1585,10 +1585,10 @@ discard block |
||
1585 | 1585 | $db_info['table'] = _content_tablename($field['type_name'], CONTENT_DB_STORAGE_PER_CONTENT_TYPE); |
1586 | 1586 | } |
1587 | 1587 | |
1588 | - $db_info['columns'] = (array) $field['columns']; |
|
1588 | + $db_info['columns'] = (array)$field['columns']; |
|
1589 | 1589 | // Generate column names for this field from generic column names. |
1590 | 1590 | foreach ($db_info['columns'] as $column_name => $attributes) { |
1591 | - $db_info['columns'][$column_name]['column'] = $field['field_name'] .'_'. $column_name; |
|
1591 | + $db_info['columns'][$column_name]['column'] = $field['field_name'].'_'.$column_name; |
|
1592 | 1592 | } |
1593 | 1593 | |
1594 | 1594 | return $db_info; |
@@ -1682,7 +1682,7 @@ discard block |
||
1682 | 1682 | function content_allowed_values($field, $flatten = TRUE) { |
1683 | 1683 | static $allowed_values; |
1684 | 1684 | |
1685 | - $cid = $field['field_name'] .':'. ($flatten ? '1' : '0'); |
|
1685 | + $cid = $field['field_name'].':'.($flatten ? '1' : '0'); |
|
1686 | 1686 | if (isset($allowed_values[$cid])) { |
1687 | 1687 | return $allowed_values[$cid]; |
1688 | 1688 | } |
@@ -1710,7 +1710,7 @@ discard block |
||
1710 | 1710 | $opt = content_filter_xss($opt); |
1711 | 1711 | if (strpos($opt, '|') !== FALSE) { |
1712 | 1712 | list($key, $value) = explode('|', $opt); |
1713 | - $allowed_values[$cid][$key] = (isset($value) && $value !=='') ? $value : $key; |
|
1713 | + $allowed_values[$cid][$key] = (isset($value) && $value !== '') ? $value : $key; |
|
1714 | 1714 | } |
1715 | 1715 | else { |
1716 | 1716 | $allowed_values[$cid][$opt] = $opt; |
@@ -1755,14 +1755,14 @@ discard block |
||
1755 | 1755 | * List of tags allowed by content_filter_xss(). |
1756 | 1756 | */ |
1757 | 1757 | function _content_filter_xss_allowed_tags() { |
1758 | - return array('a', 'b', 'big', 'code', 'del', 'em', 'i', 'ins', 'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img'); |
|
1758 | + return array('a', 'b', 'big', 'code', 'del', 'em', 'i', 'ins', 'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img'); |
|
1759 | 1759 | } |
1760 | 1760 | |
1761 | 1761 | /** |
1762 | 1762 | * Human-readable list of allowed tags, for display in help texts. |
1763 | 1763 | */ |
1764 | 1764 | function _content_filter_xss_display_allowed_tags() { |
1765 | - return '<'. implode('> <', _content_filter_xss_allowed_tags()) .'>'; |
|
1765 | + return '<'.implode('> <', _content_filter_xss_allowed_tags()).'>'; |
|
1766 | 1766 | } |
1767 | 1767 | |
1768 | 1768 | /** |
@@ -1795,12 +1795,12 @@ discard block |
||
1795 | 1795 | } |
1796 | 1796 | |
1797 | 1797 | if (content_access('view', $field, NULL, $node) && $formatter = _content_get_formatter($formatter_name, $field['type'])) { |
1798 | - $theme = $formatter['module'] .'_formatter_'. $formatter_name; |
|
1798 | + $theme = $formatter['module'].'_formatter_'.$formatter_name; |
|
1799 | 1799 | |
1800 | 1800 | $element = array( |
1801 | 1801 | '#theme' => $theme, |
1802 | 1802 | '#field_name' => $field['field_name'], |
1803 | - '#type_name' => isset($node->type) ? $node->type :'', |
|
1803 | + '#type_name' => isset($node->type) ? $node->type : '', |
|
1804 | 1804 | '#formatter' => $formatter_name, |
1805 | 1805 | '#node' => $node, |
1806 | 1806 | '#delta' => isset($item['#delta']) ? $item['#delta'] : NULL, |
@@ -1811,7 +1811,7 @@ discard block |
||
1811 | 1811 | |
1812 | 1812 | // hook_field('sanitize') expects an array of items, so we build one. |
1813 | 1813 | $items = array($item); |
1814 | - $function = $field['module'] .'_field'; |
|
1814 | + $function = $field['module'].'_field'; |
|
1815 | 1815 | if (function_exists($function)) { |
1816 | 1816 | $function('sanitize', $node, $field, $items, FALSE, FALSE); |
1817 | 1817 | } |
@@ -1821,7 +1821,7 @@ discard block |
||
1821 | 1821 | else { |
1822 | 1822 | // Multiple values formatter. |
1823 | 1823 | $items = $item; |
1824 | - $function = $field['module'] .'_field'; |
|
1824 | + $function = $field['module'].'_field'; |
|
1825 | 1825 | if (function_exists($function)) { |
1826 | 1826 | $function('sanitize', $node, $field, $items, FALSE, FALSE); |
1827 | 1827 | } |
@@ -1856,13 +1856,13 @@ discard block |
||
1856 | 1856 | if (!isset($info)) { |
1857 | 1857 | $data = array(); |
1858 | 1858 | foreach (module_implements('content_build_modes') as $module) { |
1859 | - $function = $module .'_content_build_modes'; |
|
1860 | - $data = array_merge($data, (array) $function()); |
|
1859 | + $function = $module.'_content_build_modes'; |
|
1860 | + $data = array_merge($data, (array)$function()); |
|
1861 | 1861 | } |
1862 | 1862 | $flat = array(); |
1863 | 1863 | foreach ($data as $tab) { |
1864 | 1864 | // Use the + operator to preserve numeric indexes (core build modes). |
1865 | - $flat += (array) $tab['build modes']; |
|
1865 | + $flat += (array)$tab['build modes']; |
|
1866 | 1866 | } |
1867 | 1867 | $info = array('tabs' => $data, 'build modes' => $flat); |
1868 | 1868 | } |
@@ -1994,13 +1994,13 @@ discard block |
||
1994 | 1994 | |
1995 | 1995 | $name = str_replace('-', '_', $name); |
1996 | 1996 | switch ("$version-$storage") { |
1997 | - case '0-'. CONTENT_DB_STORAGE_PER_CONTENT_TYPE : |
|
1997 | + case '0-'.CONTENT_DB_STORAGE_PER_CONTENT_TYPE : |
|
1998 | 1998 | return "node_$name"; |
1999 | - case '0-'. CONTENT_DB_STORAGE_PER_FIELD : |
|
1999 | + case '0-'.CONTENT_DB_STORAGE_PER_FIELD : |
|
2000 | 2000 | return "node_data_$name"; |
2001 | - case '1003-'. CONTENT_DB_STORAGE_PER_CONTENT_TYPE : |
|
2001 | + case '1003-'.CONTENT_DB_STORAGE_PER_CONTENT_TYPE : |
|
2002 | 2002 | return "content_type_$name"; |
2003 | - case '1003-'. CONTENT_DB_STORAGE_PER_FIELD : |
|
2003 | + case '1003-'.CONTENT_DB_STORAGE_PER_FIELD : |
|
2004 | 2004 | return "content_$name"; |
2005 | 2005 | } |
2006 | 2006 | } |
@@ -2083,7 +2083,7 @@ discard block |
||
2083 | 2083 | |
2084 | 2084 | if (!empty($field['columns'])) { |
2085 | 2085 | foreach ($field['columns'] as $column => $attributes) { |
2086 | - $column_name = $field['field_name'] .'_'. $column; |
|
2086 | + $column_name = $field['field_name'].'_'.$column; |
|
2087 | 2087 | if (isset($attributes['index']) && $attributes['index']) { |
2088 | 2088 | $schema['indexes'][$column_name] = array($column_name); |
2089 | 2089 | unset($attributes['index']); |
@@ -2116,7 +2116,7 @@ discard block |
||
2116 | 2116 | if ($db_type == 'mysql' || $db_type == 'mysqli') { |
2117 | 2117 | if (version_compare(db_version(), '5.0.3') < 0) { |
2118 | 2118 | // Earlier versions of MySQL don't support a WHERE clause for SHOW. |
2119 | - $result = db_query('SHOW INDEX FROM {'. $table .'}'); |
|
2119 | + $result = db_query('SHOW INDEX FROM {'.$table.'}'); |
|
2120 | 2120 | while ($row = db_fetch_array($result)) { |
2121 | 2121 | if ($row['Key_name'] == $name) { |
2122 | 2122 | return TRUE; |
@@ -2124,12 +2124,12 @@ discard block |
||
2124 | 2124 | } |
2125 | 2125 | return FALSE; |
2126 | 2126 | } |
2127 | - return (bool)db_result(db_query("SHOW INDEX FROM {". $table ."} WHERE key_name = '$name'")); |
|
2127 | + return (bool)db_result(db_query("SHOW INDEX FROM {".$table."} WHERE key_name = '$name'")); |
|
2128 | 2128 | } |
2129 | 2129 | elseif ($db_type == 'pgsql') { |
2130 | 2130 | // Note that the index names in Schema API for PostgreSQL are prefixed by |
2131 | 2131 | // the table name and suffixed by '_idx'. |
2132 | - return (bool)db_result(db_query("SELECT COUNT(indexname) FROM pg_indexes WHERE indexname = '{". $table ."}_{$name}_idx'")); |
|
2132 | + return (bool)db_result(db_query("SELECT COUNT(indexname) FROM pg_indexes WHERE indexname = '{".$table."}_{$name}_idx'")); |
|
2133 | 2133 | } |
2134 | 2134 | return FALSE; |
2135 | 2135 | } |
@@ -2226,7 +2226,7 @@ discard block |
||
2226 | 2226 | elseif (!empty($field['widget']['default_value'])) { |
2227 | 2227 | $default_value = $field['widget']['default_value']; |
2228 | 2228 | } |
2229 | - return (array) $default_value; |
|
2229 | + return (array)$default_value; |
|
2230 | 2230 | } |
2231 | 2231 | |
2232 | 2232 | /** |
@@ -2373,7 +2373,7 @@ discard block |
||
2373 | 2373 | $variables['items'][$delta]['view'] = isset($element['items'][$delta]['#children']) ? $element['items'][$delta]['#children'] : ''; |
2374 | 2374 | } |
2375 | 2375 | } |
2376 | - else { |
|
2376 | + else { |
|
2377 | 2377 | // Multiple values formatter. |
2378 | 2378 | // We display the 'all items' output as $items[0], as if it was the |
2379 | 2379 | // output of a single valued field. |
@@ -2409,9 +2409,9 @@ discard block |
||
2409 | 2409 | 'field_empty' => $field_empty, |
2410 | 2410 | 'template_files' => array( |
2411 | 2411 | 'content-field', |
2412 | - 'content-field-'. $element['#field_name'], |
|
2413 | - 'content-field-'. $element['#node']->type, |
|
2414 | - 'content-field-'. $element['#field_name'] .'-'. $element['#node']->type, |
|
2412 | + 'content-field-'.$element['#field_name'], |
|
2413 | + 'content-field-'.$element['#node']->type, |
|
2414 | + 'content-field-'.$element['#field_name'].'-'.$element['#node']->type, |
|
2415 | 2415 | ), |
2416 | 2416 | ); |
2417 | 2417 | $variables = array_merge($variables, $additions); |
@@ -2629,7 +2629,7 @@ discard block |
||
2629 | 2629 | if (empty($type_name) || $content_type['type'] == $type_name) { |
2630 | 2630 | foreach ($content_type['fields'] as $field) { |
2631 | 2631 | $db_info = content_database_info($field); |
2632 | - if (db_result(db_query("SELECT COUNT(*) FROM {". $db_info['table'] ."}")) >= 1) { |
|
2632 | + if (db_result(db_query("SELECT COUNT(*) FROM {".$db_info['table']."}")) >= 1) { |
|
2633 | 2633 | return 0; |
2634 | 2634 | } |
2635 | 2635 | } |
@@ -2642,10 +2642,10 @@ discard block |
||
2642 | 2642 | else { |
2643 | 2643 | $db_info = content_database_info($field); |
2644 | 2644 | if (!empty($type_name)) { |
2645 | - $delta = db_result(db_query("SELECT MAX(delta) FROM {". $db_info['table'] ."} f LEFT JOIN {node} n ON f.vid = n.vid WHERE n.type = '%s'", $type_name)); |
|
2645 | + $delta = db_result(db_query("SELECT MAX(delta) FROM {".$db_info['table']."} f LEFT JOIN {node} n ON f.vid = n.vid WHERE n.type = '%s'", $type_name)); |
|
2646 | 2646 | } |
2647 | 2647 | else { |
2648 | - $delta = db_result(db_query("SELECT MAX(delta) FROM {". $db_info['table'] ."}")); |
|
2648 | + $delta = db_result(db_query("SELECT MAX(delta) FROM {".$db_info['table']."}")); |
|
2649 | 2649 | } |
2650 | 2650 | if ($delta >= 0) { |
2651 | 2651 | return $delta; |