You are here

function forena_report_title_callback in Forena Reports 7.3

Same name and namespace in other branches
  1. 8 forena.module \forena_report_title_callback()
  2. 7.5 forena.module \forena_report_title_callback()
  3. 7.4 forena.module \forena_report_title_callback()

Callback for setting international titles

Parameters

$report_name string name of report:

$use_menu_title boolean indicate wether to use menu title attribute.:

1 string reference to 'forena_report_title_callback'
FrxMenu::addMenuItems in ./FrxMenu.inc
Add menu items to the items array

File

./forena.module, line 907

Code

function forena_report_title_callback($report_name, $use_menu_title = TRUE) {
  global $language;
  $title = '';
  $lang = $language->language;
  $result = db_query('SELECT * FROM {forena_reports} where report_name = :name and language=:language', array(
    ':name' => $report_name,
    'language' => $lang,
  ));
  foreach ($result as $row) {
    $cache = $row->cache;
    if ($cache) {
      $cache = unserialize($cache);

      // Load menu item defaults
      $menu = $cache['menu'];
    }
    $title = $use_menu_title && @$menu['title'] ? $menu['title'] : $row->title;
  }
  return $title;
}