You are here

function devel_load_object in Devel 5

Same name and namespace in other branches
  1. 6 devel.module \devel_load_object()
  2. 7 devel.pages.inc \devel_load_object()

Menu callback; prints the loaded structure of the current node/user.

1 string reference to 'devel_load_object'
devel_menu in ./devel.module
Implementation of hook_menu().

File

./devel.module, line 1091

Code

function devel_load_object($type, $id) {
  $output = '';
  switch ($type) {
    case 'node':
      $object = node_load($id);
      drupal_set_title(check_plain($object->title));
      break;
    case 'user':
      $object = user_load(array(
        'uid' => $id,
      ));
      drupal_set_title(check_plain($object->name));
      break;
    case 'view':
      $object = views_get_view($id);
      drupal_set_title(check_plain($object->name));
  }
  return devel_print_object($object);
}