I would like you to apply this code to the module for the future release.
It will replace the Exclude Checkbox if the editing node's content type is now already excluded by the main settings.
function exclude_node_title_form_alter(&$form, &$form_state, $form_id) {
if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) {
if (!user_access('exclude any node title')) {
global $user;
if (!user_access('exclude own node title') ||
( user_access('exclude own node title') && strcmp($form['#node']->name, $user->name) ) ) {
return FALSE;
}
}
$weight = $form['title']['#weight']+1;
static $exclude_node_title_content_type;
if (!isset($exclude_node_title_content_type)) {
$exclude_node_title_content_type = variable_get('exclude_node_title_content_type_values', array());
}
if ($exclude_node_title_content_type[$form['#node']->type]) {
$form['title']['#description'] = t('This title is excluded from display');
} else {
$form['exclude_node_title'] = array(
'#type' => 'checkbox',
'#title' => t('Exclude title from display'),
'#required' => FALSE,
'#default_value' => (!empty($form['nid']['#value']) ? in_array($form['nid']['#value'], variable_get('exclude_node_title_nid_list', array())) : FALSE ),
'#weight' => $weight,
);
}
$form['#submit'][] = 'exclude_node_title_node_edit_form_submit';
}
}
Comments
Comment #1
gabrielu commentedThanks,
It will be on next release.
Gabriel