@@ -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; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | function content_profile_registration_form_alter(&$form, &$form_state, $form_id) { |
13 | 13 | if ($form_id == 'user_register') { |
14 | - require_once drupal_get_path('module', 'node') .'/node.pages.inc'; |
|
14 | + require_once drupal_get_path('module', 'node').'/node.pages.inc'; |
|
15 | 15 | |
16 | 16 | // Allow other modules to customize the used profile types, so modules |
17 | 17 | // can easily customize the registration form. |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | // Initialize new node and add in its form. |
108 | 108 | $node = array('uid' => 0, 'name' => '', 'type' => $type); |
109 | 109 | // Get the original node form. |
110 | - $node_form = drupal_retrieve_form($type .'_node_form', $form_state, $node); |
|
111 | - drupal_prepare_form($type .'_node_form', $node_form, $form_state); |
|
110 | + $node_form = drupal_retrieve_form($type.'_node_form', $form_state, $node); |
|
111 | + drupal_prepare_form($type.'_node_form', $node_form, $form_state); |
|
112 | 112 | |
113 | 113 | $node_form += array('#field_info' => array()); |
114 | 114 | $form_add = array(); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | // Set the enctype, if necessary. |
178 | - if (isset($node_form['#attributes']['enctype'])){ |
|
178 | + if (isset($node_form['#attributes']['enctype'])) { |
|
179 | 179 | $form['#attributes']['enctype'] = $node_form['#attributes']['enctype']; |
180 | 180 | } |
181 | 181 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | foreach ($elements['#content_profile_weights'] as $key => $weight) { |
191 | 191 | if (isset($elements[$key]) && is_array($elements[$key])) { |
192 | 192 | $elements[$key] += array('#weight' => 0); |
193 | - $elements[$key]['#weight'] = $weight + $elements[$key]['#weight'] / 1000; |
|
193 | + $elements[$key]['#weight'] = $weight + $elements[$key]['#weight']/1000; |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | return $elements; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * Validates the user registration form |
202 | 202 | */ |
203 | 203 | function content_profile_registration_user_register_validate($form, &$form_state) { |
204 | - require_once drupal_get_path('module', 'node') .'/node.pages.inc'; |
|
204 | + require_once drupal_get_path('module', 'node').'/node.pages.inc'; |
|
205 | 205 | |
206 | 206 | foreach ($form['#content_profile_registration_use_types'] as $type => $typename) { |
207 | 207 | $node = (object)$form_state['values']; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $types = content_profile_get_types('types'); |
17 | 17 | switch ($type) { |
18 | 18 | case 'user': |
19 | - foreach($types as $type_name => $type) { |
|
19 | + foreach ($types as $type_name => $type) { |
|
20 | 20 | if (isset($object)) { |
21 | 21 | $profile = content_profile_load($type_name, $object->uid); |
22 | 22 | } |
@@ -27,27 +27,27 @@ discard block |
||
27 | 27 | $fields = content_types($type_name); |
28 | 28 | foreach ($fields['fields'] as $field_name => $field) { |
29 | 29 | if (!$field['multiple'] && ($field['widget']['type'] == 'text_textfield' || $field['widget']['type'] == 'number')) { |
30 | - $values['content-profile-'. $type_name .'-'. substr($field_name, 6)] = check_plain($profile->{$field_name}[0]['value']); |
|
31 | - $values['content-profile-'. $type_name .'-'. substr($field_name, 6) .'-raw'] = $profile->{$field_name}[0]['value']; |
|
30 | + $values['content-profile-'.$type_name.'-'.substr($field_name, 6)] = check_plain($profile->{$field_name}[0]['value']); |
|
31 | + $values['content-profile-'.$type_name.'-'.substr($field_name, 6).'-raw'] = $profile->{$field_name}[0]['value']; |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | } |
35 | 35 | break; |
36 | 36 | |
37 | 37 | case 'flag_friend': |
38 | - if(!empty($object)) { |
|
39 | - foreach($types as $type_name => $type) { |
|
38 | + if (!empty($object)) { |
|
39 | + foreach ($types as $type_name => $type) { |
|
40 | 40 | $profile_requestor = content_profile_load($type_name, $object->friend->uid); |
41 | 41 | $profile_requestee = content_profile_load($type_name, $object->uid); |
42 | 42 | |
43 | 43 | $fields = content_types($type_name); |
44 | 44 | foreach ($fields['fields'] as $field_name => $field) { |
45 | 45 | if (!$field['multiple'] && ($field['widget']['type'] == 'text_textfield' || $field['widget']['type'] == 'number')) { |
46 | - $values['requestor-'. $type_name .'-'. substr($field_name, 6)] = check_plain($profile_requestor->{$field_name}[0]['value']); |
|
47 | - $values['requestor-'. $type_name .'-'. substr($field_name, 6) .'-raw'] = $profile_requestor->{$field_name}[0]['value']; |
|
46 | + $values['requestor-'.$type_name.'-'.substr($field_name, 6)] = check_plain($profile_requestor->{$field_name}[0]['value']); |
|
47 | + $values['requestor-'.$type_name.'-'.substr($field_name, 6).'-raw'] = $profile_requestor->{$field_name}[0]['value']; |
|
48 | 48 | |
49 | - $values['requestee-'. $type_name .'-'. substr($field_name, 6)] = check_plain($profile_requestee->{$field_name}[0]['value']); |
|
50 | - $values['requestee-'. $type_name .'-'. substr($field_name, 6) .'-raw'] = $profile_requestee->{$field_name}[0]['value']; |
|
49 | + $values['requestee-'.$type_name.'-'.substr($field_name, 6)] = check_plain($profile_requestee->{$field_name}[0]['value']); |
|
50 | + $values['requestee-'.$type_name.'-'.substr($field_name, 6).'-raw'] = $profile_requestee->{$field_name}[0]['value']; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
@@ -69,23 +69,23 @@ discard block |
||
69 | 69 | $fields = content_types($type_name); |
70 | 70 | foreach ($fields['fields'] as $field_name => $field) { |
71 | 71 | if (!$field['multiple'] && ($field['widget']['type'] == 'text_textfield' || $field['widget']['type'] == 'number')) { |
72 | - $tokens['user']['content-profile-'. $type_name .'-'. substr($field_name, 6)] = t($fields['description']) .'-'. t($field['widget']['label']); |
|
73 | - $tokens['user']['content-profile-'. $type_name .'-'. substr($field_name, 6) .'-raw'] = t($fields['description']) .'-'. t($field['widget']['label']) .' '. t('WARNING - raw user input'); |
|
72 | + $tokens['user']['content-profile-'.$type_name.'-'.substr($field_name, 6)] = t($fields['description']).'-'.t($field['widget']['label']); |
|
73 | + $tokens['user']['content-profile-'.$type_name.'-'.substr($field_name, 6).'-raw'] = t($fields['description']).'-'.t($field['widget']['label']).' '.t('WARNING - raw user input'); |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | 79 | if ($type == 'flag_friend' && module_exists('flag_friend')) { |
80 | - foreach($types as $type_name => $type) { |
|
80 | + foreach ($types as $type_name => $type) { |
|
81 | 81 | $fields = content_types($type_name); |
82 | 82 | foreach ($fields['fields'] as $field_name => $field) { |
83 | 83 | if (!$field['multiple'] && ($field['widget']['type'] == 'text_textfield' || $field['widget']['type'] == 'number')) { |
84 | - $tokens['content_profile_flag_friend']['requestor-'. $type_name .'-'. substr($field_name, 6)] = t('Requestor:') . t($fields['description']) .'-'. t($field['widget']['label']); |
|
85 | - $tokens['content_profile_flag_friend']['requestor-'. $type_name .'-'. substr($field_name, 6) .'-raw'] = t('Requestor:') . t($fields['description']) .'-'. t($field['widget']['label']) .' '. t('WARNING - raw user input'); |
|
84 | + $tokens['content_profile_flag_friend']['requestor-'.$type_name.'-'.substr($field_name, 6)] = t('Requestor:').t($fields['description']).'-'.t($field['widget']['label']); |
|
85 | + $tokens['content_profile_flag_friend']['requestor-'.$type_name.'-'.substr($field_name, 6).'-raw'] = t('Requestor:').t($fields['description']).'-'.t($field['widget']['label']).' '.t('WARNING - raw user input'); |
|
86 | 86 | |
87 | - $tokens['content_profile_flag_friend']['requestee-'. $type_name .'-'. substr($field_name, 6)] = t('Requestee:') . t($fields['description']) .'-'. t($field['widget']['label']); |
|
88 | - $tokens['content_profile_flag_friend']['requestee-'. $type_name .'-'. substr($field_name, 6) .'-raw'] = t('Requestee:') .t($fields['description']) .'-'. t($field['widget']['label']) .' '. t('WARNING - raw user input'); |
|
87 | + $tokens['content_profile_flag_friend']['requestee-'.$type_name.'-'.substr($field_name, 6)] = t('Requestee:').t($fields['description']).'-'.t($field['widget']['label']); |
|
88 | + $tokens['content_profile_flag_friend']['requestee-'.$type_name.'-'.substr($field_name, 6).'-raw'] = t('Requestee:').t($fields['description']).'-'.t($field['widget']['label']).' '.t('WARNING - raw user input'); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function content_profile_ctools_plugin_directory($module, $plugin) { |
21 | 21 | if ($module == 'ctools' && $plugin == 'relationships') { |
22 | - return 'panels/' . $plugin; |
|
22 | + return 'panels/'.$plugin; |
|
23 | 23 | } |
24 | 24 | } |
25 | 25 | |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | |
32 | 32 | //Register a path for each content profile type |
33 | 33 | foreach (content_profile_get_types('names') as $type => $typename) { |
34 | - $items['admin/content/node-type/'. str_replace('_', '-', $type) .'/edit'] = array( |
|
34 | + $items['admin/content/node-type/'.str_replace('_', '-', $type).'/edit'] = array( |
|
35 | 35 | 'title' => 'Edit', |
36 | 36 | 'type' => MENU_DEFAULT_LOCAL_TASK, |
37 | 37 | ); |
38 | - $items['admin/content/node-type/'. str_replace('_', '-', $type) .'/profile'] = array( |
|
38 | + $items['admin/content/node-type/'.str_replace('_', '-', $type).'/profile'] = array( |
|
39 | 39 | 'title' => 'Content profile', |
40 | 40 | 'description' => 'Configure the display and management of this content profile.', |
41 | 41 | 'page callback' => 'drupal_get_form', |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | ); |
48 | 48 | } |
49 | 49 | foreach (content_profile_get_types('names') as $type => $type_name) { |
50 | - $items['user/%user/profile/'. $type] = array( |
|
50 | + $items['user/%user/profile/'.$type] = array( |
|
51 | 51 | 'title callback' => 'check_plain', |
52 | 52 | 'title' => drupal_ucfirst($type_name), |
53 | 53 | 'page callback' => 'content_profile_page_edit', |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | */ |
70 | 70 | function content_profile_menu_alter(&$items) { |
71 | 71 | foreach (content_profile_get_types('names', 'edit_tab', 'sub') as $type => $type_name) { |
72 | - if (!empty($items['user/%user_category/edit/'. $type])) { |
|
73 | - $item = &$items['user/%user_category/edit/'. $type]; |
|
72 | + if (!empty($items['user/%user_category/edit/'.$type])) { |
|
73 | + $item = &$items['user/%user_category/edit/'.$type]; |
|
74 | 74 | $item = array( |
75 | 75 | 'page callback' => 'content_profile_page_edit', |
76 | 76 | 'page arguments' => array($type, 1), |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | // Else user may view the page when they are going to create their own profile |
92 | 92 | // or have permission to create it for others. |
93 | 93 | global $user; |
94 | - if ($user->uid == $account->uid || user_access('administer nodes') ){ |
|
94 | + if ($user->uid == $account->uid || user_access('administer nodes')) { |
|
95 | 95 | return node_access('create', $type); |
96 | 96 | } |
97 | 97 | return FALSE; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | if (!$node) { |
107 | 107 | $node = array('uid' => $account->uid, 'name' => (isset($account->name) ? $account->name : ''), 'type' => $type, 'language' => ''); |
108 | 108 | } |
109 | - return drupal_get_form($type .'_node_form', $node); |
|
109 | + return drupal_get_form($type.'_node_form', $node); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | function content_profile_views_api() { |
117 | 117 | return array( |
118 | 118 | 'api' => 2, |
119 | - 'path' => drupal_get_path('module', 'content_profile') .'/views', |
|
119 | + 'path' => drupal_get_path('module', 'content_profile').'/views', |
|
120 | 120 | ); |
121 | 121 | } |
122 | 122 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | if (is_object($type)) { |
202 | 202 | $type = $type->type; |
203 | 203 | } |
204 | - return variable_get('content_profile_use_'. $type, FALSE); |
|
204 | + return variable_get('content_profile_use_'.$type, FALSE); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * @param $value |
218 | 218 | * The value to compare the given setting too. |
219 | 219 | */ |
220 | -function content_profile_get_types($op = 'types', $setting = NULL , $value = TRUE) { |
|
220 | +function content_profile_get_types($op = 'types', $setting = NULL, $value = TRUE) { |
|
221 | 221 | $types = array(); |
222 | 222 | |
223 | 223 | foreach (node_get_types($op) as $type => $info) { |
@@ -235,17 +235,17 @@ discard block |
||
235 | 235 | function content_profile_node_type($op, $info) { |
236 | 236 | switch ($op) { |
237 | 237 | case 'delete': |
238 | - variable_del('content_profile_use_'. $info->type); |
|
239 | - variable_del('content_profile_'. $info->type); |
|
238 | + variable_del('content_profile_use_'.$info->type); |
|
239 | + variable_del('content_profile_'.$info->type); |
|
240 | 240 | break; |
241 | 241 | case 'update': |
242 | 242 | if (!empty($info->old_type) && $info->old_type != $info->type) { |
243 | 243 | if (is_content_profile($info->old_type)) { |
244 | - $settings = variable_get('content_profile_'. $info->old_type, array()); |
|
245 | - variable_del('content_profile_use_'. $info->old_type); |
|
246 | - variable_del('content_profile_'. $info->old_type); |
|
247 | - variable_set('content_profile_use_'. $info->type, 1); |
|
248 | - variable_set('content_profile_'. $info->type, $settings); |
|
244 | + $settings = variable_get('content_profile_'.$info->old_type, array()); |
|
245 | + variable_del('content_profile_use_'.$info->old_type); |
|
246 | + variable_del('content_profile_'.$info->old_type); |
|
247 | + variable_set('content_profile_use_'.$info->type, 1); |
|
248 | + variable_set('content_profile_'.$info->type, $settings); |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | break; |
@@ -268,15 +268,15 @@ discard block |
||
268 | 268 | $form['content_profile']['content_profile_use'] = array( |
269 | 269 | '#type' => 'checkbox', |
270 | 270 | '#title' => t('Use this content type as a content profile for users'), |
271 | - '#default_value' => variable_get('content_profile_use_'. $form['#node_type']->type, FALSE), |
|
271 | + '#default_value' => variable_get('content_profile_use_'.$form['#node_type']->type, FALSE), |
|
272 | 272 | ); |
273 | 273 | } |
274 | - elseif (isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id && is_content_profile($form['#node'])) { |
|
274 | + elseif (isset($form['#node']) && $form['#node']->type.'_node_form' == $form_id && is_content_profile($form['#node'])) { |
|
275 | 275 | // Customize the redirect target and buttons of our own node forms. |
276 | 276 | if (arg(0) == 'user' && is_numeric(arg(1)) && arg(2) == 'edit' || arg(2) == 'profile') { |
277 | 277 | $form['buttons']['preview']['#access'] = FALSE; |
278 | 278 | $form['buttons']['delete']['#access'] = FALSE; |
279 | - $form['#redirect'] = arg(2) == 'profile' ? 'user/'. $form['#node']->uid : $_GET['q']; |
|
279 | + $form['#redirect'] = arg(2) == 'profile' ? 'user/'.$form['#node']->uid : $_GET['q']; |
|
280 | 280 | } |
281 | 281 | // Set the author value - note that this works only for admins. |
282 | 282 | if (!empty($_GET['uid']) && ($uid = intval($_GET['uid'])) && ($user = user_load($uid))) { |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | $condition = array_fill(0, count($types), "type = '%s'"); |
314 | 314 | $arguments = array_merge(array_keys($types), array($account->uid)); |
315 | 315 | |
316 | - $result = db_query("SELECT * FROM {node} WHERE (". implode(' OR ', $condition) .") AND uid = %d", $arguments); |
|
316 | + $result = db_query("SELECT * FROM {node} WHERE (".implode(' OR ', $condition).") AND uid = %d", $arguments); |
|
317 | 317 | while ($node = db_fetch_object($result)) { |
318 | 318 | _content_profile_node_delete($node); |
319 | 319 | } |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | // Check if this nodetype already exists |
381 | 381 | if ($nid = content_profile_profile_exists($node, $node->uid)) { |
382 | 382 | // This node already exists, redirect to edit page |
383 | - drupal_goto('node/'. $nid .'/edit', 'destination=user/'. $node->uid); |
|
383 | + drupal_goto('node/'.$nid.'/edit', 'destination=user/'.$node->uid); |
|
384 | 384 | } |
385 | 385 | } |
386 | 386 | elseif ($op == 'validate' && is_content_profile($node) && user_access('administer nodes')) { |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | * e.g. user_edit, register or weight. |
429 | 429 | */ |
430 | 430 | function content_profile_get_settings($type, $return = 'all') { |
431 | - $settings = variable_get('content_profile_'. $type, array()); |
|
431 | + $settings = variable_get('content_profile_'.$type, array()); |
|
432 | 432 | $settings += content_profile_settings_info(); |
433 | 433 | if ($return == 'all') { |
434 | 434 | return $settings; |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | * Saves the content_profile settings of a content type. |
441 | 441 | */ |
442 | 442 | function content_profile_set_settings($type, $settings) { |
443 | - variable_set('content_profile_'. $type, $settings); |
|
443 | + variable_set('content_profile_'.$type, $settings); |
|
444 | 444 | } |
445 | 445 | |
446 | 446 | /** |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | return node_help('node/%/edit', array(1 => $node->nid)); |
507 | 507 | } |
508 | 508 | else { |
509 | - return node_help('node/add/'. $type, array('node', 'add', $type)); |
|
509 | + return node_help('node/add/'.$type, array('node', 'add', $type)); |
|
510 | 510 | } |
511 | 511 | } |
512 | 512 | } |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | $node = content_profile_load($type, $uid); |
526 | 526 | |
527 | 527 | if (($style = content_profile_get_settings($type, 'user_display')) && $node && node_access('view', $node)) { |
528 | - $content['content_profile_'. $type] = array( |
|
528 | + $content['content_profile_'.$type] = array( |
|
529 | 529 | '#theme' => ($style == 'link') ? 'content_profile_display_link' : 'content_profile_display_view', |
530 | 530 | '#edit_link' => content_profile_get_settings($type, 'edit_link'), |
531 | 531 | '#uid' => $uid, |
@@ -538,8 +538,8 @@ discard block |
||
538 | 538 | // Working around the bug described at http://drupal.org/node/302873 |
539 | 539 | module_load_include('inc', 'content_profile', 'content_profile.theme'); |
540 | 540 | } |
541 | - elseif (user_access('create '. $type .' content') && content_profile_get_settings($type, 'add_link') && !$node && ($uid == $user->uid || user_access('administer nodes'))) { |
|
542 | - $content['content_profile_'. $type] = array( |
|
541 | + elseif (user_access('create '.$type.' content') && content_profile_get_settings($type, 'add_link') && !$node && ($uid == $user->uid || user_access('administer nodes'))) { |
|
542 | + $content['content_profile_'.$type] = array( |
|
543 | 543 | '#admin' => $uid != $user->uid, |
544 | 544 | '#theme' => 'content_profile_display_add_link', |
545 | 545 | '#uid' => $uid, |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | ), |
581 | 581 | ); |
582 | 582 | if (module_exists('pageroute')) { |
583 | - $return['content_profile_pageroute_empty'] = array( |
|
583 | + $return['content_profile_pageroute_empty'] = array( |
|
584 | 584 | 'arguments' => array('type_name' => NULL), |
585 | 585 | 'file' => 'content_profile.pageroute.inc', |
586 | 586 | ); |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | */ |
633 | 633 | function content_profile_simpletest() { |
634 | 634 | // Scan through content_profile/tests directory for any .test files to tell SimpleTest module. |
635 | - $tests = file_scan_directory(drupal_get_path('module', 'content_profile') .'/tests', '\.test'); |
|
635 | + $tests = file_scan_directory(drupal_get_path('module', 'content_profile').'/tests', '\.test'); |
|
636 | 636 | return array_keys($tests); |
637 | 637 | } |
638 | 638 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $join->construct(); |
52 | 52 | $this->ensure_my_table(); |
53 | 53 | |
54 | - $alias = $join->definition['table'] .'_'. $join->definition['left_table']; |
|
54 | + $alias = $join->definition['table'].'_'.$join->definition['left_table']; |
|
55 | 55 | $this->alias = $this->query->add_relationship($alias, $join, $this->definition['base'], $this->relationship); |
56 | 56 | } |
57 | 57 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | function content_profile_views_handlers() { |
32 | 32 | return array( |
33 | 33 | 'info' => array( |
34 | - 'path' => drupal_get_path('module', 'content_profile') .'/views', |
|
34 | + 'path' => drupal_get_path('module', 'content_profile').'/views', |
|
35 | 35 | ), |
36 | 36 | 'handlers' => array( |
37 | 37 | 'content_profile_views_handler_relationship' => array( |
@@ -13,29 +13,29 @@ discard block |
||
13 | 13 | $types = array_keys(content_profile_get_types('names')); |
14 | 14 | $type = array_shift($types); |
15 | 15 | $config = |
16 | -array ( |
|
16 | +array( |
|
17 | 17 | 'rules' => |
18 | - array ( |
|
18 | + array( |
|
19 | 19 | 'content_profile_rule_1' => |
20 | - array ( |
|
20 | + array( |
|
21 | 21 | '#type' => 'rule', |
22 | 22 | '#set' => 'event_user_login', |
23 | 23 | '#label' => 'Redirect to profile creation page, if users have no profile.', |
24 | 24 | '#active' => 0, |
25 | 25 | '#weight' => '0', |
26 | 26 | '#conditions' => |
27 | - array ( |
|
27 | + array( |
|
28 | 28 | 0 => |
29 | - array ( |
|
29 | + array( |
|
30 | 30 | '#negate' => 1, |
31 | 31 | '#weight' => 0, |
32 | 32 | '#info' => |
33 | - array ( |
|
33 | + array( |
|
34 | 34 | 'label' => 'Logged in user has his Profile created', |
35 | 35 | 'arguments' => |
36 | - array ( |
|
36 | + array( |
|
37 | 37 | 'user' => |
38 | - array ( |
|
38 | + array( |
|
39 | 39 | 'type' => 'user', |
40 | 40 | 'label' => 'User', |
41 | 41 | ), |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | ), |
45 | 45 | '#name' => 'content_profile_user_has_profile_condition', |
46 | 46 | '#settings' => |
47 | - array ( |
|
47 | + array( |
|
48 | 48 | 'type' => $type, |
49 | 49 | '#argument map' => |
50 | - array ( |
|
50 | + array( |
|
51 | 51 | 'account' => 'user', |
52 | 52 | ), |
53 | 53 | ), |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | ), |
56 | 56 | ), |
57 | 57 | '#actions' => |
58 | - array ( |
|
58 | + array( |
|
59 | 59 | 0 => |
60 | - array ( |
|
60 | + array( |
|
61 | 61 | '#type' => 'action', |
62 | 62 | '#settings' => |
63 | - array ( |
|
64 | - 'path' => 'node/add/'. str_replace('_', '-', $type), |
|
63 | + array( |
|
64 | + 'path' => 'node/add/'.str_replace('_', '-', $type), |
|
65 | 65 | 'query' => '', |
66 | 66 | 'fragment' => '', |
67 | 67 | 'force' => 1, |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | ), |
70 | 70 | '#name' => 'rules_action_drupal_goto', |
71 | 71 | '#info' => |
72 | - array ( |
|
72 | + array( |
|
73 | 73 | 'label' => 'Redirect to profile creation page', |
74 | 74 | 'label callback' => false, |
75 | 75 | 'module' => 'System', |
76 | 76 | 'eval input' => |
77 | - array ( |
|
77 | + array( |
|
78 | 78 | 0 => 'path', |
79 | 79 | 1 => 'query', |
80 | 80 | 2 => 'fragment', |
@@ -83,21 +83,21 @@ discard block |
||
83 | 83 | '#weight' => 0, |
84 | 84 | ), |
85 | 85 | 1 => |
86 | - array ( |
|
86 | + array( |
|
87 | 87 | '#weight' => 0, |
88 | 88 | '#info' => |
89 | - array ( |
|
89 | + array( |
|
90 | 90 | 'label' => 'Show a message', |
91 | 91 | 'label callback' => false, |
92 | 92 | 'module' => 'System', |
93 | 93 | 'eval input' => |
94 | - array ( |
|
94 | + array( |
|
95 | 95 | 0 => 'message', |
96 | 96 | ), |
97 | 97 | ), |
98 | 98 | '#name' => 'rules_action_drupal_message', |
99 | 99 | '#settings' => |
100 | - array ( |
|
100 | + array( |
|
101 | 101 | 'message' => 'You haven\'t filled out your profile information yet. Please do so now!', |
102 | 102 | 'error' => 1, |
103 | 103 | ), |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | */ |
12 | 12 | function theme_content_profile_display_add_link($element) { |
13 | 13 | $type = $element['#content_type']; |
14 | - $uid = $element['#admin'] ? 'uid='. intval($element['#uid']) .'&' : ''; |
|
14 | + $uid = $element['#admin'] ? 'uid='.intval($element['#uid']).'&' : ''; |
|
15 | 15 | $text = t($element['#admin'] ? "Create the user's @profile_node." : "Create your @profile_node.", array('@profile_node' => node_get_types('name', $type))); |
16 | - return l($text, content_profile_get_add_path($type, $element['#uid']), array('query' => $uid . drupal_get_destination(), 'html' => TRUE)); |
|
16 | + return l($text, content_profile_get_add_path($type, $element['#uid']), array('query' => $uid.drupal_get_destination(), 'html' => TRUE)); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | function theme_content_profile_display_link($element) { |
23 | 23 | if ($node = content_profile_load($element['#content_type'], $element['#uid'])) { |
24 | 24 | if (node_access('view', $node)) { |
25 | - $output = l(node_get_types('name', $node->type), 'node/'. $node->nid); |
|
25 | + $output = l(node_get_types('name', $node->type), 'node/'.$node->nid); |
|
26 | 26 | if ($element['#edit_link'] && node_access('update', $node)) { |
27 | - $output .= ' '. l('['. t('edit') .']', content_profile_get_edit_path($node), array('query' => drupal_get_destination())); |
|
27 | + $output .= ' '.l('['.t('edit').']', content_profile_get_edit_path($node), array('query' => drupal_get_destination())); |
|
28 | 28 | } |
29 | 29 | return $output; |
30 | 30 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $variables['uid'] = $element['#uid']; |
42 | 42 | $variables['type'] = $element['#content_type']; |
43 | 43 | |
44 | - $path = drupal_get_path('module', 'content_profile') .'/content_profile.css'; |
|
44 | + $path = drupal_get_path('module', 'content_profile').'/content_profile.css'; |
|
45 | 45 | drupal_add_css($path, 'module', 'all', FALSE); |
46 | 46 | |
47 | 47 | $variables['title'] = check_plain(node_get_types('name', $node->type)); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * Themes the view tab |
62 | 62 | */ |
63 | 63 | function theme_content_profile_display_tab_view($node) { |
64 | - return l(t('View'), 'node/'. $node->nid); |
|
64 | + return l(t('View'), 'node/'.$node->nid); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -99,15 +99,15 @@ discard block |
||
99 | 99 | function content_profile_default_path_handler($action, $arg, $uid) { |
100 | 100 | $type = $action == 'add' ? $arg : $arg->type; |
101 | 101 | if (content_profile_get_settings($type, 'edit_tab') == 'top') { |
102 | - return 'user/'. $uid . '/profile/'. $type; |
|
102 | + return 'user/'.$uid.'/profile/'.$type; |
|
103 | 103 | } |
104 | 104 | elseif (content_profile_get_settings($type, 'edit_tab') == 'sub') { |
105 | - return 'user/'. $uid . '/edit/'. $type; |
|
105 | + return 'user/'.$uid.'/edit/'.$type; |
|
106 | 106 | } |
107 | 107 | elseif ($action == 'add') { |
108 | - return 'node/add/'. str_replace('_', '-', $arg); |
|
108 | + return 'node/add/'.str_replace('_', '-', $arg); |
|
109 | 109 | } |
110 | 110 | else { |
111 | - return 'node/'. $arg->nid .'/edit'; |
|
111 | + return 'node/'.$arg->nid.'/edit'; |
|
112 | 112 | } |
113 | 113 | } |
@@ -6,15 +6,15 @@ |
||
6 | 6 | * Pageroute intergration classes |
7 | 7 | */ |
8 | 8 | |
9 | -include_once(drupal_get_path('module', 'pageroute') . '/pageroute.page_edit.inc'); |
|
10 | -include_once(drupal_get_path('module', 'pageroute') . '/pageroute.page_view.inc'); |
|
9 | +include_once(drupal_get_path('module', 'pageroute').'/pageroute.page_edit.inc'); |
|
10 | +include_once(drupal_get_path('module', 'pageroute').'/pageroute.page_view.inc'); |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * theme_content_profile_pageroute_empty generates a message, if there is no content profile for the user. |
14 | 14 | */ |
15 | 15 | function theme_content_profile_pageroute_empty($type_name) { |
16 | 16 | return '<div class="content-profile-empty">'. |
17 | - t('You have not created a @type yet. Go ahead and create one!', array('@type' => $type_name)) .'</div>'; |
|
17 | + t('You have not created a @type yet. Go ahead and create one!', array('@type' => $type_name)).'</div>'; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |