timeago.install in Timeago 6.2
Same filename and directory in other branches
(Un)installs the Timeago module.
File
timeago.installView source
<?php
/**
* @file
* (Un)installs the Timeago module.
*/
/**
* Implementation of hook_requirements().
*/
function timeago_requirements($phase) {
$t = get_t();
$requirements = array(
'timeago' => array(
'title' => $t('Time ago library'),
'value' => '0.9.3',
),
);
$exists = file_exists(drupal_get_path('module', 'timeago') . '/jquery.timeago.js');
if ($exists) {
$requirements['timeago']['description'] = $t('Library exists.');
$requirements['timeago']['severity'] = REQUIREMENT_OK;
}
else {
$requirements['timeago']['description'] = $t('Library does not exist. <a href="http://timeago.yarp.com/jquery.timeago.js">Download the library</a> and put it in the timeago module folder.');
$requirements['timeago']['severity'] = $phase == 'runtime' ? REQUIREMENT_ERROR : REQUIREMENT_WARNING;
}
return $requirements;
}
/**
* Implements hook_uninstall().
*/
function timeago_uninstall() {
variable_del('timeago_node');
variable_del('timeago_comment');
variable_del('timeago_elem');
}
Functions
Name | Description |
---|---|
timeago_requirements | Implementation of hook_requirements(). |
timeago_uninstall | Implements hook_uninstall(). |