You are here

function content_menu_needs_rebuild in Content Construction Kit (CCK) 6

Flag / unflag the menus for rebuilding, or read the current value of the flag.

When adding new content types and fields, a menu rebuild is needed to update field paths, but sometimes it won't work right until other processes complete. We therefore store a flag in the session and actually rebuild on next page load (content_init()).

6 calls to content_menu_needs_rebuild()
content_field_instance_create in includes/content.crud.inc
Create a new field instance.
content_field_instance_delete in includes/content.crud.inc
Delete an existing field instance.
content_init in ./content.module
Implementation of hook_init().
content_type_create in includes/content.crud.inc
Make changes needed when a content type is created.
content_type_delete in includes/content.crud.inc
Make changes needed when a content type is deleted.

... See full list

File

./content.module, line 97
Allows administrators to associate custom fields to content types.

Code

function content_menu_needs_rebuild($rebuild = NULL) {
  if (!isset($rebuild)) {
    return isset($_SESSION['content_menu_needs_rebuild']);
  }
  elseif ($rebuild) {
    $_SESSION['content_menu_needs_rebuild'] = TRUE;
  }
  else {
    unset($_SESSION['content_menu_needs_rebuild']);
  }
}