Browse Source

Move XSLTProcessor class check to hook_requirements()

pull/273/head
Peter Murray 12 years ago
parent
commit
b561d4b72f
  1. 5
      includes/admin.form.inc
  2. 19
      islandora.install

5
includes/admin.form.inc

@ -20,11 +20,6 @@ function islandora_repository_admin(array $form, array &$form_state) {
module_load_include('inc', 'islandora', 'includes/utilities');
drupal_add_css(drupal_get_path('module', 'islandora') . '/css/islandora.admin.css');
if (!class_exists('XSLTProcessor', FALSE)) {
$link = l(t('PHP XSL extension'), 'http://us2.php.net/manual/en/book.xsl.php', array('attributes' => array('target'=>'_blank')));
drupal_set_message(t('The !xsllink is required. Check your installed PHP extensions and php.ini file.', array('!xsllink' => $link)),'error');
}
$form = array();
if (isset($form_state['values']['islandora_base_url'])) {
$url = $form_state['values']['islandora_base_url'];

19
islandora.install

@ -4,6 +4,25 @@
* @file
* This file contains all install related hooks.
*/
/**
* Implements hook_requirements().
*/
function islandora_requirements($phase) {
$requirements = array();
// Ensure translations don't break at install time
$t = get_t();
if (!class_exists('XSLTProcessor', FALSE)) {
$requirements['islandora_xsltprocessor']['title'] = $t('Islandora XSLTProcessor Prerequisite');
$requirements['islandora_xsltprocessor']['value'] = $t('Not installed');
$link = l($t('PHP XSL extension'), 'http://us2.php.net/manual/en/book.xsl.php', array('attributes' => array('target'=>'_blank')));
$requirements['islandora_xsltprocessor']['description'] = $t('The !xsllink is required. Check your installed PHP extensions and php.ini file.', array('!xsllink' => $link)),'error');
$requirements['islandora_xsltprocessor']['severity'] = REQUIREMENT_ERROR;
}
return $requirements;
}
/**
* Implements hook_install().

Loading…
Cancel
Save