@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | foreach ($code_tags as $code_tag) { |
18 | 18 | $code_tag[1] = str_replace(array('<', '>'), array('<', '>'), $code_tag[1]); |
19 | 19 | if (strpos($code_tag[1], "\n") === FALSE) |
20 | - $body = str_replace($code_tag[0], '<code class="bb-code">'. $code_tag[1] .'</code>', $body); |
|
20 | + $body = str_replace($code_tag[0], '<code class="bb-code">'.$code_tag[1].'</code>', $body); |
|
21 | 21 | elseif ($mode) { |
22 | 22 | // Strip preformatted code blocks from text during line break processing, replaced below |
23 | 23 | $body = str_replace($code_tag[0], "***pRe_sTrInG$i***", $body); |
24 | - $pre[$i++] = '<pre class="bb-code-block">'. $code_tag[1] .'</pre>'; |
|
24 | + $pre[$i++] = '<pre class="bb-code-block">'.$code_tag[1].'</pre>'; |
|
25 | 25 | } |
26 | 26 | else |
27 | - $body = str_replace($code_tag[0], '<pre class="bb-code-block">'. $code_tag[1] .'</pre>', $body); |
|
27 | + $body = str_replace($code_tag[0], '<pre class="bb-code-block">'.$code_tag[1].'</pre>', $body); |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | $body = preg_replace("/(\r\n|\n|\r)/", "\n", $body); |
39 | 39 | $body = preg_replace("/\n\n+/", "\n\n", $body); |
40 | 40 | $parts = explode("\n\n", $body); |
41 | - for ($i=0; $i<sizeof($parts); $i++) { |
|
41 | + for ($i = 0; $i < sizeof($parts); $i++) { |
|
42 | 42 | // No linebreaks if paragraph starts with an HTML tag |
43 | - if ( !preg_match('/^<.*>/', $parts[$i]) ) |
|
43 | + if (!preg_match('/^<.*>/', $parts[$i])) |
|
44 | 44 | $parts[$i] = nl2br($parts[$i]); |
45 | 45 | |
46 | 46 | // Some tags should not be in paragraph blocks |
47 | - if ( !preg_match('/^(?:<|\[)(?:table|list|ol|ul|pre|select|form|blockquote|hr)/i', $parts[$i]) ) |
|
48 | - $parts[$i] = '<p>'. $parts[$i] .'</p>'; |
|
47 | + if (!preg_match('/^(?:<|\[)(?:table|list|ol|ul|pre|select|form|blockquote|hr)/i', $parts[$i])) |
|
48 | + $parts[$i] = '<p>'.$parts[$i].'</p>'; |
|
49 | 49 | } |
50 | 50 | $body = implode("\n\n", $parts); |
51 | 51 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | // Also add opening tags, if needed |
71 | 71 | for ($i = $unclosed; $i < 0; $i++) { |
72 | - $body = '[quote]' . $body; |
|
72 | + $body = '[quote]'.$body; |
|
73 | 73 | } |
74 | 74 | preg_match_all('/\[list/i', $body, $matches); |
75 | 75 | $opentags = count($matches['0']); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $body .= '[/list]'; |
80 | 80 | } |
81 | 81 | for ($i = $unclosed; $i < 0; $i++) { |
82 | - $body = '[list]' . $body; |
|
82 | + $body = '[list]'.$body; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | // begin processing for [size] |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | } |
239 | 239 | else { |
240 | 240 | $body = preg_replace( |
241 | - array('#\[email(?::\w+)?\](.*?)\[/email(?::\w+)?\]#si','#\[email=(.*?)(?::\w+)?\]([\w\s]+)\[/email(?::\w+)?\]#si'), |
|
241 | + array('#\[email(?::\w+)?\](.*?)\[/email(?::\w+)?\]#si', '#\[email=(.*?)(?::\w+)?\]([\w\s]+)\[/email(?::\w+)?\]#si'), |
|
242 | 242 | array('<a href="mailto:\\1" class="bb-email">\\1</a>', '<a href="mailto:\\1" class="bb-email">\\2</a>'), |
243 | 243 | $body); |
244 | 244 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | if (variable_get("bbcode_make_links_$format", 1)) { |
248 | 248 | |
249 | 249 | // pad with a space so we can match things at the start of the 1st line |
250 | - $ret = ' ' . $body; |
|
250 | + $ret = ' '.$body; |
|
251 | 251 | // padding to already filtered links |
252 | 252 | $ret = preg_replace('#(<a.+>)(.+</a>)#i', "$1\x07$2", $ret); |
253 | 253 | |
@@ -283,41 +283,41 @@ discard block |
||
283 | 283 | |
284 | 284 | function _bbcode_generate_heading($level, $text) { |
285 | 285 | $anchor = preg_replace('/([\s]+)/', '_', $text); |
286 | - $anchor = preg_replace('/([\W]+)/', '', $anchor); |
|
287 | - return '<h'. $level .'><a name="'. $anchor .'">'. $text .'</a></h'. $level .'>'; |
|
286 | + $anchor = preg_replace('/([\W]+)/', '', $anchor); |
|
287 | + return '<h'.$level.'><a name="'.$anchor.'">'.$text.'</a></h'.$level.'>'; |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | function _bbcode_generate_index($body, $tag = 'ol') { |
291 | 291 | $level = 0; |
292 | - $index = '<'. $tag .">\n"; |
|
292 | + $index = '<'.$tag.">\n"; |
|
293 | 293 | $close_tags = 0; |
294 | 294 | |
295 | 295 | if (preg_match_all('#\[h([1-6]).*?\](.*?)\[/h([1-6]).*?\]#si', $body, $head_tags, PREG_SET_ORDER)) { |
296 | 296 | foreach ($head_tags as $head_tag) { |
297 | 297 | if ($level == 0) $level = $head_tag[1]; |
298 | 298 | $anchor = preg_replace('/([\s]+)/', '_', $head_tag[2]); |
299 | - $anchor = preg_replace('/([\W]+)/', '', $anchor); |
|
299 | + $anchor = preg_replace('/([\W]+)/', '', $anchor); |
|
300 | 300 | |
301 | 301 | if ($head_tag[1] > $level) { |
302 | - $index .= '<'. $tag .">\n"; |
|
303 | - $index .= '<li><a href="#'. $anchor .'">'. $head_tag[2] ."</a>\n"; |
|
302 | + $index .= '<'.$tag.">\n"; |
|
303 | + $index .= '<li><a href="#'.$anchor.'">'.$head_tag[2]."</a>\n"; |
|
304 | 304 | $close_tags++; |
305 | 305 | $level = $head_tag[1]; |
306 | 306 | } else if ($head_tag[1] < $level) { |
307 | 307 | while ($close_tags > 0) { |
308 | - $index .= '</'. $tag .">\n"; |
|
308 | + $index .= '</'.$tag.">\n"; |
|
309 | 309 | $close_tags--; |
310 | 310 | } |
311 | - $index .= '<li><a href="#'. $anchor .'">'. $head_tag[2] ."</a>\n"; |
|
311 | + $index .= '<li><a href="#'.$anchor.'">'.$head_tag[2]."</a>\n"; |
|
312 | 312 | $level = $head_tag[1]; |
313 | 313 | } else { |
314 | - $index .= '<li><a href="#'. $anchor .'">'. $head_tag[2] ."</a>\n"; |
|
314 | + $index .= '<li><a href="#'.$anchor.'">'.$head_tag[2]."</a>\n"; |
|
315 | 315 | $level = $head_tag[1]; |
316 | 316 | } |
317 | 317 | } |
318 | 318 | } |
319 | 319 | while ($close_tags >= 0) { |
320 | - $index .= '</'. $tag .">\n"; |
|
320 | + $index .= '</'.$tag.">\n"; |
|
321 | 321 | $close_tags--; |
322 | 322 | } |
323 | 323 | return $index; |
@@ -325,27 +325,27 @@ discard block |
||
325 | 325 | |
326 | 326 | function _bbcode_encode_mailto($matches) { |
327 | 327 | if (isset($matches[3])) |
328 | - $link = 'document.write(\'<a href="mailto:' . $matches[2].'@'.$matches[3] . '">' . $matches[2].'@'.$matches[3] . '</a>\');'; |
|
328 | + $link = 'document.write(\'<a href="mailto:'.$matches[2].'@'.$matches[3].'">'.$matches[2].'@'.$matches[3].'</a>\');'; |
|
329 | 329 | else |
330 | - $link = 'document.write(\'<a href="mailto:' . $matches[1] . '" class="bb-email">' . (isset($matches[2]) ? $matches[2] : $matches[1]) . '</a>\');'; |
|
330 | + $link = 'document.write(\'<a href="mailto:'.$matches[1].'" class="bb-email">'.(isset($matches[2]) ? $matches[2] : $matches[1]).'</a>\');'; |
|
331 | 331 | |
332 | 332 | $js_encode = ''; |
333 | 333 | for ($x = 0; $x < strlen($link); $x++) |
334 | - $js_encode .= '%' . bin2hex($link{$x}); |
|
334 | + $js_encode .= '%'.bin2hex($link{$x}); |
|
335 | 335 | |
336 | 336 | $link = '<script type="text/javascript">eval(unescape(\''.$js_encode.'\'))</script>'; |
337 | 337 | if (isset($matches[3])) |
338 | - $link = $matches[1] . $link; |
|
338 | + $link = $matches[1].$link; |
|
339 | 339 | |
340 | 340 | return $link; |
341 | 341 | } |
342 | 342 | |
343 | 343 | function _bbcode_notag_tag($text = NULL) { |
344 | - return str_replace( array('[', ']', '@'), array('[', ']', '@'), stripslashes($text)); |
|
344 | + return str_replace(array('[', ']', '@'), array('[', ']', '@'), stripslashes($text)); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | function _bbcode_php_tag($text = NULL) { |
348 | - return '<pre>'. highlight_string( str_replace('<br />', '', stripslashes($text)), true) .'</pre>'; |
|
348 | + return '<pre>'.highlight_string(str_replace('<br />', '', stripslashes($text)), true).'</pre>'; |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | function _bbcode_round_size_val($size) { |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | } |
359 | 359 | |
360 | 360 | function _bbcode_replace_nest_tag($arr = NULL) { |
361 | - $text = preg_replace('#(\[[/]*)'. $arr['tag'] .'(.*?\])#si', "$1\x07$2", $arr['text']); |
|
361 | + $text = preg_replace('#(\[[/]*)'.$arr['tag'].'(.*?\])#si', "$1\x07$2", $arr['text']); |
|
362 | 362 | // It will be better to use &count and do-while, if php 5 or higher. |
363 | 363 | while (preg_match($arr['pattern'], $text)) { |
364 | 364 | $text = preg_replace($arr['pattern'], $arr['replacement'], $text); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $field['active'] = 1; |
43 | 43 | } |
44 | 44 | |
45 | - $field['columns'] = (array) module_invoke($module, 'field_settings', 'database columns', $field); |
|
45 | + $field['columns'] = (array)module_invoke($module, 'field_settings', 'database columns', $field); |
|
46 | 46 | // Ensure columns always default to NULL values. |
47 | 47 | foreach ($field['columns'] as $column_name => $column) { |
48 | 48 | $field['columns'][$column_name]['not null'] = FALSE; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $field['db_storage'] = CONTENT_DB_STORAGE_PER_CONTENT_TYPE; |
54 | 54 | |
55 | 55 | // Make sure field settings all have an index in the array. |
56 | - $setting_names = (array) module_invoke($module, 'field_settings', 'save', $field); |
|
56 | + $setting_names = (array)module_invoke($module, 'field_settings', 'save', $field); |
|
57 | 57 | drupal_alter('field_settings', $setting_names, 'save', $field); |
58 | 58 | foreach ($setting_names as $setting) { |
59 | 59 | $field[$setting] = NULL; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | // Make sure widget settings all have an index in the array. |
95 | - $settings_names = (array) module_invoke($module, 'widget_settings', 'save', $widget); |
|
95 | + $settings_names = (array)module_invoke($module, 'widget_settings', 'save', $widget); |
|
96 | 96 | drupal_alter('widget_settings', $settings_names, 'save', $widget); |
97 | 97 | $widget['widget_settings'] = array(); |
98 | 98 | foreach ($settings_names as $name) { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | // initialize $widget_settings with default values, |
134 | 134 | if (isset($field['default_value']) && isset($field['default_value_php']) && |
135 | 135 | content_callback('widget', 'default value', $field) == CONTENT_CALLBACK_DEFAULT) { |
136 | - $field['widget']['default_value'] = !empty($field['default_value']) ? $field['default_value'] : NULL; |
|
136 | + $field['widget']['default_value'] = !empty($field['default_value']) ? $field['default_value'] : NULL; |
|
137 | 137 | $field['widget']['default_value_php'] = !empty($field['default_value_php']) ? $field['default_value_php'] : NULL; |
138 | 138 | unset($field['default_value']); |
139 | 139 | unset($field['default_value_php']); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | * @see menu_rebuild() |
209 | 209 | */ |
210 | 210 | function content_field_instance_create($field, $rebuild = TRUE) { |
211 | - include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc'); |
|
211 | + include_once('./'.drupal_get_path('module', 'content').'/includes/content.admin.inc'); |
|
212 | 212 | |
213 | 213 | $form_values = $field; |
214 | 214 | $field = content_field_instance_expand($field); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $field['db_storage'] = content_storage_type($field); |
256 | 256 | |
257 | 257 | // Get a fresh copy of the column information whenever a field is created. |
258 | - $field['columns'] = (array) module_invoke($field['module'], 'field_settings', 'database columns', $field); |
|
258 | + $field['columns'] = (array)module_invoke($field['module'], 'field_settings', 'database columns', $field); |
|
259 | 259 | |
260 | 260 | if (empty($prev_field['widget']) || $prior_instances < 1) { |
261 | 261 | // If this is the first instance, create the field. |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * @see menu_rebuild() |
320 | 320 | */ |
321 | 321 | function content_field_instance_update($field, $rebuild = TRUE) { |
322 | - include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc'); |
|
322 | + include_once('./'.drupal_get_path('module', 'content').'/includes/content.admin.inc'); |
|
323 | 323 | |
324 | 324 | // Ensure the field description is in the 'expanded' form. |
325 | 325 | $field = content_field_instance_expand($field); |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | |
346 | 346 | // Changes in field values may affect columns, or column |
347 | 347 | // information may have changed, get a fresh copy. |
348 | - $field['columns'] = (array) module_invoke($field['module'], 'field_settings', 'database columns', $field); |
|
348 | + $field['columns'] = (array)module_invoke($field['module'], 'field_settings', 'database columns', $field); |
|
349 | 349 | |
350 | 350 | // If the database storage has changed, update the field and previous instances. |
351 | 351 | $prior_instances = content_field_instance_read(array('field_name' => $field['field_name'])); |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | function _content_field_write($field, $op = 'update') { |
400 | 400 | // Rearrange the data to create the global_settings array. |
401 | 401 | $field['global_settings'] = array(); |
402 | - $setting_names = (array) module_invoke($field['module'], 'field_settings', 'save', $field); |
|
402 | + $setting_names = (array)module_invoke($field['module'], 'field_settings', 'save', $field); |
|
403 | 403 | drupal_alter('field_settings', $setting_names, 'save', $field); |
404 | 404 | |
405 | 405 | foreach ($setting_names as $setting) { |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | $field = content_field_instance_collapse($field); |
436 | 436 | |
437 | 437 | // Rearrange the data to create the widget_settings array. |
438 | - $setting_names = (array) module_invoke($field['widget_module'], 'widget_settings', 'save', $field); |
|
438 | + $setting_names = (array)module_invoke($field['widget_module'], 'widget_settings', 'save', $field); |
|
439 | 439 | drupal_alter('widget_settings', $setting_names, 'save', $field); |
440 | 440 | foreach ($setting_names as $setting) { |
441 | 441 | // In some cases (when the updated $field was originally read from |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | if (is_array($param)) { |
479 | 479 | // Turn the conditions into a query. |
480 | 480 | foreach ($param as $key => $value) { |
481 | - $cond[] = 'nfi.'. db_escape_string($key) ." = '%s'"; |
|
481 | + $cond[] = 'nfi.'.db_escape_string($key)." = '%s'"; |
|
482 | 482 | $args[] = $value; |
483 | 483 | } |
484 | 484 | } |
@@ -486,17 +486,17 @@ discard block |
||
486 | 486 | $cond[] = 'nf.active = 1'; |
487 | 487 | $cond[] = 'nfi.widget_active = 1'; |
488 | 488 | } |
489 | - $where = $cond ? ' WHERE '. implode(' AND ', $cond) : ''; |
|
489 | + $where = $cond ? ' WHERE '.implode(' AND ', $cond) : ''; |
|
490 | 490 | |
491 | - $db_result = db_query("SELECT * FROM {". content_instance_tablename() ."} nfi ". |
|
492 | - " JOIN {". content_field_tablename() ."} nf ON nfi.field_name = nf.field_name ". |
|
491 | + $db_result = db_query("SELECT * FROM {".content_instance_tablename()."} nfi ". |
|
492 | + " JOIN {".content_field_tablename()."} nf ON nfi.field_name = nf.field_name ". |
|
493 | 493 | "$where ORDER BY nfi.weight ASC, nfi.label ASC", $args); |
494 | 494 | |
495 | 495 | $fields = array(); |
496 | 496 | while ($instance = db_fetch_array($db_result)) { |
497 | 497 | // Unserialize arrays. |
498 | 498 | foreach (array('widget_settings', 'display_settings', 'global_settings', 'db_columns') as $key) { |
499 | - $instance[$key] = (!empty($instance[$key])) ? (array) unserialize($instance[$key]) : array(); |
|
499 | + $instance[$key] = (!empty($instance[$key])) ? (array)unserialize($instance[$key]) : array(); |
|
500 | 500 | } |
501 | 501 | // 'columns' is a reserved word in MySQL4, so our column is named 'db_columns'. |
502 | 502 | $instance['columns'] = $instance['db_columns']; |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | * @see menu_rebuild() |
545 | 545 | */ |
546 | 546 | function content_field_instance_delete($field_name, $type_name, $rebuild = TRUE) { |
547 | - include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc'); |
|
547 | + include_once('./'.drupal_get_path('module', 'content').'/includes/content.admin.inc'); |
|
548 | 548 | |
549 | 549 | // Get the previous field value. |
550 | 550 | $field = array_pop(content_field_instance_read(array('field_name' => $field_name, 'type_name' => $type_name))); |
@@ -552,13 +552,13 @@ discard block |
||
552 | 552 | // Invoke hook_content_fieldapi(). |
553 | 553 | module_invoke_all('content_fieldapi', 'delete instance', $field); |
554 | 554 | |
555 | - db_query("DELETE FROM {". content_instance_tablename() . |
|
555 | + db_query("DELETE FROM {".content_instance_tablename(). |
|
556 | 556 | "} WHERE field_name = '%s' AND type_name = '%s'", $field['field_name'], $field['type_name']); |
557 | 557 | |
558 | 558 | // If no instances remain, delete the field entirely. |
559 | 559 | $instances = content_field_instance_read(array('field_name' => $field_name)); |
560 | 560 | if (sizeof($instances) < 1) { |
561 | - db_query("DELETE FROM {". content_field_tablename() ."} WHERE field_name = '%s'", $field['field_name']); |
|
561 | + db_query("DELETE FROM {".content_field_tablename()."} WHERE field_name = '%s'", $field['field_name']); |
|
562 | 562 | content_alter_schema($field, array()); |
563 | 563 | } |
564 | 564 | // If only one instance remains, we may need to change the database |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | // If content module has been uninstalled first, all tables |
601 | 601 | // have already been dropped, and running that code will raise errors. |
602 | 602 | if (db_table_exists(content_instance_tablename())) { |
603 | - $results = db_query("SELECT field_name, type_name FROM {". content_instance_tablename() ."} WHERE widget_module = '%s'", $module); |
|
603 | + $results = db_query("SELECT field_name, type_name FROM {".content_instance_tablename()."} WHERE widget_module = '%s'", $module); |
|
604 | 604 | while ($field = db_fetch_array($results)) { |
605 | 605 | content_field_instance_delete($field['field_name'], $field['type_name'], FALSE); |
606 | 606 | } |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | function content_type_update($info) { |
635 | 635 | if (!empty($info->old_type) && $info->old_type != $info->type) { |
636 | 636 | // Rename the content type in all fields that use changed content type. |
637 | - db_query("UPDATE {". content_instance_tablename() ."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
637 | + db_query("UPDATE {".content_instance_tablename()."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
638 | 638 | |
639 | 639 | // Rename the content fields table to match new content type name. |
640 | 640 | $old_type = content_types($info->old_type); |
@@ -648,9 +648,9 @@ discard block |
||
648 | 648 | } |
649 | 649 | |
650 | 650 | // Rename the variable storing weights for non-CCK fields. |
651 | - if ($extra = variable_get('content_extra_weights_'. $info->old_type, array())) { |
|
652 | - variable_set('content_extra_weights_'. $info->type, $extra); |
|
653 | - variable_del('content_extra_weights_'. $info->old_type); |
|
651 | + if ($extra = variable_get('content_extra_weights_'.$info->old_type, array())) { |
|
652 | + variable_set('content_extra_weights_'.$info->type, $extra); |
|
653 | + variable_del('content_extra_weights_'.$info->old_type); |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 |
@@ -22,13 +22,13 @@ |
||
22 | 22 | foreach ($types as $ctype) { |
23 | 23 | foreach ($ctype['fields'] as $field) { |
24 | 24 | $module = $field['module']; |
25 | - $result = (array) module_invoke($module, 'field_settings', 'views data', $field); |
|
25 | + $result = (array)module_invoke($module, 'field_settings', 'views data', $field); |
|
26 | 26 | drupal_alter('field_settings', $result, 'views data', $field); |
27 | 27 | if (empty($result)) { |
28 | 28 | // The views field name had the column name appended, |
29 | 29 | // like field_name_value or field_username_uid. |
30 | 30 | $column = array_shift(array_keys($field['columns'])); |
31 | - $views_fields[$field['field_name'] .'_'. $column] = $field; |
|
31 | + $views_fields[$field['field_name'].'_'.$column] = $field; |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | function content_views_handlers() { |
19 | 19 | return array( |
20 | 20 | 'info' => array( |
21 | - 'path' => drupal_get_path('module', 'content') . '/includes/views/handlers', |
|
21 | + 'path' => drupal_get_path('module', 'content').'/includes/views/handlers', |
|
22 | 22 | ), |
23 | 23 | 'handlers' => array( |
24 | 24 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | 'module' => 'content', // This just tells our themes are elsewhere. |
86 | 86 | 'display' => array( |
87 | 87 | 'content_simple' => array( |
88 | - 'path' => drupal_get_path('module', 'content') . '/includes/views/handlers', |
|
88 | + 'path' => drupal_get_path('module', 'content').'/includes/views/handlers', |
|
89 | 89 | // Those strings are not translated for now. |
90 | 90 | // We'll need to change that if / when we remove 'no ui' |
91 | 91 | 'title' => 'Simple', // TODO: better name ? (currently not displayed anyway) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'accept attachments' => FALSE, |
99 | 99 | ), |
100 | 100 | 'content_references' => array( |
101 | - 'path' => drupal_get_path('module', 'content') . '/includes/views/handlers', |
|
101 | + 'path' => drupal_get_path('module', 'content').'/includes/views/handlers', |
|
102 | 102 | // Those strings are not translated for now. |
103 | 103 | // We'll need to change that if / when we remove 'no ui' |
104 | 104 | 'title' => 'Simple - for reference fields', // TODO: better name ? (currently not displayed anyway) |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | ), |
115 | 115 | 'style' => array( |
116 | 116 | 'content_php_array_autocomplete' => array( |
117 | - 'path' => drupal_get_path('module', 'content') . '/includes/views/handlers', |
|
117 | + 'path' => drupal_get_path('module', 'content').'/includes/views/handlers', |
|
118 | 118 | // Those strings are not translated for now. |
119 | 119 | // We'll need to change that if / when we remove 'no ui' |
120 | 120 | 'title' => 'Results array (with title)', |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $data = array(); |
141 | 141 | foreach (content_fields() as $field) { |
142 | 142 | $module = $field['module']; |
143 | - $result = (array) module_invoke($module, 'field_settings', 'views data', $field); |
|
143 | + $result = (array)module_invoke($module, 'field_settings', 'views data', $field); |
|
144 | 144 | drupal_alter('field_settings', $result, 'views data', $field); |
145 | 145 | if (empty($result)) { |
146 | 146 | $result = content_views_field_views_data($field); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | $data = array(); |
181 | - $data['table']['group'] = t('Content'); |
|
181 | + $data['table']['group'] = t('Content'); |
|
182 | 182 | $data['table']['join']['node'] = array( |
183 | 183 | 'table' => $db_info['table'], |
184 | 184 | 'left_field' => 'vid', |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | 'group' => t('Content'), |
263 | 263 | 'title' => $title, |
264 | 264 | 'title short' => $title_short, |
265 | - 'help' => t($field_types[$field['type']]['label']) .' - '. t('Appears in: @types', array('@types' => implode(', ', $types))), |
|
265 | + 'help' => t($field_types[$field['type']]['label']).' - '.t('Appears in: @types', array('@types' => implode(', ', $types))), |
|
266 | 266 | ); |
267 | 267 | if ($i == 0) { |
268 | 268 | $data[$db_field]['field'] = array( |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | * in the future without re-writing code. |
360 | 360 | */ |
361 | 361 | function content_views_tablename($field) { |
362 | - return 'node_data_'. $field['field_name']; |
|
362 | + return 'node_data_'.$field['field_name']; |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | function theme_content_view_multiple_field($items, $field, $values) { |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | $i = 0; |
368 | 368 | foreach ($items as $item) { |
369 | 369 | if (!empty($item) || $item == '0') { |
370 | - $output .= '<div class="field-item field-item-'. $i .'">'. $item .'</div>'; |
|
370 | + $output .= '<div class="field-item field-item-'.$i.'">'.$item.'</div>'; |
|
371 | 371 | $i++; |
372 | 372 | } |
373 | 373 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | $table_data = views_fetch_data($this->name_table); |
17 | 17 | $table = array_shift($table_data['table']['join']); |
18 | 18 | |
19 | - $result = db_query("SELECT $this->name_field AS title FROM {". $table['table'] ."} WHERE ". $table['field'] ." IN ($placeholders)", $this->value); |
|
19 | + $result = db_query("SELECT $this->name_field AS title FROM {".$table['table']."} WHERE ".$table['field']." IN ($placeholders)", $this->value); |
|
20 | 20 | while ($row = db_fetch_object($result)) { |
21 | 21 | $titles[] = check_plain($row->title); |
22 | 22 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | // or from content_allowed_values(); |
26 | 26 | function allowed_values() { |
27 | 27 | $field = $this->content_field; |
28 | - $function = $field['module'] .'_allowed_values'; |
|
28 | + $function = $field['module'].'_allowed_values'; |
|
29 | 29 | if ($this->value_form_type == 'select') { |
30 | 30 | // Select elements accept multidimensional arrays to support optgroups. |
31 | 31 | $options = function_exists($function) ? $function($field) : content_allowed_values($field, FALSE); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | else { |
37 | 37 | $options = function_exists($function) ? $function($field) : content_allowed_values($field); |
38 | 38 | } |
39 | - return (array) $options; |
|
39 | + return (array)$options; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -41,8 +41,8 @@ |
||
41 | 41 | |
42 | 42 | function allowed_values() { |
43 | 43 | $field = $this->content_field; |
44 | - $function = $field['module'] .'_allowed_values'; |
|
44 | + $function = $field['module'].'_allowed_values'; |
|
45 | 45 | $options = function_exists($function) ? $function($field) : content_allowed_values($field); |
46 | - return (array) $options; |
|
46 | + return (array)$options; |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -168,10 +168,10 @@ discard block |
||
168 | 168 | foreach ($db_info['columns'] as $column => $attributes) { |
169 | 169 | $query_columns[] = "$attributes[column] AS $column"; |
170 | 170 | } |
171 | - $query = 'SELECT '. implode(', ', $query_columns) . |
|
172 | - ' FROM {'. $db_info['table'] ."}". |
|
173 | - " WHERE vid IN (". implode(',', $vids) .')'. |
|
174 | - " ORDER BY _nid ASC, _delta ". ($options['multiple']['multiple_reversed'] ? 'DESC' : 'ASC'); |
|
171 | + $query = 'SELECT '.implode(', ', $query_columns). |
|
172 | + ' FROM {'.$db_info['table']."}". |
|
173 | + " WHERE vid IN (".implode(',', $vids).')'. |
|
174 | + " ORDER BY _nid ASC, _delta ".($options['multiple']['multiple_reversed'] ? 'DESC' : 'ASC'); |
|
175 | 175 | $result = db_query($query); |
176 | 176 | |
177 | 177 | while ($item = db_fetch_array($result)) { |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | foreach ($items as $item) { |
274 | 274 | $output = content_format($field, $item, $formatter_name, $node); |
275 | 275 | if (!empty($output)) { |
276 | - $rendered[] = $this->render_link($output, (object) array('nid' => $nid)); |
|
276 | + $rendered[] = $this->render_link($output, (object)array('nid' => $nid)); |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | // Multiple values formatter. |
282 | 282 | $output = content_format($field, $items, $formatter_name, $values); |
283 | 283 | if (!empty($output)) { |
284 | - $rendered[] = $this->render_link($output, (object) array('nid' => $nid)); |
|
284 | + $rendered[] = $this->render_link($output, (object)array('nid' => $nid)); |
|
285 | 285 | } |
286 | 286 | } |
287 | 287 | |
@@ -307,11 +307,11 @@ discard block |
||
307 | 307 | if (method_exists('render_as_link', 'views_handler_field')) { |
308 | 308 | // Views 2.3+ |
309 | 309 | $this->options['alter']['make_link'] = TRUE; |
310 | - $this->options['alter']['path'] = "node/" . $values->{$this->aliases['nid']}; |
|
310 | + $this->options['alter']['path'] = "node/".$values->{$this->aliases['nid']}; |
|
311 | 311 | } |
312 | 312 | else { |
313 | 313 | // Views up to 2.2 |
314 | - return l($data, "node/" . $values->nid, array('html' => TRUE)); |
|
314 | + return l($data, "node/".$values->nid, array('html' => TRUE)); |
|
315 | 315 | } |
316 | 316 | } |
317 | 317 | else { |
@@ -36,7 +36,7 @@ |
||
36 | 36 | } |
37 | 37 | elseif ($options['ids']) { |
38 | 38 | $alias = $this->view->query->ensure_table($options['table']); |
39 | - $this->view->query->add_where(NULL, "$alias.$options[field_id] IN (" . db_placeholders($options['ids']) . ')', $options['ids']); |
|
39 | + $this->view->query->add_where(NULL, "$alias.$options[field_id] IN (".db_placeholders($options['ids']).')', $options['ids']); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |