diff --git a/auto_nodetitle.module b/auto_nodetitle.module index 0d0b6cad58985843bab9b0bac4b5639346a7c91e..3611ac41af21f4a1b82b00e47edfcc323131122b 100644 --- a/auto_nodetitle.module +++ b/auto_nodetitle.module @@ -23,9 +23,9 @@ function auto_nodetitle_form_alter($form_id, &$form) { } else if (isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id) { //this is a node form - if (variable_get('auto_nodetitle_'. $form['#node']->type, 0)) { + if (variable_get('ant_'. $form['#node']->type, 0)) { $types = node_get_types(); - $pattern = variable_get('auto_nodetitle_pattern_'. $form['#node']->type, ''); + $pattern = variable_get('ant_pattern_'. $form['#node']->type, ''); if (trim($pattern)) { // the $form['#node'] is not complete yet, so we merge it with the post info $node = (object)array_merge((array)$form['#node'], $form['#post']); @@ -51,7 +51,7 @@ function auto_nodetitle_form_alter($form_id, &$form) { */ function auto_nodetitle_validate($form_id, $form_values, $form) { // there could be a setting for allowing empty node titles, but we haven't implemented that - if (!trim($form_values['title']) && !variable_get('auto_nodetitle_emptyok_'. $form['#node']->type, 0)) { + if (!trim($form_values['title']) && !variable_get('ant_emptyok_'. $form['#node']->type, 0)) { $message = t('Autogenerated title field is blank.'); if (user_access('administer nodes')) { $message .= ' '. t('Perhaps you need to change the configuration settings for this content type.', array('@url' => 'admin/content/types/'. $form['#node']->type)); @@ -71,18 +71,18 @@ function auto_nodetitle_node_settings_form(&$form) { '#title' => t('Automatic title generation'), '#weight' => 0, ); - $form['auto_nodetitle']['auto_nodetitle'] = array( + $form['auto_nodetitle']['ant'] = array( '#type' => 'checkbox', '#title' => t('Automatically generate the node title and hide the node title field.'), - '#default_value' => variable_get('auto_nodetitle_'. $form['#node_type']->type, 0), + '#default_value' => variable_get('ant_'. $form['#node_type']->type, 0), ); if (module_exists('token') || user_access('use PHP for title patterns')) { - $form['auto_nodetitle']['auto_nodetitle_pattern'] = array( + $form['auto_nodetitle']['ant_pattern'] = array( '#type' => 'textarea', '#title' => t('Pattern for the title'), '#description' => t('Leave blank for using the per default generated title. Otherwise this string will be used as title.'), - '#default_value' => variable_get('auto_nodetitle_pattern_'. $form['#node_type']->type, ''), + '#default_value' => variable_get('ant_pattern_'. $form['#node_type']->type, ''), ); } @@ -98,11 +98,11 @@ function auto_nodetitle_node_settings_form(&$form) { ); } if (user_access('use PHP for title patterns')) { - $form['auto_nodetitle']['auto_nodetitle_php'] = array( + $form['auto_nodetitle']['ant_php'] = array( '#type' => 'checkbox', '#title' => t('Evaluate PHP in pattern.'), '#description' => t('Put PHP code above that prints your string, but make sure you surround code in <?php and ?>'), - '#default_value' => variable_get('auto_nodetitle_pattern_'. $form['#node_type']->type, ''), + '#default_value' => variable_get('ant_php_'. $form['#node_type']->type, ''), ); } else { @@ -124,7 +124,7 @@ function _auto_nodetitle_patternprocessor($output, $node) { if (module_exists('token')) { $output = token_replace($output, 'node', $node); } - if (variable_get('auto_nodetitle_php_'. $node->type, 0)) { + if (variable_get('ant_php_'. $node->type, 0)) { $output = drupal_eval($output); } return $output;