Skip to content
Snippets Groups Projects
Commit 87eb90b4 authored by Tim Steiner's avatar Tim Steiner
Browse files

Support for setting an abbreviated site name in WDN Theme settings.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@114 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 606dfde1
No related branches found
No related tags found
No related merge requests found
......@@ -21,11 +21,11 @@ function unl_wdn_breadcrumb($variables)
$breadcrumbs = $variables['breadcrumb'];
if (count($breadcrumbs) == 0) {
$breadcrumbs[] = variable_get('site_name', 'Department');
$breadcrumbs[] = unl_get_site_name_abbreviated();
} else {
//Change 'Home' to be $site_name
array_unshift($breadcrumbs,
str_replace('Home', variable_get('site_name', 'Department'),
str_replace('Home', unl_get_site_name_abbreviated(),
array_shift($breadcrumbs)));
}
//Prepend UNL
......@@ -61,7 +61,7 @@ function unl_wdn_head_title()
}
// Change 'Home' to be $site_name
array_unshift($path, str_replace( 'Home', variable_get('site_name', 'Department'), array_shift($path)));
array_unshift($path, str_replace( 'Home', unl_get_site_name_abbreviated(), array_shift($path)));
//Prepend UNL
array_unshift($path, 'UNL');
......@@ -165,3 +165,16 @@ EOF;
return $output;
}
/**
* Return the abbreviated site name, assuming it has been set and we're not on the front page.
* Otherwise, it returns the full site name.
*/
function unl_get_site_name_abbreviated()
{
if (!drupal_is_front_page() && theme_get_setting('site_name_abbreviation')) {
return theme_get_setting('site_name_abbreviation');
} else {
return variable_get('site_name', 'Department');
}
}
......@@ -2,6 +2,13 @@
function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state)
{
$form['site_name_abbreviation'] = array(
'#type' => 'textfield',
'#title' => t('Site Name Abbreviation'),
'#default_value' => theme_get_setting('site_name_abbreviation'),
'#description' => t('An abbreviated version of your site\'s name to use in breadcrumbs.')
);
$form['zen_forms'] = array(
'#type' => 'checkbox',
'#title' => t('Use Zen Forms'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment