summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.module48
1 files changed, 24 insertions, 24 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index d9bf59def..a28779ca7 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -669,7 +669,7 @@ function node_menu($may_cache) {
$items[] = array('path' => 'admin/node/configure/settings', 'title' => t('settings'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/node/configure/types', 'title' => t('content types'),
- 'callback' => 'node_types',
+ 'callback' => 'node_types_configure',
'access' => user_access('administer nodes'),
'type' => MENU_LOCAL_TASK);
if (module_exist('search')) {
@@ -717,8 +717,6 @@ function node_menu($may_cache) {
else if (arg(0) == 'admin' && arg(1) == 'node' && arg(2) == 'configure' && arg(3) == 'types' && is_string(arg(4))) {
$items[] = array('path' => 'admin/node/configure/types/'. arg(4),
'title' => t("'%name' content type", array('%name' => node_invoke(arg(4), 'node_name'))),
- 'callback' => 'node_types_configure',
- 'access' => user_access('administer nodes'),
'type' => MENU_CALLBACK);
}
}
@@ -942,32 +940,34 @@ function node_admin_nodes() {
return form($output, 'post', url('admin/node/action'));
}
-function node_types() {
- $header = array(t('Type'), t('Operations'));
-
- $rows = array();
- foreach (node_list() as $type) {
- $rows[] = array(node_invoke($type, 'node_name'), l(t('configure'), 'admin/node/configure/types/'. $type));
- }
+/**
+ * Menu callback; presents each node type configuration page.
+ */
+function node_types_configure($type = NULL) {
+ if (isset($type)) {
+ // Go to the listing page when we submit this form, system_settings_save() calls drupal_goto().
+ if ($_POST['op']) {
+ $_GET['q'] = 'admin/node/configure/types';
+ }
+ system_settings_save();
- print theme('page', theme('table', $header, $rows));
-}
+ $group = form_textarea(t('Explanation or submission guidelines'), $type .'_help', variable_get($type .'_help', ''), 70, 5, t('This text will be displayed at the top of the %type submission form. It is useful for helping or instructing your users.', array('%type' => node_invoke($type, 'node_name'))));
+ $group .= form_select(t('Minimum number of words'), 'minimum_'. $type .'_size', variable_get('minimum_'. $type .'_size', 0), drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200)), t('The minimum number of words a %type must be to be considered valid. This can be useful to rule out submissions that do not meet the site\'s standards, such as short test posts.', array('%type' => node_invoke($type, 'node_name'))));
+ $output = form_group(t('Submission form'), $group);
+ $output .= form_group(t('Workflow'), implode('', node_invoke_nodeapi($type, 'settings')));
-function node_types_configure() {
- // Go to the listing page when we submit this form, system_settings_save() calls drupal_goto().
- if ($_POST['op']) {
- $_GET['q'] = 'admin/node/configure/types';
+ print theme('page', system_settings_form($output));
}
- system_settings_save();
-
- $type = arg(4);
+ else {
+ $header = array(t('Type'), t('Operations'));
- $group = form_textarea(t('Explanation or submission guidelines'), $type .'_help', variable_get($type .'_help', ''), 70, 5, t('This text will be displayed at the top of the %type submission form. It is useful for helping or instructing your users.', array('%type' => node_invoke($type, 'node_name'))));
- $group .= form_select(t('Minimum number of words'), 'minimum_'. $type .'_size', variable_get('minimum_'. $type .'_size', 0), drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200)), t('The minimum number of words a %type must be to be considered valid. This can be useful to rule out submissions that do not meet the site\'s standards, such as short test posts.', array('%type' => node_invoke($type, 'node_name'))));
- $output = form_group(t('Submission form'), $group);
- $output .= form_group(t('Workflow'), implode('', node_invoke_nodeapi($type, 'settings')));
+ $rows = array();
+ foreach (node_list() as $type) {
+ $rows[] = array(node_invoke($type, 'node_name'), l(t('configure'), 'admin/node/configure/types/'. $type));
+ }
- print theme('page', system_settings_form($output));
+ print theme('page', theme('table', $header, $rows));
+ }
}
/**