Compare commits
No commits in common. "30e4609f6feb9a21e24648e2cfa5d28486c14eba" and "cc71a435f788bee331e2f902b238769ec1240183" have entirely different histories.
30e4609f6f
...
cc71a435f7
@ -1085,32 +1085,55 @@ class PagewidgetController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function viewbookmarkAction(Request $request,$id,$access="config") {
|
public function viewbookmarkAction(Request $request,$id,$access="config") {
|
||||||
// Récupération de la requete
|
$look=$request->query->get('look');
|
||||||
$this->setRequest($request,$id,$access);
|
$selwidget=$request->query->get('selwidget');
|
||||||
|
|
||||||
// Valeur par défaut
|
$em = $this->getDoctrine()->getManager();
|
||||||
$modedesktop=0;
|
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||||
$bookmarks=null;
|
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||||
|
|
||||||
// Datas associées au widget
|
// Permissions
|
||||||
if(!$this->mini) {
|
if($access=="config") {
|
||||||
// Récupération des paramétres du widget
|
$canupdate = true;
|
||||||
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
|
||||||
switch($parameter["id"]) {
|
|
||||||
case "modedesktop":
|
|
||||||
$modedesktop=$parameter["value"];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bookmark du widget
|
|
||||||
$bookmarks=$this->em->getRepository("CadolesPortalBundle:Bookmark")->findBy(["pagewidget"=>$this->entity]);
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
// On s'assure que l'utilisateur à la permission de voir
|
||||||
|
$page=$entity->getPage();
|
||||||
|
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
||||||
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Récupération des paramétres du widget
|
||||||
|
$modedesktop=0;
|
||||||
|
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||||
|
switch($parameter["id"]) {
|
||||||
|
case "modedesktop":
|
||||||
|
$modedesktop=$parameter["value"];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
|
// Profilage
|
||||||
|
$user=$this->getUser();
|
||||||
|
|
||||||
|
// Bookmark du widget
|
||||||
|
$bookmarks=$em->getRepository("CadolesPortalBundle:Bookmark")->findBy(["pagewidget"=>$entity]);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->getRender('viewbookmark.html.twig', [
|
return $this->render($this->labelentity.':viewbookmark.html.twig', [
|
||||||
|
'entity' => $entity,
|
||||||
|
'canadd' => $canupdate,
|
||||||
|
'canupdate' => $canupdate,
|
||||||
'modedesktop' => $modedesktop,
|
'modedesktop' => $modedesktop,
|
||||||
'bookmarks' => $bookmarks,
|
'bookmarks' => $bookmarks,
|
||||||
|
'access' => $access,
|
||||||
|
'look' => $look,
|
||||||
|
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,12 +6,6 @@
|
|||||||
#R1C1:first-child {
|
#R1C1:first-child {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-mini .logo {
|
|
||||||
background-color: #{{color["main"]}};
|
|
||||||
padding: 3px;
|
|
||||||
border-radius: 100%;
|
|
||||||
}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block pagewrapper %}
|
{% block pagewrapper %}
|
||||||
|
@ -51,6 +51,9 @@
|
|||||||
{% if canupdate %}
|
{% if canupdate %}
|
||||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if canadd %}
|
||||||
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" style="{{ stylewidgetmenu }}"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@ -110,7 +113,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if canupdate %}
|
{% if canadd %}
|
||||||
<div class="grid-item {{ stylegrid }}">
|
<div class="grid-item {{ stylegrid }}">
|
||||||
<div title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" class="grid-item-content" style="background-color: #{{color['main']}};cursor:pointer;">
|
<div title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" class="grid-item-content" style="background-color: #{{color['main']}};cursor:pointer;">
|
||||||
<div class="item-link clearfix">
|
<div class="item-link clearfix">
|
||||||
|
@ -42,18 +42,12 @@
|
|||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-chat" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-chat" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||||
|
{% if canupdate %}
|
||||||
<div class="widgetmenu">
|
<div class="widgetmenu">
|
||||||
{% if canupdate %}
|
|
||||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
{% endif %}
|
|
||||||
{% if look=="list" %}
|
|
||||||
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
|
||||||
{% else %}
|
|
||||||
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% if onheader %}
|
{% if onheader %}
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
||||||
{% if icon %}
|
{% if icon %}
|
||||||
<img src="/{{ alias }}{{ icon }}" class="logo" style="border-radius:100%"/>
|
<img src="/{{ alias }}{{ icon }}" class="logo" />
|
||||||
{% else %}
|
{% else %}
|
||||||
<img src="/{{ alias }}/uploads/icon/icon_users.png" class="logo"/>
|
<img src="/{{ alias }}/uploads/icon/icon_users.png" class="logo"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user