Commit 8fb99064 authored by David Metzler's avatar David Metzler
Browse files

#2168989 Report categories via callback.

parent d5096e7e
......@@ -145,10 +145,16 @@ function forena_get_html($tag, $r_text) {
*
*/
function forena_get_user_reports() {
function forena_get_user_reports($category = '') {
GLOBAL $language;
$result = db_query('SELECT * FROM {forena_reports} where hidden=0 and language=:language ORDER BY category,title asc', array(':language' => $language->language));
$select = db_select('forena_reports', 'r')
->fields('r')
->condition('language', $language->language)
->condition('hidden', 0);
if ($category) {
$select = $select->condition('category', $category);
}
$result = $select->execute();
$reports = array();
foreach ($result AS $row) {
$access = TRUE;
......
......@@ -762,10 +762,10 @@ function forena_permission() {
function forena_user_reports() {
function forena_user_reports($category = '') {
require_once('forena.common.inc');
$output='';
$reports = forena_get_user_reports();
$reports = forena_get_user_reports($category);
$report_repos = variable_get('forena_path', 'reports');
if (!$reports) {
$output = 'No Reports Found';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment