Using Bootstrap pull right class + code format

This commit is contained in:
Wruczek 2016-10-31 03:18:46 +01:00
parent 3f3baab957
commit f68c29cc04
14 changed files with 129 additions and 138 deletions

View File

@ -55,7 +55,7 @@ function scriptFail($error) {
)));
}
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
function exception_error_handler($errno, $errstr, $errfile, $errline) {
scriptFail("[$errfile @ $errline] " . $errstr);
}

View File

@ -5,7 +5,6 @@ require_once __DIR__ . "/include/tsutils.php";
require_once __DIR__ . "/lib/phpfastcache/autoload.php";
use phpFastCache\Util;
use phpFastCache\CacheManager;
@ -20,8 +19,6 @@ if (is_null($banlist)) {
$banlist = array(getBanlist(), date('d-m-Y H:i:s'));
$cache->set('banlist', $banlist, 600);
}
?>
<div class="panel panel-default">
@ -65,7 +62,7 @@ function getBanlist() {
global $lang;
try {
$tsAdmin = TeamSpeak3::factory(getTeamspeakURI(). "#no_query_clients");
$tsAdmin = TeamSpeak3::factory(getTeamspeakURI() . "#no_query_clients");
$bany = $tsAdmin->banList();
@ -73,7 +70,7 @@ function getBanlist() {
foreach ($bany as $ban) {
if(!isset($ban['lastnickname']))
if (!isset($ban['lastnickname']))
continue;
$lastnickname = $ban['lastnickname']->toString();
@ -82,10 +79,10 @@ function getBanlist() {
$created = date('d-m-Y H:i:s', $ban['created']);
$duration = $ban['duration'];
if(empty($reason))
if (empty($reason))
$reason = "<b>" . translate($lang["banlist"]["table"]["emptyreason"]) . "</b>";
if($duration == 0)
if ($duration == 0)
$expires = translate($lang["banlist"]["table"]["permaban"]);
else
$expires = date('d-m-Y H:i:s', $ban['created'] + $duration);
@ -94,8 +91,8 @@ function getBanlist() {
}
return $output;
} catch(TeamSpeak3_Exception $e) {
if($e->getCode() == 1281) {
} catch (TeamSpeak3_Exception $e) {
if ($e->getCode() == 1281) {
return '';
} else {
return '<div class="alert alert-danger"><p class="text-center">' . translate($lang["general"]["scripterror"], [$e->getCode(), $e->getMessage()]) . '</p></div>';

View File

@ -30,7 +30,7 @@
}
@media (min-width: 768px) {
.navbar-nav> li> a {
.navbar-nav > li > a {
padding-top: 14.5px;
padding-bottom: 14.5px;
}
@ -61,6 +61,6 @@
margin-bottom: 14.5px;
}
.navbar .dropdown-menu>li>a {
.navbar .dropdown-menu > li > a {
font-size: 14px;
}

View File

@ -23,11 +23,7 @@ a {
text-align: right;
}
.pullright {
float: right !important;
}
.pullright .fa {
.pull-right .fa {
margin-right: 0px
}
@ -44,7 +40,6 @@ p, a {
hyphens: auto;
}
/* ****** */
/* STATUS */
/* ****** */
@ -61,12 +56,11 @@ p, a {
float: right
}
/* ********* */
/* ADMINLIST */
/* ********* */
.adminlist> .groupname~ .groupname {
.adminlist > .groupname ~ .groupname {
margin-top: 15px;
}
@ -93,7 +87,6 @@ p, a {
margin-left: 19px
}
/* ****** */
/* NAVBAR */
/* ****** */
@ -106,7 +99,7 @@ body {
font-size: 14px
}
.nav> li> a {
.nav > li > a {
padding-left: 10px;
padding-right: 10px;
}
@ -117,13 +110,12 @@ body {
align-items: center;
}
.navbar-brand> img {
.navbar-brand > img {
height: 100%;
padding: 5px 5px 5px 15px;
width: auto;
}
/* ****** */
/* FOOTER */
/* ****** */

View File

@ -40,15 +40,15 @@ caption {
color: #00343f;
}
.table>tfoot>tr>td {
.table > tfoot > tr > td {
border-top: 1px solid #00343f
}
.table>thead>tr>th {
.table > thead > tr > th {
border-bottom: 2px solid #00343f
}
.table>tbody+tbody {
.table > tbody + tbody {
border-top: 2px solid #00343f
}
@ -56,30 +56,30 @@ caption {
border: 1px solid #00343f
}
.table-bordered>tfoot>tr>td {
.table-bordered > tfoot > tr > td {
border: 1px solid #00343f
}
.table-striped>tbody>tr:nth-of-type(odd) {
.table-striped > tbody > tr:nth-of-type(odd) {
background-color: #00343f
}
.table-hover>tbody>tr:hover {
.table-hover > tbody > tr:hover {
background-color: #004449
}
.table>thead>tr>td.active,
.table>tbody>tr>td.active,
.table>tfoot>tr>td.active,
.table>thead>tr>th.active,
.table>tbody>tr>th.active,
.table>tfoot>tr>th.active,
.table>thead>tr.active>td,
.table>tbody>tr.active>td,
.table>tfoot>tr.active>td,
.table>thead>tr.active>th,
.table>tbody>tr.active>th,
.table>tfoot>tr.active>th {
.table > thead > tr > td.active,
.table > tbody > tr > td.active,
.table > tfoot > tr > td.active,
.table > thead > tr > th.active,
.table > tbody > tr > th.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > tbody > tr.active > td,
.table > tfoot > tr.active > td,
.table > thead > tr.active > th,
.table > tbody > tr.active > th,
.table > tfoot > tr.active > th {
background-color: #004449
}
@ -121,8 +121,8 @@ fieldset[disabled] .btn-link:focus {
background-color: #00343f;
}
.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus {
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
background-color: #004449
}
@ -130,63 +130,65 @@ fieldset[disabled] .btn-link:focus {
background-color: #00343f;
}
.nav>li>a:focus {
.nav > li > a:focus {
background-color: #00343f
}
.nav>li.disabled>a {
.nav > li.disabled > a {
color: #00343f
}
.nav>li.disabled>a:hover,
.nav>li.disabled>a:focus {
.nav > li.disabled > a:hover,
.nav > li.disabled > a:focus {
color: #00343f;
}
.nav .open>a,
.nav .open>a:hover,
.nav .open>a:focus {
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus {
background-color: #00343f;
}
.nav-tabs>li>a:hover {
.nav-tabs > li > a:hover {
border-color: #00343f #00343f transparent
}
.nav-tabs>li.active>a:focus {
.nav-tabs > li.active > a:focus {
border: 1px solid #00343f;
}
.nav-tabs>li.active>a,
.nav-tabs>li.active>a:hover,
.nav-tabs>li.active>a:focus {
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
border: 1px solid #00343f;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified>li>a {
.nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #00343f;
}
.nav-tabs.nav-justified>.active>a,
.nav-tabs.nav-justified>.active>a:hover,
.nav-tabs.nav-justified>.active>a:focus {
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border-bottom-color: #00343f
}
}
.nav-tabs-justified>.active>a,
.nav-tabs-justified>.active>a:hover,
.nav-tabs-justified>.active>a:focus {
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border: 1px solid #00343f
}
@media (min-width: 768px) {
.nav-tabs-justified>li>a {
.nav-tabs-justified > li > a {
border-bottom: 1px solid #00343f;
}
.nav-tabs-justified>.active>a,
.nav-tabs-justified>.active>a:hover,
.nav-tabs-justified>.active>a:focus {
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border-bottom-color: #00343f
}
}
@ -195,25 +197,26 @@ fieldset[disabled] .btn-link:focus {
background-color: #00343f;
}
.navbar-default .navbar-nav>li>a:hover,
.navbar-default .navbar-nav>li>a:focus {
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
background-color: #083d48
}
.navbar-default .navbar-nav>.active>a,
.navbar-default .navbar-nav>.active>a:hover,
.navbar-default .navbar-nav>.active>a:focus {
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
background-color: #004449
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,
.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus {
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
background-color: #004449
}
.navbar-default .navbar-nav .open .dropdown-menu>.active>a,
.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,
.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus {
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
background-color: #004449
}
}
@ -222,36 +225,36 @@ fieldset[disabled] .btn-link:focus {
background-color: #00343f;
}
.pagination>li>a,
.pagination>li>span {
.pagination > li > a,
.pagination > li > span {
background-color: #00343f;
}
.pagination>li>a:hover,
.pagination>li>span:hover,
.pagination>li>a:focus,
.pagination>li>span:focus {
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination > li > a:focus,
.pagination > li > span:focus {
background-color: #004449;
}
.pagination>.disabled>a:focus {
.pagination > .disabled > a:focus {
background-color: #00343f;
}
.pager li>a,
.pager li>span {
.pager li > a,
.pager li > span {
background-color: #00343f;
}
.pager li>a:hover,
.pager li>a:focus {
.pager li > a:hover,
.pager li > a:focus {
background-color: #004449
}
.pager .disabled>a,
.pager .disabled>a:hover,
.pager .disabled>a:focus,
.pager .disabled>span {
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
background-color: #00343f;
}
@ -302,22 +305,22 @@ button.list-group-item:focus {
background-color: #004449;
}
.panel>.panel-body+.table,
.panel>.panel-body+.table-responsive,
.panel>.table+.panel-body,
.panel>.table-responsive+.panel-body {
.panel > .panel-body + .table,
.panel > .panel-body + .table-responsive,
.panel > .table + .panel-body,
.panel > .table-responsive + .panel-body {
border-top: 1px solid #00343f
}
.panel-success>.panel-heading {
.panel-success > .panel-heading {
color: #13ddcd;
}
.panel-info>.panel-heading {
.panel-info > .panel-heading {
color: #13ddcd;
}
.panel-warning>.panel-heading {
.panel-warning > .panel-heading {
color: #13ddcd;
}
@ -337,19 +340,19 @@ button.list-group-item:focus {
background-color: #004449;
}
.popover.top>.arrow:after {
.popover.top > .arrow:after {
border-top-color: #00343f
}
.popover.right>.arrow:after {
.popover.right > .arrow:after {
border-right-color: #00343f
}
.popover.bottom>.arrow:after {
.popover.bottom > .arrow:after {
border-bottom-color: #00343f
}
.popover.left>.arrow:after {
.popover.left > .arrow:after {
border-left-color: #00343f;
}
@ -370,7 +373,7 @@ table .text-muted,
color: #00343f
}
.panel-default>.panel-heading {
.panel-default > .panel-heading {
background-color: #004449;
}

View File

@ -3,7 +3,6 @@ require_once __DIR__ . "/tsutils.php";
require_once __DIR__ . "/../lib/phpfastcache/autoload.php";
use phpFastCache\Util;
use phpFastCache\CacheManager;
@ -30,27 +29,27 @@ function getAdminList() {
$localIcons = array(100, 200, 300, 400, 500, 600);
try {
$tsAdmin = TeamSpeak3::factory(getTeamspeakURI(). "#no_query_clients");
$tsAdmin = TeamSpeak3::factory(getTeamspeakURI() . "#no_query_clients");
$output = "";
foreach ($admingroups as $group) {
if(!array_key_exists((string) $group, $tsAdmin->serverGroupList()))
if (!array_key_exists((string)$group, $tsAdmin->serverGroupList()))
continue;
$group = $tsAdmin->serverGroupGetById($group);
$icon = '';
if($group["iconid"]) {
if(!$group->iconIsLocal("iconid")) {
if ($group["iconid"]) {
if (!$group->iconIsLocal("iconid")) {
$groupicon = getGroupIcon($tsAdmin, $group);
if($groupicon) {
if ($groupicon) {
$icon = '<img src="data:' . TeamSpeak3_Helper_Convert::imageMimeType($groupicon) . ';base64,' . base64_encode($groupicon) . '" alt="Ikona grupy" /> ';
}
} elseif(in_array($group["iconid"], $localIcons)) {
} elseif (in_array($group["iconid"], $localIcons)) {
$icon = '<img src="lib/ts3phpframework/images/viewer/group_icon_' . $group["iconid"] . '.png" alt="Ikona grupy" /> ';
}
}
@ -59,7 +58,7 @@ function getAdminList() {
$clients = $group->clientList();
if(empty($clients)) {
if (empty($clients)) {
$output .= '<p class="text-center"><i>' . translate($lang["adminlist"]["emptygroup"]) . '</i></p>';
continue;
}
@ -67,17 +66,17 @@ function getAdminList() {
foreach ($clients as $userInfo) {
$user = getClientByDbid($tsAdmin, $userInfo['cldbid']);
if(!$user) {
$output .= '<p><span class="label label-primary iconspacer">' . $userInfo['client_nickname'] . '</span><span class="label label-danger pullright">' . translate($lang["adminlist"]["status"]["offline"]) . '</span></p>';
if (!$user) {
$output .= '<p><span class="label label-primary iconspacer">' . $userInfo['client_nickname'] . '</span><span class="label label-danger pull-right">' . translate($lang["adminlist"]["status"]["offline"]) . '</span></p>';
continue;
}
$output .= '<p><img src="lib/ts3phpframework/images/viewer/' . $user->getIcon() . '.png" alt="Status użytkownika">' . '<span class="label label-primary">' . $user . '</span>' . ($user['client_away'] ? '<span class="label label-warning pullright">' . translate($lang["adminlist"]["status"]["away"]) . '</span>' : '<span class="label label-success pullright">' . translate($lang["adminlist"]["status"]["online"]) . '</span>') . '</p>';
$output .= '<p><img src="lib/ts3phpframework/images/viewer/' . $user->getIcon() . '.png" alt="Status użytkownika">' . '<span class="label label-primary">' . $user . '</span>' . ($user['client_away'] ? '<span class="label label-warning pull-right">' . translate($lang["adminlist"]["status"]["away"]) . '</span>' : '<span class="label label-success pull-right">' . translate($lang["adminlist"]["status"]["online"]) . '</span>') . '</p>';
}
}
return $output;
} catch(TeamSpeak3_Exception $e) {
} catch (TeamSpeak3_Exception $e) {
return '<div class="alert alert-danger"><p class="text-center">' . translate($lang["general"]["scripterror"], [$e->getCode(), $e->getMessage()]) . '</p></div>';
}
@ -86,7 +85,7 @@ function getAdminList() {
function getClientByDbid($tsAdmin, $cldbid) {
try {
return $tsAdmin->clientGetByDbid($cldbid);
} catch(TeamSpeak3_Exception $e) {
} catch (TeamSpeak3_Exception $e) {
return false;
}
}
@ -94,7 +93,7 @@ function getClientByDbid($tsAdmin, $cldbid) {
function getGroupIcon($tsAdmin, $group) {
try {
return $group->iconDownload();
} catch(TeamSpeak3_Exception $e) {
} catch (TeamSpeak3_Exception $e) {
return false;
}
}

View File

@ -29,7 +29,7 @@
<!-- Readmore.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Readmore.js/2.2.0/readmore.min.js"></script>
<?php if(isset($bansPage)) { ?>
<?php if (isset($bansPage)) { ?>
<script>var datatablesUrl = "<?php tl($lang["banlist"]["datatablesurl"]); ?>";</script>
<!-- DataTables for Bootstrap -->

View File

@ -131,7 +131,7 @@ $htalink = $config["general"]["enablehta"] ? "" : ".php";
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-shield" aria-hidden="true"></i> <?php tl($lang["adminlist"]["title"]); ?> <span class="pullright"><i class="fa fa-question-circle" aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="<?php tl($lang["adminlist"]["lastupdate"], [$adminlist[1]]); ?>"></i></span></div>
<div class="panel-heading"><i class="fa fa-shield" aria-hidden="true"></i> <?php tl($lang["adminlist"]["title"]); ?> <span class="pull-right"><i class="fa fa-question-circle" aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="<?php tl($lang["adminlist"]["lastupdate"], [$adminlist[1]]); ?>"></i></span></div>
<div class="panel-body adminlist">
<?php echo $adminlist[0]; ?>
</div>
@ -146,7 +146,7 @@ $htalink = $config["general"]["enablehta"] ? "" : ".php";
$name = $item[0];
$linkdesc = $item[1];
$link = $item[2];
echo '<li>' . $name . ' <span class="pullright"><a href="' . $link . '">' . $linkdesc . '</a></span></li>';
echo '<li>' . $name . ' <span class="pull-right"><a href="' . $link . '">' . $linkdesc . '</a></span></li>';
} ?>
</ul>
</div>

View File

@ -14,13 +14,13 @@ if (isset($_GET['lang'])) {
$langcode = $_SESSION['lang'];
} else if (isset($_COOKIE['lang'])) {
$langcode = $_COOKIE['lang'];
} else if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
} else if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$langcode = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
} else {
$langcode = "en";
}
if(!file_exists(getLanguagePath($langcode)))
if (!file_exists(getLanguagePath($langcode)))
$langcode = "en";
require_once getLanguagePath($langcode);
@ -35,7 +35,7 @@ function tl($pattern, $args = null) {
function translate($pattern, $args = null) {
if(!$args) {
if (!$args) {
return $pattern;
}

View File

@ -29,7 +29,7 @@ if (!extension_loaded("mbstring")) {
try {
require_once __DIR__ . "/../lib/phpfastcache/autoload.php";
\phpFastCache\CacheManager::Files();
\phpFastCache\CacheManager::Files();
} catch (\phpFastCache\Exceptions\phpFastCacheDriverException $e) {
$title = 'Directory is not writable';
@ -38,7 +38,7 @@ try {
die(showError($title, $text));
}
if(!file_exists(__DIR__ . "/../config/config.php")) {
if (!file_exists(__DIR__ . "/../config/config.php")) {
$title = 'config.php does not exists';
$text = '<p>Please go into the directory <code>config</code> and rename <code>config.template.php</code> to <code>config.php</code>.</p>

View File

@ -11,11 +11,11 @@ function pingTeamspeakServer($uri) {
try {
$tsAdmin = TeamSpeak3::factory($uri);
if(!$tsAdmin->getProperty("virtualserver_status"))
if (!$tsAdmin->getProperty("virtualserver_status"))
throw new Exception("Server is offline");
return $tsAdmin->getInfo();
} catch(TeamSpeak3_Exception $e) {
} catch (TeamSpeak3_Exception $e) {
return false;
}

View File

@ -18,7 +18,7 @@ $parsedown = new Parsedown();
$path = __DIR__ . "/" . $config["general"]["newsDir"];
if(file_exists($path))
if (file_exists($path))
showNews($path);
else
echo '<div class="alert alert-danger"><p class="text-center">' . translate($lang["index"]["errortitle"]) . '</p><p class="text-center">' . translate($lang["index"]["errorsubtitle"]) . '</p></div>';
@ -33,7 +33,7 @@ function showNews($path) {
$files = array_diff(scandir($path), array('..', '.'));
foreach ($files as $newsFile) {
if(!endsWith($newsFile, ".md"))
if (!endsWith($newsFile, ".md"))
continue;
$file = readFileContent($path . "/" . $newsFile);
@ -60,8 +60,8 @@ function generateNewsBox($title, $author, $text) { ?>
function readFileContent($file) {
$fopen = @fopen($file, "r");
if(!$fopen) return false;
$text = fread($fopen,filesize($file));
if (!$fopen) return false;
$text = fread($fopen, filesize($file));
fclose($fopen);
return $text;
}

View File

@ -6,12 +6,12 @@ $parsedown = new Parsedown();
$path = __DIR__ . "/config/rules.md";
if(!file_exists($path)) {
if (!file_exists($path)) {
echo '<div class="alert alert-danger"><p class="text-center">' . translate($lang["rules"]["filenotfound"]) . '</div>';
} else {
$file = readFileContent($path);
if(!$file) {
if (!$file) {
echo '<div class="alert alert-danger"><p class="text-center">' . translate($lang["rules"]["readerror"]) . '</div>';
} else {
?>
@ -32,8 +32,8 @@ if(!file_exists($path)) {
function readFileContent($file) {
$fopen = @fopen($file, "r");
if(!$fopen) return false;
$text = fread($fopen,filesize($file));
if (!$fopen) return false;
$text = fread($fopen, filesize($file));
fclose($fopen);
return $text;
}

View File

@ -25,9 +25,9 @@ function getViewer() {
global $lang;
try {
$tsAdmin = TeamSpeak3::factory(getTeamspeakURI(). "#no_query_clients");
$tsAdmin = TeamSpeak3::factory(getTeamspeakURI() . "#no_query_clients");
return $tsAdmin->getViewer(new TeamSpeak3_Viewer_Html("lib/ts3phpframework/images/viewer/", "lib/ts3phpframework/images/flags/", "data:image"));
} catch(TeamSpeak3_Exception $e) {
} catch (TeamSpeak3_Exception $e) {
return '<div class="alert alert-danger"><p class="text-center">' . translate($lang["general"]["scripterror"], [$e->getCode(), $e->getMessage()]) . '</p></div>';
}
}