function panelizer_default_content_page in Panelizer 7.2
Same name and namespace in other branches
- 6 includes/admin.inc \panelizer_default_content_page()
- 7.3 includes/admin.inc \panelizer_default_content_page()
- 7 includes/admin.inc \panelizer_default_content_page()
Pass through to the panels content editor.
2 string references to 'panelizer_default_content_page'
- PanelizerEntityDefault::add_admin_links in plugins/
entity/ PanelizerEntityDefault.class.php - Helper function to add administrative menu items into an entity's already existing structure.
- panelizer_admin_hook_menu in includes/
admin.inc - Delegated hook_menu for admin
File
- includes/
admin.inc, line 422 - Contains administrative forms and settings.
Code
function panelizer_default_content_page($handler, $bundle, $name) {
if (is_string($handler)) {
$handler = panelizer_entity_plugin_get_handler($handler);
}
$panelizer = $handler
->get_default_panelizer_object($bundle, $name);
if (empty($panelizer)) {
return MENU_NOT_FOUND;
}
$cache_key = 'panelizer:default:' . $handler->entity_type . ':' . $bundle . ':' . $name;
$form_state = array(
'display cache' => panels_edit_cache_get($cache_key),
'no_redirect' => TRUE,
);
ctools_include('common', 'panelizer');
$output = drupal_build_form('panelizer_edit_content_form', $form_state);
if (!empty($form_state['executed'])) {
if (!empty($form_state['clicked_button']['#save-display'])) {
drupal_set_message(t('The settings have been updated.'));
$panelizer->display = $form_state['display'];
ctools_export_crud_save('panelizer_defaults', $panelizer);
}
else {
drupal_set_message(t('Changes have been discarded.'));
}
panels_edit_cache_clear($form_state['display cache']);
drupal_goto($_GET['q']);
}
ctools_set_no_blocks(FALSE);
drupal_set_page_content($output);
$page = element_info('page');
return $page;
}