You are here

function _panopoly_magic_add_content_preview_mode_name in Panopoly Magic 7

Helper function to get name of the 'Add content' preview mode.

2 calls to _panopoly_magic_add_content_preview_mode_name()
panopoly_magic_init in ./panopoly_magic.module
Implements hook_init()
panopoly_magic_preprocess_panels_add_content_modal in ./panopoly_magic.module
Preprocess the panels_add_content_modal() function to add the HTML for the preview

File

./panopoly_magic.module, line 1990

Code

function _panopoly_magic_add_content_preview_mode_name($value = NULL) {
  if (is_null($value)) {
    $value = variable_get('panopoly_magic_pane_add_preview', PANOPOLY_ADD_PREVIEW_DEFAULT);
  }
  switch ($value) {
    case PANOPOLY_ADD_PREVIEW_SINGLE:
      return 'single';
    case PANOPOLY_ADD_PREVIEW_DISABLED:
      return 'disabled';
    case PANOPOLY_ADD_PREVIEW_AUTOMATIC:
      return 'automatic';
    case PANOPOLY_ADD_PREVIEW_MANUAL:
      return 'manual';
  }
}