Skip to content

Commit

Permalink
Merge branch '7.x-2.x' into caw
Browse files Browse the repository at this point in the history
  • Loading branch information
sherakama committed Jul 8, 2015
2 parents d0af67a + 0bb2350 commit bb80c17
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion stanford_subsites.module
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,21 @@ function stanford_subsites_preprocess_html(&$vars, $hook) {
if ($subsite_node) {
$vars['subsite_site_name_text'] = $subsite_node->{SUBSITE_NAME_FIELD}[LANGUAGE_NONE][0]["safe_value"];
$vars['subsite_site_name_html'] = l($vars['subsite_site_name_text'], "<front>");
$vars["classes_array"][] = "subsite-is-active";

// Add the subsite to the css classes array.
$full_name = "subsite-";
if (isset($subsite_node->{SUBSITE_NAME_FIELD}[LANGUAGE_NONE][0]["safe_value"])) {
$full_name .= $subsite_node->{SUBSITE_NAME_FIELD}[LANGUAGE_NONE][0]["safe_value"];
}
if (isset($subsite_node->field_stanford_subsite_2nd_line[LANGUAGE_NONE][0]["safe_value"])) {
$full_name .= " " . $subsite_node->field_stanford_subsite_2nd_line[LANGUAGE_NONE][0]["safe_value"];
}

$full_name = strtolower(html_entity_decode($full_name));
$clean_css_class = drupal_clean_css_identifier($full_name);
$vars["classes_array"][] = $clean_css_class;

}
else {
$vars['subsite_site_name_html'] = l($vars['site_name'], "<front>");
Expand Down Expand Up @@ -251,6 +266,7 @@ function stanford_subsites_preprocess_page(&$vars) {
*/
function stanford_subsites_apply_subsite($node, &$vars) {


// Change the site title.
if (isset($node->{SUBSITE_NAME_FIELD}[LANGUAGE_NONE][0]["safe_value"])
&& !empty($node->{SUBSITE_NAME_FIELD}[LANGUAGE_NONE][0]["safe_value"])) {
Expand All @@ -263,7 +279,6 @@ function stanford_subsites_apply_subsite($node, &$vars) {
$vars['site_title_second_line'] = $node->field_stanford_subsite_2nd_line[LANGUAGE_NONE][0]["safe_value"];
}


// Create new $logo_title and $alt variables for use in the page.tpl.php
$vars['alt'] = $vars['site_name'];
$vars['logo_title'] = $vars['site_name'];
Expand Down

0 comments on commit bb80c17

Please sign in to comment.