node_types_configure
- Versions
- 4.6 – 4.7
node_types_configure($type = NULL)
Menu callback; presents each node type configuration page.
Code
modules/node.module, line 956
<?php
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();
$node = new stdClass();
$node->type = $type;
$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($node, 'settings')));
print theme('page', system_settings_form($output));
}
else {
$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));
}
print theme('page', theme('table', $header, $rows));
}
}
?>Login or register to post comments 