From 6f4b4cd6f0ca9d3fc865dfc9795c27f7a006b869 Mon Sep 17 00:00:00 2001
From: rwincewicz <richard.wincewicz@googlemail.com>
Date: Fri, 18 May 2012 08:37:54 -0300
Subject: [PATCH] Updated 7.x

---
 admin/islandora.admin.inc |  12 ++--
 islandora.module          | 137 +++++++++++++++++++-------------------
 2 files changed, 75 insertions(+), 74 deletions(-)

diff --git a/admin/islandora.admin.inc b/admin/islandora.admin.inc
index 8e06fddf..ab92166d 100644
--- a/admin/islandora.admin.inc
+++ b/admin/islandora.admin.inc
@@ -1,9 +1,11 @@
 <?php
 
 /**
-   * Create admin form
-   * @return array 
-   */
+ * @file islandora.admin.inc
+ * Create admin form
+ * @return array 
+ */
+
   function islandora_repository_admin() {
     if (!user_access('administer site configuration')) {
       drupal_set_message(t('You must be a site administrator to edit the Fedora collections list.'), 'error');
@@ -139,6 +141,4 @@
 
 
     return system_settings_form($form);
-  }
-
-?>
+  }
\ No newline at end of file
diff --git a/islandora.module b/islandora.module
index 0ab0e152..2f014679 100644
--- a/islandora.module
+++ b/islandora.module
@@ -38,8 +38,8 @@ function islandora_menu() {
   $items = array();
 
   $items['admin/settings/islandora'] = array(
-    'title' => t('Islandora Configuration'),
-    'description' => t("Configure Islandora's interaction with Fedora"),
+    'title' => 'Islandora Configuration',
+    'description' => "Configure Islandora's interaction with Fedora",
     'page callback' => 'drupal_get_form',
     'page arguments' => array('islandora_repository_admin'),
     'file' => 'admin/islandora.admin.inc',
@@ -47,23 +47,24 @@ function islandora_menu() {
     'type' => MENU_NORMAL_ITEM,
   );
   $items['admin/settings/islandora/collection'] = array(
-    'title' => t('Islandora Configuration'),
-    'description' => t('Enter the Islandora collection information here.'),
+    'title' => 'Islandora Configuration',
+    'description' => 'Enter the Islandora collection information here.',
     'access arguments' => array('administer site configuration'),
     'type' => MENU_DEFAULT_LOCAL_TASK,
     'weight' => 0,
   );
 
   $items['admin/settings/islandora/demoobjects'] = array(
-    'title' => t('Solution Packs'),
-    'description' => t('Install content models and collections required by installed solution packs.'),
+    'title' => 'Solution Packs',
+    'description' => 'Install content models and collections required by installed solution packs.',
     'page callback' => 'islandora_solution_packs_page',
     'access arguments' => array(FEDORA_ADD_DS),
     'file' => 'admin/islandora.solutionpacks.inc',
     'type' => MENU_LOCAL_TASK,
   );
+  
   $items['islandoracm.xsd'] = array(
-    'title' => t('Islandora Content Model XML Schema Definition'),
+    'title' => 'Islandora Content Model XML Schema Definition',
     'page callback' => 'islandora_display_schema',
     'page arguments' => array('islandoracm.xsd'),
     'type' => MENU_CALLBACK,
@@ -71,13 +72,20 @@ function islandora_menu() {
   );
 
   $items['collection_policy.xsd'] = array(
-    'title' => t('Islandora Content Model XML Schema Definition'),
+    'title' => 'Islandora Content Model XML Schema Definition',
     'page callback' => 'islandora_display_schema',
     'page arguments' => array('collection_policy.xsd'),
     'type' => MENU_CALLBACK,
     'access arguments' => array(FEDORA_VIEW),
   );
 
+  $items['islandora/ingest'] = array(
+    'title' => 'Ingest object',
+    'page callback' => 'islandora_ingest_object',
+    'type' => MENU_CALLBACK,
+    'access arguments' => array(FEDORA_INGEST)
+  );
+  
   $items['islandora/object/%'] = array(
     'title' => 'Repository',
     'page callback' => 'islandora_view_object',
@@ -85,72 +93,67 @@ function islandora_menu() {
     'type' => MENU_NORMAL_ITEM,
     'access arguments' => array(FEDORA_VIEW),
   );
-
-  /* $items['fedora/repository/service'] = array(
-    'page callback' => 'repository_service',
-    'type' => MENU_CALLBACK,
+  
+  $items['islandora/object/%/view'] = array(
+    'title' => 'Repository',
+    'page callback' => 'islandora_view_object',
+    'page arguments' => array(2),
+    'type' => MENU_NORMAL_ITEM,
     'access arguments' => array(FEDORA_VIEW),
-    ); */
-
-  $items['islandora/object/%/datastream/%/download'] = array(
-    'title' => t('Download object'),
-    'page callback' => 'islandora_object_as_attachment',
-    'page arguments' => array(2, 4),
-    'type' => MENU_CALLBACK,
-    'access arguments' => array(FEDORA_VIEW)
   );
-
-  /* $items['fedora/repository/editmetadata'] = array(
-    'title' => t('Edit metadata'),
-    'page callback' => 'fedora_repository_edit_qdc_page',
-    'type' => MENU_CALLBACK,
-    'access arguments' => array('edit fedora meta data')
-    ); */
-
-  $items['islandora/object/%/datastream/%/purge'] = array(
-    'title' => t('Purge data stream'),
-    'page callback' => 'islandora_purge_stream',
-    'page arguments' => array(2, 4),
-    'type' => MENU_CALLBACK,
-    'access arguments' => array(FEDORA_PURGE)
+ 
+  $items['islandora/object/%/edit'] = array(
+    'title' => 'Repository',
+    'page callback' => 'islandora_edit_object',
+    'page arguments' => array(2),
+    'type' => MENU_NORMAL_ITEM,
+    'access arguments' => array(FEDORA_MODIFY_STATE),
   );
-
-  /* $items['fedora/repository/replaceStream'] = array(
-    'title' => t('Replace Stream'),
-    'page callback' => 'fedora_repository_replace_stream',
-    'type' => MENU_CALLBACK,
-    'access arguments' => array('add fedora datastreams'),
-    ); */
-
+    
   $items['islandora/object/%/purge'] = array(
-    'title' => t('Purge object'),
+    'title' => 'Purge object',
     'page callback' => 'islandora_purge_object',
     'type' => MENU_CALLBACK,
-    'access arguments' => array(FEDORA_PURGE)
+    'access arguments' => array(FEDORA_PURGE),
   );
 
   $items['islandora/object/%/datastream/%/add'] = array(
-    'title' => t('Add stream'),
+    'title' => 'Add stream',
     'page callback' => 'islandora_add_stream',
     'type' => MENU_CALLBACK,
     'access arguments' => array(FEDORA_ADD_DS)
   );
-
-  /* $items['fedora/repository/collection'] = array(
-    'title' => t('Collection view'),
-    'page callback' => 'fedora_collection_view',
+  
+  $items['islandora/object/%/datastream/%/download'] = array(
+    'title' => 'Download datastream',
+    'page callback' => 'islandora_datastream_as_attachment',
+    'page arguments' => array(2, 4),
     'type' => MENU_CALLBACK,
-    'access argruments' => array('view fedora collection'),
-    ); */
-
-  //new for mnpl******************************************
-
+    'access arguments' => array(FEDORA_VIEW),
+  );
 
-  $items['islandora/object/ingest'] = array(
-    'title' => t('Ingest object'),
-    'page callback' => 'islandora_ingest_object',
+  $items['islandora/object/%/datastream/%/view'] = array(
+    'title' => 'Download datastream',
+    'page callback' => 'islandora_datastream_as_attachment',
+    'page arguments' => array(2, 4),
     'type' => MENU_CALLBACK,
-    'access arguments' => array(FEDORA_INGEST)
+    'access arguments' => array(FEDORA_VIEW),
+  );
+  
+  $items['islandora/object/%/datastream/%/edit'] = array(
+    'title' => 'Edit datastream',
+    'page callback' => 'islandora_edit_stream',
+    'page arguments' => array(2, 4),
+    'type' => MENU_CALLBACK,
+    'access arguments' => array(FEDORA_METADATA_EDIT),
+  );
+    
+  $items['islandora/object/%/datastream/%/purge'] = array(
+    'title' => 'Purge data stream',
+    'page callback' => 'islandora_purge_stream',
+    'page arguments' => array(2, 4),
+    'type' => MENU_CALLBACK,
+    'access arguments' => array(FEDORA_PURGE),
   );
 
   return $items;
@@ -194,12 +197,12 @@ function islandora_node_access($op, $pid = NULL, $as_user = NULL) {
  */
 function islandora_purge_object($object_id) {
   if (!isset($object_id)) {
-    drupal_set_message('Cannot remove object, object id not set');
+    drupal_set_message(t('Cannot remove object, object id not set'));
     return;
   }
   $object = new Object($object_id);
   if (!isset($object)) {
-    drupal_set_message('Could not remove object, object not found');
+    drupal_set_message(t('Could not remove object, object not found'));
     return;
   }
   module_invoke_all('islandora_purge_object', $object); //notify modules of pending deletion
@@ -221,12 +224,12 @@ function islandora_get_types() {
  */
 function islandora_purge_datastream($object_id, $datastream_id) {
   if (!isset($datastream_id)) {
-    drupal_set_message('Cannot remove datastream, datastream id not set');
+    drupal_set_message(t('Cannot remove datastream, datastream id not set'));
     return;
   }
   $object = new Object($object_id);
   if (!isset($object)) {
-    drupal_set_message('Could not remove object, object not found');
+    drupal_set_message(t('Could not remove object, object not found'));
     return;
   }
   module_invoke_all('islandora_purge_datastream', $datastream); //notify modules of pending deletion so we can update rels etc
@@ -243,7 +246,7 @@ function islandora_purge_datastream($object_id, $datastream_id) {
 function islandora_view_object($object_id) {
   //return $object_id;
   if (!isset($object_id)) {
-    drupal_set_message('Cannot view object, object id not set');
+    drupal_set_message(t('Cannot view object, object id not set'));
     return;
   }
 
@@ -257,7 +260,7 @@ function islandora_view_object($object_id) {
     $restConnection = new RestConnection($user);
     $fedora_object = new FedoraObject($object_id, $restConnection->repository);
   } catch (Exception $e) {
-    drupal_set_message(t('Error getting Islandora object %s',array('%s' => $object_id)), 'error');
+    drupal_set_message(t('Error getting Islandora object %s', array('%s' => $object_id)), 'error');
     return"";
   }
   drupal_alter('islandora_view_object', $fedora_object); //modify object if required before it is passed along
@@ -311,17 +314,15 @@ function islandora_permission() {
  */
 function islandora_add_datastream($object_id) {
   if (!isset($object_id)) {
-    drupal_set_message('Cannot add datastream to object, object id not set');
+    drupal_set_message(t('Cannot add datastream to object, object id not set'));
     return;
   }
   //send message to synapse
   $object = new IslandoraObject($object_id);
 
   if (!isset($object)) {
-    drupal_set_message('Could not remove object, object not found');
+    drupal_set_message(t('Could not remove object, object not found'));
     return;
   }
   module_invoke_all('islandora_add_datastream', $object); //allow submodules to handle add datastream based on object type
 }
-
-?>
\ No newline at end of file