icon user + cache flux

This commit is contained in:
afornerot 2019-05-10 13:59:52 +02:00
parent 8e634842b3
commit 6517d7dca2
25 changed files with 571 additions and 134 deletions

View File

@ -305,6 +305,15 @@ class PurgeFileCommand extends Command
}
}
}
// /web/uploads/ckeditor
$this->writelnred('');
$this->writelnred('== Directory = Flux');
$directory=$this->container->get('kernel')->getRootDir()."/../web/uploads/flux";
$fs = new Filesystem();
$fs->remove($directory);
$this->writeln('');
return 1;

View File

@ -237,6 +237,13 @@ class User implements UserInterface, \Serializable
*/
private $blogarticles;
/**
* @var ArrayCollection $icon
* @var Icon
*
* @ORM\OneToMany(targetEntity="Cadoles\PortalBundle\Entity\Icon", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
*/
private $icons;
//== CODE A NE PAS REGENERER
/**
@ -334,6 +341,7 @@ class User implements UserInterface, \Serializable
$this->blogs = new \Doctrine\Common\Collections\ArrayCollection();
$this->blogwriters = new \Doctrine\Common\Collections\ArrayCollection();
$this->blogarticles = new \Doctrine\Common\Collections\ArrayCollection();
$this->icons = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
@ -1255,4 +1263,38 @@ class User implements UserInterface, \Serializable
{
return $this->blogarticles;
}
/**
* Add icon
*
* @param \Cadoles\PortalBundle\Entity\Icon $icon
*
* @return User
*/
public function addIcon(\Cadoles\PortalBundle\Entity\Icon $icon)
{
$this->icons[] = $icon;
return $this;
}
/**
* Remove icon
*
* @param \Cadoles\PortalBundle\Entity\Icon $icon
*/
public function removeIcon(\Cadoles\PortalBundle\Entity\Icon $icon)
{
$this->icons->removeElement($icon);
}
/**
* Get icons
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getIcons()
{
return $this->icons;
}
}

View File

@ -333,7 +333,7 @@ class InitDataCommand extends ContainerAwareCommand
$em->persist($entityWidget);
}
// Widget Calendrier
// Widget Blog
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1890);
if(!$entityWidget) {
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_rocket.png"]);
@ -355,6 +355,28 @@ class InitDataCommand extends ContainerAwareCommand
$em->persist($entityWidget);
}
// Widget RSS
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1880);
if(!$entityWidget) {
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_rss.png"]);
$entityWidget = new Widget();
$entityWidget->setId(-1880);
$entityWidget->setRoworder(13);
$entityWidget->setIcon($entityicon);
$entityWidget->setName('RSS');
$entityWidget->setDescription("Afficher un flux RSS spécifique");
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_rss");
$entityWidget->setHeight("630");
$entityWidget->setAutoajust(true);
$entityWidget->setBorder(true);
$parameter = json_decode('{"fields": [{"id": "url", "loc": "col1", "type": "string", "label": "URL du Flux RSS", "value": "", "mandatory": "true"},{"id": "nbarticle", "loc": "col1", "type": "integer", "label": "Nombre d\'articles affichés", "value": "10", "mandatory": "true"}]}');
$entityWidget->setParameter($parameter);
$em->persist($entityWidget);
}
// Widget Séparateur
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1600);
if(!$entityWidget) {

View File

@ -63,12 +63,17 @@ class BookmarkController extends Controller
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_page_view',["id"=>$idpage]));
}
$icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>null]);
$iconsuser=null;
if($access=="user") $iconsuser=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>$this->getUser()]);
return $this->render($this->labelentity.':edit.html.twig', [
'useheader' => ($access=="config"),
'usemenu' => false,
'usesidebar' => ($access=="config"),
'entity' => $data,
'icons' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findAll(),
'icons' => $icons,
'iconsuser' => $iconsuser,
'mode' => "submit",
'access' => $access,
'idpage' => $idpage,
@ -122,14 +127,18 @@ class BookmarkController extends Controller
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_page_view',["id"=>$idpage]));
}
$icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>null]);
$iconsuser=null;
if($access=="user") $iconsuser=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>$this->getUser()]);
// Affichage du formulaire
return $this->render($this->labelentity.':edit.html.twig', [
'useheader' => ($access=="config"),
'usemenu' => false,
'usesidebar' => ($access=="config"),
'entity' => $data,
'icons' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findAll(),
'icons' => $icons,
'iconsuser' => $iconsuser,
'mode' => "update",
'access' => $access,
'idpage' => $idpage,

View File

@ -19,18 +19,24 @@ class IconController extends Controller
private $labeldata = 'icon';
private $labeldatas = 'icons';
public function listAction()
public function listAction($access="config")
{
$em = $this->getDoctrine()->getManager();
if($access=="config")
$icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>null]);
else
$icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>$this->getUser()]);
return $this->render($this->labelentity.':list.html.twig',[
'useheader' => true,
'usemenu' => false,
'usesidebar' => true,
$this->labeldatas => $this->getDatas()
'usesidebar' => ($access=="config"),
'access' => $access,
$this->labeldatas => $icons
]);
}
public function submitAction(Request $request)
public function submitAction(Request $request,$access="config")
{
// Initialisation de l'enregistrement
$data = new Icon();
@ -47,6 +53,8 @@ class IconController extends Controller
// Sur validation
if ($form->get('submit')->isClicked() && $form->isValid()) {
$data = $form->getData();
if($access=="user") $data->setUser($this->getUser());
$em = $this->getDoctrine()->getManager();
// Sauvegarde
@ -54,21 +62,22 @@ class IconController extends Controller
$em->flush();
// Retour à la liste
return $this->redirectToRoute($this->labelroute);
return $this->redirectToRoute('cadoles_portal_'.$access.'_icon');
}
// Affichage du formulaire
return $this->render($this->labelentity.':edit.html.twig', [
'useheader' => true,
'usemenu' => false,
'usesidebar' => true,
'usesidebar' => ($access=="config"),
'access' => $access,
$this->labeldata => $data,
'mode' => 'submit',
'form' => $form->createView()
'form' => $form->createView(),
]);
}
public function updateAction($id,Request $request)
public function updateAction($id,Request $request,$access="config")
{
// Récupération de l'enregistrement courant
$data=$this->getData($id);
@ -94,7 +103,7 @@ class IconController extends Controller
$em->flush();
// Retour à la liste
return $this->redirectToRoute($this->labelroute);
return $this->redirectToRoute('cadoles_portal_'.$access.'_icon');
}
@ -102,14 +111,16 @@ class IconController extends Controller
return $this->render($this->labelentity.':edit.html.twig', [
'useheader' => true,
'usemenu' => false,
'usesidebar' => true,
'usesidebar' => ($access=="config"),
'access' => $access,
$this->labeldata => $data,
'mode' => 'update',
'form' => $form->createView()
'form' => $form->createView(),
'refresh' => false,
]);
}
public function deleteAction($id,Request $request)
public function deleteAction($id,Request $request,$access="config")
{
// Récupération de l'enregistrement courant
$data=$this->getData($id);
@ -121,7 +132,7 @@ class IconController extends Controller
$em->remove($data);
$em->flush();
return $this->redirectToRoute($this->labelroute);
return $this->redirectToRoute('cadoles_portal_'.$access.'_icon');
}

View File

@ -130,13 +130,18 @@ class PagewidgetController extends Controller
return $this->redirect($this->generateUrl('cadoles_core_home',["id"=>$idpage]));
}
$icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>null]);
$iconsuser=null;
if($access=="user") $iconsuser=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>$this->getUser()]);
return $this->render($this->labelentity.':edit.html.twig', [
'useheader' => true,
'usemenu' => false,
'usesidebar' => ($access=="config"),
'maxwidth' => ($access=="user"),
'entity' => $entity,
'icons' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findAll(),
'icons' => $icons,
'iconsuser' => $iconsuser,
'mode' => "submit",
'access' => $access,
'idpage' => $idpage,
@ -191,13 +196,18 @@ class PagewidgetController extends Controller
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_page_view',["id"=>$idpage]));
}
$icons=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>null]);
$iconsuser=null;
if($access=="user") $iconsuser=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findBy(["user"=>$this->getUser()]);
return $this->render($this->labelentity.':edit.html.twig', [
'useheader' => ($access=="config"),
'usemenu' => false,
'usesidebar' => ($access=="config"),
'maxwidth' => ($access=="user"),
'entity' => $entity,
'icons' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findAll(),
'icons' => $icons,
'iconsuser' => $iconsuser,
'mode' => "update",
'access' => $access,
'idpage' => $idpage,
@ -633,78 +643,110 @@ class PagewidgetController extends Controller
$feedIo = new \FeedIo\FeedIo($client, $logger);
$feeds=array();
$filesystem = new Filesystem();
foreach($fluxsordered as $flux) {
// On regarde si le flux a été lu il y a peu
// On lit le flux rss
$result = $feedIo->read($flux->getUrl());
$feedtitle = $result->getFeed()->getTitle();
// Pour chaque articles
$nbflux=0;
foreach ($result->getFeed() as $item) {
$title = $item->getTitle();
$link = $item->getLink();
$description = substr(strip_tags($item->getDescription()),0,250);
$description = str_replace("¶","",$description);
$date = $item->getLastModified();
$dateformat = $item->getLastModified()->format('d/m/Y H:i:s');
$content = $item->getDescription();
$media = $item->getMedias();
$mediaurl = "";
foreach ($item->getMedias() as $itemMedia) {
if($itemMedia->getType()=="image/jpeg")
$mediaurl=$itemMedia->getUrl();
}
foreach ($item->getAllElements() as $element) {
if($element->getName()=="content:encoded")
$content = $element->getValue();
}
if($mediaurl!="") {
$imgurl=$mediaurl;
}
else {
// Récupérer la première image du contenu
$imgcontent="";
$imgurl="";
$imgstart = stripos($content,"<img");
if($imgstart!== false) {
$imgend = stripos($content,">",$imgstart);
$imgcontent=substr($content,$imgstart,$imgend-$imgstart+1);
$imgstart = stripos($imgcontent,"src=");
$imgurl=substr($imgcontent,$imgstart+5);
$imgend = stripos($imgurl,'"');
if($imgend===false) $imgend = stripos($imgurl,"'");
$imgurl=substr($imgurl,0,$imgend);
}
}
// Garder le flux
if($nbflux<26) {
array_push($feeds,array(
"feedtitle" => $feedtitle,
"title" => $title,
"link" => $link,
"description" => $description,
"date" => $date,
"dateformat" => $dateformat,
"content" => $content,
"image" => $imgurl,
"color" => $flux->getColor(),
"fluxid" => $flux->getId(),
));
$toregen=true;
if($filesystem->exists('uploads/flux/flux-'.$flux->getId().'.txt')) {
// On récupère la date de modification du fichier
$timestampfile = filemtime('uploads/flux/flux-'.$flux->getId().'.txt');
$datetimeFormat = 'Y-m-d H:i:s';
$datefile = new \DateTime();
$datefile->setTimestamp($timestampfile);
// On ajoute 30mn
$datefile->add(new \DateInterval('PT30M'));
// Si la date est inférieur à maintenant on regénère le flux
$now = new \DateTime();
if($datefile>=$now) {
$toregen=false;
$backup = unserialize(file_get_contents('uploads/flux/flux-'.$flux->getId().'.txt'));
$feeds=array_merge($feeds,$backup);
}
$nbflux++;
if($nbflux>=$flux->getMaxread()) break;
}
}
// Si le fichier est trop ancien on relit le flus
if($toregen) {
// On lit le flux rss
$result = $feedIo->read($flux->getUrl());
$feedtitle = $result->getFeed()->getTitle();
$backup=[];
// Pour chaque articles
$nbflux=0;
foreach ($result->getFeed() as $item) {
$title = $item->getTitle();
$link = $item->getLink();
$description = substr(strip_tags($item->getDescription()),0,250);
$description = str_replace("&para;","",$description);
$date = $item->getLastModified();
$dateformat = ($date?$item->getLastModified()->format('d/m/Y H:i:s'):"");
$content = $item->getDescription();
$media = $item->getMedias();
$mediaurl = "";
foreach ($item->getMedias() as $itemMedia) {
if($itemMedia->getType()=="image/jpeg")
$mediaurl=$itemMedia->getUrl();
}
foreach ($item->getAllElements() as $element) {
if($element->getName()=="content:encoded")
$content = $element->getValue();
}
if($mediaurl!="") {
$imgurl=$mediaurl;
}
else {
// Récupérer la première image du contenu
$imgcontent="";
$imgurl="";
$imgstart = stripos($content,"<img");
if($imgstart!== false) {
$imgend = stripos($content,">",$imgstart);
$imgcontent=substr($content,$imgstart,$imgend-$imgstart+1);
$imgstart = stripos($imgcontent,"src=");
$imgurl=substr($imgcontent,$imgstart+5);
$imgend = stripos($imgurl,'"');
if($imgend===false) $imgend = stripos($imgurl,"'");
$imgurl=substr($imgurl,0,$imgend);
}
}
// Garder le flux
$tmp=array(
"feedtitle" => $feedtitle,
"title" => $title,
"link" => $link,
"description" => $description,
"date" => $date,
"dateformat" => $dateformat,
"content" => $content,
"image" => $imgurl,
"color" => "",
"fluxid" => $flux->getId(),
);
array_push($feeds,$tmp);
array_push($backup,$tmp);
$nbflux++;
if($nbflux>=$flux->getMaxread()) break;
}
// On sauvegarde le résultat en fichier on rechargera son contenu que s'il n'a pas été lu depuis 30mn
$filesystem->dumpFile('uploads/flux/flux-'.$flux->getId().'.txt', serialize($backup));
}
}
$libelle=array();
@ -724,6 +766,166 @@ class PagewidgetController extends Controller
}
public function viewrssAction($id,$access="config") {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
// Permissions
if($access=="config") {
$canupdate = true;
}
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
$url="";
$nbarticle="_blank";
foreach($entity->getParameter()["fields"] as $parameter) {
switch($parameter["id"]) {
case "url":
$url=$parameter["value"];
break;
case "nbarticle":
$nbarticle=$parameter["value"];
break;
}
}
// On regarde si le flux a été lu il y a peu
$toregen=true;
$filesystem = new Filesystem();
if($filesystem->exists('uploads/flux/widget-'.$id.'.txt')) {
// On récupère la date de modification du fichier
$timestampfile = filemtime('uploads/flux/widget-'.$id.'.txt');
$datetimeFormat = 'Y-m-d H:i:s';
$datefile = new \DateTime();
$datefile->setTimestamp($timestampfile);
// On ajoute 30mn
$datefile->add(new \DateInterval('PT30M'));
// Si la date est inférieur à maintenant on regénère le flux
$now = new \DateTime();
if($datefile>=$now) {
$toregen=false;
$feeds = unserialize(file_get_contents('uploads/flux/widget-'.$id.'.txt'));
}
}
// Si le fichier est trop ancien on relit le flus
if($toregen) {
// Connexion au client
$PROXYactivate = $em->getRepository("CadolesCoreBundle:Config")->find("PROXYactivate")->getValue();
if($PROXYactivate) {
$PROXYserver = $em->getRepository("CadolesCoreBundle:Config")->find("PROXYserver")->getValue();
$PROXYport = $em->getRepository("CadolesCoreBundle:Config")->find("PROXYport")->getValue();
$clientguzzle = new \GuzzleHttp\Client(array('proxy' => ['http' => 'tcp://'.$PROXYserver.':'.$PROXYport,'https' => 'tcp://'.$PROXYserver.':'.$PROXYport]));
}
else
$clientguzzle = new \GuzzleHttp\Client();
$client = new \FeedIo\Adapter\Guzzle\Client($clientguzzle);
$logger = new \Psr\Log\NullLogger();
$feedIo = new \FeedIo\FeedIo($client, $logger);
$feeds=array();
// On lit le flux rss
$result = $feedIo->read($url);
$feedtitle = $result->getFeed()->getTitle();
// Pour chaque articles
$nbflux=0;
foreach ($result->getFeed() as $item) {
$title = $item->getTitle();
$link = $item->getLink();
$description = substr(strip_tags($item->getDescription()),0,250);
$description = str_replace("&para;","",$description);
$date = $item->getLastModified();
$dateformat = ($date?$item->getLastModified()->format('d/m/Y H:i:s'):"");
$content = $item->getDescription();
$media = $item->getMedias();
$mediaurl = "";
foreach ($item->getMedias() as $itemMedia) {
if($itemMedia->getType()=="image/jpeg")
$mediaurl=$itemMedia->getUrl();
}
foreach ($item->getAllElements() as $element) {
if($element->getName()=="content:encoded")
$content = $element->getValue();
}
if($mediaurl!="") {
$imgurl=$mediaurl;
}
else {
// Récupérer la première image du contenu
$imgcontent="";
$imgurl="";
$imgstart = stripos($content,"<img");
if($imgstart!== false) {
$imgend = stripos($content,">",$imgstart);
$imgcontent=substr($content,$imgstart,$imgend-$imgstart+1);
$imgstart = stripos($imgcontent,"src=");
$imgurl=substr($imgcontent,$imgstart+5);
$imgend = stripos($imgurl,'"');
if($imgend===false) $imgend = stripos($imgurl,"'");
$imgurl=substr($imgurl,0,$imgend);
}
}
// Garder le flux
array_push($feeds,array(
"feedtitle" => $feedtitle,
"title" => $title,
"link" => $link,
"description" => $description,
"date" => $date,
"dateformat" => $dateformat,
"content" => $content,
"image" => $imgurl,
// "color" => $flux->getColor(),
"fluxid" => 0,
));
$nbflux++;
if($nbflux>=$nbarticle) break;
}
$libelle=array();
foreach ($feeds as $key => $valeur) {
$libelle[$key] = $valeur["date"];
}
array_multisort($libelle, SORT_DESC, $feeds);
// On sauvegarde le résultat en fichier on rechargera son contenu que s'il n'a pas été lu depuis 30mn
$filesystem->dumpFile('uploads/flux/widget-'.$id.'.txt', serialize($feeds));
}
// Render
return $this->render($this->labelentity.':viewflux.html.twig', [
'entity' => $entity,
'canupdate' => $canupdate,
//'fluxs' => $fluxsordered,
'access' => $access,
'feeds' => $feeds,
]);
}
public function viewbookmarkAction($id,$access="config") {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);

View File

@ -27,6 +27,12 @@ class Icon
*/
private $label;
/**
* @ORM\ManyToOne(targetEntity="Cadoles\CoreBundle\Entity\User", inversedBy="icons")
* @ORM\JoinColumn(nullable=true)
*/
private $user;
/**
* @var ArrayCollection $items
* @var Item
@ -61,6 +67,7 @@ class Icon
private $bookmarks;
/**
* Constructor
*/
@ -106,6 +113,30 @@ class Icon
return $this->label;
}
/**
* Set user
*
* @param \Cadoles\CoreBundle\Entity\User $user
*
* @return Icon
*/
public function setUser(\Cadoles\CoreBundle\Entity\User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user
*
* @return \Cadoles\CoreBundle\Entity\User
*/
public function getUser()
{
return $this->user;
}
/**
* Add item
*

View File

@ -2,25 +2,43 @@
#== ICON =================================================================================================================================================
cadoles_portal_config_icon:
path: /config/icon
defaults: { _controller: CadolesPortalBundle:Icon:list }
defaults: { _controller: CadolesPortalBundle:Icon:list, access: config }
cadoles_portal_config_icon_submit:
path: /config/icon/submit
defaults: { _controller: CadolesPortalBundle:Icon:submit }
defaults: { _controller: CadolesPortalBundle:Icon:submit, access: config }
cadoles_portal_config_icon_update:
path: /config/icon/update/{id}
defaults: { _controller: CadolesPortalBundle:Icon:update }
defaults: { _controller: CadolesPortalBundle:Icon:update, access: config }
cadoles_portal_config_icon_delete:
path: /config/icon/delete/{id}
defaults: { _controller: CadolesPortalBundle:Icon:delete }
defaults: { _controller: CadolesPortalBundle:Icon:delete, access: config }
cadoles_portal_config_icon_icon:
path: /config/icon/icon
defaults: { _controller: CadolesPortalBundle:Icon:icon }
defaults: { _controller: CadolesPortalBundle:Icon:icon, access: config }
cadoles_portal_user_icon:
path: /user/icon
defaults: { _controller: CadolesPortalBundle:Icon:list, access: user }
cadoles_portal_user_icon_submit:
path: /user/icon/submit
defaults: { _controller: CadolesPortalBundle:Icon:submit, access: user }
cadoles_portal_user_icon_update:
path: /user/icon/update/{id}
defaults: { _controller: CadolesPortalBundle:Icon:update, access: user }
cadoles_portal_user_icon_delete:
path: /user/icon/delete/{id}
defaults: { _controller: CadolesPortalBundle:Icon:delete, access: user }
cadoles_portal_user_icon_icon:
path: /user/icon/icon
defaults: { _controller: CadolesPortalBundle:Icon:icon, access: user }
#== ITEM =================================================================================================================================================
@ -595,6 +613,10 @@ cadoles_portal_config_panelwidget_view_flux:
path: /config/pagewidget/view/flux/{id}
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewflux, access: config }
cadoles_portal_config_panelwidget_view_rss:
path: /config/pagewidget/view/rss/{id}
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewrss, access: config }
cadoles_portal_config_panelwidget_view_bookmark:
path: /pagewidget/view/bookmark/{id}
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewbookmark, access: config }
@ -677,6 +699,10 @@ cadoles_portal_user_panelwidget_view_flux:
path: /pagewidget/view/flux/{id}
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewflux, access: user }
cadoles_portal_user_panelwidget_view_rss:
path: /pagewidget/view/rss/{id}
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewrss, access: user }
cadoles_portal_user_panelwidget_view_bookmark:
path: /pagewidget/view/bookmark/{id}
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewbookmark, access: user }

View File

@ -59,7 +59,7 @@
{{ form_row(form.target) }}
{{ form_row(form.color) }}
<div id="diviconsel" class="col-md-12 text-left" style="height:140px; padding:20px; text-align:center; background-color: {{ entity.color ? entity.color : '#000000' }};">
<div id="diviconsel" class="col-md-12 text-left" style="height:140px; padding:20px; text-align:center; background-color: {{ entity.color ? "#"~entity.color : '#000000' }};">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" height="100" />
{% endif %}
@ -85,11 +85,24 @@
<div class="form-group row clearfix">
<div class="col-md-12" style="margin-bottom:15px">
<a onclick="$('#selicon').modal('hide');" class="btn btn-default">Annuler</a>
{% if access=="user" %}
<a href="{{ path('cadoles_portal_user_icon') }}" target="_parent" class="btn btn-default">Gérer mes Icônes</a>
{% endif %}
</div>
<div class="col-md-12">
{% if iconsuser is not empty %}
<h3>Mes Icônes</h3>
{% for icon in iconsuser %}
<a style="cursor:pointer" onClick="selIcon({{ icon.id }})">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
</a>
{% endfor %}
<h3>Icônes Communs</h3>
{% endif %}
{% for icon in icons %}
<a href="#" onClick="selIcon({{ icon.id }})">
<a style="cursor:pointer" onClick="selIcon({{ icon.id }})">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
</a>
{% endfor %}
@ -98,7 +111,7 @@
</div>
</div>
</div>
</div>
</div>
{{ form_end(form) }}
{% endblock %}

View File

@ -11,19 +11,18 @@
</h1>
{{ form_widget(form.submit) }}
<a class="btn btn-default" href={{ path('cadoles_portal_config_icon') }}>Annuler</a>
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_icon') }}>Annuler</a>
{% if mode=="update" %}
<a href={{ path('cadoles_portal_config_icon_delete',{'id':icon.id}) }}
<a href={{ path('cadoles_portal_'~access~'_icon_delete',{'id':icon.id}) }}
class="btn btn-danger pull-right"
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
data-confirm="Êtes-vous sûr de vouloir supprimer cet icône ?">
Supprimer
Supprimer
</a>
{% endif %}
<br><br>
{% if app.session.flashbag.has('error') %}
<div class='alert alert-danger' style='margin: 5px 0px'>
<strong>Erreur</strong><br>

View File

@ -3,11 +3,13 @@
{% block pagewrapper %}
<h1 class="page-header">Gestion des Icônes</h1>
<p><a class="btn btn-success" href={{ path('cadoles_portal_config_icon_submit') }}>Ajouter</a></p>
<p><a class="btn btn-success" href={{ path('cadoles_portal_'~access~'_icon_submit') }}>Ajouter</a></p>
{% for icon in icons %}
<a href="{{ path('cadoles_portal_config_icon_update', {id : icon.id}) }}"><img class="icon" height="90" src="/{{ alias }}/{{ icon.label }}" style="padding:10px"></a>
{% endfor %}
<div class="row">
{% for icon in icons %}
<a href="{{ path('cadoles_portal_'~access~'_icon_update', {id : icon.id}) }}"><img class="icon" height="90" src="/{{ alias }}/{{ icon.label }}" style="padding:10px"></a>
{% endfor %}
</div>
{% endblock %}

View File

@ -94,13 +94,24 @@
<div class="modal-body" style="height: 480px; overflow-y: scroll;">
<div class="form-group row clearfix">
<div class="col-md-12" style="margin-bottom:15px">
<a onclick="$('#selicon').modal('hide');" class="btn btn-info">
<i class="fa fa-chevron-left"></i>
Annuler
</a>
<a onclick="$('#selicon').modal('hide');" class="btn btn-default">Annuler</a>
{% if access=="user" %}
<a href="{{ path('cadoles_portal_user_icon') }}" target="_parent" class="btn btn-default">Gérer mes Icônes</a>
{% endif %}
</div>
<div class="col-md-12">
{% if iconsuser is not empty %}
<h3>Mes Icônes</h3>
{% for icon in iconsuser %}
<a style="cursor:pointer" onClick="selIcon({{ icon.id }})">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
</a>
{% endfor %}
<h3>Icônes Communs</h3>
{% endif %}
{% for icon in icons %}
<a href="#" onClick="selIcon({{ icon.id }})">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">

View File

@ -22,7 +22,11 @@
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>

View File

@ -47,7 +47,11 @@
</div>
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>

View File

@ -39,7 +39,11 @@
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>

View File

@ -27,7 +27,11 @@
</div>
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>

View File

@ -22,7 +22,11 @@
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>

View File

@ -40,7 +40,11 @@
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>

View File

@ -27,31 +27,37 @@
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>
{% set firstflux="" %}
<div class="widgetbody" style="{{ stylewidgetbody }}">
{% for flux in fluxs %}
{% if loop.first %}
{% set firstflux = flux.id %}
{% endif %}
{% if fluxs is defined %}
{% for flux in fluxs %}
{% if loop.first %}
{% set firstflux = flux.id %}
{% endif %}
{% set stylefeed = "background-color: #" ~ color['main'] ~ ";" %}
{% if flux.color is not null %}
{% set stylefeed = "background-color: #" ~ flux.color ~ ";" %}
{% endif %}
{% set stylefeed = "background-color: #" ~ color['main'] ~ ";" %}
{% if flux.color is not null %}
{% set stylefeed = "background-color: #" ~ flux.color ~ ";" %}
{% endif %}
{% if fluxs|length > 1 %}
<div class="cat-list-feed" onClick="showFlux({{ entity.id}},{{ flux.id }})" style="{{ stylefeed }}">{{ flux.title }}</div>
{% endif %}
{% endfor %}
{% if fluxs|length > 1 %}
<div class="cat-list-feed" onClick="showFlux({{ entity.id}},{{ flux.id }})" style="{{ stylefeed }}">{{ flux.title }}</div>
{% endif %}
{% endfor %}
{% endif %}
{% for feed in feeds %}
{% set stylefeed = "background-color: #" ~ color['main'] ~ ";" %}
{% if feed.color is not null %}
{% if feed.color is defined and feed.color is not null %}
{% set stylefeed = "background-color: #" ~ feed.color ~ ";" %}
{% endif %}
{% if feed.image is not null and feed.image != ""%}

View File

@ -37,7 +37,11 @@
</div>
{% else %}
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" />
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>

View File

@ -40,7 +40,11 @@
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>

View File

@ -39,7 +39,11 @@
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>

View File

@ -36,8 +36,14 @@
<a style="{{ stylelink }}"href="{{ url }}" target="{% if access=="user" %}_top{% else %}{{ target }}{% endif %}">
{% else %}
<a style="{{ stylelink }}" href="{{ url }}" target="{{ target }}">
{% endif %}
<img src="/{{ alias }}/{{ entity.icon.label }}" style="max-height: 100%; width: auto; display: block; margin: auto; padding-top: 10px;" />
{% endif %}
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" style="max-height: 100%; width: auto; display: block; margin: auto; padding-top: 10px;" />
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" style="max-height: 100%; width: auto; display: block; margin: auto; padding-top: 10px;" />
{% endif %}
<div style="text-align: center;">{{ entity.name }}</div>
</a>
</div>

View File

@ -28,7 +28,11 @@
<div class="widgetheader" style="{{ stylewidgetbodyimage }}">
{% if seeicon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" />
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
{% endif %}
{% if seetitle %}

View File

@ -22,7 +22,11 @@
{% if imagemedia %}
{% if entity.autoajust %}
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>
<div class="widgetbody" style="{{ stylewidgetbodyframe }}">
@ -33,7 +37,11 @@
{% endif %}
{% else %}
<div class="widgetheader" style="{{ stylewidgetheader }}">
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" />
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>