/** * Show list of activated reports * * @param array $opt : short_classname,f_name,gtype,rand */ static function title($opt) { global $LANG; $self = new self(); $params['classname'] = 'PluginMreporting' . $opt['short_classname']; $reports = $self->getAllReports(true, $params); echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='2'>" . __("Select statistics to be displayed") . " :</th></tr>"; echo "<tr class='tab_bg_1'><td class='center'>"; echo "<select name='graphmenu' onchange='window.location.href=this.options\n [this.selectedIndex].value'>"; echo "<option value='-1' selected>" . Dropdown::EMPTY_VALUE . "</option>"; $i = 0; foreach ($reports as $classname => $report) { foreach ($report['functions'] as $function) { if ($function['is_active']) { $graphs[$function['category_func']][] = $function; } } echo "<optgroup label=\"" . $report['title'] . "\">"; foreach ($graphs as $cat => $graph) { echo "<optgroup label=\"" . $cat . "\">"; foreach ($graph as $k => $v) { if ($v['is_active']) { $comment = ""; if (isset($v["desc"])) { $comment = $v["desc"]; $desc = " (" . $comment . ")"; } echo "<option value='" . $v["url_graph"] . "' title=\"" . Html::cleanInputText($comment) . "\">" . $v["title"] . $desc . "</option>"; $i++; } } echo "</optgroup>"; } echo "</optgroup>"; } echo "</select>"; echo "</td>"; echo "</tr>"; echo "</table>"; }