You are here

function node_gallery_type_exists in Node Gallery 6.3

Same name and namespace in other branches
  1. 7 node_gallery.install \node_gallery_type_exists()
1 call to node_gallery_type_exists()
node_gallery_setup_content_type in ./node_gallery.install

File

./node_gallery.install, line 141
Install, update and uninstall functions for the node_gallery module.

Code

function node_gallery_type_exists($type) {

  // During install profiles, node and user modules aren't yet loaded.
  // Ensure they're loaded before calling node_get_types().
  include_once './' . drupal_get_path('module', 'node') . '/node.module';
  include_once './' . drupal_get_path('module', 'user') . '/user.module';
  $types = node_get_types();
  $types = array_change_key_case($types, CASE_LOWER);
  return array_key_exists($type, $types);
}