Project

General

Profile

« Previous | Next » 

Revision d9555fc5

Added by Colin Fleming about 11 years ago

Tidy up "services_ntpd" XHTML

Add "closehead" PHP variable and manually close HEAD
Add CDATA sections to SCRIPTS
Closing IMG tag and add ALT
Change "onclick" to lower case
Add SUMMARY to tables
Close INPUT tags
Update HTML Boolean operators
Remove closing anchor tag from INPUT tag

View differences:

usr/local/www/services_ntpd.php
168 168

  
169 169
	}
170 170
}
171

  
171
$closehead = false;
172 172
$pconfig = &$config['ntpd'];
173 173
$pgtitle = array(gettext("Services"),gettext("NTP"));
174 174
$shortcut_section = "ntp";
......
177 177
?>
178 178

  
179 179
<script type="text/javascript">
180

  
180
//<![CDATA[
181 181
	//Generic show an advanced option function
182 182
	function show_advanced(showboxID, configvalueID) {
183 183
		document.getElementById(showboxID).innerHTML='';
......
204 204
				//then revise the add another server line
205 205
				if (add < 9) {
206 206
					var next = add + 1;
207
					var newdiv = '<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?php echo gettext("Add another Time server");?>" OnClick="NewTimeServer(' + next + ')">\n';
207
					var newdiv = '<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?php echo gettext("Add another Time server");?>" onclick="NewTimeServer(' + next + ')" alt="add" />\n';
208 208
					document.getElementById('addserver').innerHTML=newdiv;
209 209
				}else{
210 210
					document.getElementById('addserver').style.display = 'none';
......
212 212
			}
213 213
		}
214 214
	}
215
	
215
//]]>
216 216
</script>
217

  
217
</head>
218 218

  
219 219
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
220 220
<?php include("fbegin.inc"); ?>
......
222 222
<?php if ($input_errors) print_input_errors($input_errors); ?>
223 223
<?php if ($savemsg) print_info_box($savemsg); ?>
224 224

  
225
<table width="100%" border="0" cellpadding="0" cellspacing="0">
225
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="ntpd">
226 226
  <tr>
227 227
	<td>
228 228
<?php
......
237 237
  <tr>
238 238
	<td>
239 239
		<div id="mainarea">
240
		<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
240
		<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
241 241
			<tr>
242 242
				<td colspan="2" valign="top" class="listtopic"><?=gettext("NTP Server Configuration"); ?></td>
243 243
			</tr>
......
254 254
		$interfaces[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
255 255
	$size = (count($interfaces) < 10) ? count($interfaces) : 10;
256 256
?>
257
			<select id="interface" name="interface[]" multiple="true" class="formselect" size="<?php echo $size; ?>">
257
			<select id="interface" name="interface[]" multiple="multiple" class="formselect" size="<?php echo $size; ?>">
258 258
<?php	
259 259
	foreach ($interfaces as $iface => $ifacename) {
260 260
		if (!is_ipaddr(get_interface_ip($iface)) && !is_ipaddr($iface))
......
286 286
						}
287 287
						echo ">\n";
288 288
						
289
						echo "<input name=\"server{$i}\" class=\"formfld unknown\" id=\"server{$i}\" size=\"30\" value=\"{$timeservers[$i]}\" type=\"text\">&emsp;";
290
						echo "\n<input name=\"servprefer{$i}\" class=\"formcheckbox\" id=\"servprefer{$i}\" OnClick=\"CheckOffOther('servprefer{$i}', 'servselect{$i}')\" type=\"checkbox\"";
291
						if (substr_count($config['ntpd']['prefer'], $timeservers[$i])) echo ' checked';
292
						echo '>&nbsp;prefer&emsp;';
293
						echo "\n<input name=\"servselect{$i}\" class=\"formcheckbox\" id=\"servselect{$i}\" OnClick=\"CheckOffOther('servselect{$i}', 'servprefer{$i}')\" type=\"checkbox\"";
294
						if (substr_count($config['ntpd']['noselect'], $timeservers[$i])) echo ' checked';
295
						echo ">&nbsp;noselect\n<br />\n</div>\n";
289
						echo "<input name=\"server{$i}\" class=\"formfld unknown\" id=\"server{$i}\" size=\"30\" value=\"{$timeservers[$i]}\" type=\"text\" />&emsp;";
290
						echo "\n<input name=\"servprefer{$i}\" class=\"formcheckbox\" id=\"servprefer{$i}\" onclick=\"CheckOffOther('servprefer{$i}', 'servselect{$i}')\" type=\"checkbox\"";
291
						if (substr_count($config['ntpd']['prefer'], $timeservers[$i])) echo " checked=\"checked\"";
292
						echo " />&nbsp;prefer&emsp;";
293
						echo "\n<input name=\"servselect{$i}\" class=\"formcheckbox\" id=\"servselect{$i}\" onclick=\"CheckOffOther('servselect{$i}', 'servprefer{$i}')\" type=\"checkbox\"";
294
						if (substr_count($config['ntpd']['noselect'], $timeservers[$i])) echo " checked=\"checked\"";
295
						echo " />&nbsp;noselect\n<br />\n</div>\n";
296 296
					}
297 297
					?>
298 298
					<div id="addserver">
299
					<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?php echo gettext("Add another Time server");?>" OnClick="NewTimeServer(<?php echo $j;?>)">
299
					<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?php echo gettext("Add another Time server");?>" onclick="NewTimeServer(<?php echo $j;?>)" alt="add" />
300 300
					</div>
301 301
					<br />
302 302
					<?php echo gettext('For best results three to five servers should be configured here.'); ?>
......
309 309
			<tr>
310 310
				<td width="22%" valign="top" class="vncellreq">Orphan mode</td>
311 311
				<td width="78%" class="vtable">
312
					<input name="ntporphan" type="text" class="formfld unknown" id="ntporphan" min="1" max="16" size="20" value="<?=htmlspecialchars($pconfig['orphan']);?>"><?php echo gettext("(0-15)");?><br />
312
					<input name="ntporphan" type="text" class="formfld unknown" id="ntporphan" min="1" max="16" size="20" value="<?=htmlspecialchars($pconfig['orphan']);?>" /><?php echo gettext("(0-15)");?><br />
313 313
					<?php echo gettext("Orphan mode allows the system clock to be used when no other clocks are available. The number here specifies the stratum reported during orphan mode and should normally be set to a number high enough to insure that any other servers available to clients are preferred over this server. (default: 12)."); ?>
314 314
				</td>
315 315
			</tr>
316 316
			<tr>
317 317
				<td width="22%" valign="top" class="vncellreq">NTP graphs</td>
318 318
				<td width="78%" class="vtable">
319
					<input name="statsgraph" type="checkbox" class="formcheckbox" id="statsgraph" <?php if($pconfig['statsgraph']) echo ' checked'; ?>>
319
					<input name="statsgraph" type="checkbox" class="formcheckbox" id="statsgraph" <?php if($pconfig['statsgraph']) echo " checked=\"checked\""; ?> />
320 320
					<?php echo gettext("Enable rrd graphs of NTP statistics (default: disabled)."); ?>
321 321
				</td>
322 322
			</tr>
......
325 325
				<td width="78%" class="vtable">
326 326
					<?php echo gettext("These options enable additional messages from NTP to be written to the System Log");?> (<a href="diag_logs_ntpd.php"><?php echo gettext("Status > System Logs > NTP"); ?></a>).
327 327
					<br /><br />
328
					<input name="logpeer" type="checkbox" class="formcheckbox" id="logpeer"<?php if($pconfig['logpeer']) echo ' checked'; ?>>
328
					<input name="logpeer" type="checkbox" class="formcheckbox" id="logpeer"<?php if($pconfig['logpeer']) echo " checked=\"checked\""; ?> />
329 329
					<?php echo gettext("Enable logging of peer messages (default: disabled)."); ?>
330 330
					<br />
331
					<input name="logsys" type="checkbox" class="formcheckbox" id="logsys"<?php if($pconfig['logsys']) echo ' checked'; ?>>
331
					<input name="logsys" type="checkbox" class="formcheckbox" id="logsys"<?php if($pconfig['logsys']) echo " checked=\"checked\""; ?> />
332 332
					<?php echo gettext("Enable logging of system messages (default: disabled)."); ?>
333 333
				</td>
334 334
			</tr>
......
336 336
				<td width="22%" valign="top" class="vncellreq">Statistics logging</td>
337 337
				<td width="78%" class="vtable">
338 338
					<div id="showstatisticsbox">
339
					<input type="button" onClick="show_advanced('showstatisticsbox', 'showstatistics')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show statistics logging options");?></a>
339
					<input type="button" onclick="show_advanced('showstatisticsbox', 'showstatistics')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show statistics logging options");?>
340 340
					</div>
341 341
					<div id="showstatistics" style="display:none">
342 342
					<strong><?php echo gettext("Warning: ")?></strong><?php echo gettext("these options will create persistant daily log files in /var/log/ntp."); ?>
343 343
					<br /><br />
344
					<input name="clockstats" type="checkbox" class="formcheckbox" id="clockstats"<?php if($pconfig['clockstats']) echo ' checked'; ?>>
344
					<input name="clockstats" type="checkbox" class="formcheckbox" id="clockstats"<?php if($pconfig['clockstats']) echo " checked=\"checked\""; ?> />
345 345
					<?php echo gettext("Enable logging of reference clock statistics (default: disabled)."); ?>
346 346
					<br />
347
					<input name="loopstats" type="checkbox" class="formcheckbox" id="loopstats"<?php if($pconfig['loopstats']) echo ' checked'; ?>>
347
					<input name="loopstats" type="checkbox" class="formcheckbox" id="loopstats"<?php if($pconfig['loopstats']) echo " checked=\"checked\""; ?> />
348 348
					<?php echo gettext("Enable logging of clock discipline statistics (default: disabled)."); ?>
349 349
					<br />
350
					<input name="peerstats" type="checkbox" class="formcheckbox" id="peerstats"<?php if($pconfig['peerstats']) echo ' checked'; ?>>
350
					<input name="peerstats" type="checkbox" class="formcheckbox" id="peerstats"<?php if($pconfig['peerstats']) echo " checked=\"checked\""; ?> />
351 351
					<?php echo gettext("Enable logging of NTP peer statistics (default: disabled)."); ?>
352 352
					</div>
353 353
				</td>
......
356 356
				<td width="22%" valign="top" class="vncellreq">Access restrictions</td>
357 357
				<td width="78%" class="vtable">
358 358
					<div id="showrestrictbox">
359
					<input type="button" onClick="show_advanced('showrestrictbox', 'showrestrict')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show access restriction options");?></a>
359
					<input type="button" onclick="show_advanced('showrestrictbox', 'showrestrict')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show access restriction options");?>
360 360
					</div>
361 361
					<div id="showrestrict" style="display:none">
362 362
					<?php echo gettext("these options control access to NTP from the WAN."); ?>
363 363
					<br /><br />
364
					<input name="kod" type="checkbox" class="formcheckbox" id="kod"<?php if(!$pconfig['kod']) echo ' checked'; ?>>
364
					<input name="kod" type="checkbox" class="formcheckbox" id="kod"<?php if(!$pconfig['kod']) echo " checked=\"checked\""; ?> />
365 365
					<?php echo gettext("Enable Kiss-o'-death packets (default: enabled)."); ?>
366 366
					<br />
367
					<input name="nomodify" type="checkbox" class="formcheckbox" id="nomodify"<?php if(!$pconfig['nomodify']) echo ' checked'; ?>>
367
					<input name="nomodify" type="checkbox" class="formcheckbox" id="nomodify"<?php if(!$pconfig['nomodify']) echo " checked=\"checked\""; ?> />
368 368
					<?php echo gettext("Deny state modifications (i.e. run time configuration) by ntpq and ntpdc (default: enabled)."); ?>
369 369
					<br />
370
					<input name="noquery" type="checkbox" class="formcheckbox" id="noquery"<?php if($pconfig['noquery']) echo ' checked'; ?>>
370
					<input name="noquery" type="checkbox" class="formcheckbox" id="noquery"<?php if($pconfig['noquery']) echo " checked=\"checked\""; ?> />>
371 371
					<?php echo gettext("Disable ntpq and ntpdc queries (default: disabled)."); ?>
372 372
					<br />
373
					<input name="noserve" type="checkbox" class="formcheckbox" id="noserve"<?php if($pconfig['noserve']) echo ' checked'; ?>>
373
					<input name="noserve" type="checkbox" class="formcheckbox" id="noserve"<?php if($pconfig['noserve']) echo " checked=\"checked\""; ?> />
374 374
					<?php echo gettext("Disable all except ntpq and ntpdc queries (default: disabled)."); ?>
375 375
					<br />
376
					<input name="nopeer" type="checkbox" class="formcheckbox" id="nopeer"<?php if(!$pconfig['nopeer']) echo ' checked'; ?>>
376
					<input name="nopeer" type="checkbox" class="formcheckbox" id="nopeer"<?php if(!$pconfig['nopeer']) echo " checked=\"checked\""; ?> />
377 377
					<?php echo gettext("Deny packets that attempt a peer association (default: enabled)."); ?>
378 378
					<br />
379
					<input name="notrap" type="checkbox" class="formcheckbox" id="notrap"<?php if(!$pconfig['notrap']) echo ' checked'; ?>>
379
					<input name="notrap" type="checkbox" class="formcheckbox" id="notrap"<?php if(!$pconfig['notrap']) echo " checked=\"checked\""; ?> />
380 380
					<?php echo gettext("Deny mode 6 control message trap service (default: enabled)."); ?>
381 381
					</div>
382 382
				</td>
......
385 385
				<td width="22%" valign="top" class="vncellreq">Leap seconds</td>
386 386
				<td width="78%" class="vtable">
387 387
					<div id="showleapsecbox">
388
					<input type="button" onClick="show_advanced('showleapsecbox', 'showleapsec')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show Leap second configuration");?></a>
388
					<input type="button" onclick="show_advanced('showleapsecbox', 'showleapsec')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show Leap second configuration");?>
389 389
					</div>
390 390
					<div id="showleapsec" style="display:none">
391 391
					<?php echo gettext("A leap second file allows NTP to advertize an upcoming leap second addition or subtraction.");?>
......
394 394
					<?php echo gettext("Enter Leap second configuration as text:");?><br />
395 395
					<textarea name="leaptxt" class="formpre" id="leaptxt" cols="65" rows="7"><?php $text = base64_decode(chunk_split($pconfig['leapsec'])); echo $text;?></textarea><br />
396 396
					<strong><?php echo gettext("Or");?></strong>, <?php echo gettext("select a file to upload:");?>
397
					<input type="file" name="leapfile" class="formfld file" id="leapfile">
397
					<input type="file" name="leapfile" class="formfld file" id="leapfile" />
398 398
					</div>
399 399
				</td>
400 400
			</tr>
401 401
			<tr>
402 402
				<td width="22%" valign="top">&nbsp;</td>
403 403
				<td width="78%">
404
				<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>">
404
				<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
405 405
				</td>
406 406
			</tr>
407 407
		</table>

Also available in: Unified diff