Skip to content
Snippets Groups Projects
Commit 0b2828b3 authored by Bruno Massa's avatar Bruno Massa
Browse files

New features:

* implementation of hook_requirements() to alert users that he/she didnt installed any chart provider module
parent acf7b702
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@
*/
function charts_chart($chart_provider, &$data) {
if (function_exists()) {
$chart_provider = $chart_provider .'_printchart';
$chart_provider = $chart_provider .'_chartapi';
return $chart_provider($data);
}
}
......@@ -52,4 +52,18 @@ function charts_menu() {
'type' => MENU_LOCAL_TASK,
);
return $items;
}
\ No newline at end of file
}
/**
* Implementation of hook_requirements().
*/
function charts_requirements($phase) {
if ($phase == 'runtime' and !$modules = module_invoke_all('chartsinfo', 'list')) {
$requirements['charts']['title'] = t('Charts');
$requirements['charts']['value'] = t('No Charts provider installed');
$requirements['charts']['severity'] = REQUIREMENT_ERROR;
$requirements['charts']['description'] = t('Charts core module only provides a a common set of functions. You must install a Charts provider module to create charts.');
return $requirements;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment