
Untitled
By: a guest on
Aug 3rd, 2012 | syntax:
PHP | size: 1.40 KB | hits: 22 | expires: Never
/**
* Implements hook_requirements().
*/
function godiagram_requirements($phase) {
$requirements = array();
if ($phase == 'install') {
$t = get_t();
$requirements['sltxt2png'] = array(
'title' => $t('SL Txt 2 PNG'),
);
if (!function_exists('libraries_get_path')) {
module_load_include('module', 'libraries');
}
$sltxt2png_path = libraries_get_path('sltxt2png');
if (!is_file($sltxt2png_path . '/sltxt2png.php')) {
$requirements['sltxt2png']['description'] = $t(
'<h2>SL Txt 2 PNG library not installed</h2><br />' .
'You are missing the required files for the SL Txt 2 PNG library. Please download the library from !sltxt2png_url and unzip the files to !sltxt2png_path. After doing this, confirm that the following path exists: !sltxt2png_php_path.',
array(
'!sltxt2png_url' => l(
'http://senseis.xmp.net/?GoWiki%2FSLTxt2PNG',
'http://senseis.xmp.net/?GoWiki%2FSLTxt2PNG',
array(
'external' => TRUE,
)
),
'!sltxt2png_path' => $sltxt2png_path,
'!sltxt2png_php_path' => $sltxt2png_path . '/sltxt2png.php',
)
);
$requirements['sltxt2png']['severity'] = REQUIREMENT_ERROR;
}
else {
$requirements['sltxt2png']['severity'] = REQUIREMENT_OK;
}
}
return $requirements;
}