Browse Source

Updated settings logic.

pull/499/head
MorganDawe 11 years ago
parent
commit
c19bb4b3d2
  1. 6
      includes/admin.form.inc
  2. 7
      theme/theme.inc

6
includes/admin.form.inc

@ -86,17 +86,15 @@ function islandora_repository_admin(array $form, array &$form_state) {
'islandora_ds_replace_exclude' => array(
'#type' => 'fieldset',
'#title' => t('Excluded DSID'),
'islandora_namespace_restriction_enforced' => array(
'islandora_ds_replace_exclude_enforced' => array(
'#type' => 'textfield',
'#title' => t('Enforce DSID restrictions'),
'#description' => t("A comma seperated list, allowing administrator to restrict user's access to replace a versionable datastreams latest version"),
'#default_value' => variable_get('islandora_namespace_restriction_enforced', 'RELS-EXT,RELS-INT'),
'#default_value' => variable_get('islandora_ds_replace_exclude_enforced', 'RELS-EXT,RELS-INT'),
),
),
),
);
$var_string = variable_get('islandora_namespace_restriction_enforced', 'RELS-EXT,RELS-INT');
dsm($var_string, "hehe");
return system_settings_form($form);
}

7
theme/theme.inc

@ -456,13 +456,10 @@ function theme_islandora_datastream_version_link(array $vars) {
*/
function theme_islandora_datastream_replace_link(array $vars) {
$datastream = $vars['datastream'];
//TODO: RELS-EXT and RELS-INT should never be replaced, but should
// be moved out into configuration somewhere. Hard coded === bad time.
if (islandora_datastream_access(ISLANDORA_REPLACE_DATASTREAM, $datastream) &&
islandora_datastream_access(ISLANDORA_ADD_NEW_DATASTREAM_VERSION, $datastream)) {
$var_string = variable_get("islandora_namespace_restriction_enforced", "RELS-EXT,RELS-INT");
$replace_exclude = explode($var_string, ",");
dsm($var_string, "var string");
$var_string = variable_get("islandora_ds_replace_exclude_enforced", "RELS-EXT,RELS-INT");
$replace_exclude = explode(",", $var_string);
if (!in_array($datastream->id, $replace_exclude)) {
return l(t('replace'), "islandora/object/{$datastream->parent->id}/datastream/{$datastream->id}/replace");
}

Loading…
Cancel
Save