From cfae7317a31ec1fcb63707f1656c3f35c6657fab Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 13:26:41 -0300 Subject: [PATCH] Deleted fedora attach, newspaper and pidfield --- plugins/fedora_attach/fedora_attach.admin.inc | 36 -- plugins/fedora_attach/fedora_attach.info | 8 - plugins/fedora_attach/fedora_attach.install | 14 - plugins/fedora_attach/fedora_attach.module | 487 ------------------ .../Crystal_Clear_mimetype_document.png | Bin 4847 -> 0 bytes plugins/islandora_newspaper/Newspaper.inc | 177 ------- .../islandora_newspaper.info | 7 - .../islandora_newspaper.module | 63 --- .../newspapers_collection_policy.xml | 22 - .../newspapers_guardian.xml | 379 -------------- .../newspapers_issueCModel_islandoracm.xml | 25 - .../newspapers_pageCModel.xml | 149 ------ .../newspapers_viewerSdep-issueCModel.xml | 241 --------- .../newspapers_viewerSdep-pageCModel.xml | 217 -------- plugins/pidfield/pidfield.info | 8 - plugins/pidfield/pidfield.install | 40 -- plugins/pidfield/pidfield.module | 459 ----------------- 17 files changed, 2332 deletions(-) delete mode 100644 plugins/fedora_attach/fedora_attach.admin.inc delete mode 100644 plugins/fedora_attach/fedora_attach.info delete mode 100644 plugins/fedora_attach/fedora_attach.install delete mode 100644 plugins/fedora_attach/fedora_attach.module delete mode 100644 plugins/islandora_newspaper/Crystal_Clear_mimetype_document.png delete mode 100644 plugins/islandora_newspaper/Newspaper.inc delete mode 100644 plugins/islandora_newspaper/islandora_newspaper.info delete mode 100644 plugins/islandora_newspaper/islandora_newspaper.module delete mode 100644 plugins/islandora_newspaper/newspapers_collection_policy.xml delete mode 100644 plugins/islandora_newspaper/newspapers_guardian.xml delete mode 100644 plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml delete mode 100644 plugins/islandora_newspaper/newspapers_pageCModel.xml delete mode 100644 plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml delete mode 100644 plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml delete mode 100644 plugins/pidfield/pidfield.info delete mode 100644 plugins/pidfield/pidfield.install delete mode 100644 plugins/pidfield/pidfield.module diff --git a/plugins/fedora_attach/fedora_attach.admin.inc b/plugins/fedora_attach/fedora_attach.admin.inc deleted file mode 100644 index 5dbd3a57..00000000 --- a/plugins/fedora_attach/fedora_attach.admin.inc +++ /dev/null @@ -1,36 +0,0 @@ - 'select', - '#title' => t('Fedora Attach PID namespace'), - '#options' => $options, - '#default_value' => $default_value, - '#description' => t('The PID namespace into which the Fedora Attach module will ingest objects.'), - ); - return (system_settings_form($form)); -} - diff --git a/plugins/fedora_attach/fedora_attach.info b/plugins/fedora_attach/fedora_attach.info deleted file mode 100644 index fc1c2aa7..00000000 --- a/plugins/fedora_attach/fedora_attach.info +++ /dev/null @@ -1,8 +0,0 @@ -; $Id$ -name = Fedora Attach -description = Allows users to attach files to node content which then get ingested into Fedora. -package = Fedora Repository -dependencies[] = fedora_repository -dependencies[] = upload -version = 6.1dev -core = 6.x diff --git a/plugins/fedora_attach/fedora_attach.install b/plugins/fedora_attach/fedora_attach.install deleted file mode 100644 index 15a28628..00000000 --- a/plugins/fedora_attach/fedora_attach.install +++ /dev/null @@ -1,14 +0,0 @@ -files)) { - foreach ($node->files as $fid => $file) { - $file = (object) $file; // Convert file to object type for compatibility. - $fid = $file->fid; // For the cases where we have temp fid for uplaoded files. - $success = FALSE; - $filepath = $file->filepath; // Need copy if file_move fails. - $public = file_directory_path(); - - $file_is_ingested = _fedora_attach_is_file_in_repository($filepath); - if (!empty($file->ingested) && !$file_is_ingested) { - // Attach flag is set, but file is not listed as being in the repository. - // so try and ingest it now. - if (user_access('select file access by role')) { - $roles = array(); - if (!empty($file->roles)) { - foreach ($file->roles as $rolename => $rolevalue) { - if (!empty($rolevalue)) { - array_push($roles, $rolevalue); - } - } - } - // if (!empty($roles)) { - // Generate the security policy datastream. - $policy_stream = _fedora_attach_create_policy($roles); - // } - } - try { - $pid_namespace = variable_get('fedora_attach_pid_namespace', 'default:'); - $pid_namespace = substr($pid_namespace, 0, strpos($pid_namespace, ":")); - $pid = fedora_item::get_next_PID_in_namespace($pid_namespace); - $new_item = fedora_item::ingest_new_item($pid, 'A', $file->description); // PID will be generated using getNextPID - if (empty($new_item->objectProfile)) { - drupal_set_message("Unable to create fedora object. Check Watchdog log for details.", "error"); - $success = FALSE; - } - else { - if (user_access('select file access by role')) { - $new_item->add_datastream_from_string($policy_stream, 'POLICY', "Security Policy", "text/xml", "X"); - } - $new_item->add_datastream_from_file($file->filepath, 'OBJ', $file->filename, $file->filemime, 'M'); - $new_item->add_relationship("hasModel", "islandora:genericCModel", FEDORA_MODEL_URI); - module_load_include('inc', 'fedora_repository', 'api/dublin_core'); - $dc = new Dublin_Core(); - $dc->add_element('dc:title', $file->description); - $dc->add_element('dc:identifier', $new_item->pid); - - $new_item->modify_datastream_by_value($dc->as_xml(), 'DC', 'Default Dublin Core Metadata', 'text/xml', 'X'); - - $success = TRUE; - } - } catch (exception $e) { - drupal_set_message(t('An error occurred ingesting the file: ') . $e, 'error'); - $new_item->purge(); - drupal_set_message(t('The item has been removed from the repository')); - } - if ($success) { // We were able to ingest the file, so update the file path. - $new_filepath = '/fedora/repository/' . $new_item->pid . '/OBJ/' . $file->description; - _fedora_attach_update_filepath($new_filepath, $fid); - file_delete($filepath); - } - } - // Convert file to object for compatibility - // Remove file. Process removals first since no further processing - // will be required. - if (!empty($file->remove)) { - - // If the file isn't used by any other revisions warn the user. - $count = db_result(db_query('SELECT COUNT(fid) FROM {upload} WHERE fid = %d', $fid)); - if ($count < 1) { - file_delete($file->filepath); - db_query('DELETE FROM {files} WHERE fid = %d', $fid); - } - - // Remove it from the session in the case of new uploads, - // that you want to disassociate before node submission. - unset($node->files[$fid]); - // Move on, so the removed file won't be added to new revisions. - continue; - } - } - } - } - break; - case 'view': - // ****************************************************** - // *** VIEW - // Re-theme the file attachments table. - // Rebuild the files table and overwrite default. - // Using the rules from upload.module. - if (isset($node->files) && count($node->files) && user_access('view uploaded files') && !$teaser) { - $node->content['files']['#value'] = theme('fedora_attach_attachments', $node->files); - } - break; - } -} - -/** - * Implementation of hook_menu(). - */ -function fedora_attach_menu() { - $items['admin/settings/fedora_repository/attach'] = array( - 'title' => 'Fedora Attach', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('fedora_attach_admin'), - 'access arguments' => array('administer site configuration'), - 'type' => MENU_LOCAL_TASK, - 'file' => 'fedora_attach.admin.inc', - ); - return $items; -} - -function fedora_attach_save(&$node) { - print ("FNARF!"); -} - -/** - * Implements hook_form_alter() - * - * Add a 'add to repository' checkbox to the file attach form. - * - * @param unknown_type $form - * @param unknown_type $form_state - * @param unknown_type $form_id - * Two paths, one for normal submit, one for JavaScript - */ -function fedora_attach_form_alter(&$form, $form_state, $form_id) { - $disabled = TRUE; - global $base_url; - if (isset($form['type'])) { - $node = $form['#node']; - if ($form['type']['#value'] . '_node_form' == $form_id && variable_get("upload_$node->type", TRUE)) { - $form['#submit'][] = 'fedora_attach_form_submit'; - if (!empty($node->files) && is_array($node->files) && count($node->files)) { // Hijack theme function. - $form['attachments']['wrapper']['files']['#theme'] = 'fedora_attach_form'; - $form['#validate']['private_upload_form_validate'] = array(); - foreach ($node->files as $fid => $file) { - - // Add ingest checkbox - if (is_array($file) && isset($file['ingest'])) { // Preview - $default_value = $file['ingest']; - } - else { // Node load - $default_value = _fedora_attach_is_file_in_repository($file->filepath); - $disabled = $default_value; - } - - $form['attachments']['wrapper']['files'][$fid]['ingested'] = array( - '#type' => 'checkbox', - '#default_value' => $default_value, - '#disabled' => $disabled, - ); - $form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $base_url . $file->filepath; - } - if (user_access('select file access by role')) { - _fedora_attach_build_roles_form($form, FALSE); - } - } - } - } - elseif ($form_id == 'upload_js') { - $form['files']['#theme'] = 'fedora_attach_form'; - - foreach ($form['files'] as $fid => $file) { - - if (!_fedora_attach_starts_with($fid, '#')) {// Ignore properties. - if (!empty($_POST['files'][$fid])) { - $ingested = (!empty($_POST['files'][$fid]['ingested']) ? $_POST['files'][$fid]['ingested'] : FALSE); - //$form['files'][$fid]['list']['#default_value'] = (!empty($_POST['files'][$fid]['[$_POST['files'][$fid]['list']; - //$form['files'][$fid]['remove']['#default_value'] = $_POST['files'][$fid]['remove']; - } - else { - $ingested = (variable_get('fedora_attach_default', 'ingested') == 'ingested'); - } - $form['files'][$fid]['ingested'] = array( - '#type' => 'checkbox', - '#default_value' => $ingested, - ); - - $form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $base_url . $file['filepath']; - if (user_access('select file access by role')) { - _fedora_attach_build_roles_form($form, TRUE); - } - } - } - } -} - -/** - * Called to validate the attach form. - * - * @param string $formid - * @param array $form_values - */ -function fedora_attach_form_validate($formid, $form_values) { - if (is_array($form_values['files']) && count($form_values['files'])) { - $file = array_shift($form_values['files']); - if (!isset($file['ingested'])) { - drupal_set_message(t('Fedora Attach cannot find add repository settings.'), 'error'); - // Be sure we are going after core upload module - $upload_weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'upload'")); - $attach_weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'fedora_attach'")); - if ($attach_weight <= $uplaod_weight) { - $new_weight = $upload_weight + 1; - drupal_set_message(t('Adjusting Fedora Attach module\'s weight to') . $new_weight, 'warning'); - db_query("UPDATE {system} SET weight = '%d' WHERE name = 'fedora_attach'", $new_weight); - ; - } - else { - drupal_set_message(t('Please check for modules that conflict with Fedora Attach'), 'error'); - } - } - } -} - -/** - * Fixes edge case: When the node is first being created, the file->private info does not - * get moved automatically into the node. So we need to copy it by hand. - * - * @param array $form - * @param array $form_state - */ -function fedora_attach_form_submit($form, &$form_state) { - global $base_url; - if ($form_state['values'] && $form_state['values']['files']) { - - foreach ($form_state['values']['files'] as $fid => $file) { - if ($file['remove'] && !empty($file['ingested']) && $file['ingested']) { - drupal_set_message("The attachment ${file['filename']} was removed from this node but it will remain in the repository until it is purged it directly."); - } - if (!isset($file->ingested)) { // Newly-inserted file. - if (isset($form['attachments']['wrapper']['files'])) { - // I know it is naughty to look at the $_POST, but I can't find this value anywhere else. - // Seems like it should be in $form_state somewhere. - $ingested = !empty($_POST['files'][$fid]['ingested']); - } - else { - $ingested = (variable_get('fedora_attach_ingested', 'ingested') == 'ingested'); // Submit before attach - } - $form_state['values']['files'][$fid]['ingested'] = $ingested; - } - $form_state['values']['files'][$fid]['roles'] = (!empty($_POST['files']['roles']) ? $_POST['files']['roles'] : array()); - } - } -} - -// ***************************************************************************** -// Theme functions *********************************************************** -// ***************************************************************************** - -/** - * hook_theme = Theme registry - * - * @return array - */ -function fedora_attach_theme() { - return array( - 'fedora_attach_form' => array( - 'arguments' => array('form' => NULL), - ), - 'fedora_attach_attachments' => array( - 'arguments' => array('files' => NULL), - ), - ); -} - -/** - * Based on theme_upload_form_current - * Adds the Ingest checkbox. - * - * @param array $form - */ -function theme_fedora_attach_form(&$form) { - $header = array(t('Delete'), t('List'), t('Add to Repository'), t('Label'), t('Weight'), t('Size'), ''); - drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight'); - - foreach (element_children($form) as $key) { - // Add class to group weight fields for drag and drop. - $form[$key]['weight']['#attributes']['class'] = 'upload-weight'; - - $row = array(); - $row[] = drupal_render($form[$key]['remove']); - $row[] = drupal_render($form[$key]['list']); - $row[] = drupal_render($form[$key]['ingested']); - $row[] = drupal_render($form[$key]['description']); - $row[] = drupal_render($form[$key]['weight']); - $row[] = drupal_render($form[$key]['size']); - $row[] = drupal_render($form[$key]['msg']); - $rows[] = array('data' => $row, 'class' => 'draggable'); - } - $output = theme('table', $header, $rows, array('id' => 'upload-attachments')); - $output .= drupal_render($form); - return $output; -} - -/** - * Displays file attachments in table. - * - * @param array $files - */ -function theme_fedora_attach_attachments($files) { - $header = array(t('Attachment'), t('Size')); - $rows = array(); - if (is_array($files)) { - foreach ($files as $file) { - $file = (object) $file; - if ($file->list && empty($file->remove)) { - $inspect_item = ''; - if (_fedora_attach_is_file_in_repository($file->filepath)) { - $inspect_item = ' ' . theme_image(drupal_get_path('module', 'Fedora_Repository') . '/images/view.gif', '', 'View the item\'s repository page') . ''; - } - $href = _fedora_attach_create_url($file); // this is the changed line - $text = $file->description ? $file->description : $file->filename; - $rows[] = array(l($text, $href) . $inspect_item, format_size($file->filesize)); - } - } - if (count($rows)) { - return theme('table', $header, $rows, array('id' => 'attachments')); - } - } -} - -function _fedora_attach_build_roles_form(&$form, $inside_js = FALSE) { - //$result = db_query("SELECT {name} from {role}"); - global $user; - //while ($role = db_fetch_array($result)) { - foreach ($user->roles as $role) { - if ($role != 'anonymous user') { - $roles[] = $role; - } - } - if (empty($roles)) { - return ''; - } - $new_form_elements = array( - '#type' => 'checkboxes', - '#title' => t('Roles which can view the attached items'), - '#options' => array_combine($roles, $roles), - '#description' => t('This only applies to files which you add to the repository. If no roles are checked the item will be public.'), - ); - - if ($inside_js) { - $form['files']['roles'] = $new_form_elements; - } - else { - $form['attachments']['wrapper']['roles'] = $new_form_elements; - } -// var_dump($form['files']); - //return $output; -} - -function _fedora_attach_create_policy($roles) { - $policy_filename = !empty($roles) ? drupal_get_path('module', 'fedora_repository') . '/policies/viewANDeditbyrole.xml' : drupal_get_path('module', 'fedora_repository') . '/policies/noObjectEditPolicy.xml'; - $policy_document = new DOMDocument(); - $policy_document->load($policy_filename); - $designators = $policy_document->getElementsByTagName("SubjectAttributeDesignator"); - - if (!empty($designators)) { - foreach ($designators as $designator) { - if ($designator->hasAttribute("AttributeId")) { - if ($designator->getAttribute('AttributeId') == 'fedoraRole') { - foreach ($roles as $role) { - //$apply = $designator->nextSibling; - foreach ($designator->parentNode->childNodes as $apply) { - if ($apply->nodeName == "Apply") { - $new_role_node = $policy_document->createElement('AttributeValue', $role); - $new_role_node->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); - $apply->appendChild($new_role_node); - } - } - } - } - elseif ($designator->getAttribute('AttributeId') == 'urn:fedora:names:fedora:2.1:subject:loginId') { - // $apply = $designator->nextSibling; - foreach ($designator->parentNode->childNodes as $apply) { - if ($apply->nodeName == "Apply") { - global $user; - $new_user_node = $policy_document->createElement('AttributeValue', $user->name); - $new_user_node->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); - $apply->appendChild($new_user_node); - } - } - } - } - } - } - return $policy_document->saveXML(); -} - -function fedora_attach_file_download($filepath) { - // Pass through if this isn't a repository item. - if (!strstr($filepath, 'fedora/repository')) { - return; - } - $result = db_query("SELECT DISTINCT(u.nid) FROM {upload} u INNER JOIN {files} f ON u.fid = f.fid " . - "WHERE f.filepath LIKE '%s'", $filepath . '%'); - $has_results = FALSE; - while ($row = db_fetch_array($result)) { - $has_results = TRUE; - $node = node_load($row['nid']); - if (node_access('view', $node)) { - return; // Access is ok as far as we are concerned. - } - } - if ($has_results) { - return -1; - } - else { - return; - } -} - -/** - * Create a URL to a file that changes if the file is in the repository. - * - * @param file object $file - * @return str: the correct URL - */ -function _fedora_attach_create_url($file) { - if (_fedora_attach_is_file_in_repository($file->filepath)) { - $href = $GLOBALS['base_url'] . $file->filepath; - } - else { - $href = file_create_url((strpos($file->fid, 'upload') === FALSE ? $file->filepath : file_create_filename($file->filename, file_create_path()))); - } - return $href; -} - -/** - * Checks if the file path references a file in the repository. - * - * @param string $filepath - * @return boolean - */ -function _fedora_attach_is_file_in_repository($filepath) { - $repository_path = '/fedora/repository'; - $is_in = _fedora_attach_starts_with($filepath, $repository_path); - return $is_in; -} - -function _fedora_attach_starts_with($str, $start) { - if (count($str) == 0) { // Avoid FALSE positives. - return FALSE; - } - return strstr($str, $start) == $str; -} - -/** - * Alters the file's path in the files table to point to the repository datastream. - * - * @param string $filepath - * @param int $fid - */ -function _fedora_attach_update_filepath($filepath, $fid) { - db_query("UPDATE {files} SET filepath = '%s' WHERE fid=%d", $filepath, $fid); -} diff --git a/plugins/islandora_newspaper/Crystal_Clear_mimetype_document.png b/plugins/islandora_newspaper/Crystal_Clear_mimetype_document.png deleted file mode 100644 index f61fec3f64eace89ba6ee95097e3c27205d49f95..0000000000000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wC1NXUH4I@i@P-+=sjcb-@HT31)VQj9}68u%wG)y2XUJK58_f z-U7=#)M(+c$OZHFeM~plE??U3MdXqwrqiMU+;RX6!-zii>o}vlZiWWnVXoc8VK%Lc zI=bQGZ0-f>Y;Y6v`e<~Q(U4>L3w_jRp}vpvz%Y&)933AzLh80Kt_XmQGXaFuCHDaG zmj(WyNiJD7K46P4N8N=I{GH)i|)CA`F|Y8c3MpUZ@LAruG%pYZ{tFPSXN%Z{e6}rT@>L`YS8; z+uO;sU-q+Ke$k)D$3y7}oIP=4csS;pT{ zZ>fJuSpQ;uweX+S{hamt*2~Xb`Sa+@8?`KdGG{ed-?o0&`b?n!e$o1p^)2fkt$OQ+ z)_>NhG+RHgUbFtz`nvVS!hc%(dF!**Zz6d7we|PbcdYN$q({Io3;%KT z=YZfd)~{N>WBsA^m70}5uzt(>g7reN|H;Cq;5aWL8oX4q@;Mm)3zhsY+kbBU{XY`6 VLE}14Da-%>002ovPDHLkV1h?o;kN() diff --git a/plugins/islandora_newspaper/Newspaper.inc b/plugins/islandora_newspaper/Newspaper.inc deleted file mode 100644 index 5f5212e8..00000000 --- a/plugins/islandora_newspaper/Newspaper.inc +++ /dev/null @@ -1,177 +0,0 @@ -pid = $pid; - $this->item = new Fedora_Item($pid); - } - } - - public function buildDrupalForm($form = array(), $ingest_form = array(), &$form_state = array()) { - - // Give the user an option to enter a custom PID - $form['custom_pid'] = array( - '#type' => 'textfield', - '#title' => 'Custom PID', - '#description' => 'If you want to manually specify the PID for the new object, enter it here. ' . - 'Leave it blank for an automatically-generated PID.', - ); - - $form['mods'] = array( - '#tree' => TRUE, - '#prefix' => '
', - '#suffix' => '
', - ); - $form['mods']['mods_record'] = array( - '#type' => 'textarea', - '#title' => 'MODS Record to Import', - '#rows' => 20, - ); - - return $form; - } - - public function handleIngestForm($form_values, &$form_state) { - /* - * process the metadata form - * Create fedora object - * Add the datastreams - */ - module_load_include('inc', 'fedora_repository', 'MimeClass'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_ilives', 'book'); - $mods_list_doc = new DomDocument(); - $mods_list_doc->loadXML($form_values['mods']['mods_record']); - $mods_item_doc = new DomDocument(); - $mods_item = $mods_list_doc->getElementsByTagNameNS('http://www.loc.gov/mods/v3', 'mods')->item(0); - $new_mods_item = $mods_item_doc->importNode($mods_item, TRUE); - $mods_item_doc->appendChild($new_mods_item); - - $title_info = $mods_item_doc->getElementsByTagNameNS('http://www.loc.gov/mods/v3', 'titleInfo')->item(0); - $title = ''; - foreach (array('nonSort', 'title') as $title_field) { - $title .= $title_info->getElementsByTagNameNS('http://www.loc.gov/mods/v3', $title_field)->item(0)->nodeValue; - } - - $mods_text = $mods_item_doc->saveXML(); - global $user; - $mimetype = new MimeClass(); - - $new_item = Fedora_Item::ingest_new_item(!empty($form_values['custom_pid']) ? $form_values['custom_pid'] : $form_values['pid'], 'A', $title, - $user->name); - - $new_item->add_datastream_from_string($mods_text, 'MODS', - 'MODS Metadata', 'text/xml', 'X'); - - $dc = transform_mods_to_dc($mods_text); - if ($dc) { - // Add the PID to a dc:identifier field. - $dc_doc = simplexml_load_string($dc); - $dc_doc->registerXPathNamespace('oai_dc', 'http://www.openarchives.org/OAI/2.0/oai_dc/'); - $dc_item = $dc_doc->xpath('//oai_dc:dc'); - foreach ($dc_item as $node) { - $node->addChild('dc:identifier', $new_item->pid, 'http://purl.org/dc/elements/1.1/'); - } - $new_item->modify_datastream_by_value($dc_doc->saveXML(), 'DC', 'Dublin Core XML Metadata', 'text/xml'); - } - $new_item->add_relationship('hasModel', $form_values['content_model_pid'], FEDORA_MODEL_URI); - $new_item->add_relationship(!empty($form_values['relationship']) ? $form_values['relationship'] : 'isMemberOfCollection', $form_values['collection_pid']); - drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($new_item->pid, 'fedora/repository/' . $new_item->pid))), "status"); - } - - public function showFieldSets() { - module_load_include('inc', 'fedora_ilives', 'book'); - global $base_url; - - $tabset = array(); - - $tabset = array( - '#type' => 'tabset', - ); - - global $user; - $qs = ''; - if ($user->uid != 0) { - $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); - } - - $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; - $html = ''; - - $tabset['read'] = array( - '#type' => 'tabpage', - '#title' => t('Read'), - '#weight' => -1, - '#content' => $html - ); - - $item = new Fedora_Item($this->pid); - - $tabset['description'] = array( - '#type' => 'tabpage', - '#title' => 'Description', - '#content' => $item->get_dissemination('islandora:mods2htmlSdef', 'mods2html'), - ); - $tabset['add_pages'] = array( - '#type' => 'tabpage', - '#title' => t('Add pages'), - '#content' => drupal_get_form('book_add_pages_form', $this->pid, 'newspapers:pageCModel', 'isPartOf'), - ); - return $tabset; - } - - public function showPageFieldSets() { - - global $base_url; - - $tabset = array(); - - $tabset = array( - '#type' => 'tabset', - ); - - global $user; - $qs = ''; - if ($user->uid != 0) { - $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); - } - - $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; - $html = ''; - - $tabset['first_tab'] = array( - '#type' => 'tabpage', - '#title' => t('Read'), - '#content' => $html - ); - - $item = new Fedora_Item($this->pid); - - // Get this page's parent item to show the issue's metadata. - $rels = $item->get_relationships(); - $parent_pid = ''; - foreach ($rels as $rel) { - if (strstr($rel['predicate'], 'isPartOf')) { - $parent_pid = $rel['object']; - break; - } - } - $parent_item = new Fedora_Item($parent_pid); - $tabset['second_tab'] = array( - '#type' => 'tabpage', - '#title' => 'Description', - '#content' => $parent_item->get_dissemination('islandora:mods2htmlSdef', 'mods2html'), - ); - - return $tabset; - } - -} diff --git a/plugins/islandora_newspaper/islandora_newspaper.info b/plugins/islandora_newspaper/islandora_newspaper.info deleted file mode 100644 index bbc884a2..00000000 --- a/plugins/islandora_newspaper/islandora_newspaper.info +++ /dev/null @@ -1,7 +0,0 @@ -; $Id$ -name = Islandora Newspaper -description = Content models and support code for Newspapers -package = Fedora Repository -dependencies[] = fedora_repository -version = 6.1dev -core = 6.x diff --git a/plugins/islandora_newspaper/islandora_newspaper.module b/plugins/islandora_newspaper/islandora_newspaper.module deleted file mode 100644 index 03e67e66..00000000 --- a/plugins/islandora_newspaper/islandora_newspaper.module +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'module' => 'islandora_newspaper', - 'title' => 'Islandora Newspaper', - 'objects' => array( - array( - //'foxml_file' => "$module_path/newspapers_issueCModel.xml", - 'pid' => 'newspapers:issueCModel', - 'dsid' => 'ISLANDORACM', - 'cmodel' => 'fedora-system:ContentModel-3.0', - 'datastream_file' => "$module_path/newspapers_issueCModel_islandoracm.xml", - 'dsversion' => 2, - ), - array( - 'foxml_file' => "$module_path/newspapers_pageCModel.xml", - 'pid' => 'newspapers:pageCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/newspapers_viewerSdep-issueCModel.xml", - 'pid' => 'newspapers:viewerSdep-issueCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/newspapers_viewerSdep-pageCModel.xml", - 'pid' => 'newspapers:viewerSdep-pageCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'pid' => 'newspapers:collection', - 'label' => 'Newspapers Collection', - 'cmodel' => 'islandora:collectionCModel', - 'parent' => 'islandora:demos', - 'datastreams' => array( - array( - 'dsid' => 'COLLECTION_POLICY', - 'datastream_file' => "$module_path/newspapers_collection_policy.xml", - ), - array( - 'dsid' => 'TN', - 'datastream_file' => "$module_path/Crystal_Clear_mimetype_document.png", - 'mimetype' => 'image/png', - ), - ), - ), - ), - ), - ); -} \ No newline at end of file diff --git a/plugins/islandora_newspaper/newspapers_collection_policy.xml b/plugins/islandora_newspaper/newspapers_collection_policy.xml deleted file mode 100644 index 86f1027e..00000000 --- a/plugins/islandora_newspaper/newspapers_collection_policy.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - dc.title - dc.creator - dc.description - dc.date - dc.identifier - dc.language - dc.publisher - dc.rights - dc.subject - dc.relation - dcterms.temporal - dcterms.spatial - Full Text - - isMemberOfCollection - diff --git a/plugins/islandora_newspaper/newspapers_guardian.xml b/plugins/islandora_newspaper/newspapers_guardian.xml deleted file mode 100644 index a198db9c..00000000 --- a/plugins/islandora_newspaper/newspapers_guardian.xml +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - - - - - - - - - - - modifyDatastreamByValue - MODS - fedoraAdmin - 2010-05-28T18:38:36.223Z - - - - - ingest - - fedoraAdmin - 2010-05-31T15:14:58.313Z - Ingested from local file /Users/al/Desktop/newspapers_guardian.xml - - - - - - - - - - This is an object-specific policy. It could be stored inside the digital object in the POLICY datastream OR in the directory for object-specific policies. (The directory location is set in the Authorization module configuration in the Fedora server configuration file (fedora.fcfg). By using multiple policy Rules, this policy shows how to deny access to all raw datastreams in the object except to particular users (e.g., the object owners). It also shows how to deny access to a particular disseminations to selected user roles. - - - - - - - - - - - urn:fedora:names:fedora:2.1:action:id-ingest - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDatastreamByReference - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDatastreamByValue - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDisseminator - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDisseminator - - - - - - urn:fedora:names:fedora:2.1:action:id-purgeObject - - - - - - urn:fedora:names:fedora:2.1:action:id-purgeDatastream - - - - - - urn:fedora:names:fedora:2.1:action:id-purgeDisseminator - - - - - - urn:fedora:names:fedora:2.1:action:id-setDatastreamState - - - - - - urn:fedora:names:fedora:2.1:action:id-setDisseminatorState - - - - - - urn:fedora:names:fedora:2.1:action:id-setDatastreamVersionable - - - - - - urn:fedora:names:fedora:2.1:action:id-addDatastream - - - - - - urn:fedora:names:fedora:2.1:action:id-addDisseminator - - - - - - - - - - - - administrator - - - - - - fedoraAdmin - - - - - - - - - - - - - - - - - - - - The Guardian - Guardian (Charlottetown, P.E.I.) - The Island guardian - The Charlottetown guardian - The Morning guardian - Newspapers - Newspapers - The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. - - The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade. - - .... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers. - - Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. - Ceased publication in 1920? - Missing issues. - Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. - Hood, J. P. - 1887-1920 - Text - v. - microfilm - http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 - newspapers:guardian - eng - Prince Edward Island - Charlottetown (P.E.I.) - - - - - - - - - - The - Guardian - - - Guardian (Charlottetown, P.E.I.) - - - The - Island guardian - - - The - Charlottetown guardian - - - The - Morning guardian - - - Hood, J. P. - - - Manager - - - Business Manager from Dec. 29, 1891 - Mar. 9, 1903; Managing Director from July 2, 1912 - Jan. 30, 1913. - - - text - - - pic - - - Charlottetown, P.E.I - - 1887-1920 - 1887 - 1920 - continuing - - - eng - - The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. - - The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade. - - .... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers. - - -
microfilm
-
microform
- v. -
- Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. - Ceased publication in 1920? - Missing issues. - Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. - - Prince Edward Island - Newspapers - - - Charlottetown (P.E.I.) - Newspapers - - http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 - - CaPCU - 760913 - 20090407151822.0 - -
-
-
- - - - - The - Guardian - - - Guardian (Charlottetown, P.E.I.) - - - The - Island guardian - - - The - Charlottetown guardian - - - The - Morning guardian - - - Hood, J. P. - - - Manager - - - Business Manager from Dec. 29, 1891 - Mar. 9, 1903; Managing Director from July 2, 1912 - Jan. 30, 1913. - - - text - - - pic - - - Charlottetown, P.E.I - - 1887-1920 - 1887 - 1920 - continuing - - - eng - - The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. - - The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade. - - .... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers. - - -
microfilm
-
microform
- v. -
- Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. - Ceased publication in 1920? - Missing issues. - Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. - - Prince Edward Island - Newspapers - - - Charlottetown (P.E.I.) - Newspapers - - http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 - - CaPCU - 760913 - 20090407151822.0 - -
-
-
-
- - - - - - - - - - - - -
diff --git a/plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml b/plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml deleted file mode 100644 index 3346fec8..00000000 --- a/plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - text/xml - - - - text/xml - - - - - - - - - - - - - - - - - diff --git a/plugins/islandora_newspaper/newspapers_pageCModel.xml b/plugins/islandora_newspaper/newspapers_pageCModel.xml deleted file mode 100644 index 00364347..00000000 --- a/plugins/islandora_newspaper/newspapers_pageCModel.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2010-05-28T19:37:09.514Z - Created with Admin GUI "New Object" command - - - - ingest - - fedoraAdmin - 2010-05-31T15:15:26.657Z - Ingested from local file /Users/al/Desktop/newspapers_pageCModel.xml - - - - ingest - - fedoraAdmin - 2010-06-01T13:22:40.275Z - Ingested from local file /Users/aoneill/fedora_repository/plugins/newspaper/newspapers_pageCModel.xml - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2010-06-21T16:26:53.809Z - DatastreamsPane generated this logMessage. - - - - ingest - - fedoraAdmin - 2010-06-21T19:39:20.139Z - Ingested from source repository with pid newspapers:pageCModel - - - - - - - - - - - - - - - - - - - - - - This DS-COMPOSITE-MODEL datastream is included as a starting point to - assist in the creation of a content model. The DS-COMPOSITE-MODEL - should define the datastreams that are required for any objects - conforming to this content model. - For more information about content models, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed content model objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection, - demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - -
- - - - - - - - - - Newspaper Page Content Model - newspapers:pageCModel - - - - - - - - - - - - - plugins/Newspaper.inc - Newspaper - showPageFieldSets - - - - - - - - - - - - plugins/Newspaper.inc - Newspaper - buildEditMetadataForm - - - plugins/Newspaper.inc - Newspaper - handleEditMetadataForm - - - - - - - diff --git a/plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml b/plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml deleted file mode 100644 index d2879675..00000000 --- a/plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2010-05-31T20:54:30.053Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2010-05-31T20:55:13.521Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-05-31T20:55:35.100Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2010-05-31T20:55:59.039Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-05-31T20:57:54.728Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-05-31T20:59:03.704Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This METHODMAP datastream is included as a starting point to - assist in the creation of a service deployment. The METHODMAP - should define the the mapping of the WSDL to Fedora object methods. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This DSINPUTSPEC datastream is included as a starting point to - assist in the creation of a service deployment. The DSINPUTSPEC - should define the datastreams to be used by WSDL-defined methods. - - - - - - - - DC - text/xml - - - - - - - - - - - This WSDL datastream is included as a starting point to - assist in the creation of a service deployment. The WSDL - should define the services provided by this - service deployment. - For more information about service deployments, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed service deployment objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:2, demo:13, demo:20, and demo:28. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Viewer service deployment for Newspaper content model - newspapers:viewerSdep-issueCModel - - - - - diff --git a/plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml b/plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml deleted file mode 100644 index 46908d60..00000000 --- a/plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2010-06-21T17:47:30.096Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-06-21T17:49:00.674Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-06-21T17:50:01.411Z - - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2010-06-21T17:50:23.252Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2010-06-21T17:51:49.022Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This METHODMAP datastream is included as a starting point to - assist in the creation of a service deployment. The METHODMAP - should define the the mapping of the WSDL to Fedora object methods. - - - - - - - - - - - - - - - - - - - - - - This DSINPUTSPEC datastream is included as a starting point to - assist in the creation of a service deployment. The DSINPUTSPEC - should define the datastreams to be used by WSDL-defined methods. - - - - - - - - DC - text/xml - - - - - - - - - - - This WSDL datastream is included as a starting point to - assist in the creation of a service deployment. The WSDL - should define the services provided by this - service deployment. - For more information about service deployments, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed service deployment objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:2, demo:13, demo:20, and demo:28. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Viewer for newspaper pages - newspapers:viewerSdep-pageCModel - - - - - diff --git a/plugins/pidfield/pidfield.info b/plugins/pidfield/pidfield.info deleted file mode 100644 index e7b9d96f..00000000 --- a/plugins/pidfield/pidfield.info +++ /dev/null @@ -1,8 +0,0 @@ -; $Id$ -name = PID Field -description = Defines a field type for referencing a Fedora item from a node. -dependencies[] = content -dependencies[] = fedora_repository -package = Fedora Repository -core = 6.x - diff --git a/plugins/pidfield/pidfield.install b/plugins/pidfield/pidfield.install deleted file mode 100644 index 1ce6a073..00000000 --- a/plugins/pidfield/pidfield.install +++ /dev/null @@ -1,40 +0,0 @@ - array( - // The human-readable label of the field that will be - // seen in the Manage fields screen. - 'label' => t('Fedora PID field'), - // A description of what type of data the field stores. - 'description' => t('Store a reference to a PID in this site\'s Fedora repository.'), - // An icon to use in Panels. - 'content_icon' => 'icon_content_text.png', - ), - ); -} - -/** - * Implementation of hook_field_settings(). - */ -function pidfield_field_settings($op, $field) { - switch ($op) { - // Create the form element to be used on the field - // settings form. Field settings will be the same for - // all shared instances of the same field and should - // define the way the value will be stored - // in the database. - case 'form': - $form = array(); - $form['max_length'] = array( - '#type' => 'textfield', - '#title' => t('Maximum length'), - '#default_value' => is_numeric($field['max_length']) ? $field['max_length'] : 64, - '#required' => FALSE, - // Use #element_validate to validate the settings. - '#element_validate' => array('_pidfield_length_validate'), - '#description' => t('The maximum length of the field in characters. Must be a number between 1 and 255'), - ); - return $form; - - // Return an array of the names of the field settings - // defined by this module. These are the items that - // CCK will store in the field definition - // and they will be available in the $field array. - // This should match the items defined in 'form' above. - case 'save': - return array('max_length'); - - // Define the database storage for this field using - // the same construct used by schema API. Most fields - // have only one column, but there can be any number - // of different columns. After the schema API values, - // add two optional values to each column, - // 'views', to define a Views field - // 'sortable', to add a Views sort field - case 'database columns': - $columns['value'] = array( - 'type' => 'varchar', - 'length' => is_numeric($field['max_length']) ? $field['max_length'] : 64, - 'not null' => FALSE, - 'sortable' => TRUE, - 'views' => TRUE, - ); - return $columns; - - // Optional: Make changes to the default $data array - // created for Views. Omit this if no changes are - // needed, use it to add a custom handler or make - // other changes. - case 'views data': - // Start with the $data created by CCK - // and alter it as needed. The following - // code illustrates how you would retrieve - // the necessary data. - $data = content_views_field_views_data($field); - $db_info = content_database_info($field); - $table_alias = content_views_tablename($field); - $field_data = $data[$table_alias][$field['field_name'] . '_value']; - // Make changes to $data as needed here. - return $data; - } -} - -/** - * Custom validation of settings values. - * - * Create callbacks like this to do settings validation. - */ -function _pidfield_length_validate($element, &$form_state) { - $value = $form_state['values']['max_length']; - if ($value && !is_numeric($value) || $value < 1 || $value > 255) { - form_set_error('max_length', t('"Max length" must be a number between 1 and 64.')); - } -} - -/** - * Implementation of hook_field(). - */ -function pidfield_field($op, &$node, $field, &$items, $teaser, $page) { - switch ($op) { - // Do validation on the field values here. The widget - // will do its own validation and you cannot make any - // assumptions about what kind of widget has been used, - // so don't validate widget values, only field values. - case 'validate': - if (is_array($items)) { - foreach ($items as $delta => $item) { - // The error_element is needed so that CCK can - // set an error on the right sub-element when - // fields are deeply nested in the form. - $error_element = isset($item['_error_element']) ? $item['_error_element'] : ''; - if (is_array($item) && isset($item['_error_element'])) - unset($item['_error_element']); - if (!empty($item['value'])) { - if (!empty($field['max_length']) && drupal_strlen($item['value']) > $field['max_length']) { - form_set_error($error_element, t('%name: the value may not be longer than %max characters.', array('%name' => $field['widget']['label'], '%max' => $field['max_length']))); - } - } - } - } - return $items; - - // This is where you make sure that user-provided - // data is sanitized before being displayed. - case 'sanitize': - foreach ($items as $delta => $item) { - $pid_field_text = check_plain($item['value']); - $items[$delta]['safe'] = $pid_field_text; - } - } -} - -/** - * Implementation of hook_content_is_empty(). - * - * CCK has no way to know if something like a zero is - * an empty value or a valid value, so return - * TRUE or FALSE to a populated field $item array. - * CCK uses this to remove empty multi-value elements - * from forms. - */ -function pidfield_content_is_empty($item, $field) { - if (empty($item['value'])) { - return TRUE; - } - return FALSE; -} - -/** - * Implementation of hook content_generate(). - * - * Optional, provide dummy value for nodes created - * by the Devel Generate module. - */ -function pidfield_content_generate($node, $field) { - $node_field = array(); - // Generate a value that respects max_length. - if (empty($field['max_length'])) { - $field['max_length'] = 12; - } - $node_field['value'] = user_password($field['max_length']); - return $node_field; -} - -/** - * Implementation of hook_token_list() - * and hook_token_values(). - * - * Optional, provide token values for this field. - */ -function pidfield_token_list($type = 'all') { - if ($type == 'field' || $type == 'all') { - $tokens = array(); - - $tokens['pidfield']['raw'] = t('Just the PID itself.'); - $tokens['pidfield']['formatted'] = t('A PID with a hyperlink'); - - return $tokens; - } -} - -function pidfield_token_values($type, $object = NULL) { - if ($type == 'field') { - $item = $object[0]; - - $tokens['raw'] = $item['value']; - $tokens['formatted'] = isset($item['view']) ? $item['view'] : ''; - return $tokens; - } -} - -//==========================================// -// DEFINING A FORMATTER -//==========================================// - -/** - * Implementation of hook_theme(). - */ -function pidfield_theme() { - return array( - // Themes for the formatters. - 'pidfield_formatter_default' => array( - 'arguments' => array('element' => NULL), - ), - 'pidfield_formatter_plain' => array( - 'arguments' => array('element' => NULL), - ), - ); -} - -/** - * Implementation of hook_field_formatter_info(). - * - * All fields should have a 'default' formatter. - * Any number of other formatters can be defined as well. - * It's nice for there always to be a 'plain' option - * for the raw value, but that is not required. - * - */ -function pidfield_field_formatter_info() { - return array( - // The machine name of the formatter. - 'default' => array( - // The human-readable label shown on the Display - // fields screen. - 'label' => t('Default'), - // An array of the field types this formatter - // can be used on. - 'field types' => array('pidfield'), - // CONTENT_HANDLE_CORE: CCK will pass the formatter - // a single value. - // CONTENT_HANDLE_MODULE: CCK will pass the formatter - // an array of all the values. None of CCK's core - // formatters use multiple values, that is an option - // available to other modules that want it. - 'multiple values' => CONTENT_HANDLE_CORE, - ), - 'plain' => array( - 'label' => t('Plain text'), - 'field types' => array('pidfield'), - 'multiple values' => CONTENT_HANDLE_CORE, - ), - ); -} - -/** - * Theme function for 'default' example field formatter. - * - * $element['#item']: the sanitized $delta value for the item, - * $element['#field_name']: the field name, - * $element['#type_name']: the $node->type, - * $element['#formatter']: the $formatter_name, - * $element'#node']: the $node, - * $element['#delta']: the delta of this item, like '0', - * - */ -function theme_pidfield_formatter_default($element) { - $pid = $element['#item']['safe']; - if (!empty($pid)) { - return fedora_repository_get_items($pid); - } - return null; -} - -/** - * Theme function for 'plain' example field formatter. - */ -function theme_pidfield_formatter_plain($element) { - return strip_tags($element['#item']['safe']); -} - -//==========================================// -// DEFINING A WIDGET -//==========================================// - -/** - * Implementation of hook_widget_info(). - * - * Here we indicate that the content module will handle - * the default value and multiple values for these widgets. - * - * Callbacks can be omitted if default handing is used. - * They're included here just so this module can be used - * as an example for custom modules that might do things - * differently. - */ -function pidfield_widget_info() { - return array( - // The machine name of the widget, no more than 32 - // characters. - 'pidfield_widget' => array( - // The human-readable label of the field that will be - // seen in the Manage fields screen. - 'label' => t('PID Field widget'), - // An array of the field types this widget can be - // used with. - 'field types' => array('pidfield'), - // Who will handle multiple values, default is core. - // 'CONTENT_HANDLE_MODULE' means the module does it. - // See optionwidgets for an example of a module that - // handles its own multiple values. - 'multiple values' => CONTENT_HANDLE_CORE, - 'callbacks' => array( - // Who will create the default value, default is core. - // 'CONTENT_CALLBACK_CUSTOM' means the module does it. - // 'CONTENT_CALLBACK_NONE' means this widget has - // no default value. - 'default value' => CONTENT_CALLBACK_DEFAULT, - ), - ), - ); -} - -/** - * Implementation of hook_widget_settings(). - */ -function pidfield_widget_settings($op, $widget) { - switch ($op) { - // Create the form element to be used on the widget - // settings form. Widget settings can be different - // for each shared instance of the same field and - // should define the way the value is displayed to - // the user in the edit form for that content type. - case 'form': - $form = array(); - $size = (isset($widget['size']) && is_numeric($widget['size'])) ? $widget['size'] : 60; - $form['size'] = array( - '#type' => 'textfield', - '#title' => t('Size of textfield'), - '#default_value' => $size, - '#element_validate' => array('_element_validate_integer_positive'), - '#required' => TRUE, - ); - return $form; - - // Return an array of the names of the widget settings - // defined by this module. These are the items that - // CCK will store in the widget definition and they - // will be available in the $field['widget'] array. - // This should match the items defined in 'form' above. - case 'save': - return array('size'); - } -} - -/** - * Implementation of hook_widget(). - * - * Attach a single form element to the form. - * - * CCK core fields only add a stub element and builds - * the complete item in #process so reusable elements - * created by hook_elements can be plugged into any - * module that provides valid $field information. - * - * Custom widgets that don't care about using hook_elements - * can be built out completely at this time. - * - * If there are multiple values for this field and CCK is - * handling multiple values, the content module will call - * this function as many times as needed. - * - * @param $form - * the entire form array, - * $form['#node'] holds node information - * @param $form_state - * the form_state, - * $form_state['values'][$field['field_name']] - * holds the field's form values. - * @param $field - * the field array - * @param $items - * array of default values for this field - * @param $delta - * the order of this item in the array of - * subelements (0, 1, 2, etc) - * - * @return - * the form item for a single element for this field - */ -function pidfield_widget(&$form, &$form_state, $field, $items, $delta = 0) { - - $element['value'] = array( - '#type' => 'textfield', - '#title' => $field['widget']['label'], - '#default_value' => isset($items[$delta]['value']) ? $items[$delta]['value'] : NULL, - '#autocomplete_path' => $element['#autocomplete_path'], - '#size' => !empty($field['widget']['size']) ? $field['widget']['size'] : 60, - '#attributes' => array('class' => 'pidfield'), - '#maxlength' => !empty($field['max_length']) ? $field['max_length'] : NULL, - ); - - // Used so that hook_field('validate') knows where to - // flag an error in deeply nested forms. - if (empty($form['#parents'])) { - $form['#parents'] = array(); - } - $element['_error_element'] = array( - '#type' => 'value', - '#value' => implode('][', array_merge($form['#parents'], array('value'))), - ); - - return $element; -} - -function get_node_references_for_fedora_item($item) { - $result = db_query("SELECT * - FROM {content_node_field} nf - INNER JOIN {content_node_field_instance} ni ON nf.field_name = ni.field_name - WHERE nf.type = 'pidfield'"); - while ($field = db_fetch_array($result)) { - - - $db_info = content_database_info($field); - - - - - - $ids = db_query("SELECT nid FROM {" . $db_info['table'] . "} WHERE " . $field['field_name'] . "_value=\"" . $item->pid . "\""); - - $results = array(); - while ($data = db_fetch_object($ids)) { - //$additions[] = node_load($data->vid); - - $results[] = $data->nid; - - //$referred_node = node_load(array('nid'=>$data->nid) ); - } - return $results; - } -} - -function fedora_pidfield_redirect_to_node($item) { - $node_references = get_node_references_for_fedora_item($item); - if (!empty($node_references)) { - if (strstr(drupal_get_destination(), urlencode('fedora/repository'))) { - drupal_goto(drupal_get_path_alias("node/" . $node_references[0])); - } - } -} \ No newline at end of file