function displayReportGraphic($report_graphic_id, $group_id, $atid, $url) { $current_user = UserManager::instance()->getCurrentUser(); echo '<A name="charts"></A>'; echo '<h3>'; $onclick = ''; $onclick .= "if (\$('artifacts_charts').empty()) { return true }"; if (!$current_user->isAnonymous()) { $onclick .= "else { new Ajax.Request(this.href); }"; } $onclick .= "if (\$('artifacts_charts').visible()) { this.firstChild.src.replace(/minus.png/, 'plus.png'); } else {this.firstChild.src.replace(/plus.png/, 'minus.png');}"; $onclick .= "new Effect.toggle(\$('artifacts_charts'), 'slide', {duration:0.1});"; $onclick .= "return false;"; echo '<a href="' . $url . '&func=toggle_section&section=charts" onclick="' . $onclick . '">'; if ($current_user->getPreference('tracker_' . (int) $atid . '_hide_section_charts')) { $image = 'ic/toggle_plus.png'; } else { $image = 'ic/toggle_minus.png'; } echo $GLOBALS['HTML']->getimage($image, array('style' => 'vertical-align:bottom; padding-right:5px;')); echo '</a>'; echo $GLOBALS['Language']->getText('plugin_graphontrackers_report', 'title') . '</h3>'; echo '<div id="artifacts_charts" style="padding-left:16px;">'; if (!$current_user->getPreference('tracker_' . (int) $atid . '_hide_section_charts')) { echo '<p>' . $this->genGraphRepSelBox($report_graphic_id) . '</p>'; $gr = new GraphOnTrackers_Report($report_graphic_id); foreach ($gr->getCharts() as $chart) { $overflow = $chart->getWidth() ? '' : 'overflow:auto;'; echo '<div style="float:left; padding:10px; text-align:right; ' . $overflow . '">'; $chart->display(); echo '</div>'; } echo '<div style="clear:both;"></div>'; } echo '</div>'; }