/** * Get the item of the menu options. * * If no items is returned, the menu won't be displayed. * * @return array of 'item_key' => {url: '', icon: '', label: ''} */ public function getOptionsMenuItems() { $my_items = array('export' => ''); $my_items['export'] .= '<div class="btn-group">'; $my_items['export'] .= '<a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">'; $my_items['export'] .= '<i class="icon-download-alt"></i> '; $my_items['export'] .= $GLOBALS['Language']->getText('plugin_tracker_report', 'export'); $my_items['export'] .= ' <span class="caret"></span>'; $my_items['export'] .= '</a>'; $my_items['export'] .= '<ul class="dropdown-menu">'; $my_items['export'] .= '<li>'; $my_items['export'] .= '<a href="' . $this->getExportResultURL(self::EXPORT_LIGHT) . '">'; $my_items['export'] .= $GLOBALS['Language']->getText('plugin_tracker_include_report', 'export_only_report_columns'); $my_items['export'] .= '</a>'; $my_items['export'] .= '</li>'; $my_items['export'] .= '<li>'; $my_items['export'] .= '<a href="' . $this->getExportResultURL(self::EXPORT_FULL) . '">'; $my_items['export'] .= $GLOBALS['Language']->getText('plugin_tracker_include_report', 'export_all_columns'); $my_items['export'] .= '</a>'; $my_items['export'] .= '</li>'; $my_items['export'] .= '</ul>'; $my_items['export'] .= '</div>'; return $my_items + parent::getOptionsMenuItems(); }
/** * Get the item of the menu options. * * If no items is returned, the menu won't be displayed. * * @return array of 'item_key' => {url: '', icon: '', label: ''} */ public function getOptionsMenuItems() { $items = parent::getOptionsMenuItems(); $items['export_light'] = array('url' => TRACKER_BASE_URL . '/?' . http_build_query(array('report' => $this->report->id, 'renderer' => $this->id, 'func' => 'renderer', 'renderer_table' => array('export' => 1, 'export_only_displayed_fields' => 1))), 'icon' => $GLOBALS['HTML']->getImage('ic/clipboard-paste.png', array('border' => 0, 'alt' => '', 'style' => 'vertical-align:middle;')), 'label' => $GLOBALS['Language']->getText('plugin_tracker_include_report', 'export_only_report_columns')); $items['export_full'] = array('url' => TRACKER_BASE_URL . '/?' . http_build_query(array('report' => $this->report->id, 'renderer' => $this->id, 'func' => 'renderer', 'renderer_table' => array('export' => 1, 'export_only_displayed_fields' => 0))), 'icon' => $GLOBALS['HTML']->getImage('ic/clipboard-paste.png', array('border' => 0, 'alt' => '', 'style' => 'vertical-align:middle;')), 'label' => $GLOBALS['Language']->getText('plugin_tracker_include_report', 'export_all_columns')); return $items; }