@@ -27,13 +27,13 @@ discard block |
||
| 27 | 27 | // Make the description smaller |
| 28 | 28 | $row[] = array('data' => filter_xss_admin($type->description), 'class' => 'description'); |
| 29 | 29 | // Set the edit column. |
| 30 | - $row[] = array('data' => l(t('edit'), 'admin/content/node-type/'. $type_url_str)); |
|
| 30 | + $row[] = array('data' => l(t('edit'), 'admin/content/node-type/'.$type_url_str)); |
|
| 31 | 31 | // Set links for managing fields. |
| 32 | 32 | // TODO: a hook to allow other content modules to add more stuff? |
| 33 | - $row[] = array('data' => l(t('manage fields'), 'admin/content/node-type/'. $type_url_str .'/fields')); |
|
| 33 | + $row[] = array('data' => l(t('manage fields'), 'admin/content/node-type/'.$type_url_str.'/fields')); |
|
| 34 | 34 | // Set the delete column. |
| 35 | 35 | if ($type->custom) { |
| 36 | - $row[] = array('data' => l(t('delete'), 'admin/content/node-type/'. $type_url_str .'/delete')); |
|
| 36 | + $row[] = array('data' => l(t('delete'), 'admin/content/node-type/'.$type_url_str.'/delete')); |
|
| 37 | 37 | } |
| 38 | 38 | else { |
| 39 | 39 | $row[] = array('data' => ''); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | // Allow external modules alter the table headers and rows. |
| 47 | 47 | foreach (module_implements('content_types_overview_alter') as $module) { |
| 48 | - $function = $module .'_content_types_overview_alter'; |
|
| 48 | + $function = $module.'_content_types_overview_alter'; |
|
| 49 | 49 | $function($header, $rows); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | $rows[] = array(array('data' => t('No content types available.'), 'colspan' => '7', 'class' => 'message')); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return theme('table', $header, $rows) .theme('content_overview_links'); |
|
| 56 | + return theme('table', $header, $rows).theme('content_overview_links'); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | function theme_content_overview_links() { |
| 60 | - return '<div class="content-overview-links">'. l(t('» Add a new content type'), 'admin/content/types/add') .'</div>'; |
|
| 60 | + return '<div class="content-overview-links">'.l(t('» Add a new content type'), 'admin/content/types/add').'</div>'; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $row[] = t($field_types[$field['type']]['label']); |
| 79 | 79 | |
| 80 | 80 | $types = array(); |
| 81 | - $result = db_query("SELECT nt.name, nt.type FROM {". content_instance_tablename() ."} nfi ". |
|
| 81 | + $result = db_query("SELECT nt.name, nt.type FROM {".content_instance_tablename()."} nfi ". |
|
| 82 | 82 | "LEFT JOIN {node_type} nt ON nt.type = nfi.type_name ". |
| 83 | 83 | "WHERE nfi.field_name = '%s' ". |
| 84 | 84 | // Keep disabled modules out of table. |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | "ORDER BY nt.name ASC", $field['field_name']); |
| 87 | 87 | while ($type = db_fetch_array($result)) { |
| 88 | 88 | $content_type = content_types($type['type']); |
| 89 | - $types[] = l($type['name'], 'admin/content/node-type/'. $content_type['url_str'] .'/fields'); |
|
| 89 | + $types[] = l($type['name'], 'admin/content/node-type/'.$content_type['url_str'].'/fields'); |
|
| 90 | 90 | } |
| 91 | 91 | $row[] = implode(', ', $types); |
| 92 | 92 | |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | 'label' => array('#value' => check_plain($field['widget']['label'])), |
| 174 | 174 | 'field_name' => array('#value' => $field['field_name']), |
| 175 | 175 | 'type' => array('#value' => t($field_types[$field['type']]['label'])), |
| 176 | - 'configure' => array('#value' => l(t('Configure'), 'admin/content/node-type/'. $type['url_str'] .'/fields/'. $field['field_name'])), |
|
| 177 | - 'remove' => array('#value' => l(t('Remove'), 'admin/content/node-type/'. $type['url_str'] .'/fields/'. $field['field_name'] .'/remove')), |
|
| 176 | + 'configure' => array('#value' => l(t('Configure'), 'admin/content/node-type/'.$type['url_str'].'/fields/'.$field['field_name'])), |
|
| 177 | + 'remove' => array('#value' => l(t('Remove'), 'admin/content/node-type/'.$type['url_str'].'/fields/'.$field['field_name'].'/remove')), |
|
| 178 | 178 | 'weight' => array('#type' => 'textfield', '#default_value' => $weight, '#size' => 3), |
| 179 | 179 | 'parent' => array('#type' => 'select', '#options' => $group_options, '#default_value' => ''), |
| 180 | 180 | 'prev_parent' => array('#type' => 'hidden', '#value' => ''), |
@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | 'label' => array('#value' => check_plain($group['label'])), |
| 200 | 200 | 'group_name' => array('#value' => $group['group_name']), |
| 201 | 201 | 'group_type' => array('#value' => t($group_types[$group['group_type']])), |
| 202 | - 'configure' => array('#value' => l(t('Configure'), 'admin/content/node-type/'. $type['url_str'] .'/groups/'. $group['group_name'])), |
|
| 203 | - 'remove' => array('#value' => l(t('Remove'), 'admin/content/node-type/'. $type['url_str'] .'/groups/'. $group['group_name'] .'/remove')), |
|
| 202 | + 'configure' => array('#value' => l(t('Configure'), 'admin/content/node-type/'.$type['url_str'].'/groups/'.$group['group_name'])), |
|
| 203 | + 'remove' => array('#value' => l(t('Remove'), 'admin/content/node-type/'.$type['url_str'].'/groups/'.$group['group_name'].'/remove')), |
|
| 204 | 204 | 'weight' => array('#type' => 'textfield', '#default_value' => $weight, '#size' => 3), |
| 205 | 205 | 'parent' => array('#type' => 'hidden', '#default_value' => ''), |
| 206 | 206 | 'hidden_name' => array('#type' => 'hidden', '#default_value' => $group['group_name']), |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | 'type' => array( |
| 267 | 267 | '#type' => 'select', |
| 268 | 268 | '#options' => $field_type_options, |
| 269 | - '#description' => theme('advanced_help_topic', 'content', 'fields') . t('Type of data to store.'), |
|
| 269 | + '#description' => theme('advanced_help_topic', 'content', 'fields').t('Type of data to store.'), |
|
| 270 | 270 | ), |
| 271 | 271 | 'widget_type' => array( |
| 272 | 272 | '#type' => 'select', |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | |
| 398 | 398 | // Add the 'field_' prefix. |
| 399 | 399 | if (substr($field_name, 0, 6) != 'field_') { |
| 400 | - $field_name = 'field_'. $field_name; |
|
| 400 | + $field_name = 'field_'.$field_name; |
|
| 401 | 401 | form_set_value($form['_add_new_field']['field_name'], $field_name, $form_state); |
| 402 | 402 | } |
| 403 | 403 | |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | foreach ($form_values as $key => $values) { |
| 495 | 495 | // Groups are handled in fieldgroup_content_overview_form_submit(). |
| 496 | 496 | if (in_array($key, $form['#fields'])) { |
| 497 | - db_query("UPDATE {". content_instance_tablename() ."} SET weight = %d WHERE type_name = '%s' AND field_name = '%s'", |
|
| 497 | + db_query("UPDATE {".content_instance_tablename()."} SET weight = %d WHERE type_name = '%s' AND field_name = '%s'", |
|
| 498 | 498 | $values['weight'], $type_name, $key); |
| 499 | 499 | } |
| 500 | 500 | elseif (in_array($key, $form['#extra'])) { |
@@ -503,10 +503,10 @@ discard block |
||
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | if ($extra) { |
| 506 | - variable_set('content_extra_weights_'. $type_name, $extra); |
|
| 506 | + variable_set('content_extra_weights_'.$type_name, $extra); |
|
| 507 | 507 | } |
| 508 | 508 | else { |
| 509 | - variable_del('content_extra_weights_'. $type_name); |
|
| 509 | + variable_del('content_extra_weights_'.$type_name); |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | content_clear_type_cache(); |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | if (content_field_instance_create($field)) { |
| 523 | 523 | // Store new field information for fieldgroup submit handler. |
| 524 | 524 | $form_state['fields_added']['_add_new_field'] = $field['field_name']; |
| 525 | - $destinations[] = 'admin/content/node-type/'. $type['url_str'] .'/fields/'. $field['field_name']; |
|
| 525 | + $destinations[] = 'admin/content/node-type/'.$type['url_str'].'/fields/'.$field['field_name']; |
|
| 526 | 526 | } |
| 527 | 527 | else { |
| 528 | 528 | drupal_set_message(t('There was a problem creating field %label.', array( |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | if (content_field_instance_create($field)) { |
| 545 | 545 | // Store new field information for fieldgroup submit handler. |
| 546 | 546 | $form_state['fields_added']['_add_existing_field'] = $field['field_name']; |
| 547 | - $destinations[] = 'admin/content/node-type/'. $type['url_str'] .'/fields/'. $field['field_name']; |
|
| 547 | + $destinations[] = 'admin/content/node-type/'.$type['url_str'].'/fields/'.$field['field_name']; |
|
| 548 | 548 | } |
| 549 | 549 | else { |
| 550 | 550 | drupal_set_message(t('There was a problem adding field %label.', array('%label' => $field['field_name']))); |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | |
| 591 | 591 | if (empty($fields)) { |
| 592 | 592 | drupal_set_message(t('There are no fields configured for this content type. You can add new fields on the <a href="@link">Manage fields</a> page.', array( |
| 593 | - '@link' => url('admin/content/node-type/'. $type['url_str'] .'/fields'))), 'warning'); |
|
| 593 | + '@link' => url('admin/content/node-type/'.$type['url_str'].'/fields'))), 'warning'); |
|
| 594 | 594 | return $form; |
| 595 | 595 | } |
| 596 | 596 | |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | if (!isset($type['fields'][$field['field_name']]) && !$field['locked']) { |
| 784 | 784 | $field_type = $field_types[$field['type']]; |
| 785 | 785 | $text = t('@type: @field (@label)', array('@type' => t($field_type['label']), '@label' => t($field['widget']['label']), '@field' => $field['field_name'])); |
| 786 | - $options[$field['field_name']] = (drupal_strlen($text) > 80) ? truncate_utf8($text, 77) . '...' : $text; |
|
| 786 | + $options[$field['field_name']] = (drupal_strlen($text) > 80) ? truncate_utf8($text, 77).'...' : $text; |
|
| 787 | 787 | } |
| 788 | 788 | } |
| 789 | 789 | // Sort the list by type, then by field name, then by label. |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | $type = content_types($form_values['type_name']); |
| 888 | - $form_state['redirect'] = 'admin/content/node-type/'. $type['url_str'] .'/fields/'. $form_values['field_name']; |
|
| 888 | + $form_state['redirect'] = 'admin/content/node-type/'.$type['url_str'].'/fields/'.$form_values['field_name']; |
|
| 889 | 889 | $form_state['rebuild'] = FALSE; |
| 890 | 890 | } |
| 891 | 891 | |
@@ -908,7 +908,7 @@ discard block |
||
| 908 | 908 | |
| 909 | 909 | $output = confirm_form($form, |
| 910 | 910 | t('Are you sure you want to remove the field %field?', array('%field' => $field['widget']['label'])), |
| 911 | - 'admin/content/node-type/'. $type['url_str'] .'/fields', |
|
| 911 | + 'admin/content/node-type/'.$type['url_str'].'/fields', |
|
| 912 | 912 | t('If you have any content left in this field, it will be lost. This action cannot be undone.'), |
| 913 | 913 | t('Remove'), t('Cancel'), |
| 914 | 914 | 'confirm' |
@@ -946,7 +946,7 @@ discard block |
||
| 946 | 946 | '%field' => $field['widget']['label'], |
| 947 | 947 | '%type' => $type['name']))); |
| 948 | 948 | } |
| 949 | - $form_state['redirect'] = 'admin/content/node-type/'. $type['url_str'] .'/fields'; |
|
| 949 | + $form_state['redirect'] = 'admin/content/node-type/'.$type['url_str'].'/fields'; |
|
| 950 | 950 | } |
| 951 | 951 | } |
| 952 | 952 | |
@@ -1042,7 +1042,7 @@ discard block |
||
| 1042 | 1042 | '#default_value' => $field['widget']['weight'], |
| 1043 | 1043 | ); |
| 1044 | 1044 | |
| 1045 | - $additions = (array) module_invoke($widget_type['module'], 'widget_settings', 'form', $field['widget']); |
|
| 1045 | + $additions = (array)module_invoke($widget_type['module'], 'widget_settings', 'form', $field['widget']); |
|
| 1046 | 1046 | drupal_alter('widget_settings', $additions, 'form', $field['widget']); |
| 1047 | 1047 | $form['widget'] = array_merge($form['widget'], $additions); |
| 1048 | 1048 | |
@@ -1083,7 +1083,7 @@ discard block |
||
| 1083 | 1083 | ); |
| 1084 | 1084 | |
| 1085 | 1085 | // Default value widget. |
| 1086 | - $widget_form = array('#node' => (object) array('type' => $type_name)); |
|
| 1086 | + $widget_form = array('#node' => (object)array('type' => $type_name)); |
|
| 1087 | 1087 | $widget_form_state = array('values' => array($field['field_name'] => $default_value)); |
| 1088 | 1088 | // Make sure the default value is not a required field. |
| 1089 | 1089 | $widget_field = $field; |
@@ -1127,7 +1127,7 @@ discard block |
||
| 1127 | 1127 | $form['widget']['default_value_fieldset']['advanced_options']['markup_default_value_php'] = array( |
| 1128 | 1128 | '#type' => 'item', |
| 1129 | 1129 | '#title' => t('Code'), |
| 1130 | - '#value' => !empty($field['widget']['default_value_php']) ? '<code>'. check_plain($field['widget']['default_value_php']) .'</code>' : t('<none>'), |
|
| 1130 | + '#value' => !empty($field['widget']['default_value_php']) ? '<code>'.check_plain($field['widget']['default_value_php']).'</code>' : t('<none>'), |
|
| 1131 | 1131 | '#description' => empty($field['widget']['default_value_php']) ? t("You're not allowed to input PHP code.") : t('This PHP code was set by an administrator and will override any value specified above.'), |
| 1132 | 1132 | ); |
| 1133 | 1133 | } |
@@ -1145,9 +1145,9 @@ discard block |
||
| 1145 | 1145 | ); |
| 1146 | 1146 | $description = t('Maximum number of values users can enter for this field.'); |
| 1147 | 1147 | if (content_handle('widget', 'multiple values', $field) == CONTENT_HANDLE_CORE) { |
| 1148 | - $description .= '<br/>'. t("'Unlimited' will provide an 'Add more' button so the users can add as many values as they like."); |
|
| 1148 | + $description .= '<br/>'.t("'Unlimited' will provide an 'Add more' button so the users can add as many values as they like."); |
|
| 1149 | 1149 | } |
| 1150 | - $description .= '<br/><strong>'. t('Warning! Changing this setting after data has been created could result in the loss of data!') .'</strong>'; |
|
| 1150 | + $description .= '<br/><strong>'.t('Warning! Changing this setting after data has been created could result in the loss of data!').'</strong>'; |
|
| 1151 | 1151 | $form['field']['multiple'] = array( |
| 1152 | 1152 | '#type' => 'select', |
| 1153 | 1153 | '#title' => t('Number of values'), |
@@ -1161,7 +1161,7 @@ discard block |
||
| 1161 | 1161 | '#value' => serialize($field), |
| 1162 | 1162 | ); |
| 1163 | 1163 | |
| 1164 | - $additions = (array) module_invoke($field_type['module'], 'field_settings', 'form', $field); |
|
| 1164 | + $additions = (array)module_invoke($field_type['module'], 'field_settings', 'form', $field); |
|
| 1165 | 1165 | drupal_alter('field_settings', $additions, 'form', $field); |
| 1166 | 1166 | $form['field'] = array_merge($form['field'], $additions); |
| 1167 | 1167 | |
@@ -1290,7 +1290,7 @@ discard block |
||
| 1290 | 1290 | $node = array(); |
| 1291 | 1291 | $node[$form_values['field_name']] = $default_value; |
| 1292 | 1292 | $field['required'] = FALSE; |
| 1293 | - $field_function = $field_type['module'] .'_field'; |
|
| 1293 | + $field_function = $field_type['module'].'_field'; |
|
| 1294 | 1294 | |
| 1295 | 1295 | $errors_before = form_get_errors(); |
| 1296 | 1296 | |
@@ -1341,7 +1341,7 @@ discard block |
||
| 1341 | 1341 | else { |
| 1342 | 1342 | drupal_set_message(t('Saved field %label.', array('%label' => $form_values['label']))); |
| 1343 | 1343 | $type = content_types($form_values['type_name']); |
| 1344 | - $form_state['redirect'] = 'admin/content/node-type/'. $type['url_str'] .'/fields'; |
|
| 1344 | + $form_state['redirect'] = 'admin/content/node-type/'.$type['url_str'].'/fields'; |
|
| 1345 | 1345 | } |
| 1346 | 1346 | } |
| 1347 | 1347 | |
@@ -1518,7 +1518,7 @@ discard block |
||
| 1518 | 1518 | // drop all delta values higher than the new maximum delta value. |
| 1519 | 1519 | // Not needed if the new multiple is unlimited or if the new table is the content table. |
| 1520 | 1520 | if ($new_table != $base_tablename && $new_field['multiple'] < $previous_field['multiple'] && $new_field['multiple'] != 1) { |
| 1521 | - db_query("DELETE FROM {". $new_table ."} WHERE delta >= ". max(1, $new_field['multiple'])); |
|
| 1521 | + db_query("DELETE FROM {".$new_table."} WHERE delta >= ".max(1, $new_field['multiple'])); |
|
| 1522 | 1522 | } |
| 1523 | 1523 | |
| 1524 | 1524 | // If going from multiple to non-multiple, make sure the field tables have |
@@ -1548,12 +1548,12 @@ discard block |
||
| 1548 | 1548 | $new_field['db_storage'] == CONTENT_DB_STORAGE_PER_FIELD) { |
| 1549 | 1549 | $columns = array_keys($migrate_columns); |
| 1550 | 1550 | if ($new_field['multiple']) { |
| 1551 | - db_query('INSERT INTO {'. $new_table .'} (vid, nid, delta, '. implode(', ', $columns) .') '. |
|
| 1552 | - ' SELECT vid, nid, 0, '. implode(', ', $columns) .' FROM {'. $previous_table .'}'); |
|
| 1551 | + db_query('INSERT INTO {'.$new_table.'} (vid, nid, delta, '.implode(', ', $columns).') '. |
|
| 1552 | + ' SELECT vid, nid, 0, '.implode(', ', $columns).' FROM {'.$previous_table.'}'); |
|
| 1553 | 1553 | } |
| 1554 | 1554 | else { |
| 1555 | - db_query('INSERT INTO {'. $new_table .'} (vid, nid, '. implode(', ', $columns) .') '. |
|
| 1556 | - ' SELECT vid, nid, '. implode(', ', $columns) .' FROM {'. $previous_table .'}'); |
|
| 1555 | + db_query('INSERT INTO {'.$new_table.'} (vid, nid, '.implode(', ', $columns).') '. |
|
| 1556 | + ' SELECT vid, nid, '.implode(', ', $columns).' FROM {'.$previous_table.'}'); |
|
| 1557 | 1557 | } |
| 1558 | 1558 | foreach ($columns as $column_name) { |
| 1559 | 1559 | db_drop_field($ret, $previous_table, $column_name); |
@@ -1567,10 +1567,10 @@ discard block |
||
| 1567 | 1567 | // rebuild the schema now. |
| 1568 | 1568 | content_alter_db_cleanup(); |
| 1569 | 1569 | if ($previous_field['multiple']) { |
| 1570 | - $result = db_query("SELECT * FROM {". $previous_table ."} c JOIN {node} n ON c.nid = n.nid WHERE delta = 0 AND n.type = '%s'", $new_field['type_name']); |
|
| 1570 | + $result = db_query("SELECT * FROM {".$previous_table."} c JOIN {node} n ON c.nid = n.nid WHERE delta = 0 AND n.type = '%s'", $new_field['type_name']); |
|
| 1571 | 1571 | } |
| 1572 | 1572 | else { |
| 1573 | - $result = db_query("SELECT * FROM {". $previous_table ."} c JOIN {node} n ON c.nid = n.nid WHERE n.type = '%s'", $new_field['type_name']); |
|
| 1573 | + $result = db_query("SELECT * FROM {".$previous_table."} c JOIN {node} n ON c.nid = n.nid WHERE n.type = '%s'", $new_field['type_name']); |
|
| 1574 | 1574 | } |
| 1575 | 1575 | $record = array(); |
| 1576 | 1576 | while ($data = db_fetch_array($result)) { |
@@ -1591,7 +1591,7 @@ discard block |
||
| 1591 | 1591 | } |
| 1592 | 1592 | } |
| 1593 | 1593 | } |
| 1594 | - if (db_result(db_query('SELECT COUNT(*) FROM {'. $new_table . |
|
| 1594 | + if (db_result(db_query('SELECT COUNT(*) FROM {'.$new_table. |
|
| 1595 | 1595 | '} WHERE vid = %d AND nid = %d', $data['vid'], $data['nid']))) { |
| 1596 | 1596 | $keys = $new_field['multiple'] ? array('vid', 'delta') : array('vid'); |
| 1597 | 1597 | drupal_write_record($new_table, $record, $keys); |
@@ -1656,12 +1656,12 @@ discard block |
||
| 1656 | 1656 | // Group rows: account for weight. |
| 1657 | 1657 | if (module_exists('fieldgroup')) { |
| 1658 | 1658 | foreach ($group_rows as $name) { |
| 1659 | - $dummy[$name] = array('#weight' => $form[$name]['weight']['#value'], '#value' => $name .' '); |
|
| 1659 | + $dummy[$name] = array('#weight' => $form[$name]['weight']['#value'], '#value' => $name.' '); |
|
| 1660 | 1660 | } |
| 1661 | 1661 | } |
| 1662 | 1662 | // Field rows : account for weight and parenting. |
| 1663 | 1663 | foreach ($field_rows as $name) { |
| 1664 | - $dummy[$name] = array('#weight' => $form[$name]['weight']['#value'], '#value' => $name .' '); |
|
| 1664 | + $dummy[$name] = array('#weight' => $form[$name]['weight']['#value'], '#value' => $name.' '); |
|
| 1665 | 1665 | if (module_exists('fieldgroup')) { |
| 1666 | 1666 | if ($parent = $form[$name]['parent']['#value']) { |
| 1667 | 1667 | $form[$name]['#depth'] = 1; |
@@ -1706,7 +1706,7 @@ discard block |
||
| 1706 | 1706 | 'finished' => '_content_alter_fields_finished', |
| 1707 | 1707 | 'title' => t('Processing'), |
| 1708 | 1708 | 'error_message' => t('The update has encountered an error.'), |
| 1709 | - 'file' => './'. drupal_get_path('module', 'content') .'/includes/content.admin.inc', |
|
| 1709 | + 'file' => './'.drupal_get_path('module', 'content').'/includes/content.admin.inc', |
|
| 1710 | 1710 | ); |
| 1711 | 1711 | batch_set($batch); |
| 1712 | 1712 | if (!empty($url)) { |
@@ -1802,7 +1802,7 @@ discard block |
||
| 1802 | 1802 | return $context['finished'] = 1; |
| 1803 | 1803 | } |
| 1804 | 1804 | $nodes = array(); |
| 1805 | - $result = db_query("SELECT nid FROM {". $db_info['table'] ."}"); |
|
| 1805 | + $result = db_query("SELECT nid FROM {".$db_info['table']."}"); |
|
| 1806 | 1806 | while ($node = db_fetch_array($result)) { |
| 1807 | 1807 | $nodes[] = $node['nid']; |
| 1808 | 1808 | } |
@@ -1821,7 +1821,7 @@ discard block |
||
| 1821 | 1821 | $node = content_field_replace($nid, array($updates)); |
| 1822 | 1822 | |
| 1823 | 1823 | // Store result for post-processing in the finished callback. |
| 1824 | - $context['results'][] = l($node->title, 'node/'. $node->nid); |
|
| 1824 | + $context['results'][] = l($node->title, 'node/'.$node->nid); |
|
| 1825 | 1825 | |
| 1826 | 1826 | // Update our progress information. |
| 1827 | 1827 | $context['sandbox']['progress']++; |
@@ -1831,7 +1831,7 @@ discard block |
||
| 1831 | 1831 | // Inform the batch engine that we are not finished, |
| 1832 | 1832 | // and provide an estimation of the completion level we reached. |
| 1833 | 1833 | if ($context['sandbox']['progress'] != $context['sandbox']['max']) { |
| 1834 | - $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max']; |
|
| 1834 | + $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max']; |
|
| 1835 | 1835 | } |
| 1836 | 1836 | } |
| 1837 | 1837 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | if (!content_access('view', $field, NULL, $new_node)) { |
| 23 | 23 | continue; |
| 24 | 24 | } |
| 25 | - $function = $field_types[$field['type']]['module'] . '_content_diff_values'; |
|
| 25 | + $function = $field_types[$field['type']]['module'].'_content_diff_values'; |
|
| 26 | 26 | $function = function_exists($function) ? $function : 'content_content_diff_values'; |
| 27 | 27 | $old_values = array(); |
| 28 | 28 | $new_values = array(); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // Fetch titles we don't know yet. |
| 80 | 80 | $queried_ids = array_diff($ids, array_keys($titles)); |
| 81 | 81 | if ($queried_ids) { |
| 82 | - $result = db_query('SELECT uid, name FROM {users} WHERE uid IN ('. db_placeholders($queried_ids) .')', $queried_ids); |
|
| 82 | + $result = db_query('SELECT uid, name FROM {users} WHERE uid IN ('.db_placeholders($queried_ids).')', $queried_ids); |
|
| 83 | 83 | while ($row = db_fetch_array($result)) { |
| 84 | 84 | $titles[$row['uid']] = $row['name']; |
| 85 | 85 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | // Fetch titles we don't know yet. |
| 112 | 112 | $queried_ids = array_diff($ids, array_keys($titles)); |
| 113 | 113 | if ($queried_ids) { |
| 114 | - $result = db_query('SELECT nid, title FROM {node} WHERE nid IN ('. db_placeholders($queried_ids) .')', $queried_ids); |
|
| 114 | + $result = db_query('SELECT nid, title FROM {node} WHERE nid IN ('.db_placeholders($queried_ids).')', $queried_ids); |
|
| 115 | 115 | while ($row = db_fetch_array($result)) { |
| 116 | 116 | $titles[$row['nid']] = $row['title']; |
| 117 | 117 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | $type = content_types($form['type']['#value']); |
| 13 | 13 | foreach ($type['fields'] as $field_name => $field) { |
| 14 | 14 | $form['#field_info'][$field['field_name']] = $field; |
| 15 | - $form += (array) content_field_form($form, $form_state, $field); |
|
| 15 | + $form += (array)content_field_form($form, $form_state, $field); |
|
| 16 | 16 | } |
| 17 | 17 | return $form; |
| 18 | 18 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | // TODO: is the "if (function_exists($function)) {" needed ? |
| 48 | 48 | // defining the $function here makes it unclear where it is actually called |
| 49 | - $function = $field['widget']['module'] .'_widget'; |
|
| 49 | + $function = $field['widget']['module'].'_widget'; |
|
| 50 | 50 | if (function_exists($function)) { |
| 51 | 51 | // Prepare the values to be filled in the widget. |
| 52 | 52 | // We look in the following places: |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | if (!empty($form_state['values'][$field['field_name']])) { |
| 58 | 58 | $items = $form_state['values'][$field['field_name']]; |
| 59 | 59 | // If there was an AHAH add more button in this field, don't save it. |
| 60 | - unset($items[$field['field_name'] .'_add_more']); |
|
| 60 | + unset($items[$field['field_name'].'_add_more']); |
|
| 61 | 61 | } |
| 62 | 62 | elseif (!empty($node->$field['field_name'])) { |
| 63 | 63 | $items = $node->$field['field_name']; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | // it should provide a hook_default_value() function to call, |
| 69 | 69 | // otherwise the content module's content_default_value() function |
| 70 | 70 | // will be used. |
| 71 | - $callback = content_callback('widget', 'default value', $field) == CONTENT_CALLBACK_CUSTOM ? $field['widget']['module'] .'_default_value' : 'content_default_value'; |
|
| 71 | + $callback = content_callback('widget', 'default value', $field) == CONTENT_CALLBACK_CUSTOM ? $field['widget']['module'].'_default_value' : 'content_default_value'; |
|
| 72 | 72 | if (function_exists($callback)) { |
| 73 | 73 | $items = $callback($form, $form_state, $field, 0); |
| 74 | 74 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | '#required' => $field['required'], |
| 180 | 180 | '#description' => $description, |
| 181 | 181 | ); |
| 182 | - $function = $field['widget']['module'] .'_widget'; |
|
| 182 | + $function = $field['widget']['module'].'_widget'; |
|
| 183 | 183 | |
| 184 | 184 | for ($delta = 0; $delta <= $max; $delta++) { |
| 185 | 185 | if ($element = $function($form, $form_state, $field, $items, $delta)) { |
@@ -218,9 +218,9 @@ discard block |
||
| 218 | 218 | $content_type = content_types($field['type_name']); |
| 219 | 219 | $field_name_css = str_replace('_', '-', $field_name); |
| 220 | 220 | |
| 221 | - $form_element[$field_name .'_add_more'] = array( |
|
| 221 | + $form_element[$field_name.'_add_more'] = array( |
|
| 222 | 222 | '#type' => 'submit', |
| 223 | - '#name' => $field_name .'_add_more', |
|
| 223 | + '#name' => $field_name.'_add_more', |
|
| 224 | 224 | '#value' => t('Add another item'), |
| 225 | 225 | '#weight' => $field['widget']['weight'] + $max + 1, |
| 226 | 226 | // Submit callback for disabled JavaScript. drupal_get_form() might get |
@@ -228,8 +228,8 @@ discard block |
||
| 228 | 228 | // including this file. Therefore, call a proxy function to do this. |
| 229 | 229 | '#submit' => array('content_add_more_submit_proxy'), |
| 230 | 230 | '#ahah' => array( |
| 231 | - 'path' => 'content/js_add_more/'. $content_type['url_str'] .'/'. $field_name, |
|
| 232 | - 'wrapper' => $field_name_css .'-items', |
|
| 231 | + 'path' => 'content/js_add_more/'.$content_type['url_str'].'/'.$field_name, |
|
| 232 | + 'wrapper' => $field_name_css.'-items', |
|
| 233 | 233 | 'method' => 'replace', |
| 234 | 234 | 'effect' => 'fade', |
| 235 | 235 | ), |
@@ -240,10 +240,10 @@ discard block |
||
| 240 | 240 | ); |
| 241 | 241 | |
| 242 | 242 | // Add wrappers for the fields and 'more' button. |
| 243 | - $form_element['#prefix'] = '<div id="'. $field_name_css .'-items">'; |
|
| 243 | + $form_element['#prefix'] = '<div id="'.$field_name_css.'-items">'; |
|
| 244 | 244 | $form_element['#suffix'] = '</div>'; |
| 245 | - $form_element[$field_name .'_add_more']['#prefix'] = '<div class="content-add-more clear-block">'; |
|
| 246 | - $form_element[$field_name .'_add_more']['#suffix'] = '</div>'; |
|
| 245 | + $form_element[$field_name.'_add_more']['#prefix'] = '<div class="content-add-more clear-block">'; |
|
| 246 | + $form_element[$field_name.'_add_more']['#suffix'] = '</div>'; |
|
| 247 | 247 | } |
| 248 | 248 | return $form_element; |
| 249 | 249 | } |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $type_name = $form_state['clicked_button']['#type_name']; |
| 261 | 261 | |
| 262 | 262 | // Make the changes we want to the form state. |
| 263 | - if ($form_state['values'][$field_name][$field_name .'_add_more']) { |
|
| 263 | + if ($form_state['values'][$field_name][$field_name.'_add_more']) { |
|
| 264 | 264 | $form_state['item_count'][$field_name] = count($form_state['values'][$field_name]); |
| 265 | 265 | } |
| 266 | 266 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | // Sort the $form_state['values'] we just built *and* the incoming $_POST data |
| 312 | 312 | // according to d-n-d reordering. |
| 313 | - unset($form_state['values'][$field_name][$field['field_name'] .'_add_more']); |
|
| 313 | + unset($form_state['values'][$field_name][$field['field_name'].'_add_more']); |
|
| 314 | 314 | foreach ($_POST[$field_name] as $delta => $item) { |
| 315 | 315 | $form_state['values'][$field_name][$delta]['_weight'] = $item['_weight']; |
| 316 | 316 | } |
@@ -356,8 +356,8 @@ discard block |
||
| 356 | 356 | // Render the new output. |
| 357 | 357 | $field_form = (!empty($group_name)) ? $form[$group_name][$field_name] : $form[$field_name]; |
| 358 | 358 | // We add a div around the new content to receive the ahah effect. |
| 359 | - $field_form[$delta]['#prefix'] = '<div class="ahah-new-content">'. (isset($field_form[$delta]['#prefix']) ? $field_form[$delta]['#prefix'] : ''); |
|
| 360 | - $field_form[$delta]['#suffix'] = (isset($field_form[$delta]['#suffix']) ? $field_form[$delta]['#suffix'] : '') .'</div>'; |
|
| 359 | + $field_form[$delta]['#prefix'] = '<div class="ahah-new-content">'.(isset($field_form[$delta]['#prefix']) ? $field_form[$delta]['#prefix'] : ''); |
|
| 360 | + $field_form[$delta]['#suffix'] = (isset($field_form[$delta]['#suffix']) ? $field_form[$delta]['#suffix'] : '').'</div>'; |
|
| 361 | 361 | // Prevent duplicate wrapper. |
| 362 | 362 | unset($field_form['#prefix'], $field_form['#suffix']); |
| 363 | 363 | |
@@ -367,14 +367,14 @@ discard block |
||
| 367 | 367 | // The new ones didn't exist then, so we need to update Drupal.settings |
| 368 | 368 | // by ourselves in order to let AHAH know about those new form elements. |
| 369 | 369 | $javascript = drupal_add_js(NULL, NULL); |
| 370 | - $output_js = isset($javascript['setting']) ? '<script type="text/javascript">jQuery.extend(Drupal.settings, '. drupal_to_js(call_user_func_array('array_merge_recursive', $javascript['setting'])) .');</script>' : ''; |
|
| 370 | + $output_js = isset($javascript['setting']) ? '<script type="text/javascript">jQuery.extend(Drupal.settings, '.drupal_to_js(call_user_func_array('array_merge_recursive', $javascript['setting'])).');</script>' : ''; |
|
| 371 | 371 | |
| 372 | - $output = theme('status_messages') . drupal_render($field_form) . $output_js; |
|
| 372 | + $output = theme('status_messages').drupal_render($field_form).$output_js; |
|
| 373 | 373 | |
| 374 | 374 | // Using drupal_json() breaks filefield's file upload, because the jQuery |
| 375 | 375 | // Form plugin handles file uploads in a way that is not compatible with |
| 376 | 376 | // 'text/javascript' response type. |
| 377 | - $GLOBALS['devel_shutdown'] = FALSE; |
|
| 377 | + $GLOBALS['devel_shutdown'] = FALSE; |
|
| 378 | 378 | print drupal_to_js(array('status' => TRUE, 'data' => $output)); |
| 379 | 379 | exit; |
| 380 | 380 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | for ($i = 0; $i <= $max; $i++) { |
| 47 | 47 | $module = $field_types[$field['type']]['module']; |
| 48 | - $function = $module .'_content_generate'; |
|
| 48 | + $function = $module.'_content_generate'; |
|
| 49 | 49 | if (function_exists($function)) { |
| 50 | 50 | $result = $function($node, $field); // $items, $teaser, $page |
| 51 | 51 | if (content_handle('widget', 'multiple values', $field) == CONTENT_HANDLE_MODULE) { |
@@ -155,13 +155,13 @@ discard block |
||
| 155 | 155 | $precision = is_numeric($field['precision']) ? $field['precision'] : 10; |
| 156 | 156 | $scale = is_numeric($field['scale']) ? $field['scale'] : 2; |
| 157 | 157 | $max = is_numeric($field['max']) ? $field['max'] : pow(10, ($precision - $scale)); |
| 158 | - $decimal = rand(0, (10 * $scale)) / 100; |
|
| 158 | + $decimal = rand(0, (10*$scale))/100; |
|
| 159 | 159 | break; |
| 160 | 160 | |
| 161 | 161 | case 'number_float': |
| 162 | 162 | $precision = rand(10, 32); |
| 163 | 163 | $scale = rand(0, 2); |
| 164 | - $decimal = rand(0, (10 * $scale)) / 100; |
|
| 164 | + $decimal = rand(0, (10*$scale))/100; |
|
| 165 | 165 | $max = is_numeric($field['max']) ? $field['max'] : pow(10, ($precision - $scale)); |
| 166 | 166 | break; |
| 167 | 167 | } |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | $field_types = _content_field_types(); |
| 42 | 42 | foreach ($content_type['fields'] as $field_name => $field) { |
| 43 | 43 | $items = isset($node->{$field_name}) ? $node->{$field_name} : array(); |
| 44 | - $function = $field_types[$field['type']]['module'] . '_token_values'; |
|
| 44 | + $function = $field_types[$field['type']]['module'].'_token_values'; |
|
| 45 | 45 | if (!empty($items) && function_exists($function)) { |
| 46 | - $token_values = (array) $function('field', $items, $options); |
|
| 46 | + $token_values = (array)$function('field', $items, $options); |
|
| 47 | 47 | foreach ($token_values as $token => $value) { |
| 48 | - $tokens[$field_name .'-'. $token] = $value; |
|
| 48 | + $tokens[$field_name.'-'.$token] = $value; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -61,12 +61,12 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | foreach (content_fields() as $field) { |
| 63 | 63 | $sub_list = array(); |
| 64 | - $function = $field_types[$field['type']]['module'] . '_token_list'; |
|
| 64 | + $function = $field_types[$field['type']]['module'].'_token_list'; |
|
| 65 | 65 | if (function_exists($function)) { |
| 66 | 66 | $sub_list = $function('field'); |
| 67 | 67 | foreach ($sub_list as $category => $token_list) { |
| 68 | 68 | foreach ($token_list as $token => $description) { |
| 69 | - $list['CCK '. $category][$field['field_name'] .'-'. $token] = $description; |
|
| 69 | + $list['CCK '.$category][$field['field_name'].'-'.$token] = $description; |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $tokens['node reference']['title-raw'] = t('Referenced node unfiltered title. WARNING - raw user input.'); |
| 87 | 87 | $tokens['node reference']['link'] = t("Formatted html link to the referenced node."); |
| 88 | 88 | $tokens['node reference']['path'] = t("Relative path alias to the referenced node."); |
| 89 | - $tokens['node reference']['url'] = t("Absolute path alias to the referenced node."); |
|
| 89 | + $tokens['node reference']['url'] = t("Absolute path alias to the referenced node."); |
|
| 90 | 90 | |
| 91 | 91 | return $tokens; |
| 92 | 92 | } |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | $tokens['title'] = $title ? check_plain($title) : ''; |
| 102 | 102 | $tokens['title-raw'] = $title; |
| 103 | 103 | $tokens['link'] = isset($item['view']) ? $item['view'] : ''; |
| 104 | - $tokens['path'] = is_numeric($item['nid']) ? url('node/' . $item['nid']) : ''; |
|
| 105 | - $tokens['url'] = is_numeric($item['nid']) ? url('node/' . $item['nid'], array('absolute' => TRUE)) : ''; |
|
| 104 | + $tokens['path'] = is_numeric($item['nid']) ? url('node/'.$item['nid']) : ''; |
|
| 105 | + $tokens['url'] = is_numeric($item['nid']) ? url('node/'.$item['nid'], array('absolute' => TRUE)) : ''; |
|
| 106 | 106 | |
| 107 | 107 | return $tokens; |
| 108 | 108 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | if ($type == 'field') { |
| 150 | 150 | $item = $object[0]; |
| 151 | 151 | |
| 152 | - $tokens['raw'] = $item['value']; |
|
| 152 | + $tokens['raw'] = $item['value']; |
|
| 153 | 153 | $tokens['formatted'] = isset($item['view']) ? $item['view'] : ''; |
| 154 | 154 | return $tokens; |
| 155 | 155 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $tokens['user reference']['name'] = t('Referenced user name'); |
| 166 | 166 | $tokens['user reference']['link'] = t('Formatted HTML link to referenced user'); |
| 167 | 167 | $tokens['user reference']['path'] = t("Relative path alias to the referenced user."); |
| 168 | - $tokens['user reference']['url'] = t("Absolute path alias to the referenced user."); |
|
| 168 | + $tokens['user reference']['url'] = t("Absolute path alias to the referenced user."); |
|
| 169 | 169 | |
| 170 | 170 | return $tokens; |
| 171 | 171 | } |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | $tokens['uid'] = $item['uid']; |
| 179 | 179 | $tokens['name'] = isset($item['view']) ? strip_tags($item['view']) : ''; |
| 180 | 180 | $tokens['link'] = isset($item['view']) ? $item['view'] : ''; |
| 181 | - $tokens['path'] = is_numeric($item['uid']) ? url('user/' . $item['uid']) : ''; |
|
| 182 | - $tokens['url'] = is_numeric($item['uid']) ? url('user/' . $item['uid'], array('absolute' => TRUE)) : ''; |
|
| 181 | + $tokens['path'] = is_numeric($item['uid']) ? url('user/'.$item['uid']) : ''; |
|
| 182 | + $tokens['url'] = is_numeric($item['uid']) ? url('user/'.$item['uid'], array('absolute' => TRUE)) : ''; |
|
| 183 | 183 | |
| 184 | 184 | return $tokens; |
| 185 | 185 | } |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | $form['#node'] = (object)array('type' => '', $settings['field_name'] => $settings['value']); |
| 74 | 74 | $form['#field_info'][$field['field_name']] = $field; |
| 75 | 75 | // We can't put it into $form['settings'] as this would break AHAH callbacks |
| 76 | - $form += (array) content_field_form($form, $form_state, $field); |
|
| 77 | - $form[ $settings['field_name'] ]['#weight'] = 4; |
|
| 76 | + $form += (array)content_field_form($form, $form_state, $field); |
|
| 77 | + $form[$settings['field_name']]['#weight'] = 4; |
|
| 78 | 78 | |
| 79 | 79 | unset($form['#cache']); |
| 80 | 80 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | // Add this file to be included when the form is built by rules |
| 109 | 109 | // as it's needed by CCKs add more button. |
| 110 | 110 | // See rules_after_build_include_files(). |
| 111 | - $form['#includes'][] = './'. drupal_get_path('module', 'node') .'/node.pages.inc'; |
|
| 111 | + $form['#includes'][] = './'.drupal_get_path('module', 'node').'/node.pages.inc'; |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | $settings = $form_state['element']['#settings']; |
| 136 | 136 | $field = content_fields($settings['field_name']); |
| 137 | 137 | $field_types = _content_field_types(); |
| 138 | - $function = $field_types[$field['type']]['module'] .'_field'; |
|
| 138 | + $function = $field_types[$field['type']]['module'].'_field'; |
|
| 139 | 139 | if (function_exists($function)) { |
| 140 | 140 | $form['#node'] = (object)array('type' => '', $settings['field_name'] => $form_state['values'][$settings['field_name']]); |
| 141 | 141 | $items = isset($form['#node']->$field['field_name']) ? $form['#node']->$field['field_name'] : array(); |
| 142 | 142 | |
| 143 | 143 | //Make sure AHAH 'add more' button isn't sent to the fields |
| 144 | 144 | // for processing. |
| 145 | - unset($items[$field['field_name'] .'_add_more']); |
|
| 145 | + unset($items[$field['field_name'].'_add_more']); |
|
| 146 | 146 | |
| 147 | 147 | $function('validate', $form['#node'], $field, $items, $form, NULL); |
| 148 | 148 | content_field('validate', $form['#node'], $field, $items, $form, NULL); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // Name the content type a combination of fieldgroup and node type names. |
| 36 | - $content_type_name = $group['type_name'] . ':' . $group['group_name']; |
|
| 36 | + $content_type_name = $group['type_name'].':'.$group['group_name']; |
|
| 37 | 37 | |
| 38 | 38 | // Assemble the information about the content type. |
| 39 | 39 | $info = array( |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * Implementation of hook_init(). |
| 17 | 17 | */ |
| 18 | 18 | function fieldgroup_init() { |
| 19 | - drupal_add_css(drupal_get_path('module', 'fieldgroup') .'/fieldgroup.css'); |
|
| 19 | + drupal_add_css(drupal_get_path('module', 'fieldgroup').'/fieldgroup.css'); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | function fieldgroup_ctools_plugin_directory($module, $plugin) { |
| 26 | 26 | if ($module == 'ctools' && $plugin == 'content_types') { |
| 27 | - return 'panels/' . $plugin; |
|
| 27 | + return 'panels/'.$plugin; |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | $type_name = $type->type; |
| 42 | 42 | $content_type = content_types($type_name); |
| 43 | 43 | $type_url_str = $content_type['url_str']; |
| 44 | - $items['admin/content/node-type/'. $type_url_str .'/groups/%'] = array( |
|
| 44 | + $items['admin/content/node-type/'.$type_url_str.'/groups/%'] = array( |
|
| 45 | 45 | 'title' => 'Edit group', |
| 46 | 46 | 'page callback' => 'drupal_get_form', |
| 47 | 47 | 'page arguments' => array('fieldgroup_group_edit_form', $type_name, 5), |
| 48 | 48 | 'access arguments' => array('administer content types'), |
| 49 | 49 | 'type' => MENU_CALLBACK, |
| 50 | 50 | ); |
| 51 | - $items['admin/content/node-type/'. $type_url_str .'/groups/%/remove'] = array( |
|
| 51 | + $items['admin/content/node-type/'.$type_url_str.'/groups/%/remove'] = array( |
|
| 52 | 52 | 'title' => 'Edit group', |
| 53 | 53 | 'page callback' => 'drupal_get_form', |
| 54 | 54 | 'page arguments' => array('fieldgroup_remove_group', $type_name, 5), |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | function fieldgroup_content_fieldapi($op, $field) { |
| 95 | 95 | switch ($op) { |
| 96 | 96 | case 'delete instance': |
| 97 | - db_query("DELETE FROM {". fieldgroup_fields_tablename() ."} WHERE field_name = '%s' AND type_name = '%s'", $field['field_name'], $field['type_name']); |
|
| 97 | + db_query("DELETE FROM {".fieldgroup_fields_tablename()."} WHERE field_name = '%s' AND type_name = '%s'", $field['field_name'], $field['type_name']); |
|
| 98 | 98 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
| 99 | 99 | break; |
| 100 | 100 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $form_values = $form_state['values']; |
| 183 | 183 | $content_type = $form['#content_type']; |
| 184 | 184 | fieldgroup_save_group($content_type['type'], $form_values); |
| 185 | - $form_state['redirect'] = 'admin/content/node-type/'. $content_type['url_str'] .'/fields'; |
|
| 185 | + $form_state['redirect'] = 'admin/content/node-type/'.$content_type['url_str'].'/fields'; |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | function fieldgroup_remove_group(&$form_state, $type_name, $group_name) { |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | return confirm_form($form, |
| 203 | 203 | t('Are you sure you want to remove the group %label?', |
| 204 | 204 | array('%label' => t($group['label']))), |
| 205 | - 'admin/content/node-type/'. $content_type['url_str'] .'/fields', t('This action cannot be undone.'), |
|
| 205 | + 'admin/content/node-type/'.$content_type['url_str'].'/fields', t('This action cannot be undone.'), |
|
| 206 | 206 | t('Remove'), t('Cancel')); |
| 207 | 207 | } |
| 208 | 208 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $group_name = $form['#group_name']; |
| 213 | 213 | fieldgroup_delete($content_type['type'], $group_name); |
| 214 | 214 | drupal_set_message(t('The group %group_name has been removed.', array('%group_name' => $group_name))); |
| 215 | - $form_state['redirect'] = 'admin/content/node-type/'. $content_type['url_str'] .'/fields'; |
|
| 215 | + $form_state['redirect'] = 'admin/content/node-type/'.$content_type['url_str'].'/fields'; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
@@ -222,13 +222,13 @@ discard block |
||
| 222 | 222 | global $language; |
| 223 | 223 | static $groups, $groups_sorted; |
| 224 | 224 | if (!isset($groups) || $reset) { |
| 225 | - if ($cached = cache_get('fieldgroup_data:'. $language->language, content_cache_tablename())) { |
|
| 225 | + if ($cached = cache_get('fieldgroup_data:'.$language->language, content_cache_tablename())) { |
|
| 226 | 226 | $data = $cached->data; |
| 227 | 227 | $groups = $data['groups']; |
| 228 | 228 | $groups_sorted = $data['groups_sorted']; |
| 229 | 229 | } |
| 230 | 230 | else { |
| 231 | - $result = db_query("SELECT * FROM {". fieldgroup_tablename() ."} ORDER BY weight, group_name"); |
|
| 231 | + $result = db_query("SELECT * FROM {".fieldgroup_tablename()."} ORDER BY weight, group_name"); |
|
| 232 | 232 | $groups = array(); |
| 233 | 233 | $groups_sorted = array(); |
| 234 | 234 | while ($group = db_fetch_array($result)) { |
@@ -250,9 +250,9 @@ discard block |
||
| 250 | 250 | $groups_sorted[$group['type_name']][] = &$groups[$group['type_name']][$group['group_name']]; |
| 251 | 251 | } |
| 252 | 252 | //load fields |
| 253 | - $result = db_query("SELECT nfi.*, ng.group_name FROM {". fieldgroup_tablename() ."} ng ". |
|
| 254 | - "INNER JOIN {". fieldgroup_fields_tablename() ."} ngf ON ngf.type_name = ng.type_name AND ngf.group_name = ng.group_name ". |
|
| 255 | - "INNER JOIN {". content_instance_tablename() ."} nfi ON nfi.field_name = ngf.field_name AND nfi.type_name = ngf.type_name ". |
|
| 253 | + $result = db_query("SELECT nfi.*, ng.group_name FROM {".fieldgroup_tablename()."} ng ". |
|
| 254 | + "INNER JOIN {".fieldgroup_fields_tablename()."} ngf ON ngf.type_name = ng.type_name AND ngf.group_name = ng.group_name ". |
|
| 255 | + "INNER JOIN {".content_instance_tablename()."} nfi ON nfi.field_name = ngf.field_name AND nfi.type_name = ngf.type_name ". |
|
| 256 | 256 | "WHERE nfi.widget_active = 1 ORDER BY nfi.weight"); |
| 257 | 257 | while ($field = db_fetch_array($result)) { |
| 258 | 258 | // Allow external modules to translate field strings. |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | $groups[$field['type_name']][$field['group_name']]['fields'][$field['field_name']] = $field; |
| 268 | 268 | } |
| 269 | - cache_set('fieldgroup_data:'. $language->language, array('groups' => $groups, 'groups_sorted' => $groups_sorted), content_cache_tablename()); |
|
| 269 | + cache_set('fieldgroup_data:'.$language->language, array('groups' => $groups, 'groups_sorted' => $groups_sorted), content_cache_tablename()); |
|
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | if (empty($content_type)) { |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | function _fieldgroup_groups_label($content_type) { |
| 283 | 283 | $groups = fieldgroup_groups($content_type); |
| 284 | 284 | |
| 285 | - $labels[''] = '<'. t('none') .'>'; |
|
| 285 | + $labels[''] = '<'.t('none').'>'; |
|
| 286 | 286 | foreach ($groups as $group_name => $group) { |
| 287 | 287 | $labels[$group_name] = t($group['label']); |
| 288 | 288 | } |
@@ -290,14 +290,14 @@ discard block |
||
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | function _fieldgroup_field_get_group($content_type, $field_name) { |
| 293 | - return db_result(db_query("SELECT group_name FROM {". fieldgroup_fields_tablename() ."} WHERE type_name = '%s' AND field_name = '%s'", $content_type, $field_name)); |
|
| 293 | + return db_result(db_query("SELECT group_name FROM {".fieldgroup_fields_tablename()."} WHERE type_name = '%s' AND field_name = '%s'", $content_type, $field_name)); |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /** |
| 297 | 297 | * Implementation of hook_form_alter() |
| 298 | 298 | */ |
| 299 | 299 | function fieldgroup_form_alter(&$form, $form_state, $form_id) { |
| 300 | - if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) { |
|
| 300 | + if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'].'_node_form' == $form_id) { |
|
| 301 | 301 | foreach (fieldgroup_groups($form['type']['#value']) as $group_name => $group) { |
| 302 | 302 | $form[$group_name] = array( |
| 303 | 303 | '#type' => 'fieldset', |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | // Can't use module_invoke_all because we want |
| 335 | 335 | // to be able to use a reference to $form and $form_state. |
| 336 | 336 | foreach (module_implements('fieldgroup_form') as $module) { |
| 337 | - $function = $module .'_fieldgroup_form'; |
|
| 337 | + $function = $module.'_fieldgroup_form'; |
|
| 338 | 338 | $function($form, $form_state, $form_id, $group); |
| 339 | 339 | } |
| 340 | 340 | |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | |
| 390 | 390 | // Add the 'group_' prefix. |
| 391 | 391 | if (substr($group_name, 0, 6) != 'group_') { |
| 392 | - $group_name = 'group_'. $group_name; |
|
| 392 | + $group_name = 'group_'.$group_name; |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | // Invalid field name. |
@@ -422,10 +422,10 @@ discard block |
||
| 422 | 422 | foreach ($validation['errors'] as $type => $messages) { |
| 423 | 423 | foreach ($messages as $message) { |
| 424 | 424 | if ($type == 'label') { |
| 425 | - form_set_error('_add_new_group][label', t('Add new group:') .' '. $message); |
|
| 425 | + form_set_error('_add_new_group][label', t('Add new group:').' '.$message); |
|
| 426 | 426 | } |
| 427 | 427 | else { |
| 428 | - form_set_error('_add_new_group][group_name', t('Add new group:') .' '. $message); |
|
| 428 | + form_set_error('_add_new_group][group_name', t('Add new group:').' '.$message); |
|
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | } |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | // If 'group' row: update groups weights |
| 491 | 491 | // (possible newly created group has already been taken care of). |
| 492 | 492 | elseif (in_array($key, $form['#groups'])) { |
| 493 | - db_query("UPDATE {". fieldgroup_tablename() ."} SET weight = %d WHERE type_name = '%s' AND group_name = '%s'", |
|
| 493 | + db_query("UPDATE {".fieldgroup_tablename()."} SET weight = %d WHERE type_name = '%s' AND group_name = '%s'", |
|
| 494 | 494 | $values['weight'], $type_name, $key); |
| 495 | 495 | } |
| 496 | 496 | } |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | // - when a (non last) field is removed from a group, a 'ghost row' remains in the fields overview |
| 533 | 533 | // - when the last field is removed, the group disappears |
| 534 | 534 | // seems to be fixed when emptying the cache. |
| 535 | - db_query("DELETE FROM {". fieldgroup_fields_tablename() ."} WHERE type_name = '%s' AND field_name = '%s'", $form_values['type_name'], $form_values['field_name']); |
|
| 535 | + db_query("DELETE FROM {".fieldgroup_fields_tablename()."} WHERE type_name = '%s' AND field_name = '%s'", $form_values['type_name'], $form_values['field_name']); |
|
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | /** |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | $element['#collapsible'] = TRUE; |
| 606 | 606 | case 'fieldset': |
| 607 | 607 | $element['#type'] = 'fieldgroup_fieldset'; |
| 608 | - $element['#attributes'] = array('class' => 'fieldgroup '. strtr($group['group_name'], '_', '-')); |
|
| 608 | + $element['#attributes'] = array('class' => 'fieldgroup '.strtr($group['group_name'], '_', '-')); |
|
| 609 | 609 | break; |
| 610 | 610 | } |
| 611 | 611 | foreach ($group['fields'] as $field_name => $field) { |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | // Can't use module_invoke_all because we want |
| 619 | 619 | // to be able to use a reference to $node and $element. |
| 620 | 620 | foreach (module_implements('fieldgroup_view') as $module) { |
| 621 | - $function = $module .'_fieldgroup_view'; |
|
| 621 | + $function = $module.'_fieldgroup_view'; |
|
| 622 | 622 | $function($node, $element, $group, $context); |
| 623 | 623 | } |
| 624 | 624 | |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | |
| 696 | 696 | // One-field equivalent to _content_field_invoke('sanitize'). |
| 697 | 697 | $module = $field_types[$field['type']]['module']; |
| 698 | - $function = $module .'_field'; |
|
| 698 | + $function = $module.'_field'; |
|
| 699 | 699 | if (function_exists($function)) { |
| 700 | 700 | $function('sanitize', $node_copy, $field, $items, $teaser, $page); |
| 701 | 701 | $node_copy->{$field_name} = $items; |
@@ -755,13 +755,13 @@ discard block |
||
| 755 | 755 | function fieldgroup_node_type($op, $info) { |
| 756 | 756 | if ($op == 'update' && !empty($info->old_type) && $info->type != $info->old_type) { |
| 757 | 757 | // update the tables |
| 758 | - db_query("UPDATE {". fieldgroup_tablename() ."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
| 759 | - db_query("UPDATE {". fieldgroup_fields_tablename() ."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
| 758 | + db_query("UPDATE {".fieldgroup_tablename()."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
| 759 | + db_query("UPDATE {".fieldgroup_fields_tablename()."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
| 760 | 760 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
| 761 | 761 | } |
| 762 | 762 | elseif ($op == 'delete') { |
| 763 | - db_query("DELETE FROM {". fieldgroup_tablename() ."} WHERE type_name = '%s'", $info->type); |
|
| 764 | - db_query("DELETE FROM {". fieldgroup_fields_tablename() ."} WHERE type_name = '%s'", $info->type); |
|
| 763 | + db_query("DELETE FROM {".fieldgroup_tablename()."} WHERE type_name = '%s'", $info->type); |
|
| 764 | + db_query("DELETE FROM {".fieldgroup_fields_tablename()."} WHERE type_name = '%s'", $info->type); |
|
| 765 | 765 | } |
| 766 | 766 | } |
| 767 | 767 | |
@@ -800,19 +800,19 @@ discard block |
||
| 800 | 800 | |
| 801 | 801 | // Allow other modules to intervene when the group is saved. |
| 802 | 802 | foreach (module_implements('fieldgroup_save_group') as $module) { |
| 803 | - $function = $module .'_fieldgroup_save_group'; |
|
| 803 | + $function = $module.'_fieldgroup_save_group'; |
|
| 804 | 804 | $function($group); |
| 805 | 805 | } |
| 806 | 806 | |
| 807 | 807 | if (!isset($groups[$group['group_name']])) { |
| 808 | 808 | // Accept group name from programmed submissions if valid. |
| 809 | - db_query("INSERT INTO {". fieldgroup_tablename() ."} (group_type, type_name, group_name, label, settings, weight)". |
|
| 809 | + db_query("INSERT INTO {".fieldgroup_tablename()."} (group_type, type_name, group_name, label, settings, weight)". |
|
| 810 | 810 | " VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $group['group_type'], $type_name, $group['group_name'], $group['label'], serialize($group['settings']), $group['weight']); |
| 811 | 811 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
| 812 | 812 | return SAVED_NEW; |
| 813 | 813 | } |
| 814 | 814 | else { |
| 815 | - db_query("UPDATE {". fieldgroup_tablename() ."} SET group_type = '%s', label = '%s', settings = '%s', weight = %d ". |
|
| 815 | + db_query("UPDATE {".fieldgroup_tablename()."} SET group_type = '%s', label = '%s', settings = '%s', weight = %d ". |
|
| 816 | 816 | "WHERE type_name = '%s' AND group_name = '%s'", |
| 817 | 817 | $group['group_type'], $group['label'], serialize($group['settings']), $group['weight'], $type_name, $group['group_name']); |
| 818 | 818 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
@@ -825,21 +825,21 @@ discard block |
||
| 825 | 825 | |
| 826 | 826 | if ($default != $form_values['group']) { |
| 827 | 827 | if ($form_values['group'] && !$default) { |
| 828 | - db_query("INSERT INTO {". fieldgroup_fields_tablename() ."} (type_name, group_name, field_name) VALUES ('%s', '%s', '%s')", $form_values['type_name'], $form_values['group'], $form_values['field_name']); |
|
| 828 | + db_query("INSERT INTO {".fieldgroup_fields_tablename()."} (type_name, group_name, field_name) VALUES ('%s', '%s', '%s')", $form_values['type_name'], $form_values['group'], $form_values['field_name']); |
|
| 829 | 829 | } |
| 830 | 830 | elseif ($form_values['group']) { |
| 831 | - db_query("UPDATE {". fieldgroup_fields_tablename() ."} SET group_name = '%s' WHERE type_name = '%s' AND field_name = '%s'", $form_values['group'], $form_values['type_name'], $form_values['field_name']); |
|
| 831 | + db_query("UPDATE {".fieldgroup_fields_tablename()."} SET group_name = '%s' WHERE type_name = '%s' AND field_name = '%s'", $form_values['group'], $form_values['type_name'], $form_values['field_name']); |
|
| 832 | 832 | } |
| 833 | 833 | else { |
| 834 | - db_query("DELETE FROM {". fieldgroup_fields_tablename() ."} WHERE type_name = '%s' AND field_name = '%s'", $form_values['type_name'], $form_values['field_name']); |
|
| 834 | + db_query("DELETE FROM {".fieldgroup_fields_tablename()."} WHERE type_name = '%s' AND field_name = '%s'", $form_values['type_name'], $form_values['field_name']); |
|
| 835 | 835 | } |
| 836 | 836 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
| 837 | 837 | } |
| 838 | 838 | } |
| 839 | 839 | |
| 840 | 840 | function fieldgroup_delete($content_type, $group_name) { |
| 841 | - db_query("DELETE FROM {". fieldgroup_tablename() ."} WHERE type_name = '%s' AND group_name = '%s'", $content_type, $group_name); |
|
| 842 | - db_query("DELETE FROM {". fieldgroup_fields_tablename() ."} WHERE type_name = '%s' AND group_name = '%s'", $content_type, $group_name); |
|
| 841 | + db_query("DELETE FROM {".fieldgroup_tablename()."} WHERE type_name = '%s' AND group_name = '%s'", $content_type, $group_name); |
|
| 842 | + db_query("DELETE FROM {".fieldgroup_fields_tablename()."} WHERE type_name = '%s' AND group_name = '%s'", $content_type, $group_name); |
|
| 843 | 843 | cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE); |
| 844 | 844 | } |
| 845 | 845 | |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | $element['#attributes']['class'] .= ' collapsed'; |
| 866 | 866 | } |
| 867 | 867 | } |
| 868 | - return '<fieldset'. drupal_attributes($element['#attributes']) .'>'. ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . (isset($element['#value']) ? $element['#value'] : '') ."</fieldset>\n"; |
|
| 868 | + return '<fieldset'.drupal_attributes($element['#attributes']).'>'.($element['#title'] ? '<legend>'.$element['#title'].'</legend>' : '').(isset($element['#description']) && $element['#description'] ? '<div class="description">'.$element['#description'].'</div>' : '').(!empty($element['#children']) ? $element['#children'] : '').(isset($element['#value']) ? $element['#value'] : '')."</fieldset>\n"; |
|
| 869 | 869 | } |
| 870 | 870 | |
| 871 | 871 | |
@@ -886,14 +886,14 @@ discard block |
||
| 886 | 886 | |
| 887 | 887 | $vars['group_name'] = $element['#group_name']; |
| 888 | 888 | $vars['group_name_css'] = strtr($element['#group_name'], '_', '-'); |
| 889 | - $vars['label'] = isset($element['#title']) ? $element['#title'] : '';; |
|
| 890 | - $vars['description'] = isset($element['#description']) ? $element['#description'] : '';; |
|
| 889 | + $vars['label'] = isset($element['#title']) ? $element['#title'] : ''; ; |
|
| 890 | + $vars['description'] = isset($element['#description']) ? $element['#description'] : ''; ; |
|
| 891 | 891 | $vars['content'] = isset($element['#children']) ? $element['#children'] : ''; |
| 892 | 892 | $vars['template_files'] = array( |
| 893 | 893 | 'fieldgroup-simple-', |
| 894 | - 'fieldgroup-simple-'. $element['#group_name'], |
|
| 895 | - 'fieldgroup-simple-'. $element['#node']->type, |
|
| 896 | - 'fieldgroup-simple-'. $element['#group_name'] .'-'. $element['#node']->type, |
|
| 894 | + 'fieldgroup-simple-'.$element['#group_name'], |
|
| 895 | + 'fieldgroup-simple-'.$element['#node']->type, |
|
| 896 | + 'fieldgroup-simple-'.$element['#group_name'].'-'.$element['#node']->type, |
|
| 897 | 897 | ); |
| 898 | 898 | } |
| 899 | 899 | |
@@ -908,6 +908,6 @@ discard block |
||
| 908 | 908 | |
| 909 | 909 | foreach (fieldgroup_groups($node->type) as $group_name => $group) { |
| 910 | 910 | // '#chilren' might not be set if the group is empty. |
| 911 | - $vars[$group_name .'_rendered'] = isset($node->content[$group_name]['#children']) ? $node->content[$group_name]['#children'] : ''; |
|
| 911 | + $vars[$group_name.'_rendered'] = isset($node->content[$group_name]['#children']) ? $node->content[$group_name]['#children'] : ''; |
|
| 912 | 912 | } |
| 913 | 913 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | function nodereference_ctools_plugin_directory($module, $plugin) { |
| 59 | 59 | if ($module == 'ctools' && $plugin == 'relationships') { |
| 60 | - return 'panels/' . $plugin; |
|
| 60 | + return 'panels/'.$plugin; |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | '#title' => t('View used to select the nodes'), |
| 116 | 116 | '#options' => $views, |
| 117 | 117 | '#default_value' => isset($field['advanced_view']) ? $field['advanced_view'] : '--', |
| 118 | - '#description' => t('<p>Choose the "Views module" view that selects the nodes that can be referenced.<br />Note:</p>') . |
|
| 118 | + '#description' => t('<p>Choose the "Views module" view that selects the nodes that can be referenced.<br />Note:</p>'). |
|
| 119 | 119 | t('<ul><li>Only views that have fields will work for this purpose.</li><li>This will discard the "Content types" settings above. Use the view\'s "filters" section instead.</li><li>Use the view\'s "fields" section to display additional informations about candidate nodes on node creation/edition form.</li><li>Use the view\'s "sort criteria" section to determine the order in which candidate nodes will be displayed.</li></ul>'), |
| 120 | 120 | ); |
| 121 | 121 | $form['advanced']['advanced_view_args'] = array( |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | else { |
| 130 | 130 | $form['advanced']['no_view_help'] = array( |
| 131 | - '#value' => t('<p>The list of nodes that can be referenced can be based on a "Views module" view but no appropriate views were found. <br />Note:</p>') . |
|
| 131 | + '#value' => t('<p>The list of nodes that can be referenced can be based on a "Views module" view but no appropriate views were found. <br />Note:</p>'). |
|
| 132 | 132 | t('<ul><li>Only views that have fields will work for this purpose.</li><li>This will discard the "Content types" settings above. Use the view\'s "filters" section instead.</li><li>Use the view\'s "fields" section to display additional informations about candidate nodes on node creation/edition form.</li><li>Use the view\'s "sort criteria" section to determine the order in which candidate nodes will be displayed.</li></ul>'), |
| 133 | 133 | ); |
| 134 | 134 | } |
@@ -155,19 +155,19 @@ discard block |
||
| 155 | 155 | $table_alias = content_views_tablename($field); |
| 156 | 156 | |
| 157 | 157 | // Filter: swap the handler to the 'in' operator. |
| 158 | - $data[$table_alias][$field['field_name'] .'_nid']['filter']['handler'] = 'content_handler_filter_many_to_one'; |
|
| 158 | + $data[$table_alias][$field['field_name'].'_nid']['filter']['handler'] = 'content_handler_filter_many_to_one'; |
|
| 159 | 159 | // Argument: use node.title for summaries. |
| 160 | 160 | $data["node_$table_alias"]['table']['join']['node'] = array( |
| 161 | 161 | 'table' => 'node', |
| 162 | 162 | 'field' => 'nid', |
| 163 | 163 | 'left_table' => $table_alias, |
| 164 | - 'left_field' => $field['field_name'] .'_nid', |
|
| 164 | + 'left_field' => $field['field_name'].'_nid', |
|
| 165 | 165 | ); |
| 166 | - $data[$table_alias][$field['field_name'] .'_nid']['argument']['handler'] = 'content_handler_argument_reference'; |
|
| 167 | - $data[$table_alias][$field['field_name'] .'_nid']['argument']['name table'] = "node_$table_alias"; |
|
| 168 | - $data[$table_alias][$field['field_name'] .'_nid']['argument']['name field'] = 'title'; |
|
| 166 | + $data[$table_alias][$field['field_name'].'_nid']['argument']['handler'] = 'content_handler_argument_reference'; |
|
| 167 | + $data[$table_alias][$field['field_name'].'_nid']['argument']['name table'] = "node_$table_alias"; |
|
| 168 | + $data[$table_alias][$field['field_name'].'_nid']['argument']['name field'] = 'title'; |
|
| 169 | 169 | // Relationship: add a relationship for related node. |
| 170 | - $data[$table_alias][$field['field_name'] .'_nid']['relationship'] = array( |
|
| 170 | + $data[$table_alias][$field['field_name'].'_nid']['relationship'] = array( |
|
| 171 | 171 | 'base' => 'node', |
| 172 | 172 | 'field' => $db_info['columns']['nid']['column'], |
| 173 | 173 | 'handler' => 'content_handler_relationship', |
@@ -255,11 +255,11 @@ discard block |
||
| 255 | 255 | // this page request. |
| 256 | 256 | $missing_ids = array_diff($ids, array_keys($sanitized_nodes)); |
| 257 | 257 | if (!empty($missing_ids)) { |
| 258 | - $where = array('n.nid in ('. db_placeholders($missing_ids) . ')'); |
|
| 258 | + $where = array('n.nid in ('.db_placeholders($missing_ids).')'); |
|
| 259 | 259 | if (!user_access('administer nodes')) { |
| 260 | 260 | $where[] = 'n.status = 1'; |
| 261 | 261 | } |
| 262 | - $result = db_query(db_rewrite_sql('SELECT n.nid, n.title, n.status FROM {node} n WHERE '. implode(' AND ', $where)), $missing_ids); |
|
| 262 | + $result = db_query(db_rewrite_sql('SELECT n.nid, n.title, n.status FROM {node} n WHERE '.implode(' AND ', $where)), $missing_ids); |
|
| 263 | 263 | while ($row = db_fetch_array($result)) { |
| 264 | 264 | $sanitized_nodes[$row['nid']] = $row; |
| 265 | 265 | } |
@@ -318,9 +318,9 @@ discard block |
||
| 318 | 318 | function theme_nodereference_formatter_default($element) { |
| 319 | 319 | $output = ''; |
| 320 | 320 | if (!empty($element['#item']['safe']['nid'])) { |
| 321 | - $output = l($element['#item']['safe']['title'], 'node/'. $element['#item']['safe']['nid']); |
|
| 321 | + $output = l($element['#item']['safe']['title'], 'node/'.$element['#item']['safe']['nid']); |
|
| 322 | 322 | if (!$element['#item']['safe']['status']) { |
| 323 | - $output = '<span class="node-unpublished"> '. t('(Unpublished)') ." $output</span>"; |
|
| 323 | + $output = '<span class="node-unpublished"> '.t('(Unpublished)')." $output</span>"; |
|
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | return $output; |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | if (!empty($element['#item']['safe']['nid'])) { |
| 335 | 335 | $output = check_plain($element['#item']['safe']['title']); |
| 336 | 336 | if (!$element['#item']['safe']['status']) { |
| 337 | - $output = '<span class="node-unpublished"> '. t('(Unpublished)') ." $output</span>"; |
|
| 337 | + $output = '<span class="node-unpublished"> '.t('(Unpublished)')." $output</span>"; |
|
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | return $output; |
@@ -563,11 +563,11 @@ discard block |
||
| 563 | 563 | * Substitute in the node title for the node nid. |
| 564 | 564 | */ |
| 565 | 565 | function nodereference_autocomplete_value($element, $edit = FALSE) { |
| 566 | - $field_key = $element['#columns'][0]; |
|
| 566 | + $field_key = $element['#columns'][0]; |
|
| 567 | 567 | if (!empty($element['#default_value'][$field_key])) { |
| 568 | 568 | $nid = $element['#default_value'][$field_key]; |
| 569 | 569 | $value = db_result(db_query(db_rewrite_sql('SELECT n.title FROM {node} n WHERE n.nid = %d'), $nid)); |
| 570 | - $value .= ' [nid:'. $nid .']'; |
|
| 570 | + $value .= ' [nid:'.$nid.']'; |
|
| 571 | 571 | return array($field_key => $value); |
| 572 | 572 | } |
| 573 | 573 | return array($field_key => NULL); |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | // element, it can wrap around the optionwidgets_select element. |
| 587 | 587 | // This will create a new, nested instance of the field. |
| 588 | 588 | // Add a validation step where the value can be unwrapped. |
| 589 | - $field_key = $element['#columns'][0]; |
|
| 589 | + $field_key = $element['#columns'][0]; |
|
| 590 | 590 | $element[$field_key] = array( |
| 591 | 591 | '#type' => 'optionwidgets_select', |
| 592 | 592 | '#default_value' => isset($element['#value']) ? $element['#value'] : '', |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | // element, it can wrap around the optionwidgets_select element. |
| 621 | 621 | // This will create a new, nested instance of the field. |
| 622 | 622 | // Add a validation step where the value can be unwrapped. |
| 623 | - $field_key = $element['#columns'][0]; |
|
| 623 | + $field_key = $element['#columns'][0]; |
|
| 624 | 624 | $element[$field_key] = array( |
| 625 | 625 | '#type' => 'optionwidgets_buttons', |
| 626 | 626 | '#default_value' => isset($element['#value']) ? $element['#value'] : '', |
@@ -654,12 +654,12 @@ discard block |
||
| 654 | 654 | // element, it can wrap around the text_textfield element and add an autocomplete |
| 655 | 655 | // path and some extra processing to it. |
| 656 | 656 | // Add a validation step where the value can be unwrapped. |
| 657 | - $field_key = $element['#columns'][0]; |
|
| 657 | + $field_key = $element['#columns'][0]; |
|
| 658 | 658 | |
| 659 | 659 | $element[$field_key] = array( |
| 660 | 660 | '#type' => 'text_textfield', |
| 661 | 661 | '#default_value' => isset($element['#value']) ? $element['#value'] : '', |
| 662 | - '#autocomplete_path' => 'nodereference/autocomplete/'. $element['#field_name'], |
|
| 662 | + '#autocomplete_path' => 'nodereference/autocomplete/'.$element['#field_name'], |
|
| 663 | 663 | // The following values were set by the content module and need |
| 664 | 664 | // to be passed down to the nested element. |
| 665 | 665 | '#title' => $element['#title'], |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | * like optionwidgets are using #element_validate to alter the value. |
| 698 | 698 | */ |
| 699 | 699 | function nodereference_optionwidgets_validate($element, &$form_state) { |
| 700 | - $field_key = $element['#columns'][0]; |
|
| 700 | + $field_key = $element['#columns'][0]; |
|
| 701 | 701 | |
| 702 | 702 | $value = $form_state['values']; |
| 703 | 703 | $new_parents = array(); |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | static $results = array(); |
| 806 | 806 | |
| 807 | 807 | // Create unique id for static cache. |
| 808 | - $cid = $field['field_name'] .':'. $match .':'. ($string !== '' ? $string : implode('-', $ids)) .':'. $limit; |
|
| 808 | + $cid = $field['field_name'].':'.$match.':'.($string !== '' ? $string : implode('-', $ids)).':'.$limit; |
|
| 809 | 809 | if (!isset($results[$cid])) { |
| 810 | 810 | $references = FALSE; |
| 811 | 811 | if (module_exists('views') && !empty($field['advanced_view']) && $field['advanced_view'] != '--') { |
@@ -931,15 +931,15 @@ discard block |
||
| 931 | 931 | 'equals' => "= '%s'", |
| 932 | 932 | 'starts_with' => "$like '%s%%'", |
| 933 | 933 | ); |
| 934 | - $where[] = 'n.title '. (isset($match_clauses[$match]) ? $match_clauses[$match] : $match_clauses['contains']); |
|
| 934 | + $where[] = 'n.title '.(isset($match_clauses[$match]) ? $match_clauses[$match] : $match_clauses['contains']); |
|
| 935 | 935 | $args[] = $string; |
| 936 | 936 | } |
| 937 | 937 | elseif ($ids) { |
| 938 | - $where[] = 'n.nid IN (' . db_placeholders($ids) . ')'; |
|
| 938 | + $where[] = 'n.nid IN ('.db_placeholders($ids).')'; |
|
| 939 | 939 | $args = array_merge($args, $ids); |
| 940 | 940 | } |
| 941 | 941 | |
| 942 | - $where_clause = $where ? 'WHERE ('. implode(') AND (', $where) .')' : ''; |
|
| 942 | + $where_clause = $where ? 'WHERE ('.implode(') AND (', $where).')' : ''; |
|
| 943 | 943 | $sql = db_rewrite_sql("SELECT n.nid, n.title AS node_title, n.type AS node_type FROM {node} n $where_clause ORDER BY n.title, n.type"); |
| 944 | 944 | $result = $limit ? db_query_range($sql, $args, 0, $limit) : db_query($sql, $args); |
| 945 | 945 | $references = array(); |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | $references = _nodereference_potential_references($field, $string, $match, array(), 10); |
| 976 | 976 | foreach ($references as $id => $row) { |
| 977 | 977 | // Add a class wrapper for a few required CSS overrides. |
| 978 | - $matches[$row['title'] ." [nid:$id]"] = '<div class="reference-autocomplete">'. $row['rendered'] . '</div>'; |
|
| 978 | + $matches[$row['title']." [nid:$id]"] = '<div class="reference-autocomplete">'.$row['rendered'].'</div>'; |
|
| 979 | 979 | } |
| 980 | 980 | drupal_json($matches); |
| 981 | 981 | } |
@@ -1024,9 +1024,9 @@ discard block |
||
| 1024 | 1024 | $node = $vars['node']; |
| 1025 | 1025 | $field = $node->referencing_field; |
| 1026 | 1026 | $vars['template_files'][] = 'node-nodereference'; |
| 1027 | - $vars['template_files'][] = 'node-nodereference-'. $field['field_name']; |
|
| 1028 | - $vars['template_files'][] = 'node-nodereference-'. $node->type; |
|
| 1029 | - $vars['template_files'][] = 'node-nodereference-'. $field['field_name'] .'-'. $node->type; |
|
| 1027 | + $vars['template_files'][] = 'node-nodereference-'.$field['field_name']; |
|
| 1028 | + $vars['template_files'][] = 'node-nodereference-'.$node->type; |
|
| 1029 | + $vars['template_files'][] = 'node-nodereference-'.$field['field_name'].'-'.$node->type; |
|
| 1030 | 1030 | } |
| 1031 | 1031 | } |
| 1032 | 1032 | |