+
+/**
+ * Show the button in the main bar
+ *
+ * @access private
+ *
+ */
+function bug_report_button_do() {
+ global $username, $data_dir;
+ $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible', FALSE);
+
+ if (! $bug_report_visible || ! bug_report_check_user()) {
+ return;
+ }
+
+ global $oTemplate, $nbsp;
+ $output = makeInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '')
+ . $nbsp . $nbsp;
+ return array('menuline' => $output);
+}
+
+
+/**
+ * Register bug report option block
+ *
+ * @since 1.5.1
+ *
+ * @access private
+ *
+ */
+function bug_report_block_do() {
+ if (bug_report_check_user()) {
+ global $username, $data_dir, $optpage_data, $bug_report_visible;
+ $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible', FALSE);
+ $optpage_data['grps']['bug_report'] = _("Bug Reports");
+ $optionValues = array();
+// FIXME: option needs refresh in SMOPT_REFRESH_RIGHT (menulinks are built before options are saved/loaded)
+ $optionValues[] = array(
+ 'name' => 'bug_report_visible',
+ 'caption' => _("Show button in toolbar"),
+ 'type' => SMOPT_TYPE_BOOLEAN,
+ 'refresh' => SMOPT_REFRESH_ALL,
+ 'initial_value' => false
+ );
+ $optpage_data['vals']['bug_report'] = $optionValues;
+ }
+}
+
+