Browse Source

cleanup

pull/200/head
DannyJoris 12 years ago
parent
commit
ea22f8ed44
  1. 2
      admin/islandora.admin.inc
  2. 2
      includes/solution_packs.inc
  3. 25
      islandora.api.php
  4. 168
      islandora.module

2
admin/islandora.admin.inc

@ -13,6 +13,8 @@
function islandora_repository_admin($form, &$form_state) { function islandora_repository_admin($form, &$form_state) {
module_load_include('inc', 'islandora', 'includes/tuque'); module_load_include('inc', 'islandora', 'includes/tuque');
module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/utilities');
// add css
drupal_add_css(drupal_get_path('module', 'islandora') . '/css/islandora.admin.css');
if (!IslandoraTuque::exists()) { if (!IslandoraTuque::exists()) {
IslandoraTuque::getError(); IslandoraTuque::getError();

2
includes/solution_packs.inc

@ -9,6 +9,8 @@
* Solution pack admin page callback * Solution pack admin page callback
*/ */
function islandora_solution_packs_admin() { function islandora_solution_packs_admin() {
// add css
drupal_add_css(drupal_get_path('module', 'islandora') . '/css/islandora.admin.css');
// check connection // check connection
module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/utilities');
$url = variable_get('islandora_base_url', 'http://localhost:8080/fedora'); $url = variable_get('islandora_base_url', 'http://localhost:8080/fedora');

25
islandora.api.php

@ -126,7 +126,7 @@ function hook_CMODEL_PID_islandora_pre_purge_object($fedora_object) {}
function hook_islandora_ingest_registry($collection_object) { function hook_islandora_ingest_registry($collection_object) {
$reg = array( $reg = array(
array( array(
'name' => t('Ingest Route Name'), 'name' => t('Ingest route name'),
'url' => 'ingest_route/url', 'url' => 'ingest_route/url',
'weight' => 0, 'weight' => 0,
), ),
@ -195,3 +195,26 @@ function hook_islandora_post_purge_datastream($object, $dsid) {}
*/ */
function hook_islandora_post_purge_object($object_id, $content_models) {} function hook_islandora_post_purge_object($object_id, $content_models) {}
/**
* Registry hook for required objects.
*
* Solution packs can include data to create certain objects that describe or
* help the objects it would create. This includes collection objects and content
* models.
*
* @see islandora_solution_packs_admin()
* @see islandora_install_solution_pack()
* @example islandora_islandora_required_objects()
*/
function hook_islandora_required_objects() {}
/**
* Registry hook for viewers that can be implemented by solution packs.
*
* Solution packs can use viewers for their data. This hook lets Islandora know
* which viewers there are available.
*
* @see islandora_get_viewers()
* @see islandora_get_viewer_callback()
*/
function hook_islandora_viewer_info() {}

168
islandora.module

@ -223,6 +223,84 @@ function islandora_admin_paths() {
return $paths; return $paths;
} }
/**
* Implements hook_theme().
*
* @return array
*/
function islandora_theme() {
return array(
// default object template
'islandora_default' => array(
'file' => 'theme/islandora.theme.inc',
'template' => 'theme/islandora-object',
'variables' => array('islandora_object' => NULL),
),
// default edit page
'islandora_default_edit' => array(
'file' => 'theme/islandora.theme.inc',
'template' => 'theme/islandora-object-edit',
'variables' => array('islandora_object' => NULL),
),
// admin table for solution pack viewer selection
'islandora_viewers_table' => array(
'file' => 'includes/solution_packs.inc',
'render element' => 'form',
),
);
}
/**
* Implements hook_permission().
*
* @return array
*/
function islandora_permission() {
return array(
FEDORA_VIEW => array(
'title' => t('View repository objects and datastreams'),
'description' => t('View objects in the repository and their associated datastreams. Note: Fedora XACML security policies may override this permission.')
),
FEDORA_ADD_DS => array(
'title' => t('Add datastreams to repository objects'),
'description' => t('Add datastreams to objects in the repository. Note: Fedora XACML security policies may override this position.')
),
FEDORA_METADATA_EDIT => array(
'title' => t('Edit metadata'),
'description' => t('Edit metadata for objects in the repository.')
),
FEDORA_INGEST => array(
'title' => t('Create new repository objects'),
'description' => t('Create new objects in the repository.')
),
FEDORA_PURGE => array(
'title' => t('Permanently remove objects from the repository'),
'description' => t('Permanently remove objects from the repository.')
),
FEDORA_MODIFY_STATE => array(
'title' => t('Change repository object states'),
'description' => t('Change the state of objects in the repository (e.g. from Active to Inactive).')
),
FEDORA_MANAGE => array(
'title' => t('View object management tabs'),
'description' => t('View tabs that provide object management functions.')
)
);
}
/**
* Implements hook_forms().
*/
function islandora_forms($form_id) {
$forms = array();
if (strpos($form_id, 'islandora_solution_pack_form_') !== FALSE) {
$forms[$form_id] = array(
'callback' => 'islandora_solution_pack_form',
);
}
return $forms;
}
/** /**
* determines whether we can see the object or not * determines whether we can see the object or not
* checks PID namespace permissions, and user permissions * checks PID namespace permissions, and user permissions
@ -237,9 +315,9 @@ function islandora_access_callback($object = NULL, $perm = NULL) {
return FALSE; return FALSE;
} }
$isRestricted = variable_get('islandora_namespace_restriction_enforced', FALSE); $is_restricted = variable_get('islandora_namespace_restriction_enforced', FALSE);
if (!$isRestricted) { if (!$is_restricted) {
$namespace_access = TRUE; $namespace_access = TRUE;
} }
else { else {
@ -251,25 +329,6 @@ function islandora_access_callback($object = NULL, $perm = NULL) {
return ($namespace_access && user_access($perm)); return ($namespace_access && user_access($perm));
} }
function islandora_init() {
if (path_is_admin(current_path())) {
drupal_add_css(drupal_get_path('module', 'islandora') . '/css/islandora.admin.css');
}
}
/**
* Implements hook_forms().
*/
function islandora_forms($form_id) {
$forms = array();
if (strpos($form_id, 'islandora_solution_pack_form_') !== FALSE) {
$forms[$form_id] = array(
'callback' => 'islandora_solution_pack_form',
);
}
return $forms;
}
/** /**
* a function to call other modules edit page. If there are not any modules * a function to call other modules edit page. If there are not any modules
* that handle this function this module will build a default page. * that handle this function this module will build a default page.
@ -408,71 +467,6 @@ function islandora_default_islandora_view_object($object) {
return array('Default output' => $output); return array('Default output' => $output);
} }
/**
* Implements hook_theme().
*
* @return array
*/
function islandora_theme() {
return array(
// default object template
'islandora_default' => array(
'file' => 'theme/islandora.theme.inc',
'template' => 'theme/islandora-object',
'variables' => array('islandora_object' => NULL),
),
// default edit page
'islandora_default_edit' => array(
'file' => 'theme/islandora.theme.inc',
'template' => 'theme/islandora-object-edit',
'variables' => array('islandora_object' => NULL),
),
// admin table for solution pack viewer selection
'islandora_viewers_table' => array(
'file' => 'includes/solution_packs.inc',
'render element' => 'form',
),
);
}
/**
* Implements hook_permission().
*
* @return array
*/
function islandora_permission() {
return array(
FEDORA_VIEW => array(
'title' => t('View repository objects and datastreams'),
'description' => t('View objects in the repository and their associated datastreams. Note: Fedora XACML security policies may override this permission.')
),
FEDORA_ADD_DS => array(
'title' => t('Add datastreams to repository objects'),
'description' => t('Add datastreams to objects in the repository. Note: Fedora XACML security policies may override this position.')
),
FEDORA_METADATA_EDIT => array(
'title' => t('Edit metadata'),
'description' => t('Edit metadata for objects in the repository.')
),
FEDORA_INGEST => array(
'title' => t('Create new repository objects'),
'description' => t('Create new objects in the repository.')
),
FEDORA_PURGE => array(
'title' => t('Permanently remove objects from the repository'),
'description' => t('Permanently remove objects from the repository.')
),
FEDORA_MODIFY_STATE => array(
'title' => t('Change repository object states'),
'description' => t('Change the state of objects in the repository (e.g. from Active to Inactive).')
),
FEDORA_MANAGE => array(
'title' => t('View object management tabs'),
'description' => t('View tabs that provide object management functions.')
)
);
}
/** /**
* A helper function to get a connection and return an object * A helper function to get a connection and return an object
* *
@ -608,10 +602,8 @@ function islandora_get_islandora_datastream_version($item = NULL, $dsid = NULL,
* Implements hook_islandora_required_objects(). * Implements hook_islandora_required_objects().
*/ */
function islandora_islandora_required_objects() { function islandora_islandora_required_objects() {
// module path // module path
$module_path = drupal_get_path('module', 'islandora'); $module_path = drupal_get_path('module', 'islandora');
return array( return array(
'islandora' => array( 'islandora' => array(
'title' => 'Islandora', 'title' => 'Islandora',

Loading…
Cancel
Save