description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
@ -39,7 +39,7 @@ function islandora_add_datastream_form(array $form, array &$form_state, FedoraOb
'#collapsed' => FALSE,
'#collapsed' => FALSE,
'dsid' => array(
'dsid' => array(
'#title' => 'Datastream ID',
'#title' => 'Datastream ID',
'#description' => t("An ID for this stream that is unique to this object. Must start with a letter and contain only alphanumeric characters and dashes and underscores. Datastreams that are defined by the content model don't currently exist: <b>@unused_dsids</b>.", array('@unused_dsids' => $unused_datastreams)),
'#description' => t("An ID for this stream that is unique to this object. Must start with a letter and contain only alphanumeric characters, dashes and underscores. The following datastreams are defined by this content model but don't currently exist: <b>@unused_dsids</b>.", array('@unused_dsids' => $unused_datastreams)),
),
),
'#type' => 'textfield',
'#type' => 'textfield',
'#size' => 64,
'#size' => 64,
@ -57,7 +57,7 @@ function islandora_add_datastream_form(array $form, array &$form_state, FedoraOb
'#description' => t("Allow administrator to restrict user's access to the PID namepaces listed below"),
'#default_value' => $restrict_namespaces,
),
'islandora_pids_allowed' => array(
'#type' => 'textfield',
'#title' => t('PID namespaces allowed in this Drupal install'),
'#description' => t('A list of PID namespaces, separated by spaces, that users are permitted to access from this Drupal installation. <br/> This could be more than a simple namespace, e.g. <b>demo:mydemos</b>. <br/> The namespace <b>islandora:</b> is reserved, and is always allowed.'),
'#description' => t('A space separated list of PID namespaces that users are permitted to access from this Drupal installation. <br/> This could be more than a simple namespace ie demo:mydemos. <br/> islandora: is reserved and is always allowed.'),
'#weight' => 0,
);
}
return system_settings_form($form);
}
}
/**
/**
@ -168,18 +140,3 @@ function islandora_repository_admin(array $form, array &$form_state) {
function islandora_update_url_div(array $form, array $form_state) {
function islandora_update_url_div(array $form, array $form_state) {
$msg = '@module: Did not install any objects. Could not connect to the ';
$msg = $t('@module: Did not install any objects. Could not connect to the repository. Please check the settings on the !config_link page and install the required objects manually on the !admin_link page.', $t_params);
$msg .= 'repository. Please check the settings on the !config_link page ';
drupal_set_message(filter_xss($msg), 'error');
$msg .= 'and install the required objects manually on the !admin_link page.';
'up_to_date' => 'The object already exists and is up-to-date',
'up_to_date' => $t('The object already exists and is up-to-date.', $t_params),
'missing_datastream' => 'The object already exists but is missing a datastream. Please reinstall the object on the !admin_link page',
'missing_datastream' => $t('The object already exists but is missing a datastream. Please reinstall the object on the !admin_link page.', $t_params),
'out_of_date' => 'The object already exists but is out-of-date. Please update the object on the !admin_link page',
'out_of_date' => $t('The object already exists but is out-of-date. Please update the object on the !admin_link page.', $t_params),
'modified_datastream' => 'The object already exists but datastreams are modified. Please reinstall the object on the !admin_link page',
'modified_datastream' => $t('The object already exists but datastreams are modified. Please reinstall the object on the !admin_link page.', $t_params),
$msg = '@module: Did not uninstall any objects. Could not connect to the ';
$msg = $t('@module: Did not uninstall any objects. Could not connect to the repository. Please check the settings on the !config_link page and uninstall the required objects manually if necessary.', array(
$msg .= 'repository. Please check the settings on the !config_link page ';
'@module' => $module_name,
$msg .= 'and uninstall the required objects manually if necessary.';
'!config_link' => $config_link,
drupal_set_message(st($msg, array(
));
'@module' => $module_name,
drupal_set_message(filter_xss($msg), 'error');
'!config_link' => $config_link,
)), 'error');
return;
return;
}
}
$connection = islandora_get_tuque_connection();
$connection = islandora_get_tuque_connection();
@ -334,19 +354,20 @@ function islandora_uninstall_solution_pack($module) {
'Attempting to ingest %file in islandora_prepare_new_object(), but it does not appear to be readable. We will pass the path through url(), and pass along as such.',
@ -32,7 +32,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
* @see IslandoraWebTestCase::setUp()
* @see IslandoraWebTestCase::setUp()
*/
*/
public function setUp() {
public function setUp() {
parent::setUp('islandora_hooks_test', 'devel');
parent::setUp('islandora_hooks_test');
$this->repository = $this->admin->repository;
$this->repository = $this->admin->repository;
$this->purgeTestObjects();
$this->purgeTestObjects();
}
}
@ -67,7 +67,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$object->label = "Don't Block";
$object->label = "Don't Block";
$this->repository->purgeObject($object->id);
$this->repository->purgeObject($object->id);
}
}
catch(Exception $e) {
catch(Exception $e) {
// Meh... Either it didn't exist or the purge failed.
// Meh... Either it didn't exist or the purge failed.
}
}
}
}
@ -95,7 +95,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$this->fail('Blocked ingest should throw an Exception.');
$this->fail('Blocked ingest should throw an Exception.');
$this->repository->purgeObject($object->id);
$this->repository->purgeObject($object->id);
}
}
catch(Exception $e) {
catch(Exception $e) {
$this->pass('Ingest blocked and exception thrown.');
$this->pass('Ingest blocked and exception thrown.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_OBJECT_INGESTED_HOOK], 'Called "hook_islandora_object_alter" when blocking ingesting via FedoraRepository::ingestObject.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_OBJECT_INGESTED_HOOK], 'Called "hook_islandora_object_alter" when blocking ingesting via FedoraRepository::ingestObject.');
$this->assertFalse($_SESSION['islandora_hooks']['hook'][ISLANDORA_OBJECT_INGESTED_HOOK], 'Did not called ISLANDORA_OBJECT_INGESTED_HOOK when blocking ingesting via FedoraRepository::ingestObject.');
$this->assertFalse($_SESSION['islandora_hooks']['hook'][ISLANDORA_OBJECT_INGESTED_HOOK], 'Did not called ISLANDORA_OBJECT_INGESTED_HOOK when blocking ingesting via FedoraRepository::ingestObject.');
@ -115,7 +115,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$object->label = 'block';
$object->label = 'block';
$this->fail('Blocked modify should throw an Exception.');
$this->fail('Blocked modify should throw an Exception.');
}
}
catch(Exception $e) {
catch(Exception $e) {
$this->pass('Modify blocked and exception thrown.');
$this->pass('Modify blocked and exception thrown.');
$this->assertNotEqual($object->label, 'block', 'Modification did not stick.');
$this->assertNotEqual($object->label, 'block', 'Modification did not stick.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_OBJECT_MODIFIED_HOOK], 'Called "hook_islandora_object_alter" when blocking modifying via set magic functions.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_OBJECT_MODIFIED_HOOK], 'Called "hook_islandora_object_alter" when blocking modifying via set magic functions.');
@ -149,7 +149,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$this->repository->purgeObject($object->id);
$this->repository->purgeObject($object->id);
$this->fail('Blocked modify should throw an Exception.');
$this->fail('Blocked modify should throw an Exception.');
}
}
catch(Exception $e) {
catch(Exception $e) {
$this->pass('Modify blocked and exception thrown.');
$this->pass('Modify blocked and exception thrown.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_OBJECT_PURGED_HOOK], 'Called "hook_islandora_object_alter" when blocking purge via FedoraRepository::purgeObject.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_OBJECT_PURGED_HOOK], 'Called "hook_islandora_object_alter" when blocking purge via FedoraRepository::purgeObject.');
$this->assertFalse($_SESSION['islandora_hooks']['hook'][ISLANDORA_OBJECT_PURGED_HOOK], 'Called ISLANDORA_OBJECT_PURGED_HOOK when blocking purge via FedoraRepository::purgeObject.');
$this->assertFalse($_SESSION['islandora_hooks']['hook'][ISLANDORA_OBJECT_PURGED_HOOK], 'Called ISLANDORA_OBJECT_PURGED_HOOK when blocking purge via FedoraRepository::purgeObject.');
@ -191,7 +191,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$ds->label = 'block';
$ds->label = 'block';
$this->fail('Blocked modify should throw an Exception.');
$this->fail('Blocked modify should throw an Exception.');
}
}
catch(Exception $e) {
catch(Exception $e) {
$this->pass('Modify blocked and exception thrown.');
$this->pass('Modify blocked and exception thrown.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_DATASTREAM_MODIFIED_HOOK], 'Called "hook_islandora_datastream_alter" when blocking modifying via set magic functions.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_DATASTREAM_MODIFIED_HOOK], 'Called "hook_islandora_datastream_alter" when blocking modifying via set magic functions.');
$this->assertFALSE($_SESSION['islandora_hooks']['hook'][ISLANDORA_DATASTREAM_MODIFIED_HOOK], 'Called ISLANDORA_DATASTREAM_MODIFIED_HOOK when blocking modifying via set magic functions.');
$this->assertFALSE($_SESSION['islandora_hooks']['hook'][ISLANDORA_DATASTREAM_MODIFIED_HOOK], 'Called ISLANDORA_DATASTREAM_MODIFIED_HOOK when blocking modifying via set magic functions.');