1 layout.admin.inc layout_condition_edit_title(Layout $layout = NULL, Block $block = NULL, LayoutMenuItem $menu_item = NULL, $handler_id)

Title callback; Provide the page title for configuring a layout condition.

File

core/modules/layout/layout.admin.inc, line 1973
Administrative functions for Layout module.

Code

function layout_condition_edit_title(Layout $layout = NULL, Block $block = NULL, LayoutMenuItem $menu_item = NULL, $handler_id) {
  if (isset($menu_item->conditions[$handler_id])) {
    $plugin_name = $menu_item->conditions[$handler_id]->plugin;
  }
  elseif (isset($block->conditions[$handler_id])) {
    $plugin_name = $block->conditions[$handler_id]->plugin;
  }
  elseif (isset($layout->conditions[$handler_id])) {
    $plugin_name = $layout->conditions[$handler_id]->plugin;
  }
  else {
    $plugin_name = $handler_id;
  }
  $access_info = layout_get_access_info($plugin_name);
  if (isset($access_info['title'])) {
    if ($menu_item) {
      return t('Configure condition "@condition" for "@title"', array('@condition' => $access_info['title'], '@title' => $menu_item->path));
    }
    elseif ($block) {
      return t('Configure condition "@condition" for "@title"', array('@condition' => $access_info['title'], '@title' => $block->getAdminTitle()));
    }
    else {
      return t('Configure condition "@condition"', array('@condition' => $access_info['title']));
    }
  }
}