1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244
|
<?php
/**
* Base layout class.
*
* Extends the basic Error class to add HTML functions
* for displaying all site dependent HTML, while allowing
* extendibility/overriding by themes via the Theme class.
*
* Make sure browser.php is included _before_ you create an instance of this object.
*
* Geoffrey Herteg, August 29, 2000
*
* @version $Id: Layout.class 5293 2006-02-13 14:38:41Z danper $
*/
require_once ('www/search/include/SearchManager.class');
class Layout extends Error {
/**
* The default main page content
*/
var $rootindex = 'index_std.php';
/**
* The root location for images
*
* @var string $imgroot
*/
var $imgroot = '/themes/gforge/images/';
var $COLOR_CONTENT_BACK= '#ffffff';
var $COLOR_LTBACK1= '#eeeeef';
var $COLOR_LTBACK2= '#fafafa';
var $COLOR_SELECTED_TAB= '#e0e0e0';
var $COLOR_HTMLBOX_TITLE = '#bbbbbb';
var $COLOR_HTMLBOX_BACK = '#eaecef';
var $FONT_CONTENT = 'helvetica';
var $FONT_HTMLBOX_TITLE = 'helvetica';
var $FONTCOLOR_HTMLBOX_TITLE = '#333333';
var $FONTCOLOR_CONTENT = '#333333';
var $FONTSIZE = 'small';
var $FONTSIZE_SMALLER='x-small';
var $FONTSIZE_SMALLEST='xx-small';
var $FONTSIZE_HTMLBOX_TITLE = 'small';
var $bgpri = array();
/**
* Layout() - Constructor
*/
function Layout() {
GLOBAL $bgpri;
// Constructor for parent class...
if ( file_exists($GLOBALS['sys_custom_path'] . '/index_std.php') )
$this->rootindex = $GLOBALS['sys_custom_path'] . '/index_std.php';
$this->Error();
/*
Set up the priority color array one time only
*/
$bgpri[1] = '#dadada';
$bgpri[2] = '#dacaca';
$bgpri[3] = '#dababa';
$bgpri[4] = '#daaaaa';
$bgpri[5] = '#da8a8a';
//determine font for this platform
if (browser_is_windows() && browser_is_ie()) {
//ie needs smaller fonts
$this->FONTSIZE='x-small';
$this->FONTSIZE_SMALLER='xx-small';
$this->FONTSIZE_SMALLEST='7pt';
} else if (browser_is_windows()) {
//netscape on wintel
$this->FONTSIZE='small';
$this->FONTSIZE_SMALLER='x-small';
$this->FONTSIZE_SMALLEST='x-small';
} else if (browser_is_mac()){
//mac users need bigger fonts
$this->FONTSIZE='medium';
$this->FONTSIZE_SMALLER='small';
$this->FONTSIZE_SMALLEST='x-small';
} else {
//linux and other users
$this->FONTSIZE='small';
$this->FONTSIZE_SMALLER='x-small';
$this->FONTSIZE_SMALLEST='xx-small';
}
$this->FONTSIZE_HTMLBOX_TITLE = $this->FONTSIZE;
}
/**
* createLinkToUserHome() - Creates a link to a user's home page
*
* @param string The user's user_name
* @param string The user's realname
*/
function createLinkToUserHome($user_name, $realname) {
return '<a href="/users/'.$user_name.'/">'.$realname.'</a>';
}
/**
* header() - "steel theme" top of page
*
* @param array Header parameters array
*/
function header($params) {
global $Language;
if (!$params['title']) {
$params['title'] = $GLOBALS['sys_name'];
} else {
$params['title'] = $GLOBALS['sys_name'] . ': ' . $params['title'];
}
print '<?xml version="1.0" encoding="' . $Language->getEncoding(). '"?>';
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="<?php echo $Language->getLanguageCode(); ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Language->getEncoding(); ?>" />
<title><?php echo $params['title']; ?></title>
<link rel="alternate" title="<?php echo $GLOBALS['sys_name']; ?> - Project News Highlights RSS" href="/export/rss_sfnews.php" type="application/rss+xml"/>
<link rel="alternate" title="<?php echo $GLOBALS['sys_name']; ?> - Project News Highlights RSS" href="/export/rss20_news.php" type="application/rss+xml"/>
<link rel="alternate" title="<?php echo $GLOBALS['sys_name']; ?> - New Projects RSS" href="/export/rss_sfprojects.php" type="application/rss+xml"/>
<script language="JavaScript" type="text/javascript">
<!--
function admin_window(adminurl) {
AdminWin = window.open( adminurl, 'AdminWindow','scrollbars=yes,resizable=yes, toolbar=yes, height=400, width=400, top=2, left=2');
AdminWin.focus();
}
function help_window(helpurl) {
HelpWin = window.open( helpurl,'HelpWindow','scrollbars=yes,resizable=yes,toolbar=no,height=400,width=400');
}
// -->
<?php plugin_hook ("javascript",false) ; ?>
</script>
<?php
/*
WARNING - changing this font call can affect
INTERNATIONALIZATION
*/
//gets font from Language Object
$site_fonts=$GLOBALS['Language']->getFont();
?>
<style type="text/css">
<!--
BODY {
margin-top: 3;
margin-left: 3;
margin-right: 3;
margin-bottom: 3;
background-image: url("<?php echo $this->imgroot; ?>theme-top-blue.png");
}
ol,ul,p,body,td,tr,th,form { font-family: <?php echo $site_fonts; ?>; font-size:<?php echo $this->FONTSIZE; ?>;
color: <?php echo $this->FONTCOLOR_CONTENT ?>; }
h1 { font-size: x-large; font-family: <?php echo $site_fonts; ?>; }
h2 { font-size: large; font-family: <?php echo $site_fonts; ?>; }
h3 { font-size: medium; font-family: <?php echo $site_fonts; ?>; }
h4 { font-size: small; font-family: <?php echo $site_fonts; ?>; }
h5 { font-size: x-small; font-family: <?php echo $site_fonts; ?>; }
h6 { font-size: xx-small; font-family: <?php echo $site_fonts; ?>; }
pre,tt { font-family: courier,sans-serif }
a:link { text-decoration:none; color: #0000be }
a:visited { text-decoration:none; color: #0000be }
a:active { text-decoration:none }
a:hover { text-decoration:underline; color:red }
.titlebar { color: black; text-decoration: none; font-weight: bold; }
a.tablink { color: black; text-decoration: none; font-weight: bold; font-size: <?php echo $this->FONTSIZE_SMALLER; ?>; }
a.tablink:visited { color: black; text-decoration: none; font-weight: bold; font-size: <?php echo $this->FONTSIZE_SMALLER; ?>; }
a.tablink:hover { text-decoration: none; color: black; font-weight: bold; font-size: <?php echo $this->FONTSIZE_SMALLER; ?>; }
a.tabsellink { color: #0000be; text-decoration: none; font-weight: bold; font-size: <?php echo $this->FONTSIZE_SMALLER; ?>; }
a.tabsellink:visited { color: #0000be; text-decoration: none; font-weight: bold; font-size: <?php echo $this->FONTSIZE_SMALLER; ?>; }
a.tabsellink:hover { text-decoration: none; color: #0000be; font-weight: bold; font-size: <?php echo $this->FONTSIZE_SMALLER; ?>; }
<?php plugin_hook ("cssstyle",$this) ; ?>
-->
</style>
<?php plugin_hook ('cssfile',$this); ?>
</head>
<body>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><a href="/"><?php echo html_image('logo.png',198,52,array('border'=>'0')); ?></a></td>
<td><?php echo $this->searchBox(); ?></td>
<td align="right"><?php
if (session_loggedin()) {
?>
<b><a style="color: #FFFFFF" href="/account/logout.php"><?php echo $Language->getText('common','logout'); ?></a></b><br />
<b><a style="color: #FFFFFF" href="/account/"><?php echo $Language->getText('common','myaccount'); ?></a></b>
<?php
} else {
?>
<b><a style="color: #FFFFFF" href="/account/login.php"><?php echo $Language->getText('common','login'); ?></a></b><br />
<b><a style="color: #FFFFFF" href="/account/register.php"><?php echo $Language->getText('common','newaccount'); ?></a></b>
<?php
}
echo $this->quickNav();
?></td>
<td> </td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td colspan="3">
<?php echo $this->outerTabs($params); ?>
</td>
<td> </td>
</tr>
<tr>
<td align="left" bgcolor="#E0E0E0" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topleft.png" height="9" width="9" alt="" /></td>
<td bgcolor="#E0E0E0" width="30"><img src="<?php echo $this->imgroot; ?>clear.png" width="30" height="1" alt="" /></td>
<td bgcolor="#E0E0E0"><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
<td bgcolor="#E0E0E0" width="30"><img src="<?php echo $this->imgroot; ?>clear.png" width="30" height="1" alt="" /></td>
<td align="right" bgcolor="#E0E0E0" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topright.png" height="9" width="9" alt="" /></td>
</tr>
<tr>
<!-- Outer body row -->
<td bgcolor="#E0E0E0"><img src="<?php echo $this->imgroot; ?>clear.png" width="10" height="1" alt="" /></td>
<td valign="top" width="99%" bgcolor="#E0E0E0" colspan="3">
<!-- Inner Tabs / Shell -->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
if (isset($params['group']) && $params['group']) {
?>
<tr>
<td> </td>
<td>
<?php
echo $this->projectTabs($params['toptab'],$params['group']);
?>
</td>
<td> </td>
</tr>
<?php
}
?>
<tr>
<td align="left" bgcolor="#ffffff" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topleft-inner.png" height="9" width="9" alt="" /></td>
<td bgcolor="#ffffff"><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
<td align="right" bgcolor="#ffffff" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topright-inner.png" height="9" width="9" alt="" /></td>
</tr>
<tr>
<td bgcolor="#ffffff"><img src="<?php echo $this->imgroot; ?>clear.png" width="10" height="1" alt="" /></td>
<td valign="top" width="99%" bgcolor="white">
<?php
}
function footer($params) {
?>
<!-- end main body row -->
</td>
<td width="10" bgcolor="#ffffff"><img src="<?php echo $this->imgroot; ?>clear.png" width="2" height="1" alt="" /></td>
</tr>
<tr>
<td align="left" bgcolor="#E0E0E0" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomleft-inner.png" height="11" width="11" alt="" /></td>
<td bgcolor="#ffffff"><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
<td align="right" bgcolor="#E0E0E0" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomright-inner.png" height="11" width="11" alt="" /></td>
</tr>
</table>
<!-- end inner body row -->
</td>
<td width="10" bgcolor="#E0E0E0"><img src="<?php echo $this->imgroot; ?>clear.png" width="2" height="1" alt="" /></td>
</tr>
<tr>
<td align="left" bgcolor="#E0E0E0" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomleft.png" height="9" width="9" alt="" /></td>
<td bgcolor="#E0E0E0" colspan="3"><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
<td align="right" bgcolor="#E0E0E0" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomright.png" height="9" width="9" alt="" /></td>
</tr>
</table>
<!-- PLEASE LEAVE "Powered By GForge" on your site -->
<br />
<center>
<a href="http://gforge.org/"><img src="/images/pow-gforge.png" alt="Powered By GForge Collaborative Development Environment" border="0" /></a>
</center>
<?php
global $sys_show_source;
global $Language;
if ($sys_show_source) {
global $SCRIPT_NAME;
print '<a class="showsource" href="/source.php?file=' . $SCRIPT_NAME . '"> '.$Language->getText('source','show_source').' </a>';
}
?>
</body>
</html>
<?php
}
function getRootIndex() {
return $this->rootindex;
}
/**
* boxTop() - Top HTML box
*
* @param string Box title
* @param bool Whether to echo or return the results
* @param string The box background color
*/
function boxTop($title) {
return '
<!-- Box Top Start -->
<table cellspacing="0" cellpadding="0" width="100%" border="0" background="'.$this->imgroot.'vert-grad.png">
<tr align="center">
<td valign="top" align="right" width="10" background="'.$this->imgroot.'box-topleft.png"><img src="'.$this->imgroot.'clear.png" width="10" height="20" /></td>
<td width="100%" background="'.$this->imgroot.'box-grad.png"><span class="titlebar">'.$title.'</span></td>
<td valign="top" width="10" background="'.$this->imgroot.'box-topright.png"><img src="'.$this->imgroot.'clear.png" width="10" height="20" /></td>
</tr>
<tr>
<td colspan="3">
<table cellspacing="2" cellpadding="2" width="100%" border="0">
<tr align="left">
<td colspan="2">
<!-- Box Top End -->';
}
/**
* boxMiddle() - Middle HTML box
*
* @param string Box title
* @param string The box background color
*/
function boxMiddle($title) {
return '
<!-- Box Middle Start -->
</td>
</tr>
<tr align="center">
<td colspan="2" background="'.$this->imgroot.'box-grad.png"><span class="titlebar">'.$title.'</span></td>
</tr>
<tr align="left">
<td colspan="2">
<!-- Box Middle End -->';
}
/**
* boxBottom() - Bottom HTML box
*
* @param bool Whether to echo or return the results
*/
function boxBottom() {
return '
<!-- Box Bottom Start -->
</td>
</tr>
</table>
</td>
</tr>
</table><br />
<!-- Box Bottom End -->';
}
/**
* boxGetAltRowStyle() - Get an alternating row style for tables
*
* @param int Row number
*/
function boxGetAltRowStyle($i) {
if ($i % 2 == 0) {
return 'bgcolor="#EAEAEA"';
} else {
return 'bgcolor="#E0E0E0"';
}
}
/**
* listTableTop() - Takes an array of titles and builds the first row of a new table.
*
* @param array The array of titles
* @param array The array of title links
*/
function listTableTop ($title_arr,$links_arr=false) {
$return = '
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr align="center">
<!-- <td valign="top" align="right" width="10" background="'.$this->imgroot.'box-grad.png"><img src="'.$this->imgroot.'box-topleft.png" width="10" height="75" /></td> -->
<td background="'.$this->imgroot.'box-grad.png">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>';
$count=count($title_arr);
if ($links_arr) {
for ($i=0; $i<$count; $i++) {
$return .= '
<td align="center"><a class="sortbutton" href="'.$links_arr[$i].'"><span style="color:'.
$this->FONTCOLOR_HTMLBOX_TITLE.'"><strong>'.$title_arr[$i].'</strong></span></a></td>';
}
} else {
for ($i=0; $i<$count; $i++) {
$return .= '
<td align="center"><span style="color:'.
$this->FONTCOLOR_HTMLBOX_TITLE.'"><strong>'.$title_arr[$i].'</strong></span></td>';
}
}
return $return.'</tr>';
}
function listTableBottom() {
return '</table></td>
<!-- <td valign="top" align="right" width="10" background="'.$this->imgroot.'box-grad.png"><img src="'.$this->imgroot.'box-topright.png" width="10" height="75" /></td> -->
</tr></table>';
}
function outerTabs($params) {
global $Language,$sys_use_trove,$sys_use_snippet,$sys_use_people;
$TABS_DIRS[]='/';
$TABS_DIRS[]='/my/';
if ($sys_use_trove) {
$TABS_DIRS[]='/softwaremap/';
}
if ($sys_use_snippet) {
$TABS_DIRS[]='/snippet/';
}
if ($sys_use_people) {
$TABS_DIRS[]='/people/';
}
$TABS_TITLES[]=$Language->getText('menu','home');
$TABS_TITLES[]=$Language->getText('menu','mypage');
if ($sys_use_trove) {
$TABS_TITLES[]=$Language->getText('menu','projectree');
}
if ($sys_use_snippet) {
$TABS_TITLES[]=$Language->getText('menu','code_snippet');
}
if ($sys_use_people) {
$TABS_TITLES[]=$Language->getText('menu','project_help_wanted');
}
if (user_ismember(1,'A')) {
$TABS_DIRS[]='/admin/';
$TABS_TITLES[]=$Language->getText('menu','admin');
}
if (user_ismember($GLOBALS['sys_stats_group'])) {
$TABS_DIRS[]='/reporting/';
$TABS_TITLES[]=$Language->getText('menu','reporting');
}
if(isset($params['group']) && $params['group']) {
// get group info using the common result set
$project =& group_get_object($params['group']);
if ($project && is_object($project)) {
if ($project->isError()) {
} elseif (!$project->isProject()) {
} else {
$TABS_DIRS[]='/projects/'.$project->getUnixName().'/';
$TABS_TITLES[]=$project->getPublicName();
$selected=count($TABS_DIRS)-1;
}
}
} elseif (strstr($GLOBALS['REQUEST_URI'],'/my/') || strstr($GLOBALS['REQUEST_URI'],'/account/') ||
strstr($GLOBALS['REQUEST_URI'],'/themes/') ) {
$selected=array_search("/my/", $TABS_DIRS);
} elseif (strstr($GLOBALS['REQUEST_URI'],'softwaremap')) {
$selected=array_search("/softwaremap/", $TABS_DIRS);
} elseif (strstr($GLOBALS['REQUEST_URI'],'/snippet/')) {
$selected=array_search("/snippet/", $TABS_DIRS);
} elseif (strstr($GLOBALS['REQUEST_URI'],'/people/')) {
$selected=array_search("/people/", $TABS_DIRS);
} elseif (strstr($GLOBALS['REQUEST_URI'],'/reporting/')) {
$selected=array_search('/reporting/',$TABS_DIRS);
} elseif (strstr($GLOBALS['REQUEST_URI'],'/admin/') && user_ismember(1,'A')) {
$selected=array_search('/admin/',$TABS_DIRS);;
} else {
$selected=0;
}
if (!$this->COLOR_SELECTED_TAB) {
$this->COLOR_SELECTED_TAB= '#e0e0e0';
}
echo $this->tabGenerator($TABS_DIRS,$TABS_TITLES,false,$selected,$this->COLOR_SELECTED_TAB,'100%');
}
/**
* projectTabs() - Prints out the project tabs, contained here in case
* we want to allow it to be overriden
*
* @param string Is the tab currently selected
* @param string Is the group we should look up get title info
*/
function projectTabs($toptab,$group) {
global $Language;
// get group info using the common result set
$project =& group_get_object($group);
if (!$project || !is_object($project)) {
return;
}
if ($project->isError()) {
//wasn't found or some other problem
return;
}
if (!$project->isProject()) {
return;
}
// Summary
$TABS_DIRS[]='/projects/'. $project->getUnixName() .'/';
$TABS_TITLES[]=$Language->getText('group','short_summary');
(($toptab == 'home') ? $selected=(count($TABS_TITLES)-1) : '' );
if (user_ismember($group,'A')) {
// Project Admin
$TABS_DIRS[]='/project/admin/?group_id='. $group;
$TABS_TITLES[]=$Language->getText('group','short_admin');
(($toptab == 'admin') ? $selected=(count($TABS_TITLES)-1) : '' );
}
/* Homepage
$TABS_DIRS[]='http://'. $project->getHomePage();
$TABS_TITLES[]=$Language->getText('group','short_homepage');
*/
// Forums
if ($project->usesForum()) {
$TABS_DIRS[]='/forum/?group_id='.$group;
$TABS_TITLES[]=$Language->getText('group','short_forum');
(($toptab == 'forums') ? $selected=(count($TABS_TITLES)-1) : '' );
}
// Artifact Tracking
if ($project->usesTracker()) {
$TABS_DIRS[]='/tracker/?group_id='.$group;
$TABS_TITLES[]=$Language->getText('group','short_tracker');
(($toptab == 'tracker' || $toptab == 'bugs' || $toptab == 'support' || $toptab == 'patch')
? $selected=(count($TABS_TITLES)-1) : '' );
}
// Mailing Lists
if ($project->usesMail()) {
$TABS_DIRS[]='/mail/?group_id='.$group;
$TABS_TITLES[]=$Language->getText('group','short_mail');
(($toptab == 'mail') ? $selected=(count($TABS_TITLES)-1) : '' );
}
// Project Manager
if ($project->usesPm()) {
$TABS_DIRS[]='/pm/?group_id='.$group;
$TABS_TITLES[]=$Language->getText('group','short_pm');
(($toptab == 'pm') ? $selected=(count($TABS_TITLES)-1) : '' );
}
// Doc Manager
if ($project->usesDocman()) {
$TABS_DIRS[]='/docman/?group_id='.$group;
$TABS_TITLES[]=$Language->getText('group','short_docman');
(($toptab == 'docman') ? $selected=(count($TABS_TITLES)-1) : '' );
}
// Surveys
if ($project->usesSurvey()) {
$TABS_DIRS[]='/survey/?group_id='.$group;
$TABS_TITLES[]=$Language->getText('group','short_survey');
(($toptab == 'surveys') ? $selected=(count($TABS_TITLES)-1) : '' );
}
//newsbytes
if ($project->usesNews()) {
$TABS_DIRS[]='/news/?group_id='.$group;
$TABS_TITLES[]=$Language->getText('group','short_news');
(($toptab == 'news') ? $selected=(count($TABS_TITLES)-1) : '' );
}
// SCM systems
if ($project->usesSCM()) {
$TABS_DIRS[]='/scm/?group_id='.$group;
$TABS_TITLES[]=$Language->getText('group','short_scm');
(($toptab == 'scm') ? $selected=(count($TABS_TITLES)-1) : '' );
}
// groupmenu_after_scm hook
$hookParams['DIRS'] = &$TABS_DIRS;
$hookParams['TITLES'] = &$TABS_TITLES;
$hookParams['toptab'] = &$toptab;
$hookParams['selected'] = &$selected;
$hookParams['group_id'] = $group ;
plugin_hook ("groupmenu_scm", $hookParams) ;
// Downloads
if ($project->usesFRS()) {
$TABS_DIRS[]='/frs/?group_id='.$group;
$TABS_TITLES[]=$Language->getText('group','short_files');
(($toptab == 'frs') ? $selected=(count($TABS_TITLES)-1) : '' );
}
// groupmenu hook
$hookParams['DIRS'] = &$TABS_DIRS;
$hookParams['TITLES'] = &$TABS_TITLES;
$hookParams['toptab'] = &$toptab;
$hookParams['selected'] = &$selected;
$hookParams['group'] = $group;
plugin_hook ("groupmenu", $hookParams) ;
echo $this->tabGenerator($TABS_DIRS,$TABS_TITLES,true,$selected,'white','100%');
}
function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='WHITE',$total_width='100%') {
$count=count($TABS_DIRS);
$width=intval((100/$count));
$return = '';
$return .= '
<!-- start tabs -->
<table border="0" cellpadding="0" cellspacing="0" width="'.$total_width.'">
<tr>';
if ($nested) {
$inner='bottomtab';
} else {
$inner='toptab';
}
$rowspan = '';
for ($i=0; $i<$count; $i++) {
if ($i == 0) {
//
// this is the first tab, choose an image with end-name
//
$wassel=false;
$issel=($selected==$i);
$bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png');
// $rowspan=(($issel)?'rowspan="2" ' : '');
$return .= '
<td '.$rowspan.'valign="top" width="10" background="'.$this->imgroot . 'theme-'.$inner.'-end-'.(($issel) ? '' : 'not').'selected.png">'.
'<img src="'.$this->imgroot . 'clear.png" height="25" width="10" alt="" /></td>'.
'<td '.$rowspan.'background="'.$this->imgroot . $bgimg.'" width="'.$width.'%" align="center"><a class="'. (($issel)?'tabsellink':'tablink') .'" href="'.$TABS_DIRS[$i].'">'.$TABS_TITLES[$i].'</a></td>';
} elseif ($i==$count-1) {
//
// this is the last tab, choose an image with name-end
//
$wassel=($selected==$i-1);
$issel=($selected==$i);
$bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png');
// $rowspan=(($issel)?'rowspan="2" ' : '');
//
// Build image between current and prior tab
//
$return .= '
<td '.$rowspan.'colspan="2" valign="top" width="20" background="'.$this->imgroot . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png">'.
'<img src="'.$this->imgroot . 'clear.png" height="2" width="20" alt="" /></td>'.
'<td '.$rowspan.'background="'.$this->imgroot . $bgimg.'" width="'.$width.'%" align="center"><a class="'. (($issel)?'tabsellink':'tablink') .'" href="'.$TABS_DIRS[$i].'">'.$TABS_TITLES[$i].'</a></td>';
//
// Last graphic on right-side
//
$return .= '
<td '.$rowspan.'valign="top" width="10" background="'.$this->imgroot . 'theme-'.$inner.'-'.(($issel) ? '' : 'not').'selected-end.png">'.
'<img src="'.$this->imgroot . 'clear.png" height="2" width="10" alt="" /></td>';
} else {
//
// middle tabs
//
$wassel=($selected==$i-1);
$issel=($selected==$i);
$bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png');
// $rowspan=(($issel)?'rowspan="2" ' : '');
//
// Build image between current and prior tab
//
$return .= '
<td '.$rowspan.'colspan="2" valign="top" width="20" background="'.$this->imgroot . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png">'.
'<img src="'.$this->imgroot . 'clear.png" height="2" width="20" alt="" /></td>'.
'<td '.$rowspan.'background="'.$this->imgroot . $bgimg.'" width="'.$width.'%" align="center"><a class="'. (($issel)?'tabsellink':'tablink') .'" href="'.$TABS_DIRS[$i].'">'.$TABS_TITLES[$i].'</a></td>';
}
}
$return .= '</tr>';
//
// Building a bottom row in this table, which will be darker
//
if ($selected == 0) {
$beg_cols=0;
$end_cols=((count($TABS_DIRS)*3)-3);
} elseif ($selected == (count($TABS_DIRS)-1)) {
$beg_cols=((count($TABS_DIRS)*3)-3);
$end_cols=0;
} else {
$beg_cols=($selected*3);
$end_cols=(((count($TABS_DIRS)*3)-3)-$beg_cols);
}
$return .= '<tr>';
if ($beg_cols > 0) {
$return .= '<td colspan="'.$beg_cols.'" height="1" bgcolor="#909090"><img src="'.$this->imgroot.'clear.png" height="1" width="10" /></td>';
}
$return .= '<td colspan="3" height="1" bgcolor="'.$sel_tab_bgcolor.'"><img src="'.$this->imgroot.'clear.png" height="1" width="10" /></td>';
if ($end_cols > 0) {
$return .= '<td colspan="'.$end_cols.'" height="1" bgcolor="#909090"><img src="'.$this->imgroot.'clear.png" height="1" width="10" /></td>';
}
$return .= '</tr>';
/*
$bgcolor=(($selected==$i)?$light:$dark);
$imgcolor=(($selected==$i)?'':'-dark');
$return .= '
<td '.$bgcolor.' width="9" valign="top">'.
'<div align="left">'. html_image('tabs/topleft'.$inner.$imgcolor.'.png',9,9,array()).'</div></td>
<td '.$bgcolor.' width="'.$width.'%" rowspan="2" align="center">'.
'<a class="'. (($selected==$i)?'tabsellink':'tablink') .'" href="'. $TABS_DIRS[$i] .
'">'. $TABS_TITLES[$i] .'</a></td>
<td '.$bgcolor.' width="9" valign="top">'.
'<div align="right">'. html_image('tabs/topright'.$inner.$imgcolor.'.png',9,9,array()).'</div></td>';
if ($i < $count-1) {
$return .= '<td width="1" rowspan="2"><img src="'.$this->imgroot . 'clear.png" height="2" width="1" alt="" /></td>';
}
}
$return .= '
</tr>
<tr>';
for ($i=0; $i<$count; $i++) {
$bgcolor=(($selected==$i)?$light:$dark);
$return .= '<td '.$bgcolor.'> </td>';
$return .= '<td '.$bgcolor.'> </td>';
}
$return .= '
</tr>
<tr>';
for ($i=0; $i<$count; $i++) {
$bgcolor=(($selected==$i)?$light:'style="background-color:#999999"');
$return .= '<td '.$bgcolor.' colspan="4"><img src="'.$this->imgroot . 'clear.png" height="2" width="1" alt="" /></td>';
}
*/
return $return.'
</table>
<!-- end tabs -->
';
}
function searchBox() {
global $Language,$words,$forum_id,$group_id,$group_project_id,$atid,$exact,$type_of_search;
if(get_magic_quotes_gpc()) {
$defaultWords = stripslashes($words);
} else {
$defaultWords = $words;
}
$defaultWords = htmlspecialchars($defaultWords);
// if there is no search currently, set the default
if ( ! isset($type_of_search) ) {
$exact = 1;
}
print '
<form action="/search/" method="get">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td>
<div align="center" style="font-size:smaller">';
$parameters = array(
SEARCH__PARAMETER_GROUP_ID => $group_id,
SEARCH__PARAMETER_ARTIFACT_ID => $atid,
SEARCH__PARAMETER_FORUM_ID => $forum_id,
SEARCH__PARAMETER_GROUP_PROJECT_ID => $group_project_id
);
$searchManager =& getSearchManager();
$searchManager->setParametersValues($parameters);
$searchEngines =& $searchManager->getAvailableSearchEngines();
echo '<select name="type_of_search">';
for($i = 0, $max = count($searchEngines); $i < $max; $i++) {
$searchEngine =& $searchEngines[$i];
echo '<option value="'.$searchEngine->getType().'"'.( $type_of_search == $searchEngine->getType() ? ' selected="selected"' : '' ).'>'.$searchEngine->getLabel($parameters).'</option>'."\n";
}
echo '</select></div>';
// print '<br />';
// print '
// <input type="CHECKBOX" name="exact" value="1"'.( $exact ? ' CHECKED' : ' UNCHECKED' ).'> Require All Words';
print '</td><td> ';
$parameters = $searchManager->getParameters();
foreach($parameters AS $name => $value) {
print '<input type="hidden" value="'.$value.'" name="'.$name.'" />';
}
print '</td><td>';
print '<input type="text" size="12" name="words" value="'.$defaultWords.'" />';
print '</td><td> </td><td>';
print '<input type="submit" name="Search" value="'.$Language->getText('searchbox','search').'" />';
print '</td>';
if (isset($group_id)) {
print '
<td width="10"> </td>
<td><b><a href="/search/advanced_search.php?group_id='.$group_id.'"> '.$Language->getText('searchbox', 'advanced_search').'</a></b></td>';
}
print '</tr></table>';
print '</form>';
}
function advancedSearchBox($sectionsArray, $group_id, $words, $isExact) {
global $Language;
// display the searchmask
print '
<form name="advancedsearch" action="'.$PHP_SELF.'" method="post">
<input type="hidden" name="search" value="1"/>
<input type="hidden" name="group_id" value="'.$group_id.'"/>
<div align="center"><br />
<table border="0">
<tr>
<td colspan ="2">
<input type="text" size="60" name="words" value="'.stripslashes(htmlspecialchars($words)).'" />
<input type="submit" name="submitbutton" value="'.$Language->getText('advanced_search', 'search_button').'" />
</td>
</tr>
<tr>
<td valign="top">
<input type="radio" name="mode" value="'.SEARCH__MODE_AND.'" '.($isExact ? 'checked="checked"' : '').' />'.$Language->getText('advanced_search', 'and_search').'
</td>
<td>
<input type="radio" name="mode" value="'.SEARCH__MODE_OR.'" '.(!$isExact ? 'checked="checked"' : '').' />'.$Language->getText('advanced_search', 'or_search').'
</td>
</tr>
</table><br /></div>'
.$this->createUnderSections($sectionsArray).'
</form>';
//create javascript methods for select none/all
print '
<script type="text/javascript">
<!-- method for disable/enable checkboxes
function setCheckBoxes(parent, checked) {
for (var i = 0; i < document.advancedsearch.elements.length; i++)
if (document.advancedsearch.elements[i].type == "checkbox")
if (document.advancedsearch.elements[i].name.substr(0, parent.length) == parent)
document.advancedsearch.elements[i].checked = checked;
}
//-->
</script>
';
}
function createUnderSections($sectionsArray) {
global $Language;
$countLines = 0;
foreach ($sectionsArray as $section) {
if(is_array($section)) {
$countLines += (3 + count ($section));
} else {
//2 lines one for section name and one for checkbox
$countLines += 3;
}
}
$breakLimit = round($countLines/3);
$break = $breakLimit;
$countLines = 0;
$return = '
<table width="100%" border="0" cellspacing="0" cellpadding="1" style="background-color:'. $this->COLOR_LTBACK2.'">
<tr>
<td>
<table width="100%" cellspacing="0" border="0" style="background-color:'. $this->COLOR_LTBACK1.'">
<tr style="font-weight: bold;background-color:'. $this->COLOR_LTBACK2 .'">
<td colspan="2">'.$Language->getText('advanced_search', 'search_in').':</td>
<td align="right">'.$Language->getText('advanced_search', 'select').' <a href="javascript:setCheckBoxes(\'\', true)">'.$Language->getText('advanced_search', 'all').'</a> / <a href="javascript:setCheckBoxes(\'\', false)">'.$Language->getText('advanced_search', 'none').'</a></td>
</tr>
<tr height="20">
<td colspan="3"> </td>
</tr>
<tr align="center" valign="top">
<td>';
foreach($sectionsArray as $key => $section) {
$oldcountlines = $countLines;
if (is_array($section)) {
$countLines += (3 + count ($section));
} else {
$countLines += 3;
}
if ($countLines >= $break) {
//if the next block is so large that shifting it to the next column hits the breakpoint better
//the second part of statement (behind &&) proofs, that no 4th column is added
if ((($countLines - $break) >= ($break - $countLines)) && ((($break + $breakLimit)/$breakLimit) <= 3)) {
$return .= '</td><td>';
$break += $breakLimit;
}
}
$return .= '<table width="90%" border="0" cellpadding="1" cellspacing="0" style="background-color:'. $this->COLOR_LTBACK2.'">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr style="background-color:'. $this->COLOR_LTBACK2 .'; font-weight: bold">
<td cellspacing="0">
<a href="#'.$key.'">'.$Language->getText('group', $key).'</a>'
.' </td>
<td align="right">'
.$Language->getText('advanced_search', 'select').' <a href="javascript:setCheckBoxes(\''.$key.'\', true)">'.$Language->getText('advanced_search', 'all').'</a> / <a href="javascript:setCheckBoxes(\''.$key.'\', false)">'.$Language->getText('advanced_search', 'none').'</a>
</td>
</tr>
<tr style="background-color:'. $this->COLOR_LTBACK1.'">
<td colspan="2">';
if (!is_array($section)) {
$return .= ' <input type="checkbox" name="'.urlencode($key).'"';
if (isset($GLOBALS[urlencode($key)]))
$return .= ' checked="checked" ';
$return .= ' /></input>'.$Language->getText('group', $key).'<br />';
}
else
foreach($section as $underkey => $undersection) {
$return .= ' <input type="checkbox" name="'.urlencode($key.$underkey).'"';
if (isset($GLOBALS[urlencode($key.$underkey)]))
$return .= ' checked ';
$return .= '></input>'.$undersection.'<br />';
}
$return .= ' </td>
</tr>
</table></td></tr></table><br />';
if ($countLines >= $break) {
if (($countLines - $break) < ($break - $countLines)) {
$return .= '</td><td width="33%">';
$break += $breakLimit;
}
}
}
return $return.' </td>
</tr>
</table></td></tr></table>';
}
/**
* beginSubMenu() - Opening a submenu.
*
* @return string Html to start a submenu.
*/
function beginSubMenu () {
$return = '
<p><strong>';
return $return;
}
/**
* endSubMenu() - Closing a submenu.
*
* @return string Html to end a submenu.
*/
function endSubMenu () {
$return = '</strong></p>';
return $return;
}
/**
* printSubMenu() - Takes two array of titles and links and builds the contents of a menu.
*
* @param array The array of titles.
* @param array The array of title links.
* @return string Html to build a submenu.
*/
function printSubMenu ($title_arr,$links_arr) {
$count=count($title_arr);
$count--;
$return = '';
for ($i=0; $i<$count; $i++) {
$return .= '
<a href="'.$links_arr[$i].'">'.$title_arr[$i].'</a> | ';
}
$return .= '
<a href="'.$links_arr[$i].'">'.$title_arr[$i].'</a>';
return $return;
}
/**
* subMenu() - Takes two array of titles and links and build a menu.
*
* @param array The array of titles.
* @param array The array of title links.
* @return string Html to build a submenu.
*/
function subMenu ($title_arr,$links_arr) {
$return = $this->beginSubMenu () ;
$return .= $this->printSubMenu ($title_arr,$links_arr) ;
$return .= $this->endSubMenu () ;
return $return;
}
/**
* multiTableRow() - create a mutlilevel row in a table
*
* @param string the row attributes
* @param array the array of cell data, each element is an array,
* the first item being the text,
* the subsequent items are attributes (dont include
* the bgcolor for the title here, that will be
* handled by $istitle
* @param boolean is this row part of the title ?
*
*/
function multiTableRow($row_attr, $cell_data, $istitle) {
$return= '
<tr '.$row_attr;
if ( $istitle ) {
$return .=' align="center" bgcolor="'. $this->COLOR_HTMLBOX_TITLE .'"';
}
$return .= '>';
for ( $c = 0; $c < count($cell_data); $c++ ) {
$return .='<td ';
for ( $a=1; $a < count($cell_data[$c]); $a++) {
$return .= $cell_data[$c][$a].' ';
}
$return .= '>';
if ( $istitle ) {
$return .='<font color="'.$this->FONTCOLOR_HTMLBOX_TITLE.'"><strong>';
}
$return .= $cell_data[$c][0];
if ( $istitle ) {
$return .='</strong></font>';
}
$return .= '</td>';
}
$return .= '</tr>
';
return $return;
}
/**
* feedback() - returns the htmlized feedback string when an action is performed.
*
* @param string feedback string
* @return string htmlized feedback
*/
function feedback($feedback) {
if (!$feedback) {
return '';
} else {
return '
<h3 style="color:red">'.strip_tags($feedback, '<br>').'</h3>';
}
}
/**
* getThemeIdFromName()
*
* @param string the dirname of the theme
* @return integer the theme id
*/
function getThemeIdFromName($dirname) {
$res=db_query("SELECT theme_id FROM themes WHERE dirname='$dirname'");
return db_result($res,0,'theme_id');
}
function quickNav() {
if (!session_loggedin()) {
return '';
} else {
$res=db_query("SELECT * FROM groups NATURAL JOIN user_group WHERE user_id='".user_getid()."' ORDER BY group_name");
echo db_error();
if (!$res || db_numrows($res) < 1) {
return '';
} else {
$ret = '
<form name="quicknavform">
<select name="quicknav" onChange="location.href=document.quicknavform.quicknav.value">';
$ret .= '
<option value="">Quick Jump To...</option>';
for ($i=0; $i<db_numrows($res); $i++) {
$ret .= '
<option value="/projects/'.db_result($res,$i,'unix_group_name').'/">'.db_result($res,$i,'group_name').'</option>';
if (trim(db_result($res,$i,'admin_flags'))=='A') {
$ret .= '
<option value="/project/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
}
//tracker
if (db_result($res,$i,'use_tracker')) {
$ret .= '
<option value="/tracker/?group_id='.db_result($res,$i,'group_id').'"> Tracker</option>';
if (db_result($res,$i,'admin_flags') || db_result($res,$i,'tracker_flags')) {
$ret .= '
<option value="/tracker/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
}
}
//task mgr
if (db_result($res,$i,'use_pm')) {
$ret .= '
<option value="/pm/?group_id='.db_result($res,$i,'group_id').'"> Task Manager</option>';
if (trim(db_result($res,$i,'admin_flags')) =='A' || db_result($res,$i,'project_flags')) {
$ret .= '
<option value="/pm/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
}
}
//FRS
if (db_result($res,$i,'use_frs')) {
$ret .= '
<option value="/frs/?group_id='.db_result($res,$i,'group_id').'"> Files</option>';
if (trim(db_result($res,$i,'admin_flags'))=='A' || db_result($res,$i,'release_flags')) {
$ret .= '
<option value="/frs/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
}
}
//SCM
if (db_result($res,$i,'use_scm')) {
$ret .= '
<option value="/scm/?group_id='.db_result($res,$i,'group_id').'"> SCM</option>';
/*if (db_result($res,$i,'admin_flags') || db_result($res,$i,'project_flags')) {
$ret .= '
<option value="/pm/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
} */
}
//forum
if (db_result($res,$i,'use_forum')) {
$ret .= '
<option value="/forum/?group_id='.db_result($res,$i,'group_id').'"> Forum</option>';
if (trim(db_result($res,$i,'admin_flags'))=='A' || db_result($res,$i,'forum_flags')) {
$ret .= '
<option value="/forum/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
}
}
//mail
if (db_result($res,$i,'use_mail')) {
$ret .= '
<option value="/mail/?group_id='.db_result($res,$i,'group_id').'"> Lists</option>';
if (trim(db_result($res,$i,'admin_flags'))=='A') {
$ret .= '
<option value="/mail/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
}
}
//doc
if (db_result($res,$i,'use_docman')) {
$ret .= '
<option value="/docman/?group_id='.db_result($res,$i,'group_id').'"> Docs</option>';
if (trim(db_result($res,$i,'admin_flags'))=='A' || db_result($res,$i,'doc_flags')) {
$ret .= '
<option value="/docman/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
}
}
//news
if (db_result($res,$i,'use_news')) {
$ret .= '
<option value="/news/?group_id='.db_result($res,$i,'group_id').'"> News</option>';
if (trim(db_result($res,$i,'admin_flags'))=='A') {
$ret .= '
<option value="/news/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
}
}
//survey
if (db_result($res,$i,'use_survey')) {
$ret .= '
<option value="/survey/?group_id='.db_result($res,$i,'group_id').'"> Surveys</option>';
if (trim(db_result($res,$i,'admin_flags'))=='A') {
$ret .= '
<option value="/survey/admin/?group_id='.db_result($res,$i,'group_id').'"> Admin</option>';
}
}
}
$ret .= '
</select>
</form>';
}
}
return $ret;
}
}
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
?>
|