Browse Source

added default edit template and default css files

pull/109/merge
Paul Pound 13 years ago
parent
commit
df620d3464
  1. 9
      css/islandora.admin.css
  2. 8
      css/islandora.base.css
  3. 8
      css/islandora.theme.css
  4. 59
      islandora-object-edit.tpl.php
  5. 55
      islandora.module
  6. 9
      islandora_basic_collection/css/islandora_basic_collection.admin.css
  7. 8
      islandora_basic_collection/css/islandora_basic_collection.base.css
  8. 9
      islandora_basic_collection/css/islandora_basic_collection.theme.css
  9. 12
      islandora_basic_image/css/islandora_basic_image.admin.css
  10. 8
      islandora_basic_image/css/islandora_basic_image.base.css
  11. 8
      islandora_basic_image/css/islandora_basic_image.theme.css

9
css/islandora.admin.css

@ -0,0 +1,9 @@
/*
Document : islandora_basic_collection.admin.css
Created on : May 23, 2012, 11:23:06 AM
Description:
Purpose of the stylesheet follows.
*/

8
css/islandora.base.css

@ -0,0 +1,8 @@
/*
Document : islandora_basic_collection.base.css
Created on : May 23, 2012, 11:22:04 AM
Description:
Purpose of the stylesheet follows.
*/

8
css/islandora.theme.css

@ -0,0 +1,8 @@
/*
Document : islandora_basic_collection.theme
Created on : May 23, 2012, 11:23:56 AM
Description:
Purpose of the stylesheet follows.
*/

59
islandora-object-edit.tpl.php

@ -0,0 +1,59 @@
<?php
/*
* islandora-object.tpl.php
*
*
*
* This file is part of Islandora.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program. If not, see <http ://www.gnu.org/licenses/>.
*/
?>
<?php
/*
* this is a template for objects that do not have a module to registered to build their display.
*
* islandora_object is a fedora tuque Object
* $object->label
* $object->id
* to get the contents of a datastream
* $object['dsid']->content
*
* $dublin_core is a Dublin_Core object
* which is an array of elements, such as dc.title
* and each element has an array of values. dc.title can have none, one or many titles
* this is the case for all dc elements.
*
* we can get a list of datastreams by doing
* foreach ($object as $ds){
* do something here
* }
*
*/
//dsm($object);
drupal_set_title($islandora_object->label);
print($islandora_object->label . ' ' . $islandora_object->id);
print('this is the edit template');
print ('<h3>datastreams</h3>');
foreach ($islandora_object as $ds) {
print $ds->label . '<br>';
//do something
}
?>

55
islandora.module

@ -104,18 +104,18 @@ function islandora_menu() {
); );
$items['islandora/object/%/view'] = array( $items['islandora/object/%/view'] = array(
'title' => 'Repository', 'title' => 'View',
'page callback' => 'islandora_view_object', 'page callback' => 'islandora_view_object',
'page arguments' => array(2), 'page arguments' => array(2),
'type' => MENU_NORMAL_ITEM, 'type' => MENU_DEFAULT_LOCAL_TASK,
'access arguments' => array(FEDORA_VIEW), 'access arguments' => array(FEDORA_VIEW),
); );
$items['islandora/object/%/edit'] = array( $items['islandora/object/%/edit'] = array(
'title' => 'Repository', 'title' => 'Edit',
'page callback' => 'islandora_edit_object', 'page callback' => 'islandora_edit_object',
'page arguments' => array(2), 'page arguments' => array(2),
'type' => MENU_NORMAL_ITEM, 'type' => MENU_LOCAL_TASK,
'access arguments' => array(FEDORA_MODIFY_STATE), 'access arguments' => array(FEDORA_MODIFY_STATE),
); );
@ -230,6 +230,44 @@ function islandora_get_types() {
return module_invoke_all('islandora_get_types'); return module_invoke_all('islandora_get_types');
} }
/**
* 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.
* @global object $user
* @param string $object_id
* @return string
*/
function islandora_edit_object($object_id) {
module_load_include('inc', 'islandora', 'RestConnection');
global $user;
try {
$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');
return"";
}
drupal_alter('islandora_edit_object', $fedora_object);
$arr = module_invoke_all('islandora_edit_object', $fedora_object);
$output = "";
foreach ($arr as $key => $value) {
$output .= $key . '<br />' . $value; //if we have multiple modules handle one cmodel we need to iterate over multiple
}
//we could do another module invoke all here to build the edit tab with a default implemented in this module?
return $output;
}
/**
* builds a default page for the edit tab
* @param object $fedora_object
* A tuque Fedora Object
*/
function islandora_islandora_edit_object($fedora_object){
$output = theme('islandora_default_edit', array('islandora_object' => $fedora_object));
return array ('Default Edit output' => $output);
}
/** /**
* *
* @paramstring $datastream_id * @paramstring $datastream_id
@ -318,6 +356,10 @@ function islandora_theme() {
'template' => 'islandora-object', 'template' => 'islandora-object',
'variables' => array('islandora_object' => NULL), 'variables' => array('islandora_object' => NULL),
), ),
'islandora_default_edit' => array(
'template' => 'islandora-object-edit',
'variables' => array('islandora_object' => NULL),
),
); );
} }
@ -390,4 +432,9 @@ function islandora_preprocess_islandora_default(&$variables) {
if (isset($islandora_object['TN'])) { if (isset($islandora_object['TN'])) {
$variables['islandora_thumbnail_url'] = $base_url . '/islandora/object/' . $islandora_object->id . '/datastream/TN/view'; $variables['islandora_thumbnail_url'] = $base_url . '/islandora/object/' . $islandora_object->id . '/datastream/TN/view';
} }
}
function islandora_preprocess_islandora_default_edit(&$variables){
//$islandora_object = $variables['islandora_object'];
} }

9
islandora_basic_collection/css/islandora_basic_collection.admin.css

@ -0,0 +1,9 @@
/*
Document : islandora_basic_collection.admin.css
Created on : May 23, 2012, 11:23:06 AM
Description:
Purpose of the stylesheet follows.
*/

8
islandora_basic_collection/css/islandora_basic_collection.base.css

@ -0,0 +1,8 @@
/*
Document : islandora_basic_collection.base.css
Created on : May 23, 2012, 11:22:04 AM
Description:
Purpose of the stylesheet follows.
*/

9
islandora_basic_collection/css/islandora_basic_collection.theme.css

@ -0,0 +1,9 @@
/*
Document : islandora_basic_collection.theme
Created on : May 23, 2012, 11:23:56 AM
Description:
Purpose of the stylesheet follows.
*/

12
islandora_basic_image/css/islandora_basic_image.admin.css

@ -0,0 +1,12 @@
/*
Document : islandora_basic_collection.admin.css
Created on : May 23, 2012, 11:23:06 AM
Author : ppound
Description:
Purpose of the stylesheet follows.
*/
root {
display: block;
}

8
islandora_basic_image/css/islandora_basic_image.base.css

@ -0,0 +1,8 @@
/*
Document : islandora_basic_collection.base.css
Created on : May 23, 2012, 11:22:04 AM
Description:
Purpose of the stylesheet follows.
*/

8
islandora_basic_image/css/islandora_basic_image.theme.css

@ -0,0 +1,8 @@
/*
Document : islandora_basic_collection.theme
Created on : May 23, 2012, 11:23:56 AM
Description:
Purpose of the stylesheet follows.
*/
Loading…
Cancel
Save