Browse Source

First pass at drupal node content type for basic image. Install and uninstall hook working. Moving on to adding fields.

7.x-2.x
Daniel Lamb 10 years ago
parent
commit
136987b321
  1. 6
      islandora_basic_image/islandora_basic_image.info
  2. 30
      islandora_basic_image/islandora_basic_image.install
  3. 10
      islandora_basic_image/islandora_basic_image.module

6
islandora_basic_image/islandora_basic_image.info

@ -0,0 +1,6 @@
name = Islandora Basic Image
description = "Content type, viewer, and hooks for Basic Image objects"
package = Islandora
version = 7.x-dev
core = 7.x
dependencies[] = islandora

30
islandora_basic_image/islandora_basic_image.install

@ -0,0 +1,30 @@
<?php
function islandora_basic_image_install() {
$t = get_t();
$basic_image_content_type = array(
'type' => 'basic_image',
'name' => $t('Basic Image'),
'base' => 'node_content',
'description' => $t('An image object in Fedora'),
);
$basic_image_content_type = node_type_set_defaults($basic_image_content_type);
$status = node_type_save($basic_image_content_type);
$t_args = array('%name' => $basic_image_content_type->name);
if ($status == SAVED_UPDATED) {
drupal_set_message($t('Updated %name content type.', $t_args));
}
elseif ($status == SAVED_NEW) {
drupal_set_message($t('Created %name content type.', $t_args));
}
}
function islandora_basic_image_uninstall() {
node_type_delete('basic_image');
}

10
islandora_basic_image/islandora_basic_image.module

@ -0,0 +1,10 @@
<?php
/**
* @file
* This is the new Islandora Basic Image module.
*/
function islandora_basic_image_form($node, &$form_state) {
return node_content_form($node, $form_state);
}
Loading…
Cancel
Save