function statspro_optional_dependency_charts_graphs in Statistics Pro 6.2
1 call to statspro_optional_dependency_charts_graphs()
- statspro_main_admin_settings_form in ./
statspro_admin_settings.inc - Main admin settings form.
File
- ./
statspro_admin_settings.inc, line 155
Code
function statspro_optional_dependency_charts_graphs(&$form) {
$dependency_ok = module_exists('charts_graphs');
$form['optional_requirements']['charts_graphs_module_wrapper'] = array(
'#type' => 'fieldset',
'#title' => t('Charts and Graphs module'),
'#collapsible' => TRUE,
'#collapsed' => $dependency_ok,
);
$message = "\n<p>" . t("The %charts_graphs_module module is required\n for producing graphs on several reports.", array(
'%charts_graphs_module' => t('Charts and Graphs'),
)) . "</p>\n";
$message .= "\n<p>" . t("The %charts_graphs_module module is currently %status.", array(
'%charts_graphs_module' => t('Charts and Graphs'),
'%status' => $dependency_ok ? t('Enabled') : t('Disabled'),
)) . "</p>\n";
$form['optional_requirements']['charts_graphs_module_wrapper']['charts_graphs_module'] = array(
'#value' => $message,
);
if ($dependency_ok) {
$available_charts_graphs = charts_graphs_apis();
if (count($available_charts_graphs) == 0) {
$message = "\n<p>" . t("There is no charting submodule enabled for\n %charts_graphs_module module. You need at least one charting submodule\n enabled.", array(
'%charts_graphs_module' => t('Charts and Graphs'),
)) . "</p>\n";
$form['optional_requirements']['charts_graphs_module_wrapper']['charts_graphs_submodule'] = array(
'#value' => $message,
);
}
}
}