You are here

date_popup.install in Date 6

File

date_popup/date_popup.install
View source
<?php

/**
 * Implementation of hook_requirements().
 * Make sure a site timezone name has been selected.
 */
function date_popup_requirements($phase) {
  $requirements = array();
  $t = get_t();
  switch ($phase) {
    case 'runtime':
      $error = FALSE;
      if (!file_exists(drupal_get_path('module', 'date_popup') . '/lib/jquery.timeentry.pack.js')) {
        $message .= t('<p>Download jquery.timeentry.pack.js and jquery.timeentry.css from the jquery-timeentry home page at !link and install them in the /lib/ folder of the Date Popup module.</p>', array(
          '!link' => l('http://home.iprimus.com.au/kbwood/jquery/timeEntry.html', 'http://home.iprimus.com.au/kbwood/jquery/timeEntry.html', array(), NULL, NULL, FALSE, TRUE),
        ));
      }
      if (!empty($message)) {
        $requirements['date_popup_files'] = array(
          'title' => $t('Date Popup requirements'),
          'value' => $message,
          'severity' => REQUIREMENT_ERROR,
        );
      }
      break;
    case 'install':
      break;
  }
  return $requirements;
}

Functions

Namesort descending Description
date_popup_requirements Implementation of hook_requirements(). Make sure a site timezone name has been selected.