configuration page.", array( '@url' => url('admin/config/content/table-tidy')) )); } /** * Implements hook_requirements(). * * $phase typically is one of 'install', 'runtime', 'update'. */ function table_tidy_requirements($phase) { $requirements = array(); if ($phase != 'runtime') { return $requirements; } $css_file = trim(variable_get('table_tidy_icon_lib_css')); $t = get_t(); $requirements['table_tidy_icon_lib'] = array( 'title' => $t('Table Tidy icon library'), 'severity' => REQUIREMENT_OK, ); if (empty($css_file)) { $msg = $t('None specified.'); $requirements['table_tidy_icon_lib']['severity'] = REQUIREMENT_INFO; } else { if (file_exists($css_file)) { $msg = $t('Icon library found at %css_file', array('%css_file' => $css_file)); } else { $msg = $t('Icon library %file was entered on the configuration page but not found.', array( '%file' => $css_file, '!url_config' => url('admin/config/content/table-tidy'), )); $requirements['table_tidy_icon_lib']['severity'] = REQUIREMENT_WARNING; } } $requirements['table_tidy_icon_lib']['value'] = $msg; return $requirements; } /** * Implements hook_install(). */ function table_tidy_install() { // Set a high module weight so our hook_views_pre_render() gets executed last. db_update('system') ->fields(array('weight' => 0)) ->condition('name', 'table_tidy') ->execute(); } /** * Implements hook_uninstall(). */ function table_tidy_uninstall() { // Delete all table_tidy_* variables at once. db_query("DELETE FROM {variable} WHERE name LIKE 'table_tidy_%%'"); }