function headerJS() {
echo '
- <script type="text/javascript" src="'. $this->jsbaseurl .'gforge.js"></script>
+ <script type="text/javascript" src="'. util_make_uri('/js/common.js') .'"></script>
<script type="text/javascript">';
plugin_hook ("javascript",false);
echo '
}
- function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='WHITE',$total_width='100%') {
+ function tabGenerator($TABS_DIRS, $TABS_TITLES, $nested=false,
+ $selected=false, $sel_tab_bgcolor='WHITE',
+ $total_width='100%') {
$count=count($TABS_DIRS);
if ($count < 1) {
return;
}
- $width=intval((100/$count));
- $rest_width=100-$count*$width;
-
$return = '
<!-- start tabs -->
<table class="tabGenerator width-100p100" summary="" ';
$folder = $this->imgurl.($nested ? 'bottomtab-new/' : 'toptab-new/');
+ $accumulated_width = 0;
+ for ($i=0; $i<$count; $i++) {
+ $tabwidth = intval(ceil(($i+1)*100/$count)) - $accumulated_width ;
+ $accumulated_width += $tabwidth ;
+
for ($i=0; $i<$count; $i++) {
if ($selected == $i) {
$left_img = $folder.'selected-left.gif';
$return .= '</td>' . "\n";
// middle part
- $return .= '<td class="tg-middle" style="width:'.$width.'%;">' . "\n";
+ $return .= '<td class="tg-middle" style="width:'.$tabwidth.'%;">' . "\n";
$return .= '<div';
if ($selected == $i) {
$return .= ' class="selected"';
}
}
- if ($rest_width > 0) {
- $return .= '<td class="tg-middle" style="width:'.$rest_width.'%;">' . "\n";
- $return .= '<div><div';
- if ($nested) {
- $return .= ' class="nested"';
- }
- $return .= '>' . "\n";
- $return .= '</div></div>' . "\n";
- $return .= '</td>' . "\n";
- }
-
$return .= '</tr>
</table>
<!-- end tabs -->';