|
|
|
@ -22,7 +22,6 @@
|
|
|
|
|
* You should have received a copy of the GNU General Public License |
|
|
|
|
* along with the program. If not, see <http ://www.gnu.org/licenses/>. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
// Common datastreams. |
|
|
|
|
define('ISLANDORA_DS_COMP_STREAM', 'DS-COMPOSITE-MODEL'); |
|
|
|
|
|
|
|
|
@ -459,7 +458,8 @@ function islandora_theme() {
|
|
|
|
|
'variables' => array( |
|
|
|
|
'object' => NULL, |
|
|
|
|
'content' => NULL, |
|
|
|
|
'islandora_content' => NULL), |
|
|
|
|
'islandora_content' => NULL, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
// Render a bunch of objects as either a grid or a list. |
|
|
|
|
'islandora_objects' => array( |
|
|
|
@ -562,6 +562,12 @@ function islandora_theme() {
|
|
|
|
|
'file' => 'includes/solution_packs.inc', |
|
|
|
|
'render element' => 'form', |
|
|
|
|
), |
|
|
|
|
// Overview for manage tab |
|
|
|
|
'islandora_object_overview' => array( |
|
|
|
|
'file' => 'theme/theme.inc', |
|
|
|
|
'template' => 'theme/islandora-object-overview', |
|
|
|
|
'variables' => array('islandora_object' => NULL), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -743,7 +749,7 @@ function islandora_forms($form_id) {
|
|
|
|
|
* TRUE if the user is allowed to access this object/datastream, FALSE |
|
|
|
|
* otherwise. |
|
|
|
|
*/ |
|
|
|
|
function islandora_user_access($object_or_datastream, array $permissions, $content_models = array(), $access_any = TRUE, $user = NULL) { |
|
|
|
|
function islandora_user_access($object_or_datastream, array$permissions, $content_models = array(), $access_any = TRUE, $user = NULL) { |
|
|
|
|
|
|
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
|
$is_repository_accessible = &drupal_static(__FUNCTION__); |
|
|
|
@ -919,40 +925,21 @@ function islandora_object_manage_access_callback($perms, $object = NULL) {
|
|
|
|
|
*/ |
|
|
|
|
function islandora_manage_overview_object(AbstractObject $object) { |
|
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
|
$output = array(); |
|
|
|
|
$output = islandora_create_manage_overview($object); |
|
|
|
|
$hooks = islandora_build_hook_list(ISLANDORA_OVERVIEW_HOOK, $object->models); |
|
|
|
|
foreach ($hooks as $hook) { |
|
|
|
|
$temp = module_invoke_all($hook, $object); |
|
|
|
|
islandora_as_renderable_array($temp); |
|
|
|
|
if (!empty($temp)) { |
|
|
|
|
arsort($temp); |
|
|
|
|
$output = array_merge_recursive($output, $temp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (empty($output)) { |
|
|
|
|
// Add in the default, if we did not get any results. |
|
|
|
|
$output = islandora_default_islandora_manage_overview_object($object); |
|
|
|
|
} |
|
|
|
|
arsort($output); |
|
|
|
|
drupal_alter($hooks, $object, $output); |
|
|
|
|
islandora_as_renderable_array($output); |
|
|
|
|
return $output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Renders the default manage object page for the given object. |
|
|
|
|
* |
|
|
|
|
* @param AbstractObject $object |
|
|
|
|
* The object used to render the manage object page. |
|
|
|
|
* |
|
|
|
|
* @return array |
|
|
|
|
* The default rendering of the object manage page, indexed at |
|
|
|
|
* 'Default Edit output'. |
|
|
|
|
*/ |
|
|
|
|
function islandora_default_islandora_manage_overview_object(AbstractObject $object) { |
|
|
|
|
$output = theme('islandora_default_overview', array('islandora_object' => $object)); |
|
|
|
|
return array('Default overview output' => array('#markup' => $output)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Renders the given objects manage page. |
|
|
|
|
* |
|
|
|
@ -1819,7 +1806,6 @@ function islandora_islandora_object_purged($pid) {
|
|
|
|
|
islandora_conditionally_clear_cache(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Implements hook_islandora_datastream_purged(). |
|
|
|
|
*/ |
|
|
|
@ -2174,27 +2160,7 @@ function islandora_islandora_get_breadcrumb_query_predicates(AbstractObject $obj
|
|
|
|
|
/** |
|
|
|
|
* Implements hook_islandora_overview_object(). |
|
|
|
|
*/ |
|
|
|
|
function islandora_islandora_overview_object(AbstractObject $object) { |
|
|
|
|
$cmodels = $object->models; |
|
|
|
|
$rows = array(); |
|
|
|
|
foreach ($cmodels as $cmodel) { |
|
|
|
|
if ($cmodel != 'fedora-system:FedoraObject-3.0') { |
|
|
|
|
$o = islandora_object_load($cmodel); |
|
|
|
|
if (is_object($o)) { |
|
|
|
|
$rows[] = array(l($o->label, "islandora/object/{$o->id}")); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$rows[] = array(t("@cmodel - (This content model is not in this Islandora repository.)", array('@cmodel' => $cmodel))); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$header = format_plural(count($rows), 'Content Model', 'Content Models'); |
|
|
|
|
$table = array( |
|
|
|
|
'#type' => 'markup', |
|
|
|
|
'#theme' => 'table', |
|
|
|
|
'#header' => array($header), |
|
|
|
|
'#rows' => $rows, |
|
|
|
|
'#empty' => t('No Islandora content model associated with this object.'), |
|
|
|
|
); |
|
|
|
|
return array('cmodels' => $table); |
|
|
|
|
function islandora_create_manage_overview(AbstractObject $object) { |
|
|
|
|
$output = theme('islandora_object_overview', array('islandora_object' => $object)); |
|
|
|
|
return array('cmodels' => $output); |
|
|
|
|
} |
|
|
|
|