gestion du header escamotable en préférence utilisateur (fixes #31431)
This commit is contained in:
parent
3c47ed1d40
commit
c7c10ded30
@ -309,8 +309,15 @@
|
||||
$color = $this->container->get('cadoles.core.service.color');
|
||||
$color->setColor();
|
||||
|
||||
// Visite
|
||||
if($curentuser!="anon.") {
|
||||
// Préférence header
|
||||
$preference=$curentuser->getPreference();
|
||||
if(array_key_exists("fgheader",$preference)) {
|
||||
$fgheader=($preference["fgheader"][0]=="true");
|
||||
$session->set("fgheader", $fgheader);
|
||||
}
|
||||
|
||||
// Visite
|
||||
$now=new \DateTime();
|
||||
if(!$curentuser->getVisitedate()) {
|
||||
$curentuser->setVisitedate($now);
|
||||
|
@ -62,6 +62,8 @@ body {
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.header { display: none }
|
||||
#menu-header { display: none }
|
||||
#navbarsmalltitle { display: none }
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,6 +135,26 @@
|
||||
$(location).attr('href',"/{{ alias }}");
|
||||
}
|
||||
|
||||
function switchHeader() {
|
||||
{% if app.user %}
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('cadoles_core_user_preference') }}",
|
||||
data: {
|
||||
id:0,
|
||||
key:'fgheader',
|
||||
{% if fgheader %}
|
||||
value: false
|
||||
{% else %}
|
||||
value: true
|
||||
{% endif %}
|
||||
},
|
||||
success: function(idbookmark) {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".js-datepicker").datepicker({
|
||||
|
@ -4,6 +4,13 @@
|
||||
{% endif %}
|
||||
|
||||
{% set permannu = app.session.get('permannu') %}
|
||||
|
||||
{% if fgheader %}
|
||||
<li id="menu-header"><a onclick="switchHeader()" title="Cacher / Affichier Bannière " style="cursor:pointer"><i class="fa fa-chevron-up fa-fw"></i></a>
|
||||
{% else %}
|
||||
<li id="menu-header"><a onclick="switchHeader()" title="Cacher / Affichier Bannière " style="cursor:pointer"><i class="fa fa-chevron-down fa-fw"></i></a>
|
||||
{% endif %}
|
||||
|
||||
{% if is_granted('ROLE_ADMIN') or (is_granted('ROLE_MODO') and (permannu=="ROLE_MODO" or permannu=="ROLE_ANIM" or permannu=="ROLE_USER")) or (is_granted('ROLE_ANIM') and (permannu=="ROLE_ANIM" or permannu=="ROLE_USER")) or (is_granted('ROLE_USER') and permannu=="ROLE_USER") %}
|
||||
<li id="menu-annuaire"><a href="{{ path('cadoles_core_user_users') }}" title="Annuaire"><i class="fa fa-address-book fa-fw"></i></a>
|
||||
{%endif%}
|
||||
|
@ -102,7 +102,7 @@
|
||||
|
||||
<a class="navbar-brand" href="{{ path("cadoles_core_home") }}">
|
||||
<img id="logo" src="/{{ alias }}/{{ logo }}">
|
||||
{{ app.session.get('appname') }}
|
||||
<span id="navbarsmalltitle">{{ app.session.get('appname') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user