The functions in theme/theme.inc displays does not respect the theme toggle settings(admin/appearance/settings). Is there a case to change the(below) to keep things in line with normal theme settings?

Changing as follows seems to work on a local version :

function template_process_pane_navigation(&$vars) {
  $vars['main_menu'] = theme('links__system_main_menu', array(
    'links' => $vars['main_menu'],
    'attributes' => array('id' => 'main-menu', 'class' => array('links', 'clearfix', 'inline')),
    'heading' => t('Main menu')
  ));
  $vars['secondary_menu'] = theme('links__system_secondary_menu', array(
    'links' => $vars['secondary_menu'],
    'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'clearfix', 'inline')),
    'heading' => t('Secondary menu')
  ));
  $vars['breadcrumb'] = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb()));
}

to

function template_process_pane_navigation(&$vars) {
  if(!theme_get_setting('toggle_main_menu')) {
    unset($vars['main_menu']);
  } else {
    $vars['main_menu'] = theme('links__system_main_menu', array(
      'links' => $vars['main_menu'],
      'attributes' => array('id' => 'main-menu', 'class' => array('links', 'clearfix', 'inline')),
      'heading' => t('Main menu')
    ));
  }

  if(!theme_get_setting('toggle_secondary_menu')) {
    unset($vars['secondary_menu']);
  } else {
    $vars['secondary_menu'] = theme('links__system_secondary_menu', array(
      'links' => $vars['secondary_menu'],
      'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'clearfix', 'inline')),
      'heading' => t('Secondary menu')
    ));
  }
  
  if(!theme_get_setting('toggle_breadcrumb')) {
    unset($vars['breadcrumb']);
  } else {
    $vars['breadcrumb'] = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb())); 
  }
}

Comments

dig1’s picture

Status: Active » Closed (works as designed)

I am doing some triage on this project. No activity has ocurred on this issue for approximately 20 months. Hopefully ok to Close (works as designed).

damienmckenna’s picture

Status: Closed (works as designed) » Active

I believe we need to add a documentation note about it, or provide a way of controlling whether PE adheres to the theme settings.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.43 KB

This verifies that the two menu variables actually contain something before passing them through the theme function.

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

  • Commit e2d9400 on 7.x-1.x by DamienMcKenna:
    Issue #1687872 by DamienMcKenna, exiled_hammer: Don't theme the...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.