File: 1.13.1a/server/base/screen.inc.php (View as HTML)

  1: <?php // screen.inc.php -- web page screen library
  2: /* -------------------------------------------------------------
  3: This file is part of FreeNATS
  4: 
  5: FreeNATS is (C) Copyright 2008-2011 PurplePixie Systems
  6: 
  7: FreeNATS 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 3 of the License, or
 10: (at your option) any later version.
 11: 
 12: FreeNATS 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 FreeNATS.  If not, see www.gnu.org/licenses
 19: 
 20: For more information see www.purplepixie.org/freenats
 21: -------------------------------------------------------------- */
 22: 
 23: $menu=array();
 24: $menu[0]="<a href=http://www.purplepixie.org/freenats/>".$NATS->Lang->Item("homepage")."</a>";
 25: $menu[1]="<a href=monitor.php>".$NATS->Lang->Item("live.monitor")."</a>&nbsp; &nbsp;<a href=main.php>".$NATS->Lang->Item("configuration")."</a>&nbsp; &nbsp;";
 26: $menu[1].="<a href=http://www.purplepixie.org/freenats/support.php target=top>".$NATS->Lang->Item("help")."</a>&nbsp; &nbsp;<a href=logout.php>".$NATS->Lang->Item("logout")."</a>";
 27: $menu[2]=$menu[1]."&nbsp; &nbsp;<a href=admin.php>Admin</a>";
 28: 
 29: $menu[3]="<a href=iphone.php>".$NATS->Lang->Item("iphone")."</a>&nbsp;  &nbsp;<a href=http://www.purplepixie.org/freenats/>".$NATS->Lang->Item("homepage")."</a>";
 30: /*
 31: $pagemenu['main']="<a href=main.php?mode=overview>Overview</a>&nbsp; &nbsp;<a href=main.php?mode=nodes>Nodes</a>&nbsp; &nbsp;";
 32: $pagemenu['main'].="<a href=main.php?mode=groups>Groups</a>&nbsp; &nbsp;<a href=main.php?mode=views>Views &amp; Reports</a>&nbsp; &nbsp;";
 33: $pagemenu['main'].="<a href=pref.php>User Options</a>";
 34: */
 35: $pagemenu=array();
 36: $pagemenu['main']=array(
 37: 	array("overview","main.php?mode=overview",$NATS->Lang->Item("overview")),
 38: 	array("nodes","main.php?mode=nodes",$NATS->Lang->Item("nodes")),
 39: 	array("groups","main.php?mode=groups",$NATS->Lang->Item("groups")),
 40: 	array("views","main.php?mode=views",$NATS->Lang->Item("views.reports")),
 41: 	array("pref","pref.php?mode=pref",$NATS->Lang->Item("user.options")),
 42: 	array("admin","admin.php",$NATS->Lang->Item("system.settings")) );
 43: 	
 44: function PageMenu($name,$mode="")
 45: {
 46: global $pagemenu;
 47: if (($mode=="")&&isset($_REQUEST['mode'])) $mode=$_REQUEST['mode'];
 48: $out="";
 49: $first=true;
 50: foreach($pagemenu[$name] as $opt)
 51: 	{
 52: 	if ($first) $first=false;
 53: 	else $out.=" ";
 54: 	if ($mode!=$opt[0]) $out.="&nbsp;<a href=".$opt[1].">";
 55: 	else $out.="<b style=\"background-color: #ffffff;\">&nbsp;<a href=\"".$opt[1]."\" style=\"color: black; text-decoration: none;\">";
 56: 	$out.=$opt[2];
 57: 	if ($mode!=$opt[0]) $out.="</a>&nbsp; ";
 58: 	else $out.="</a>&nbsp;</b>";
 59: 	}
 60: return $out;
 61: }
 62: 	
 63: $poplist=array();
 64: 
 65: function Screen_Header($title,$menuindex=0,$alertpane=0,$ah="",$pagemenu="",$pagemenumode="")
 66: {
 67: global $menu,$NATS,$NATS_Session;
 68: if ($NATS->Cfg->Get("site.enable.interactive")!=1)
 69: 	{
 70: 	echo "Sorry but FreeNATS interactive is disabled.<br>";
 71: 	echo "<i>site.enable.interactive</i> != 1<br><br>";
 72: 	echo "To resolve this issue your system administrator needs to set the FreeNATS system variable site.enable.interactive to 1.<br><br>";
 73: 	$NATS->Stop();
 74: 	exit();
 75: 	}
 76: if ($menuindex==1) $alertpane=1; // bodge
 77: 
 78: if ( ($menuindex==1) && ($pagemenu=="main") ) $secCheckFirstrun=true;
 79: else $secCheckFirstrun=false; // KLUDGE
 80: 
 81: //if ($NATS_Session->userlevel>9) $menuindex=2; // further bodge!
 82: echo "<html><head><title>FreeNATS: ".$title."</title>\n";
 83: echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
 84: echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/main.css\">\n";
 85: /*
 86: echo "<style type=\"text/css\">\n";
 87: require("css/main.css");
 88: echo "\n</style>\n";
 89: */
 90: if ($ah!="") echo $ah;
 91: echo "</head>\n";
 92: echo "<script type=\"text/javascript\" src=\"js/freenats.js\"></script>\n";
 93: echo "<body>";
 94: 
 95: echo "<table class=\"maintitle\" cellspacing=0 cellpadding=0>\n";
 96: echo "<tr><td align=left valign=center class=\"mainleft\">\n";
 97: echo "<b class=\"maintitle\">".$title."</b>";
 98: if ($pagemenu!="") echo "<br>&nbsp;&nbsp;<b>".PageMenu($pagemenu,$pagemenumode)."</b>";
 99: echo "</td>\n";
100: echo "<td class=\"titlelink\" align=right valign=center>\n";
101: echo $menu[$menuindex];
102: echo "&nbsp;</td></tr>\n";
103: //echo "<tr><td align=left valign=bottom><img src=images/e0e0ff.10px.bl.jpg></td>";
104: //echo "</tr>\n";
105: echo "</table>\n";
106: 
107: if ($secCheckFirstrun && ( $NATS->Cfg->Get("site.firstrun.ignore",0) != 1 ) )
108: 	{
109: 	if (file_exists("firstrun.php"))
110: 		{
111: 		echo "<div class=\"sec_warning\">";
112: 		echo "<b>".$NATS->Lang->Item("sec.firstrun")."</b><br />";
113: 		echo $NATS->Lang->Item("sec.firstrun.text")."<br />";
114: 		echo $NATS->Lang->Item("sec.firstrun.ignore")."<BR />";
115: 		echo "<a href=\"http://www.purplepixie.org/freenats/wiki/Firstrun_Warning\" target=\"top\">http://www.purplepixie.org/freenats/wiki/Firstrun_Warning</a>";
116: 		
117: 		echo "</div>";
118: 		}
119: 	}
120: 
121: 
122: if ($alertpane==1)
123: 	{
124: 	$alerts=$NATS->GetAlerts();
125: 	if (is_array($alerts))
126: 		{
127: 		echo "<div class=\"alertpane\" id=\"fn_alertpane\">";
128: 		echo "<b><u>".$NATS->Lang->Item("nats.alerts")."</u></b><br><br>";
129: 		foreach($alerts as $alert)
130: 			{
131: 			echo "&nbsp;<a href=node.php?nodeid=".$alert['nodeid'].">";
132: 			echo "<b class=\"al".$alert['alertlevel']."\">".$alert['nodeid']."</b></a><br>";
133: 			}
134: 		echo "<br>";
135: 		echo "</div>";
136: 		}
137: 	}
138: 
139: }
140: 
141: function Start_Round($title,$width="")
142: {
143: if ($width!="") $w=" width=".$width;
144: else $w="";
145: echo "<table border=0".$w." cellspacing=0 cellpadding=0>\n";
146: echo "<tr><td valign=top align=left width=11 style=\"background-color: #e0e0ff;\"><img src=images/e0e0ff.10px.tl.jpg></td>\n";
147: echo "<td align=left valign=center style=\"background-color: #e0e0ff;\">\n";
148: echo $title;
149: echo "\n</td><td align=right valign=top style=\"background-color: #e0e0ff;\"><img src=images/e0e0ff.10px.tr.jpg></td></tr>\n";
150: echo "<tr><td colspan=3 style=\"border-left: solid 1px #e0e0ff; border-bottom: solid 1px #e0e0ff; border-right: solid 1px #e0e0ff; padding: 5px;\">\n";
151: }
152: 
153: function End_Round()
154: {
155: echo "\n</td></tr>\n";
156: 
157: echo "</table>";
158: }
159: 
160: function Screen_Footer($track_if_enabled=true)
161: {
162: global $NATS,$poplist;
163: echo "<br><br>\n";
164: //$NATS->Cfg->DumpToScreen();
165: echo "<div class=\"nfooter\">";
166: echo "<div class=\"bl\"><div class=\"br\"><div class=\"tl\"><div class=\"tr\">";
167: 
168: echo "<div align=\"left\" class=\"nfootleft\"><a href=http://www.purplepixie.org/freenats/>FreeNATS</a>; &copy; ".$NATS->Lang->Item("copyright")." 2008-2011 ";
169: echo "<a href=http://www.purplepixie.org/>PurplePixie Systems</a>";
170: echo "</div><div class=\"nfootright\">";
171: echo $NATS->Lang->Item("version").": ".$NATS->Version;
172: if ($NATS->Release!="") echo "/".$NATS->Release;
173: echo "&nbsp;&nbsp;</div>";
174: 
175: //echo "Hello";
176: echo "</div></div></div></div>";
177: echo "</div>";
178: if (ini_get("freenats.rpath")==1)
179: 	{
180: 	echo "<i>FreeNATS Virtual Server Powered By <a href=http://www.rpath.org/>rPath</a> LAMP Appliance</i><br>";
181: 	}
182: //echo "<i>This is alpha-test software - we would very much value your ";
183: //echo "<a href=http://www.purplepixie.org/freenats/feedback.php>feedback</a></i><br>";
184: $autofeedback=false;
185: if ($track_if_enabled)
186: 	{
187: 	$t=$NATS->Cfg->Get("freenats.tracker");
188: 	if ( ($t!="") && ($t>0) )
189: 		{
190: 		$autofeedback=true;
191: 		$usid=$NATS->Cfg->Get("freenats.tracker.usid","");
192: 		if ($usid=="")
193: 			{ // generate usid if not already set
194: 			// usid form XYZ-XYZ-XYZ...
195: 			$allow="abcdef0123456789";
196: 			$allow_len=strlen($allow);
197: 			mt_srand(microtime()*1000000);
198: 			$first_set=1;
199: 			for ($a=0; $a<5; $a++) // blocks
200: 				{
201: 				if ($first_set==1) $first_set=0;
202: 				else $usid.="-";
203: 				for ($b=0; $b<10; $b++)
204: 					{
205: 					$c=mt_rand(0,$allow_len-1);
206: 					$usid.=$allow[$c];
207: 					}
208: 				}
209: 			$NATS->Cfg->Set("freenats.tracker.usid",$usid);
210: 			}
211: 			
212: 		// get some more data
213: 		$sn=explode("/",$_SERVER['SCRIPT_NAME']);
214: 		$script=$sn[count($sn)-1];
215: 		
216: 		// show tracking image
217: 		echo "<img src=\"http://www.purplepixie.org/freenats/report/ping.png.php?data=v=".$NATS->Version."+p=".$script."&type=ping&usid=".$usid."\" width=1 height=1>\n";
218: 		}
219: 	}
220: 
221: //$NATS->PageError("fish","swim in the sea");
222: //$NATS->PageError("dogs","walk on the land");
223: //$autofeedback=true;
224: 
225: if (count($NATS->PageErrors)>0) // page errors reported
226: 	{
227: 	echo "<div class=\"page_error\">\n";
228: 	echo "Errors detected on page: ";
229: 	$url="";
230: 	$counter=0;
231: 	foreach($NATS->PageErrors as $PageError)
232: 		{
233: 		if ($counter>0) $url.="&";
234: 		$url.="code[".$counter."]=".urlencode($PageError['code'])."&desc[".$counter."]=".urlencode($PageError['desc']);
235: 		$counter++;
236: 		}
237: 		
238: 	echo "<script type=\"text/javascript\">\n";
239: 	echo "function report_error()\n";
240: 	echo "{\n";
241: 	echo "document.getElementById('error_report_result').innerHTML = 'Reporting Now...';\n";
242: 	echo "var s = document.createElement(\"script\");\n";
243: 	echo "s.src = \"http://www.purplepixie.org/freenats/report/error.php?".$url."\";\n";
244: 	echo "document.body.appendChild(s);\n";
245: 	echo "}\n";
246: 	echo "</script>";
247: 		
248: 	echo "<span id=\"error_report_result\">";
249: 	if ($autofeedback)
250: 		{
251: 		echo "Reporting...";
252: 		}
253: 	else
254: 		{
255: 		echo "<a href=\"javascript:report_error();\">Click to report to PurplePixie</a> | ";
256: 		echo "<a href=\"javascript:displayToggle('error_detail');\">Click to show/hide details</a>";
257: 		}
258: 	echo "</span>";
259: 	echo "<div id=\"error_detail\" style=\"display: none;\">\n";
260: 	foreach($NATS->PageErrors as $PageError)
261: 		{
262: 		echo "# ".$PageError['code']." : ".$PageError['desc']."<BR />\n";
263: 		}
264: 	echo "</div>";
265: 	echo "</div>\n";
266: 	if ($autofeedback)
267: 		{
268: 		//echo "<script src=\"http://www.purplepixie.org/freenats/report/error.php?".$url."\" type=\"text/javascript\"></script>\n";
269: 		echo "<script type=\"text/javascript\">\n";
270: 		echo "report_error();\n";
271: 		echo "</script>\n";
272: 		}
273: 		
274: 	}
275: 		
276: if ($NATS->Cfg->Get("site.popupmessage")=="1")
277: 	{
278: 	if (count($poplist)>0)
279: 		{
280: 		echo "\n<script type=\"text/javascript\">\n";
281: 		
282: 		foreach($poplist as $pop)
283: 			{
284: 			echo "alert('".$pop."');\n";
285: 			}
286: 			
287: 		echo "</script>\n";
288: 		}
289: 	}
290: echo "\n</body></html>\n";
291: }
292: 
293: function UL_Error($task="")
294: {
295: global $NATS;
296: Screen_Header($NATS->Lang->Item("access.error"));
297: echo "<br>".$NATS->Lang->Item("access.error.detail")." (".$task.").<br><br>";
298: echo "<a href=main.php>".$NATS->Lang->Item("click.continue")."</a><br><br>";
299: Screen_Footer();
300: exit();
301: }
302: 
303: function Session_Error()
304: {
305: global $REQUEST_URI;
306: header("Location: ./?login_msg=Invalid+or+Expired+Session&url=".urlencode($REQUEST_URI));
307: exit();
308: }
309: 
310: function nicedt($ts)
311: {
312: global $NATS;
313: $form="H:i:s d/m/Y";
314: if (isset($NATS)) $form=$NATS->Cfg->Get("site.dtformat","H:i:s d/m/Y");
315: if ($ts<=0) return $NATS->Lang->Item("never");
316: return date($form,$ts);
317: }
318: 
319: function enicedt($ts)
320: {
321: echo nicedt($ts);
322: }
323: 
324: function nicediff($diff)
325: {
326: $hr=0;
327: $mn=0;
328: $se=0;
329: if ($diff>59)
330: 	{
331: 	$mn=round($diff/60,0);
332: 	$se=$diff%60;
333: 	if ($mn>59)
334: 		{
335: 		$hr=round($mn/60,0);
336: 		$mn=$mn%60;
337: 		}
338: 	}
339: else $se=$diff;
340: $s="";
341: if ($hr<10) $s="0";
342: $s.=$hr.":";
343: if ($mn<10) $s.="0";
344: $s.=$mn.":";
345: if ($se<10) $s.="0";
346: $s.=$se;
347: return $s;
348: }
349: 
350: function dtago($ts,$sayago=true)
351: {
352: global $NATS;
353: if ($ts<=0) return $NATS->Lang->Item("never");
354: $now=time();
355: $diff=$now-$ts;
356: $s=nicediff($diff);
357: if ($sayago) $s.=" ".$NATS->Lang->Item("ago");
358: return $s;
359: }
360: 
361: function nicenextx($nextx)
362: {
363: if ($nextx<=0) return "Now";
364: $diff=$nextx-time();
365: if ($diff<0)
366: 	{
367: 	$sign=" ago";
368: 	$diff=0-$diff;
369: 	}
370: else $sign="";
371: return nicediff($diff).$sign;
372: }
373: 
374: function edtago($ts)
375: {
376: echo dtago($ts);
377: }
378: 
379: function smartx($x) // smart handling of unixtime x variables
380: {
381: if ($x==0) return time();	// 0 = now
382: else if ($x<0)				// -z = now - z seconds
383: 	return (time()+$x);		// negative number so +
384: else						// positive number so is a unixtime
385: 	return $x;
386: }
387: 
388: $allowed="00123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@_-.,:&/~%=+(){}[]#?$";
389: 
390: function nices($s)
391: {
392: global $allowed;
393: $o="";
394: for ($a=0; $a<strlen($s); $a++)
395: 	{
396: 	$c=$s[$a];
397: 	if (strpos($allowed,$c)===false)
398: 		{
399: 		// skip it
400: 		}
401: 	else $o.=$c;
402: 	}
403: return $o;
404: }
405: /* // Old Static List Function
406: function ShowIcons()
407: {
408: global $fnIcons,$fnIcon_DefNode,$fnIcon_DefGroup;
409: $c=0;
410: echo "<table border=0>";
411: $cc=0;
412: for ($a=0; $a<count($fnIcons); $a++)
413: 	{
414: 	if ($cc==0) echo "<tr>";
415: 	echo "<td valign=top align=center><img src=icons/".$fnIcons[$a]."><br>".$fnIcons[$a]."<br>";
416: 	if ($a==$fnIcon_DefNode) echo "<i>Node Default</i> ";
417: 	if ($a==$fnIcon_DefGroup) echo "<i>Group Default</i>";
418: 	echo "</td>";
419: 	$cc++;
420: 	if ($cc>=5)
421: 		{
422: 		echo "</tr>";
423: 		$cc=0;
424: 		}
425: 	}
426: if ($cc>0) echo "</tr>";
427: echo "</table>";
428: }
429: */
430: 
431: function GetIcons()
432: {
433: $iconFiles=glob("icons/{*.gif,*.GIF,*.jpg,*.JPG,*.jpeg,*.JPEG,*.png,*.PNG}", GLOB_BRACE);
434: for($a=0;$a<count($iconFiles);$a++)
435: 	$iconFiles[$a]=substr($iconFiles[$a],6);
436: return $iconFiles;
437: }
438: 
439: 
440: function ShowIcons()
441: {
442: global $fnIcons,$fnIcon_DefNode,$fnIcon_DefGroup,$NATS;
443: $c=0;
444: echo "<table border=0>";
445: $cc=0;
446: $iconFiles=GetIcons();
447: for ($a=0; $a<count($iconFiles); $a++)
448: 	{
449: 	$icon=$iconFiles[$a];
450: 	if ($cc==0) echo "<tr>";
451: 	echo "<td valign=top align=center><img src=icons/".$icon."><br>".$icon."<br>";
452: 	if ($icon==$fnIcons[$fnIcon_DefNode]) echo "<i>".$NATS->Lang->Item("node.default")."</i> ";
453: 	if ($a==$fnIcons[$fnIcon_DefGroup]) echo "<i>".$NATS->Lang->Item("group.default")."</i>";
454: 	echo "</td>";
455: 	$cc++;
456: 	if ($cc>=5)
457: 		{
458: 		echo "</tr>";
459: 		$cc=0;
460: 		}
461: 	}
462: if ($cc>0) echo "</tr>";
463: echo "</table>";
464: }
465: 
466: 
467: 
468: function NodeIcon($nodeid)
469: {
470: global $NATS,$fnIcons,$fnIcon_DefNode;
471: $q="SELECT nodeicon FROM fnnode WHERE nodeid=\"".ss($nodeid)."\"";
472: $r=$NATS->DB->Query($q);
473: if ($row=$NATS->DB->Fetch_Array($r)) 
474: 	{
475: 	if ($row['nodeicon']!="") return $row['nodeicon'];
476: 	}
477: return $fnIcons[$fnIcon_DefNode];
478: }
479: 
480: function GroupIcon($groupid)
481: {
482: global $NATS,$fnIcons,$fnIcon_DefGroup;
483: $q="SELECT groupicon FROM fngroup WHERE groupid=\"".ss($groupid)."\"";
484: $r=$NATS->DB->Query($q);
485: if ($row=$NATS->DB->Fetch_Array($r)) 
486: 	{
487: 	if ($row['groupicon']!="") return $row['groupicon'];
488: 	}
489: return $fnIcons[$fnIcon_DefGroup];
490: }
491: 
492: function np_tiny($nodeid,$text=true,$nodename="",$jslink=false)
493: {
494: global $NATS;
495: $al=$NATS->NodeAlertLevel($nodeid);
496: echo "<table class=\"nptiny-al".$al."\">";
497: echo "<tr><td valign=center align=center>";
498: if ($jslink) echo "<a href=\"javascript:nodeClick('".$nodeid."');\">";
499: else echo "<a href=node.php?nodeid=".$nodeid.">";
500: echo "<img src=\"icons/".NodeIcon($nodeid)."\" border=0>";
501: echo "</a>";
502: if ($text)
503: 	{
504: 	if ($nodename=="") $nodename=$nodeid;
505: 	
506: 	//$words=explode(" ",$nodename);
507: 	
508: 	// messy but there you go...
509: 	
510: 	$max_on_line=7;
511: 	$max_lines=2;
512: 	$len=strlen($nodename);
513: 	$out="";
514: 	$linecount=0;
515: 	$charcount=0;
516: 	for ($a=0; $a<$len; $a++)
517: 		{
518: 			
519: 		$char=$nodename[$a];
520: 		
521: 		if ($char==" ")
522: 			{
523: 			$linecount++;
524: 			$charcount=0;
525: 			}
526: 		else $charcount++;
527: 		
528: 		if ($charcount>=$max_on_line) 
529: 			{
530: 			$a=$len+10;
531: 			$out.="..";
532: 			}
533: 		else if ($linecount>=$max_lines) 
534: 			{
535: 			$a=$len+10;
536: 			$out.="..";
537: 			}
538: 		else $out.=$char;
539: 		
540: 		}
541: 	//if ($a==($len+10)) $out.="..";
542: 	$nodename=$out;
543: 	
544: 	$size=10;
545: 		
546: /* -- size-based	
547: 	$len=strlen($nodename);
548: 	if ($len<9) $size=10;
549: 	else if ($len<15) $size=8;
550: 	else if ($len<20) $size=7;
551: 	else
552: 		{
553: 		$size=6;
554: 		$nodename=substr($nodename,0,18)."..";
555: 		}
556: */
557: 	
558: 	echo "<br><b class=\"al".$al."\" style=\"font-size: ".$size."pt;\">".$nodename."</b>";
559: 	}
560: echo "</td></tr></table>";
561: }
562: 
563: function ng_tiny($groupid,$groupname="",$text=true)
564: {
565: global $NATS;
566: // to do - get groupname if not sent but F--- it for now
567: $al=$NATS->GroupAlertLevel($groupid);
568: echo "<table class=\"nptiny-al".$al."\">";
569: echo "<tr><td valign=center align=center>";
570: echo "<a href=group.php?groupid=".$groupid.">";
571: echo "<img src=\"icons/".GroupIcon($groupid)."\" border=0>";
572: echo "</a>";
573: if ($text)
574: 	{
575: 	echo "<br><b class=\"al".$al."\">".$groupname."</b>";
576: 	}
577: echo "</td></tr></table>";
578: }
579: 
580: function ng_big($groupid,$groupname="",$groupdesc="",$groupicon="")
581: {
582: global $NATS;
583: if ($groupicon=="") $groupicon=GroupIcon($groupid);
584: $al=$NATS->GroupAlertLevel($groupid);
585: echo "<table class=\"npbig-al".$al."\">";
586: echo "<tr><td align=left valign=top>";
587: echo "<table class=\"nicetable\" width=300>";
588: echo "<tr><td align=right>".$NATS->Lang->Item("group.name")." :";
589: echo "</td><td align=left><a href=group.php?groupid=".$groupid.">".$groupname."</a></td></tr>";
590: echo "<tr><td align=right>".$NATS->Lang->Item("description")." :";
591: echo "</td><td align=left>".$groupdesc."</td></tr>";
592: echo "<tr><td align=right>".$NATS->Lang->Item("status")."</td><td align=left>";
593: echo "<b class=\"al".$al."\">".oText($al)."</b></td></tr>";
594: echo "</table></td>";
595: //echo "<td align=left valign=top align=right width=60>";
596: //echo "<img src=icons/".GroupIcon($groupid).">";
597: //echo "</td>";
598: echo "</tr>";
599: echo "</table>";
600: }
601: 
602: function np_big($nodeid,$nodename="",$nodedesc="",$nodeicon="",$jslink=false)
603: {
604: global $NATS;
605: if ($nodedesc=="") $nodedesc="&nbsp;";
606: if ($nodeicon=="") $nodeicon=NodeIcon($nodeid);
607: $al=$NATS->NodeAlertLevel($nodeid);
608: echo "<table class=\"npbig-al".$al."\">";
609: echo "<tr><td align=left valign=top>";
610: echo "<table class=\"nicetable\" width=300>";
611: echo "<tr><td align=right>".$NATS->Lang->Item("node.name")." :";
612: if ($nodename=="") $nodename=$nodeid;
613: echo "</td><td align=left>";
614: if ($jslink) echo "<a href=\"javascript:nodeClick('".$nodeid."');\">";
615: else echo "<a href=node.php?nodeid=".$nodeid.">";
616: echo $nodename."</a></td></tr>";
617: echo "<tr><td align=right>".$NATS->Lang->Item("description")." :";
618: echo "</td><td align=left>".$nodedesc."</td></tr>";
619: echo "<tr><td align=right>".$NATS->Lang->item("status")." :</td><td align=left>";
620: echo "<b class=\"al".$al."\">".oText($al)."</b></td></tr>";
621: echo "</table></td>";
622: //echo "<td align=left valign=top align=right width=60>";
623: //echo "<img src=icons/".GroupIcon($groupid).">";
624: //echo "</td>";
625: echo "</tr>";
626: echo "</table>";
627: }
628: 
629: function GetAbsolute($filename="")
630: { // sooooooooo messy but looks like the ONLY FRICKIN' WAY!
631: if ((isset($_SERVER['HTTPS']))&&($_SERVER['HTTPS']!="")) $uri="https://";
632: else $uri="http://";
633: $uri.=$_SERVER['HTTP_HOST'];
634: $uri.=$_SERVER['REQUEST_URI'];
635: $pos=strripos($uri,"/");
636: $rdir=substr($uri,0,$pos+1);
637: return $rdir.$filename;
638: }
639: 
640: 
641: ?>
642: