Skip to content

Commit

Permalink
Fix admin/layout
Browse files Browse the repository at this point in the history
  • Loading branch information
c0r1an committed Mar 4, 2017
1 parent 5d95679 commit f100286
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 55 deletions.
1 change: 0 additions & 1 deletion application/modules/admin/config/config.php
Expand Up @@ -50,7 +50,6 @@ public function install()
$databaseConfig->set('description', 'Das ilch CMS bietet dir ein einfach erweiterbares Grundsystem, welches keinerlei Kenntnisse in Programmiersprachen voraussetzt.');
$databaseConfig->set('standardMail', $_SESSION['install']['adminEmail']);
$databaseConfig->set('defaultPaginationObjects', 20);
$databaseConfig->set('admin_layout_top_nav', 'navbar-fixed-top');
$databaseConfig->set('admin_layout_hmenu', 'hmenu-fixed');
$databaseConfig->set('maintenance_mode', '0');
$databaseConfig->set('maintenance_status', '0');
Expand Down
20 changes: 6 additions & 14 deletions application/modules/admin/controllers/admin/Settings.php
Expand Up @@ -89,8 +89,7 @@ public function indexAction()
'modRewrite' => 'required|numeric|integer|min:0|max:1',
'standardMail' => 'required|email',
'defaultPaginationObjects' => 'numeric|integer|min:1',
'hmenuFixed' => 'required|numeric|integer|min:0|max:1',
'navbarFixed' => 'required|numeric|integer|min:0|max:1'
'hmenuFixed' => 'required|numeric|integer|min:0|max:1'
]);

if ($validation->isValid()) {
Expand All @@ -102,16 +101,9 @@ public function indexAction()
$this->getConfig()->set('timezone', $this->getRequest()->getPost('timezone'));
$this->getConfig()->set('locale', $this->getRequest()->getPost('locale'));
$this->getConfig()->set('defaultPaginationObjects', $this->getRequest()->getPost('defaultPaginationObjects'));
if ($this->getRequest()->getPost('navbarFixed') === '1') {
$this->getConfig()->set('admin_layout_top_nav', 'navbar-fixed-top');

if ($this->getRequest()->getPost('hmenuFixed') === '1') {
$this->getConfig()->set('admin_layout_hmenu', 'hmenu-fixed');
} elseif ($this->getRequest()->getPost('hmenuFixed') === '0') {
$this->getConfig()->set('admin_layout_hmenu', '');
}
} elseif ($this->getRequest()->getPost('navbarFixed') === '0') {
$this->getConfig()->set('admin_layout_top_nav', '');
if ($this->getRequest()->getPost('hmenuFixed') === '1') {
$this->getConfig()->set('admin_layout_hmenu', 'hmenu-fixed');
} elseif ($this->getRequest()->getPost('hmenuFixed') === '0') {
$this->getConfig()->set('admin_layout_hmenu', '');
}

Expand All @@ -132,9 +124,10 @@ public function indexAction()
}

$this->addMessage('saveSuccess');
} else {
$this->addMessage($validation->getErrorBag()->getErrorMessages(), 'danger', true);
}

$this->addMessage($validation->getErrorBag()->getErrorMessages(), 'danger', true);
$this->redirect()
->withErrors($validation->getErrorBag())
->to(['action' => 'index']);
Expand All @@ -151,7 +144,6 @@ public function indexAction()
$this->getView()->set('locale', $this->getConfig()->get('locale'));
$this->getView()->set('modules', $moduleMapper->getModules());
$this->getView()->set('pages', $pageMapper->getPageList());
$this->getView()->set('navbarFixed', $this->getConfig()->get('admin_layout_top_nav'));
$this->getView()->set('hmenuFixed', $this->getConfig()->get('admin_layout_hmenu'));
$this->getView()->set('defaultPaginationObjects', $this->getConfig()->get('defaultPaginationObjects'));
}
Expand Down
2 changes: 1 addition & 1 deletion application/modules/admin/layouts/index.php
Expand Up @@ -73,7 +73,7 @@
<header id="header">
<!-- TOP NAVBAR -->
<?php $config = \Ilch\Registry::get('config'); ?>
<nav class="navbar navbar-default topnavbar <?=$config->get('admin_layout_top_nav') ?>">
<nav class="navbar navbar-default topnavbar navbar-fixed-top">
<!-- TOP NAVBAR LEFT -->
<div class="navbar-header leftbar">
<?php if ($this->hasSidebar()): ?>
Expand Down
112 changes: 96 additions & 16 deletions application/modules/admin/static/css/admin.css
Expand Up @@ -249,12 +249,64 @@ ul > .heading {
bottom: 0px;
width:100%;
position: fixed;
padding: 5px 15px 5px 15px;
padding: 5px 30px 5px 30px;
background-color: #EEEEEE;
}
.content_savebox:before {
padding-top: 15px;
}
.content_savebox > .save_button {
background-color: #699DB6;
border-color: rgba(0,0,0,0.3);
text-shadow: 0 1px 0 rgba(0,0,0,0.5);
font-weight: bold;
color: #FFF;
}

.content_savebox > .save_button:hover {
background-color: #4F87A2;
border-color: rgba(0,0,0,0.5);
}

.content_savebox > .save_button:active {
background-color: #3C677B;
border-color: rgba(0,0,0,0.9);
}
.content_savebox > .save_button {
background-color: #699DB6;
border-color: rgba(0,0,0,0.3);
text-shadow: 0 1px 0 rgba(0,0,0,0.5);
font-weight: bold;
color: #FFF;
}

.content_savebox > .save_button:hover {
background-color: #4F87A2;
border-color: rgba(0,0,0,0.5);
}

.content_savebox > .save_button:active {
background-color: #3C677B;
border-color: rgba(0,0,0,0.9);
}

.content_savebox > .delete_button {
background-color: #E48681;
border-color: rgba(0,0,0,0.3);
text-shadow: 0 1px 0 rgba(0,0,0,0.5);
font-weight: bold;
color: #FFF;
}

.content_savebox > .delete_button:hover {
background-color: #DA4F49;
border-color: rgba(0,0,0,0.5);
}

.content_savebox > .delete_button:active {
background-color: #B32C24;
border-color: rgba(0,0,0,0.9);
}
.hidden-menu .content_savebox {
margin-left: -15px;
}
Expand Down Expand Up @@ -319,7 +371,8 @@ iframe {
}
#content {
padding: 10px 15px;
position: relative;
position: absolute;
width: 100%;
}
body.container {
position: absolute;
Expand Down Expand Up @@ -355,7 +408,7 @@ aside {
background-image: linear-gradient(to bottom, #f3f3f3, #e2e2e2);
background-repeat: repeat-x;
position: relative;
z-index: 905;

}
#header > div {
display: inline-block;
Expand All @@ -372,27 +425,37 @@ aside {
}
aside {
width: 220px;
overflow-y: visible !important;
}
#left-panel {
position: absolute;
position: fixed;
top: 0;
left: 0;
z-index: 904;
padding-top: 40px;
}
#left-panel > nav {
position: fixed;
width: 220px;
overflow-y: visible;
overflow-x: hidden;
bottom: 0;
top: 40px;
}
.dropdown-menu .divider {
background-color: #ccc;
}
#main {
margin-left: 220px;
padding: 0;
padding-bottom: 52px;
min-height: 590px;
overflow: hidden;
padding-bottom: 80px;
overflow-y: auto;
position: absolute;
left: 0;
right: 0;
top: 40px;
bottom: 0px;
}
.savebox_bottom {
bottom: 45px !important;
}
#ribbon {
min-height: 39px;
Expand All @@ -412,13 +475,16 @@ aside {
margin: 0px !important;
box-sizing: border-box;
}
.ribbon-fixed {
top: 79px !important;
}
.ribbon-fixed > #ribbon {
position: fixed !important;
top: 40px;
z-index: 900;
}
.ribbon-fixed > #content {
margin-top: 39px;
margin-top: 15px;
}
#ribbon .breadcrumb {
display: inline-block;
Expand Down Expand Up @@ -733,7 +799,7 @@ legend {

@media (max-width:991px) {
#main {
width: 100% !important;
width: auto;
}
.hidden-menu #left-panel:hover ~ #main {
margin-left: 10px;
Expand Down Expand Up @@ -778,7 +844,6 @@ legend {
left: 0;
}
.hidden-menu #main {
position: relative;
left: 210px;
}
}
Expand Down Expand Up @@ -819,11 +884,14 @@ legend {
left: 0;
}
.hidden-menu #main {
position: relative;
left: 210px;
}
}
@media (max-width:767px) {
#left-panel > nav {
position: fixed;
overflow-y: auto;
}
#main {
margin-left: 0;
overflow-x: hidden;
Expand Down Expand Up @@ -862,11 +930,14 @@ legend {
left: 0;
}
.hidden-menu #main {
position: relative;
left: 210px;
}
}
@media only screen and (min-width:0) and (max-width:679px) {
#left-panel > nav {
position: fixed;
overflow-y: auto;
}
#main {
margin-left: 0;
overflow-x: hidden;
Expand Down Expand Up @@ -905,11 +976,18 @@ legend {
left: 0;
}
.hidden-menu #main {
position: relative;
left: 210px;
}
.navbar-fixed-top .navbar-collapse {
max-height: 240px;
}
}
@media only screen and (min-width:320px) and (max-width:479px) {

#left-panel > nav {
position: fixed;
overflow-y: auto;
}
#main {
margin-left: 0;
overflow-x: hidden;
Expand Down Expand Up @@ -959,7 +1037,6 @@ legend {
left: 0;
}
.hidden-menu #main {
position: relative;
left: 210px;
overflow-x: hidden;
}
Expand All @@ -972,6 +1049,9 @@ legend {
color: #000;
padding: 7px 7px !important;
}
.navbar-fixed-top .navbar-collapse {
max-height: 240px;
}
}


Expand Down
3 changes: 2 additions & 1 deletion application/modules/admin/static/js/functions.js
Expand Up @@ -83,7 +83,8 @@ $(document).ready
);

$(document).ready (function() {
if (!$('#left-panel').hasClass('hmenu-fixed')) {
$( "#main:has(.content_savebox)" ).addClass( "savebox_bottom" );
if (!$('#left-panel').hasClass('hmenu-fixed')) {
var element = document.getElementById('header');
if (typeof(element) !== 'undefined' && element !== null) {
$(window).scrollTop(0);
Expand Down
23 changes: 1 addition & 22 deletions application/modules/admin/views/admin/settings/index.php
Expand Up @@ -161,21 +161,7 @@ class="form-control"
</div>

<legend><?=$this->getTrans('backendFunctions') ?></legend>
<div class="form-group <?=$this->validation()->hasError('navbarFixed') ? 'has-error' : '' ?>">
<div class="col-lg-2 control-label">
<?=$this->getTrans('navbarFixed') ?>:
</div>
<div class="col-lg-4">
<div class="flipswitch">
<input type="radio" class="flipswitch-input" id="navbarFixed-on" name="navbarFixed" value="1" <?php if ($this->get('navbarFixed') == 'navbar-fixed-top') { echo 'checked="checked"'; } ?> />
<label for="navbarFixed-on" class="flipswitch-label flipswitch-label-on"><?=$this->getTrans('on') ?></label>
<input type="radio" class="flipswitch-input" id="navbarFixed-off" name="navbarFixed" value="0" <?php if ($this->get('navbarFixed') == '') { echo 'checked="checked"'; } ?> />
<label for="navbarFixed-off" class="flipswitch-label flipswitch-label-off"><?=$this->getTrans('off') ?></label>
<span class="flipswitch-selection"></span>
</div>
</div>
</div>
<div id="hmenuFixed" class="form-group <?php if (empty($this->get('navbarFixed'))) { echo 'hidden'; } else { echo $this->validation()->hasError('navbarFixed') ? 'has-error' : ''; } ?>">
<div id="hmenuFixed" class="form-group">
<div class="col-lg-2 control-label">
<?=$this->getTrans('hmenuFixed') ?>:
</div>
Expand All @@ -200,11 +186,4 @@ class="form-control"
$('#contentLanguage').addClass('hidden');
}
});
$('[name="navbarFixed"]').click(function () {
if ($(this).val() == "1") {
$('#hmenuFixed').removeClass('hidden');
} else {
$('#hmenuFixed').addClass('hidden');
}
});
</script>

0 comments on commit f100286

Please sign in to comment.