function quant_page in Quant 7
Same name and namespace in other branches
- 6 includes/pages.inc \quant_page()
The analytics page callback
1 string reference to 'quant_page'
- quant_menu in ./
quant.module - Implements hook_menu().
File
- ./
quant.pages.inc, line 11 - Page callbacks
Code
function quant_page() {
$charts = array();
// Get time period or interval
$period = _quant_get_time_from_url();
// Fetch all available quants
if ($period) {
$quants = quant_get_quants();
foreach ($quants as $quant) {
// Check to see if this quant should be shown
if ($allowed = variable_get('quant_visible', array())) {
if (isset($allowed[$quant->id]) && !$allowed[$quant->id]) {
continue;
}
}
// Process the quant
$quant
->execute($period);
$charts[] = $quant
->render();
}
}
else {
drupal_set_message(t('Invalid timeframe arguments provided.'), 'error');
}
// Get the time form
$form = drupal_get_form('quant_time_form');
// Theme and return the page
$build = array(
'#theme' => 'quant_page',
'#form' => drupal_render($form),
'#charts' => $charts,
'#attached' => array(
'css' => array(
drupal_get_path('module', 'quant') . '/css/quant.css',
),
),
);
return $build;
}