Project

General

Profile

Download (19.1 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
    index.php
5
    Copyright (C) 2004, 2005 Scott Ullrich
6
    All rights reserved.
7

    
8
    Originally part of m0n0wall (http://m0n0.ch/wall)
9
    Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
    All rights reserved.
11

    
12
    Redistribution and use in source and binary forms, with or without
13
    modification, are permitted provided that the following conditions are met:
14

    
15
    1. Redistributions of source code must retain the above copyright notice,
16
       this list of conditions and the following disclaimer.
17

    
18
    2. Redistributions in binary form must reproduce the above copyright
19
       notice, this list of conditions and the following disclaimer in the
20
       documentation and/or other materials provided with the distribution.
21

    
22
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
    oR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
    POSSIBILITY OF SUCH DAMAGE.
32
*/
33

    
34
	## Load Essential Includes
35
	require_once('guiconfig.inc');
36
	require_once('notices.inc');
37

    
38
	## Load Functions Files
39
	require_once('includes/functions.inc.php');
40

    
41

    
42
	## Load AJAX, Initiate Class ###############################################
43
	require_once('includes/sajax.class.php');
44

    
45
	## Initiate Class and Set location of ajax file containing 
46
	## the information that we need for this page. Also set functions
47
	## that SAJAX will be using.
48
	$oSajax = new sajax();
49
	$oSajax->sajax_remote_uri = 'sajax/index.sajax.php';
50
	$oSajax->sajax_request_type = 'POST';
51
	$oSajax->sajax_export("get_stats");
52
	$oSajax->sajax_handle_client_request();
53
	############################################################################
54

    
55

    
56
	## Check to see if we have a swap space,
57
	## if true, display, if false, hide it ...
58
	if(file_exists("/usr/sbin/swapinfo")) {
59
		$swapinfo = `/usr/sbin/swapinfo`;
60
		if(stristr($swapinfo,'%') == true) $showswap=true;
61
	}
62

    
63

    
64
	## User recently restored his config.
65
	## If packages are installed lets resync
66
	if(file_exists('/conf/needs_package_sync')) {
67
		if($config['installedpackages'] <> '') {
68
			conf_mount_rw();
69
			unlink('/conf/needs_package_sync');
70
			header('Location: pkg_mgr_install.php?mode=reinstallall');
71
			exit;
72
		}
73
	}
74

    
75

    
76
	## If it is the first time webGUI has been
77
	## accessed since initial install show this stuff.
78
	if(file_exists('/conf/trigger_initial_wizard')) {
79

    
80
		$pgtitle = 'pfSense first time setup';
81
		include('head.inc');
82

    
83
		echo "<body link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">\n";
84
		echo "<form>\n";
85
		echo "<center>\n";
86
		echo "<img src=\"/themes/{$g['theme']}/images/logo.gif\" border=\"0\"><p>\n";
87
		echo "<div \" style=\"width:700px;background-color:#ffffff\" id=\"nifty\">\n";
88
		echo "Welcome to pfSense!<p>\n";
89
		echo "One moment while we start the initial setup wizard.<p>\n";
90
		echo "Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal gui.<p>\n";
91
		echo "To bypass the wizard, click on the pfSense wizard on the initial page.\n";
92
		echo "</div>\n";
93
		echo "<meta http-equiv=\"refresh\" content=\"1;url=wizard.php?xml=setup_wizard.xml\">\n";
94
		echo "<script type=\"text/javascript\">\n";
95
		echo "NiftyCheck();\n";
96
		echo "Rounded(\"div#nifty\",\"all\",\"#000\",\"#FFFFFF\",\"smooth\");\n";
97
		echo "</script>\n";
98
		exit;
99
	}
100

    
101

    
102
	## Find out whether there's hardware encryption or not
103
	unset($hwcrypto);
104
	$fd = @fopen("{$g['varlog_path']}/dmesg.boot", "r");
105
	if ($fd) {
106
		while (!feof($fd)) {
107
			$dmesgl = fgets($fd);
108
			if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches)) {
109
				$hwcrypto = $matches[1];
110
				break;
111
			}
112
		}
113
		fclose($fd);
114
	}
115
	
116
//build list of widgets
117
$directory = "widgets/widgets/";
118
$dirhandle  = opendir($directory);
119
$filename = "";
120
$widgetnames = array ();
121
$widgetfiles = array();
122

    
123
while (false !== ($filename = readdir($dirhandle))) {
124
	$periodpos = strpos($filename, ".");
125
	$widgetname = substr($filename, 0, $periodpos);
126
	$widgetnames[] = $widgetname;
127
	if ($widgetname != "system_information")
128
		$widgetfiles[] = $filename;   		
129
}
130
sort($widgetfiles);
131
array_unshift($widgetfiles, "system_information.widget.php");
132

    
133

    
134
if (!is_array($config['widgets'])) {
135
	$config['widgets'] = array();
136
}
137

    
138
$pconfig['sequence'] = $config['widgets']['sequence'];
139
	
140
if ($_POST){
141
	$config['widgets']['sequence'] = $_POST['sequence'];
142
	
143
	foreach ($widgetnames as $widget){
144
		if ($_POST[$widget . '-config']){
145
			$config['widgets'][$widget . '-config'] = $_POST[$widget . '-config'];
146
		}
147
	}
148
	
149
	write_config();
150
	header("Location: index.php");
151
	exit;
152
}
153

    
154
	
155
if ($config['widgets'])
156
{
157
	$widgetlist = $pconfig['sequence'];
158
	
159
	$colpos = array();
160
	$savedwidgetfiles = array();
161
	$widgetname = "";
162
	$widgetlist = explode(",",$widgetlist);
163
	foreach ($widgetlist as $widget){
164
		$dashpos = strpos($widget, "-");		
165
		$widgetname = substr($widget, 0, $dashpos);
166
		$colposition = strpos($widget, ":");		
167
		$displayposition = strrpos($widget, ":");
168
		$colpos[] = substr($widget,$colposition+1, $displayposition - $colposition-1);
169
		$displayarray[] = substr($widget,$displayposition+1);
170
		$savedwidgetfiles[] = $widgetname . ".widget.php";
171
	}
172
	foreach ($widgetnames as $widget){
173
		if ($config['widgets'][$widget . '-config']){
174
			$pconfig[$widget . '-config'] = $config['widgets'][$widget . '-config'];
175
		}
176
	}	
177
}
178

    
179

    
180
//build list of php include files
181
$phpincludefiles = Array();
182
$directory = "widgets/include/";
183
$dirhandle  = opendir($directory);
184
$filename = "";
185
while (false !== ($filename = readdir($dirhandle))) {
186
	$phpincludefiles[] = $filename;
187
}
188
foreach($phpincludefiles as $includename) {
189
	if(!stristr($includename, ".inc"))
190
		continue;	
191
	include($directory . $includename);
192
}
193
	
194
	
195

    
196
$jscriptstr = <<<EOD
197
<script language="javascript" type="text/javascript">
198

    
199
function addDiv(selectedDiv){	
200
	selectedDiv = selectedDiv + "-div";
201
	textlink = d.getElementById(selectedDiv);
202
	if (textlink.style.display != "none")
203
	{
204
		Effect.Shake(selectedDiv);	
205
	}
206
	else
207
	{
208
		Effect.Appear(selectedDiv, {duration:1});
209
		d = document;	
210
		selectIntLink = selectedDiv + "-input";
211
		textlink = d.getElementById(selectIntLink);
212
		textlink.value = "show";	
213
		showSave();
214
	}
215
}
216

    
217
function configureDiv(selectedDiv){
218
	selectIntLink = selectedDiv + "-settings";	
219
	d = document;
220
	textlink = d.getElementById(selectIntLink);
221
	if (textlink.style.display == "none")
222
		Effect.BlindDown(selectIntLink, {duration:1});
223
	else
224
		Effect.BlindUp(selectIntLink, {duration:1});
225
}
226

    
227
function showDiv(selectedDiv,swapButtons){
228
		//appear element
229
    Effect.BlindDown(selectedDiv, {duration:1});      
230
    showSave();    
231
	d = document;	
232
    if (swapButtons){
233
	    selectIntLink = selectedDiv + "-min";
234
		textlink = d.getElementById(selectIntLink);
235
		textlink.style.display = "inline";
236
	    
237
	    
238
	    selectIntLink = selectedDiv + "-open";
239
		textlink = d.getElementById(selectIntLink);
240
		textlink.style.display = "none";
241

    
242
    }
243
	selectIntLink = selectedDiv + "-div-input";
244
	textlink = d.getElementById(selectIntLink);
245
	textlink.value = "show";	
246
    
247
}
248
	
249
function minimizeDiv(selectedDiv,swapButtons){
250
	//fade element
251
    Effect.BlindUp(selectedDiv, {duration:1});      
252
    showSave();
253
	d = document;	
254
    if (swapButtons){
255
	    selectIntLink = selectedDiv + "-open";
256
		textlink = d.getElementById(selectIntLink);
257
		textlink.style.display = "inline";	    
258
	    
259
	    selectIntLink = selectedDiv + "-min";
260
		textlink = d.getElementById(selectIntLink);
261
		textlink.style.display = "none";
262
    }  		
263
	selectIntLink = selectedDiv + "-div-input";
264
	textlink = d.getElementById(selectIntLink);
265
	textlink.value = "hide";	  
266
    
267
}
268

    
269
function closeDiv(selectedDiv){	
270
	showSave();
271
	selectedDiv = selectedDiv + "-div";
272
	Effect.Fade(selectedDiv, {duration:1});
273
	d = document;
274
	selectIntLink = selectedDiv + "-input";
275
	textlink = d.getElementById(selectIntLink);
276
	textlink.value = "close";	
277
}
278

    
279
function showSave(){
280
	d = document;
281
	selectIntLink = "submit";
282
	textlink = d.getElementById(selectIntLink);
283
	textlink.style.display = "inline";	
284
}
285

    
286
function updatePref(){	
287
	var widgets = document.getElementsByClassName('widgetdiv');
288
	var widgetSequence = "";
289
	var firstprint = false;	
290
	d = document;
291
	for (i=0; i<widgets.length; i++){
292
		if (firstprint)
293
			widgetSequence += ",";
294
		var widget = widgets[i].id;
295
		widgetSequence += widget + ":" + widgets[i].parentNode.id + ":";
296
		widget = widget + "-input";
297
		textlink = d.getElementById(widget).value;
298
		widgetSequence += textlink;
299
		firstprint = true;		
300
	}
301
	selectLink = "sequence";
302
	textlink = d.getElementById(selectLink);
303
	textlink.value = widgetSequence;
304
	return true;	
305
}
306

    
307
function hideAllWidgets(){		
308
		Effect.Fade('niftyOutter', {to: 0.2});
309
}
310

    
311
function showAllWidgets(){		
312
		Effect.Fade('niftyOutter', {to: 1.0});
313
}
314

    
315
</script>
316
EOD;
317
$closehead = false;
318

    
319
## Set Page Title and Include Header
320
$pgtitle = "pfSense webGUI";
321
include("head.inc");
322
	
323
	
324
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domLib.js\"></script>";
325
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domTT.js\"></script>";
326
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/behaviour.js\"></script>";
327
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/fadomatic.js\"></script>";
328
?>
329

    
330
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
331
<form action="index.php" method="post">
332
<script language="javascript" type="text/javascript">
333
// <![CDATA[
334
columns = ['col1','col2'];
335
// ]]>
336

    
337
</script>
338

    
339

    
340
<script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script>
341
<script src="/javascript/scriptaculous/scriptaculous.js" type="text/javascript"></script>
342

    
343
<?php
344
include("fbegin.inc");
345
echo $jscriptstr;
346
	if(!file_exists("/usr/local/www/themes/{$g['theme']}/no_big_logo"))
347
		echo "<center><img src=\"./themes/".$g['theme']."/images/logobig.jpg\"></center><br>";
348
?>
349

    
350
<?php 
351
	?>
352
<div id="widgetcontainer" style="display:none">
353
		<div id="content1"><h1>Available Widgets</h1><p><?php
354
			$widgetfiles_add = $widgetfiles;
355
			sort($widgetfiles_add);
356
			foreach($widgetfiles_add as $widget) {			
357
				if(!stristr($widget, "widget.php"))
358
					continue;		
359
				
360
				$periodpos = strpos($widget, ".");
361
				$widgetname = substr($widget, 0, $periodpos);
362
				$nicename = $widgetname;
363
				$nicename = str_replace("_", " ", $nicename);
364
				//make the title look nice
365
				$nicename = ucwords($nicename);
366
				
367
				$widgettitle = $widgetname . "_title";
368
				$widgettitlelink = $widgetname . "_title_link";
369
					if ($$widgettitle != "")
370
					{
371
						//echo widget title ?>
372
						<span style="cursor: pointer;" onclick='return addDiv("<?php echo $widgetname; ?>")'>
373
						<u><?php echo $$widgettitle; ?></u></span><br>
374
						<?php 
375
					}
376
					else {?>
377
						<span style="cursor: pointer;" onclick='return addDiv("<?php echo $widgetname; ?>")'>
378
						<u><?php echo $nicename; ?></u></span><br><?php
379
					}
380
			}
381
		?>
382
		</p>
383
	</div>
384
</div>
385

    
386
<div id="welcomecontainer" style="display:none">
387
		<div id="welcome-div">
388
			<h1>
389
				<div style="float:left;width:80%;padding: 2px">
390
					Welcome to the New Dashboard page!
391
				</div>
392
				<div onclick="domTT_close(this);showAllWidgets();" style="float:right;width:8%; cursor:pointer;padding: 5px;" >
393
					<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_close.gif" />
394
				</div>
395
				<div style="clear:both;"></div>
396
			</h1>
397
			<p>
398
			This page allows you to customize the information you want to be displayed!<br/>
399
			To get started click the <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif"> icon to add widgets.<br/>
400
			<br/>
401
			You can move any widget around by clicking and dragging the title.			
402
			</p>
403
	</div>
404
</div>
405

    
406

    
407

    
408
<input type="hidden" value="" name="sequence" id="sequence">
409
<p class="pgtitle">Dashboard&nbsp;&nbsp;&nbsp;
410
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="Click here to add widgets" style="cursor: pointer;" onmouseup="domTT_activate(this, event, 'content', document.getElementById('content1'), 'type', 'velcro', 'delay', 0, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle');" />
411

    
412
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_info_pkg.gif" alt="Click here for help" style="cursor: help;" onmouseup="hideAllWidgets();domTT_activate(this, event, 'content', document.getElementById('welcome-div'), 'type', 'sticky', 'closeLink', '','delay', 0, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle');" />
413

    
414

    
415
&nbsp;&nbsp;&nbsp;
416
		<input id="submit" name="submit" type="submit" style="display:none" onclick="return updatePref();" class="formbtn" value="Save Settings" />
417
</p>
418

    
419
<div style="clear:both;"></div>
420
<div id="niftyOutter">
421
	<?php
422
	$totalwidgets = count($widgetfiles);
423
	$halftotal = $totalwidgets / 2 -1;
424
	$widgetcounter = 0;
425
	$directory = "widgets/widgets/";
426
	$printed = false;
427
	$firstprint = false;
428
	?> 
429
	<div id="col1" style="float:left;width:49%;padding: 2px;padding-bottom:40px">		
430
	<?php
431
	
432
	if ($config['widgets']){
433
		$widgetlist = $savedwidgetfiles;
434
		
435
		//add widgets that may not be in the saved configuration, in case they want to be added later
436
		foreach ($widgetfiles as $defaultwidgets){
437
			
438
			if (!in_array($defaultwidgets, $savedwidgetfiles)){
439
				$widgetlist[] = $defaultwidgets;
440
			}
441
		}		
442
		
443
	}
444
	else
445
		$widgetlist = $widgetfiles;	
446
	
447
	foreach($widgetlist as $widget) {
448
	
449
		if(!stristr($widget, "widget.php"))
450
			continue;		
451
		
452
		$periodpos = strpos($widget, ".");
453
		$widgetname = substr($widget, 0, $periodpos);	
454
		if ($widgetname != ""){
455
		$nicename = $widgetname;
456
		$nicename = str_replace("_", " ", $nicename);
457
			
458
		//make the title look nice
459
		$nicename = ucwords($nicename);
460
		
461
		if ($config['widgets']){
462
			if ($displayarray[$widgetcounter] == "show"){
463
				$divdisplay = "block";
464
				$display = "block";
465
				$inputdisplay = "show";					
466
				$showdiv = "none";
467
				$mindiv = "inline";
468
			}
469
			else if ($displayarray[$widgetcounter] == "hide") {
470
				$divdisplay = "block";
471
				$display = "none";
472
				$inputdisplay = "hide";		
473
				$showdiv = "inline";
474
				$mindiv = "none";
475
			}
476
			else if ($displayarray[$widgetcounter] == "close"){
477
				$divdisplay = "none";
478
				$display = "block";
479
				$inputdisplay = "close";			
480
				$showdiv = "none";
481
				$mindiv = "inline";
482
			}
483
			else{
484
				$divdisplay = "none";
485
				$display = "block";
486
				$inputdisplay = "none";
487
				$showdiv = "none";
488
				$mindiv = "inline";
489
			}
490
		}
491
		else
492
		{
493
			if ($firstprint == false){
494
				$divdisplay = "block";
495
				$display = "block";
496
				$inputdisplay = "show";					
497
				$showdiv = "none";
498
				$mindiv = "inline";
499
				$firstprint = true;
500
			}
501
			else
502
			{
503
				$divdisplay = "none";
504
				$display = "block";
505
				$inputdisplay = "close";			
506
				$showdiv = "none";
507
				$mindiv = "inline";
508
			}
509
		}
510
			
511
		
512
		if ($config['widgets']){
513
			if ($colpos[$widgetcounter] == "col2" && $printed == false)
514
			{
515
				$printed = true;
516
				?>
517
				</div>
518
				<div id="col2" style="float:right;width:49%;padding: 2px;padding-bottom:40px">		
519
				<?php
520
			}
521
		}
522
		else if ($widgetcounter >= $halftotal && $printed == false){
523
			$printed = true;
524
			?>
525
			</div>
526
			<div id="col2" style="float:right;width:49%;padding: 2px;padding-bottom:40px">		
527
			<?php
528
		}
529
		
530
		?>
531
		<div style="clear:both;"></div>
532
		<div  id="<?php echo $widgetname;?>-div" class="widgetdiv" style="display:<?php echo $divdisplay; ?>;">
533
			<input type="hidden" value="<?php echo $inputdisplay;?>" id="<?php echo $widgetname;?>-div-input" name="<?php echo $widgetname;?>-div-input">
534
			<div id="<?php echo $widgetname;?>topic" class="widgetheader" style="cursor:move">
535
				<div style="float:left;">
536
					<?php 
537
					
538
					$widgettitle = $widgetname . "_title";
539
					$widgettitlelink = $widgetname . "_title_link";
540
					if ($$widgettitle != "")
541
					{
542
						//only show link if defined
543
						if ($$widgettitlelink != "") {?>						
544
						<u><span onClick="location.href='/<?php echo $$widgettitlelink;?>'" style="cursor:pointer">
545
						<?php }
546
							//echo widget title
547
							echo $$widgettitle; 
548
						if ($$widgettitlelink != "") { ?>
549
						</span></u>						
550
						<?php }
551
					}
552
					else{		
553
						if ($$widgettitlelink != "") {?>						
554
						<u><span onClick="location.href='/<?php echo $$widgettitlelink;?>'" style="cursor:pointer">
555
						<?php }
556
						echo $nicename;
557
							if ($$widgettitlelink != "") { ?>
558
						</span></u>						
559
						<?php }
560
					}
561
					?>
562
				</div>
563
				<div align="right" style="float:right;">	
564
					<div id="<?php echo $widgetname;?>-configure" onclick='return configureDiv("<?php echo $widgetname;?>")' style="display:none; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_configure.gif" /></div>									
565
					<div id="<?php echo $widgetname;?>-open" onclick='return showDiv("<?php echo $widgetname;?>",true)' style="display:<?php echo $showdiv;?>; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_open.gif" /></div>	
566
					<div id="<?php echo $widgetname;?>-min" onclick='return minimizeDiv("<?php echo $widgetname;?>",true)' style="display:<?php echo $mindiv;?>; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_minus.gif"/></div>												
567
					<div id="<?php echo $widgetname;?>-close" onclick='return closeDiv("<?php echo $widgetname;?>",true)' style="display:inline; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_close.gif" /></div>	
568
				</div>
569
				<div style="clear:both;"></div>
570
			</div>
571
			<div id="<?php echo $widgetname;?>" style="display:<?php echo $display; ?>;">
572
				<?php include($directory . $widget); ?>
573
			</div>
574
			<div style="clear:both;"></div>
575
		</div>
576
		<?php 	
577
	$widgetcounter++;
578
		}
579
	}//end foreach	
580
	?>			
581
	</div><!-- end col -->
582
	<?php  if ($printed == false){
583
			$printed = true;
584
			?>
585
			</div>
586
			<div id="col2" style="float:right;width:49%;padding: 2px;padding-bottom:40px"></div>
587
		
588
			<?php } ?>
589
	<div style="clear:both;"></div>
590
</div>
591

    
592

    
593

    
594
<?php include("fend.inc"); ?>
595
	    
596
<script type="text/javascript">
597

    
598
	<?php if (!$config['widgets']){ ?>
599
	window.onload = function(in_event)
600
	{		
601
			hideAllWidgets();		    
602
			domTT_activate('welcome1', null, 'x', 287, 'y', 107, 'content', document.getElementById('welcome-div'), 'type', 'sticky', 'closeLink', '','delay', 1000, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle');		
603
	}
604
	<?php } ?>
605
	// <![CDATA[
606
	Sortable.create("col1", {tag:'div',dropOnEmpty:true,containment:columns,handle:'widgetheader',constraint:false,only:'widgetdiv',onChange:showSave});	
607
	Sortable.create("col2", {tag:'div',dropOnEmpty:true,containment:columns,handle:'widgetheader',constraint:false,only:'widgetdiv',onChange:showSave});		
608
	// ]]>	
609
	
610
	<?php
611
	//build list of javascript include files
612
	$jsincludefiles = array();
613
	$directory = "widgets/javascript/";
614
	$dirhandle  = opendir($directory);
615
	$filename = "";
616
	while (false !== ($filename = readdir($dirhandle))) {
617
   		$jsincludefiles[] = $filename;
618
	}
619
	foreach($jsincludefiles as $jsincludename) {
620
		if(!stristr($jsincludename, ".js"))
621
			continue;	
622
		include($directory . $jsincludename);
623
	}
624
	?>
625
</script>
626
</form>
627
</body>
628
</html>
(72-72/181)