Exemple #1
0
function cignaIndonesia_breadcrumb($variables)
{
    //$breadcrumb = $variables['breadcrumb'];
    $breadcrumb = drupal_get_breadcrumb();
    $breadcrumb = array_unique($breadcrumb);
    if (!empty($breadcrumb)) {
        // Provide a navigational heading to give context for breadcrumb links to
        // screen-reader users. Make the heading invisible with .element-invisible.
        $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
        $crumbs = '<div class="breadcrumb">';
        $array_size = count($breadcrumb);
        $i = 0;
        if (drupal_get_title() != "Search") {
            while ($i < $array_size) {
                $pos = strpos($breadcrumb[$i], drupal_get_title());
                //we stop duplicates entering where there is a sub nav based on page jumps
                if ($pos === false) {
                    $crumbs .= '<span class="breadcrumb-' . $i;
                    $crumbs .= '">' . $breadcrumb[$i] . '</span>';
                    $crumbs .= '<img src="' . base_path() . path_to_theme() . '/images/breadcrumbArrow.gif" width="7" height="6" alt="Breadcrumb arrow" title="Breadcrumb arrow" />';
                }
                $i++;
            }
            $crumbs .= '<span class="active">' . drupal_get_title() . '</span></div>';
        }
        if (drupal_get_title() == "Search") {
            $crumbs .= '<span class="breadcrumb-0';
            $crumbs .= '">' . $breadcrumb[0] . '</span>';
            $crumbs .= '<img src="' . base_path() . path_to_theme() . '/images/breadcrumbArrow.gif" width="7" height="6" alt="Breadcrumb arrow" title="Breadcrumb arrow" />';
            $crumbs .= '<span class="active">' . drupal_get_title() . '</span></div>';
        }
        return $crumbs;
    }
}
Exemple #2
0
 /**
  * Check if the breadcrumb is to be suppressed altogether.
  *
  * @return bool
  *
  * @see crumbs_CurrentPageInfo::$breadcrumbSuppressed
  */
 protected function breadcrumbSuppressed()
 {
     // @todo Make this work!
     return FALSE;
     $existing_breadcrumb = drupal_get_breadcrumb();
     // If the existing breadcrumb is empty, that means a module has
     // intentionally removed it. Honor that, and stop here.
     return empty($existing_breadcrumb);
 }
Exemple #3
0
/**
 * Override or insert variables into the page template.
 */
function casasrealprod_process_page(&$variables)
{
    // Hook into color.module.
    if (module_exists('color')) {
        _color_page_alter($variables);
    }
    // Always print the site name and slogan, but if they are toggled off, we'll
    // just hide them visually.
    $variables['hide_site_name'] = theme_get_setting('toggle_name') ? FALSE : TRUE;
    $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
    if ($variables['hide_site_name']) {
        // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
        $variables['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
    }
    if ($variables['hide_site_slogan']) {
        // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it.
        $variables['site_slogan'] = filter_xss_admin(variable_get('site_slogan', ''));
    }
    // Since the title and the shortcut link are both block level elements,
    // positioning them next to each other is much simpler with a wrapper div.
    if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) {
        // Add a wrapper div using the title_prefix and title_suffix render elements.
        $variables['title_prefix']['shortcut_wrapper'] = array('#markup' => '<div class="shortcut-wrapper clearfix">', '#weight' => 100);
        $variables['title_suffix']['shortcut_wrapper'] = array('#markup' => '</div>', '#weight' => -99);
        // Make sure the shortcut link is the first item in title_suffix.
        $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
    }
    if (isset($variables['node']) && $variables['node']->type == "casas" && strpos(drupal_get_path_alias(), '/booking') > 0) {
        drupal_add_js(drupal_get_path('theme', 'casasrealprod') . '/js/casas_booking_manager.js');
        $breadcrumbs = array();
        $breadcrumbs[] = l(t('Home'), '<front>');
        $breadcrumbs[] = l(t('Las Casas'), 'node/10');
        $breadcrumbs[] = l($variables['node']->title, 'node/' . $variables['node']->nid);
        drupal_set_breadcrumb($breadcrumbs);
        $variables['title'] = t('Search for Availability');
        $variables['breadcrumb'] = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb()));
    }
    if (strpos(drupal_get_path_alias(), 'bookings') !== FALSE) {
        drupal_add_js(drupal_get_path('theme', 'casasrealprod') . '/js/casas_booking_manager.js');
    }
    if (strpos(drupal_get_path_alias(), 'checkout') !== FALSE) {
        $parts = explode('/', current_path());
        $last = array_pop($parts);
        $title = drupal_get_title();
        if (is_numeric($last)) {
            $title = t('Fill your personal data');
        } else {
            if ($last == 'review') {
                $title = t('Review order');
            }
        }
        $variables['title'] = $title;
    }
}
Exemple #4
0
 /**
  * Append an additional breadcrumb tag to the existing breadcrumb
  *
  * @param string $title
  * @param string $url   
  *
  * @return void
  * @access public
  * @static
  */
 static function appendBreadCrumb($breadCrumbs)
 {
     $breadCrumb = drupal_get_breadcrumb();
     if (is_array($breadCrumbs)) {
         foreach ($breadCrumbs as $crumbs) {
             if (stripos($crumbs['url'], 'id%%')) {
                 $args = array('cid', 'mid');
                 foreach ($args as $a) {
                     $val = CRM_Utils_Request::retrieve($a, 'Positive', CRM_Core_DAO::$_nullObject, false, null, $_GET);
                     if ($val) {
                         $crumbs['url'] = str_ireplace("%%{$a}%%", $val, $crumbs['url']);
                     }
                 }
             }
             $breadCrumb[] = "<a href=\"{$crumbs['url']}\">{$crumbs['title']}</a>";
         }
     }
     drupal_set_breadcrumb($breadCrumb);
 }
Exemple #5
0
function wistar_preprocess_node(&$vars) {
	$node = $vars['node'];

	if( $vars['node'] ) {
		$vars['template_files'][] = 'node-' . $vars['node']->nid;
	}

	$vars['node']->comment = $vars['node']->comments = $vars['node']->comment_form = 0;
	if (module_exists('comment') && isset($vars['node'])) {
		$vars['node']->comments = comment_render($vars['node']);
		$vars['node']->comment_form = drupal_get_form('comment_form',array('nid' => $vars['node']->nid));
	}

	$node->comment = 0;

	if($vars['node']->type=='newsletter') {
		$crumbs = drupal_get_breadcrumb();
		array_pop($crumbs);
		$crumbs[] = l('Wistar Today', 'wistar-today');
		$crumbs[] = l('News and Media', 'news-and-media');
		$crumbs[] = l('Focus Newsletter', 'news-and-media/focus-newsletter');
		$crumbs[] = $vars['node']->title;
		drupal_set_breadcrumb($crumbs);
	}

	if($node->type=='article') {
		$crumbs = drupal_get_breadcrumb();
		array_pop($crumbs);
		$crumbs[] = l('Wistar Today', 'wistar-today');
		$crumbs[] = l('News and Media', 'news-and-media');
		$crumbs[] = l('Focus Newsletter', 'news-and-media/focus-newsletter');
		//pa($node->field_article_newsletter[0]['nid'],1);
		if(!empty($node->field_article_newsletter[0]['nid'])){
			$node_newsletter = node_load($node->field_article_newsletter[0]['nid']);
			if(!empty($node_newsletter->field_newsletter_date[0]['value'])){
				$crumbs[] = l($node_newsletter->field_newsletter_date[0]['value'], $node_newsletter->path);
			}
		}
		$crumbs[] = $node->title;
		drupal_set_breadcrumb($crumbs);
	}
}
/**
 * Override theme_breadcrumb().
 */
function maxhealthcare_breadcrumb($breadcrumb)
{
    $links = array();
    $path = '';
    // Get URL arguments
    $arguments = explode('/', request_uri());
    // Remove empty values
    foreach ($arguments as $key => $value) {
        if (empty($value)) {
            unset($arguments[$key]);
        }
    }
    $arguments = array_values($arguments);
    // Add 'Home' link
    $links[] = l(t('Home'), '<front>');
    // Add other links
    if (!empty($arguments)) {
        foreach ($arguments as $key => $value) {
            // Don't make last breadcrumb a link
            if ($key == count($arguments) - 1) {
                $links[] = drupal_get_title();
            } else {
                if (!empty($path)) {
                    $path .= '/' . $value;
                } else {
                    $path .= $value;
                }
                $links[] = l(drupal_ucfirst($value), $path);
            }
        }
    }
    // Set custom breadcrumbs
    drupal_set_breadcrumb($links);
    // Get custom breadcrumbs
    $breadcrumb = drupal_get_breadcrumb();
    // Hide breadcrumbs if only 'Home' exists
    if (count($breadcrumb) > 1) {
        return '<div class="breadcrumb">' . implode(' &raquo; ', $breadcrumb) . '</div>';
    }
}
Exemple #7
0
/**
 * Custom breadcrumb generator
*/
function scc_get_breadcrumb($variables)
{
    $breadcrumbs = drupal_get_breadcrumb();
    //$breadcrumbs_copy = $breadcrumbs; //Keep a copy for some usecases
    $obj = menu_get_object();
    /*
      $path = (empty($obj)) ? $_GET['q'] : drupal_lookup_path('alias', $_GET['q']);
      $sections = explode("/",$path);
      
      $segment = '';
      $breadcrumb_mappings = array(
        //Browse
        'index' => 'Browse',
      );
    
      //Iterate through url sections and generate crumbs based on mappings
      if(!empty($sections) && !empty($breadcrumb_mappings[$sections[0]])) {
        $breadcrumbs = array(l('Home','<front>'));
        $this_path = "";
        foreach($sections as $section) {
          $this_path .= (empty($this_path)) ? $section : "/" . $section;
          if(!empty($breadcrumb_mappings[$this_path])) {
            $breadcrumbs[] = l($breadcrumb_mappings[$this_path], $this_path);
          }
        }
      }
    */
    if (!empty($obj) && ($obj->type == 'xf_biomaterial' || $obj->type == 'xf_bioassay')) {
        $parent = _exframe_get_parent_experiment($obj);
        $exp_url = drupal_get_path_alias('/node/' . $parent->nid);
        $breadcrumbs[] = '<a href="' . $exp_url . '">' . $parent->title . '</a>';
    }
    //Add Node title to breadcrumb as it is currently empty
    if (!empty($obj) && isset($obj->title)) {
        $breadcrumbs[count($breadcrumbs)] = $obj->title;
    }
    return $breadcrumbs;
}
Exemple #8
0
function phptemplate_breadcrumb($breadcrumb)
{
    if (drupal_is_front_page()) {
        return "";
    }
    $bread_arr = drupal_get_breadcrumb();
    $position = count(drupal_get_breadcrumb()) - 1;
    $breadcrumb[] = l(ucwords($bread_arr[$position]), $_GET["q"], array("html" => TRUE));
    if (!empty($breadcrumb)) {
        unset($breadcrumb[0]);
        $lat = sizeof($breadcrumb) - 1;
        unset($breadcrumb[$lat]);
        $retornado = '<div class="breadcrumb">' . ucfirst(implode(' / ', $breadcrumb)) . '</div>';
    }
    $url = explode('/', $_GET['q']);
    if ($url[0] == 'node' && $url[1] == 'add' && $url[2] == 'profile') {
        $retornado = '<div class="breadcrumb"><a href="">Request Membership</a></div>';
    }
    if ($url[0] == 'node' && $url[1] == 'edit' && $url[2] == 'profile') {
        $retornado = '<div class="breadcrumb"><a href="">Update Profile</a></div>';
    }
    return $retornado;
}
Exemple #9
0
/**
 * Breadcrumb themeing
 */
function ciclo20v2_breadcrumb($breadcrumb)
{
    if (!empty($breadcrumb)) {
        $html = '';
        if (preg_match('/^og\\/users\\/\\d+\\/invite$/', $_GET[q]) == 1) {
            $node = node_load(arg(2));
            if (!empty($node)) {
                $links = array();
                $links[] = l(t('Home'), '<front>');
                $links[] = l(t('Groups'), 'og');
                $links[] = l($node->title, 'node/' . $node->nid);
                $links[] = l(t('List'), 'og/users/' . $node->nid);
                // Set custom breadcrumbs
                drupal_set_breadcrumb($links);
                // Get custom breadcrumbs
                $breadcrumb = drupal_get_breadcrumb();
            }
        }
        if (count($breadcrumb) > 1) {
            $html .= '<div class="breadcrumb">' . implode(' &gt; ', $breadcrumb) . '</div>';
        }
        return $html;
    }
}
Exemple #10
0
/**
 * Implementation of template_preprocess_page().
 */
function csa_base_preprocess_page(&$variables)
{
    $conditional = array();
    $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
    $conditional['IE'] = array();
    // Target all IE versions
    $conditional['IE 6'] = array();
    // Target Internet Explorer 6 only
    $conditional['IE 7'] = array();
    // Target Internet Explorer 7 only
    $conditional['IE 8'] = array();
    // Target Internet Explorer 8 only
    $conditional['IE 6'][] .= '<script type="text/javascript">var blankImgIE="' . theme('theme_path', '/images/blank.gif') . '";</script>';
    $conditional['IE 6'][] .= '<style type="text/css" media="all">@import "' . theme('theme_path', '/css/fix-ie-6.css') . $query_string . '";</style>';
    $conditional['IE 6'][] .= '<style type="text/css">img { behavior: url(' . theme('theme_path', '/script/iepngfix.htc') . $query_string . ') }</style>';
    $conditional['IE 7'][] .= '<style type="text/css" media="all">@import "' . theme('theme_path', '/css/fix-ie-7.css') . $query_string . '";</style>';
    $conditional_output = '';
    foreach ($conditional as $version => $rules) {
        if (count($rules)) {
            $conditional_output .= '<!--[if ' . $version . "]>\n";
            foreach ($rules as $rule) {
                $conditional_output .= $rule . "\n";
            }
            $conditional_output .= "<![endif]-->\n";
        }
    }
    // Rebuild the $scripts output
    $js = drupal_add_js();
    // remove sticky table headers, we use our own modified version for this
    unset($js['module']['misc/tableheader.js']);
    $variables['scripts'] = drupal_get_js('header', $js) . $conditional_output;
    // Rebuild the $styles output
    $css = drupal_add_css();
    $variables['styles'] = drupal_get_css($css);
    $http = empty($_SERVER['HTTPS']) ? 'http' : 'https';
    $variables['styles'] .= "<link href='" . $http . "://fonts.googleapis.com/css?family=Molengo' rel='stylesheet' type='text/css'>\n";
    $variables['styles'] .= "<link href='" . $http . "://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'>\n";
    // add a var $admin_section to see if we are in the admin section of the site
    $variables['admin_section'] = FALSE;
    if (arg(0) == 'admin' || arg(2) == 'edit' || arg(2) == 'webform-results') {
        $variables['body_classes'] .= ' admin-section';
        $variables['admin_section'] = TRUE;
    }
    // Move second sidebar to first if this option is enabled in the theme settings and the user is viewing an admin page
    if (theme_get_setting('csa_base_move_sidebar') && $variables['admin_section']) {
        if (!empty($variables['sidebar_1']) && !empty($variables['sidebar_2'])) {
            $variables['sidebar_1'] .= $variables['sidebar_2'];
            unset($variables['sidebar_2']);
        } elseif (!empty($variables['sidebar_2'])) {
            $variables['sidebar_1'] = $variables['sidebar_2'];
            unset($variables['sidebar_2']);
        }
    }
    // Set up layout variable
    $variables['layout'] = 'none';
    if (!empty($variables['sidebar_1'])) {
        $variables['layout'] = 'sidebar-1';
    }
    if (!empty($variables['sidebar_2'])) {
        $variables['layout'] = $variables['layout'] == 'sidebar-1' ? 'both' : 'sidebar-2';
    }
    // Strip sidebar classes from the body
    $variables['body_classes'] = str_replace(array('both', 'no-sidebars', 'two-sidebars', 'one-sidebar', 'sidebar-left', 'sidebar-right'), '', $variables['body_classes']);
    // Remove excess spaces
    $variables['body_classes'] = str_replace('  ', ' ', trim($variables['body_classes']));
    // Add information about the number of sidebars
    if ($variables['layout'] == 'both') {
        $variables['body_classes'] .= ' two-sidebars';
    } elseif ($variables['layout'] == 'none') {
        $variables['body_classes'] .= ' no-sidebars';
    } else {
        $variables['body_classes'] .= ' one-sidebar ' . $variables['layout'];
    }
    // add the taxonomy terms to the body_classes
    if (module_exists('taxonomy') && !empty($variables['node_terms'])) {
        $terms = array();
        foreach (taxonomy_node_get_terms($variables['node']) as $term) {
            $terms[] = $variables['node_terms'] . csa_base_safe_css_name($term->name);
        }
        if (count($terms)) {
            $variables['body_classes'] .= ' ' . implode(' ', $terms);
        }
    }
    if (!empty($variables['logo'])) {
        $logo_img = theme('image', substr($variables['logo'], strlen(base_path()), strlen($variables['logo'])), $variables['site_name'], $variables['site_name']);
        $variables['logo'] = l($logo_img, "<front>", array('html' => 'true', 'attributes' => array('title' => $variables['site_name'])));
    }
    // Display mission statement on all pages?
    if (theme_get_setting('mission_statement_pages') == 'all') {
        $variables['mission'] = theme_get_setting('mission', FALSE);
    }
    // Show the title in the breadcrumb?
    if (!theme_get_setting('breadcrumb_display_admin') && $variables['admin_section'] || theme_get_setting('breadcrumb_display') == 0 && !$variables['admin_section']) {
        //Hide breadcrumb on all pages?
        unset($variables['breadcrumb']);
    } elseif (theme_get_setting('breadcrumb_with_title')) {
        $variables['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb(), $variables['title']);
    }
    $title = t(variable_get('site_name', ''));
    $slogan = t(variable_get('site_slogan', ''));
    $mission = t(variable_get('site_mission', ''));
    $page_title = t(drupal_get_title());
    $title_separator = theme_get_setting('configurable_separator');
    // Front page title settings
    if (drupal_is_front_page()) {
        switch (theme_get_setting('front_page_title_display')) {
            case 'title_slogan':
                $variables['head_title'] = drupal_set_title($title . $title_separator . $slogan);
                break;
            case 'slogan_title':
                $variables['head_title'] = drupal_set_title($slogan . $title_separator . $title);
                break;
            case 'title_mission':
                $variables['head_title'] = drupal_set_title($title . $title_separator . $mission);
                break;
            case 'custom':
                if (theme_get_setting('page_title_display_custom') !== '') {
                    $variabless['head_title'] = drupal_set_title(t(theme_get_setting('page_title_display_custom')));
                }
        }
    } else {
        // Non-front page title settings
        switch (theme_get_setting('other_page_title_display')) {
            case 'ptitle_slogan':
                $variables['head_title'] = drupal_set_title($page_title . $title_separator . $slogan);
                break;
            case 'ptitle_stitle':
                $variables['head_title'] = drupal_set_title($page_title . $title_separator . $title);
                break;
            case 'ptitle_smission':
                $variables['head_title'] = drupal_set_title($page_title . $title_separator . $mission);
                break;
            case 'ptitle_custom':
                if (theme_get_setting('other_page_title_display_custom') !== '') {
                    $variables['head_title'] = drupal_set_title($page_title . $title_separator . t(theme_get_setting('other_page_title_display_custom')));
                }
                break;
            case 'custom':
                if (theme_get_setting('other_page_title_display_custom') !== '') {
                    $variables['head_title'] = drupal_set_title(t(theme_get_setting('other_page_title_display_custom')));
                }
        }
    }
    // Set variables for the primary and secondary links
    if (!empty($variables['primary_links'])) {
        if (theme_get_setting('primary_links_allow_tree')) {
            $variables['primary_menu'] = menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
        } else {
            $variables['primary_menu'] = theme('links', $variables['primary_links'], array('class' => 'menu primary-links'));
        }
    }
    if (!empty($variables['secondary_links'])) {
        if (theme_get_setting('secondary_links_allow_tree')) {
            $variables['secondary_menu'] = menu_tree(variable_get('menu_secondary_links_source', 'secondary-links'));
        } else {
            $variables['secondary_menu'] = theme('links', $variables['secondary_links'], array('class' => 'menu secondary-links'));
        }
    }
    if (theme_get_setting('hide_front_page_title') && drupal_is_front_page()) {
        $variables['title'] = NULL;
    } else {
        // Remove any potential html tags
        $variables['head_title'] = strip_tags($variables['head_title']);
    }
}
Exemple #11
0
/**
 * Process variables for search-results.tpl.php.
 *
 * The $variables array contains the following arguments:
 * - $results
 * - $type
 *
 * @see search-results.tpl.php
 * default preprocess search function  is altered for adding  drupal collapsible fieldset to advanced search 
 */
function alim_preprocess_search_results(&$variables) {
$keys = search_get_keys();
 $tot_res_cnt = 0;
	if($variables['type'] == 'alimsearch' ){ // only for advanced search groups the search results in to fieldsets 	
		$variables['search_results'] = '';
		$crumb = drupal_get_breadcrumb();   
		$c = count($crumb);
		unset($crumb[$c-1]);
		drupal_set_breadcrumb($crumb);
		drupal_set_title('Search Results');
		foreach($variables['results'] as $key => $val ){
		     
				$value = "";$ct ='';
				$value .= $val['pagerval'];
				if($val['empty'])
				$value .= $val['empty'];
				foreach ($val['results'] as $result) {
					$value .= theme('search_result', $result, $variables['type']);
				}
				  $tot_res_cnt += $val['tot_res_cnt'];
				$ct .= '<div><a href="#search-'.$key.'" >'.$val['search_ind'].' </a></div>';
				$variables['search_results'] .= theme('fieldset', // collpasible group of results in advanced search 
													array(
													'#title' => $val['fullname'],
													'#collapsible' => TRUE,
													'#collapsed' => FALSE,
													'#value' => $value,
													'#attributes' => array('id' => 'search-'.$key)
													)
													);
				$variables['counter_left'] .= 	 $ct ;
		
		}
		// Provide alternate search results template.
		$variables['template_files'][] = 'search-results-'. $variables['type'];	// adding template sugessions
	
	}else{ // for simple search 
		$variables['search_results'] = '';
		$crumb = drupal_get_breadcrumb();   
		$c = count($crumb);
		unset($crumb[$c-1]);
		drupal_set_breadcrumb($crumb);
		drupal_set_title('Search Results');
		// $variables['search_results'] = '';
		foreach ($variables['results'] as $result) {
			$variables['search_results'] .= theme('search_result', $result, $variables['type']);
		}
		if(arg(0) == 'alimsearch' ){
			$variables['pager'] = theme('pager', NULL, 10, 0);
		}
		else{
			$variables['pager'] = theme('pager', NULL, 100, 0);
		}
		// Provide alternate search results template.
		$variables['template_files'][] = 'search-results-'. $variables['type']; // adding template sugessions
		global $pager_total_items;
        $tot_res_cnt = $pager_total_items[0]; 
	} 
	
   $script = "var search_key_value = '".$keys." => result count - ".substr($tot_res_cnt,0,30)."'";
   drupal_add_js($script, 'inline', 'footer');
 
}
Exemple #12
0
/**
 * Implements hook_page_alter().
 *
 * hook_page_alter() allows us to control the contents the $page render array.
 * This array contains populated theme regions and is printed in page.tpl.php.
 */
function dgd7_page_alter(&$page)
{
    // Remove the block template wrapper from the main content block.
    // The reason we don't use unset() is because #theme_wrappers is an array that
    // can contain multiple values. Since other modules can potentially add to
    // this value, here we make sure that we're specifically removing the block
    // wrapper.
    if (!empty($page['content']['system_main'])) {
        $page['content']['system_main']['#theme_wrappers'] = array_diff($page['content']['system_main']['#theme_wrappers'], array('block'));
    }
    // If on the front page, remove the sidebars and content region.
    // This will prevent the regions from printing in the page.tpl.php template or
    // variation of it. You can also accomplish the same affect by creating a
    // page--front.tpl.php, and removing the code that prints these variables.
    if (drupal_is_front_page()) {
        unset($page['sidebar_first'], $page['sidebar_second'], $page['content']);
    }
    // Add the breadcrumbs to the bottom of the footer region.
    // This is example of adding new content to a render array (covered on pg.
    // 325). The footer region already exists, and we are adding breadcrumbs to
    // it. Note: This alone will cause the breadcrumbs to print twice on the page
    // because the $breadcrumb variable is created during
    // template_process_page() and printed in page.tpl.php. The variable needs to
    // be removed and/or emptied in a process function. We've done this here in
    // dgd7_process_page().
    $page['footer']['breadcrumbs'] = array('#type' => 'container', '#attributes' => array('class' => array('breadcrumb-wrapper')), '#weight' => 10);
    $page['footer']['breadcrumbs']['breadcrumb'] = array('#theme' => 'breadcrumb', '#breadcrumb' => drupal_get_breadcrumb());
    // Trigger the contents of the footer region to be sorted.
    $page['footer']['#sorted'] = FALSE;
    // Move the messages into the help region.
    // Note: This alone will cause the breadcrumbs to print twice on the page
    // because the $messages variable is created during
    // template_process_page() and printed in page.tpl.php. The variable needs to
    // be removed and/or emptied in a process function. We've done this here in
    // dgd7_process_page().
    if ($page['#show_messages']) {
        $page['help']['messages'] = array('#markup' => theme('status_messages'), '#weight' => -10);
        // Trigger the contents of the help region to be sorted.
        $page['help']['#sorted'] = FALSE;
    }
}
Exemple #13
0
function aurora_preprocess_block(&$vars)
{
    // Logo Block
    if ($vars['block']->delta == 'blockify-logo') {
        $vars['theme_hook_suggestions'][] = 'block__logo';
        $site_name = filter_xss_admin(variable_get('site_name', 'Drupal'));
        // Strip the base_path from the beginning of the logo path.
        $path = preg_replace('|^' . base_path() . '|', '', theme_get_setting('logo'));
        $image = array('#theme' => 'image', '#path' => $path, '#alt' => t('!site_name Logo', array('!site_name' => $site_name)));
        $vars['logo'] = $image;
        $vars['sitename'] = $site_name;
        $vars['sitepath'] = url('<front>');
    } else {
        if ($vars['block']->delta == 'blockify-site-name') {
            $vars['theme_hook_suggestions'][] = 'block__site_name';
            $site_name = filter_xss_admin(variable_get('site_name', 'Drupal'));
            $vars['sitename'] = $site_name;
            $vars['sitepath'] = url('<front>');
        } else {
            if ($vars['block']->delta == 'blockify-site-slogan') {
                $vars['theme_hook_suggestions'][] = 'block__site_slogan';
                $slogan = filter_xss_admin(variable_get('site_slogan', 'Drupal'));
                $vars['slogan'] = $slogan;
            } else {
                if ($vars['block']->delta == 'blockify-page-title') {
                    $vars['theme_hook_suggestions'][] = 'block__page_title';
                    $vars['page_title'] = drupal_get_title();
                    // Add this for legacy support. Should not be used in the template. #2370653
                    $vars['title'] = $vars['page_title'];
                } else {
                    if ($vars['block']->delta == 'blockify-messages') {
                        $vars['theme_hook_suggestions'][] = 'block__messages';
                    } else {
                        if ($vars['block']->delta == 'blockify-breadcrumb') {
                            $vars['theme_hook_suggestions'][] = 'block__breadcrumbs';
                            $breadcrumbs = drupal_get_breadcrumb();
                            $vars['breadcrumbs'] = theme('breadcrumb', array('breadcrumb' => $breadcrumbs));
                        } else {
                            if ($vars['block']->delta == 'blockify-tabs') {
                                $vars['theme_hook_suggestions'][] = 'block__tabs';
                                $primary = menu_primary_local_tasks();
                                $secondary = menu_secondary_local_tasks();
                                $tabs = array('primary' => $primary, 'secondary' => $secondary);
                                $tabs = theme('menu_local_tasks', $tabs);
                                $vars['tabs'] = $tabs;
                            } else {
                                if ($vars['block']->delta == 'blockify-actions') {
                                    $vars['theme_hook_suggestions'][] = 'block__actions';
                                    $actions = menu_local_actions();
                                    $vars['actions'] = $actions;
                                } else {
                                    if ($vars['block']->delta == 'blockify-feed-icons') {
                                        $vars['theme_hook_suggestions'][] = 'block__feed_icons';
                                        $icons = drupal_get_feeds();
                                        $vars['icons'] = $icons;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Exemple #14
0
/**
 * Breadcrumb themeing
 */
function arquideasprod_breadcrumb($breadcrumb)
{
    if (!empty($breadcrumb)) {
        global $language;
        $html = '';
        $pattern = '/^contest\\/\\d+\\/[a-z_]+$/';
        $match = preg_match($pattern, $_GET[q]);
        if ($match == 1) {
            $arr = explode('/', $_GET[q]);
            $current = '';
            switch ($arr[2]) {
                case 'canceled':
                    $current = t('Canceled');
                    break;
                case 'finalists':
                    $current = t('Finalists');
                    break;
                case 'selectfinal':
                    $current = t('Finalists selection');
                    break;
                case 'inscripted':
                    $current = t('Inscripted');
                    break;
                case 'juryvotes':
                    $current = t('Jury voting');
                    break;
                case 'myvoting':
                    $current = t('My voting');
                    break;
                case 'payment_pending':
                    $current = t('Payment pending');
                    break;
                case 'preinscripted':
                    $current = t('Pre-inscripted');
                    break;
                case 'preselect':
                    $current = t('Preselection');
                    break;
                case 'publicvotationresults':
                    $current = t('Results of public voting');
                    break;
                case 'publicvotation':
                    $current = t('Public voting');
                    break;
                case 'submitted':
                    $current = t('Submitted');
                    break;
                case 'votingresults':
                    $current = t('Voting results');
                    break;
                case 'winners':
                    $current = t('Winners');
                    break;
                case 'selectwinners':
                    $current = t('Winners selection');
                    break;
                case 'all':
                    $current = t('All inscriptions');
                    break;
                default:
                    break;
            }
            $links = array();
            $links[] = l(t('Home'), '<front>');
            $links[] = l(t('Contest'), 'node/' . $arr[1]);
            $links[] = $current;
            // Set custom breadcrumbs
            drupal_set_breadcrumb($links);
            // Get custom breadcrumbs
            $breadcrumb = drupal_get_breadcrumb();
        }
        $pattern = '/^inscription\\/\\d+$/';
        $match = preg_match($pattern, $_GET['q']);
        if ($match == 1) {
            $arr = explode('/', $_GET[q]);
            $node = node_load($arr[1]);
            $cnode = node_load($node->field_contest[0]['nid']);
            if (!empty($node) && !empty($cnode)) {
                $ctitle = $cnode->title;
                if (!empty($cnode->tnid) && $cnode->tnid != 0) {
                    $translations = translation_node_get_translations($cnode->tnid);
                    if (!empty($translations[$language->language])) {
                        $cnode_trans = node_load($translations[$language->language]->nid);
                        if (!empty($cnode_trans)) {
                            $ctitle = $cnode_trans->title;
                        }
                    }
                }
                $links = array();
                $links[] = l(t('Home'), '<front>');
                $links[] = l($ctitle, 'node/' . $cnode->nid);
                $links[] = $node->title;
                // Set custom breadcrumbs
                drupal_set_breadcrumb($links);
                // Get custom breadcrumbs
                $breadcrumb = drupal_get_breadcrumb();
            }
        }
        $pattern = '/^node\\/\\d+$/';
        $match = preg_match($pattern, $_GET['q']);
        if ($match == 1) {
            $arr = explode('/', $_GET['q']);
            $node = node_load($arr[1]);
            if ($node->type == 'news') {
                $links = array();
                $links[] = l(t('Home'), '<front>');
                $links[] = l(t('News'), 'news');
                $links[] = $node->title;
                // Set custom breadcrumbs
                drupal_set_breadcrumb($links);
                // Get custom breadcrumbs
                $breadcrumb = drupal_get_breadcrumb();
            } elseif ($node->type == 'colaborator') {
                $links = array();
                $links[] = l(t('Home'), '<front>');
                $links[] = l(t('Partners&Co'), 'partners-and-co');
                $links[] = $node->title;
                // Set custom breadcrumbs
                drupal_set_breadcrumb($links);
                // Get custom breadcrumbs
                $breadcrumb = drupal_get_breadcrumb();
            }
        }
        if (count($breadcrumb) > 1) {
            $html .= '<div class="breadcrumb">' . implode(' &gt; ', $breadcrumb) . '</div>';
        }
        return $html;
    }
}
Exemple #15
0
/**
 * Override theme_breadcrumb().
 *
 * Base breadcrumbs on paths e.g., about/our-organization/bob-jones
 * turns into About Us > Our Organization > Bob Jones
 */



function mytheme_breadcrumb($breadcrumb) {
  $links = array();
  $path = '';
  $arguments = explode('/', request_uri());
  array_shift($arguments); //remove dsource folder name in breadcrumb
  array_shift($arguments); //remove dsource folder name in breadcrumb 
  foreach ($arguments as $key => $value) {
    if (empty($value)) {
      unset($arguments[$key]);
    }
  }
  $arguments = array_values($arguments);

  $links[] = l(t('Home'), '<front>');

  if (!empty($arguments)) {
    foreach ($arguments as $key => $value) {
      if ($key == (count($arguments) - 1)) {
        $links[] = drupal_get_title();
      }
      else {
        if (!empty($path)) {
          $path .= '/'. $value;
        } else {
          $path .= $value;
        }

        $menu_item = menu_get_item(drupal_lookup_path('source', $path));
        if ($menu_item['title']) {
          $links[] = l($menu_item['title'], $path);
        }
        else {
          $links[] = l(ucwords(str_replace('-', ' ', $value)), $path);
        }
      }
    }
  }

  drupal_set_breadcrumb($links);
  $breadcrumb = drupal_get_breadcrumb();
  if (count($breadcrumb) > 1) {
    return '<div class="breadcrumb">'. implode(' / ', $breadcrumb) .'</div>';
  }
}
/**
* Implements hook_alpha_preprocess_block()
*
* There is an issue with using Path Breadcrumb module with Delta blocks.
* See drupal.org/node/1777644 for description of issue and fix.
*/
function vp_theme_alpha_preprocess_block(&$vars)
{
    if ($vars['block']->module == 'delta_blocks' && $vars['block']->delta == 'breadcrumb') {
        $data = array('#theme' => 'breadcrumb', '#breadcrumb' => drupal_get_breadcrumb());
        $last = $data['#breadcrumb'][count($data['#breadcrumb']) - 1];
        if (!empty($last) && strpos($last, '<a') === FALSE && strlen($last) > 50) {
            $data['#breadcrumb'][count($data['#breadcrumb']) - 1] = substr($data['#breadcrumb'][count($data['#breadcrumb']) - 1], 0, 50) . '...';
        }
        $active_trail = array();
        $obj = menu_get_object('node');
        if ($obj && $obj->type === 'article') {
            $trail = menu_get_active_trail();
            unset($trail[count($trail) - 1]);
            foreach ($trail as $menu_item) {
                $active_trail[] = l($menu_item['title'], $menu_item['href']);
            }
            $active_trail[] = $data['#breadcrumb'][count($data['#breadcrumb']) - 1];
            $data['#breadcrumb'] = $active_trail;
        }
        $breadcrumb = render($data);
        $vars['content'] = $breadcrumb;
    }
}
//  dsm($content);
?>

<?php 
$output = "";
?>

                     
        <!-- ARTIKEL START -->
<?php 
$output = $output . "<section id=\"node-" . $node->nid . "\" class=\"" . $classes . " artikel\">";
$output = $output . "<div class=\"container\">";
// Brødkrummesti
$output = $output . "<div class=\"row\">";
$output = $output . "<div class=\"grid-two-thirds\">";
$output = $output . "<p class=\"breadcrumbs\">" . theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb())) . " / " . $title . "</p>";
$output = $output . "</div>";
$output = $output . "</div>";
$output = $output . "<div class=\"row second\">";
$output = $output . "<div class=\"grid-two-thirds\">";
// TITEL
if ($node->field_os2web_meetings_committee and !empty($content['field_os2web_meetings_date']) and $node->field_os2web_meetings_type) {
    $meetingDate = render($content['field_os2web_meetings_date']);
    $output .= "<h1>" . $node->field_os2web_meetings_type['und'][0]['value'] . " for " . taxonomy_term_load($node->field_os2web_meetings_committee['und'][0]['tid'])->name . "s møde " . strtolower($meetingDate) . "</h1>";
}
$output = $output . "</div>";
$output = $output . "<div class=\"grid-third sociale-medier social-desktop\"></div>";
$output = $output . "</div>";
$output = $output . "<div class=\"row second\">";
$output = $output . "<div class=\"grid-two-thirds\">";
$output = $output . "<!-- ARTIKEL TOP START -->";
/**
 * Implements theme_breadcrumb().
 */
function expressbase_breadcrumb($vars)
{
    $breadcrumb = !empty($vars['breadcrumb']) ? $vars['breadcrumb'] : drupal_get_breadcrumb();
    $theme = variable_get('theme_default', '');
    if (!empty($breadcrumb) && theme_get_setting('use_breadcrumbs', $theme)) {
        // Replace the Home breadcrumb with a Home icon
        //$breadcrumb[0] = str_replace('Home','<i class="fa fa-home"></i> <span class="home-breadcrumb element-invisible">Home</span>',$breadcrumb[0]);
        // Get current page title and add to breadcrumb array
        $breadcrumb[] = '<span class="current-breadcrumb">' . drupal_get_title() . '</span>';
        // Provide a navigational heading to give context for breadcrumb links to
        // screen-reader users. Make the heading invisible with .element-invisible.
        $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
        $output .= '<div class="breadcrumb">' . implode(' <i class="fa fa-angle-right"></i> ', $breadcrumb) . '</div>';
        return $output;
    }
}
Exemple #19
0
 /**
  * Set LC breadcrumbs
  *
  * @return void
  */
 protected function setBreadcrumbs()
 {
     $widget = $this->getHandler()->getWidget('\\XLite\\View\\Location');
     $lcNodes = array_map(function (\XLite\View\Location\Node $node) {
         return $node->getContent();
     }, $widget->getNodes());
     array_shift($lcNodes);
     // Add store root node
     $trails = menu_get_active_trail();
     array_splice($trails, 1, 0, array(array('title' => t('Store'), 'href' => \XLite\Core\Converter::buildFullURL(), 'link_path' => '', 'localized_options' => array(), 'type' => MENU_VISIBLE_IN_BREADCRUMB)));
     menu_set_active_trail($trails);
     $drupalNodes = array_slice(drupal_get_breadcrumb(), 0, 2);
     drupal_set_breadcrumb(array_merge($drupalNodes, $lcNodes));
 }
Exemple #20
0
        $output .= "</div>";
        $output .= "</div>";
        $output .= "</div>";
        $output .= "</div>";
        $output .= "</section>";
    }
} elseif ($term->vocabulary_machine_name == "aktivitetssted") {
    $output .= "<h1>Bingo!!!!</h1>";
} else {
    $output .= "<!-- ARTIKEL START -->";
    $output .= "<section id=\"taxonomy-term-" . $term->tid . "\" class=\"" . $classes . " artikel\">";
    $output .= "<div class=\"container\">";
    // Brødkrummesti
    $output .= "<div class=\"row\">";
    $output .= "<div class=\"grid-two-thirds\">";
    $output .= "<p class=\"breadcrumbs\">" . theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb())) . " / " . $term_name . "</p>";
    $output .= "</div>";
    $output .= "</div>";
    $output .= "<div class=\"row second\">";
    $output .= "<div class=\"grid-two-thirds\">";
    $output .= "<h1>" . $term_name . "</h1>";
    $output .= "</div>";
    $output .= "<div class=\"grid-third sociale-medier social-desktop\"></div>";
    $output .= "</div>";
    $output .= "<div class=\"row second\">";
    $output .= "<div class=\"grid-two-thirds\">";
    $output .= "<!-- ARTIKEL TOP START -->";
    $output .= "<div class=\"artikel-top\">";
    $output .= "</div>";
    $output .= "<!-- ARTIKEL TOP S**T -->";
    // ------------------------------  //
Exemple #21
0
function rcredits_links($variables)
{
    //  global $called; if (@$called) {die('you must disable secondary menu in theme settings');} else $called = TRUE;
    global $rUrl, $base_url;
    $links = $variables['links'];
    $attributes = $variables['attributes'];
    $attributes['class'][] = 'nav navbar-nav';
    // cgf
    $menuLinks = '';
    $num_links = count($links);
    $i = 1;
    foreach ($links as $key => $item) {
        // for each top-level menu item
        extract($item, EXTR_PREFIX_ALL, 'm');
        // get title and href
        $id = "menu-{$m_href}";
        $class = 'topmenu';
        if ($i == 1) {
            $class .= ' first';
        }
        if ($i == $num_links) {
            $class .= ' last';
        }
        if ($m_href == $_GET['q'] or $m_href == '<front>' && \drupal_is_front_page()) {
            $class .= ' active';
        }
        if (in_array($m_href, ['history', 'settings', 'community', 'sadmin'])) {
            $class .= ' submenu';
            //      $menu = w\modal($id, $m_title, '', w\subMenuHtml($m_href), 'X');
            $menu = w\subMenuHtml($m_href);
            //      $menu = htmlspecialchars("<div class=\"popmenu\">$menu</div>");
            //       <div id="hidden-$id" class="element-invisible">$menu</div>
            //      <a href="#" onclick="jQuery('#block-system-main .content').html(jQuery('#hidden-$id').html()); jQuery('#navbar').hide();">$m_title</a>
            //      <a href="#" data-toggle="popover" data-html="true" data-content="$menu" data-placement="bottom"
            $link = <<<EOF
      <div class="popmenu">{$menu}</div>
      <a href="#" data-toggle="popover" data-html="true" data-trigger="manual" data-animation="false" onclick="jQuery('.submenu a').not(jQuery(this)).popover('hide'); jQuery(this).popover('toggle');">{$m_title}</a>
EOF;
        } else {
            $link = spinLink("{$base_url}/{$m_href}", $m_title, $id);
        }
        $menuLinks .= "<li id=\"{$id}\" class=\"{$class}\">{$link}</li>\n";
        $i++;
    }
    if ($mya = r\acct()) {
        $acctName = "{$mya->fullName} ({$mya->mainQid})";
        $co = $mya->co ? ' co' : '';
    } else {
        $acctName = $co = '';
    }
    $breadcrumb = rcredits_breadcrumb(['breadcrumb' => \drupal_get_breadcrumb()]);
    return <<<EOF
<div class="nav2">
  <div class="nav2-inner">
    <div id="extras" class="">
      <button type="button" class="accounts-toggle photo{$co}" data-toggle="collapse" data-target="#edit-acct-account" aria-expanded="false" aria-controls="edit-acct-account">
        <a title="{$acctName}" data-toggle="popover" data-placement="left"><img src="{$base_url}/settings/icon"/></a>
      </button>
    </div>
  </div>
</div>

<nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container">
    <ol class="breadcrumb">
      {$breadcrumb}
    </ol>
  
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#"><div><img src="{$rUrl}/images/rlogo-circle80.png" /></div></a>
    </div>
    <div id="navbar" class="collapse navbar-collapse">
      <ul class="nav navbar-nav">
{$menuLinks}
      </ul>
    </div><!--/.navbar-collapse -->
  </div>
</nav>
EOF;
}
Exemple #22
0
/**
 * Preprocesses template variables for overlay.tpl.php
 *
 * @see overlay.tpl.php
 */
function shiny_preprocess_overlay(&$variables)
{
    if (module_exists('crumbs')) {
        $breadcrumb_data = crumbs_get_breadcrumb_data();
        $variables['crumbs_trail'] = $breadcrumb_data['trail'];
        $variables['breadcrumb'] = $breadcrumb_data['html'];
    } else {
        $variables['breadcrumb'] = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb()));
    }
}
/**
 * Preprocessor for theme('help').
 */
function rubik_preprocess_help(&$vars)
{
    $vars['hook'] = 'help';
    $vars['attr']['id'] = 'rubik-help';
    $vars['attr']['class'] .= 'path-admin-help clear-block toggleable';
    $help = menu_get_active_help();
    if (($test = strip_tags($help)) && !empty($help)) {
        // Thankfully this is static cached.
        $vars['attr']['class'] .= menu_secondary_local_tasks() ? ' with-tabs' : '';
        $vars['is_prose'] = TRUE;
        $vars['layout'] = TRUE;
        $vars['content'] = "<span class='icon'></span>" . $help;
        $vars['links'] = '<label class="breadcrumb-label">' . t('Help text for') . '</label>';
        $vars['links'] .= theme('breadcrumb', drupal_get_breadcrumb(), FALSE);
    }
}
Exemple #24
0
if (function_exists('themer_body_class')) {
    print themer_body_class();
}
?>
">
      <div id="header" class="clear-block">
        <div class="lbow-topleft-positiv">
          <div class="lbow-topleft-bar">
              <h1 class="logo-site-name">
                <?php 
$path = drupal_get_path_alias($_GET['q']);
//get alias of URL
$path = explode('/', $path);
//break path into an array
if ($path[0] == 'blog' || arg(0) == 'user' || arg(0) == 'works') {
    $my_breadcrumb = drupal_get_breadcrumb();
    $last_breadcrumb = $my_breadcrumb[count($my_breadcrumb) - 1];
    print '<span class="title">' . $last_breadcrumb . '</span>';
} else {
    print '<span class="title">' . $site_name . '</span>';
}
?>
              </h1>
          </div>
          <div class="lbow-topleft-negativ">
            <div class="lbow-content">

              <?php 
if ($breadcrumb) {
    ?>
                <div id="breadcrumb" class="nav">
Exemple #25
0
/**
 * Preprocess variables for page template.
 */
function scholarly_lite_preprocess_page(&$variables)
{
    $three_columns_grid_layout = theme_get_setting('three_columns_grid_layout', 'scholarly_lite');
    $sidebar_first = $variables['page']['sidebar_first'];
    $sidebar_second = $variables['page']['sidebar_second'];
    $header_top_left = $variables['page']['header_top_left'];
    $header_top_right = $variables['page']['header_top_right'];
    $footer_top_left = $variables['page']['footer_top_left'];
    $footer_top_right = $variables['page']['footer_top_right'];
    $footer_first = $variables['page']['footer_first'];
    $footer_second = $variables['page']['footer_second'];
    $footer_third = $variables['page']['footer_third'];
    $footer_fourth = $variables['page']['footer_fourth'];
    $breadcrumb = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb()));
    /**
     * Insert variables into the page template.
     */
    if (isset($variables['node']) && $variables['node']->type != 'page') {
        if ($sidebar_first && $sidebar_second) {
            if ($three_columns_grid_layout == 'grid_3_6_3') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-3';
                $variables['sidebar_second_grid_class'] = 'col-md-3';
            } elseif ($three_columns_grid_layout == 'grid_2_6_4') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-2';
                $variables['sidebar_second_grid_class'] = 'col-md-4';
            } elseif ($three_columns_grid_layout == 'grid_4_6_2') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-4';
                $variables['sidebar_second_grid_class'] = 'col-md-2';
            }
        } elseif ($sidebar_first && !$sidebar_second) {
            $variables['main_grid_class'] = 'col-md-8';
            $variables['sidebar_first_grid_class'] = 'col-md-4 fix-sidebar-first';
        } elseif (!$sidebar_first && $sidebar_second) {
            $variables['main_grid_class'] = 'col-md-8';
            $variables['sidebar_second_grid_class'] = 'col-md-4 fix-sidebar-second';
        } else {
            $variables['main_grid_class'] = 'col-md-8 col-md-offset-2';
            $variables['sidebar_first_grid_class'] = '';
            $variables['sidebar_second_grid_class'] = '';
        }
    } else {
        if ($sidebar_first && $sidebar_second) {
            if ($three_columns_grid_layout == 'grid_3_6_3') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-3';
                $variables['sidebar_second_grid_class'] = 'col-md-3';
            } elseif ($three_columns_grid_layout == 'grid_2_6_4') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-2';
                $variables['sidebar_second_grid_class'] = 'col-md-4';
            } elseif ($three_columns_grid_layout == 'grid_4_6_2') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-4';
                $variables['sidebar_second_grid_class'] = 'col-md-2';
            }
        } elseif ($sidebar_first && !$sidebar_second) {
            $variables['main_grid_class'] = 'col-md-8';
            $variables['sidebar_first_grid_class'] = 'col-md-4 fix-sidebar-first';
        } elseif (!$sidebar_first && $sidebar_second) {
            $variables['main_grid_class'] = 'col-md-8';
            $variables['sidebar_second_grid_class'] = 'col-md-4 fix-sidebar-second';
        } else {
            $variables['main_grid_class'] = 'col-md-12';
            $variables['sidebar_first_grid_class'] = '';
            $variables['sidebar_second_grid_class'] = '';
        }
    }
    if ($header_top_left && $header_top_right) {
        $variables['header_top_left_grid_class'] = 'col-md-8';
        $variables['header_top_right_grid_class'] = 'col-md-4';
    } elseif ($header_top_right || $header_top_left) {
        $variables['header_top_left_grid_class'] = 'col-md-12';
        $variables['header_top_right_grid_class'] = 'col-md-12';
    }
    if ($footer_top_left && $footer_top_right) {
        $variables['footer_top_left_grid_class'] = 'col-sm-6';
        $variables['footer_top_right_grid_class'] = 'col-sm-6';
        $variables['footer_top_regions'] = 'two-regions';
    } elseif ($footer_top_right || $footer_top_left) {
        $variables['footer_top_regions'] = 'one-region';
        $variables['footer_top_left_grid_class'] = 'col-md-12';
        $variables['footer_top_right_grid_class'] = 'col-ms-12';
    }
    if ($footer_first && $footer_second && $footer_third && $footer_fourth) {
        $variables['footer_grid_class'] = 'col-sm-3';
    } elseif (!$footer_first && $footer_second && $footer_third && $footer_fourth || $footer_first && !$footer_second && $footer_third && $footer_fourth || $footer_first && $footer_second && !$footer_third && $footer_fourth || $footer_first && $footer_second && $footer_third && !$footer_fourth) {
        $variables['footer_grid_class'] = 'col-sm-4';
    } elseif (!$footer_first && !$footer_second && $footer_third && $footer_fourth || !$footer_first && $footer_second && !$footer_third && $footer_fourth || !$footer_first && $footer_second && $footer_third && !$footer_fourth || $footer_first && !$footer_second && !$footer_third && $footer_fourth || $footer_first && !$footer_second && $footer_third && !$footer_fourth || $footer_first && $footer_second && !$footer_third && !$footer_fourth) {
        $variables['footer_grid_class'] = 'col-sm-6';
    } else {
        $variables['footer_grid_class'] = 'col-sm-12';
    }
}
  </div>
<?php 
} else {
    ?>
  <div id="page-title-image-section" class="page-title-image-wide">
    <div id="page-title-image-wrapper" class=" " style="background-image:url(<?php 
    print $title_image;
    ?>
);">
      <div id="page-title-image-overlay">
        <div id="page-title-image-inner" class="element-max-width-padding">
          <h1 id="page-title-image-title">
            <?php 
    print drupal_get_title();
    ?>
</h1>
        </div>
      </div>
    </div>
  </div>
<?php 
}
?>
<div class="page-title-breadcrumbs container-fluid">
  <div class="element-max-width-padding">
    <?php 
print theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb()));
?>
  </div>
</div>
<?php print theme('imagecache', 'page_masthead_image', $node->field_masthead_image[0]['filepath'], '', '', array('style' => 'margin-bottom:10px;')); ?>
<?php print theme('breadcrumb', drupal_get_breadcrumb()); ?>
<div class="vertical_tab_container">
	<div class="vertical_tab_elements">
		<?php print theme('wistar_vertical_tabs');?>
		<div class="content">			
			<?php print theme('wistar_content_heading', $node);?>
			<div id="node-<?php print $node->nid;?>" class="node page node-page">
				<div class="section">
					<div class="wysiwyg">
						<?php print $node->content['body']['#value']; ?>				
					</div>
				</div>
				<?php print theme('wistar_content_callouts', $node); ?>				
			</div>
		</div>
	</div>
</div>
Exemple #28
0
$bufcount = 0;
$buftid = 0;
foreach ($result2 as $v1) {
    foreach ($v1 as $v2) {
        if ($bufcount == 0) {
            $buftid = $v2->tid;
            ++$bufcount;
        }
    }
}
$bterm = taxonomy_term_load($buftid);
// Brødkrummesti
$output = $output . "<div class=\"row\">";
$output = $output . "<div class=\"grid-two-thirds\">";
//  $output = $output . "<p class=\"breadcrumbs\">" . theme('breadcrumb', array('breadcrumb'=>drupal_get_breadcrumb())) . " / " . $title . "</p>";
$output = $output . "<p class=\"breadcrumbs\">" . theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb())) . " / " . "<a href=\"" . url('taxonomy/term/' . $bterm->tid) . "\" title=\"Kategorien " . $bterm->name . "\">" . $bterm->name . "</a>" . " / " . $title . "</p>";
$output = $output . "</div>";
$output = $output . "</div>";
$output = $output . "<div class=\"row second\">";
$output = $output . "<div class=\"grid-two-thirds\">";
$output = $output . "<h1 id=\"main-content\">" . $title . "</h1>";
$output = $output . "</div>";
$output = $output . "<div class=\"grid-third sociale-medier social-desktop\"></div>";
$output = $output . "</div>";
$output = $output . "<div class=\"row second\">";
$output = $output . "<div class=\"grid-two-thirds\">";
$output = $output . "<!-- ARTIKEL TOP START -->";
$output = $output . "<div class=\"artikel-top\">";
// FOTO
$output = $output . "<!-- FOTO START -->";
if ($node->field_os2web_base_field_image) {
Exemple #29
0
/**
 * Preprocess variables for page template.
 */
function scholarly_preprocess_page(&$variables)
{
    $three_columns_grid_layout = theme_get_setting('three_columns_grid_layout', 'scholarly');
    $sidebar_first = $variables['page']['sidebar_first'];
    $sidebar_second = $variables['page']['sidebar_second'];
    $header_top_left = $variables['page']['header_top_left'];
    $header_top_right = $variables['page']['header_top_right'];
    $footer_top_left = $variables['page']['footer_top_left'];
    $footer_top_right = $variables['page']['footer_top_right'];
    $footer_first = $variables['page']['footer_first'];
    $footer_second = $variables['page']['footer_second'];
    $footer_third = $variables['page']['footer_third'];
    $footer_fourth = $variables['page']['footer_fourth'];
    $breadcrumb = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb()));
    /**
     * Insert variables into the page template.
     */
    if (isset($variables['node']) && $variables['node']->type != 'page') {
        if ($sidebar_first && $sidebar_second) {
            if ($three_columns_grid_layout == 'grid_3_6_3') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-3';
                $variables['sidebar_second_grid_class'] = 'col-md-3';
            } elseif ($three_columns_grid_layout == 'grid_2_6_4') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-2';
                $variables['sidebar_second_grid_class'] = 'col-md-4';
            } elseif ($three_columns_grid_layout == 'grid_4_6_2') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-4';
                $variables['sidebar_second_grid_class'] = 'col-md-2';
            }
        } elseif ($sidebar_first && !$sidebar_second) {
            $variables['main_grid_class'] = 'col-md-8';
            $variables['sidebar_first_grid_class'] = 'col-md-4 fix-sidebar-first';
        } elseif (!$sidebar_first && $sidebar_second) {
            $variables['main_grid_class'] = 'col-md-8';
            $variables['sidebar_second_grid_class'] = 'col-md-4 fix-sidebar-second';
        } else {
            $variables['main_grid_class'] = 'col-md-8 col-md-offset-2';
            $variables['sidebar_first_grid_class'] = '';
            $variables['sidebar_second_grid_class'] = '';
        }
    } else {
        if ($sidebar_first && $sidebar_second) {
            if ($three_columns_grid_layout == 'grid_3_6_3') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-3';
                $variables['sidebar_second_grid_class'] = 'col-md-3';
            } elseif ($three_columns_grid_layout == 'grid_2_6_4') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-2';
                $variables['sidebar_second_grid_class'] = 'col-md-4';
            } elseif ($three_columns_grid_layout == 'grid_4_6_2') {
                $variables['main_grid_class'] = 'col-md-6';
                $variables['sidebar_first_grid_class'] = 'col-md-4';
                $variables['sidebar_second_grid_class'] = 'col-md-2';
            }
        } elseif ($sidebar_first && !$sidebar_second) {
            $variables['main_grid_class'] = 'col-md-8';
            $variables['sidebar_first_grid_class'] = 'col-md-4 fix-sidebar-first';
        } elseif (!$sidebar_first && $sidebar_second) {
            $variables['main_grid_class'] = 'col-md-8';
            $variables['sidebar_second_grid_class'] = 'col-md-4 fix-sidebar-second';
        } else {
            $variables['main_grid_class'] = 'col-md-12';
            $variables['sidebar_first_grid_class'] = '';
            $variables['sidebar_second_grid_class'] = '';
        }
    }
    if ($header_top_left && $header_top_right) {
        $variables['header_top_left_grid_class'] = 'col-md-8';
        $variables['header_top_right_grid_class'] = 'col-md-4';
    } elseif ($header_top_right || $header_top_left) {
        $variables['header_top_left_grid_class'] = 'col-md-12';
        $variables['header_top_right_grid_class'] = 'col-md-12';
    }
    if ($footer_top_left && $footer_top_right) {
        $variables['footer_top_left_grid_class'] = 'col-sm-6';
        $variables['footer_top_right_grid_class'] = 'col-sm-6';
        $variables['footer_top_regions'] = 'two-regions';
    } elseif ($footer_top_right || $footer_top_left) {
        $variables['footer_top_regions'] = 'one-region';
        $variables['footer_top_left_grid_class'] = 'col-md-12';
        $variables['footer_top_right_grid_class'] = 'col-ms-12';
    }
    if ($footer_first && $footer_second && $footer_third && $footer_fourth) {
        $variables['footer_grid_class'] = 'col-sm-3';
    } elseif (!$footer_first && $footer_second && $footer_third && $footer_fourth || $footer_first && !$footer_second && $footer_third && $footer_fourth || $footer_first && $footer_second && !$footer_third && $footer_fourth || $footer_first && $footer_second && $footer_third && !$footer_fourth) {
        $variables['footer_grid_class'] = 'col-sm-4';
    } elseif (!$footer_first && !$footer_second && $footer_third && $footer_fourth || !$footer_first && $footer_second && !$footer_third && $footer_fourth || !$footer_first && $footer_second && $footer_third && !$footer_fourth || $footer_first && !$footer_second && !$footer_third && $footer_fourth || $footer_first && !$footer_second && $footer_third && !$footer_fourth || $footer_first && $footer_second && !$footer_third && !$footer_fourth) {
        $variables['footer_grid_class'] = 'col-sm-6';
    } else {
        $variables['footer_grid_class'] = 'col-sm-12';
    }
    /**
     * Generate page intro markup
     */
    if (arg(0) == "node" && is_numeric(arg(1))) {
        $nid = arg(1);
        $node = node_load($nid);
        $lang = "und";
        $banner_class = "";
        if (empty($node->field_teaser_image) || (!isset($node->field_internal_banner) || $node->field_internal_banner[$lang][0]["value"] == "0")) {
            $banner_class = "no-internal-banner-image";
        } else {
            $banner_class = "with-internal-banner-image ";
        }
        if (!empty($breadcrumb) && theme_get_setting("breadcrumb_display") || !empty($node->field_teaser_image) && (isset($node->field_internal_banner) && $node->field_internal_banner[$lang][0]["value"] == "1")) {
            if (!empty($node->field_teaser_image) && (isset($node->field_internal_banner) && $node->field_internal_banner[$lang][0]["value"] == "1")) {
                $image = image_style_url("slideshow", $node->field_teaser_image[$lang][0]["uri"]);
                $image_alt = $node->field_teaser_image[$lang][0]["alt"];
                $image_title = $node->field_teaser_image[$lang][0]["title"];
                $banner_image_markup = "<div class=\"container\"><div class=\"internal-banner-image\"><img src=\"" . $image . "\" alt=\"" . $image_alt . "\" title=\"" . $image_title . "\"/></div></div>";
            } else {
                $banner_image_markup = "";
            }
            if (!empty($breadcrumb) && theme_get_setting("breadcrumb_display")) {
                $page_intro_inside_markup = "<div id=\"page-intro-inside\" class=\"clearfix internal-banner {$banner_class}\"><div class=\"container\"><div class=\"row\"><div class=\"col-md-12\">\n\t            <div id=\"breadcrumb\" class=\"clearfix\"><div id=\"breadcrumb-inside\" class=\"clearfix\">{$breadcrumb}</div></div></div></div></div></div>";
            } else {
                $page_intro_inside_markup = "";
            }
            $variables['page_intro_markup'] = "<div id=\"page-intro\" class=\"clearfix\">{$banner_image_markup} {$page_intro_inside_markup}</div>";
        } else {
            $variables['page_intro_markup'] = "";
        }
    } else {
        if (!empty($breadcrumb) && theme_get_setting("breadcrumb_display")) {
            $variables['page_intro_markup'] = "<div id=\"page-intro\" class=\"clearfix\"><div id=\"page-intro-inside\" class=\"clearfix internal-banner no-internal-banner-image\"><div class=\"container\"><div class=\"row\">\n\t        <div class=\"col-md-12\"><div id=\"breadcrumb\" class=\"clearfix\"><div id=\"breadcrumb-inside\" class=\"clearfix\">{$breadcrumb}</div></div></div></div></div></div></div>";
        } else {
            $variables['page_intro_markup'] = "";
        }
    }
}
Exemple #30
0
/**
 * Theme engine calls this preprocess "hook" before rendering a page.
 *
 * We change template for iframes, add styles and fbjs.
 */
function fb_fbml_preprocess_page(&$vars, $hook)
{
    global $fb_app, $user;
    if (fb_is_iframe_canvas()) {
        // Iframe in a canvas
        $vars['template_file'] = 'iframe';
    } else {
        // FBML canvas page
        // Add our own stylesheet
        drupal_add_css(path_to_theme() . '/styles_fbml.css', 'theme', 'fbml');
        // http://wiki.developers.facebook.com/index.php/Include_files
        // Facebook now allows external references to stylesheets, but not
        // using the normal syntax, we don't use the normal
        // drupal_get_css() here.
        $css = drupal_add_css();
        $module_css = '';
        $theme_css = '';
        // Only include stylesheets for FBML
        foreach ($css['fbml'] as $type => $files) {
            foreach ($files as $file => $preprocess) {
                $url = base_path() . $file;
                if (file_exists($file)) {
                    // Refresh Facebook's cache anytime file changes.
                    $url .= '?v=' . filemtime($file);
                }
                // preprocess ignored
                if ($type == 'module') {
                    $module_css .= '<link rel="stylesheet" type="text/css" media="screen" href="' . $url . "\" />\n";
                } else {
                    if ($type == 'theme') {
                        $theme_css .= '<link rel="stylesheet" type="text/css" media="screen" href="' . $url . "\" />\n";
                    }
                }
            }
        }
        $vars['styles'] = $module_css . $theme_css;
        // Include only Facebook aware javascript.
        $vars['fbjs'] = drupal_get_js('fbml');
        // Enforce that only admins see admin block.  This can be done (more
        // cleanly?) elsewhere.  But we're doing it here to make sure.
        if (!user_access('access administration pages')) {
            $vars['admin'] = '';
        } else {
            if ($vars['admin']) {
                $vars['admin'] = "<div class=\"region admin_sidebar\">\n" . $vars['admin'] . "\n</div><!-- end admin sidebar-->";
            }
        }
        // Change 'Home' in breadcrumbs
        $crumbs = drupal_get_breadcrumb();
        if (count($crumbs) && strpos($crumbs[0], t('Home'))) {
            $crumbs[0] = l(t($fb_app->title), '');
            $vars['breadcrumb'] = theme('breadcrumb', $crumbs);
        }
        // Style page differently depending on which sidebars are present.
        // Approach copied from Zen theme.
        // allows styling based on context (home page, node of certain type, etc.)
        $body_classes = array();
        $body_classes[] = $vars['is_front'] ? 'front' : 'not-front';
        $body_classes[] = $user->uid > 0 ? 'logged-in' : 'not-logged-in';
        if (isset($vars['left']) && isset($vars['right'])) {
            $body_classes[] = 'with-both-sidebars';
        } else {
            if ($vars['right']) {
                $body_classes[] = 'with-sidebar-right';
            } else {
                if ($vars['left']) {
                    $body_classes[] = 'with-sidebar-left';
                }
            }
        }
        // new facebook pages are wider
        if ($_REQUEST['fb_sig_in_new_facebook']) {
            $body_classes[] = 'in-new-facebook';
        }
        $vars['body_classes'] = implode(' ', $body_classes);
    }
}