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 1252
<?php
function node_types_configure($type = NULL) {
if (isset($type)) {
$node = new stdClass();
$node->type = $type;
$form['submission'] = array('#type' => 'fieldset', '#title' =>t('Submission form') );
$form['submission'][$type . '_help'] = array(
'#type' => 'textarea', '#title' => t('Explanation or submission guidelines'), '#default_value' => variable_get($type .'_help', ''),
'#description' => 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_get_name($type)))
);
$form['submission']['minimum_'. $type .'_size'] = array(
'#type' => 'select', '#title' => t('Minimum number of words'), '#default_value' => variable_get('minimum_'. $type .'_size', 0), '#options' => drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200)),
'#description' => 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_get_name($type)))
);
$form['workflow'] = array('#type' => 'fieldset', '#title' =>t('Workflow'));
$form['type'] = array('#type' => 'value', '#value' => $type);
$form['array_filter'] = array('#type' => 'value', '#value' => TRUE);
return system_settings_form($type .'_node_settings', $form);
}
else {
$header = array(t('Type'), t('Operations'));
$rows = array();
foreach (node_get_types() as $type => $name) {
$rows[] = array($name, l(t('configure'), 'admin/settings/content-types/'. $type));
}
return theme('table', $header, $rows);
}
}
?>Login or register to post comments 