function page_title_admin_settings in Page Title 6
Same name and namespace in other branches
- 8.2 page_title.admin.inc \page_title_admin_settings()
- 5.2 page_title.admin.inc \page_title_admin_settings()
- 5 page_title.module \page_title_admin_settings()
- 6.2 page_title.admin.inc \page_title_admin_settings()
- 7.2 page_title.admin.inc \page_title_admin_settings()
- 7 page_title.admin.inc \page_title_admin_settings()
Displays the form for the standard settings tab.
Return value
array A structured array for use with Forms API.
1 string reference to 'page_title_admin_settings'
- page_title_menu in ./
page_title.module - Implementation of hook_menu().
File
- ./
page_title.module, line 103 - Enhanced control over the page title (in the head tag).
Code
function page_title_admin_settings() {
//Define the titles
$form['title']['page_title_default'] = array(
'#type' => 'markup',
'#value' => 'Default Pattern',
);
$form['title']['page_title_front'] = array(
'#type' => 'markup',
'#value' => 'Frontpage Pattern',
);
//Define the 'default' token patterns
$form['pattern']['page_title_default'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('page_title_default', '[page-title] | [site-name]'),
'#maxlength' => 128,
'#description' => t('This is the pattern used in a situation where a pattern is not defined specifically for a content type below.'),
);
$form['pattern']['page_title_front'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('page_title_front', '[site-name] | [site-slogan]'),
'#maxlength' => 128,
'#description' => t('This is the frontpage pattern.'),
);
//Definate the patterns per-node-type
$types = node_get_types();
foreach ($types as $type) {
$key = 'page_title_type_' . $type->type;
$form['title'][$key] = array(
'#type' => 'markup',
'#value' => t('Pattern for %type', array(
'%type' => $type->name,
)),
);
$form['pattern'][$key] = array(
'#type' => 'textfield',
'#default_value' => variable_get($key, ''),
'#maxlength' => 128,
'#description' => t('If left blank, will inherit from default settings.'),
);
}
//Add the system buttons to the form
$form = system_settings_form($form);
//Overide the theme function back to our own one
$form['#theme'] = 'page_title_admin_settings';
return $form;
}