1 layout.admin.inc | layout_removal_removes_page($layout) |
- Determines whether the deletion or disabling of this layout would remove the
- page at its path.
*
Return value
Boolean.:
- TRUE if the layout creates a page that is the last enabled layout with the
- same path. FALSE if not.
File
- core/
modules/ layout/ layout.admin.inc, line 2695 - Admin page callbacks for the Layout module.
Code
function layout_removal_removes_page($layout) {
$path = $layout->getPath();
$form['layout_path'] = $path;
$router_item = menu_get_item($path);
if ($router_item != FALSE) {
$is_layout_page = ($router_item['page_callback'] == 'layout_page_callback');
if ($is_layout_page) {
if (!isset($router_item['map'])) {
// This needs to exist but isn't always set by menu_get_item().
$router_item['map'] = array();
}
return count(layout_load_multiple_by_router_item($router_item)) == 1;
}
}
return FALSE;
}