1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved |
4
|
|
|
* |
5
|
|
|
* This file is a part of Codendi. |
6
|
|
|
* |
7
|
|
|
* Codendi is free software; you can redistribute it and/or modify |
8
|
|
|
* it under the terms of the GNU General Public License as published by |
9
|
|
|
* the Free Software Foundation; either version 2 of the License, or |
10
|
|
|
* (at your option) any later version. |
11
|
|
|
* |
12
|
|
|
* Codendi is distributed in the hope that it will be useful, |
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15
|
|
|
* GNU General Public License for more details. |
16
|
|
|
* |
17
|
|
|
* You should have received a copy of the GNU General Public License |
18
|
|
|
* along with Codendi. If not, see <http://www.gnu.org/licenses/>. |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
require_once('Layout.class.php'); |
22
|
|
|
class TabbedLayout extends Layout { |
23
|
|
|
|
24
|
|
|
function getBodyHeader($params) { |
25
|
|
|
$output = ' |
26
|
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%"> |
27
|
|
|
<tr> |
28
|
|
|
<td class="header_osdn">'.$this->getOsdnNavBar().'</td> |
29
|
|
|
<td class="header_actions"> |
30
|
|
|
<ul>'; |
31
|
|
|
if (user_isloggedin()) { |
32
|
|
|
|
33
|
|
|
$output .= '<li class="header_actions_nolink">'.$GLOBALS['Language']->getText('include_menu','logged_in').': '.user_getname().'</li>'; |
34
|
|
|
$output .= '<li><a href="/account/logout.php">'.$GLOBALS['Language']->getText('include_menu','logout').'</a></li>'; |
35
|
|
|
if((isset($GLOBALS['sys_use_project_registration']) && $GLOBALS['sys_use_project_registration'] ==1) || !isset($GLOBALS['sys_use_project_registration'])) { |
36
|
|
|
$output .= '<li><a href="/project/register.php">'.$GLOBALS['Language']->getText('include_menu','register_new_proj').'</a></li>'; |
37
|
|
|
} |
38
|
|
|
$request = HTTPRequest::instance(); |
39
|
|
|
if (!$request->isPost()) { |
40
|
|
|
$bookmark_title = urlencode( str_replace($GLOBALS['sys_name'].': ', '', $params['title'])); |
41
|
|
|
$output .= '<li class="bookmarkpage"><a href="/my/bookmark_add.php?bookmark_url='.urlencode($_SERVER['REQUEST_URI']).'&bookmark_title='.$bookmark_title.'">'.$GLOBALS['Language']->getText('include_menu','bookmark_this_page').'</a></li>'; |
42
|
|
|
} |
43
|
|
|
} else { |
44
|
|
|
$output .= '<li class="header_actions_nolink highlight">'.$GLOBALS['Language']->getText('include_menu','not_logged_in').'</li>'; |
45
|
|
|
$output .= '<li><a href="/account/login.php">'.$GLOBALS['Language']->getText('include_menu','login').'</a></li>'; |
46
|
|
|
|
47
|
|
|
$em =& EventManager::instance(); |
48
|
|
|
$display_new_user = true; |
49
|
|
|
$params = array('allow' => &$display_new_user); |
50
|
|
|
$em->processEvent('display_newaccount', $params); |
51
|
|
|
if ($display_new_user) { |
52
|
|
|
$output .= '<li><a href="/account/register.php">'.$GLOBALS['Language']->getText('include_menu','new_user').'</a></li>'; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
} |
56
|
|
|
$output .= '</ul> |
57
|
|
|
</td> |
58
|
|
|
</tr> |
59
|
|
|
<tr> |
60
|
|
|
<td class="header_logo"> |
61
|
|
|
<a class="header_logo" href="/"><img src="'.$this->imgroot.'organization_logo.png" /></a> |
62
|
|
|
</td> |
63
|
|
|
<td class="header_searchbox"><br />'.$this->getSearchBox().'</td> |
64
|
|
|
</tr> |
65
|
|
|
</table>'; |
66
|
|
|
return $output; |
67
|
|
|
} |
68
|
|
|
/** |
69
|
|
|
* header() - "steel theme" top of page |
70
|
|
|
* |
71
|
|
|
* @param array Header parameters array |
72
|
|
|
*/ |
73
|
|
|
function header($params) { |
74
|
|
|
global $Language; |
75
|
|
|
|
76
|
|
|
$this->generic_header($params); |
77
|
|
|
?> |
78
|
|
|
|
79
|
|
|
|
80
|
|
|
<body class="<?php echo $this->getClassnamesForBodyTag() ?>"> |
81
|
|
|
<div id="header"><?php echo $this->getBodyHeader($params); ?></div> |
82
|
|
|
|
83
|
|
|
<table border="0" width="100%" cellspacing="0" cellpadding="0"> |
84
|
|
|
|
85
|
|
|
<tr> |
86
|
|
|
<td> </td> |
87
|
|
|
<td colspan="3"> |
88
|
|
|
|
89
|
|
|
<?php echo $this->outerTabs($params); ?> |
90
|
|
|
|
91
|
|
|
</td> |
92
|
|
|
<td> </td> |
93
|
|
|
</tr> |
94
|
|
|
|
95
|
|
|
<tr class="row_below_outertabs"> |
96
|
|
|
<td align="left" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topleft.png" height="9" width="9" alt="" /></td> |
97
|
|
|
<td width="30"><img src="<?php echo $this->imgroot; ?>clear.png" width="30" height="1" alt="" /></td> |
98
|
|
|
<td><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td> |
99
|
|
|
<td width="30"><img src="<?php echo $this->imgroot; ?>clear.png" width="30" height="1" alt="" /></td> |
100
|
|
|
<td align="right" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topright.png" height="9" width="9" alt="" /></td> |
101
|
|
|
</tr> |
102
|
|
|
|
103
|
|
|
<tr class="outer_body_row"> |
104
|
|
|
|
105
|
|
|
<!-- Outer body row --> |
106
|
|
|
|
107
|
|
|
<td ><img src="<?php echo $this->imgroot; ?>clear.png" width="10" height="1" alt="" /></td> |
108
|
|
|
<td valign="top" width="99%" colspan="3"> |
109
|
|
|
|
110
|
|
|
<!-- Inner Tabs / Shell --> |
111
|
|
|
|
112
|
|
|
<table border="0" width="100%" cellspacing="0" cellpadding="0"> |
113
|
|
|
<?php |
114
|
|
|
|
115
|
|
|
|
116
|
|
|
if (isset($params['group']) && $params['group']) { |
117
|
|
|
?> |
118
|
|
|
<tr> |
119
|
|
|
<td> </td> |
120
|
|
|
<td> |
121
|
|
|
<?php |
122
|
|
|
|
123
|
|
|
echo $this->projectTabs($params['toptab'],$params['group']); |
124
|
|
|
|
125
|
|
|
?> |
126
|
|
|
</td> |
127
|
|
|
<td> </td> |
128
|
|
|
</tr> |
129
|
|
|
<?php |
130
|
|
|
|
131
|
|
|
} else if ((isset($params['selected_top_tab']) && $params['selected_top_tab'] == '/my/') || |
132
|
|
|
strstr(getStringFromServer('REQUEST_URI'),'/my/') || |
133
|
|
|
strstr(getStringFromServer('REQUEST_URI'),'/account/')) { |
134
|
|
|
?> |
135
|
|
|
<tr> |
136
|
|
|
<td> </td> |
137
|
|
|
<td> |
138
|
|
|
<?php |
139
|
|
|
echo $this->tabGenerator(array( |
140
|
|
|
'/my/', |
141
|
|
|
'/account/', |
142
|
|
|
), array( |
143
|
|
|
$Language->getText('my_index','my_dashboard'), |
144
|
|
|
$Language->getText('my_index','account_maintenance'), |
145
|
|
|
), |
146
|
|
|
true, |
147
|
|
|
(isset($params['selected_top_tab']) && $params['selected_top_tab'] == '/my/') || |
148
|
|
|
strstr(getStringFromServer('REQUEST_URI'),'/my/') ? 0 : |
149
|
|
|
(strstr(getStringFromServer('REQUEST_URI'),'/account') ? 2 : 1) |
150
|
|
|
, |
151
|
|
|
'WHITE', //deprecated |
152
|
|
|
''); |
153
|
|
|
|
154
|
|
|
|
155
|
|
|
?> |
156
|
|
|
</td> |
157
|
|
|
<td> </td> |
158
|
|
|
</tr> |
159
|
|
|
<?php |
160
|
|
|
} |
161
|
|
|
$main_body_class = ''; |
162
|
|
|
if (isset($params['toptab']) && is_string($params['toptab'])) { |
163
|
|
|
$main_body_class = 'service-' . $params['toptab']; |
164
|
|
|
} |
165
|
|
|
?> |
166
|
|
|
<tr class="start_main_body_row"> |
167
|
|
|
<td align="left" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topleft-inner.png" height="9" width="9" alt="" /></td> |
168
|
|
|
<td><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td> |
169
|
|
|
<td align="right" width="9"><img src="<?php echo $this->imgroot; ?>tabs/topright-inner.png" height="9" width="9" alt="" /></td> |
170
|
|
|
</tr> |
171
|
|
|
|
172
|
|
|
<tr class="main_body_row"> |
173
|
|
|
<td><img src="<?php echo $this->imgroot; ?>clear.png" width="10" height="1" alt="" /></td> |
174
|
|
|
<td valign="top" width="99%" class="contenttable <?=$main_body_class;?>"> |
175
|
|
|
|
176
|
|
|
<?php |
177
|
|
|
echo $this->getBreadCrumbs(); |
178
|
|
|
echo $this->getToolbar(); |
179
|
|
|
$this->_feedback->display(); |
180
|
|
|
echo $this->getNotificationPlaceholder(); |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
function footer($params) { |
184
|
|
|
|
185
|
|
|
?> |
186
|
|
|
|
187
|
|
|
<!-- end main body row --> |
188
|
|
|
|
189
|
|
|
|
190
|
|
|
</td> |
191
|
|
|
<td width="10"><img src="<?php echo $this->imgroot; ?>clear.png" width="2" height="1" alt="" /></td> |
192
|
|
|
</tr> |
193
|
|
|
<tr class="end_main_body_row"> |
194
|
|
|
<td align="left" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomleft-inner.png" height="11" width="11" alt="" /></td> |
195
|
|
|
<td ><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td> |
196
|
|
|
<td align="right" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomright-inner.png" height="11" width="11" alt="" /></td> |
197
|
|
|
</tr> |
198
|
|
|
</table> |
199
|
|
|
|
200
|
|
|
<!-- end inner body row --> |
201
|
|
|
|
202
|
|
|
</td> |
203
|
|
|
<td width="10"><img src="<?php echo $this->imgroot; ?>clear.png" width="2" height="1" alt="" /></td> |
204
|
|
|
</tr> |
205
|
|
|
<tr class="end_inner_body_row"> |
206
|
|
|
<td align="left" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomleft.png" height="9" width="9" alt="" /></td> |
207
|
|
|
<td colspan="3"><img src="<?php echo $this->imgroot; ?>clear.png" width="1" height="1" alt="" /></td> |
208
|
|
|
<td align="right" width="9"><img src="<?php echo $this->imgroot; ?>tabs/bottomright.png" height="9" width="9" alt="" /></td> |
209
|
|
|
</tr> |
210
|
|
|
<?php echo $this->getCustomFooter(); ?> |
211
|
|
|
</table> |
212
|
|
|
|
213
|
|
|
<?php |
214
|
|
|
$this->generic_footer($params); |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
function getCustomFooter() { |
218
|
|
|
return ''; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* boxTop() - Top HTML box |
224
|
|
|
* |
225
|
|
|
* @param string Box title |
226
|
|
|
* @param bool Whether to echo or return the results |
227
|
|
|
* @param string The box background color |
228
|
|
|
*/ |
229
|
|
|
function boxTop($title) { |
230
|
|
|
return ' |
231
|
|
|
<!-- Box Top Start --> |
232
|
|
|
|
233
|
|
|
<table cellspacing="0" cellpadding="0" width="100%" border="0" class="boxtop"> |
234
|
|
|
<tr align="center" class="boxtop_top"> |
235
|
|
|
<td class="boxtop_left" valign="top" align="right" width="10" background="'.$this->imgroot.'box-topleft.png"><img src="'.$this->imgroot.'clear.png" width="10" height="20" /></td> |
236
|
|
|
<td class="boxtop_center" width="100%"><span class="titlebar">'.$title.'</span></td> |
237
|
|
|
<td class="boxtop_right" valign="top" width="10"><img src="'.$this->imgroot.'clear.png" width="10" height="20" /></td> |
238
|
|
|
</tr> |
239
|
|
|
<tr> |
240
|
|
|
<td colspan="3"> |
241
|
|
|
<table class="boxtop_inner" cellspacing="0" cellpadding="2" width="100%" border="0"> |
242
|
|
|
<tr align="left""> |
243
|
|
|
<td colspan="2" > |
244
|
|
|
|
245
|
|
|
<!-- Box Top End -->'; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
/** |
249
|
|
|
* boxMiddle() - Middle HTML box |
250
|
|
|
* |
251
|
|
|
* @param string Box title |
252
|
|
|
* @param string The box background color |
253
|
|
|
*/ |
254
|
|
|
function boxMiddle($title) { |
255
|
|
|
return ' |
256
|
|
|
<!-- Box Middle Start --> |
257
|
|
|
</td> |
258
|
|
|
</tr> |
259
|
|
|
<tr align="center" class="boxmiddle"> |
260
|
|
|
<td colspan="2"><span class="titlebar">'.$title.'</span></td> |
261
|
|
|
</tr> |
262
|
|
|
<tr align="left" class="boxmiddle_inner"> |
263
|
|
|
<td colspan="2"> |
264
|
|
|
<!-- Box Middle End -->'; |
265
|
|
|
} |
266
|
|
|
|
267
|
|
|
/** |
268
|
|
|
* boxBottom() - Bottom HTML box |
269
|
|
|
* |
270
|
|
|
* @param bool Whether to echo or return the results |
271
|
|
|
*/ |
272
|
|
|
function boxBottom() { |
273
|
|
|
return ' |
274
|
|
|
<!-- Box Bottom Start --> |
275
|
|
|
</td> |
276
|
|
|
</tr> |
277
|
|
|
</table> |
278
|
|
|
</td> |
279
|
|
|
</tr> |
280
|
|
|
</table><br /> |
281
|
|
|
<!-- Box Bottom End -->'; |
282
|
|
|
} |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* boxGetAltRowStyle() - Get an alternating row style for tables |
286
|
|
|
* |
287
|
|
|
* @param int Row number |
288
|
|
|
*/ |
289
|
|
|
function boxGetAltRowStyle($i) { |
290
|
|
|
if ($i % 2 == 0) { |
291
|
|
|
return 'background="'.$this->imgroot.'vert-grad.png"'; |
292
|
|
|
} else { |
293
|
|
|
return 'background="'.$this->imgroot.'box-grad.png"'; |
294
|
|
|
} |
295
|
|
|
} |
296
|
|
|
|
297
|
|
|
function outerTabs($params) { |
298
|
|
|
global $Language; |
299
|
|
|
|
300
|
|
|
$TABS_DIRS[]='/'; |
301
|
|
|
$TABS_TITLES[]=$Language->getText('menu','home'); |
302
|
|
|
|
303
|
|
|
if (user_isloggedin()) { |
304
|
|
|
$TABS_DIRS[]='/my/'; |
305
|
|
|
$TABS_TITLES[]=$Language->getText('menu','my_personal_page'); |
306
|
|
|
} |
307
|
|
|
|
308
|
|
|
if ($GLOBALS['sys_use_trove'] != 0) { |
309
|
|
|
$TABS_DIRS[]='/softwaremap/'; |
310
|
|
|
$TABS_TITLES[]=$Language->getText('menu','projectree'); |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
if ($GLOBALS['sys_use_snippet'] != 0) { |
314
|
|
|
$TABS_DIRS[]='/snippet/'; |
315
|
|
|
$TABS_TITLES[]=$Language->getText('menu','code_snippet'); |
316
|
|
|
} |
317
|
|
|
if (user_ismember(1,'A')) { |
318
|
|
|
$TABS_DIRS[]='/admin/'; |
319
|
|
|
$TABS_TITLES[]=$Language->getText('menu','admin'); |
320
|
|
|
} |
321
|
|
|
|
322
|
|
|
$TABS_DIRS[]='/site/'; |
323
|
|
|
$TABS_TITLES[]=$Language->getText('include_layout','Help'); |
324
|
|
|
|
325
|
|
|
/* |
326
|
|
|
if (user_ismember($GLOBALS['sys_stats_group'])) { |
327
|
|
|
$TABS_DIRS[]='/reporting/'; |
328
|
|
|
$TABS_TITLES[]=$Language->getText('menu','reporting'); |
329
|
|
|
} |
330
|
|
|
*/ |
331
|
|
|
$selected_top_tab = isset($params['selected_top_tab']) ? $params['selected_top_tab'] : ''; |
332
|
|
|
if(isset($params['group']) && $params['group']) { |
333
|
|
|
// get group info using the common result set |
334
|
|
|
$pm = ProjectManager::instance(); |
335
|
|
|
$project = $pm->getProject($params['group']); |
336
|
|
|
if ($project && is_object($project)) { |
337
|
|
|
if ($project->isError()) { |
338
|
|
|
|
339
|
|
|
} else { |
340
|
|
|
$selected=array_search("/softwaremap/", $TABS_DIRS); |
341
|
|
|
} |
342
|
|
|
} |
343
|
|
|
} else if (strstr(getStringFromServer('REQUEST_URI'),'/my/') || |
344
|
|
|
strstr(getStringFromServer('REQUEST_URI'),'/themes/') || |
345
|
|
|
strstr(getStringFromServer('REQUEST_URI'),'/account/') ) { |
346
|
|
|
$selected=array_search("/my/", $TABS_DIRS); |
347
|
|
|
} elseif (strstr(getStringFromServer('REQUEST_URI'),'softwaremap')) { |
348
|
|
|
$selected=array_search("/softwaremap/", $TABS_DIRS); |
349
|
|
|
} elseif (strstr(getStringFromServer('REQUEST_URI'),'/snippet/')) { |
350
|
|
|
$selected=array_search("/snippet/", $TABS_DIRS); |
351
|
|
|
} elseif (strstr(getStringFromServer('REQUEST_URI'),'/site/')) { |
352
|
|
|
$selected=array_search("/site/", $TABS_DIRS); |
353
|
|
|
} elseif (strstr(getStringFromServer('REQUEST_URI'),'/reporting/')) { |
354
|
|
|
$selected=array_search('/reporting/',$TABS_DIRS); |
355
|
|
|
} elseif ((strstr(getStringFromServer('REQUEST_URI'),'/admin/') || $selected_top_tab == 'admin') && user_ismember(1,'A')) { |
356
|
|
|
$selected=array_search('/admin/',$TABS_DIRS);; |
357
|
|
|
} elseif ($selected_top_tab && (array_search($selected_top_tab,$TABS_DIRS) !== FALSE)) { |
358
|
|
|
$selected = array_search($selected_top_tab,$TABS_DIRS); |
359
|
|
|
} else { |
360
|
|
|
$selected=0; |
361
|
|
|
} |
362
|
|
|
echo $this->tabGenerator($TABS_DIRS,$TABS_TITLES,false,$selected,null,'100%'); |
|
|
|
|
363
|
|
|
|
364
|
|
|
} |
365
|
|
|
|
366
|
|
|
/** |
367
|
|
|
* projectTabs() - Prints out the project tabs, contained here in case |
368
|
|
|
* we want to allow it to be overriden |
369
|
|
|
* |
370
|
|
|
* @param string Is the tab currently selected |
371
|
|
|
* @param string Is the group we should look up get title info |
372
|
|
|
*/ |
373
|
|
|
function projectTabs($toptab,$group) { |
374
|
|
|
$this->project_tabs($toptab,$group); |
375
|
|
|
} |
376
|
|
|
|
377
|
|
|
function project_tabs($toptab,$group_id) { |
378
|
|
|
$pm = ProjectManager::instance(); |
379
|
|
|
$project=$pm->getProject($group_id); |
380
|
|
|
if ($project->isError()) { |
381
|
|
|
//wasn't found or some other problem |
382
|
|
|
return; |
383
|
|
|
} |
384
|
|
|
$output = ''; |
385
|
|
|
$tabs = $this->_getProjectTabs($toptab, $project); |
386
|
|
|
$nb = count($tabs); |
387
|
|
|
$selected = false; |
388
|
|
|
$TABS_DIRS = array(); |
389
|
|
|
$TABS_TITLES = array(); |
390
|
|
|
for($i = 0; $i < $nb ; $i++) { |
391
|
|
|
$TABS_DIRS[] = $tabs[$i]['link']; |
392
|
|
|
$TABS_TITLES[] = $tabs[$i]['label']; |
393
|
|
|
if ($tabs[$i]['enabled'] === true) { |
394
|
|
|
$selected = $i; |
395
|
|
|
} |
396
|
|
|
} |
397
|
|
|
$output .= $this->tabGenerator($TABS_DIRS,$TABS_TITLES,true,$selected); |
|
|
|
|
398
|
|
|
echo $output; |
399
|
|
|
} |
400
|
|
|
|
401
|
|
|
/** |
402
|
|
|
* @param sel_tab_bgcolor DEPRECATED |
403
|
|
|
*/ |
404
|
|
|
function tabGenerator($TABS_DIRS,$TABS_TITLES,$nested=false,$selected=false,$sel_tab_bgcolor='WHITE',$total_width='100%') { |
405
|
|
|
$count=count($TABS_DIRS); |
406
|
|
|
$width=intval((100/$count)); |
407
|
|
|
|
408
|
|
|
$return = ''; |
409
|
|
|
|
410
|
|
|
$return .= ' |
411
|
|
|
|
412
|
|
|
<!-- start tabs --> |
413
|
|
|
|
414
|
|
|
<table border="0" cellpadding="0" cellspacing="0" width="'.$total_width.'"> |
415
|
|
|
<tr>'; |
416
|
|
|
if ($nested) { |
417
|
|
|
$inner='bottomtab'; |
418
|
|
|
} else { |
419
|
|
|
$inner='toptab'; |
420
|
|
|
} |
421
|
|
|
$rowspan = ''; |
422
|
|
|
for ($i=0; $i<$count; $i++) { |
423
|
|
|
if ($i == 0) { |
424
|
|
|
// |
425
|
|
|
// this is the first tab, choose an image with end-name |
426
|
|
|
// |
427
|
|
|
$wassel=false; |
428
|
|
|
$issel=($selected==$i); |
429
|
|
|
$bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png'); |
430
|
|
|
// $rowspan=(($issel)?'rowspan="2" ' : ''); |
431
|
|
|
|
432
|
|
|
$return .= ' |
433
|
|
|
<td '.$rowspan.'valign="top" width="10" background="'.$this->imgroot . 'theme-'.$inner.'-end-'.(($issel) ? '' : 'not').'selected.png">'. |
434
|
|
|
'<img src="'.$this->imgroot . 'clear.png" height="25" width="10" alt="" /></td>'. |
435
|
|
|
'<td '.$rowspan.'background="'.$this->imgroot . $bgimg.'" width="'.$width.'%" align="center"><a class="'. (($issel)?'tabsellink':'tablink') .'" href="'.$TABS_DIRS[$i].'">'.$TABS_TITLES[$i].'</a></td>'; |
436
|
|
|
} elseif ($i==$count-1) { |
437
|
|
|
// |
438
|
|
|
// this is the last tab, choose an image with name-end |
439
|
|
|
// |
440
|
|
|
$wassel=($selected==$i-1); |
441
|
|
|
$issel=($selected==$i); |
442
|
|
|
$bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png'); |
443
|
|
|
// $rowspan=(($issel)?'rowspan="2" ' : ''); |
444
|
|
|
// |
445
|
|
|
// Build image between current and prior tab |
446
|
|
|
// |
447
|
|
|
$return .= ' |
448
|
|
|
<td '.$rowspan.'colspan="2" valign="top" width="20" background="'.$this->imgroot . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png">'. |
449
|
|
|
'<img src="'.$this->imgroot . 'clear.png" height="2" width="20" alt="" /></td>'. |
450
|
|
|
'<td '.$rowspan.'background="'.$this->imgroot . $bgimg.'" width="'.$width.'%" align="center" nowrap="nowrap"><a class="'. (($issel)?'tabsellink':'tablink') .'" href="'.$TABS_DIRS[$i].'">'.$TABS_TITLES[$i].'</a></td>'; |
451
|
|
|
// |
452
|
|
|
// Last graphic on right-side |
453
|
|
|
// |
454
|
|
|
$return .= ' |
455
|
|
|
<td '.$rowspan.'valign="top" width="10" background="'.$this->imgroot . 'theme-'.$inner.'-'.(($issel) ? '' : 'not').'selected-end.png">'. |
456
|
|
|
'<img src="'.$this->imgroot . 'clear.png" height="2" width="10" alt="" /></td>'; |
457
|
|
|
|
458
|
|
|
} else { |
459
|
|
|
// |
460
|
|
|
// middle tabs |
461
|
|
|
// |
462
|
|
|
$wassel=($selected==$i-1); |
463
|
|
|
$issel=($selected==$i); |
464
|
|
|
$bgimg=(($issel)?'theme-'.$inner.'-selected-bg.png':'theme-'.$inner.'-notselected-bg.png'); |
465
|
|
|
// $rowspan=(($issel)?'rowspan="2" ' : ''); |
466
|
|
|
// |
467
|
|
|
// Build image between current and prior tab |
468
|
|
|
// |
469
|
|
|
$return .= ' |
470
|
|
|
<td '.$rowspan.'colspan="2" valign="top" width="20" background="'.$this->imgroot . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png">'. |
471
|
|
|
'<img src="'.$this->imgroot . 'clear.png" height="2" width="20" alt="" /></td>'. |
472
|
|
|
'<td '.$rowspan.'background="'.$this->imgroot . $bgimg.'" width="'.$width.'%" align="center"><a class="'. (($issel)?'tabsellink':'tablink') .'" href="'.$TABS_DIRS[$i].'">'.$TABS_TITLES[$i].'</a></td>'; |
473
|
|
|
|
474
|
|
|
} |
475
|
|
|
} |
476
|
|
|
$return .= '</tr>'; |
477
|
|
|
|
478
|
|
|
// |
479
|
|
|
// Building a bottom row in this table, which will be darker |
480
|
|
|
// |
481
|
|
|
if ($selected == 0) { |
482
|
|
|
$beg_cols=0; |
483
|
|
|
$end_cols=((count($TABS_DIRS)*3)-3); |
484
|
|
|
} elseif ($selected == (count($TABS_DIRS)-1)) { |
485
|
|
|
$beg_cols=((count($TABS_DIRS)*3)-3); |
486
|
|
|
$end_cols=0; |
487
|
|
|
} else { |
488
|
|
|
$beg_cols=($selected*3); |
489
|
|
|
$end_cols=(((count($TABS_DIRS)*3)-3)-$beg_cols); |
490
|
|
|
} |
491
|
|
|
$return .= '<tr>'; |
492
|
|
|
if ($beg_cols > 0) { |
493
|
|
|
$return .= '<td colspan="'.$beg_cols.'" height="1" class="below_tabs"><img src="'.$this->imgroot.'clear.png" height="1" width="10" /></td>'; |
494
|
|
|
} |
495
|
|
|
$return .= '<td colspan="3" height="1" class="below_tabs_selected_'.$inner.'"><img src="'.$this->imgroot.'clear.png" height="1" width="10" /></td>'; |
496
|
|
|
if ($end_cols > 0) { |
497
|
|
|
$return .= '<td colspan="'.$end_cols.'" height="1" class="below_tabs"><img src="'.$this->imgroot.'clear.png" height="1" width="10" /></td>'; |
498
|
|
|
} |
499
|
|
|
$return .= '</tr>'; |
500
|
|
|
return $return.' |
501
|
|
|
</table> |
502
|
|
|
|
503
|
|
|
<!-- end tabs --> |
504
|
|
|
'; |
505
|
|
|
} |
506
|
|
|
|
507
|
|
|
function searchBox() { |
508
|
|
|
print $this->getSearchBox(); |
509
|
|
|
} |
510
|
|
|
|
511
|
|
|
//diplaying search box in body |
512
|
|
|
function bodySearchBox() { |
513
|
|
|
//do nothing |
514
|
|
|
} |
515
|
|
|
|
516
|
|
|
/** |
517
|
|
|
* feedback() - returns the htmlized feedback string when an action is performed. |
518
|
|
|
* |
519
|
|
|
* @param string feedback string |
520
|
|
|
* @return string htmlized feedback |
521
|
|
|
*/ |
522
|
|
|
function feedback($feedback) { |
523
|
|
|
if (!$feedback) { |
524
|
|
|
return ''; |
525
|
|
|
} else { |
526
|
|
|
return ' |
527
|
|
|
<h3><span class="feedback">'.strip_tags($feedback, '<br>').'</span></h3>'; |
528
|
|
|
} |
529
|
|
|
} |
530
|
|
|
|
531
|
|
|
|
532
|
|
|
function menuhtml_top($title) { |
533
|
|
|
//do nothing, we are tabbed ! |
534
|
|
|
} |
535
|
|
|
function menuhtml_bottom() { |
536
|
|
|
//do nothing, we are tabbed ! |
537
|
|
|
} |
538
|
|
|
function menu_entry($link, $title) { |
539
|
|
|
//do nothing, we are tabbed ! |
540
|
|
|
} |
541
|
|
|
|
542
|
|
|
|
543
|
|
|
//For GForge compatibility |
544
|
|
|
function box1_top($title,$echoout=1,$bgcolor='',$cols=2){ |
545
|
|
|
if ($echoout) { |
546
|
|
|
print $this->boxTop($title); |
547
|
|
|
} else { |
548
|
|
|
return $this->boxTop($title); |
549
|
|
|
} |
550
|
|
|
} |
551
|
|
|
|
552
|
|
|
function box1_middle($title,$bgcolor='',$cols=2) { |
553
|
|
|
return $this->boxMiddle($title); |
554
|
|
|
} |
555
|
|
|
|
556
|
|
|
function box1_bottom($echoout=1) { |
557
|
|
|
if ($echoout) { |
558
|
|
|
print $this->boxBottom(); |
559
|
|
|
} else { |
560
|
|
|
return $this->boxBottom(); |
561
|
|
|
} |
562
|
|
|
} |
563
|
|
|
} |
564
|
|
|
|
565
|
|
|
?> |
566
|
|
|
|
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.