You are here

function node_gallery_install_default_settings in Node Gallery 6.3

Write the default relationship to the database. This function cannot be called from hook_install, because Drupal will not know the schema of a module that has not yet been installed!

1 call to node_gallery_install_default_settings()
node_gallery_enable in ./node_gallery.install
Create default settings when the module is enabled.

File

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

Code

function node_gallery_install_default_settings() {

  // Set the defaults for a node_gallery relationship
  $rel = new stdClass();
  $rel->gallery_type = NODE_GALLERY_DEFAULT_GALLERY_TYPE;
  $rel->image_type = NODE_GALLERY_DEFAULT_IMAGE_TYPE;
  $rel->imagefield_name = 'field_node_gallery_image';
  $rel->settings = node_gallery_relationship_settings_defaults();
  drupal_write_record('node_gallery_relationships', $rel);
}