[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/imageapi/ -> imageapi.install (source)

   1  <?php
   2  
   3  
   4  /**
   5   * Implementation of hook_requirements().
   6   */
   7  function imageapi_requirements($phase) {
   8    $requirements = array();
   9    // Ensure translations don't break at install time.
  10    $t = get_t();
  11  
  12    // Check this at runtime rather than install time because the order of
  13    // installation doesn't take dependencies into account. ImageAPI may have
  14    // been installed by not loaded and if we report a requirement error
  15    // because we can't find its function or no toolkit is enabled modules that
  16    // depend on us will still be enabled but will have a missing dependency.
  17    // Seems like a better idea to let everything get enabled and then inform
  18    // them of the problem.
  19    if ($phase == 'runtime') {
  20      if (count(imageapi_get_available_toolkits()) == 0) {
  21        $requirements['imageapi_toolkits'] = array(
  22          'title' => $t('ImageAPI Toolkit'),
  23          'value' => $t('No ImageAPI toolkits available'),
  24          'severity' => REQUIREMENT_ERROR,
  25          'description' => $t('ImageAPI requires a Toolkit such as ImageAPI GD or ImageAPI ImageMagick to function. Go to !modules and enable one of them.', array('!modules' => l('admin/build/modules', 'admin/build/modules'))),
  26        );
  27      }
  28    }
  29  
  30    return $requirements;
  31  }
  32  function imageapi_install() {
  33  }
  34  
  35  /**
  36   * Implementation of hook_uninstall().
  37   *
  38   */
  39  function imageapi_uninstall() {
  40    variable_del('imageapi_image_toolkit');
  41  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7