Menu

[r8]: / themes / phpkaox / block.class.php  Maximize  Restore  History

Download this file

467 lines (408 with data), 15.8 kB

  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
<?php
#Application name: PhpCollab
#Status page: 0
class block {
function block() {
$this->iconWidth = "23";
$this->iconHeight = "23";
$this->bgColor = "#666600";
$this->fgColor = "#E2DBD3";
$this->oddColor = "#F5F5F5";
$this->evenColor = "#EFEFEF";
$this->highlightOn = "#E3E4E0";
$this->class = "odd";
$this->highlightOff = $this->oddColor;
$this->theme = THEME;
$this->pathImg = "../themes";
}
/**
* Print tooltips
* @param string $item Text printed in tooltip
* @access public
**/
function printHelp($item) {
global $help,$strings;
return " [<a href=\"javascript:void(0);\" onmouseover=\"return overlib('".addslashes($help[$item])."',SNAPX,550,BGCOLOR,'".$this->bgColor."',FGCOLOR,'".$this->fgColor."');\" onmouseout=\"return nd();\">".$strings["help"]."</a>]";
}
/**
* Add a note
* @param string $content Text printed in note
* @access public
**/
function note($content) {
echo "<p class=\"note\">".$content."</p>\n\n";
}
/**
* Print standard heading
* @param string $title Text printed in heading
* @access public
**/
function heading($title) {
echo "<h1 class=\"heading\">".stripslashes($title)."</h1>\n\n";
}
/**
* Print toggle heading (with collapse/expande arrow)
* @param string $title Text printed in heading
* @see block::closeToggle()
* @access public
**/
function headingToggle($title) {
if ($_COOKIE[$this->form] == "c" || $HTTP_COOKIE_VARS[$this->form] == "c") {
$style = "none";
$arrow = "closed";
} else {
$style = "block";
$arrow = "open";
}
echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td><a href=\"javascript:showHideModule('".$this->form."','$this->theme')\" onMouseOver=\"javascript:showHideModuleMouseOver('".$this->form."'); return true; \" onMouseOut=\"javascript:window.status=''; return true;\"><img name=\"".$this->form."Toggle\" border=\"0\" src=\"$this->pathImg/$this->theme/module_toggle_".$arrow.".gif\" alt=\"\"></a></td><td><img width=\"10\" height=\"10\" name=\"".$this->form."tl\" src=\"$this->pathImg/$this->theme/spacer.gif\" alt=\"\"></td><td width=\"100%\"><h1 class=\"heading\">".$title."</h1></td></tr></table>
<div id=\"".$this->form."\" style=\"display: $style;\">\n\n";
}
/**
* Close toggle block
* @see block::headingToggle()
* @access public
**/
function closeToggle() {
echo "</div>\n\n";
}
/**
* Print error heading
* @param string $title Text printed in heading
* @access public
**/
function headingError($title) {
echo "<h1 class=\"headingError\">".$title."</h1>\n";
}
function contentError($content) {
echo "<table class=\"error\"><tr><td>".$content."</td></tr></table>\n";
}
function returnBorne($current) {
global ${'borne'.$current};
if (${'borne'.$current} == "") {
$borneValue = "0";
} else {
$borneValue = ${'borne'.$current};
}
return $borneValue;
}
function bornesFooter($current,$total,$showall,$parameters) {
global $strings;
if ($this->rowsLimit < $this->recordsTotal) {
echo "<table cellspacing=\"0\" width=\"100%\" border=\"0\" cellpadding=\"0\"><tr><td nowrap class=\"footerCell\">&#160;&#160;&#160;&#160;";
$nbpages = ceil($this->recordsTotal/ $this->rowsLimit);
$j = "0";
for($i = 1;$i <= $nbpages;$i ++){
if ($this->borne == $j) {
echo "<b>$i</b>&#160;";
} else {
echo "<a href=\"$PHP_SELF?$transmitSid";
for ($k=1;$k<=$total;$k++) {
global ${'borne'.$k};
if ($k != $current) {
echo "&borne$k=".${'borne'.$k};
} else if ($k == $current) {
echo "&borne$k=$j";
}
}
echo "&$parameters&".session_name()."=".session_id()."#".$this->form."Anchor\">$i</a>&#160;";
}
$j = $j + $this->rowsLimit;
}
echo "</td><td nowrap align=\"right\" class=\"footerCell\">";
if ($showall != "") {
echo "<a href=\"$showall".session_name()."=".session_id()."\">".$strings["show_all"]."</a>";
}
echo "&#160;&#160;&#160;&#160;&#160;</td></tr><tr><td height=\"5\" colspan=\"2\"><img width=\"1\" height=\"5\" border=\"0\" src=\"$this->pathImg/$this->theme/spacer.gif\" alt=\"\"></td></tr></table>";
}
}
function messageBox($msgLabel) {
echo "<br/><table class=\"message\">
<tr><td>$msgLabel</td></tr>
</table>";
}
function openPaletteIcon() {
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"icons\"><tr>\n";
}
function closePaletteIcon() {
echo "<td align=left width=\"1%\"><img height=\"26\" width=\"5\" src=\"$this->pathImg/$this->theme/spacer.gif\" alt=\"\"></td><td class=\"commandDesc\" align=\"left\" width=\"99%\"><div id=\"".$this->form."tt\" class=\"rel\"><div id=\"".$this->form."tti\" class=\"abs\"><img height=\"1\" width=\"350\" src=\"$this->pathImg/$this->theme/spacer.gif\" alt=\"\"></div></div></td></tr></table>\n";
}
function openPaletteScript() {
echo "<script type=\"text/JavaScript\">
<!--
document.".$this->form."Form.buttons = new Array();\n";
}
function closePaletteScript($compt,$values) {
echo "MM_updateButtons(document.".$this->form."Form, 0);document.".$this->form."Form.checkboxes = new Array();";
for ($i=0;$i<$compt;$i++) {
echo "document.".$this->form."Form.checkboxes[document.".$this->form."Form.checkboxes.length] = new MMCheckbox('$values[$i]',document.".$this->form."Form,'".$this->form."cb$values[$i]');";
}
echo "document.".$this->form."Form.tt = '".$this->form."tt';
// -->
</script>\n\n";
}
/**
* Define sorting to apply on a list block
* @param string $sortingRef Row reference in sorting table
* @param string $sortingValue Row value in sorting table
* @param string $sortingDefault Default sorting value
* @param array $sortingFields Array with sorted fields on each column
* @access public
**/
function sorting($sortingRef,$sortingValue,$sortingDefault,$sortingFields) {
if ($sortingRef != "") {
$this->sortingRef = $sortingRef;
}
if ($sortingValue != "") {
$this->sortingValue = $sortingValue;
}
if ($sortingDefault != "") {
$this->sortingDefault = $sortingDefault;
}
if ($sortingFields != "") {
$this->sortingFields = $sortingFields;
}
global $sortingOrders,$sortingFields,$sortingArrows,$sortingStyles,$explode;
if (isset($this->sortingValue) != "") {
$explode = explode(" ",$this->sortingValue);
} else {
$this->sortingValue = $this->sortingDefault;
$explode = explode(" ",$this->sortingValue);
}
for ($i=0;$i<count($sortingFields);$i++) {
if ($sortingFields[$i] == $explode[0] && $explode[1] == "DESC") {
$sortingOrders[$i] = "ASC";
$sortingArrows[$i] = "&#160;<img border=\"0\" src=\"$this->pathImg/$this->theme/icon_sort_za.gif\" alt=\"\" width=\"11\" height=\"11\">";
$sortingStyles[$i] = "active";
} else if ($sortingFields[$i] == $explode[0] && $explode[1] == "ASC") {
$sortingOrders[$i] = "DESC";
$sortingArrows[$i] = "&#160;<img border=\"0\" src=\"$this->pathImg/$this->theme/icon_sort_az.gif\" alt=\"\" width=\"11\" height=\"11\">";
$sortingStyles[$i] = "active";
} else {
$sortingOrders[$i] = "ASC";
$sortingArrows[$i] = "";
$sortingStyles[$i] = "";
}
}
if ($sortingOrders != "") {
$this->sortingOrders = $sortingOrders;
}
if ($sortingArrows != "") {
$this->sortingArrows = $sortingArrows;
}
if ($sortingStyles != "") {
$this->sortingStyles = $sortingStyles;
}
}
/**
* Open a standard form
* @param string $address Action form value
* @see block::closeFormResults()
* @see block::closeForm()
* @access public
**/
function openForm($address) {
echo "<a name=\"".$this->form."Anchor\"></a>\n
<form accept-charset=\"UNKNOWN\" method=\"POST\" action=\"$address\" name=\"".$this->form."Form\" enctype=\"application/x-www-form-urlencoded\">\n\n";
}
/**
* Close a form used with a list block
* @access public
**/
function closeFormResults() {
echo "<input name=\"sor_cible\" type=\"HIDDEN\" value=\"$this->sortingRef\"><input name=\"sor_champs\" type=\"HIDDEN\" value=\"\"><input name=\"sor_ordre\" type=\"HIDDEN\" value=\"\">
</form>\n\n";
}
/**
* Define column labels in a list block
* @param array $labels Array with labels strings
* @param boolean $published Show/hide a published column
* @param boolean $sorting Disable sorting
* @param array $sortingOff Array with label number (from $labels) and order (ASC/DESC)
* @access public
**/
function labels($labels,$published,$sorting="true",$sortingOff="") {
global $labels,$sortingOrders,$sortingFields,$sortingArrows,$sortingStyles,$strings,$sitePublish;
$sortingFields = $this->sortingFields;
$sortingOrders = $this->sortingOrders;
$sortingArrows = $this->sortingArrows;
$sortingStyles = $this->sortingStyles;
if ($sitePublish == "false" && $published == "true") {
$comptLabels = count($labels) - 1;
} else {
$comptLabels = count($labels);
}
for ($i=0;$i<$comptLabels;$i++) {
if ($sorting == "true") {
echo "<th nowrap class=\"$sortingStyles[$i]\"><a href=\"javascript:document.".$this->form."Form.sor_cible.value='$this->sortingRef';document.".$this->form."Form.sor_champs.value='$sortingFields[$i]';document.".$this->form."Form.sor_ordre.value='$sortingOrders[$i]';document.".$this->form."Form.submit();\" onMouseOver=\"javascript:window.status='".$strings["sort_by"]." ".addslashes($labels[$i])."'; return true;\" onMouseOut=\"javascript:window.status=''; return true\">".$labels[$i]."$sortingArrows[$i]</a></th>\n";
} else {
if ($sortingOff[1] == "ASC") {
$sortingArrow = "&#160;<img border=\"0\" src=\"$this->pathImg/$this->theme/icon_sort_az.gif\" alt=\"\" width=\"11\" height=\"11\">";
} else if ($sortingOff[1] == "DESC") {
$sortingArrow = "&#160;<img border=\"0\" src=\"$this->pathImg/$this->theme/icon_sort_za.gif\" alt=\"\" width=\"11\" height=\"11\">";
}
if ($i == $sortingOff[0]) {
echo "<th nowrap class=\"active\">".$labels[$i]."$sortingArrow";
} else {
echo "<th nowrap>".$labels[$i];
}
}
}
echo "</tr>\n";
}
function openResults($checkbox="true") {
echo "<table class=\"listing\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr>\n";
if ($checkbox == "true") {
echo "<th width=\"1%\" align=\"center\"><a href=\"javascript:MM_toggleSelectedItems(document.".$this->form."Form,'$this->theme')\"><img height=\"13\" width=\"13\" border=\"0\" src=\"$this->pathImg/$this->theme/checkbox_off_16.gif\" alt=\"\" vspace=\"3\" hspace=\"3\"></a></th>\n";
} else {
echo "<th width=\"1%\" align=\"center\"><img height=\"13\" width=\"13\" border=\"0\" src=\"$this->pathImg/$this->theme/spacer.gif\" alt=\"\" vspace=\"3\"></th>\n";
}
}
function closeResults() {
echo "</table>
<hr />\n";
}
function noresults() {
global $strings;
echo "<table cellspacing=\"0\" border=\"0\" cellpadding=\"2\"><tr><td colspan=\"4\">".$strings["no_items"]."</td></tr></table><hr />";
}
function paletteIcon($num,$type,$text) {
echo "<td width=\"30\" class=\"commandBtn\"><a href=\"javascript:var b = MM_getButtonWithName(document.".$this->form."Form, '".$this->form."$num'); if (b) b.click();\" onMouseOver=\"var over = MM_getButtonWithName(document.".$this->form."Form, '".$this->form."$num'); if (over) over.over(); return true; \" onMouseOut=\"var out = MM_getButtonWithName(document.".$this->form."Form, '".$this->form."$num'); if (out) out.out(); return true; \"><img width=\"$this->iconWidth\" height=\"$this->iconHeight\" border=\"0\" name=\"".$this->form."$num\" src=\"$this->pathImg/$this->theme/btn_".$type."_norm.gif\" alt='".stripslashes($text)."'></a></td>\n";
}
function paletteScript($num,$type,$link,$options,$text) {
echo "document.".$this->form."Form.buttons[document.".$this->form."Form.buttons.length] = new MMCommandButton('".$this->form."$num',document.".$this->form."Form,'".$link."&".session_name()."=".session_id()."','$this->pathImg/$this->theme/btn_".$type."_norm.gif','$this->pathImg/$this->theme/btn_".$type."_over.gif','$this->pathImg/$this->theme/btn_".$type."_down.gif','$this->pathImg/$this->theme/btn_".$type."_dim.gif',$options,'',\"".stripslashes($text)."\",false,'');\n";
}
function openContent() {
echo "<table class=\"content\" cellspacing=\"0\" cellpadding=\"0\">";
}
function contentRow($left,$right,$altern="false") {
if ($this->class == "") {
$this->class = "odd";
}
if ($left != "") {
echo "<tr class=\"$this->class\"><td valign=\"top\" class=\"leftvalue\">".$left." :</td><td>".$right."&nbsp;</td></tr>\n";
} else {
echo "<tr class=\"$this->class\"><td valign=\"top\" class=\"leftvalue\">&nbsp;</td><td>".$right."&nbsp;</td></tr>\n";
}
if ($this->class == "odd" && $altern == "true") {
$this->class = "even";
} else if ($this->class == "even" && $altern == "true") {
$this->class = "odd";
}
}
function openRow() {
$change = "true";
echo "<tr class=\"$this->class\" onmouseover=\"this.style.backgroundColor='".$this->highlightOn."'\" onmouseout=\"this.style.backgroundColor='".$this->highlightOff."'\">\n";
if ($this->class == "odd") {
$this->class = "even";
$this->highlightOff = $this->evenColor;
$change = "false";
} else if ($this->class == "even" && $change != "false") {
$this->class = "odd";
$this->highlightOff = $this->oddColor;
}
}
function checkboxRow($ref,$checkbox="true") {
if ($checkbox == "true") {
echo "<td align=\"center\"><a href=\"javascript:MM_toggleItem(document.".$this->form."Form, '".$ref."', '".$this->form."cb".$ref."','$this->theme')\"><img name=\"".$this->form."cb".$ref."\" border=\"0\" src=\"$this->pathImg/$this->theme/checkbox_off_16.gif\" alt=\"\" vspace=\"3\"></a></td>";
} else {
echo "<td><img height=\"13\" width=\"13\" border=\"0\" src=\"$this->pathImg/$this->theme/spacer.gif\" alt=\"\" vspace=\"3\"></td>";
}
}
function cellRow($content) {
echo "<td>$content</td>";
}
function closeRow() {
echo "\n</tr>\n";
}
function contentTitle($title) {
echo "<tr><th colspan=\"2\">".$title."</th></tr>";
}
function closeContent() {
echo "</table>\n<hr />\n";
}
function closeForm() {
echo "</form>\n";
}
function openBreadcrumbs() {
echo "<p class=\"breadcrumbs\">";
}
function itemBreadcrumbs($content) {
if ($this->breadcrumbsTotal == "") {
$this->breadcrumbsTotal = "0";
}
$this->breadcrumbs[$this->breadcrumbsTotal] = stripslashes($content);
$this->breadcrumbsTotal = $this->breadcrumbsTotal + 1;
}
function closeBreadcrumbs() {
$items = $this->breadcrumbsTotal;
for ($i=0;$i<$items;$i++) {
echo $this->breadcrumbs[$i];
if ($items-1 != $i) {
echo " / ";
}
}
echo "</p>\n\n";
}
function openNavigation() {
echo "<p id=\"navigation\">";
}
function itemNavigation($content) {
if ($this->navigationTotal == "") {
$this->navigationTotal = "0";
}
$this->navigation[$this->navigationTotal] = $content;
$this->navigationTotal = $this->navigationTotal + 1;
}
function closeNavigation() {
$items = $this->navigationTotal;
for ($i=0;$i<$items;$i++) {
echo $this->navigation[$i];
if ($items-1 != $i) {
echo "&nbsp;&nbsp;";
}
}
echo "</p>\n\n";
}
function openAccount() {
echo "<p id=\"account\">";
}
function itemAccount($content) {
if ($this->accountTotal == "") {
$this->accountTotal = "0";
}
$this->account[$this->accountTotal] = $content;
$this->accountTotal = $this->accountTotal + 1;
}
function closeaccount() {
$items = $this->accountTotal;
for ($i=0;$i<$items;$i++) {
echo $this->account[$i];
if ($items-1 != $i) {
echo " ";
}
}
echo "</p>\n\n";
}
function buildLink($url,$label,$type) {
if ($type == "in") {
return "<a href=\"$url&".session_name()."=".session_id()."\">$label</a>";
} else if ($type == "icone") {
return "<a href=\"$url&".session_name()."=".session_id()."\"><img src=\"../interface/icones/$label\" border=\"0\" alt=\"\"></a>";
} else if ($type == "inblank") {
return "<a href=\"$url&".session_name()."=".session_id()."\" target=\"_blank\">$label</a>";
} else if ($type == "powered") {
return "Powered by <a href=\"$url\" target=\"_blank\">$label</a>";
} else if ($type == "out") {
// Verify correct urltyping
if (substr($url, 0, 4) != 'http') {
// Add default http on it
$url = "http://" . $url;
}
return "<a href=\"$url\" target=\"_blank\">$label</a>";
} else if ($type == "mail") {
return "<a href=\"mailto:$url\">$label</a>";
}
}
}
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.