Commit 6000388b authored by Jos Schellevis's avatar Jos Schellevis

Cleanups and bootstrap enhancements

parent 21aea245
......@@ -518,15 +518,8 @@ if (!function_exists('get_service_status_icon')) {
if(get_service_status($service)) {
$statustext = gettext("Running");
$output .= '<span class="btn btn-success"><span class="glyphicon glyphicon-play"></span></span>&nbsp;';
/*
$output .= "<img style=\"vertical-align:middle\" title=\"" . sprintf(gettext("%s Service is"),$service["name"]) . " {$statustext}\" src=\"/themes/" . $g["theme"] . "/images/icons/";
$output .= ($smallicon) ? "icon_pass.gif" : "icon_service_running.gif";
$output .= "\" alt=\"status\" />&nbsp;";
if ($withtext)
$output .= "&nbsp;" . $statustext;
*/
$output .= '<span class="btn btn-success"><span class="glyphicon glyphicon-play" title="'.sprintf(gettext('%s Service is'),$service['name']).' '.$statustext.'" data-toggle="tooltip" data-placement="bottom" ></span></span>&nbsp;';
}
......@@ -534,15 +527,7 @@ if (!function_exists('get_service_status_icon')) {
$service_enabled = is_service_enabled($service['name']);
$statustext = ($service_enabled) ? gettext("Stopped") : gettext("Disabled");
$output .= '<span class="btn btn-danger"><span class="glyphicon glyphicon-stop"></span></span>&nbsp;';
/*
$output .= "<img style=\"vertical-align:middle\" title=\"" . sprintf(gettext("%s Service is"),$service["name"]) . " {$statustext}\" src=\"/themes/" . $g["theme"] . "/images/icons/";
$output .= ($smallicon) ? "icon_block.gif" : "icon_service_stopped.gif";
$output .= "\" alt=\"status\" />&nbsp;";
if ($withtext)
$output .= "&nbsp;<font color=\"white\">{$statustext}</font>";
*/
$output .= '<span class="btn btn-danger"><span class="glyphicon glyphicon-stop" title="'.sprintf(gettext('%s Service is'),$service['name']).' '.$statustext.'" data-toggle="tooltip" data-placement="bottom" ></span></span>&nbsp;';
}
return $output;
......@@ -569,7 +554,7 @@ if (!function_exists('get_service_control_links')) {
default:
$output .= "<a href='status_services.php?mode=restartservice&amp;service={$service['name']}' class=\"btn btn-default\">";
}
$output .= "<span title='" . sprintf(gettext("Restart %sService"),$stitle) . "' class=\"glyphicon glyphicon-refresh\"/></a>\n";
$output .= "<span data-toggle=\"tooltip\" data-placement=\"bottom\" title='" . sprintf(gettext("Restart %sService"),$stitle) . "' class=\"glyphicon glyphicon-refresh\"/></a>\n";
switch ($service['name']) {
case "openvpn":
$output .= "<a href='status_services.php?mode=stopservice&amp;service={$service['name']}&amp;vpnmode={$service['mode']}&amp;id={$service['vpnid']}' class=\"btn btn-default\">";
......@@ -580,7 +565,7 @@ if (!function_exists('get_service_control_links')) {
default:
$output .= "<a href='status_services.php?mode=stopservice&amp;service={$service['name']}' class=\"btn btn-default\">";
}
$output .= "<span title='" . sprintf(gettext("Stop %sService"),$stitle) . "' class=\"glyphicon glyphicon-stop\" />";
$output .= "<span data-toggle=\"tooltip\" data-placement=\"bottom\" title='" . sprintf(gettext("Stop %sService"),$stitle) . "' class=\"glyphicon glyphicon-stop\" />";
$output .= "</a>";
} else {
$service_enabled = is_service_enabled($service['name']);
......@@ -596,7 +581,7 @@ if (!function_exists('get_service_control_links')) {
$output .= "<a href='status_services.php?mode=startservice&amp;service={$service['name']}' class=\"btn btn-default\">";
}
if ($service_enabled)
$output .= "<span title='" . sprintf(gettext("Start %sService"),$stitle) . "' alt='start' class=\"glyphicon glyphicon-play\"/></a>\n";
$output .= "<span data-toggle=\"tooltip\" data-placement=\"bottom\" title='" . sprintf(gettext("Start %sService"),$stitle) . "' alt='start' class=\"glyphicon glyphicon-play\"/></a>\n";
}
return $output;
}
......
......@@ -87,7 +87,10 @@ function get_shortcut_main_link($shortcut_section, $addspace = true, $service =
break;
}
if(!empty($link) && ($_SERVER['REQUEST_URI'] != "/{$link}"))
return "{$space}<a href=\"{$link}\" title=\"" . gettext("Main page for this section") . "\">Main page</a>";
if ($_SERVER['REQUEST_URI'] != "/status_services.php")
return "{$space}<a href=\"{$link}\" title=\"" . gettext("Main page for this section") . "\">Main page</a>";
else
return "{$space}<a href=\"{$link}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Main page for this section") . "\"><span class=\"glyphicon glyphicon-home\"></span></a>";
}
function get_shortcut_status_link($shortcut_section, $addspace = true, $service = array()) {
......@@ -111,14 +114,20 @@ function get_shortcut_status_link($shortcut_section, $addspace = true, $service
break;
}
if(!empty($link))
return "{$space}<a href=\"{$link}\" title=\"" . gettext("Status of items on this page") . "\">Status</a>";
if ($_SERVER['REQUEST_URI'] != "/status_services.php")
return "{$space}<a href=\"{$link}\" title=\"" . gettext("Status of items on this page") . "\">Status</a>";
else
return "{$space}<a href=\"{$link}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Status of items on this page") . "\"><span class=\"glyphicon glyphicon-eye-open\"></span></a>";
}
function get_shortcut_log_link($shortcut_section, $addspace = true) {
global $g, $shortcuts;
$space = ($addspace) ? "&nbsp;" : "" ;
if(!empty($shortcut_section) && !empty($shortcuts[$shortcut_section]['log'])) {
return "{$space}<a href=\"{$shortcuts[$shortcut_section]['log']}\" title=\"" . gettext("Log entries for items on this page") . "\">Log</a>";
if ($_SERVER['REQUEST_URI'] != "/status_services.php")
return "{$space}<a href=\"{$shortcuts[$shortcut_section]['log']}\" title=\"" . gettext("Log entries for items on this page") . "\">Log</a>";
else
return "{$space}<a href=\"{$shortcuts[$shortcut_section]['log']}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Log entries for items on this page") . "\"><span class=\"glyphicon glyphicon-list\"></span></a>";
}
}
......
......@@ -285,9 +285,6 @@ include("head.inc");
<div class="content-box">
<form action="system.php" method="post">
<div class="table-responsive">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area" class="table table-striped">
<thead>
<tr>
......@@ -336,12 +333,12 @@ include("head.inc");
$fldname="dns{$dnscounter}gw";
?>
<tr>
<td>
<td width="348px">
<input name="dns<?php echo $dnscounter;?>" type="text" class="formfld unknown" id="dns<?php echo $dnscounter;?>" size="28" value="<?php echo $pconfig['dns'.$dnscounter];?>" />
</td>
<td>
<?php if ($multiwan): ?>
<select name='<?=$fldname;?>' class='selectpicker' data-style='btn-default'>
<select name='<?=$fldname;?>' class='selectpicker' data-style='btn-default' data-width='auto'>
<?php
$gwname = "none";
$dnsgw = "dns{$dnscounter}gw";
......@@ -516,7 +513,6 @@ include("head.inc");
</tr>
</tbody>
</table>
</div>
</form>
</div>
......
......@@ -1149,37 +1149,32 @@ function internalca_change() {
</td>
<td valign="middle" class="list nowrap">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="system_certmanager.php?act=exp&amp;id=<?=$i;?>" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("export ca");?>">
<span class="glyphicon glyphicon-download"></span>
</a>
</td>
<td>
<a href="system_certmanager.php?act=key&amp;id=<?=$i;?>" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("export key");?>">
<span class="glyphicon glyphicon-download"></span>
</a>
</td>
<td>
<a href="system_certmanager.php?act=p12&amp;id=<?=$i;?>" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("export ca cert+user cert+user cert key in .p12 format");?>">
<span class="glyphicon glyphicon-download"></span>
</a>
</td>
<?php if (!cert_in_use($cert['refid'])): ?>
<td>
<a href="system_certmanager.php?act=del&amp;id=<?=$i;?>" class="btn btn-default btn-xs" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate?");?>')" title="<?=gettext("delete cert");?>">
<span class="glyphicon glyphicon-remove"></span>
</a>
</td>
<?php endif; ?>
<?php if ($cert['csr']): ?>
<td>
<a href="system_certmanager.php?act=csr&amp;id=<?=$i;?>" title="<?=gettext("update csr");?>">
<span class="glyphicon glyphicon-edit"></span>
</a>
</td>
<?php endif; ?>
</tr>
<tr>
<a href="system_certmanager.php?act=exp&amp;id=<?=$i;?>" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("export ca");?>">
<span class="glyphicon glyphicon-download"></span>
</a>
<a href="system_certmanager.php?act=key&amp;id=<?=$i;?>" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("export key");?>">
<span class="glyphicon glyphicon-download"></span>
</a>
<a href="system_certmanager.php?act=p12&amp;id=<?=$i;?>" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("export ca cert+user cert+user cert key in .p12 format");?>">
<span class="glyphicon glyphicon-download"></span>
</a>
<?php if (!cert_in_use($cert['refid'])): ?>
<a href="system_certmanager.php?act=del&amp;id=<?=$i;?>" class="btn btn-default btn-xs" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate?");?>')" data-toggle="tooltip" data-placement="left" title="<?=gettext("delete cert");?>">
<span class="glyphicon glyphicon-remove"></span>
</a>
<?php endif; ?>
<?php if ($cert['csr']): ?>
<a href="system_certmanager.php?act=csr&amp;id=<?=$i;?>" data-toggle="tooltip" data-placement="left" title="<?=gettext("update csr");?>">
<span class="glyphicon glyphicon-edit"></span>
</a>
<?php endif; ?>
</tr>
</table>
</td>
</tr>
......@@ -1187,7 +1182,7 @@ function internalca_change() {
<tr>
<td>&nbsp;</td>
<td colspan="3"><?=gettext("Note: You can only delete a certificate if it is not currently in use.");?></td>
<td colspan="4"><?=gettext("Note: You can only delete a certificate if it is not currently in use.");?></td>
</tr>
</tbody>
</table>
......
......@@ -431,7 +431,7 @@ include("head.inc");
<?php $crl = $thiscrl; ?>
<form action="system_crlmanager.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="revoke">
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="revoke" class="table table-striped">
<thead>
<tr>
<th width="90%" class="listhdrr" colspan="3"><b><?php echo gettext("Currently Revoked Certificates for CRL") . ': ' . $crl['descr']; ?></b></th>
......@@ -468,7 +468,7 @@ include("head.inc");
<?php echo date("D M j G:i:s T Y", $cert["revoke_time"]); ?>
</td>
<td class="list">
<a href="system_crlmanager.php?act=delcert&amp;id=<?php echo $crl['refid']; ?>&amp;certref=<?php echo $cert['refid']; ?>" title="<?=gettext("Delete this certificate from the CRL ");?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate from the CRL?");?>')" class="btn btn-default">
<a href="system_crlmanager.php?act=delcert&amp;id=<?php echo $crl['refid']; ?>&amp;certref=<?php echo $cert['refid']; ?>" data-toggle="tooltip" data-placement="left" title="<?=gettext("Delete this certificate from the CRL ");?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate from the CRL?");?>')" class="btn btn-default">
<span class="glyphicon glyphicon-remove"></span>
</a>
</td>
......@@ -493,7 +493,7 @@ include("head.inc");
<?php else: ?>
<tr>
<td class="listlr" colspan="3" align="center">
<b><?php echo gettext("Choose a Certificate to Revoke"); ?></b>: <select name='certref' id='certref' class="formselect">
<b><?php echo gettext("Choose a Certificate to Revoke"); ?></b>: <select name='certref' id='certref' class="formselect selectpicker" data-style="btn-default" data-live-search="true">
<?php $rowIndex = 0;
foreach($ca_certs as $cert):
$rowIndex++; ?>
......@@ -503,7 +503,7 @@ include("head.inc");
echo "<option></option>"; ?>
</select>
<b><?php echo gettext("Reason");?></b>:
<select name='crlreason' id='crlreason' class="formselect">
<select name='crlreason' id='crlreason' class="formselect selectpicker" data-style="btn-default">
<?php $rowIndex = 0;
foreach($openssl_crl_status as $code => $reason):
$rowIndex++; ?>
......@@ -515,7 +515,7 @@ include("head.inc");
<input name="act" type="hidden" value="addcert" />
<input name="crlref" type="hidden" value="<?=$crl['refid'];?>" />
<input name="id" type="hidden" value="<?=$crl['refid'];?>" />
<input id="submit" name="add" type="submit" class="formbtn" value="<?=gettext("Add"); ?>" />
<input id="submit" name="add" type="submit" class="formbtn btn btn-primary" value="<?=gettext("Add"); ?>" />
</td>
<td class="list">&nbsp;</td>
</tr>
......
......@@ -117,7 +117,7 @@ include("head.inc");
<form action="system_firmware_auto.php" method="post">
<div class="table-responsive table-striped">
<div class="table table-striped">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="" class="table table-striped">
<tr>
......
......@@ -113,8 +113,6 @@ function enable_altfirmwareurl(enable_over) {
<form action="system_firmware_settings.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<table class="table table-striped" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area" style="display:none"> <!--Unsupported Feuature, hide it-->
<thead>
<tr>
......@@ -277,8 +275,6 @@ function enable_altfirmwareurl(enable_over) {
</tr>
</table>
</div>
</form>
</div>
......
......@@ -256,19 +256,19 @@ $main_buttons = array(
<?php
if (isset($gateway['inactive'])):
?>
<span class="glyphicon glyphicon-remove text-muted" title="<?=gettext("This gateway is inactive because interface is missing");?>"></span>
<span class="glyphicon glyphicon-remove text-muted" data-toggle="tooltip" data-placement="left" title="<?=gettext("This gateway is inactive because interface is missing");?>"></span>
<?php
elseif (is_numeric($gateway['attribute'])):
?>
<a href="?act=toggle&amp;id=<?=$i;?>" title="<?=gettext("click to toggle enabled/disabled status");?>" >
<a href="?act=toggle&amp;id=<?=$i;?>" data-toggle="tooltip" data-placement="left" title="<?=gettext("click to toggle enabled/disabled status");?>" >
<span class="glyphicon <?php echo $iconfn;?>"></span>
</a>
<?php
else:
?>
<span class="glyphicon <?php echo $iconfn;?>" title="<?=gettext("click to toggle enabled/disabled status");?>"></span>
<span class="glyphicon <?php echo $iconfn;?>" data-toggle="tooltip" data-placement="left" title="<?=gettext("click to toggle enabled/disabled status");?>"></span>
<?php
endif;
?>
......@@ -320,7 +320,7 @@ $main_buttons = array(
</td>
<td valign="middle" class="list nowrap">
<a href="system_gateways_edit.php?id=<?=$i;?>" class="btn btn-default btn-xs">
<a href="system_gateways_edit.php?id=<?=$i;?>" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("Edit Gateway");?>">
<span class="glyphicon glyphicon-pencil"></span>
</a>
......@@ -328,7 +328,7 @@ $main_buttons = array(
if (is_numeric($gateway['attribute'])):
?>
<a href="system_gateways.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this gateway?"); ?>')" class="btn btn-default btn-xs">
<a href="system_gateways.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this gateway?"); ?>')" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("Delete Gateway");?>">
<span class="glyphicon glyphicon-remove"></span>
</a>
......@@ -336,7 +336,7 @@ $main_buttons = array(
endif;
?>
<a href="system_gateways_edit.php?dup=<?=$i;?>" class="btn btn-default btn-xs">
<a href="system_gateways_edit.php?dup=<?=$i;?>" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("Add Gateway based on this one");?>">
<span class="glyphicon glyphicon-plus"></span>
</a>
</td>
......@@ -355,7 +355,7 @@ $main_buttons = array(
if ($i > 0):
?>
<button type="submit" name="del_x" class="btn btn-default btn-xs"
<button type="submit" name="del_x" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left"
title="<?=gettext("delete selected items");?>"
onclick="return confirm('<?=gettext("Do you really want to delete the selected gateway items?");?>')">
<span class="glyphicon glyphicon-remove"></span>
......
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