function forena_admin_reports in Forena Reports 7.2
Same name and namespace in other branches
- 8 forena_ui/forena.admin.inc \forena_admin_reports()
- 6.2 forena.admin.inc \forena_admin_reports()
- 7.5 forena.admin.inc \forena_admin_reports()
- 7.3 forena.admin.inc \forena_admin_reports()
- 7.4 forena.admin.inc \forena_admin_reports()
Display reports to edit for admins in the structure menu Enter description here ...
1 string reference to 'forena_admin_reports'
- forena_menu in ./
forena.module - Implementation of hook_menu.
File
- ./
forena.admin.inc, line 13
Code
function forena_admin_reports() {
global $language;
$data = array();
$links[] = array(
'href' => 'reports/add',
'title' => 'Create New Report',
);
$output = theme('links', array(
'links' => $links,
'attributes' => array(
'class' => 'action-links',
),
));
$headers = array(
t('title'),
t('name'),
t('category'),
t('operation'),
);
$result = db_query('SELECT * FROM {forena_reports} where language=:language ORDER BY category,title', array(
':language' => $language->language,
));
foreach ($result as $row) {
$rpt = str_replace('/', '.', $row->report_name);
$edit = l('Edit', 'reports/' . $rpt . '/edit');
$clone = l('Clone', 'reports/add/' . $rpt);
$delete = l('Delete', 'reports/' . $rpt . '/delete', array(
'query' => array(
'destination' => 'admin/structure/reports',
),
));
$title = l($row->title, 'reports/' . $rpt);
$data[] = array(
$title,
$row->report_name,
$row->category,
$edit . ' ' . $clone . ' ' . $delete,
);
}
$output .= theme_table(array(
'header' => $headers,
'rows' => $data,
'attributes' => array(),
'caption' => '',
'sticky' => true,
'colgroups' => array(),
'empty' => '',
));
return $output;
}