Commit 4a8b6cae authored by Franco Fichtner's avatar Franco Fichtner

src: unify php opening tags, ze part nummer 1 of two

parent 6b4d81af
...@@ -205,7 +205,7 @@ function backup_config_section($section_name) { ...@@ -205,7 +205,7 @@ function backup_config_section($section_name) {
return $xmlconfig; return $xmlconfig;
} }
/* KEEP THIS: unbreaks syntax highlighting <? */ /* KEEP THIS: unbreaks syntax highlighting <?php */
/* /*
* restore_config_section($section_name, new_contents): restore a configuration section, * restore_config_section($section_name, new_contents): restore a configuration section,
......
...@@ -112,7 +112,7 @@ include("head.inc"); ...@@ -112,7 +112,7 @@ include("head.inc");
print_info_box($savemsg); print_info_box($savemsg);
} ?> } ?>
<?PHP if ($carp_detected_problems) { <?php if ($carp_detected_problems) {
print_info_box(gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br />" . gettext("Check link status on all interfaces with configured CARP VIPs.")); print_info_box(gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br />" . gettext("Check link status on all interfaces with configured CARP VIPs."));
} ?> } ?>
......
...@@ -709,7 +709,7 @@ function backuparea_change(obj) { ...@@ -709,7 +709,7 @@ function backuparea_change(obj) {
<th class="col-sm-3"></th> <th class="col-sm-3"></th>
</thead> </thead>
<tbody> <tbody>
<tr><td><?=gettext("Enable"); ?> </td> <td><input name="GDriveEnabled" class="formcheckbox" id="GDriveEnabled" type="checkbox" <? if( $config['system']['remotebackup']['GDriveEnabled'] == "on" ) echo "checked";?> > </td></tr> <tr><td><?=gettext("Enable"); ?> </td> <td><input name="GDriveEnabled" class="formcheckbox" id="GDriveEnabled" type="checkbox" <?php if( $config['system']['remotebackup']['GDriveEnabled'] == "on" ) echo "checked";?> > </td></tr>
<tr><td><?=gettext("Email Address"); ?> </td><td><input name="GDriveEmail" class="formfld" size="20" value="<? echo $config['system']['remotebackup']['GDriveEmail'];?>" type="text"> </td> </tr> <tr><td><?=gettext("Email Address"); ?> </td><td><input name="GDriveEmail" class="formfld" size="20" value="<? echo $config['system']['remotebackup']['GDriveEmail'];?>" type="text"> </td> </tr>
<tr><td><?=gettext("P12 key"); ?> <? if (isset($config['system']['remotebackup']['GDriveP12key'])) echo gettext("(replace)"); else echo gettext("(not loaded)"); ?> </td><td> <input name="GDriveP12file" class="formbtn" id="P12file" size="40" type="file"></td> </tr> <tr><td><?=gettext("P12 key"); ?> <? if (isset($config['system']['remotebackup']['GDriveP12key'])) echo gettext("(replace)"); else echo gettext("(not loaded)"); ?> </td><td> <input name="GDriveP12file" class="formbtn" id="P12file" size="40" type="file"></td> </tr>
<tr><td><?=gettext("Folder ID"); ?> </td><td> <input name="GDriveFolderID" class="formbtn" id="GDriveFolderID" value="<? echo $config['system']['remotebackup']['GDriveFolderID'];?>" size="40" type="text"></td> </tr> <tr><td><?=gettext("Folder ID"); ?> </td><td> <input name="GDriveFolderID" class="formbtn" id="GDriveFolderID" value="<? echo $config['system']['remotebackup']['GDriveFolderID'];?>" size="40" type="text"></td> </tr>
......
<? include("index.php"); ?>
...@@ -253,8 +253,8 @@ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enabl ...@@ -253,8 +253,8 @@ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enabl
<object data="graph.php?ifnum=<?=htmlspecialchars($curif);?>&amp;ifname=<?=rawurlencode($ifdescrs[htmlspecialchars($curif)]);?>"> <object data="graph.php?ifnum=<?=htmlspecialchars($curif);?>&amp;ifname=<?=rawurlencode($ifdescrs[htmlspecialchars($curif)]);?>">
<param name="id" value="graph" /> <param name="id" value="graph" />
<param name="type" value="image/svg+xml" /> <param name="type" value="image/svg+xml" />
<param name="width" value="<? echo $width; ?>" /> <param name="width" value="<?php echo $width; ?>" />
<param name="height" value="<? echo $height; ?>" /> <param name="height" value="<?php echo $height; ?>" />
<param name="pluginspage" value="http://www.adobe.com/svg/viewer/install/auto" /> <param name="pluginspage" value="http://www.adobe.com/svg/viewer/install/auto" />
</object> </object>
</div> </div>
......
...@@ -112,7 +112,7 @@ if ($_POST) { ...@@ -112,7 +112,7 @@ if ($_POST) {
<?php if (is_subsystem_dirty('loadbalancer')): ?><br/> <?php if (is_subsystem_dirty('loadbalancer')): ?><br/>
<?php print_info_box_apply(sprintf(gettext("The load balancer configuration has been changed%sYou must apply the changes in order for them to take effect."), "<br />"));?> <?php print_info_box_apply(sprintf(gettext("The load balancer configuration has been changed%sYou must apply the changes in order for them to take effect."), "<br />"));?>
<? endif; ?> <?php endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
......
...@@ -58,7 +58,7 @@ include("head.inc"); ...@@ -58,7 +58,7 @@ include("head.inc");
<?php if (is_subsystem_dirty('loadbalancer')): ?><br/> <?php if (is_subsystem_dirty('loadbalancer')): ?><br/>
<?php print_info_box_apply(sprintf(gettext("The load balancer configuration has been changed%sYou must apply the changes in order for them to take effect."), "<br />"));?> <?php print_info_box_apply(sprintf(gettext("The load balancer configuration has been changed%sYou must apply the changes in order for them to take effect."), "<br />"));?>
<? endif; ?> <?php endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
......
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
...@@ -67,7 +68,7 @@ include("head.inc"); ...@@ -67,7 +68,7 @@ include("head.inc");
<h3><?php echo gettext("UPnP is currently disabled."); ?></h3> <h3><?php echo gettext("UPnP is currently disabled."); ?></h3>
</header> </header>
<? else: ?> <?php else: ?>
<div class="table-responsive"> <div class="table-responsive">
...@@ -111,7 +112,7 @@ include("head.inc"); ...@@ -111,7 +112,7 @@ include("head.inc");
<form action="status_upnp.php" method="post"> <form action="status_upnp.php" method="post">
<input type="submit" name="clear" id="clear" class="btn btn-primary" value="<?=gettext("Clear");?>" /> <?=gettext("all currently connected sessions");?>. <input type="submit" name="clear" id="clear" class="btn btn-primary" value="<?=gettext("Clear");?>" /> <?=gettext("all currently connected sessions");?>.
</form> </form>
<? endif; ?> <?php endif; ?>
</div> </div>
</section> </section>
......
...@@ -321,10 +321,8 @@ servers[<?=$sindex; ...@@ -321,10 +321,8 @@ servers[<?=$sindex;
servers[<?=$sindex; servers[<?=$sindex;
?>][3][<?=$c; ?>][3][<?=$c;
?>][1] = '<?=str_replace("'", "\\'", $cert['certname']);?>'; ?>][1] = '<?=str_replace("'", "\\'", $cert['certname']);?>';
<? $c++; <?php $c++; endforeach; ?>
endforeach; ?> <?php endforeach; ?>
<?
endforeach; ?>
function download_begin(act, i, j) { function download_begin(act, i, j) {
......
...@@ -1128,11 +1128,10 @@ endif; ?> ...@@ -1128,11 +1128,10 @@ endif; ?>
<option value="<?=$name;?>"<?=$selected?>> <option value="<?=$name;?>"<?=$selected?>>
<?=htmlspecialchars($desc);?> <?=htmlspecialchars($desc);?>
</option> </option>
<?php <?php endforeach; ?>
endforeach; ?>
</select> </select>
<div class="hidden" for="help_for_digest"> <div class="hidden" for="help_for_digest">
<?PHP echo gettext("NOTE: Leave this set to SHA1 unless all clients are set to match. SHA1 is the default for OpenVPN."); ?> <?php echo gettext("NOTE: Leave this set to SHA1 unless all clients are set to match. SHA1 is the default for OpenVPN."); ?>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -1151,8 +1150,7 @@ endif; ?> ...@@ -1151,8 +1150,7 @@ endif; ?>
<option value="<?=$name;?>"<?=$selected?>> <option value="<?=$name;?>"<?=$selected?>>
<?=htmlspecialchars($desc);?> <?=htmlspecialchars($desc);?>
</option> </option>
<?php <?php endforeach; ?>
endforeach; ?>
</select> </select>
</td> </td>
</tr> </tr>
......
...@@ -141,13 +141,13 @@ if (isset($config['ipsec']['phase2'])) { ...@@ -141,13 +141,13 @@ if (isset($config['ipsec']['phase2'])) {
<td><?=$ipsec['local-ts'];?></td> <td><?=$ipsec['local-ts'];?></td>
<td><?=$ipsec['remote-ts'];?></td> <td><?=$ipsec['remote-ts'];?></td>
<td> <td>
<? if($ipsec['active']): <?php if($ipsec['active']):
?> ?>
<span class='glyphicon glyphicon-transfer text-success' alt='Tunnel status'></span> <span class='glyphicon glyphicon-transfer text-success' alt='Tunnel status'></span>
<? else: <?php else:
?> ?>
<span class='glyphicon glyphicon-transfer text-danger' alt='Tunnel status'></span> <span class='glyphicon glyphicon-transfer text-danger' alt='Tunnel status'></span>
<? endif; <?php endif;
?> ?>
</td> </td>
</tr> </tr>
......
...@@ -64,23 +64,17 @@ $filesystems = get_mounted_filesystems(); ...@@ -64,23 +64,17 @@ $filesystems = get_mounted_filesystems();
jQuery("#cpuPB").css( { width:0 } ); jQuery("#cpuPB").css( { width:0 } );
jQuery("#memUsagePB").css( { width: '<?php echo mem_usage(); ?>%' } ); jQuery("#memUsagePB").css( { width: '<?php echo mem_usage(); ?>%' } );
<?PHP $d = 0; ?> <?php $d = 0; ?>
<?PHP foreach ($filesystems as $fs) : <?php foreach ($filesystems as $fs) : ?>
?>
jQuery("#diskUsagePB<?php echo $d++; ?>").css( { width: '<?php echo $fs['percent_used']; ?>%' } ); jQuery("#diskUsagePB<?php echo $d++; ?>").css( { width: '<?php echo $fs['percent_used']; ?>%' } );
<?PHP <?php endforeach; ?>
endforeach; ?>
<?php if ($showswap == true) : <?php if ($showswap == true) : ?>
?>
jQuery("#swapUsagePB").css( { width: '<?php echo swap_usage(); ?>%' } ); jQuery("#swapUsagePB").css( { width: '<?php echo swap_usage(); ?>%' } );
<?php <?php endif; ?>
endif; ?> <?php if (get_temp() != "") : ?>
<?php if (get_temp() != "") :
?>
jQuery("#tempPB").css( { width: '<?php echo get_temp(); ?>%' } ); jQuery("#tempPB").css( { width: '<?php echo get_temp(); ?>%' } );
<?php <?php endif; ?>
endif; ?>
}); });
//]]> //]]>
</script> </script>
...@@ -114,17 +108,14 @@ endif; ?> ...@@ -114,17 +108,14 @@ endif; ?>
<tr> <tr>
<td width="25%" class="vncellt"><?=gettext("CPU Type");?></td> <td width="25%" class="vncellt"><?=gettext("CPU Type");?></td>
<td width="75%" class="listr"> <td width="75%" class="listr">
<?php <?php echo (htmlspecialchars(get_single_sysctl("hw.model"))); ?>
echo (htmlspecialchars(get_single_sysctl("hw.model")));
?>
<div id="cpufreq"><?= get_cpufreq(); ?></div> <div id="cpufreq"><?= get_cpufreq(); ?></div>
<?php $cpucount = get_cpu_count(); <?php $cpucount = get_cpu_count();
if ($cpucount > 1) : if ($cpucount > 1) :
?> ?>
<div id="cpucount"> <div id="cpucount">
<?= htmlspecialchars($cpucount) ?> CPUs: <?= htmlspecialchars(get_cpu_count(true)); ?></div> <?= htmlspecialchars($cpucount) ?> CPUs: <?= htmlspecialchars(get_cpu_count(true)); ?></div>
<?php <?php endif; ?>
endif; ?>
</td> </td>
</tr> </tr>
<?php if (isset($hwcrypto)) : <?php if (isset($hwcrypto)) :
...@@ -133,8 +124,7 @@ endif; ?> ...@@ -133,8 +124,7 @@ endif; ?>
<td width="25%" class="vncellt"><?=gettext("Hardware crypto");?></td> <td width="25%" class="vncellt"><?=gettext("Hardware crypto");?></td>
<td width="75%" class="listr"><?=htmlspecialchars($hwcrypto);?></td> <td width="75%" class="listr"><?=htmlspecialchars($hwcrypto);?></td>
</tr> </tr>
<?php <?php endif; ?>
endif; ?>
<tr> <tr>
<td width="25%" class="vncellt"><?=gettext("Uptime");?></td> <td width="25%" class="vncellt"><?=gettext("Uptime");?></td>
<td width="75%" class="listr" id="uptime"><?= htmlspecialchars(get_uptime()); ?></td> <td width="75%" class="listr" id="uptime"><?= htmlspecialchars(get_uptime()); ?></td>
...@@ -162,8 +152,7 @@ endif; ?> ...@@ -162,8 +152,7 @@ endif; ?>
<td width="25%" class="vncellt"><?=gettext("Last config change");?></td> <td width="25%" class="vncellt"><?=gettext("Last config change");?></td>
<td width="75%" class="listr"><?= htmlspecialchars(date("D M j G:i:s T Y", intval($config['revision']['time'])));?></td> <td width="75%" class="listr"><?= htmlspecialchars(date("D M j G:i:s T Y", intval($config['revision']['time'])));?></td>
</tr> </tr>
<?php <?php endif; ?>
endif; ?>
<tr> <tr>
<td width="25%" class="vncellt"><?=gettext("State table size");?></td> <td width="25%" class="vncellt"><?=gettext("State table size");?></td>
<td width="75%" class="listr"> <td width="75%" class="listr">
...@@ -213,8 +202,7 @@ endif; ?> ...@@ -213,8 +202,7 @@ endif; ?>
<span id="tempmeter"><?= $temp."&#176;C"; ?></span> <span id="tempmeter"><?= $temp."&#176;C"; ?></span>
</td> </td>
</tr> </tr>
<?php <?php endif; ?>
endif; ?>
<tr> <tr>
<td width="25%" class="vncellt"><?=gettext("Load average");?></td> <td width="25%" class="vncellt"><?=gettext("Load average");?></td>
<td width="75%" class="listr"> <td width="75%" class="listr">
...@@ -259,23 +247,21 @@ endif; ?> ...@@ -259,23 +247,21 @@ endif; ?>
<span id="swapusagemeter"><?= $swapusage.'%'; ?></span> used <?= sprintf("%.0f/%.0f", `/usr/sbin/swapinfo -m | /usr/bin/grep -v Device | /usr/bin/awk '{ print $3;}'`, `/usr/sbin/swapinfo -m | /usr/bin/grep -v Device | /usr/bin/awk '{ print $2;}'`) ?> MB <span id="swapusagemeter"><?= $swapusage.'%'; ?></span> used <?= sprintf("%.0f/%.0f", `/usr/sbin/swapinfo -m | /usr/bin/grep -v Device | /usr/bin/awk '{ print $3;}'`, `/usr/sbin/swapinfo -m | /usr/bin/grep -v Device | /usr/bin/awk '{ print $2;}'`) ?> MB
</td> </td>
</tr> </tr>
<?php <?php endif; ?>
endif; ?>
<tr> <tr>
<td width="25%" class="vncellt"><?=gettext("Disk usage");?></td> <td width="25%" class="vncellt"><?=gettext("Disk usage");?></td>
<td width="75%" class="listr"> <td width="75%" class="listr">
<?PHP $d = 0; ?> <?php $d = 0; ?>
<?PHP foreach ($filesystems as $fs) : <?php foreach ($filesystems as $fs) : ?>
?>
<div class="progress"> <div class="progress">
<div id="diskUsagePB<?php echo $d; ?>" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"> <div id="diskUsagePB<?php echo $d; ?>" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
<span class="sr-only"></span> <span class="sr-only"></span>
</div> </div>
</div> </div>
<?PHP if (substr(basename($fs['device']), 0, 5) == "tmpfs") { <?php if (substr(basename($fs['device']), 0, 5) == "tmpfs") {
$fs['type'] .= " in RAM"; $fs['type'] .= " in RAM";
} ?> } ?>
<?PHP echo "{$fs['mountpoint']} ({$fs['type']})";?>: <span id="diskusagemeter<?php echo $d++ ?>"><?= $fs['percent_used'].'%'; ?></span> used <?PHP echo $fs['used_size'] ."/". $fs['total_size']; <?php echo "{$fs['mountpoint']} ({$fs['type']})";?>: <span id="diskusagemeter<?php echo $d++ ?>"><?= $fs['percent_used'].'%'; ?></span> used <?php echo $fs['used_size'] ."/". $fs['total_size'];
if ($d != count($filesystems)) { if ($d != count($filesystems)) {
echo '<br/><br/>'; echo '<br/><br/>';
} }
......
...@@ -222,7 +222,7 @@ include("head.inc"); ...@@ -222,7 +222,7 @@ include("head.inc");
?> ?>
<body> <body>
<? include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<?php if($pkg['step'][$stepid]['fields']['field'] <> "") { ?> <?php if($pkg['step'][$stepid]['fields']['field'] <> "") { ?>
<script type="text/javascript"> <script type="text/javascript">
...@@ -381,7 +381,7 @@ function showchange() { ...@@ -381,7 +381,7 @@ function showchange() {
<header class="content-box-head container-fluid"> <header class="content-box-head container-fluid">
<h3><?= fixup_string($title) ?></h3> <h3><?= fixup_string($title) ?></h3>
</header> </header>
<? endif; ?> <?php endif; ?>
<div class="content-box-main"> <div class="content-box-main">
<div style="padding:20px !important;"> <div style="padding:20px !important;">
...@@ -1031,4 +1031,4 @@ function is_timezone($elt) { ...@@ -1031,4 +1031,4 @@ function is_timezone($elt) {
?> ?>
<? include('foot.inc'); ?> <?php include('foot.inc'); ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment