You are here

function panelizer_has_no_choice_callback in Panelizer 6

Same name and namespace in other branches
  1. 7.3 panelizer.module \panelizer_has_no_choice_callback()
  2. 7 panelizer.module \panelizer_has_no_choice_callback()
  3. 7.2 panelizer.module \panelizer_has_no_choice_callback()

Menu callback to determine if a type has a choice of defaults.

We use this to make sure the right tabs appear.

1 string reference to 'panelizer_has_no_choice_callback'
panelizer_menu in ./panelizer.module
Implementation of hook_menu().

File

./panelizer.module, line 261
panelizer.module

Code

function panelizer_has_no_choice_callback($type, $key) {
  if (!user_access('administer panelizer')) {
    return FALSE;
  }

  // If this type has defaults and is not allowed a choice, return true.
  $settings = variable_get('panelizer_defaults', array());
  return !empty($settings[$type][$key]['status']) && !empty($settings[$type][$key]['default']) && empty($settings[$type][$key]['choice']);
}