You are here

function node_gallery_cck_field_exists in Node Gallery 6.3

Returns true or false if a particular field exists on a particular content type.

3 calls to node_gallery_cck_field_exists()
node_gallery_install_cck_type in ./node_gallery.install
node_gallery_relationship_settings_form_submit in ./node_gallery.admin.inc
Submit handler for relationship settings form
node_gallery_uninstall in ./node_gallery.install
Implements hook_uninstall()

File

./node_gallery.inc, line 1043
Shared functions for node_gallery

Code

function node_gallery_cck_field_exists($param) {
  module_load_include('inc', 'content', 'includes/content.crud');

  // content_field_instance_read croaks if you send it more than it expects
  if (count($param) > 2) {
    $param = array(
      'type_name' => $param['type_name'],
      'field_name' => $param['field_name'],
    );
  }
  $field_instance = content_field_instance_read($param);
  if (empty($field_instance)) {
    return FALSE;
  }
  return TRUE;
}