summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Ziegler2007-01-07 13:52:09 (GMT)
committer Wolfgang Ziegler2007-01-07 13:52:09 (GMT)
commit497b52b98a8c0bc853ec8b0a011c861936e77495 (patch)
tree419b4be37bebee042adc524f9dcafe7ea33f4120
parentcf9ea50de8833099305d63d0aaa6b4a15d9cd7b7 (diff)
#107370: fixed possible problems with long variable names
-rw-r--r--auto_nodetitle.module20
1 files changed, 10 insertions, 10 deletions
diff --git a/auto_nodetitle.module b/auto_nodetitle.module
index 0d0b6ca..3611ac4 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 <a href="@url">configuration settings</a> 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 &lt;?php and ?&gt;'),
- '#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;