-
Notifications
You must be signed in to change notification settings - Fork 47
/
manage_issue.inc
41 lines (38 loc) · 1.22 KB
/
manage_issue.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* @file
* Provides the management interface for Newspaper Issue objects.
*/
require_once dirname(__FILE__) . '/utilities.inc';
/**
* Local menu action, that gets the ingest page form.
*
* @param AbstractObject $issue
* The newspaper to ingest into.
*
* @return string
* The HTML repersentation of the ingest page form.
*
* @global $user
*/
function islandora_newspaper_ingest_page(AbstractObject $issue) {
global $user;
module_load_include('inc', 'islandora', 'includes/utilities');
module_load_include('inc', 'islandora', 'includes/ingest.form');
$tuque = islandora_get_tuque_connection();
$page = $tuque->repository->constructObject(islandora_get_namespace($issue->id));
$page->owner = $user->name;
$page->label = 'New Page';
$page->models = 'islandora:newspaperPageCModel';
$newspaper = islandora_object_load(islandora_newspaper_get_newspaper($issue));
drupal_set_title(t('Add page to @newspaper issue @issue', array(
'@newspaper' => $newspaper->label,
'@issue' => $issue->label,
)));
return drupal_get_form('islandora_ingest_form', array(
'models' => array('islandora:newspaperPageCModel'),
'issue' => $issue,
'objects' => array($page),
'parent' => $issue->id,
));
}