Browse Source

Coding standard cleanup

pull/45/head
Ben Woodhead 13 years ago
parent
commit
58ceada875
  1. 6
      BatchIngest.inc
  2. 8
      CollectionClass.inc
  3. 6
      CollectionManagement.inc
  4. 16
      CollectionPolicy.inc
  5. 54
      ContentModel.inc
  6. 4
      ObjectHelper.inc
  7. 4
      XMLDatastream.inc
  8. 2
      api/fedora_export.inc
  9. 6
      api/fedora_item.inc
  10. 6
      api/fedora_utils.inc
  11. 2
      fedora_repository.module
  12. 8
      formClass.inc
  13. 2
      plugins/ImageManipulation.inc
  14. 4
      plugins/qt_viewer.inc

6
BatchIngest.inc

@ -38,7 +38,7 @@ function batch_creation_form(&$form_state, $collection_pid, $content_models) {
'#title' => "Choose content model to be associated with objects ingested", '#title' => "Choose content model to be associated with objects ingested",
'#type' => 'select', '#type' => 'select',
'#options' => $cm_options, '#options' => $cm_options,
'#required' => true, '#required' => TRUE,
'#description' => t("Content models describe the behaviours of objects with which they are associated."), '#description' => t("Content models describe the behaviours of objects with which they are associated."),
); );
$form['indicator']['file-location'] = array( $form['indicator']['file-location'] = array(
@ -251,14 +251,14 @@ function batch_create_dc_from_mods($mods_xml) {
*/ */
function recursive_directory_delete($dir) { function recursive_directory_delete($dir) {
if (!file_exists($dir)) if (!file_exists($dir))
return true; return TRUE;
if (!is_dir($dir)) if (!is_dir($dir))
return unlink($dir); return unlink($dir);
foreach (scandir($dir) as $item) { foreach (scandir($dir) as $item) {
if ($item == '.' || $item == '..') if ($item == '.' || $item == '..')
continue; continue;
if (!recursive_directory_delete($dir . DIRECTORY_SEPARATOR . $item)) if (!recursive_directory_delete($dir . DIRECTORY_SEPARATOR . $item))
return false; return FALSE;
} }
return rmdir($dir); return rmdir($dir);
} }

8
CollectionClass.inc

@ -524,11 +524,11 @@ class CollectionClass {
$show_batch_tab = FALSE; $show_batch_tab = FALSE;
} }
if (!$show_ingest_tab) { if (!$show_ingest_tab) {
$view_selected = true; $view_selected = TRUE;
} }
if(!$collection_items){ if(!$collection_items){
$view_selected = false; $view_selected = FALSE;
$add_selected = true; $add_selected = TRUE;
} }
$view_selected = !$show_ingest_tab; $view_selected = !$show_ingest_tab;
@ -554,7 +554,7 @@ class CollectionClass {
'#title' => t('Manage This Collection'), '#title' => t('Manage This Collection'),
// This will be the content of the tab. // This will be the content of the tab.
'#content' => drupal_get_form('collection_management_form', $this->pid, $content_models), '#content' => drupal_get_form('collection_management_form', $this->pid, $content_models),
'#selected' => false, '#selected' => FALSE,
); );
} }
if ($show_batch_tab && user_access('create batch process')) { if ($show_batch_tab && user_access('create batch process')) {

6
CollectionManagement.inc

@ -10,8 +10,8 @@
function collection_management_form(&$form_state, $this_collection_pid, $content_models) { function collection_management_form(&$form_state, $this_collection_pid, $content_models) {
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$restricted = FALSE; $restricted = FALSE;
if (variable_get('fedora_namespace_restriction_enforced', true)) { if (variable_get('fedora_namespace_restriction_enforced', TRUE)) {
$restricted = true; $restricted = TRUE;
$allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:');
$namespaces = explode(':', $allowed_string); $namespaces = explode(':', $allowed_string);
foreach ($namespaces as $namespace) { foreach ($namespaces as $namespace) {
@ -35,7 +35,7 @@ function collection_management_form(&$form_state, $this_collection_pid, $content
} }
} }
if (!empty($cm_options)) { if (!empty($cm_options)) {
$show_delete = true; $show_delete = TRUE;
} }

16
CollectionPolicy.inc

@ -64,7 +64,7 @@ class CollectionPolicy extends XMLDatastream {
/** /**
* Ingests a new Collection Policy datastream to the specified * Ingests a new Collection Policy datastream to the specified
* PID with the DSID specified. The file should be a valid collection * PID with the DSID specified. The file should be a valid collection
* policy XML. Returns false on failure. * policy XML. Returns FALSE on failure.
* *
* @param string $pid * @param string $pid
* @param string $name * @param string $name
@ -92,7 +92,7 @@ class CollectionPolicy extends XMLDatastream {
/** /**
* Ingests a new Collection Policy datastream to the specified * Ingests a new Collection Policy datastream to the specified
* PID with the DSID specified. Clones the collection policy from the * PID with the DSID specified. Clones the collection policy from the
* source collection pid. Returns false on failure. * source collection pid. Returns FALSE on failure.
* *
* @param string $pid * @param string $pid
* @param string $name * @param string $name
@ -122,7 +122,7 @@ class CollectionPolicy extends XMLDatastream {
/** /**
* Ingests a new minimum Collection Policy datastream to the specified * Ingests a new minimum Collection Policy datastream to the specified
* PID with the DSID specified. Initializes the policy with the specified values. * PID with the DSID specified. Initializes the policy with the specified values.
* Returns false on failure * Returns FALSE on failure
* *
* @param string $pid * @param string $pid
* @param string $name * @param string $name
@ -234,7 +234,7 @@ class CollectionPolicy extends XMLDatastream {
$termEl = $newDom->createElement('term', $term->value); $termEl = $newDom->createElement('term', $term->value);
$termEl->setAttribute('field', $term->field); $termEl->setAttribute('field', $term->field);
if (strval($sXml->search_terms->default) == $term->field) { if (strval($sXml->search_terms->default) == $term->field) {
$termEl->setAttribute('default', 'true'); $termEl->setAttribute('default', 'TRUE');
} }
$search_termsEl->appendChild($termEl); $search_termsEl->appendChild($termEl);
} }
@ -321,7 +321,7 @@ class CollectionPolicy extends XMLDatastream {
/** /**
* Sets the path to the staging area to use for this * Sets the path to the staging area to use for this
* collection. If specified path is blank (or false) it will * collection. If specified path is blank (or FALSE) it will
* remove the staging are path element from the collection policy. * remove the staging are path element from the collection policy.
* *
* @param string $path * @param string $path
@ -435,7 +435,7 @@ class CollectionPolicy extends XMLDatastream {
$terms = $this->xml->getElementsByTagName('search_terms')->item(0)->getElementsByTagName('term'); $terms = $this->xml->getElementsByTagName('search_terms')->item(0)->getElementsByTagName('term');
for ($i = 0; $i < $terms->length; $i++) { for ($i = 0; $i < $terms->length; $i++) {
$default = $terms->item($i)->attributes->getNamedItem('default'); $default = $terms->item($i)->attributes->getNamedItem('default');
$default = ($default !== NULL) ? (strtolower($default->nodeValue) == 'true') : FALSE; $default = ($default !== NULL) ? (strtolower($default->nodeValue) == 'TRUE') : FALSE;
$ret[] = ($asArray) ? array('value' => $terms->item($i)->nodeValue, $ret[] = ($asArray) ? array('value' => $terms->item($i)->nodeValue,
'field' => $terms->item($i)->getAttribute('field'), 'field' => $terms->item($i)->getAttribute('field'),
'default' => $default) : $terms->item($i)->nodeValue; 'default' => $default) : $terms->item($i)->nodeValue;
@ -540,7 +540,7 @@ class CollectionPolicy extends XMLDatastream {
if ($terms->item($i)->attributes->getNamedItem('default') !== NULL) { if ($terms->item($i)->attributes->getNamedItem('default') !== NULL) {
$terms->item($i)->removeAttribute('default'); $terms->item($i)->removeAttribute('default');
} }
$found->setAttribute('default', 'true'); $found->setAttribute('default', 'TRUE');
$ret = TRUE; $ret = TRUE;
} }
} }
@ -550,7 +550,7 @@ class CollectionPolicy extends XMLDatastream {
/** /**
* Removes the specified content model from the collection policy. This will only * Removes the specified content model from the collection policy. This will only
* prevent future ingests of the removed model to the collection. $cm should be * prevent future ingests of the removed model to the collection. $cm should be
* a valid ContentModel object. Returns false on failure or when the CM was not found in * a valid ContentModel object. Returns FALSE on failure or when the CM was not found in
* the collection policy. * the collection policy.
* *
* @param ContentModel $cm * @param ContentModel $cm

54
ContentModel.inc

@ -34,7 +34,7 @@ class ContentModel extends XMLDatastream {
/** /**
* Constructs a ContentModel object from a Fedora item * Constructs a ContentModel object from a Fedora item
* by getting the first content model from the hasModel relationship. * by getting the first content model from the hasModel relationship.
* Returns false on failure. * Returns FALSE on failure.
* @param string $pid * @param string $pid
* @return ContentModel $cm * @return ContentModel $cm
*/ */
@ -57,7 +57,7 @@ class ContentModel extends XMLDatastream {
/** /**
* Ingests a Content Model from a file to the specified pid/dsid . * Ingests a Content Model from a file to the specified pid/dsid .
* Returns false on failure. * Returns FALSE on failure.
* *
* @param string $pid * @param string $pid
* @param string $name * @param string $name
@ -84,7 +84,7 @@ class ContentModel extends XMLDatastream {
/** /**
* Ingests a Content Model from an existing model to the specified pid/dsid . * Ingests a Content Model from an existing model to the specified pid/dsid .
* Returns false on failure. * Returns FALSE on failure.
* *
* @param string $pid * @param string $pid
* @param string $name * @param string $name
@ -113,7 +113,7 @@ class ContentModel extends XMLDatastream {
/** /**
* Ingests a minimum Content Model to the specified pid/dsid. * Ingests a minimum Content Model to the specified pid/dsid.
* Returns false on failure. * Returns FALSE on failure.
* *
* @param string $pid * @param string $pid
* @param string $name * @param string $name
@ -153,8 +153,8 @@ class ContentModel extends XMLDatastream {
$ingestFormEl = $newDom->createElement('ingest_form'); $ingestFormEl = $newDom->createElement('ingest_form');
$ingestFormEl->setAttribute('dsid', $ingestFormDsid); $ingestFormEl->setAttribute('dsid', $ingestFormDsid);
$ingestFormEl->setAttribute('page', $ingestFormPage); $ingestFormEl->setAttribute('page', $ingestFormPage);
if ($ingestFormHideChooser == 'true') { if ($ingestFormHideChooser == 'TRUE') {
$ingestFormEl->setAttribute('hide_file_chooser', 'true'); $ingestFormEl->setAttribute('hide_file_chooser', 'TRUE');
} }
$builderEl = $newDom->createElement('form_builder_method'); $builderEl = $newDom->createElement('form_builder_method');
@ -186,7 +186,7 @@ class ContentModel extends XMLDatastream {
* If DSID is specified it will use that datastream as the model, otherwise it will * If DSID is specified it will use that datastream as the model, otherwise it will
* use the default (usually ISLANDORACM). PID_NAMESPACE and name can also be initialized * use the default (usually ISLANDORACM). PID_NAMESPACE and name can also be initialized
* from the collection policy. * from the collection policy.
* Returns false on failure. * Returns FALSE on failure.
* *
* NOTE: $name will be overwritten with the content model name found in the datastream * NOTE: $name will be overwritten with the content model name found in the datastream
* when the model is first validated.\ * when the model is first validated.\
@ -344,7 +344,7 @@ class ContentModel extends XMLDatastream {
$ingest_formEl->setAttribute('dsid', $sXml->ingest_form['dsid']); $ingest_formEl->setAttribute('dsid', $sXml->ingest_form['dsid']);
$ingest_formEl->setAttribute('page', $sXml->ingest_form['page']); $ingest_formEl->setAttribute('page', $sXml->ingest_form['page']);
if (isset($sXml->ingest_form['hide_file_chooser'])) { if (isset($sXml->ingest_form['hide_file_chooser'])) {
$ingest_formEl->setAttribute('hide_file_chooser', (strtolower($sXml->ingest_form['hide_file_chooser']) == 'true') ? 'true' : 'false'); $ingest_formEl->setAttribute('hide_file_chooser', (strtolower($sXml->ingest_form['hide_file_chooser']) == 'TRUE') ? 'TRUE' : 'FALSE');
} }
$form_builderEl = $newDom->createElement('form_builder_method'); $form_builderEl = $newDom->createElement('form_builder_method');
@ -373,8 +373,8 @@ class ContentModel extends XMLDatastream {
$elEl->setAttribute('label', $element->label); $elEl->setAttribute('label', $element->label);
$elEl->setAttribute('name', $element->name); $elEl->setAttribute('name', $element->name);
$elEl->setAttribute('type', $element->type); $elEl->setAttribute('type', $element->type);
if (strtolower($element->required) == 'true') { if (strtolower($element->required) == 'TRUE') {
$elEl->setAttribute('required', 'true'); $elEl->setAttribute('required', 'TRUE');
} }
if (isset($element->description) && trim($element->description) != '') { if (isset($element->description) && trim($element->description) != '') {
$descEl = $newDom->createElement('description', trim($element->description)); $descEl = $newDom->createElement('description', trim($element->description));
@ -453,7 +453,7 @@ class ContentModel extends XMLDatastream {
/** /**
* Gets the name of the ContentModel * Gets the name of the ContentModel
* Returns false on failure. * Returns FALSE on failure.
* *
* @return String $name * @return String $name
*/ */
@ -539,7 +539,7 @@ class ContentModel extends XMLDatastream {
$element = array('name' => $elements->item($i)->getAttribute('name'), $element = array('name' => $elements->item($i)->getAttribute('name'),
'label' => $label, 'label' => $label,
'type' => $elements->item($i)->getAttribute('type'), 'type' => $elements->item($i)->getAttribute('type'),
'required' => ($elements->item($i)->getAttribute('required') == 'true') ? TRUE : FALSE, 'required' => ($elements->item($i)->getAttribute('required') == 'TRUE') ? TRUE : FALSE,
'description' => $desc 'description' => $desc
); );
@ -561,7 +561,7 @@ class ContentModel extends XMLDatastream {
$items = $params->item(0)->getElementsByTagName('parameter'); $items = $params->item(0)->getElementsByTagName('parameter');
for ($j = 0; $j < $items->length; $j++) { for ($j = 0; $j < $items->length; $j++) {
$value = $items->item($j)->nodeValue; $value = $items->item($j)->nodeValue;
$list[$items->item($j)->getAttribute('name')] = (strtolower($value) == 'true' ? TRUE : (strtolower($value) == 'false' ? FALSE : $value)); $list[$items->item($j)->getAttribute('name')] = (strtolower($value) == 'TRUE' ? TRUE : (strtolower($value) == 'FALSE' ? FALSE : $value));
} }
} }
$element['parameters'] = $list; $element['parameters'] = $list;
@ -657,7 +657,7 @@ class ContentModel extends XMLDatastream {
/** /**
* Sets a parameter of an ingest form element. If the value of the element is FALSE the parameter * Sets a parameter of an ingest form element. If the value of the element is FALSE the parameter
* will be removed entirely (if you want to store false as a value, then send the String "false"). * will be removed entirely (if you want to store FALSE as a value, then send the String "FALSE").
* *
* @param String $elementName * @param String $elementName
* @param String $paramName * @param String $paramName
@ -786,7 +786,7 @@ class ContentModel extends XMLDatastream {
$found->setAttribute('name', $name); $found->setAttribute('name', $name);
$found->setAttribute('type', $type); $found->setAttribute('type', $type);
$found->setAttribute('required', $required ? 'true' : 'false'); $found->setAttribute('required', $required ? 'TRUE' : 'FALSE');
if (trim($label) != '' && trim($label) != trim($name)) { if (trim($label) != '' && trim($label) != trim($name)) {
$found->setAttribute('label', $label); $found->setAttribute('label', $label);
} }
@ -838,7 +838,7 @@ class ContentModel extends XMLDatastream {
$elementEl = $this->xml->createElement('element'); $elementEl = $this->xml->createElement('element');
$elementEl->setAttribute('name', $name); $elementEl->setAttribute('name', $name);
$elementEl->setAttribute('type', $type); $elementEl->setAttribute('type', $type);
$elementEl->setAttribute('required', $requiredi ? 'true' : 'false'); $elementEl->setAttribute('required', $requiredi ? 'TRUE' : 'FALSE');
if (trim($label) != '' && trim($label) != trim($name)) { if (trim($label) != '' && trim($label) != trim($name)) {
$elementEl->setAttribute('label', $label); $elementEl->setAttribute('label', $label);
} }
@ -1062,7 +1062,7 @@ class ContentModel extends XMLDatastream {
$ingest_form = $this->xml->getElementsByTagName('ingest_form')->item(0); $ingest_form = $this->xml->getElementsByTagName('ingest_form')->item(0);
if (!empty($ingest_form)) { if (!empty($ingest_form)) {
if (strtolower($ingest_form->getAttribute('hide_file_chooser')) == 'true') { if (strtolower($ingest_form->getAttribute('hide_file_chooser')) == 'TRUE') {
$form['indicator']['ingest-file-location']['#type'] = 'hidden'; $form['indicator']['ingest-file-location']['#type'] = 'hidden';
} }
} }
@ -1464,7 +1464,7 @@ class ContentModel extends XMLDatastream {
$datastreams = $datastreams->item(0)->getElementsByTagName('datastream'); $datastreams = $datastreams->item(0)->getElementsByTagName('datastream');
for ($i = 0; $i < $datastreams->length; $i++) { for ($i = 0; $i < $datastreams->length; $i++) {
$ds = $datastreams->item($i); $ds = $datastreams->item($i);
if ($ds->attributes->getNamedItem('display_in_fieldset') == NULL || strtolower($ds->getAttribute('display_in_fieldset')) != 'false') { if ($ds->attributes->getNamedItem('display_in_fieldset') == NULL || strtolower($ds->getAttribute('display_in_fieldset')) != 'FALSE') {
$dispMethods = $ds->getElementsByTagName('display_method'); $dispMethods = $ds->getElementsByTagName('display_method');
for ($j = 0; $j < $dispMethods->length; $j++) { for ($j = 0; $j < $dispMethods->length; $j++) {
$method = $dispMethods->item($j); $method = $dispMethods->item($j);
@ -1592,7 +1592,7 @@ class ContentModel extends XMLDatastream {
'file' => $dispMethods->item($i)->getAttribute('file'), 'file' => $dispMethods->item($i)->getAttribute('file'),
'class' => $dispMethods->item($i)->getAttribute('class'), 'class' => $dispMethods->item($i)->getAttribute('class'),
'method' => $dispMethods->item($i)->getAttribute('method'), 'method' => $dispMethods->item($i)->getAttribute('method'),
'default' => ($dispMethods->item($i)->attributes->getNamedItem('default') !== NULL ? strtolower($dispMethods->item($i)->getAttribute('default')) == 'true' : FALSE)); 'default' => ($dispMethods->item($i)->attributes->getNamedItem('default') !== NULL ? strtolower($dispMethods->item($i)->getAttribute('default')) == 'TRUE' : FALSE));
} }
} }
return $ret; return $ret;
@ -1620,7 +1620,7 @@ class ContentModel extends XMLDatastream {
$dsEl = $this->xml->createElement('datastream'); $dsEl = $this->xml->createElement('datastream');
$dsEl->setAttribute('dsid', $dsid); $dsEl->setAttribute('dsid', $dsid);
if ($display_in_fieldset == TRUE) { if ($display_in_fieldset == TRUE) {
$dsEl->setAttribute('display_in_fieldset', 'true'); $dsEl->setAttribute('display_in_fieldset', 'TRUE');
} }
$datastreamsEl->appendChild($dsEl); $datastreamsEl->appendChild($dsEl);
$ret = TRUE; $ret = TRUE;
@ -1652,7 +1652,7 @@ class ContentModel extends XMLDatastream {
public function displayInFieldset($dsid) { public function displayInFieldset($dsid) {
$ret = FALSE; $ret = FALSE;
if (self::valid_dsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { if (self::valid_dsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) {
$ret = strtolower($ds->getAttribute('display_in_fieldset')) == 'true'; $ret = strtolower($ds->getAttribute('display_in_fieldset')) == 'TRUE';
} }
return $ret; return $ret;
} }
@ -1671,7 +1671,7 @@ class ContentModel extends XMLDatastream {
$ret = TRUE; $ret = TRUE;
} }
elseif ($value == TRUE) { elseif ($value == TRUE) {
$ds->setAttribute('display_in_fieldset', 'true'); $ds->setAttribute('display_in_fieldset', 'TRUE');
$ret = TRUE; $ret = TRUE;
} }
} }
@ -1710,7 +1710,7 @@ class ContentModel extends XMLDatastream {
} }
} }
$found->setAttribute('default', 'true'); $found->setAttribute('default', 'TRUE');
$ret = TRUE; $ret = TRUE;
} }
} }
@ -2112,8 +2112,8 @@ class ContentModel extends XMLDatastream {
$ingest_formEl = $this->xml->getElementsByTagName('ingest_form')->item(0); $ingest_formEl = $this->xml->getElementsByTagName('ingest_form')->item(0);
$ret = array('dsid' => $ingest_formEl->getAttribute('dsid'), $ret = array('dsid' => $ingest_formEl->getAttribute('dsid'),
'page' => $ingest_formEl->getAttribute('page'), 'page' => $ingest_formEl->getAttribute('page'),
'hide_file_chooser' => strtolower($ingest_formEl->getAttribute('hide_file_chooser')) == 'true', 'hide_file_chooser' => strtolower($ingest_formEl->getAttribute('hide_file_chooser')) == 'TRUE',
'redirect' => strtolower($ingest_formEl->getAttribute('redirect')) == 'false' ? FALSE : TRUE); 'redirect' => strtolower($ingest_formEl->getAttribute('redirect')) == 'FALSE' ? FALSE : TRUE);
} }
return $ret; return $ret;
} }
@ -2133,13 +2133,13 @@ class ContentModel extends XMLDatastream {
$ingest_formEl->setAttribute('dsid', $dsid); $ingest_formEl->setAttribute('dsid', $dsid);
$ingest_formEl->setAttribute('page', $page); $ingest_formEl->setAttribute('page', $page);
if (!$redirect) { if (!$redirect) {
$ingest_formEl->setAttribute('redirect', 'false'); $ingest_formEl->setAttribute('redirect', 'FALSE');
} }
else { else {
$ingest_formEl->removeAttribute('redirect'); $ingest_formEl->removeAttribute('redirect');
} }
if ($hide_file_chooser) { if ($hide_file_chooser) {
$ingest_formEl->setAttribute('hide_file_chooser', 'true'); $ingest_formEl->setAttribute('hide_file_chooser', 'TRUE');
} }
else { else {
$ingest_formEl->removeAttribute('hide_file_chooser'); $ingest_formEl->removeAttribute('hide_file_chooser');

4
ObjectHelper.inc

@ -835,7 +835,7 @@ class ObjectHelper {
and $o <mulgara:is> <info:fedora/' . $pid . '>'; and $o <mulgara:is> <info:fedora/' . $pid . '>';
$url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query=";
$content = do_curl($url . htmlentities(urlencode($query_string))); $content = do_curl($url . htmlentities(urlencode($query_string)));
$rows = explode("\n", $content); $rows = explode("\n", $content);
@ -869,7 +869,7 @@ class ObjectHelper {
$query_string = substr($query_string, 0, -3) . ' )'; $query_string = substr($query_string, 0, -3) . ' )';
$url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query=";
$url .= htmlentities(urlencode($query_string)); $url .= htmlentities(urlencode($query_string));
$content = $this->doCurl($url); $content = $this->doCurl($url);

4
XMLDatastream.inc

@ -102,7 +102,7 @@ abstract class XMLDatastream {
* @return XMLDatastream $cm * @return XMLDatastream $cm
*/ */
public function __construct($xmlStr, $pid = NULL, $dsid = NULL) { public function __construct($xmlStr, $pid = NULL, $dsid = NULL) {
libxml_use_internal_errors(true); libxml_use_internal_errors(TRUE);
$this->pid = $pid; $this->pid = $pid;
$this->dsid = $dsid; $this->dsid = $dsid;
@ -253,7 +253,7 @@ abstract class XMLDatastream {
/** /**
* Gets the history of the datastream from fedora. * Gets the history of the datastream from fedora.
* Returns false on failure. * Returns FALSE on failure.
* *
* @return string[] $ret * @return string[] $ret
*/ */

2
api/fedora_export.inc

@ -170,7 +170,7 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re
} }
foreach ($xpath->('METS:FLocat[@xlink:href]', $content_node) as $floc) { foreach ($xpath->('METS:FLocat[@xlink:href]', $content_node) as $floc) {
$floc->setAttribute('xlink:href', url($paths[$ds_id], array('absolute' => true))); $floc->setAttribute('xlink:href', url($paths[$ds_id], array('absolute' => TRUE)));
} }
`} `}
*/ */

6
api/fedora_item.inc

@ -297,14 +297,14 @@ class Fedora_Item {
$i++; $i++;
$url = variable_get('fedora_base_url', 'http://localhost:8080/fedora'); $url = variable_get('fedora_base_url', 'http://localhost:8080/fedora');
if ($cursor == 0) { if ($cursor == 0) {
$url .= "/objects?query=$field~$pattern&pid=true&title=true&resultFormat=xml&maxResults=$max_results"; $url .= "/objects?query=$field~$pattern&pid=TRUE&title=TRUE&resultFormat=xml&maxResults=$max_results";
} }
else { else {
$url .= "/objects?pid=true&title=truesessionToken=$session_token&resultFormat=xml&maxResults=$max_results"; $url .= "/objects?pid=TRUE&title=TRUEsessionToken=$session_token&resultFormat=xml&maxResults=$max_results";
} }
if (count($resultFields) > 0) { if (count($resultFields) > 0) {
$url .= '&' . join('=true&', $resultFields) . '=true'; $url .= '&' . join('=TRUE&', $resultFields) . '=TRUE';
} }
$resultxml = do_curl($url); $resultxml = do_curl($url);

6
api/fedora_utils.inc

@ -245,7 +245,7 @@ function get_collections_as_option_array() {
and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)
order by $title'; order by $title';
$url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query=";
$content = do_curl($url . htmlentities(urlencode($query))); $content = do_curl($url . htmlentities(urlencode($query)));
$list = explode("\n", $content); $list = explode("\n", $content);
array_shift($list); array_shift($list);
@ -271,7 +271,7 @@ function get_collections_as_option_array() {
function get_content_models_as_option_array() { function get_content_models_as_option_array() {
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$restricted = variable_get('fedora_namespace_restriction_enforced', true); $restricted = variable_get('fedora_namespace_restriction_enforced', TRUE);
$allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:');
$namespaces = explode(':', $allowed_string); $namespaces = explode(':', $allowed_string);
foreach ($namespaces as $namespace) { foreach ($namespaces as $namespace) {
@ -287,7 +287,7 @@ function get_content_models_as_option_array() {
order by $title'; order by $title';
$url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query=";
$content = do_curl($url . htmlentities(urlencode($query))); $content = do_curl($url . htmlentities(urlencode($query)));
$list = explode("\n", $content); $list = explode("\n", $content);
array_shift($list); array_shift($list);

2
fedora_repository.module

@ -990,7 +990,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
// Add a 'manage object' tab for all objects, where detailed list of content is shown. // Add a 'manage object' tab for all objects, where detailed list of content is shown.
$obj = new FedoraObjectDetailedContent($pid); $obj = new FedoraObjectDetailedContent($pid);
$object_details = $obj->showFieldSets(); $object_details = $obj->showFieldSets();
if ($object_details['fedora_object_details']['#selected'] == true){ if ($object_details['fedora_object_details']['#selected'] == TRUE){
foreach($cmodels_tabs as $cmodel_tab){ foreach($cmodels_tabs as $cmodel_tab){
if (is_array($cmodel_tab)){ if (is_array($cmodel_tab)){
$cmodel_tab['#selected'] = FALSE; $cmodel_tab['#selected'] = FALSE;

8
formClass.inc

@ -306,8 +306,8 @@ class formClass {
'#type' => 'fieldset', '#type' => 'fieldset',
'#title' => t('Advanced configuration options'), '#title' => t('Advanced configuration options'),
'#description' => t('Advanced configuration. Under normal circumstances these will not be touched'), '#description' => t('Advanced configuration. Under normal circumstances these will not be touched'),
'#collapsible' => true, '#collapsible' => TRUE,
'#collapsed' => true, '#collapsed' => TRUE,
); );
$form['advanced']['fedora_object_display_title'] = array( $form['advanced']['fedora_object_display_title'] = array(
'#type' => 'select', '#type' => 'select',
@ -587,7 +587,7 @@ class formClass {
$form = new IngestObjectMetadataForm(); $form = new IngestObjectMetadataForm();
return $form->create($collection_pid, $collection_label, $form_state); return $form->create($collection_pid, $collection_label, $form_state);
} catch (Exception $e) { } catch (Exception $e) {
$form_state['storage']['xml'] = false; // An error occured revert back to the QDC Form. $form_state['storage']['xml'] = FALSE; // An error occured revert back to the QDC Form.
} }
} }
return $this->createQDCIngestForm($collection_pid, $collection_label, $form_state); return $this->createQDCIngestForm($collection_pid, $collection_label, $form_state);
@ -810,7 +810,7 @@ class formClass {
$form = new EditObjectMetadataForm($form_state); $form = new EditObjectMetadataForm($form_state);
return $form->create($pid, $client, $form_state); return $form->create($pid, $client, $form_state);
} catch (Exception $e) { } catch (Exception $e) {
$form_state['storage']['xml'] = false; // An error occured revert back to the QDC Form. $form_state['storage']['xml'] = FALSE; // An error occured revert back to the QDC Form.
} }
} }
return $this->createQDCEditForm($pid, $dsid, $client, $form_state); return $this->createQDCEditForm($pid, $dsid, $client, $form_state);

2
plugins/ImageManipulation.inc

@ -211,7 +211,7 @@ class ImageManipulation {
} }
elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'unix')) { elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'unix')) {
// Use this for Mac OS X (MAMP) // Use this for Mac OS X (MAMP)
$cmdline = "sips -s format jpeg \"$file\" -z $height $height --out \"$file$file_suffix\" >/dev/null"; $cmdline = "sips -s format jpeg \"$file\" -z $height $height --out \"$file$file_suffix\" >/dev/NULL";
} }
else { else {
$cmdline = "convert \"$file\"\[0\] -colorspace RGB -thumbnail " . $width . "x" . $height . " \"$file$file_suffix\""; $cmdline = "convert \"$file\"\[0\] -colorspace RGB -thumbnail " . $width . "x" . $height . " \"$file$file_suffix\"";

4
plugins/qt_viewer.inc

@ -99,7 +99,7 @@ class ShowQtStreamsInFieldSets {
} }
/** /**
* Is download enabled. It always returns false. ??? * Is download enabled. It always returns FALSE. ???
* @return FALSE * @return FALSE
*/ */
function enableDownload() { function enableDownload() {
@ -147,7 +147,7 @@ class ShowQtStreamsInFieldSets {
} }
$src = base_path() . 'fedora/repository/' . $this->pid . '/' . $media->ID . '/MOV.mov'; $src = base_path() . 'fedora/repository/' . $this->pid . '/' . $media->ID . '/MOV.mov';
$qtparams = ''; $qtparams = '';
$qtparams .= "'autostart', '" . ($pframe !== FALSE ? 'true' : 'false') . "', "; $qtparams .= "'autostart', '" . ($pframe !== FALSE ? 'TRUE' : 'FALSE') . "', ";
$init = <<<EOD $init = <<<EOD
$(function() { $(function() {
src = "$src"; src = "$src";

Loading…
Cancel
Save