View source
<?php
function cufon_install() {
$sql = "UPDATE {system}\n SET weight = 100\n WHERE name = 'cufon'";
db_query($sql);
}
function cufon_update_6000() {
$sql = "UPDATE {system}\n SET weight = 100\n WHERE name = 'cufon'";
db_query($sql);
}
function cufon_requirements($phase) {
$requirements = array();
$cufonLib = drupal_system_listing('cufon-yui.js', 'libraries');
$file_exists = isset($cufonLib['cufon-yui']);
if (!$file_exists) {
$js = dirname(__FILE__) . '/js';
$file_exists = file_exists($js . '/cufon-yui.js');
}
if ($phase == 'runtime' || !$file_exists) {
$requirements['cufon'] = array(
'title' => t('Cufon'),
'value' => $file_exists ? t('Cufon library installed') : t('<strong>Cufón:</strong> You must download <a href="http://cufon.shoqolate.com/js/cufon-yui.js">cufon-yui.js</a> and install it to <code>libraries/cufon</code>.'),
'severity' => $file_exists ? REQUIREMENT_INFO : REQUIREMENT_ERROR,
);
}
return $requirements;
}