svg
@ -46,7 +46,7 @@
|
||||
<variable type='string' name='cadolesuser_niveau02labels' description="Label pluriel du niveau 02 d'organisation" mandatory='True'><value>Services</value></variable>
|
||||
<variable type='string' name='cadolesuser_niveau02icon' description="Icon du niveau 02 d'organisation" mandatory='True'><value>fa-sitemap</value></variable>
|
||||
|
||||
<variable type='string' name='cadolesuser_colormain' description="Couleur principale" mandatory='True'><value>428BCA</value></variable>
|
||||
<variable type='string' name='cadolesuser_colormain' description="Couleur principale" mandatory='True'><value>2c3e50</value></variable>
|
||||
<variable type='string' name='cadolesuser_fontcolorhover' description="Couleur des polices sur fond de couleur principale" mandatory='True'><value>FFFFFF</value></variable>
|
||||
|
||||
<variable type='string' name='cadolesuser_moderegistration' description="Mode de registration : none / byuser / byadmin" mandatory='True'><value>none</value></variable>
|
||||
|
@ -52,6 +52,8 @@ twig:
|
||||
form_themes:
|
||||
- 'CadolesCoreBundle:Form:fields.html.twig'
|
||||
- 'TetranzSelect2EntityBundle:Form:fields.html.twig'
|
||||
paths:
|
||||
'%kernel.project_dir%/src/Cadoles/CoreBundle/Resources/public/themes/': Theme
|
||||
|
||||
# Swiftmailer Configuration
|
||||
swiftmailer:
|
||||
@ -90,6 +92,8 @@ oneup_uploader:
|
||||
frontend: dropzone # or any uploader you use in the frontend
|
||||
slide:
|
||||
frontend: dropzone # or any uploader you use in the frontend
|
||||
blogarticle:
|
||||
frontend: dropzone # or any uploader you use in the frontend
|
||||
file:
|
||||
frontend: dropzone # or any uploader you use in the frontend
|
||||
namer: cadoles.core.upload.namer.same
|
||||
|
@ -24,7 +24,7 @@ parameters:
|
||||
portal_activate: true
|
||||
|
||||
# Information de base de l'annuaire
|
||||
ldap_host: 172.27.7.61
|
||||
ldap_host: 127.0.0.1
|
||||
ldap_port: 389
|
||||
ldap_user: cn=admin,o=gouv,c=fr
|
||||
ldap_password: eole
|
||||
@ -34,7 +34,7 @@ parameters:
|
||||
alias: cadolesuser
|
||||
libelle_etab: ldapbundle
|
||||
numero_etab: 0000000A
|
||||
colormain: 428BCA # Couleur principale
|
||||
colormain: 2c3e50 # Couleur principale
|
||||
fontcolorhover: FFFFFF # Couleur des polices sur fond de couleur principale
|
||||
keyterm: 8 # Taille mini du password
|
||||
labelniveau01: Ecole # Label singulier du niveau 01 d'organisation
|
||||
@ -77,7 +77,7 @@ parameters:
|
||||
|
||||
# Si mode_auth = CAS
|
||||
cas_host: ldapbundle.ac-arno.fr
|
||||
cas_path: ~
|
||||
cas_path:
|
||||
cas_port: 8443
|
||||
|
||||
# Si mode_aut = SAML
|
||||
|
@ -26,7 +26,7 @@ class SecurityController extends Controller
|
||||
|
||||
// Init Client CAS
|
||||
\phpCAS::setDebug(false);
|
||||
\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), true);
|
||||
\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
|
||||
\phpCAS::setNoCasServerValidation();
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$output->writeln('CORE = Default Data');
|
||||
|
||||
$em = $this->getContainer()->get('doctrine')->getEntityManager();
|
||||
|
||||
|
||||
$finder = new Finder();
|
||||
$finder->in('src/Cadoles/CoreBundle/Command/data');
|
||||
|
||||
@ -67,7 +67,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
|
||||
$stmt = $em->getConnection()->prepare($content);
|
||||
$stmt->execute();
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Init city
|
||||
@ -78,7 +78,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
|
||||
$stmt = $em->getConnection()->prepare($content);
|
||||
$stmt->execute();
|
||||
|
||||
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@ -91,9 +91,8 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$group->setFgopen(false);
|
||||
$group->setFgall(true);
|
||||
$group->setFgtemplate(false);
|
||||
$group->setFgcanshare(false);
|
||||
$em->persist($group);
|
||||
$em->flush();
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
$sub = $em->createQueryBuilder();
|
||||
@ -114,7 +113,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$usergroup->setUser($data);
|
||||
$usergroup->setGroup($group);
|
||||
$em->persist($usergroup);
|
||||
$em->flush();
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
$output->writeln('');
|
||||
|
@ -41,6 +41,7 @@ class PurgeFileCommand extends Command
|
||||
$this->output = $output;
|
||||
$this->filesystem = new Filesystem();
|
||||
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
|
||||
$alias = $this->container->getParameter('alias');
|
||||
|
||||
$this->writelnred('');
|
||||
$this->writelnred('== Core:PurgeFile');
|
||||
@ -215,6 +216,96 @@ class PurgeFileCommand extends Command
|
||||
}
|
||||
}
|
||||
|
||||
// /web/uploads/blogarticle
|
||||
$this->writelnred('');
|
||||
$this->writelnred('== Directory = Blog Article');
|
||||
|
||||
$directory=$this->container->get('kernel')->getRootDir()."/../web/uploads/blogarticle";
|
||||
$files=[];
|
||||
$fs = new Filesystem();
|
||||
|
||||
if($fs->exists($directory)) {
|
||||
$finder = new Finder();
|
||||
$finder->in($directory)->files();
|
||||
|
||||
foreach (iterator_to_array($finder) as $file) {
|
||||
$name = $file->getRelativePathname();
|
||||
if(strpos($name,"thumb-")===false) {
|
||||
$entity=$this->em->getRepository("CadolesPortalBundle:Blogarticle")->findBy(["image"=>"uploads/blogarticle/".$name]);
|
||||
if(!$entity) {
|
||||
$this->writeln($name);
|
||||
|
||||
// Suppression du fichier
|
||||
$url=$directory."/".$name;
|
||||
if($fs->exists($url)) {
|
||||
$fs->remove($url);
|
||||
}
|
||||
|
||||
// Suppression du thumb fichier
|
||||
$url=$directory."/thumb-".$name;
|
||||
if($fs->exists($url)) {
|
||||
$fs->remove($url);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// /web/uploads/ckeditor
|
||||
$this->writelnred('');
|
||||
$this->writelnred('== Directory = Ckeditor');
|
||||
$directory=$this->container->get('kernel')->getRootDir()."/../web/uploads/ckeditor";
|
||||
$files=[];
|
||||
$fs = new Filesystem();
|
||||
|
||||
if($fs->exists($directory)) {
|
||||
$finder = new Finder();
|
||||
$finder->in($directory)->files();
|
||||
|
||||
foreach (iterator_to_array($finder) as $file) {
|
||||
$name = $file->getRelativePathname();
|
||||
$tofind = "/".$alias."/uploads/ckeditor/".$name;
|
||||
$find=false;
|
||||
|
||||
// On recherche l'image dans les pages
|
||||
$result = $this->em
|
||||
->getRepository("CadolesPortalBundle:Page")->createQueryBuilder('page')
|
||||
->where('page.html LIKE :tofind')
|
||||
->setParameter('tofind', '%'.$tofind.'%')
|
||||
->getQuery()->getResult();
|
||||
if($result) $find=true;
|
||||
|
||||
// Si pas trouvé on la cherche dans les widgets
|
||||
if(!$find) {
|
||||
$result = $this->em
|
||||
->getRepository("CadolesPortalBundle:Pagewidget")->createQueryBuilder('pagewidget')
|
||||
->where('pagewidget.parameter LIKE :tofind')
|
||||
->setParameter('tofind', '%'.$tofind.'%')
|
||||
->getQuery()->getResult();
|
||||
if($result) $find=true;
|
||||
}
|
||||
|
||||
// Si pas trouvé on la cherche dans les blogs
|
||||
if(!$find) {
|
||||
$result = $this->em
|
||||
->getRepository("CadolesPortalBundle:Blogarticle")->createQueryBuilder('blogarticle')
|
||||
->where('blogarticle.description LIKE :tofind')
|
||||
->setParameter('tofind', '%'.$tofind.'%')
|
||||
->getQuery()->getResult();
|
||||
if($result) $find=true;
|
||||
}
|
||||
|
||||
// Si pas trouvé on supprime
|
||||
if(!$find) {
|
||||
$this->writeln($name);
|
||||
$url=$directory."/".$name;
|
||||
if($fs->exists($url)) {
|
||||
$fs->remove($url);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->writeln('');
|
||||
return 1;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastna
|
||||
|
||||
TRUNCATE TABLE sidebar;
|
||||
INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `fonticon`, `permission`, `appactivate`) VALUES
|
||||
(1000, NULL, 1000, 'CONFIGURATION', '', 'fa-gear', 'ROLE_ADMIN,ROLE_MODO', ''),
|
||||
(1000, NULL, 1000, 'CONFIGURATION', '', 'fa-gear', 'ROLE_ADMIN', ''),
|
||||
(1010, 1000, 1010, 'Générale', 'cadoles_core_config_commun', 'fa-table', 'ROLE_ADMIN', ''),
|
||||
(1200, NULL, 1200, 'ORGANISATION', NULL, 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''),
|
||||
(1210, 1200, 1210, 'Listes Blanche', 'cadoles_core_config_whitelist', 'fa-tasks', 'ROLE_ADMIN', ''),
|
||||
|
@ -5,6 +5,7 @@ namespace Cadoles\CoreBundle\Controller;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
use Cadoles\PortalBundle\Entity\Page;
|
||||
|
||||
|
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\CoreBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
use Symfony\Component\Finder\Finder;
|
||||
|
||||
class ThemeController extends Controller
|
||||
{
|
||||
public function listAction(Request $request)
|
||||
{
|
||||
$session=$this->get('session');
|
||||
$finder = new Finder();
|
||||
|
||||
$dir = $this->get('kernel')->getRootDir()."/../web/bundles/cadolescore/themes";
|
||||
$url="/".$this->getParameter('alias')."/bundles/cadolescore/themes";
|
||||
|
||||
$finder->in($dir)->directories()->depth('== 0');
|
||||
$themes=[];
|
||||
$themes[""]["dir"]="";
|
||||
$themes[""]["url"]=$url;
|
||||
$themes[""]["name"]="Thème par défaut";
|
||||
|
||||
foreach ($finder as $file) {
|
||||
$key=$file->getRelativePathname();
|
||||
$themes[$key]["dir"]=$key;
|
||||
$themes[$key]["url"]=$url."/".$key;
|
||||
|
||||
$yml=Yaml::parseFile($dir.'/'.$key.'/info.yml');
|
||||
$themes[$key]["name"]=$yml["name"];
|
||||
}
|
||||
|
||||
$current=$session->get("theme");
|
||||
$currentheme=$themes[$current];
|
||||
unset($themes[$current]);
|
||||
|
||||
return $this->render('CadolesCoreBundle:Theme:list.html.twig',[
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => true,
|
||||
'currentheme' => $currentheme,
|
||||
'themes' => $themes
|
||||
]);
|
||||
}
|
||||
|
||||
public function selectAction(Request $request,$name)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$config=$em->getRepository("CadolesCoreBundle:Config")->findoneBy(["id"=>"theme"]);
|
||||
$config->setValue($name);
|
||||
|
||||
$em->persist($config);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirectToRoute("cadoles_core_config_theme");
|
||||
}
|
||||
|
||||
public function setconfigAction(Request $request)
|
||||
{
|
||||
$session=$this->get('session');
|
||||
$themename=$session->get("theme");
|
||||
|
||||
$logo=$request->query->get('logo');
|
||||
if(!empty($logo)) $session->set('logo',"bundles/cadolescore/themes/$themename/".$logo);
|
||||
|
||||
$fgheader=$request->query->get('fgheader');
|
||||
if(!empty($fgheader)) $session->set('fgheader',boolval($fgheader));
|
||||
|
||||
$header=$request->query->get('header');
|
||||
if(!empty($header)) $session->set('header',"bundles/cadolescore/themes/$themename/".$header);
|
||||
|
||||
$heightheader=$request->query->get('heightheader');
|
||||
if(!empty($heightheader)) $session->set('heightheader',$heightheader);
|
||||
|
||||
$colormain=$request->query->get('colormain');
|
||||
if(!empty($colormain)) $session->set('colormain',$colormain);
|
||||
|
||||
$fontcolorhover=$request->query->get('fontcolorhover');
|
||||
if(!empty($fontcolorhover)) $session->set('fontcolorhover',$fontcolorhover);
|
||||
|
||||
$fontfacetitle=$request->query->get('fontfacetitle');
|
||||
if(!empty($fontfacetitle)) $session->set('fontfacetitle',$fontfacetitle);
|
||||
|
||||
$fontfacebody=$request->query->get('fontfacebody');
|
||||
if(!empty($fontfacebody)) $session->set('fontfacebody',$fontfacebody);
|
||||
|
||||
$color = $this->container->get('cadoles.core.service.color');
|
||||
$color->setColor();
|
||||
|
||||
return new Response();
|
||||
}
|
||||
}
|
@ -214,9 +214,9 @@ class UserController extends Controller
|
||||
// Action
|
||||
$action = "";
|
||||
if($access=="config") {
|
||||
$action.="<a href='".$this->generateUrl('cadoles_core_config_user_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-fw'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl('cadoles_core_config_user_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-fw fa-2x'></i></a>";
|
||||
if($data->getId()>0&&$this->GetParameter("masteridentity")!="LDAP") {
|
||||
$action.="<a href='".$this->generateUrl('cadoles_core_config_user_delete', array('id'=>$data->getId()))."'><i class='fa fa-trash fa-fw'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl('cadoles_core_config_user_delete', array('id'=>$data->getId()))."'><i class='fa fa-trash fa-fw fa-2x'></i></a>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,6 +98,12 @@ class Group
|
||||
*/
|
||||
protected $calendars;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Blog", mappedBy="groups")
|
||||
*/
|
||||
protected $blogs;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -111,6 +117,7 @@ class Group
|
||||
$this->fluxs = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->notices = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->calendars = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->blogs = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -528,4 +535,38 @@ class Group
|
||||
{
|
||||
return $this->calendars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add blog
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\Blog $blog
|
||||
*
|
||||
* @return Group
|
||||
*/
|
||||
public function addBlog(\Cadoles\PortalBundle\Entity\Blog $blog)
|
||||
{
|
||||
$this->blogs[] = $blog;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove blog
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\Blog $blog
|
||||
*/
|
||||
public function removeBlog(\Cadoles\PortalBundle\Entity\Blog $blog)
|
||||
{
|
||||
$this->blogs->removeElement($blog);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get blogs
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getBlogs()
|
||||
{
|
||||
return $this->blogs;
|
||||
}
|
||||
}
|
||||
|
@ -215,8 +215,29 @@ class User implements UserInterface, \Serializable
|
||||
* @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Notice", mappedBy="users")
|
||||
*/
|
||||
protected $notices;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $blog
|
||||
* @var Blog
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="Cadoles\PortalBundle\Entity\Blog", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
|
||||
*/
|
||||
private $blogs;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Blog", mappedBy="writers")
|
||||
*/
|
||||
protected $blogwriters;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $blogarticle
|
||||
* @var Blogarticle
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="Cadoles\PortalBundle\Entity\Blogarticle", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
|
||||
*/
|
||||
private $blogarticles;
|
||||
|
||||
|
||||
//== CODE A NE PAS REGENERER
|
||||
/**
|
||||
* @ORM\PostLoad
|
||||
@ -227,11 +248,6 @@ class User implements UserInterface, \Serializable
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->profils = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getUserName()
|
||||
{
|
||||
return $this->username;
|
||||
@ -305,6 +321,22 @@ class User implements UserInterface, \Serializable
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->groups = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->modos = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->pages = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->bookmarks = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->calendars = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->notices = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->blogs = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->blogwriters = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->blogarticles = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
@ -1122,4 +1154,106 @@ class User implements UserInterface, \Serializable
|
||||
{
|
||||
return $this->notices;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add blog
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\Blog $blog
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function addBlog(\Cadoles\PortalBundle\Entity\Blog $blog)
|
||||
{
|
||||
$this->blogs[] = $blog;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove blog
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\Blog $blog
|
||||
*/
|
||||
public function removeBlog(\Cadoles\PortalBundle\Entity\Blog $blog)
|
||||
{
|
||||
$this->blogs->removeElement($blog);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get blogs
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getBlogs()
|
||||
{
|
||||
return $this->blogs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add blogwriter
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\Blog $blogwriter
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function addBlogwriter(\Cadoles\PortalBundle\Entity\Blog $blogwriter)
|
||||
{
|
||||
$this->blogwriters[] = $blogwriter;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove blogwriter
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\Blog $blogwriter
|
||||
*/
|
||||
public function removeBlogwriter(\Cadoles\PortalBundle\Entity\Blog $blogwriter)
|
||||
{
|
||||
$this->blogwriters->removeElement($blogwriter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get blogwriters
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getBlogwriters()
|
||||
{
|
||||
return $this->blogwriters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add blogarticle
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\Blogarticle $blogarticle
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function addBlogarticle(\Cadoles\PortalBundle\Entity\Blogarticle $blogarticle)
|
||||
{
|
||||
$this->blogarticles[] = $blogarticle;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove blogarticle
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\Blogarticle $blogarticle
|
||||
*/
|
||||
public function removeBlogarticle(\Cadoles\PortalBundle\Entity\Blogarticle $blogarticle)
|
||||
{
|
||||
$this->blogarticles->removeElement($blogarticle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get blogarticles
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getBlogarticles()
|
||||
{
|
||||
return $this->blogarticles;
|
||||
}
|
||||
}
|
||||
|
@ -38,9 +38,11 @@
|
||||
public function onDomainParse(Event $event) {
|
||||
$session = new Session();
|
||||
|
||||
|
||||
|
||||
$configs = $this->em->getRepository("CadolesCoreBundle:Config")->findAll();
|
||||
foreach($configs as $config) {
|
||||
$session->set($config->getId(), $config->getValue());
|
||||
$session->set($config->getId(), strval($config->getValue()));
|
||||
}
|
||||
|
||||
// Calcul des couleurs
|
||||
|
@ -116,6 +116,25 @@ class uploadListener
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case "blogarticle":
|
||||
$file=$event->getFile();
|
||||
$filename=$file->getFilename();
|
||||
$pathname=$file->getPath();
|
||||
|
||||
// Creation d'un thumb
|
||||
$fs = new Filesystem();
|
||||
$fs->copy($pathname."/".$filename,$pathname."/thumb-".$filename);
|
||||
$max_width=350;
|
||||
$width = $this->getWidth($pathname."/thumb-".$filename);
|
||||
$height = $this->getHeight($pathname."/thumb-".$filename);
|
||||
$scale = $max_width/$width;
|
||||
$this->resizeImage($pathname."/thumb-".$filename,$width,$height,$scale);
|
||||
|
||||
$response = $event->getResponse();
|
||||
$response['file'] = $filename;
|
||||
break;
|
||||
|
||||
default:
|
||||
$file=$event->getFile();
|
||||
$filename=$file->getFilename();
|
||||
|
@ -118,6 +118,15 @@ class ConfigType extends AbstractType
|
||||
$builder->add('value',HiddenType::class);
|
||||
break;
|
||||
|
||||
case "theme":
|
||||
$builder->add('value',
|
||||
TextType::class,
|
||||
array("label" => "Valeur",
|
||||
"label_attr" => array("style" => 'margin-top:15px;'),
|
||||
"attr" => array("class" => "form-control"),
|
||||
'required' => ($options["required"]==0?false:true)));
|
||||
break;
|
||||
|
||||
case "color":
|
||||
$builder->add('value',
|
||||
TextType::class,
|
||||
|
@ -3,6 +3,20 @@ cadoles_core_home:
|
||||
path: /
|
||||
defaults: { _controller: CadolesCoreBundle:Core:home }
|
||||
|
||||
#== Theme ================================================================================================================
|
||||
|
||||
cadoles_core_theme_setconfig:
|
||||
path: /theme/setconfig
|
||||
defaults: { _controller: CadolesCoreBundle:Theme:setconfig }
|
||||
|
||||
cadoles_core_config_theme:
|
||||
path: /config/theme
|
||||
defaults: { _controller: CadolesCoreBundle:Theme:list }
|
||||
|
||||
cadoles_core_config_theme_selec:
|
||||
path: /config/theme/select/{name}
|
||||
defaults: { _controller: CadolesCoreBundle:Theme:select, name:"" }
|
||||
|
||||
#== Security Auth ========================================================================================================
|
||||
cadoles_core_login:
|
||||
path: /login
|
||||
|
@ -1,4 +1,56 @@
|
||||
|
||||
/*== GLOBAL =============================================================================================================================================*/
|
||||
|
||||
html {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
body.simple {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
body {
|
||||
padding-right: 0 !important
|
||||
}
|
||||
|
||||
#loader {
|
||||
text-align:center;
|
||||
margin-top:100px;
|
||||
}
|
||||
|
||||
/*== HEADER =============================================================================================================================================*/
|
||||
|
||||
.header {
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.header .title{
|
||||
text-decoration: none;
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
.header .title:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.header #logo{
|
||||
text-decoration: none;
|
||||
margin:10px 10px 0px 10px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.header span {
|
||||
float:left;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.header { display: none }
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*== NAVBAR =============================================================================================================================================*/
|
||||
|
||||
.navbar-default .navbar-brand {
|
||||
font-size: 30px;
|
||||
}
|
||||
@ -16,6 +68,21 @@
|
||||
padding: 5px 15px 0px 15px;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.navbar-top-links li a {
|
||||
padding: 5px 10px;
|
||||
font-size: 18px;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.navbar-right li a {
|
||||
padding: 0px;
|
||||
font-size: 35px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.navbar-default .navbar-header #title {
|
||||
display: none;
|
||||
@ -25,11 +92,569 @@
|
||||
float:right;
|
||||
}
|
||||
|
||||
.navbarheader { display: none }
|
||||
.navbarsmall { display: block !important}
|
||||
}
|
||||
|
||||
|
||||
/*== SIDEBAR ============================================================================================================================================*/
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.sidebar {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*== AVATAR ============================================================================================================================================*/
|
||||
|
||||
.avatar {
|
||||
height: 40px;
|
||||
border-radius: 100%;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
.avatar.big{
|
||||
height: 90px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/*== PAGE-WRAPPER =======================================================================================================================================*/
|
||||
#page-wrapper {
|
||||
border:none;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
#page-wrapper {
|
||||
padding: 0 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*== SORTABLE ===========================================================================================================================================*/
|
||||
|
||||
.placeholder {
|
||||
border: 2px dotted #3498db;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*== LIST CONFIG ========================================================================================================================================*/
|
||||
|
||||
.category-list-item {
|
||||
min-height: 30px;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
min-height: 50px;
|
||||
margin-top: 10px;
|
||||
color:#ffffff;
|
||||
border-radius: 0px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.list-item .panel-heading,
|
||||
.list-item .panel-heading a{
|
||||
color:#ffffff;
|
||||
font-size: 22px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
span.item-drag {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
width: 32px;
|
||||
background: rgba(0,0,0,.1);
|
||||
line-height: 35px;
|
||||
height: 32px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
transition: background .2s;
|
||||
border-radius: 0 0 10px 0;
|
||||
}
|
||||
|
||||
|
||||
/*== GRID ===============================================================================================================================================*/
|
||||
|
||||
.grid {
|
||||
list-style-type: none;
|
||||
margin: 0px;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
min-height: 30px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.grid-gutter-sizer { width: 0px }
|
||||
|
||||
.grid-title {
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
padding-top: 10px;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
.grid .grid-item,
|
||||
.grid .grid-sizer {
|
||||
float: left;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
width: 290px;
|
||||
height: 150px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.grid-item .grid-item-content:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.grid-item .item-link {
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 18px !important;
|
||||
color: #fff;
|
||||
display: block;
|
||||
text-align: left;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.grid-item .item-link a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.grid-item-content a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.grid-item .item-link {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.grid-item-logo {
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
width: 40%;
|
||||
height: 150px;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.grid-item .item-link img {
|
||||
display: block;
|
||||
margin: 10px auto;
|
||||
max-width: 100%;
|
||||
max-height: 110px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.grid-item .grid-item-title {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
padding: 15px 5px;;
|
||||
font-size: 12px;
|
||||
width: 50%;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.grid-item .grid-item-title h2 {
|
||||
font-size: 20px;
|
||||
margin: 10px 0 0 0;
|
||||
border-bottom: 1px solid #fff;
|
||||
padding-bottom: 5px;
|
||||
margin-bottom: 5px;
|
||||
text-transform: uppercase;
|
||||
color: #fff;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
|
||||
a.item-preview {
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 2px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
a.item-update {
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 2px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
a.item-delete {
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 2px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
a.item-heart {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 2px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.grid-item-body {
|
||||
height:200px;
|
||||
overflow-y:auto;
|
||||
text-align: left;
|
||||
padding:15px;
|
||||
line-height:10px;
|
||||
}
|
||||
|
||||
.grid .grid-medium {
|
||||
width:150px;
|
||||
height:200px;
|
||||
}
|
||||
|
||||
.grid .grid-medium .item-link {
|
||||
height:200px;
|
||||
}
|
||||
|
||||
.grid .grid-medium .grid-item-logo {
|
||||
display: block;
|
||||
height:80px;
|
||||
width:auto;
|
||||
}
|
||||
.grid .grid-medium .grid-item-logo img {
|
||||
height: 80px;
|
||||
width: auto;
|
||||
margin: 5px auto;
|
||||
}
|
||||
.grid .grid-medium .grid-item-title {
|
||||
display: block;
|
||||
vertical-align: top;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
text-align:center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.grid .grid-small {
|
||||
width:100px;
|
||||
height:120px;
|
||||
}
|
||||
|
||||
.grid .grid-small .item-link {
|
||||
height:120px;
|
||||
}
|
||||
|
||||
.grid .grid-small .grid-item-logo {
|
||||
display: block;
|
||||
height:60px;
|
||||
width:auto;
|
||||
}
|
||||
.grid .grid-small .grid-item-logo img {
|
||||
height: 60px;
|
||||
width: auto;
|
||||
margin: 5px auto;
|
||||
}
|
||||
.grid .grid-small .grid-item-title {
|
||||
display: block;
|
||||
vertical-align: top;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
text-align:center;
|
||||
width: 100%;
|
||||
}
|
||||
.grid .grid-small .grid-item-title h2 { font-size:10px; border-bottom: none; }
|
||||
.grid .grid-small .grid-item-title span { display: none }
|
||||
|
||||
.grid .grid-image {
|
||||
width:20%;
|
||||
height:auto;
|
||||
}
|
||||
|
||||
.grid .grid-image .item-link {
|
||||
height:auto;
|
||||
}
|
||||
|
||||
.grid .grid-image .grid-item-logo {
|
||||
display: block;
|
||||
height:auto;
|
||||
width:auto;
|
||||
padding:0px;
|
||||
}
|
||||
.grid .grid-image .grid-item-logo img {
|
||||
height: auto;
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
max-height:none;
|
||||
}
|
||||
|
||||
|
||||
.grid .grid-preview {
|
||||
width:19.2%;
|
||||
height:auto;
|
||||
margin-bottom: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.grid .grid-preview a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.grid .grid-preview .grid-preview-title {
|
||||
margin:0px;
|
||||
font-size:25px;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
.grid .grid-preview .caption { padding: 9px }
|
||||
|
||||
.grid-gutter-sizer-preview { width: 1% }
|
||||
|
||||
@media (max-width: 991px) {
|
||||
.grid .grid-preview {
|
||||
width:32.666666667%;
|
||||
height:auto;
|
||||
}
|
||||
|
||||
.grid .grid-image {
|
||||
width:33.3333333333%;
|
||||
height:auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.grid .grid-preview {
|
||||
width:49.5%;
|
||||
height:auto;
|
||||
}
|
||||
|
||||
.grid .grid-image {
|
||||
width:50%;
|
||||
height:auto;
|
||||
}
|
||||
}
|
||||
|
||||
/*== PAGE ===============================================================================================================================================*/
|
||||
|
||||
#menupageaction {
|
||||
float: right;
|
||||
font-size: 20px;
|
||||
margin: 5px 15px 0px 0px
|
||||
}
|
||||
|
||||
.pagemenu {
|
||||
display: block;
|
||||
margin: 0px -30px;
|
||||
padding: 0px 30px;
|
||||
font-size:20px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
/*== WIDGET =============================================================================================================================================*/
|
||||
|
||||
.widgetplacehorder {
|
||||
height:50px;
|
||||
border: 2px dotted #3498db;
|
||||
background-color:#cdcdcd;
|
||||
}
|
||||
|
||||
.widgetempty {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.widget {
|
||||
margin-top:30px;
|
||||
}
|
||||
|
||||
.widgetmenu {
|
||||
right: 20px;
|
||||
position: absolute;
|
||||
margin-top: 10px;
|
||||
display:none;
|
||||
z-index: 10000000;
|
||||
}
|
||||
|
||||
.widgetmenu i {
|
||||
font-size :20px;
|
||||
}
|
||||
|
||||
.widgetheader {
|
||||
font-size: 30px;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.widgetheader .logo {
|
||||
position: absolute;
|
||||
height:40px;
|
||||
width:40px;
|
||||
border-radius: 100%;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.widgetheader .title {
|
||||
position: absolute;
|
||||
margin-left:50px;
|
||||
}
|
||||
|
||||
.widgetheader iframe,
|
||||
.widgetbody iframe {
|
||||
width:100%;
|
||||
border:0px;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.frameitem {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
width:100%;
|
||||
border:0px;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
/*== FEED ===============================================================================================================================================*/
|
||||
|
||||
.cat-list-feed {
|
||||
display: inline-block;
|
||||
padding: 8px;
|
||||
margin-top: 10px;
|
||||
margin-right: 5px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.feed{
|
||||
height:200px;
|
||||
padding: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.feed h1 {
|
||||
margin:0px;
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
.feed .description {
|
||||
width: 70%;
|
||||
float: right;
|
||||
margin-top: 5px;
|
||||
background: rgb(0,0,0,0.6);
|
||||
padding: 10px;
|
||||
font-size: 11px;
|
||||
max-height: 110px;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
|
||||
/*== SLICK===============================================================================================================================================*/
|
||||
|
||||
.slick {
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:relative;
|
||||
}
|
||||
.slick div{
|
||||
width:100%;
|
||||
height:100%;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
color:#fff;
|
||||
}
|
||||
.slick .slicktitle {
|
||||
text-align: left;
|
||||
margin: 30px 0px 0px 50px;
|
||||
padding: 15px;
|
||||
background-color: rgb(0,0,0,0.4);
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.slick .slicksubtitle,
|
||||
.slick .slicklink
|
||||
{
|
||||
margin: 5px 0px 0px 50px;
|
||||
padding: 15px;
|
||||
background-color: rgb(0,0,0,0.4);
|
||||
font-size: 15px;
|
||||
text-transform: initial;
|
||||
float: left;
|
||||
clear: both;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.nav-pills>li>a { border-radius: 0px; }
|
||||
|
||||
.page-maxed {
|
||||
max-width:1500px;
|
||||
margin:auto !important;
|
||||
}
|
||||
|
||||
|
||||
.blogpreview .blogtitle{
|
||||
text-align:center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.blogarticle {
|
||||
margin-bottom:150px;
|
||||
}
|
||||
|
||||
.blogarticle .blogtitle h1{
|
||||
text-align:left
|
||||
}
|
||||
|
||||
.blogarticle .blogimage {
|
||||
width:100%;
|
||||
height:450px;
|
||||
background-size:cover;
|
||||
background-position: center;
|
||||
margin-top:20px;
|
||||
}
|
||||
|
||||
.blogarticle .blogtitle {
|
||||
margin-bottom:20px;
|
||||
}
|
||||
|
||||
.blogarticle .blogtitle legend {
|
||||
margin-bottom:0px;
|
||||
}
|
||||
|
||||
.blogarticle .blogbody {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.blogarticle .blogsidebar {
|
||||
border-left: 1px solid #e5e5e5;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.blogarticle .blogsidebartitle {
|
||||
margin-bottom:0px;
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,26 @@
|
||||
{% set logo = "" %}
|
||||
|
||||
{% set fgheader = "" %}
|
||||
{% set header = "header.png" %}
|
||||
{% set heightheader = "" %}
|
||||
|
||||
{% set colormain = "2e3131" %}
|
||||
{% set fontcolorhover = "" %}
|
||||
|
||||
{% set fontfacetitle = "" %}
|
||||
{% set fontfacebody = "" %}
|
||||
|
||||
{{
|
||||
render(url("cadoles_core_theme_setconfig",
|
||||
{
|
||||
'logo':logo,
|
||||
'fgheader':fgheader,
|
||||
'header': header,
|
||||
'heightheader': heightheader,
|
||||
'colormain': colormain,
|
||||
'fontcolorhover': fontcolorhover,
|
||||
'fontfacetitle': fontfacetitle,
|
||||
'fontfacebody': fontfacebody
|
||||
}
|
||||
))
|
||||
}}
|
After Width: | Height: | Size: 7.9 KiB |
@ -0,0 +1,6 @@
|
||||
name: Black
|
||||
author: Arnaud Fornerot
|
||||
version: 1.0
|
||||
forcelogo: false
|
||||
forceheader: true
|
||||
color: 1e824c
|
After Width: | Height: | Size: 1.2 MiB |
@ -0,0 +1,7 @@
|
||||
{% macro logo() %}{{ app.session.get('logo') }}{% endmacro %}
|
||||
{% macro fgheader() %}{{ app.session.get('fgheader') }}{% endmacro %}
|
||||
{% macro header() %}{{ app.session.get('header') }}{% endmacro %}
|
||||
{% macro heightheader() %}{{ app.session.get('heightheader') }}{% endmacro %}
|
||||
{% macro colorR() %}{{ app.session.get('color')['mainrgb']['r'] }}{% endmacro %}
|
||||
{% macro colorG() %}{{ app.session.get('color')['mainrgb']['g'] }}{% endmacro %}
|
||||
{% macro colorB() %}{{ app.session.get('color')['mainrgb']['b'] }}{% endmacro %}
|
@ -0,0 +1,27 @@
|
||||
{% set logo = "" %}
|
||||
|
||||
{% set fgheader = "" %}
|
||||
{% set header = "header.jpg" %}
|
||||
{% set heightheader = "" %}
|
||||
|
||||
{% set colormain = "6c7a89" %}
|
||||
{% set fontcolorhover = "" %}
|
||||
|
||||
{% set fontfacetitle = "" %}
|
||||
{% set fontfacebody = "" %}
|
||||
|
||||
|
||||
{{
|
||||
render(url("cadoles_core_theme_setconfig",
|
||||
{
|
||||
'logo':logo,
|
||||
'fgheader':fgheader,
|
||||
'header': header,
|
||||
'heightheader': heightheader,
|
||||
'colormain': colormain,
|
||||
'fontcolorhover': fontcolorhover,
|
||||
'fontfacetitle': fontfacetitle,
|
||||
'fontfacebody': fontfacebody
|
||||
}
|
||||
))
|
||||
}}
|
After Width: | Height: | Size: 89 KiB |
@ -0,0 +1,6 @@
|
||||
name: Gray
|
||||
author: Arnaud Fornerot
|
||||
version: 1.0
|
||||
forcelogo: false
|
||||
forceheader: true
|
||||
color: 6c7a89
|
After Width: | Height: | Size: 1.2 MiB |
@ -0,0 +1,26 @@
|
||||
{% set logo = "" %}
|
||||
|
||||
{% set fgheader = "" %}
|
||||
{% set header = "header.png" %}
|
||||
{% set heightheader = "" %}
|
||||
|
||||
{% set colormain = "1e824c" %}
|
||||
{% set fontcolorhover = "" %}
|
||||
|
||||
{% set fontfacetitle = "" %}
|
||||
{% set fontfacebody = "" %}
|
||||
|
||||
{{
|
||||
render(url("cadoles_core_theme_setconfig",
|
||||
{
|
||||
'logo':logo,
|
||||
'fgheader':fgheader,
|
||||
'header': header,
|
||||
'heightheader': heightheader,
|
||||
'colormain': colormain,
|
||||
'fontcolorhover': fontcolorhover,
|
||||
'fontfacetitle': fontfacetitle,
|
||||
'fontfacebody': fontfacebody
|
||||
}
|
||||
))
|
||||
}}
|
After Width: | Height: | Size: 436 KiB |
@ -0,0 +1,6 @@
|
||||
name: Green
|
||||
author: Arnaud Fornerot
|
||||
version: 1.0
|
||||
forcelogo: false
|
||||
forceheader: true
|
||||
color: 1e824c
|
After Width: | Height: | Size: 1.2 MiB |
@ -0,0 +1,6 @@
|
||||
name: Green
|
||||
author: Arnaud Fornerot
|
||||
version: 1.0
|
||||
forcelogo: false
|
||||
forceheader: true
|
||||
color: 1e824c
|
After Width: | Height: | Size: 1.3 MiB |
@ -0,0 +1,27 @@
|
||||
{% set logo = "" %}
|
||||
|
||||
{% set fgheader = "" %}
|
||||
{% set header = "header.jpg" %}
|
||||
{% set heightheader = "" %}
|
||||
|
||||
{% set colormain = "f15a22" %}
|
||||
{% set fontcolorhover = "" %}
|
||||
|
||||
{% set fontfacetitle = "" %}
|
||||
{% set fontfacebody = "" %}
|
||||
|
||||
|
||||
{{
|
||||
render(url("cadoles_core_theme_setconfig",
|
||||
{
|
||||
'logo':logo,
|
||||
'fgheader':fgheader,
|
||||
'header': header,
|
||||
'heightheader': heightheader,
|
||||
'colormain': colormain,
|
||||
'fontcolorhover': fontcolorhover,
|
||||
'fontfacetitle': fontfacetitle,
|
||||
'fontfacebody': fontfacebody
|
||||
}
|
||||
))
|
||||
}}
|
After Width: | Height: | Size: 89 KiB |
@ -0,0 +1,6 @@
|
||||
name: Orange
|
||||
author: Arnaud Fornerot
|
||||
version: 1.0
|
||||
forcelogo: false
|
||||
forceheader: true
|
||||
color: 6c7a89
|
After Width: | Height: | Size: 1.2 MiB |
@ -0,0 +1,27 @@
|
||||
{% set logo = "" %}
|
||||
|
||||
{% set fgheader = "" %}
|
||||
{% set header = "header.jpg" %}
|
||||
{% set heightheader = "" %}
|
||||
|
||||
{% set colormain = "f7ca18" %}
|
||||
{% set fontcolorhover = "171717" %}
|
||||
|
||||
{% set fontfacetitle = "" %}
|
||||
{% set fontfacebody = "" %}
|
||||
|
||||
|
||||
{{
|
||||
render(url("cadoles_core_theme_setconfig",
|
||||
{
|
||||
'logo':logo,
|
||||
'fgheader':fgheader,
|
||||
'header': header,
|
||||
'heightheader': heightheader,
|
||||
'colormain': colormain,
|
||||
'fontcolorhover': fontcolorhover,
|
||||
'fontfacetitle': fontfacetitle,
|
||||
'fontfacebody': fontfacebody
|
||||
}
|
||||
))
|
||||
}}
|
After Width: | Height: | Size: 89 KiB |
@ -0,0 +1,6 @@
|
||||
name: Yellow
|
||||
author: Arnaud Fornerot
|
||||
version: 1.0
|
||||
forcelogo: false
|
||||
forceheader: true
|
||||
color: f7ca18
|
After Width: | Height: | Size: 1.2 MiB |
@ -51,12 +51,11 @@
|
||||
'@CadolesCoreBundle/Resources/public/js/bootstrap-datetimepicker.fr.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/bootstrap-slider.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/masonry.pkgd.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/sb-admin-2.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/gridify-min.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/jquery-ui.min.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/tinycolor-0.9.15.min.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/pick-a-color-1.2.3.min.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/bootstrap-switch.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/gridify-min.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/dropzone.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/jquery.imgareaselect.min.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/jquery.fakecrop.js'
|
||||
@ -71,7 +70,8 @@
|
||||
'@CadolesCoreBundle/Resources/public/js/moment.min.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/fullcalendar.min.js'
|
||||
'@CadolesCoreBundle/Resources/public/js/fullcalendar.lang.js'
|
||||
|
||||
'@CadolesCoreBundle/Resources/public/js/sb-admin-2.js'
|
||||
|
||||
'@Tetranz\Select2EntityBundle//Resources/public/js/select2entity.js'
|
||||
|
||||
'@CadolesCoreBundle/Resources/public/js/local.js'
|
||||
|
@ -41,483 +41,17 @@
|
||||
<link href="{{ asset_url }}" rel="stylesheet" media="screen" />
|
||||
{% endstylesheets %}
|
||||
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
<link href="/{{ alias }}/bundles/cadolescore/themes/{{theme}}/style.css" rel="stylesheet" media="screen" />
|
||||
{% endif %}
|
||||
|
||||
<link rel="shortcut icon" href="/{{ alias }}/{{ app.session.get('logo') }}" />
|
||||
<style>
|
||||
html { height: 100% }
|
||||
|
||||
body.simple { background-color: transparent; }
|
||||
body { padding-right: 0 !important }
|
||||
|
||||
.header .title{
|
||||
text-decoration: none;
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
.header .title:hover {
|
||||
text-decoration: none;
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
.header #logo{
|
||||
text-decoration: none;
|
||||
margin:10px 10px 0px 10px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.header span {
|
||||
float:left;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.navbar-top-links li a {
|
||||
padding: 5px 10px;
|
||||
font-size: 18px;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
|
||||
.li-placeholder {
|
||||
border: 2px dotted #3498db;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.header { display: none }
|
||||
.navbarheader { display: none }
|
||||
.navbarsmall { display: block !important}
|
||||
}
|
||||
|
||||
.navbar-right li a {
|
||||
padding: 0px;
|
||||
font-size: 35px;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
height: 40px;
|
||||
border-radius: 100%;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
.avatar.big{
|
||||
height: 90px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@media(min-width:768px) {
|
||||
#page-wrapper {
|
||||
border-left: none;
|
||||
}
|
||||
}
|
||||
|
||||
.category-list-item {
|
||||
min-height: 30px;
|
||||
}
|
||||
|
||||
.category-list-item-placeholder {
|
||||
border: 2px dotted #3498db;
|
||||
}
|
||||
|
||||
.cat-list-item {
|
||||
display: inline-block;
|
||||
padding: 8px;
|
||||
margin-top: 10px;
|
||||
margin-right: 5px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
min-height: 50px;
|
||||
margin-top: 10px;
|
||||
color:#ffffff;
|
||||
border-radius: 0px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.list-item-placeholder {
|
||||
border: 2px dotted #3498db;
|
||||
}
|
||||
|
||||
.list-item .panel-heading,
|
||||
.list-item .panel-heading a{
|
||||
color:#ffffff;
|
||||
font-size: 22px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
span.item-drag {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
width: 32px;
|
||||
background: rgba(0,0,0,.1);
|
||||
line-height: 35px;
|
||||
height: 32px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
transition: background .2s;
|
||||
border-radius: 0 0 10px 0;
|
||||
}
|
||||
|
||||
.grid-title {
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
padding-top: 10px;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
.grid {
|
||||
list-style-type: none;
|
||||
margin: 0px;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
min-height: 30px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.grid .grid-item,
|
||||
.grid .grid-sizer {
|
||||
float: left;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
width: 290px;
|
||||
height: 150px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.grid-item .grid-item-content:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.grid-item .item-link {
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 18px !important;
|
||||
color: #fff;
|
||||
display: block;
|
||||
text-align: left;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.grid-item .item-link a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.grid-item-content a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.grid-item .item-link {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.grid-item-logo {
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
width: 40%;
|
||||
height: 150px;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.grid-item .item-link img {
|
||||
display: block;
|
||||
margin: 10px auto;
|
||||
max-width: 100%;
|
||||
max-height: 110px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.grid-item .grid-item-title {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
padding: 15px 5px;;
|
||||
font-size: 12px;
|
||||
width: 50%;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.grid-item .grid-item-title h2 {
|
||||
font-size: 20px;
|
||||
margin: 10px 0 0 0;
|
||||
border-bottom: 1px solid #fff;
|
||||
padding-bottom: 5px;
|
||||
margin-bottom: 5px;
|
||||
text-transform: uppercase;
|
||||
color: #fff;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.grid-item-placeholder {
|
||||
border: 2px dotted #3498db;
|
||||
}
|
||||
|
||||
a.item-preview {
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 2px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
a.item-update {
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 2px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
a.item-delete {
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 2px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
a.item-heart {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 2px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.grid-item-body {
|
||||
height:200px;
|
||||
overflow-y:auto;
|
||||
text-align: left;
|
||||
padding:15px;
|
||||
line-height:10px;
|
||||
}
|
||||
|
||||
.grid .grid-medium {
|
||||
width:150px;
|
||||
height:200px;
|
||||
}
|
||||
|
||||
.grid .grid-medium .item-link {
|
||||
height:200px;
|
||||
}
|
||||
|
||||
.grid .grid-medium .grid-item-logo {
|
||||
display: block;
|
||||
height:80px;
|
||||
width:auto;
|
||||
}
|
||||
.grid .grid-medium .grid-item-logo img {
|
||||
height: 80px;
|
||||
width: auto;
|
||||
margin: 5px auto;
|
||||
}
|
||||
.grid .grid-medium .grid-item-title {
|
||||
display: block;
|
||||
vertical-align: top;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
text-align:center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.grid .grid-small {
|
||||
width:100px;
|
||||
height:120px;
|
||||
}
|
||||
|
||||
.grid .grid-small .item-link {
|
||||
height:120px;
|
||||
}
|
||||
|
||||
.grid .grid-small .grid-item-logo {
|
||||
display: block;
|
||||
height:60px;
|
||||
width:auto;
|
||||
}
|
||||
.grid .grid-small .grid-item-logo img {
|
||||
height: 60px;
|
||||
width: auto;
|
||||
margin: 5px auto;
|
||||
}
|
||||
.grid .grid-small .grid-item-title {
|
||||
display: block;
|
||||
vertical-align: top;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
text-align:center;
|
||||
width: 100%;
|
||||
}
|
||||
.grid .grid-small .grid-item-title h2 { font-size:10px; border-bottom: none; }
|
||||
.grid .grid-small .grid-item-title span { display: none }
|
||||
|
||||
.grid .grid-image {
|
||||
width:20%;
|
||||
height:auto;
|
||||
}
|
||||
|
||||
.grid .grid-image .item-link {
|
||||
height:auto;
|
||||
}
|
||||
|
||||
.grid .grid-image .grid-item-logo {
|
||||
display: block;
|
||||
height:auto;
|
||||
width:auto;
|
||||
padding:0px;
|
||||
}
|
||||
.grid .grid-image .grid-item-logo img {
|
||||
height: auto;
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
max-height:none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#menupageaction {
|
||||
float: right;
|
||||
font-size: 20px;
|
||||
margin: 5px 15px 0px 0px
|
||||
}
|
||||
|
||||
.pagemenu {
|
||||
display: block;
|
||||
margin: 0px -30px;
|
||||
padding: 0px 30px;
|
||||
font-size:20px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.widgetplacehorder {
|
||||
height:50px;
|
||||
border: 2px dotted #3498db;
|
||||
background-color:#cdcdcd;
|
||||
}
|
||||
|
||||
.widgetempty {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.widget {
|
||||
margin-top:30px;
|
||||
}
|
||||
|
||||
.widgetmenu {
|
||||
right: 20px;
|
||||
position: absolute;
|
||||
margin-top: 10px;
|
||||
display:none;
|
||||
z-index: 10000000;
|
||||
}
|
||||
|
||||
.widgetmenu i {
|
||||
font-size :20px;
|
||||
}
|
||||
|
||||
.widgetheader {
|
||||
font-size: 30px;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.widgetheader .logo {
|
||||
position: absolute;
|
||||
height:40px;
|
||||
width:40px;
|
||||
border-radius: 100%;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.widgetheader .title {
|
||||
position: absolute;
|
||||
margin-left:50px;
|
||||
}
|
||||
|
||||
.widgetheader iframe,
|
||||
.widgetbody iframe {
|
||||
width:100%;
|
||||
border:0px;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.frameitem {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
width:100%;
|
||||
border:0px;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.feed{
|
||||
height:200px;
|
||||
padding: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.feed h1 {
|
||||
margin:0px;
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
.feed .description {
|
||||
width: 70%;
|
||||
float: right;
|
||||
margin-top: 5px;
|
||||
background: rgb(0,0,0,0.6);
|
||||
padding: 10px;
|
||||
font-size: 11px;
|
||||
max-height: 110px;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* slick */
|
||||
.slick {
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:relative;
|
||||
}
|
||||
.slick div{
|
||||
width:100%;
|
||||
height:100%;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
color:#fff;
|
||||
}
|
||||
.slick .slicktitle {
|
||||
text-align: left;
|
||||
margin: 30px 0px 0px 50px;
|
||||
padding: 15px;
|
||||
background-color: rgb(0,0,0,0.4);
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.slick .slicksubtitle,
|
||||
.slick .slicklink
|
||||
{
|
||||
margin: 5px 0px 0px 50px;
|
||||
padding: 15px;
|
||||
background-color: rgb(0,0,0,0.4);
|
||||
font-size: 15px;
|
||||
text-transform: initial;
|
||||
float: left;
|
||||
clear: both;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
@ -532,7 +66,8 @@
|
||||
.pagination>.active>span:hover,
|
||||
.herotitle img,
|
||||
.avatar,
|
||||
.pagemenu
|
||||
.pagemenu,
|
||||
.grid .grid-preview .caption
|
||||
{
|
||||
background-color: #{{ color['main'] }}
|
||||
}
|
||||
@ -591,7 +126,9 @@
|
||||
.navbar-default .navbar-brand,
|
||||
.navbar-default a,
|
||||
.sidebar a,
|
||||
.pagemenu a {
|
||||
.pagemenu a,
|
||||
.grid .grid-preview .caption,
|
||||
.grid .grid-preview .caption h1 {
|
||||
color: #{{ color['fontcolorhover'] }}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
<li><a href="{{ path('cadoles_core_config') }}" title="Configuration"><i class="fa fa-gear fa-fw"></i></a>
|
||||
{% endif %}
|
||||
<li><a href="{{ path('cadoles_core_profil_users') }}" title="Annuaire"><i class="fa fa-users fa-fw"></i></a>
|
||||
<li><a href="{{ path('cadoles_portal_user_calendar_view') }}" title="Calendrier"><i class="fa fa-calendar fa-fw"></i></a>
|
||||
<li><a href="{{ path('cadoles_portal_user_notice_view') }}" title="Charte"><i class="fa fa-info fa-fw"></i></a>
|
||||
<li><a href="{{ path('cadoles_core_profil') }}" title="Profil"><img class='avatar' src="/{{ alias }}/uploads/avatar/{{ app.user.avatar }}"></a></li>
|
||||
|
||||
@ -21,6 +20,7 @@
|
||||
|
||||
{% else %}
|
||||
<li><a href="{{ path('cadoles_portal_user_notice_view') }}" title="Charte"><i class="fa fa-info fa-fw"></i></a>
|
||||
|
||||
{% if moderegistration!="none" and masteridentity=="SQL"%}
|
||||
<li><a href="{{ path('cadoles_core_registration') }}" title="Inscription"><i class="fa fa-user-plus fa-fw"></i></a>
|
||||
{% endif %}
|
||||
|
@ -0,0 +1,38 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
<div class="row">
|
||||
<h2>Thème en cours</h2>
|
||||
<div class="col-sm-3">
|
||||
<div class="thumbnail">
|
||||
<img src="{{currentheme.url}}/look.png">
|
||||
|
||||
<div class="caption">
|
||||
<h3>{{currentheme.name}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<h2>Thèmes disponibles</h2>
|
||||
{% for theme in themes %}
|
||||
<div class="col-sm-3">
|
||||
<div class="thumbnail">
|
||||
<img src="{{theme.url}}/look.png">
|
||||
|
||||
<div class="caption">
|
||||
<h3>{{theme.name}}</h3>
|
||||
<p><a href="{{ path("cadoles_core_config_theme_selec",{"name":theme.dir}) }}" class="btn btn-primary" role="button">Sélectionner</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,8 +1,31 @@
|
||||
{% set color = app.session.get('color') %}
|
||||
|
||||
{% set logo = app.session.get('logo') %}
|
||||
{% set fgheader = app.session.get('fgheader') %}
|
||||
{% set header = app.session.get('header') %}
|
||||
{% set heightheader = app.session.get('heightheader') %}
|
||||
{% set colorR = color['mainrgb']['r'] %}
|
||||
{% set colorG = color['mainrgb']['g'] %}
|
||||
{% set colorB = color['mainrgb']['b'] %}
|
||||
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% import '@Theme/constant.html.twig' as constant %}
|
||||
|
||||
{% set logo = constant.logo().__toString %}
|
||||
{% set fgheader = constant.fgheader().__toString %}
|
||||
{% set header = constant.header().__toString %}
|
||||
{% set heightheader = constant.heightheader().__toString %}
|
||||
{% set colorR = constant.colorR.__toString %}
|
||||
{% set colorG = constant.colorG.__toString %}
|
||||
{% set colorB = constant.colorB.__toString %}
|
||||
{%endif%}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
|
||||
{{ include('@CadolesCore/Include/head.html.twig') }}
|
||||
|
||||
<style>
|
||||
@ -24,12 +47,12 @@
|
||||
{{ render(url("cadoles_core_checkuser")) }}
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.get('fgheader') %}
|
||||
{% if fgheader==1 %}
|
||||
{% if useheader %}
|
||||
<div class="header" style="height:{{ app.session.get('heightheader') }}px; background-image: linear-gradient(90deg,rgba({{ color['mainrgb']['r'] }},{{ color['mainrgb']['g'] }},{{ color['mainrgb']['b'] }},1),rgba({{ color['mainrgb']['r'] }},{{ color['mainrgb']['g'] }},{{ color['mainrgb']['b'] }},0.1)),url(/{{ alias }}/{{ app.session.get('header') }});">
|
||||
<div class="header" style="height:{{ heightheader }}px; background-image: linear-gradient(90deg,rgba({{ colorR }},{{ colorG }},{{ colorB }},1),rgba({{ colorR }},{{ colorG }},{{ colorB }},0.1)),url(/{{ alias }}/{{ header }});">
|
||||
<a class="title" style="cursor: pointer" href="{{ path("cadoles_core_home") }}">
|
||||
<img id="logo" src="/{{ alias }}/{{ app.session.get('logo') }}" style="height:{{ app.session.get('heightheader')-20 }}px;">
|
||||
<span style="height:{{ app.session.get('heightheader')}}px; line-height:{{ app.session.get('heightheader')}}px;">{{ app.session.get('appname') }}</span>
|
||||
<img id="logo" src="/{{ alias }}/{{ logo }}" style="height:{{ heightheader-20 }}px;">
|
||||
<span style="height:{{ heightheader }}px; line-height:{{ heightheader }}px;">{{ app.session.get('appname') }}</span>
|
||||
</a>
|
||||
|
||||
<div class="navbar-header">
|
||||
@ -52,7 +75,7 @@
|
||||
|
||||
<!-- Navigation -->
|
||||
{% if useheader %}
|
||||
<nav class="navbarsmall navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0;{% if app.session.get('fgheader') %} display:none; {% endif %}">
|
||||
<nav class="navbarsmall navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0;{% if fgheader==1 %} display:none; {% endif %}">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
@ -62,7 +85,7 @@
|
||||
</button>
|
||||
|
||||
<a class="navbar-brand" href="{{ path("cadoles_core_home") }}">
|
||||
<img id="logo" src="/{{ alias }}/{{ app.session.get('logo') }}">
|
||||
<img id="logo" src="/{{ alias }}/logo) }}">
|
||||
{{ app.session.get('appname') }}
|
||||
</a>
|
||||
</div>
|
||||
@ -100,10 +123,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="page-wrapper" style="min-height:1200px; {% if not usesidebar %} margin:0px; {% endif %} {% if maxwidth is defined and maxwidth %} max-width:1200px; margin:auto;{% endif %}">
|
||||
<div id="page-wrapper" class="{% if maxwidth is defined and maxwidth %} page-maxed {% endif %}" style="min-height:1200px; {% if not usesidebar %} margin:0px; {% endif %}">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
|
@ -52,6 +52,22 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
|
||||
// Creation des pagecategory
|
||||
$output->writeln(' > Creation Pagecategory');
|
||||
$entityPagecategory = $em->getRepository('CadolesPortalBundle:Pagecategory')->find(-100);
|
||||
if(!$entityPagecategory) {
|
||||
$entityPagecategory = new Pagecategory();
|
||||
$entityPagecategory->setId(-100);
|
||||
$entityPagecategory->setName('Calendriers');
|
||||
$em->persist($entityPagecategory);
|
||||
}
|
||||
|
||||
$entityPagecategory = $em->getRepository('CadolesPortalBundle:Pagecategory')->find(-90);
|
||||
if(!$entityPagecategory) {
|
||||
$entityPagecategory = new Pagecategory();
|
||||
$entityPagecategory->setId(-90);
|
||||
$entityPagecategory->setName('Blogs');
|
||||
$em->persist($entityPagecategory);
|
||||
}
|
||||
|
||||
$entityPagecategory = $em->getRepository('CadolesPortalBundle:Pagecategory')->find(1);
|
||||
if(!$entityPagecategory) {
|
||||
$entityPagecategory = new Pagecategory();
|
||||
@ -317,6 +333,51 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$em->persist($entityWidget);
|
||||
}
|
||||
|
||||
// Widget Calendrier
|
||||
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1890);
|
||||
if(!$entityWidget) {
|
||||
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_rocket.png"]);
|
||||
|
||||
$entityWidget = new Widget();
|
||||
$entityWidget->setId(-1890);
|
||||
$entityWidget->setRoworder(12);
|
||||
$entityWidget->setIcon($entityicon);
|
||||
$entityWidget->setName('Blog');
|
||||
$entityWidget->setDescription("Les derniers articles publiés sur vos blogs");
|
||||
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_blog");
|
||||
$entityWidget->setHeight("630");
|
||||
$entityWidget->setAutoajust(true);
|
||||
$entityWidget->setBorder(true);
|
||||
|
||||
$parameter = json_decode('{"fields": [{"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) {
|
||||
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_roadblock.png"]);
|
||||
|
||||
$entityWidget = new Widget();
|
||||
$entityWidget->setId(-1600);
|
||||
$entityWidget->setRoworder(100);
|
||||
$entityWidget->setIcon($entityicon);
|
||||
$entityWidget->setName('Séparateur');
|
||||
$entityWidget->setDescription("Widget graphique pour séparer les autres widgets");
|
||||
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_separator");
|
||||
$entityWidget->setHeight("50");
|
||||
$entityWidget->setAutoajust(false);
|
||||
$entityWidget->setBorder(false);
|
||||
$entityWidget->setColorbodyback("ffffff");
|
||||
|
||||
$parameter = json_decode('{"fields": [{"id": "seetitle", "loc": "col1", "type": "boolean", "label": "Afficher le titre", "value": "0", "mandatory": "true"},{"id": "seeicon", "loc": "col1", "type": "boolean", "label": "Afficher l\'icone", "value": "0", "mandatory": "true"}]}');
|
||||
$entityWidget->setParameter($parameter);
|
||||
|
||||
$em->persist($entityWidget);
|
||||
}
|
||||
|
||||
// Widget Horloge
|
||||
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1500);
|
||||
if(!$entityWidget) {
|
||||
@ -329,7 +390,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||
$entityWidget->setName('Horloge');
|
||||
$entityWidget->setDescription("Une simple horloge");
|
||||
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_clock");
|
||||
$entityWidget->setHeight("300");
|
||||
$entityWidget->setHeight("200");
|
||||
$entityWidget->setAutoajust(false);
|
||||
$entityWidget->setBorder(true);
|
||||
|
||||
|
@ -0,0 +1,359 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
use Cadoles\PortalBundle\Entity\Blog;
|
||||
use Cadoles\PortalBundle\Form\BlogType;
|
||||
use Cadoles\PortalBundle\Form\BlogShareType;
|
||||
use Cadoles\PortalBundle\Form\BlogWriterType;
|
||||
|
||||
class BlogController extends Controller
|
||||
{
|
||||
private $labelentity="CadolesPortalBundle:Blog";
|
||||
private $routeprimary="cadoles_portal_config_blog";
|
||||
|
||||
public function listAction()
|
||||
{
|
||||
return $this->render($this->labelentity.':list.html.twig',[
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function ajaxlistAction(Request $request,$access="config")
|
||||
{
|
||||
// S'assurer que c'est un appel ajax
|
||||
if (!$request->isXmlHttpRequest()) {
|
||||
return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$start=$request->query->get('start');
|
||||
$length= $request->query->get('length');
|
||||
$search= $request->query->get('search');
|
||||
$draw= $request->query->get('draw');
|
||||
$order= $request->query->get('order');
|
||||
|
||||
// Query de base
|
||||
$qbase=$em->createQueryBuilder()
|
||||
->from($this->labelentity,'table')
|
||||
->leftJoin('CadolesCoreBundle:User','user','WITH','table.user=user')
|
||||
->addSelect('user');
|
||||
|
||||
$qsearch=$qbase->where('table.id LIKE :value')
|
||||
->orWhere('table.name LIKE :value')
|
||||
->orWhere('user.username LIKE :value')
|
||||
->setParameter("value", "%".$search["value"]."%");
|
||||
|
||||
// Nombre total d'enregistrement
|
||||
$total = $qbase->select('COUNT(table)')->getQuery()->getSingleScalarResult();
|
||||
|
||||
// Nombre d'enregistrement filtré
|
||||
if($search["value"]=="")
|
||||
$totalf = $total;
|
||||
else {
|
||||
$totalf= $qsearch->select('COUNT(table)')->getQuery()->getSingleScalarResult();
|
||||
}
|
||||
|
||||
// Parcours des Enregistrement
|
||||
if($search["value"]=="")
|
||||
$qb = $qbase->select('table');
|
||||
else
|
||||
$qb = $qsearch->select('table');
|
||||
|
||||
// Order
|
||||
switch($order[0]["column"]) {
|
||||
case 1 :
|
||||
$qb->orderBy('table.name',$order[0]["dir"]);
|
||||
break;
|
||||
case 2 :
|
||||
$qb->orderBy('user.username',$order[0]["dir"]);
|
||||
break;
|
||||
}
|
||||
|
||||
// Execution de la requete d'affichage
|
||||
$datas=$qb->setFirstResult($start)->setMaxResults($length)->getQuery()->getResult();
|
||||
|
||||
// Construction du tableau de retour
|
||||
$output = array(
|
||||
'draw' => $draw,
|
||||
'recordsFiltered' => $totalf,
|
||||
'recordsTotal' => $total,
|
||||
'data' => array(),
|
||||
);
|
||||
|
||||
foreach($datas as $data) {
|
||||
$route=str_replace("_config_","_".$access."_",$this->routeprimary);
|
||||
$action = "";
|
||||
$action.="<a href='".$this->generateUrl($route.'_delete', array('id'=>$data->getId()))."' data-method='delete'><i class='fa fa-trash fa-fw fa-2x'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl($route.'_view', array('id'=>$data->getId()))."'><i class='fa fa-eye fa-2x'></i></a>";
|
||||
|
||||
$user="";
|
||||
if($data->getUser()) {
|
||||
$user.="<img src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getUser()->getAvatar()."' class='avatar' style='margin:0px 5px 0px 0px;display:inline-block;'>";
|
||||
$user.=$data->getUser()->getUsername();
|
||||
}
|
||||
|
||||
array_push($output["data"],array($action,$data->getName(),$user));
|
||||
}
|
||||
|
||||
// Retour
|
||||
return new Response(json_encode($output), 200);
|
||||
}
|
||||
|
||||
private function entityForm(Blog $entity,$access="config")
|
||||
{
|
||||
$route=str_replace("_config_","_".$access."_",$this->routeprimary);
|
||||
|
||||
if ($this->getDoctrine()->getManager()->contains($entity)) {
|
||||
return $this->createForm(BlogType::class, $entity, [
|
||||
"mode" => "update",
|
||||
"access" => $access
|
||||
]);
|
||||
}
|
||||
else {
|
||||
return $this->createForm(BlogType::class, $entity, [
|
||||
"mode" => "submit",
|
||||
"access" => $access
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function submitAction(Request $request,$access="config")
|
||||
{
|
||||
$entity = new Blog();
|
||||
|
||||
$form = $this->entityForm($entity,$access);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
if($access=="user") $entity->setUser($this->getUser());
|
||||
|
||||
$em->persist($entity);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blog_view',["id"=>$entity->getId()]));
|
||||
}
|
||||
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'mode' => "submit",
|
||||
'access' => $access,
|
||||
'form' => $form->createView()
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateAction(Request $request, $id,$access="config")
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Création du formulaire
|
||||
$form = $this->entityForm($entity,$access);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($entity);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blog_view',["id"=>$entity->getId()]));
|
||||
}
|
||||
|
||||
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'mode' => "update",
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function shareAction(Request $request, $id,$access="config")
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Création du formulaire
|
||||
$form = $this->createForm(BlogShareType::class, $entity, ["access" => $access, "user" => $this->getUser()]);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($entity);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blog_view',["id"=>$id]));
|
||||
}
|
||||
|
||||
|
||||
return $this->render($this->labelentity.':share.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function writerAction(Request $request, $id,$access="config")
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Création du formulaire
|
||||
$form = $this->createForm(BlogWriterType::class, $entity, ["id"=>$entity->getId(),"access" => $access, "user" => $this->getUser()]);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($entity);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blog_view',["id"=>$id]));
|
||||
}
|
||||
|
||||
|
||||
return $this->render($this->labelentity.':writer.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function deleteAction(Request $request, $id,$access="config")
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $this->getDoctrine()->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de supprimer
|
||||
if($access=="user") {
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Suppression
|
||||
$em->remove($entity);
|
||||
$em->flush();
|
||||
|
||||
// Retour
|
||||
if($access=="config")
|
||||
return $this->redirect($this->generateUrl($this->routeprimary));
|
||||
else
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blog_view'));
|
||||
}
|
||||
|
||||
public function viewAction(Request $request, $id, $access="config") {
|
||||
|
||||
$page=$request->query->get("page");
|
||||
if(is_null($page)) $page=1;
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity=[];
|
||||
if($id!=0) {
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
}
|
||||
|
||||
// Permissions
|
||||
$user=$this->getUser();
|
||||
if($access=="config") {
|
||||
$canupdate = true;
|
||||
$canadd=true;
|
||||
|
||||
$blogs=$em->getRepository($this->labelentity)->findBy(["id"=>$id]);
|
||||
$entity->setCanupdate(true);
|
||||
$entity->setCanadd(true);
|
||||
|
||||
}
|
||||
else {
|
||||
// On récupère l'ensemble des blogs de l'utilisateur
|
||||
$em->getRepository($this->labelentity)->getBlogsUser($user,$blogsuser,$blogsadmin,$blogsshared);
|
||||
$blogs=array_merge($blogsuser,$blogsadmin->toArray(),$blogsshared);
|
||||
|
||||
// permission
|
||||
if($id==0) {
|
||||
$cansee=true;
|
||||
$canadd=($this->getUser());
|
||||
}
|
||||
else {
|
||||
$em->getRepository($this->labelentity)->getPermission($user,$entity,$cansee,$canupdate,$canadd);
|
||||
}
|
||||
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$canupdate=false;
|
||||
if($user) $canupdate=true;
|
||||
}
|
||||
|
||||
$pagination=15;
|
||||
if($entity)
|
||||
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($entity,($page-1)*$pagination,$pagination,$count,$blogarticles);
|
||||
else
|
||||
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,($page-1)*$pagination,$pagination,$count,$blogarticles);
|
||||
|
||||
return $this->render($this->labelentity.':view.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'canupdate' => $canupdate,
|
||||
'canadd' => $canadd,
|
||||
'blogarticles' => $blogarticles,
|
||||
'blogs' => $blogs,
|
||||
'countarticles' => $count,
|
||||
'pagination' => $pagination,
|
||||
'page' => $page
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
use Cadoles\PortalBundle\Entity\Blogarticle;
|
||||
use Cadoles\PortalBundle\Form\BlogarticleType;
|
||||
|
||||
class BlogarticleController extends Controller
|
||||
{
|
||||
private $labelentity="CadolesPortalBundle:Blogarticle";
|
||||
private $routeprimary="cadoles_portal_config_blogarticle";
|
||||
|
||||
private function entityForm(Blogarticle $entity,$access="config")
|
||||
{
|
||||
$route=str_replace("_config_","_".$access."_",$this->routeprimary);
|
||||
|
||||
if ($this->getDoctrine()->getManager()->contains($entity)) {
|
||||
return $this->createForm(BlogarticleType::class, $entity, [
|
||||
"mode" => "update",
|
||||
"access" => $access,
|
||||
"user" => $this->getUser()
|
||||
]);
|
||||
}
|
||||
else {
|
||||
return $this->createForm(BlogarticleType::class, $entity, [
|
||||
"mode" => "submit",
|
||||
"access" => $access,
|
||||
"user" => $this->getUser()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function submitAction(Request $request,$idblog,$access="config")
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = new Blogarticle();
|
||||
$blog=$em->getRepository("CadolesPortalBundle:Blog")->find($idblog);
|
||||
if($blog) $entity->setBlog($blog);
|
||||
|
||||
$form = $this->entityForm($entity,$access);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
$entity->setUser($this->getUser());
|
||||
$entity->setSubmit(new \Datetime());
|
||||
$entity->setFgdraft(true);
|
||||
|
||||
$em->persist($entity);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]));
|
||||
}
|
||||
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'mode' => "submit",
|
||||
'access' => $access,
|
||||
'form' => $form->createView()
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateAction(Request $request, $id,$access="config")
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de modifier
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlog(),$cansee,$canupdate,$canadd);
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Création du formulaire
|
||||
$form = $this->entityForm($entity,$access);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($entity);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]));
|
||||
}
|
||||
|
||||
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'mode' => "update",
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function deleteAction(Request $request, $id,$access="config")
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $this->getDoctrine()->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
|
||||
$idblog=$entity->getBlog()->getId();
|
||||
|
||||
// On s'assure que l'utilisateur à la permission de supprimer
|
||||
if($access=="user") {
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlog(),$cansee,$canupdate,$canadd);
|
||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
// Suppression
|
||||
$em->remove($entity);
|
||||
$em->flush();
|
||||
|
||||
// Retour
|
||||
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blog_view',["id"=>$idblog]));
|
||||
}
|
||||
|
||||
public function viewAction($id, Request $request, $access="config")
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||
|
||||
// Permissions
|
||||
$user=$this->getUser();
|
||||
if($access=="config") {
|
||||
$canupdate = true;
|
||||
$canadd=true;
|
||||
|
||||
$blogs=$em->getRepository("CadolesPortalBundle:Blog")->findBy(["id"=>$entity->getBlog()->getId()]);
|
||||
}
|
||||
else {
|
||||
// On récupère l'ensemble des blogs de l'utilisateur
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getBlogsUser($user,$blogsuser,$blogsadmin,$blogsshared);
|
||||
$blogs=array_merge($blogsuser,$blogsadmin->toArray(),$blogsshared);
|
||||
|
||||
// permission
|
||||
if($id==0) {
|
||||
$cansee=true;
|
||||
$canadd=true;
|
||||
}
|
||||
else {
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($user,$entity->getBlog(),$cansee,$canupdate,$canadd);
|
||||
}
|
||||
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
|
||||
$canupdate=false;
|
||||
if($user) $canupdate=true;
|
||||
}
|
||||
|
||||
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,0,10,$count,$blogarticles);
|
||||
|
||||
return $this->render($this->labelentity.':view.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'canupdate' => $canupdate,
|
||||
'canadd' => $canadd,
|
||||
'blogs' => $blogs,
|
||||
'blogarticles' => $blogarticles
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function uploadAction(Request $request,$access=null) {
|
||||
// Fichier temporaire uploadé
|
||||
$tmpfile = $request->files->get('upload');
|
||||
$extention = $tmpfile->getClientOriginalExtension();
|
||||
|
||||
// Répertoire de Destination
|
||||
$fs = new Filesystem();
|
||||
$rootdir = $this->get('kernel')->getRootDir()."/../web";
|
||||
$fs->mkdir($rootdir."/uploads/ckeditor");
|
||||
|
||||
// Fichier cible
|
||||
$targetName = uniqid().".".$extention;
|
||||
$targetFile = $rootdir."/uploads/ckeditor/".$targetName;
|
||||
$targetUrl = "/".$this->getParameter('alias')."/uploads/ckeditor/".$targetName;
|
||||
$message = "";
|
||||
|
||||
move_uploaded_file($tmpfile,$targetFile);
|
||||
|
||||
$funcNum = $request->query->get('CKEditorFuncNum');
|
||||
$response = "<script type='text/javascript'>\n";
|
||||
$response.= "window.parent.CKEDITOR.tools.callFunction($funcNum, '$targetUrl', '$message');\n";
|
||||
$response.= "</script>";
|
||||
|
||||
return new Response($response);
|
||||
|
||||
}
|
||||
|
||||
public function imageAction($access="config")
|
||||
{
|
||||
return $this->render('CadolesPortalBundle:Blogarticle:image.html.twig',[
|
||||
'useheader' => false,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => false,
|
||||
'access' => $access
|
||||
]);
|
||||
}
|
||||
}
|
@ -42,9 +42,14 @@ class CalendarController extends Controller
|
||||
$order= $request->query->get('order');
|
||||
|
||||
// Query de base
|
||||
$qbase=$em->createQueryBuilder()->from($this->labelentity,'table');
|
||||
$qbase=$em->createQueryBuilder()
|
||||
->from($this->labelentity,'table')
|
||||
->leftJoin('CadolesCoreBundle:User','user','WITH','table.user=user')
|
||||
->addSelect('user');
|
||||
|
||||
$qsearch=$qbase->where('table.id LIKE :value')
|
||||
->orWhere('table.name LIKE :value')
|
||||
->orWhere('user.username LIKE :value')
|
||||
->setParameter("value", "%".$search["value"]."%");
|
||||
|
||||
// Nombre total d'enregistrement
|
||||
@ -68,6 +73,9 @@ class CalendarController extends Controller
|
||||
case 1 :
|
||||
$qb->orderBy('table.name',$order[0]["dir"]);
|
||||
break;
|
||||
case 2 :
|
||||
$qb->orderBy('user.username',$order[0]["dir"]);
|
||||
break;
|
||||
}
|
||||
|
||||
// Execution de la requete d'affichage
|
||||
@ -80,14 +88,20 @@ class CalendarController extends Controller
|
||||
'recordsTotal' => $total,
|
||||
'data' => array(),
|
||||
);
|
||||
|
||||
foreach($datas as $data) {
|
||||
$route=str_replace("_config_","_".$access."_",$this->routeprimary);
|
||||
$action = "";
|
||||
//$action.="<a href='".$this->generateUrl($route.'_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-fw'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl($route.'_delete', array('id'=>$data->getId()))."' data-method='delete'><i class='fa fa-trash fa-fw'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl($route.'_view', array('id'=>$data->getId()))."'><i class='fa fa-eye'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl($route.'_delete', array('id'=>$data->getId()))."' data-method='delete'><i class='fa fa-trash fa-fw fa-2x'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl($route.'_view', array('id'=>$data->getId()))."'><i class='fa fa-eye fa-2x'></i></a>";
|
||||
|
||||
array_push($output["data"],array($action,$data->getName()));
|
||||
$user="";
|
||||
if($data->getUser()) {
|
||||
$user.="<img src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getUser()->getAvatar()."' class='avatar' style='margin:0px 5px 0px 0px;display:inline-block;'>";
|
||||
$user.=$data->getUser()->getUsername();
|
||||
}
|
||||
|
||||
array_push($output["data"],array($action,$data->getName(),$user));
|
||||
}
|
||||
|
||||
// Retour
|
||||
@ -135,7 +149,7 @@ class CalendarController extends Controller
|
||||
}
|
||||
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
'useheader' => true,
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
@ -172,7 +186,7 @@ class CalendarController extends Controller
|
||||
|
||||
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
'useheader' => true,
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
@ -209,7 +223,7 @@ class CalendarController extends Controller
|
||||
|
||||
|
||||
return $this->render($this->labelentity.':share.html.twig', [
|
||||
'useheader' => true,
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
@ -285,9 +299,10 @@ class CalendarController extends Controller
|
||||
}
|
||||
|
||||
return $this->render($this->labelentity.':view.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => ($access=="user"),
|
||||
'usesidebar' => ($access=="config"),
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'canupdate' => $canupdate,
|
||||
|
@ -243,7 +243,7 @@ class CalendareventController extends Controller
|
||||
|
||||
|
||||
return $this->render($this->labelentity.':share.html.twig', [
|
||||
'useheader' => true,
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
|
@ -6,9 +6,11 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
use Cadoles\PortalBundle\Entity\Page;
|
||||
use Cadoles\PortalBundle\Form\PageSubmitType;
|
||||
use Cadoles\PortalBundle\Form\PageUpdateToolType;
|
||||
use Cadoles\PortalBundle\Form\PageUpdateURLType;
|
||||
use Cadoles\PortalBundle\Form\PageUpdateWidgetType;
|
||||
use Cadoles\PortalBundle\Form\PageUpdateEditorType;
|
||||
@ -30,11 +32,12 @@ class PageController extends Controller
|
||||
|
||||
public function ajaxlistAction(Request $request,$access="config")
|
||||
{
|
||||
/*
|
||||
// S'assurer que c'est un appel ajax
|
||||
if (!$request->isXmlHttpRequest()) {
|
||||
return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||
}
|
||||
|
||||
*/
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$start=$request->query->get('start');
|
||||
@ -42,15 +45,28 @@ class PageController extends Controller
|
||||
$search= $request->query->get('search');
|
||||
$draw= $request->query->get('draw');
|
||||
$order= $request->query->get('order');
|
||||
|
||||
$alluser= $request->query->get('alluser');
|
||||
|
||||
// Query de base
|
||||
$qbase=$em->createQueryBuilder()->from($this->labelentity,'table');
|
||||
|
||||
if($alluser=="false") {
|
||||
dump("pouet");
|
||||
$qbase->where('table.user IS NOT NULL');
|
||||
}
|
||||
else
|
||||
$qbase->from('CadolesCoreBundle:User','user')
|
||||
->where("table.user=user");
|
||||
|
||||
$qsearch=$qbase->where('table.id LIKE :value')
|
||||
->orWhere('table.name LIKE :value')
|
||||
->setParameter("value", "%".$search["value"]."%");
|
||||
|
||||
if($alluser=="true") $qsearch->orWhere('user.username LIKE :value') ;
|
||||
|
||||
// Nombre total d'enregistrement
|
||||
$total = $qbase->select('COUNT(table)')->getQuery()->getSingleScalarResult();
|
||||
|
||||
|
||||
// Nombre d'enregistrement filtré
|
||||
if($search["value"]=="")
|
||||
@ -73,10 +89,14 @@ class PageController extends Controller
|
||||
case 2 :
|
||||
$qb->orderBy('table.name',$order[0]["dir"]);
|
||||
break;
|
||||
case 4 :
|
||||
//$qb->orderBy('user.username',$order[0]["dir"]);
|
||||
break;
|
||||
}
|
||||
|
||||
// Execution de la requete d'affichage
|
||||
$datas=$qb->setFirstResult($start)->setMaxResults($length)->getQuery()->getResult();
|
||||
dump($datas);
|
||||
|
||||
// Construction du tableau de retour
|
||||
$output = array(
|
||||
@ -86,13 +106,26 @@ class PageController extends Controller
|
||||
'data' => array(),
|
||||
);
|
||||
foreach($datas as $data) {
|
||||
|
||||
$route=str_replace("_config_","_".$access."_",$this->routeprimary);
|
||||
$action = "";
|
||||
//$action.="<a href='".$this->generateUrl($route.'_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-fw'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl($route.'_delete', array('id'=>$data->getId()))."' data-method='delete'><i class='fa fa-trash fa-fw'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl($route.'_view', array('id'=>$data->getId()))."'><i class='fa fa-eye'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl($route.'_delete', array('id'=>$data->getId()))."' data-method='delete'><i class='fa fa-trash fa-fw fa-2x'></i></a>";
|
||||
$action.="<a href='".$this->generateUrl($route.'_view', array('id'=>$data->getId()))."'><i class='fa fa-eye fa-2x'></i></a>";
|
||||
|
||||
array_push($output["data"],array($action,$data->getRoworder(),$data->getName(),$data->getPagecategory()->getName()));
|
||||
$user="";
|
||||
if($data->getUser()) {
|
||||
$user.="<img src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getUser()->getAvatar()."' class='avatar' style='margin:0px 5px 0px 0px;display:inline-block;'>";
|
||||
$user.=$data->getUser()->getUsername();
|
||||
}
|
||||
|
||||
array_push($output["data"],[
|
||||
$action,
|
||||
$data->getRoworder(),
|
||||
$data->getName(),
|
||||
$data->getPagecategory()->getName(),
|
||||
$user
|
||||
]);
|
||||
}
|
||||
|
||||
// Retour
|
||||
@ -104,6 +137,14 @@ class PageController extends Controller
|
||||
$route=str_replace("_config_","_".$access."_",$this->routeprimary);
|
||||
|
||||
if ($this->getDoctrine()->getManager()->contains($entity)) {
|
||||
// Type Tools
|
||||
if($entity->getPagecategory()->getId()<0 ) {
|
||||
return $this->createForm(PageUpdateToolType::class, $entity, [
|
||||
"mode" => "update",
|
||||
"access" => $access
|
||||
]);
|
||||
}
|
||||
|
||||
// Type URL
|
||||
if($entity->getPagecategory()->getId()==1 ) {
|
||||
return $this->createForm(PageUpdateURLType::class, $entity, [
|
||||
@ -157,7 +198,8 @@ class PageController extends Controller
|
||||
return $this->render($this->labelentity.':submit.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'mode' => "submit",
|
||||
'access' => $access,
|
||||
@ -192,13 +234,27 @@ class PageController extends Controller
|
||||
return $this->redirect($this->generateUrl('cadoles_core_home',["id"=>$id]));
|
||||
}
|
||||
|
||||
// Type Tool
|
||||
if($entity->getPagecategory()->getId()<0 ) {
|
||||
return $this->render($this->labelentity.':updatetool.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'mode' => "update",
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
// Type URL
|
||||
if($entity->getPagecategory()->getId()==1 ) {
|
||||
return $this->render($this->labelentity.':updateurl.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'mode' => "update",
|
||||
@ -210,7 +266,8 @@ class PageController extends Controller
|
||||
return $this->render($this->labelentity.':updatewidget.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'mode' => "update",
|
||||
@ -222,7 +279,8 @@ class PageController extends Controller
|
||||
return $this->render($this->labelentity.':updateeditor.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'mode' => "update",
|
||||
@ -336,7 +394,32 @@ class PageController extends Controller
|
||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||
}
|
||||
|
||||
|
||||
// Type Calendrier
|
||||
if($entity->getPageCategory()->getId()==-100) {
|
||||
$entity->setUrl($this->generateUrl('cadoles_portal_user_calendar_view'));
|
||||
return $this->render($this->labelentity.':viewurl.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'canupdate' => $canupdate
|
||||
]);
|
||||
}
|
||||
|
||||
// Type Blob
|
||||
if($entity->getPageCategory()->getId()==-90) {
|
||||
$entity->setUrl($this->generateUrl('cadoles_portal_user_blog_view'));
|
||||
return $this->render($this->labelentity.':viewurl.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'entity' => $entity,
|
||||
'access' => $access,
|
||||
'canupdate' => $canupdate
|
||||
]);
|
||||
}
|
||||
|
||||
// Type URL
|
||||
if($entity->getPageCategory()->getId()==1) {
|
||||
@ -376,12 +459,29 @@ class PageController extends Controller
|
||||
}
|
||||
|
||||
public function uploadAction(Request $request,$access=null) {
|
||||
//dump($request);
|
||||
$file = $request->files->get('files');
|
||||
// Fichier temporaire uploadé
|
||||
$tmpfile = $request->files->get('upload');
|
||||
$extention = $tmpfile->getClientOriginalExtension();
|
||||
|
||||
// Répertoire de Destination
|
||||
$fs = new Filesystem();
|
||||
$rootdir = $this->get('kernel')->getRootDir()."/../web";
|
||||
$fs->mkdir($rootdir."/uploads/ckeditor");
|
||||
|
||||
$tmpfile=$request->files->get('upload');
|
||||
//$tmpfile->move
|
||||
return new Response($tmpfile);
|
||||
// Fichier cible
|
||||
$targetName = uniqid().".".$extention;
|
||||
$targetFile = $rootdir."/uploads/ckeditor/".$targetName;
|
||||
$targetUrl = "/".$this->getParameter('alias')."/uploads/ckeditor/".$targetName;
|
||||
$message = "";
|
||||
|
||||
move_uploaded_file($tmpfile,$targetFile);
|
||||
|
||||
$funcNum = $request->query->get('CKEditorFuncNum');
|
||||
$response = "<script type='text/javascript'>\n";
|
||||
$response.= "window.parent.CKEDITOR.tools.callFunction($funcNum, '$targetUrl', '$message');\n";
|
||||
$response.= "</script>";
|
||||
|
||||
return new Response($response);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ class PagewidgetController extends Controller
|
||||
return $this->createForm(PagewidgetType::class, $entity, [
|
||||
'param' => $params,
|
||||
'mode' => "update",
|
||||
'access' => $access,
|
||||
'idicon' => $entity->getIcon()->getId(),
|
||||
'method' => 'POST',
|
||||
]);
|
||||
@ -72,6 +73,7 @@ class PagewidgetController extends Controller
|
||||
return $this->createForm(PagewidgetType::class, $entity, [
|
||||
'param' => $param,
|
||||
'mode' => "submit",
|
||||
'access' => $access,
|
||||
'idicon' => $widgettype->getIcon()->getId(),
|
||||
'method' => 'POST',
|
||||
]);
|
||||
@ -131,7 +133,8 @@ class PagewidgetController extends Controller
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'icons' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findAll(),
|
||||
'mode' => "submit",
|
||||
@ -191,7 +194,8 @@ class PagewidgetController extends Controller
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $entity,
|
||||
'icons' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findAll(),
|
||||
'mode' => "update",
|
||||
@ -256,6 +260,33 @@ class PagewidgetController extends Controller
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function uploadAction(Request $request,$access=null) {
|
||||
// Fichier temporaire uploadé
|
||||
$tmpfile = $request->files->get('upload');
|
||||
$extention = $tmpfile->getClientOriginalExtension();
|
||||
|
||||
// Répertoire de Destination
|
||||
$fs = new Filesystem();
|
||||
$rootdir = $this->get('kernel')->getRootDir()."/../web";
|
||||
$fs->mkdir($rootdir."/uploads/ckeditor");
|
||||
|
||||
// Fichier cible
|
||||
$targetName = uniqid().".".$extention;
|
||||
$targetFile = $rootdir."/uploads/ckeditor/".$targetName;
|
||||
$targetUrl = "/".$this->getParameter('alias')."/uploads/ckeditor/".$targetName;
|
||||
$message = "";
|
||||
|
||||
move_uploaded_file($tmpfile,$targetFile);
|
||||
|
||||
$funcNum = $request->query->get('CKEditorFuncNum');
|
||||
$response = "<script type='text/javascript'>\n";
|
||||
$response.= "window.parent.CKEDITOR.tools.callFunction($funcNum, '$targetUrl', '$message');\n";
|
||||
$response.= "</script>";
|
||||
|
||||
return new Response($response);
|
||||
|
||||
}
|
||||
|
||||
public function viewurlAction($id,$access="config") {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
@ -1028,6 +1059,91 @@ class PagewidgetController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewblogAction($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');
|
||||
}
|
||||
|
||||
// Parametres
|
||||
$nbarticle=10;
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "nbarticle":
|
||||
$nbarticle=$parameter["value"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// On récupère l'ensemble des blogs de l'utilisateur
|
||||
$em->getRepository("CadolesPortalBundle:Blog")->getBlogsUser($this->getUser(),$blogsuser,$blogsadmin,$blogsshared);
|
||||
$blogs=array_merge($blogsuser,$blogsadmin->toArray(),$blogsshared);
|
||||
|
||||
// On récupère les nbarticle de ses blogs
|
||||
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,0,$nbarticle,$count,$blogarticles);
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewblog.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
'blogarticles' => $blogarticles,
|
||||
'nbarticle' => $nbarticle,
|
||||
'access' => $access,
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewseparatorAction($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');
|
||||
}
|
||||
|
||||
// Parametres
|
||||
$seetitle=false;
|
||||
$seeicon=false;
|
||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||
switch($parameter["id"]) {
|
||||
case "seetitle":
|
||||
$seetitle=boolval($parameter["value"]);
|
||||
break;
|
||||
case "seeicon":
|
||||
$seeicon=boolval($parameter["value"]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Render
|
||||
return $this->render($this->labelentity.':viewseparator.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
'seetitle' => $seetitle,
|
||||
'seeicon' => $seeicon,
|
||||
'access' => $access,
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewclockAction($id,$access="config") {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
|
@ -38,7 +38,8 @@ class SlideController extends Controller
|
||||
return $this->render($this->labelentity.':list.html.twig',[
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'access' => $access,
|
||||
'idpage' => $idpage,
|
||||
'idwidget' => $idwidget,
|
||||
@ -88,7 +89,8 @@ class SlideController extends Controller
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $data,
|
||||
'mode' => "submit",
|
||||
'access' => $access,
|
||||
@ -139,7 +141,8 @@ class SlideController extends Controller
|
||||
return $this->render($this->labelentity.':edit.html.twig', [
|
||||
'useheader' => ($access=="config"),
|
||||
'usemenu' => false,
|
||||
'usesidebar' => ($access=="config"),
|
||||
'usesidebar' => ($access=="config"),
|
||||
'maxwidth' => ($access=="user"),
|
||||
'entity' => $data,
|
||||
'mode' => "update",
|
||||
'access' => $access,
|
||||
|
292
src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Blog.php
Normal file
@ -0,0 +1,292 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Blog
|
||||
*
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="blog")
|
||||
* @ORM\Entity(repositoryClass="Cadoles\PortalBundle\Repository\BlogRepository")
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
class Blog
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="name", type="string", length=100)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="roles", type="array", nullable=true)
|
||||
*/
|
||||
private $roles;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Cadoles\CoreBundle\Entity\Group", inversedBy="blogs", cascade={"persist"})
|
||||
* @ORM\JoinTable(name="bloggroupe",
|
||||
* joinColumns={@ORM\JoinColumn(name="blog", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="groupe", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
protected $groups;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Cadoles\CoreBundle\Entity\User", inversedBy="blogs")
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Cadoles\CoreBundle\Entity\User", inversedBy="blogwriters", cascade={"persist"})
|
||||
* @ORM\JoinTable(name="blogwriter",
|
||||
* joinColumns={@ORM\JoinColumn(name="blog", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="user", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
protected $writers;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $blogarticle
|
||||
* @var Blogarticle
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="Cadoles\PortalBundle\Entity\Blogarticle", mappedBy="blog", cascade={"persist"}, orphanRemoval=true)
|
||||
*/
|
||||
private $blogarticles;
|
||||
|
||||
|
||||
/* champs calculé non stocké en base */
|
||||
private $canupdate;
|
||||
public function getCanupdate()
|
||||
{
|
||||
return $this->canupdate;
|
||||
}
|
||||
public function setCanupdate($canupdate)
|
||||
{
|
||||
$this->canupdate = $canupdate;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/* champs calculé non stocké en base */
|
||||
private $canadd;
|
||||
public function getCanadd()
|
||||
{
|
||||
return $this->canadd;
|
||||
}
|
||||
public function setCanadd($canadd)
|
||||
{
|
||||
$this->canadd = $canadd;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->groups = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->writers = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->blogarticles = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set name
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return Blog
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set roles
|
||||
*
|
||||
* @param array $roles
|
||||
*
|
||||
* @return Blog
|
||||
*/
|
||||
public function setRoles($roles)
|
||||
{
|
||||
$this->roles = $roles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get roles
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getRoles()
|
||||
{
|
||||
return $this->roles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add group
|
||||
*
|
||||
* @param \Cadoles\CoreBundle\Entity\Group $group
|
||||
*
|
||||
* @return Blog
|
||||
*/
|
||||
public function addGroup(\Cadoles\CoreBundle\Entity\Group $group)
|
||||
{
|
||||
$this->groups[] = $group;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove group
|
||||
*
|
||||
* @param \Cadoles\CoreBundle\Entity\Group $group
|
||||
*/
|
||||
public function removeGroup(\Cadoles\CoreBundle\Entity\Group $group)
|
||||
{
|
||||
$this->groups->removeElement($group);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get groups
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getGroups()
|
||||
{
|
||||
return $this->groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set user
|
||||
*
|
||||
* @param \Cadoles\CoreBundle\Entity\User $user
|
||||
*
|
||||
* @return Blog
|
||||
*/
|
||||
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 writer
|
||||
*
|
||||
* @param \Cadoles\CoreBundle\Entity\User $writer
|
||||
*
|
||||
* @return Blog
|
||||
*/
|
||||
public function addWriter(\Cadoles\CoreBundle\Entity\User $writer)
|
||||
{
|
||||
$this->writers[] = $writer;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove writer
|
||||
*
|
||||
* @param \Cadoles\CoreBundle\Entity\User $writer
|
||||
*/
|
||||
public function removeWriter(\Cadoles\CoreBundle\Entity\User $writer)
|
||||
{
|
||||
$this->writers->removeElement($writer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get writers
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getWriters()
|
||||
{
|
||||
return $this->writers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add blogarticle
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\Blogarticle $blogarticle
|
||||
*
|
||||
* @return Blog
|
||||
*/
|
||||
public function addBlogarticle(\Cadoles\PortalBundle\Entity\Blogarticle $blogarticle)
|
||||
{
|
||||
$this->blogarticles[] = $blogarticle;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove blogarticle
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\Blogarticle $blogarticle
|
||||
*/
|
||||
public function removeBlogarticle(\Cadoles\PortalBundle\Entity\Blogarticle $blogarticle)
|
||||
{
|
||||
$this->blogarticles->removeElement($blogarticle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get blogarticles
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getBlogarticles()
|
||||
{
|
||||
return $this->blogarticles;
|
||||
}
|
||||
}
|
@ -0,0 +1,251 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Blogarticle
|
||||
*
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="blogarticle")
|
||||
* @ORM\Entity(repositoryClass="Cadoles\PortalBundle\Repository\BlogarticleRepository")
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
class Blogarticle
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="name", type="string", length=100)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="description", type="text", nullable=true)
|
||||
*/
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="submit", type="datetime")
|
||||
*/
|
||||
private $submit;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="fgdraft", type="boolean")
|
||||
*/
|
||||
private $fgdraft;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="image", type="string", length=100, nullable=true)
|
||||
*/
|
||||
private $image;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Cadoles\CoreBundle\Entity\User", inversedBy="blogarticles")
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Cadoles\PortalBundle\Entity\Blog", inversedBy="blogarticles")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
private $blog;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set name
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return Blogarticle
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set description
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return Blogarticle
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set submit
|
||||
*
|
||||
* @param \DateTime $submit
|
||||
*
|
||||
* @return Blogarticle
|
||||
*/
|
||||
public function setSubmit($submit)
|
||||
{
|
||||
$this->submit = $submit;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get submit
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getSubmit()
|
||||
{
|
||||
return $this->submit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set fgdraft
|
||||
*
|
||||
* @param boolean $fgdraft
|
||||
*
|
||||
* @return Blogarticle
|
||||
*/
|
||||
public function setFgdraft($fgdraft)
|
||||
{
|
||||
$this->fgdraft = $fgdraft;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fgdraft
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFgdraft()
|
||||
{
|
||||
return $this->fgdraft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set image
|
||||
*
|
||||
* @param string $image
|
||||
*
|
||||
* @return Blogarticle
|
||||
*/
|
||||
public function setImage($image)
|
||||
{
|
||||
$this->image = $image;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get image
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getImage()
|
||||
{
|
||||
return $this->image;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set user
|
||||
*
|
||||
* @param \Cadoles\CoreBundle\Entity\User $user
|
||||
*
|
||||
* @return Blogarticle
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set blog
|
||||
*
|
||||
* @param \Cadoles\PortalBundle\Entity\blog $blog
|
||||
*
|
||||
* @return Blogarticle
|
||||
*/
|
||||
public function setBlog(\Cadoles\PortalBundle\Entity\blog $blog)
|
||||
{
|
||||
$this->blog = $blog;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get blog
|
||||
*
|
||||
* @return \Cadoles\PortalBundle\Entity\blog
|
||||
*/
|
||||
public function getBlog()
|
||||
{
|
||||
return $this->blog;
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
|
||||
class BlogShareType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$user=$options['user'];
|
||||
|
||||
$builder
|
||||
->add('submit', SubmitType::class, [
|
||||
"label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Valider"),
|
||||
"attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success"))
|
||||
])
|
||||
|
||||
->add('groups', EntityType::class, [
|
||||
'label' => 'Partager avec les Groupes',
|
||||
'class' => 'CadolesCoreBundle:Group',
|
||||
'query_builder' => function(EntityRepository $er) use ($user) {
|
||||
return $er->createQueryBuilder('g')
|
||||
->select('g')
|
||||
->From('CadolesCoreBundle:UserGroup','ug')
|
||||
->where('g.fgcanshare=:fgcanshare')
|
||||
->andWhere('g=ug.group')
|
||||
->andWhere('ug.user=:user')
|
||||
->setParameter('fgcanshare',true)
|
||||
->setParameter('user',$user);
|
||||
},
|
||||
'choice_label' => 'label',
|
||||
'multiple' => true,
|
||||
'expanded' => true
|
||||
]);
|
||||
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Cadoles\PortalBundle\Entity\Blog',
|
||||
'mode' => 'string',
|
||||
'access' => 'string',
|
||||
'user' => 'Cadoles\CoreBundle\Entity\User'
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class BlogType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('submit', SubmitType::class, [
|
||||
"label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Valider"),
|
||||
"attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success"))
|
||||
])
|
||||
|
||||
->add('name', TextType::class, [
|
||||
'label' => 'Nom'
|
||||
]);
|
||||
|
||||
if($options["access"]=="config") {
|
||||
$builder
|
||||
->add('roles', ChoiceType::class, [
|
||||
"label" => 'Visible pour les Rôles',
|
||||
"choices" => [
|
||||
"Visiteur" => 'ROLE_ANONYME',
|
||||
"Utilisateur" => 'ROLE_USER',
|
||||
"Modérateur" => 'ROLE_MODO',
|
||||
"Administateur" => 'ROLE_ADMIN',
|
||||
],
|
||||
"multiple" => true,
|
||||
"expanded" => true,
|
||||
"disabled" => ($options["mode"]=="delete"?true:false),
|
||||
])
|
||||
|
||||
->add('groups', EntityType::class, [
|
||||
"label" => 'Visible pour les Groupes',
|
||||
"class" => 'CadolesCoreBundle:Group',
|
||||
"choice_label" => 'label',
|
||||
"multiple" => true,
|
||||
"expanded" => true,
|
||||
"disabled" => ($options["mode"]=="delete"?true:false),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Cadoles\PortalBundle\Entity\Blog',
|
||||
'mode' => 'string',
|
||||
'access' => 'string'
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
|
||||
class BlogWriterType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$id=$options['id'];
|
||||
$access=$options['access'];
|
||||
|
||||
$builder
|
||||
->add('submit', SubmitType::class, [
|
||||
"label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Valider"),
|
||||
"attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success"))
|
||||
])
|
||||
|
||||
->add('writers', EntityType::class, [
|
||||
'label' => 'Donner permissions en écritures à',
|
||||
'class' => 'CadolesCoreBundle:User',
|
||||
'query_builder' => function(EntityRepository $er) use ($id,$access) {
|
||||
$qb= $er->createQueryBuilder('user');
|
||||
if($access=="config")
|
||||
return $qb->select('user')
|
||||
|
||||
->from('CadolesPortalBundle:Blog','blog')
|
||||
->where('blog.id=:blog')
|
||||
|
||||
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||
->andwhere("usergroup.group MEMBER OF blog.groups AND usergroup.user=user")
|
||||
->orwhere($qb->expr()->like('blog.roles', $qb->expr()->concat($qb->expr()->literal('%'),$qb->expr()->concat('user.role',$qb->expr()->literal('%')))))
|
||||
|
||||
->setParameter('blog',$id);
|
||||
else
|
||||
return $qb->select('user')
|
||||
|
||||
->from('CadolesPortalBundle:Blog','blog')
|
||||
->andwhere('blog.id=:blog')
|
||||
|
||||
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||
->andwhere("usergroup.group MEMBER OF blog.groups")
|
||||
->andwhere("usergroup.user=user")
|
||||
|
||||
->setParameter('blog',$id);
|
||||
},
|
||||
'choice_label' => 'username',
|
||||
'multiple' => true,
|
||||
'expanded' => true
|
||||
]);
|
||||
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Cadoles\PortalBundle\Entity\Blog',
|
||||
'id' => 'integer',
|
||||
'mode' => 'string',
|
||||
'access' => 'string',
|
||||
'user' => 'Cadoles\CoreBundle\Entity\User'
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Ivory\CKEditorBundle\Form\Type\CKEditorType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
|
||||
class BlogarticleType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$user=$options['user'];
|
||||
|
||||
$builder
|
||||
->add('submit', SubmitType::class, [
|
||||
"label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Valider"),
|
||||
"attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success"))
|
||||
])
|
||||
|
||||
->add('name', TextType::class, [
|
||||
'label' => 'Titre'
|
||||
])
|
||||
|
||||
->add("description",CKEditorType::class,[
|
||||
"config_name" => 'full_config',
|
||||
"label" => 'Description',
|
||||
"required" => false,
|
||||
"disabled" => ($options["mode"]=="delete"?true:false),
|
||||
"config" => ["height" => "500px",'filebrowserUploadRoute' => 'cadoles_portal_'.$options["access"].'_blogarticle_upload']
|
||||
])
|
||||
|
||||
->add('image',HiddenType::class, [
|
||||
"label" =>"image",
|
||||
"disabled" => ($options["mode"]=="delete"?true:false)
|
||||
]);
|
||||
|
||||
if($options["access"]=="config") {
|
||||
$builder
|
||||
->add('blog', EntityType::class, [
|
||||
"label" => 'Blog associé',
|
||||
"class" => 'CadolesPortalBundle:Blog',
|
||||
"choice_label" => 'name',
|
||||
"disabled" => ($options["mode"]=="delete"?true:false),
|
||||
]);
|
||||
}
|
||||
else {
|
||||
$builder
|
||||
->add('blog', EntityType::class, [
|
||||
'label' => 'Blog associé',
|
||||
'class' => 'CadolesPortalBundle:Blog',
|
||||
'choice_label' => 'name',
|
||||
'placeholder' => '-- Sélectionnez un Blog --',
|
||||
'query_builder' => function(EntityRepository $er) use ($user) {
|
||||
$qb=$er->createQueryBuilder('blog');
|
||||
return $qb->select('blog')
|
||||
->andwhere(':user MEMBER OF blog.writers')
|
||||
|
||||
->from('CadolesCoreBundle:User','user')
|
||||
->andwhere("user=:user")
|
||||
|
||||
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||
->andwhere('usergroup.group MEMBER OF blog.groups AND usergroup.user=:user')
|
||||
->orwhere($qb->expr()->like('blog.roles', $qb->expr()->concat($qb->expr()->literal('%'),$qb->expr()->concat('user.role',$qb->expr()->literal('%')))))
|
||||
->orwhere('blog.user=:user')
|
||||
|
||||
->setparameter('user',$user);
|
||||
},
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Cadoles\PortalBundle\Entity\Blogarticle',
|
||||
'mode' => 'string',
|
||||
'access' => 'string',
|
||||
'user' => 'Cadoles\CoreBundle\Entity\User'
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PageUpdateToolType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('submit',SubmitType::class, [
|
||||
"label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Valider"),
|
||||
"attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success"))
|
||||
])
|
||||
|
||||
->add('name', TextType::class, [
|
||||
'label' => 'Nom'
|
||||
])
|
||||
|
||||
->add('roworder', IntegerType::class, [
|
||||
'label' => 'Ordre',
|
||||
]);
|
||||
|
||||
if($options["access"]=="config") {
|
||||
$builder
|
||||
->add('roles', ChoiceType::class, [
|
||||
"label" => 'Visible pour les Rôles',
|
||||
"choices" => [
|
||||
"Visiteur" => 'ROLE_ANONYME',
|
||||
"Utilisateur" => 'ROLE_USER',
|
||||
"Modérateur" => 'ROLE_MODO',
|
||||
"Administateur" => 'ROLE_ADMIN',
|
||||
],
|
||||
"multiple" => true,
|
||||
"expanded" => true,
|
||||
"disabled" => ($options["mode"]=="delete"?true:false),
|
||||
])
|
||||
|
||||
->add('groups', EntityType::class, [
|
||||
'label' => 'Visible pour les Groupes',
|
||||
'class' => 'CadolesCoreBundle:Group',
|
||||
'choice_label' => 'label',
|
||||
'multiple' => true,
|
||||
'expanded' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Cadoles\PortalBundle\Entity\Page',
|
||||
'access' => 'string',
|
||||
'mode' => 'string'
|
||||
]);
|
||||
}
|
||||
}
|
@ -94,6 +94,18 @@ class PagewidgetType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
elseif($field->type=="boolean") {
|
||||
$builder
|
||||
->add($field->id, ChoiceType::class, [
|
||||
'label' => $field->label,
|
||||
'mapped'=> false,
|
||||
'label_attr' => ['loc' => $field->loc],
|
||||
'data' => $field->value,
|
||||
'required' => ($field->mandatory=="true"),
|
||||
'choices' => array("Non" => 0,"Oui" => 1)
|
||||
]) ;
|
||||
}
|
||||
|
||||
elseif($field->type=="desktopmode") {
|
||||
$builder
|
||||
->add($field->id, ChoiceType::class, [
|
||||
@ -179,6 +191,7 @@ class PagewidgetType extends AbstractType
|
||||
'label_attr' => ['loc' => $field->loc],
|
||||
'data' => $field->value,
|
||||
'required' => ($field->mandatory=="true"),
|
||||
'config' => ['filebrowserUploadRoute' => 'cadoles_portal_'.$options["access"].'_pagewidget_upload']
|
||||
]);
|
||||
}
|
||||
|
||||
@ -202,6 +215,7 @@ class PagewidgetType extends AbstractType
|
||||
'data_class' => 'Cadoles\PortalBundle\Entity\Pagewidget',
|
||||
'param' => 'string',
|
||||
'mode' => 'string',
|
||||
'access' => 'string',
|
||||
'idicon' => 'string'
|
||||
]);
|
||||
}
|
||||
|
@ -0,0 +1,197 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Repository;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Cadoles\PortalBundle\Entity\Page;
|
||||
use Cadoles\PortalBundle\Entity\Pagecategory;
|
||||
|
||||
class BlogRepository extends EntityRepository
|
||||
{
|
||||
// getBlogsUser
|
||||
// $user = l'utilisateur en cours
|
||||
// &$blogsuser = les blogs de l'utilisateur
|
||||
// &$blogs = les blogs système de l'utilistauer
|
||||
// &$blogsshared = les blogs partagées pour l'utilisateur
|
||||
|
||||
public function getBlogsUser($user,&$blogsuser,&$blogsadmin,&$blogsshared)
|
||||
{
|
||||
// Profilage
|
||||
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
|
||||
$groups=($user?$user->getGroups():[]);
|
||||
|
||||
// Récupération des blogs de l'utilisateur
|
||||
$blogsuser=[];
|
||||
if($user) {
|
||||
$qb = $this->createQueryBuilder('blog');
|
||||
$qb ->where("blog.user=:user")
|
||||
->setParameter("user",$user)
|
||||
->addOrderBy('blog.name', 'ASC');
|
||||
$blogsuser=$qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
// Permission sur les blogs
|
||||
if($blogsuser) {
|
||||
foreach($blogsuser as $bloguser) {
|
||||
$bloguser->setCanupdate(true);
|
||||
$bloguser->setCanadd(true);
|
||||
}
|
||||
}
|
||||
|
||||
// blogs partagées
|
||||
$blogsshared=[];
|
||||
if($user) {
|
||||
$blogsshared=$this->createQueryBuilder('blog')
|
||||
->from('CadolesCoreBundle:Group','g')
|
||||
->from('CadolesCoreBundle:UserGroup','ug')
|
||||
->from('CadolesCoreBundle:UserGroup','proprio')
|
||||
->where('g.fgcanshare=:fgcanshare')
|
||||
->andWhere('g=ug.group')
|
||||
->andWhere('ug.user=:user')
|
||||
->andWhere('g MEMBER OF blog.groups')
|
||||
->andWhere('blog.user != :user')
|
||||
->andWhere('blog.user is not null')
|
||||
->andWhere('proprio.user=blog.user')
|
||||
->andWhere('proprio.group=g')
|
||||
->setParameter('fgcanshare',true)
|
||||
->setParameter('user',$user)
|
||||
->addOrderBy('blog.name', 'ASC')
|
||||
->getQuery()->getResult();
|
||||
}
|
||||
|
||||
// Permission sur les blogs
|
||||
if($blogsshared) {
|
||||
foreach($blogsshared as $blogshared) {
|
||||
$blogshared->setCanupdate(false);
|
||||
$blogshared->setCanadd($this->getInwriter($user,$blogshared));
|
||||
}
|
||||
}
|
||||
|
||||
// Initialisation du calcul des blogs
|
||||
$blogsadmin=new ArrayCollection();
|
||||
|
||||
// Récupération des blogs par rôles
|
||||
foreach($roles as $role) {
|
||||
$qb = $this->createQueryBuilder("blog");
|
||||
$qb ->where($qb->expr()->like('blog.roles', $qb->expr()->literal("%$role%")))
|
||||
->andWhere("blog.user is null");
|
||||
|
||||
$blogsroles=$qb->getQuery()->getResult();
|
||||
foreach($blogsroles as $blogrole) {
|
||||
if(!$blogsadmin->contains($blogrole)) $blogsadmin->add($blogrole);
|
||||
}
|
||||
}
|
||||
|
||||
// Récupération des blogs par group
|
||||
foreach($groups as $group) {
|
||||
$qb = $this->createQueryBuilder("blog");
|
||||
$qb ->where(":group MEMBER OF blog.groups")
|
||||
->andWhere("blog.user is null")
|
||||
->setParameter("group",$group->getGroup());
|
||||
|
||||
$blogsgroups=$qb->getQuery()->getResult();
|
||||
foreach($blogsgroups as $bloggroup) {
|
||||
if(!$blogsadmin->contains($bloggroup)) $blogsadmin->add($bloggroup);
|
||||
}
|
||||
}
|
||||
|
||||
// Permission sur les blogs
|
||||
foreach($blogsadmin as $blogadmin) {
|
||||
$blogadmin->setCanupdate(false);
|
||||
$blogadmin->setCanadd($this->getInwriter($user,$blogadmin));
|
||||
}
|
||||
}
|
||||
|
||||
public function getPermission($user,$blog,&$cansee,&$canupdate,&$canadd) {
|
||||
// si blog de l'utilisateur
|
||||
if($blog->getUser()==$user&&!is_null($user)) {
|
||||
$cansee=true;
|
||||
$canupdate=true;
|
||||
$canadd=true;
|
||||
}
|
||||
else {
|
||||
$canupdate=false;
|
||||
$cansee=false;
|
||||
$canadd=false;
|
||||
|
||||
// Profilage
|
||||
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
|
||||
$groups=($user?$user->getGroups():[]);
|
||||
|
||||
// La blog est-elle dans les blogs associées à un partage de group ?
|
||||
$inblogsshared=$this->createQueryBuilder('blog')
|
||||
->from('CadolesCoreBundle:Group','g')
|
||||
->from('CadolesCoreBundle:UserGroup','ug')
|
||||
->from('CadolesCoreBundle:UserGroup','proprio')
|
||||
->where('g.fgcanshare=:fgcanshare')
|
||||
->andWhere('blog.id = :id')
|
||||
->andWhere('g=ug.group')
|
||||
->andWhere('ug.user=:user')
|
||||
->andWhere('g MEMBER OF blog.groups')
|
||||
->andWhere('blog.user != :user')
|
||||
->andWhere('blog.user is not null')
|
||||
->andWhere('proprio.user=blog.user')
|
||||
->andWhere('proprio.group=g')
|
||||
->setParameter("id",$blog->getId())
|
||||
->setParameter('fgcanshare',true)
|
||||
->setParameter('user',$user)
|
||||
->getQuery()->getResult();
|
||||
if($inblogsshared) $cansee=true;
|
||||
|
||||
// La blog est-elle dans les blogs associées au role de l'utilisateur ?
|
||||
foreach($roles as $role) {
|
||||
$qb = $this->createQueryBuilder("blog");
|
||||
$qb ->where($qb->expr()->like('blog.roles', $qb->expr()->literal("%$role%")))
|
||||
->andWhere("blog.id=:id")
|
||||
->andWhere("blog.user is null")
|
||||
->setParameter("id",$blog->getId());
|
||||
$inblogrole=$qb->getQuery()->getResult();
|
||||
if($inblogrole) $cansee=true;
|
||||
}
|
||||
|
||||
|
||||
// La blog est-elle dans les blogs associées aux groupes de l'utilisateur ?
|
||||
foreach($groups as $group) {
|
||||
$qb = $this->createQueryBuilder("blog");
|
||||
$qb ->where(":group MEMBER OF blog.groups")
|
||||
->andWhere("blog.id=:id")
|
||||
->andWhere("blog.user is null")
|
||||
->andWhere("blog.id=:id")
|
||||
->setParameter("id",$blog->getId())
|
||||
->setParameter("group",$group->getGroup());
|
||||
|
||||
$inbloggroup=$qb->getQuery()->getResult();
|
||||
if($inbloggroup) $cansee=true;
|
||||
}
|
||||
|
||||
// utilisateur a-t-il la permission d'écriture
|
||||
$canadd=$this->getInwriter($user,$blog);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getInwriter($user,$blog) {
|
||||
$canadd=false;
|
||||
|
||||
if($user) {
|
||||
$qb = $this->createQueryBuilder("blog");
|
||||
$qb ->andWhere("blog.id=:id")
|
||||
->andwhere(':user MEMBER OF blog.writers')
|
||||
|
||||
->from('CadolesCoreBundle:User','user')
|
||||
->andwhere("user=:user")
|
||||
|
||||
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||
->andwhere('usergroup.group MEMBER OF blog.groups AND usergroup.user=:user')
|
||||
->orwhere($qb->expr()->like('blog.roles', $qb->expr()->concat($qb->expr()->literal('%'),$qb->expr()->concat('user.role',$qb->expr()->literal('%')))))
|
||||
->setParameter("id",$blog->getId())
|
||||
->setparameter('user',$user);
|
||||
|
||||
$inblogwriters=$qb->getQuery()->getResult();
|
||||
if($inblogwriters) $canadd=true;
|
||||
}
|
||||
|
||||
return $canadd;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Cadoles\PortalBundle\Repository;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Cadoles\PortalBundle\Entity\Blog;
|
||||
|
||||
class BlogarticleRepository extends EntityRepository
|
||||
{
|
||||
|
||||
public function getBlogsArticles($blogs,$start,$length=10,&$count,&$articles)
|
||||
{
|
||||
$count=$this->createQueryBuilder('blogarticle')
|
||||
->select('COUNT(blogarticle)')
|
||||
->andwhere('blogarticle.blog IN(:blog)')
|
||||
->setParameter('blog',$blogs)
|
||||
->getQuery()->getSingleScalarResult();
|
||||
|
||||
$articles=$this->createQueryBuilder('blogarticle')
|
||||
->andwhere('blogarticle.blog IN(:blog)')
|
||||
->setParameter('blog',$blogs)
|
||||
->orderBy('blogarticle.submit', 'DESC')
|
||||
->addOrderBy('blogarticle.name', 'ASC')
|
||||
->setFirstResult($start)->setMaxResults($length)
|
||||
->getQuery()->getResult();
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
#== Config Icon
|
||||
|
||||
#== ICON =================================================================================================================================================
|
||||
cadoles_portal_config_icon:
|
||||
path: /config/icon
|
||||
defaults: { _controller: CadolesPortalBundle:Icon:list }
|
||||
@ -19,7 +20,10 @@ cadoles_portal_config_icon_icon:
|
||||
path: /config/icon/icon
|
||||
defaults: { _controller: CadolesPortalBundle:Icon:icon }
|
||||
|
||||
#== Config Item
|
||||
|
||||
|
||||
|
||||
#== ITEM =================================================================================================================================================
|
||||
cadoles_portal_config_item:
|
||||
path: /config/item
|
||||
defaults: { _controller: CadolesPortalBundle:Item:list }
|
||||
@ -40,7 +44,10 @@ cadoles_portal_config_item_order:
|
||||
path: /config/item/order
|
||||
defaults: { _controller: CadolesPortalBundle:Item:order }
|
||||
|
||||
#== Config Item Category
|
||||
|
||||
|
||||
|
||||
#== ITEM CATEGORY ========================================================================================================================================
|
||||
cadoles_portal_config_itemcategory_submit:
|
||||
path: /config/itemcategory/submit
|
||||
defaults: { _controller: CadolesPortalBundle:Itemcategory:submit }
|
||||
@ -57,7 +64,10 @@ cadoles_portal_config_itemcategory_order:
|
||||
path: /config/itemcategory/order
|
||||
defaults: { _controller: CadolesPortalBundle:Itemcategory:order }
|
||||
|
||||
#== Config Alert
|
||||
|
||||
|
||||
|
||||
#== ALERT ================================================================================================================================================
|
||||
cadoles_portal_config_alert:
|
||||
path: /config/alert
|
||||
defaults: { _controller: CadolesPortalBundle:Alert:list }
|
||||
@ -78,7 +88,10 @@ cadoles_portal_config_alert_order:
|
||||
path: /config/alert/order
|
||||
defaults: { _controller: CadolesPortalBundle:Alert:order }
|
||||
|
||||
#== Config Alert Category
|
||||
|
||||
|
||||
|
||||
#== ALERT CATEGORY =======================================================================================================================================
|
||||
cadoles_portal_config_alertcategory_submit:
|
||||
path: /config/alertcategory/submit
|
||||
defaults: { _controller: CadolesPortalBundle:Alertcategory:submit }
|
||||
@ -91,7 +104,10 @@ cadoles_portal_config_alertcategory_delete:
|
||||
path: /config/alertcategory/delete/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Alertcategory:delete }
|
||||
|
||||
#== Config Flux
|
||||
|
||||
|
||||
|
||||
#== FLUX =================================================================================================================================================
|
||||
cadoles_portal_config_flux:
|
||||
path: /config/flux
|
||||
defaults: { _controller: CadolesPortalBundle:Flux:list }
|
||||
@ -112,7 +128,10 @@ cadoles_portal_config_flux_order:
|
||||
path: /config/flux/order
|
||||
defaults: { _controller: CadolesPortalBundle:Flux:order }
|
||||
|
||||
#== Config Notice
|
||||
|
||||
|
||||
|
||||
#== NOTICE ===============================================================================================================================================
|
||||
cadoles_portal_config_notice:
|
||||
path: /config/notice
|
||||
defaults: { _controller: CadolesPortalBundle:Notice:list }
|
||||
@ -137,7 +156,11 @@ cadoles_portal_user_notice_view:
|
||||
path: /notice/view
|
||||
defaults: { _controller: CadolesPortalBundle:Notice:view }
|
||||
|
||||
#== Page
|
||||
|
||||
|
||||
|
||||
#== PAGE =================================================================================================================================================
|
||||
|
||||
#-- Access config
|
||||
cadoles_portal_config_page:
|
||||
path: /config/page
|
||||
@ -201,7 +224,10 @@ cadoles_portal_user_page_upload:
|
||||
defaults: { _controller: CadolesPortalBundle:Page:upload, access: user }
|
||||
|
||||
|
||||
#== Bookmark
|
||||
|
||||
|
||||
#== BOOKMARK =============================================================================================================================================
|
||||
|
||||
#-- Access config
|
||||
cadoles_portal_config_bookmark_submit:
|
||||
path: /config/bookmark/submit/{idpage}/{idwidget}/{touser}
|
||||
@ -233,7 +259,9 @@ cadoles_portal_user_bookmark_heart:
|
||||
defaults: { _controller: CadolesPortalBundle:Bookmark:heart, access: user }
|
||||
|
||||
|
||||
#== Slide
|
||||
|
||||
|
||||
#== SLIDE ================================================================================================================================================
|
||||
#-- Access config
|
||||
cadoles_portal_config_slide_list:
|
||||
path: /config/slide/{idpage}/{idwidget}
|
||||
@ -276,7 +304,127 @@ cadoles_portal_user_slide_upload:
|
||||
path: /user/slide/upload
|
||||
defaults: { _controller: CadolesPortalBundle:Slide:upload, access: user }
|
||||
|
||||
#== Calendar
|
||||
|
||||
|
||||
|
||||
#== BLOG =================================================================================================================================================
|
||||
|
||||
#-- Access config
|
||||
cadoles_portal_config_blog:
|
||||
path: /config/blog
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:list }
|
||||
|
||||
cadoles_portal_config_blog_ajax_list:
|
||||
path: /config/blog/ajax/list
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:ajaxlist, access: config }
|
||||
|
||||
cadoles_portal_config_blog_view:
|
||||
path: /config/blog/view/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:view, access: config, id: 0 }
|
||||
|
||||
cadoles_portal_config_blog_submit:
|
||||
path: /config/blog/submit
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:submit, access: config }
|
||||
|
||||
cadoles_portal_config_blog_update:
|
||||
path: /config/blog/update/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:update, access: config }
|
||||
|
||||
cadoles_portal_config_blog_delete:
|
||||
path: /config/blog/delete/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:delete, access: config }
|
||||
|
||||
cadoles_portal_config_blog_share:
|
||||
path: /config/blog/share/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:share, access: config }
|
||||
|
||||
cadoles_portal_config_blog_writer:
|
||||
path: /config/blog/writer/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:writer, access: config }
|
||||
|
||||
|
||||
#-- Access user
|
||||
cadoles_portal_user_blog_view:
|
||||
path: /blog/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:view, access: user, id: 0 }
|
||||
|
||||
cadoles_portal_user_blog_submit:
|
||||
path: /user/blog/submit
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:submit, access: user }
|
||||
|
||||
cadoles_portal_user_blog_update:
|
||||
path: /user/blog/update/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:update, access: user }
|
||||
|
||||
cadoles_portal_user_blog_delete:
|
||||
path: /user/blog/delete/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:delete, access: user }
|
||||
|
||||
cadoles_portal_user_blog_share:
|
||||
path: /user/blog/share/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:share, access: user }
|
||||
|
||||
cadoles_portal_user_blog_writer:
|
||||
path: /user/blog/writer/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blog:writer, access: user }
|
||||
|
||||
|
||||
|
||||
|
||||
#== BLOGARTICLE ==========================================================================================================================================
|
||||
|
||||
#-- Access config
|
||||
cadoles_portal_config_blogarticle_view:
|
||||
path: /config/blogarticle/view/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:view, access: config }
|
||||
|
||||
cadoles_portal_config_blogarticle_submit:
|
||||
path: /config/blogarticle/submit/{idblog}
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:submit, access: config}
|
||||
|
||||
cadoles_portal_config_blogarticle_update:
|
||||
path: /config/blogarticle/update/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:update, access: config }
|
||||
|
||||
cadoles_portal_config_blogarticle_delete:
|
||||
path: /config/blogarticle/delete/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:delete, access: config }
|
||||
|
||||
cadoles_portal_config_blogarticle_upload:
|
||||
path: /config/blogarticle/upload
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:upload, access: config }
|
||||
|
||||
cadoles_portal_config_blogarticle_image:
|
||||
path: /config/blogarticle/image
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:image, access: config }
|
||||
|
||||
#-- Access user
|
||||
cadoles_portal_user_blogarticle_view:
|
||||
path: /blogarticle/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:view, access: user }
|
||||
|
||||
cadoles_portal_user_blogarticle_submit:
|
||||
path: /user/blogarticle/submit/{idblog}
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:submit, access: user, idblog: 0 }
|
||||
|
||||
cadoles_portal_user_blogarticle_update:
|
||||
path: /user/blogarticle/update/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:update, access: user }
|
||||
|
||||
cadoles_portal_user_blogarticle_delete:
|
||||
path: /user/blogarticle/delete/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:delete, access: user }
|
||||
|
||||
cadoles_portal_user_blogarticle_upload:
|
||||
path: /user/blogarticle/upload
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:upload, access: user }
|
||||
|
||||
cadoles_portal_user_blogarticle_image:
|
||||
path: /user/blogarticle/image
|
||||
defaults: { _controller: CadolesPortalBundle:Blogarticle:image, access: user }
|
||||
|
||||
#== CALENDAR =============================================================================================================================================
|
||||
|
||||
#-- Access config
|
||||
cadoles_portal_config_calendar:
|
||||
path: /config/calendar
|
||||
@ -330,7 +478,9 @@ cadoles_portal_user_calendar_share:
|
||||
|
||||
|
||||
|
||||
#== Calendarevent
|
||||
|
||||
#== CALENDAREVENT ========================================================================================================================================
|
||||
|
||||
#-- Access config
|
||||
cadoles_portal_config_calendarevent_load:
|
||||
path: /config/calendarevent/load
|
||||
@ -375,7 +525,10 @@ cadoles_portal_user_calendarevent_share:
|
||||
defaults: { _controller: CadolesPortalBundle:Calendarevent:share, access: user }
|
||||
|
||||
|
||||
#== Tool
|
||||
|
||||
|
||||
#== TOOL =================================================================================================================================================
|
||||
|
||||
cadoles_portal_user_tool_clockanalogique:
|
||||
path: /tool/clockanalogique
|
||||
defaults: { _controller: CadolesPortalBundle:Tool:clockanalogique }
|
||||
@ -388,7 +541,11 @@ cadoles_portal_user_tool_calculator:
|
||||
path: /tool/calculator
|
||||
defaults: { _controller: CadolesPortalBundle:Tool:calculator }
|
||||
|
||||
#== Pagewidget
|
||||
|
||||
|
||||
|
||||
#== PAGE WIDGET ==========================================================================================================================================
|
||||
|
||||
#-- Access config
|
||||
cadoles_portal_config_pagewidget_widget_sumbit:
|
||||
path: /config/pagewidget/submit/{idpage}/{idwidgettype}
|
||||
@ -406,6 +563,10 @@ cadoles_portal_config_pagewidget_order:
|
||||
path: /config/pagewidget/order
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:order, access: config }
|
||||
|
||||
cadoles_portal_config_pagewidget_upload:
|
||||
path: /config/pagewidget/upload
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:upload, access: config }
|
||||
|
||||
cadoles_portal_config_panelwidget_view_url:
|
||||
path: /config/pagewidget/view/url/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewurl, access: config }
|
||||
@ -450,6 +611,14 @@ cadoles_portal_config_panelwidget_view_calendar:
|
||||
path: /config/pagewidget/view/calendar/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewcalendar, access: config }
|
||||
|
||||
cadoles_portal_config_panelwidget_view_blog:
|
||||
path: /config/pagewidget/view/blog/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewblog, access: config }
|
||||
|
||||
cadoles_portal_config_panelwidget_view_separator:
|
||||
path: /config/pagewidget/view/separator/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewseparator, access: config }
|
||||
|
||||
cadoles_portal_config_panelwidget_view_clock:
|
||||
path: /config/pagewidget/view/clock/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewclock, access: config }
|
||||
@ -458,6 +627,7 @@ cadoles_portal_config_panelwidget_view_calculator:
|
||||
path: config/pagewidget/view/calculator/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewcalculator, access: config }
|
||||
|
||||
|
||||
#-- Access user
|
||||
cadoles_portal_user_pagewidget_widget_sumbit:
|
||||
path: /user/pagewidget/submit/{idpage}/{idwidgettype}
|
||||
@ -475,6 +645,10 @@ cadoles_portal_user_pagewidget_order:
|
||||
path: /user/pagewidget/order
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:order, access: user }
|
||||
|
||||
cadoles_portal_user_pagewidget_upload:
|
||||
path: /user/pagewidget/upload
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:upload, access: user }
|
||||
|
||||
cadoles_portal_user_panelwidget_view_url:
|
||||
path: /pagewidget/view/url/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewurl, access: user }
|
||||
@ -519,6 +693,14 @@ cadoles_portal_user_panelwidget_view_calendar:
|
||||
path: /pagewidget/view/calendar/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewcalendar, access: user }
|
||||
|
||||
cadoles_portal_user_panelwidget_view_blog:
|
||||
path: /pagewidget/view/blog/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewblog, access: user }
|
||||
|
||||
cadoles_portal_user_panelwidget_view_separator:
|
||||
path: /pagewidget/view/separator/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewseparator, access: user }
|
||||
|
||||
cadoles_portal_user_panelwidget_view_clock:
|
||||
path: /pagewidget/view/clock/{id}
|
||||
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewclock, access: user }
|
||||
|
@ -186,7 +186,7 @@
|
||||
$("a[data-role='ROLE_ADMIN']").children("span").html($('.role-ROLE_ADMIN').length);
|
||||
|
||||
function updateItems() {
|
||||
$('.list-item:not(.list-item-placeholder').each(function(i) {
|
||||
$('.list-item').each(function(i) {
|
||||
var itemid = $(this).data('alert-id');
|
||||
$(this).find('input[name="alert_item[rowOrder][]"]').val(i);
|
||||
|
||||
@ -205,7 +205,7 @@
|
||||
|
||||
$( "#list" ).sortable({
|
||||
axis: "y",
|
||||
placeholder: "list-item list-item-placeholder",
|
||||
placeholder: "list-item placeholder",
|
||||
update: updateItems
|
||||
});
|
||||
|
||||
|
@ -0,0 +1,69 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Blog
|
||||
{% elseif mode=="submit" %}
|
||||
Création Blog
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_blog_view',{'id':entity.id}) }}>Annuler</a>
|
||||
|
||||
{% if mode=="update" %}
|
||||
<a href={{ path('cadoles_portal_config_blog_delete',{'id':entity.id}) }}
|
||||
class="btn btn-danger pull-right"
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cette annonce ?">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<br><br>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="form-group row clearfix">
|
||||
{% if form.roles is defined %}
|
||||
<div class="col-md-8">
|
||||
{% else %}
|
||||
<div class="col-md-12">
|
||||
{% endif %}
|
||||
|
||||
{{ form_row(form.name) }}
|
||||
</div>
|
||||
|
||||
{% if form.roles is defined %}
|
||||
<div class="col-md-4">
|
||||
{{ form_row(form.roles) }}
|
||||
{{ form_row(form.groups) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
{% endblock %}
|
@ -0,0 +1,56 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
|
||||
{% block pagewrapper %}
|
||||
<h1>
|
||||
Gestion des Blogs
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
<a href="{{ path('cadoles_portal_config_blog_submit') }}" class="btn btn-success">Ajouter un Blog</a>
|
||||
</p>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-table fa-fw"></i> Liste des Calendriers
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="dataTable_wrapper">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="100px" class="no-sort">Action</th>
|
||||
<th>Nom</th>
|
||||
<th>Propriétaire</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
$(document).ready(function() {
|
||||
$('#dataTables').DataTable({
|
||||
columnDefs: [ { "targets": 'no-sort', "orderable": false } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 1, "asc" ]],
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: "{{ path('cadoles_portal_config_blog_ajax_list') }}",
|
||||
drawCallback: function(settings) {
|
||||
$("a[data-method='delete']").click(function(){
|
||||
if( !confirm('Êtes-vous sûr de vouloir supprimer ce calendrier ?')) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
{% endblock %}
|
@ -0,0 +1,42 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
{{ form_start(form) }}
|
||||
<h1>
|
||||
Partage Blog
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_blog_view',{'id':entity.id}) }}>Annuler</a>
|
||||
</p>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-pencil fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
{{ form_row(form.groups) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
@ -0,0 +1,179 @@
|
||||
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
|
||||
{% block pagewrapper %}
|
||||
{% if access=="config" %}
|
||||
<div class="pagemenu">
|
||||
<a href="{{ path('cadoles_portal_config_blog_view', {id:entity.id})}}">{{ entity.name }}</a>>
|
||||
<a href='{{ path('cadoles_portal_config_blog_update', {id:entity.id}) }}' title='Modifier'><i class='fa fa-file fa-fw'></i></a>
|
||||
<a href='{{ path('cadoles_portal_config_blog_writer', {id:entity.id}) }}' title='Permission'><i class='fa fa-users fa-fw'></i></a>
|
||||
<a href='{{ path('cadoles_portal_config_blog_delete', { id: entity.id }) }}' data-method='delete' data-confirm='Êtes-vous sûr de vouloir supprimer ?' title='Supprimer'><i class='fa fa-trash fa-fw'></i></a>
|
||||
</div>
|
||||
{% else %}
|
||||
<br>
|
||||
<ul class="nav navbar-default nav-pills">
|
||||
<li id="menublog-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer">
|
||||
<a href="{{ path("cadoles_portal_user_blog_view") }}">
|
||||
Tout
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% for blog in blogs %}
|
||||
<li id="menublog-{{blog.id}}" data-open="{% if blog.canupdate %}true{%endif%}" class="{% if entity.id is defined and entity.id==blog.id%}active{%endif%}" style="cursor:pointer">
|
||||
<a href="{{ path("cadoles_portal_user_blog_view",{'id':blog.id}) }}">
|
||||
{{ blog.name }}
|
||||
{% if blog.canadd %}
|
||||
<i class="fa fa-pencil"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-lock"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
{% if canupdate %}
|
||||
<li><a id="menusubmit" style="cursor:pointer" onclick="submitBlog()" title='Ajouter une blog'><i class='fa fa-plus fa-fw'></i></a></li>
|
||||
{% endif %}
|
||||
<li><a id="menuupdate" style="cursor:pointer;display:none" onclick="updateBlog()" title='Modifier un blog'><i class='fa fa-file fa-fw'></i></a></li>
|
||||
<li><a id="menushare" style="cursor:pointer;display:none" onclick="shareBlog()" title='Partager un blog'><i class='fa fa-share-alt fa-fw'></i></a></li>
|
||||
<li><a id="menuwriter" style="cursor:pointer;display:none" onclick="writerBlog()" title='Permission du blog'><i class='fa fa-users fa-fw'></i></a></li>
|
||||
<li><a id="menudelete" style="cursor:pointer;display:none" onclick="deleteBlog()" title='Supprimer un blog'><i class='fa fa-trash fa-fw'></i></a></li>
|
||||
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<div class="blogpreview">
|
||||
<h1 class="blogtitle">
|
||||
{% if entity.id is not defined %}
|
||||
Blog
|
||||
{% set idblog=0 %}
|
||||
{% else %}
|
||||
{{ entity.name }}
|
||||
{% set idblog=entity.id %}
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{% if canadd %}
|
||||
<a class="btn btn-primary" href='{{ path('cadoles_portal_'~access~'_blogarticle_submit',{'idblog':idblog}) }}' style="width:100%; font-size:20px" title='Ajouter un article'><i class='fa fa-paper-plane fa-fw'></i> Ajouter un Article</a>
|
||||
{% endif %}
|
||||
|
||||
<nav aria-label="Page navigation" style="text-align:center">
|
||||
<ul class="pagination">
|
||||
{% set maxpage=(countarticles/pagination)|round(0,"ceil") %}
|
||||
{%if maxpage>1 %}
|
||||
{% for count in 1..maxpage%}
|
||||
<li class="{%if count==page %}active{%endif%}">
|
||||
{% if entity.id is not defined %}
|
||||
<a href="{{ path("cadoles_portal_user_blog_view",{'page':count}) }}">{{ count }}</a>
|
||||
{% else %}
|
||||
<a href="{{ path("cadoles_portal_user_blog_view",{'id':entity.id,'page':count}) }}">{{ count }}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="grid clearfix" style="margin-top:10px;">
|
||||
{% for blogarticle in blogarticles %}
|
||||
{% if loop.index==1 %}
|
||||
<div class="grid-sizer grid-preview"></div>
|
||||
<div class="grid-gutter-sizer grid-gutter-sizer-preview"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item grid-preview">
|
||||
<a href="{{ path('cadoles_portal_'~access~'_blogarticle_view',{'id':blogarticle.id}) }}">
|
||||
{% if blogarticle.image is not empty %}
|
||||
<img src="/{{alias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%">
|
||||
{% endif %}
|
||||
<div class="caption">
|
||||
<h1 class="grid-preview-title">{{ blogarticle.name}}</h1>
|
||||
<small>publié par {{ blogarticle.user.username }} le {{ blogarticle.submit|date("d/m/Y à H:i") }}<br>dans le blog {{blogarticle.blog.name }}</small>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
var idblog;
|
||||
|
||||
$('document').ready(function(){
|
||||
{% if entity.id is defined %}
|
||||
{% for blog in blogs %}
|
||||
{% if blog.id==entity.id %}
|
||||
showBlog({{ blog.id }}, {{ blog.canupdate }});
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
showBlog(0, {{ canupdate }});
|
||||
{% endif %}
|
||||
|
||||
// Création des grilles d'items
|
||||
var optiongrid={columnWidth: '.grid-sizer', itemSelector: '.grid-item', gutter: '.grid-gutter-sizer'};
|
||||
var grid = $('.grid').masonry(optiongrid);
|
||||
});
|
||||
|
||||
function submitBlog() {
|
||||
var url="{{ path('cadoles_portal_'~access~'_blog_submit') }}";
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
|
||||
function updateBlog() {
|
||||
var url="{{ path('cadoles_portal_'~access~'_blog_update',{id:'xx'}) }}";
|
||||
url=url.replace('xx',idblog);
|
||||
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
|
||||
function shareBlog() {
|
||||
var url="{{ path('cadoles_portal_'~access~'_blog_share',{id:'xx'}) }}";
|
||||
url=url.replace('xx',idblog);
|
||||
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
|
||||
function writerBlog() {
|
||||
var url="{{ path('cadoles_portal_'~access~'_blog_writer',{id:'xx'}) }}";
|
||||
url=url.replace('xx',idblog);
|
||||
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
|
||||
function deleteBlog() {
|
||||
if (confirm('Êtes-vous sûr de vouloir supprimer ?')) {
|
||||
var url="{{ path('cadoles_portal_'~access~'_blog_delete',{id:'xx'}) }}";
|
||||
url=url.replace('xx',idblog);
|
||||
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
}
|
||||
|
||||
// Affichages des blogs
|
||||
function showBlog(id,canupdate) {
|
||||
idblog=id;
|
||||
|
||||
// Rendre actif le page en cours dans le menu
|
||||
$(".navbar-top-links li").removeClass("active");
|
||||
$("#menublog-"+id).addClass("active");
|
||||
|
||||
// Cacher les actions possibles sur la page
|
||||
$("#menuupdate").hide();
|
||||
$("#menushare").hide();
|
||||
$("#menuwriter").hide();
|
||||
$("#menudelete").hide();
|
||||
|
||||
if($("#menublog-"+id).data("open")) {
|
||||
console.log($("#menublog-"+id).data("open"));
|
||||
$("#menuupdate").show();
|
||||
$("#menushare").show();
|
||||
$("#menuwriter").show();
|
||||
$("#menudelete").show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{% endblock %}
|
@ -0,0 +1,42 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
{{ form_start(form) }}
|
||||
<h1>
|
||||
Permissions Blog
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_blog_view',{'id':entity.id}) }}>Annuler</a>
|
||||
</p>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-pencil fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
{{ form_row(form.writers) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
@ -0,0 +1,84 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Article de Blog
|
||||
{% elseif mode=="submit" %}
|
||||
Création Article de Blog
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
{% if mode=="update" %}
|
||||
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_blogarticle_view',{'id':entity.id}) }}'>Annuler</a>
|
||||
{% elseif mode=="submit" %}
|
||||
{% set blogid=0 %}
|
||||
{%if entity.blog.id is defined %}
|
||||
{% set blogid=entity.blog.id %}
|
||||
{%endif%}
|
||||
|
||||
<a class="btn btn-default" href='{{ path('cadoles_portal_'~access~'_blog_view',{'id':blogid})}}'>Annuler</a>
|
||||
{% endif %}
|
||||
|
||||
{% if mode=="update" %}
|
||||
<a href={{ path('cadoles_portal_'~access~'_blogarticle_delete',{'id':entity.id}) }}
|
||||
class="btn btn-danger pull-right"
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cet article ?">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<br><br>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="form-group row clearfix">
|
||||
<div class="col-md-8">
|
||||
{{ form_row(form.name) }}
|
||||
{{ form_row(form.blog) }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div style="margin:10px auto;">
|
||||
<a class="btn btn-info" style="width:100%" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Image à la une','{{ path('cadoles_portal_'~access~'_blogarticle_image') }}');" title='Ajouter un Header'>Téléchargez une image à la une</a>
|
||||
<img id="blogarticle_image_img" src="/{{ alias }}/{{ entity.image }}" style="width:100%;margin:auto;display:block;">
|
||||
{{ form_widget(form.image) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ form_row(form.description) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
$('#mymodal').on('hidden.bs.modal', function () {
|
||||
var imgSrc = $("#blogarticle_image_img").attr('src');
|
||||
$("#blogarticle_image_img").attr('src',imgSrc);
|
||||
});
|
||||
{% endblock %}
|
@ -0,0 +1,36 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
<h3 class="page-header">Téléchargez votre Image à la Une</h3>
|
||||
<a class="btn btn-default" onClick="closeModal();">Annuler</a>
|
||||
|
||||
<form action="{{ oneup_uploader_endpoint('blogarticle') }}" name="formfile" class="dropzone" id="MyDropZone" style="margin-top:10px">
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block localjavascript %}
|
||||
Dropzone.options.MyDropZone = {
|
||||
acceptedMimeTypes: 'image/*',
|
||||
maxFiles: 1,
|
||||
resizeWidth:2500,
|
||||
|
||||
success: function( file, response ){
|
||||
parent.$("#blogarticle_image").val("uploads/blogarticle/"+response["file"]);
|
||||
parent.$("#blogarticle_image_img").attr("src","/{{ alias }}/uploads/blogarticle/"+response["file"]);
|
||||
closeModal();
|
||||
}
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
window.parent.$("#mymodal").modal('hide');
|
||||
}
|
||||
|
||||
$(window).load(function () {
|
||||
// On vérifie que l'execution se fait bien dans le cadre d'une modal
|
||||
if(!window.parent.$("#mymodal #framemodal").length) {
|
||||
$(location).attr('href',"{{ path('cadoles_core_home') }}");
|
||||
}
|
||||
});
|
||||
{% endblock %}
|
@ -0,0 +1,111 @@
|
||||
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
|
||||
{% block appmenu %}
|
||||
<ul class="nav navbar-top-links navbar-left">
|
||||
<li id="menublog-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer">
|
||||
<a href="{{ path("cadoles_portal_user_blog_view") }}">
|
||||
Tout
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% for blog in blogs %}
|
||||
<li id="menublog-{{blog.id}}" data-open="{% if blog.canupdate %}true{%endif%}" class="{% if entity.id is defined and entity.id==blog.id%}active{%endif%}" style="cursor:pointer">
|
||||
<a href="{{ path("cadoles_portal_user_blog_view",{'id':blog.id}) }}">
|
||||
{{ blog.name }}
|
||||
{% if blog.canadd %}
|
||||
<i class="fa fa-pencil"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-lock"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
{% if access=="config" %}
|
||||
<div class="pagemenu">
|
||||
<a href="{{ path('cadoles_portal_config_blog_view', {id:entity.blog.id})}}">{{ entity.blog.name }}</a>>
|
||||
</div>
|
||||
{% else %}
|
||||
<br>
|
||||
<ul class="nav navbar-default nav-pills">
|
||||
<li id="menublog-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer">
|
||||
<a href="{{ path("cadoles_portal_user_blog_view") }}">
|
||||
Tout
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% for blog in blogs %}
|
||||
<li id="menublog-{{blog.id}}" data-open="{% if blog.canupdate %}true{%endif%}" class="{% if entity.id is defined and entity.id==blog.id%}active{%endif%}" style="cursor:pointer">
|
||||
<a href="{{ path("cadoles_portal_user_blog_view",{'id':blog.id}) }}">
|
||||
{{ blog.name }}
|
||||
{% if blog.canadd %}
|
||||
<i class="fa fa-pencil"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-lock"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<div class="blogarticle">
|
||||
{%if entity.image is not empty %}
|
||||
<div class="blogimage" style="background-image:url(/{{ alias }}/{{entity.image}})"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col col-md-9">
|
||||
<div class="blogtitle">
|
||||
<legend><h1>{{entity.name}}</h1></legend>
|
||||
<small>publié par {{ entity.user.username }} le {{ entity.submit|date("d/m/Y à H:i") }} dans le blog {{entity.blog.name }}</small>
|
||||
{% if canadd %}
|
||||
<a href="{{ path("cadoles_portal_"~access~"_blogarticle_update",{'id':entity.id}) }}"><i class="fa fa-file"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="blogbody">
|
||||
{{ entity.description | raw }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="blogsidebar col col-md-3">
|
||||
<h4 class="blogsidebartitle">Articles Récents</h4>
|
||||
{% for blogarticle in blogarticles %}
|
||||
<a href="{{ path("cadoles_portal_"~access~"_blogarticle_view",{"id":blogarticle.id}) }}">{{ blogarticle.name }}</a><br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
var idblog;
|
||||
|
||||
$('document').ready(function(){
|
||||
{% if entity.id is defined %}
|
||||
{% for blog in blogs %}
|
||||
{% if blog.id==entity.blog.id %}
|
||||
showBlog({{ blog.id }}, {{ blog.canupdate }});
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
showBlog(0, {{ canupdate }});
|
||||
{% endif %}
|
||||
});
|
||||
|
||||
|
||||
// Affichages des blogs
|
||||
function showBlog(id,canupdate) {
|
||||
// Rendre actif le page en cours dans le menu
|
||||
$(".navbar-top-links li").removeClass("active");
|
||||
$("#menublog-"+id).addClass("active");
|
||||
}
|
||||
|
||||
|
||||
{% endblock %}
|
@ -22,6 +22,7 @@
|
||||
<tr>
|
||||
<th width="100px" class="no-sort">Action</th>
|
||||
<th>Nom</th>
|
||||
<th>Propriétaire</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
@ -3,7 +3,7 @@
|
||||
{% block pagewrapper %}
|
||||
{{ form_start(form) }}
|
||||
<h1>
|
||||
Partage Page
|
||||
Partage Calendrier
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
|
@ -2,32 +2,6 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
|
||||
{% block appmenu %}
|
||||
<ul class="nav navbar-top-links navbar-left">
|
||||
<li id="menucalendar-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer"><a onClick="showCalendar(0,{{ canupdate }})">Tout</a></li>
|
||||
|
||||
{% for calendar in calendars %}
|
||||
<li id="menucalendar-{{calendar.id}}" data-open="{% if calendar.canupdate %}true{%endif%}" class="{% if entity.id is defined and entity.id==calendar.id%}active{%endif%}" style="cursor:pointer">
|
||||
<a onClick="showCalendar({{ calendar.id }},{{ calendar.canupdate }})">
|
||||
{{ calendar.name }}
|
||||
{% if not calendar.canupdate %}
|
||||
<i class="fa fa-lock"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<div id="menupageaction">
|
||||
{% if canupdate %}
|
||||
<a id="menusubmit" style="cursor:pointer" onclick="submitCalendar()" title='Ajouter une calendar'><i class='fa fa-plus fa-fw'></i></a>
|
||||
{% endif %}
|
||||
<a id="menuupdate" style="cursor:pointer;display:none" onclick="updateCalendar()" title='Modifier une calendar'><i class='fa fa-file fa-fw'></i></a>
|
||||
<a id="menushare" style="cursor:pointer;display:none" onclick="shareCalendar()" title='Partager une calendar'><i class='fa fa-share-alt fa-fw'></i></a>
|
||||
<a id="menudelete" style="cursor:pointer;display:none" onclick="deleteCalendar()" title='Supprimer une calendar'><i class='fa fa-trash fa-fw'></i></a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
{% if access=="config" %}
|
||||
<div class="pagemenu">
|
||||
@ -35,6 +9,30 @@
|
||||
<a href='{{ path('cadoles_portal_config_calendar_update', {id:entity.id}) }}' title='Modifier le panel'><i class='fa fa-file fa-fw'></i></a>
|
||||
<a href='{{ path('cadoles_portal_config_calendar_delete', { id: entity.id }) }}' data-method='delete' data-confirm='Êtes-vous sûr de vouloir supprimer ?' title='Supprimer le panel'><i class='fa fa-trash fa-fw'></i></a>
|
||||
</div>
|
||||
{% else %}
|
||||
<br>
|
||||
<ul class="nav navbar-default nav-pills">
|
||||
<li id="menucalendar-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer"><a onClick="showCalendar(0,{{ canupdate }})">Tout</a></li>
|
||||
|
||||
{% for calendar in calendars %}
|
||||
<li id="menucalendar-{{calendar.id}}" data-open="{% if calendar.canupdate %}true{%endif%}" class="{% if entity.id is defined and entity.id==calendar.id%}active{%endif%}" style="cursor:pointer">
|
||||
<a onClick="showCalendar({{ calendar.id }},{{ calendar.canupdate }})">
|
||||
{{ calendar.name }}
|
||||
{% if not calendar.canupdate %}
|
||||
<i class="fa fa-lock"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
{% if canupdate %}
|
||||
<li><a id="menusubmit" style="cursor:pointer" onclick="submitCalendar()" title='Ajouter une calendar'><i class='fa fa-plus fa-fw'></i></a></li>
|
||||
{% endif %}
|
||||
<li><a id="menuupdate" style="cursor:pointer;display:none" onclick="updateCalendar()" title='Modifier une calendar'><i class='fa fa-file fa-fw'></i></a></li>
|
||||
<li><a id="menushare" style="cursor:pointer;display:none" onclick="shareCalendar()" title='Partager une calendar'><i class='fa fa-share-alt fa-fw'></i></a></li>
|
||||
<li><a id="menudelete" style="cursor:pointer;display:none" onclick="deleteCalendar()" title='Supprimer une calendar'><i class='fa fa-trash fa-fw'></i></a></li>
|
||||
</ul>
|
||||
<br>
|
||||
{% endif %}
|
||||
|
||||
<div id="calendar"></div>
|
||||
@ -246,7 +244,7 @@
|
||||
urltoload=urltoload.replace('xx',idcalendar);
|
||||
|
||||
// Rendre actif le page en cours dans le menu
|
||||
$(".navbar-top-links li").removeClass("active");
|
||||
$(".navbar-default li").removeClass("active");
|
||||
$("#menucalendar-"+id).addClass("active");
|
||||
|
||||
// Cacher les actions possibles sur la page
|
||||
|
@ -3,7 +3,7 @@
|
||||
{% block pagewrapper %}
|
||||
{{ form_start(form) }}
|
||||
<h1>
|
||||
Partage Page
|
||||
Partage Evènement
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
|
@ -143,7 +143,7 @@
|
||||
|
||||
function updateItems() {
|
||||
// Pour chaque catégorie
|
||||
$('.category-list-item:not(.category-list-item-placeholder').each(function(i) {
|
||||
$('.category-list-item').each(function(i) {
|
||||
// On récupère id et order
|
||||
var categoryid = $(this).data('itemcategory-id');
|
||||
$(this).find('input[name="itemcategory[rowOrder][]"]').val(i);
|
||||
@ -159,7 +159,7 @@
|
||||
});
|
||||
|
||||
// Pour chaque item de la catégorie
|
||||
$(this).find('.grid-item:not(.grid-item-placeholder)').each(function(j) {
|
||||
$(this).find('.grid-item').each(function(j) {
|
||||
// On récupère les id
|
||||
var itemid = $(this).data('item-id');
|
||||
$(this).find('input[name="item[rowOrder][]"]').val(j);
|
||||
@ -181,13 +181,13 @@
|
||||
|
||||
$( ".grid" ).sortable({
|
||||
connectWith: ".grid",
|
||||
placeholder: "grid-item grid-item-placeholder",
|
||||
placeholder: "grid-item placeholder",
|
||||
update: updateItems
|
||||
});
|
||||
|
||||
$( ".category-list" ).sortable({
|
||||
axis: "y",
|
||||
placeholder: "category-list-item category-list-item-placeholder",
|
||||
placeholder: "category-list-item placeholder",
|
||||
update: updateItems
|
||||
});
|
||||
|
||||
|
@ -8,6 +8,11 @@
|
||||
|
||||
<p>
|
||||
<a href="{{ path('cadoles_portal_config_page_submit') }}" class="btn btn-success">Ajouter une Page</a>
|
||||
|
||||
<span class="pull-right">
|
||||
<label for="alluser" class="control-label">Afficher les utilisateurs</label>
|
||||
<input id="alluser" name="alluser" type="checkbox" class="switch" onChange="switchalluser();">
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
@ -23,7 +28,8 @@
|
||||
<th width="100px" class="no-sort">Action</th>
|
||||
<th>Ordre</th>
|
||||
<th>Nom</th>
|
||||
<th>Catégorie</th>
|
||||
<th class="no-sort">Catégorie</th>
|
||||
<th>Propriétaire</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
@ -34,14 +40,22 @@
|
||||
|
||||
{% block localjavascript %}
|
||||
$(document).ready(function() {
|
||||
$('#dataTables').DataTable({
|
||||
table = $('#dataTables').DataTable({
|
||||
columnDefs: [ { "targets": 'no-sort', "orderable": false } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 1, "asc" ]],
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: "{{ path('cadoles_portal_config_page_ajax_list') }}",
|
||||
ajax: {
|
||||
"url": "{{ path('cadoles_portal_config_page_ajax_list') }}",
|
||||
"data": function ( d ) {
|
||||
return $.extend( {}, d, {
|
||||
"alluser": $('#alluser').bootstrapSwitch('state')
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
drawCallback: function(settings) {
|
||||
$("a[data-method='delete']").click(function(){
|
||||
if( !confirm('Êtes-vous sûr de vouloir supprimer cette page ?')) {
|
||||
@ -51,7 +65,11 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".switch").bootstrapSwitch();
|
||||
});
|
||||
|
||||
function switchalluser() {
|
||||
table.ajax.reload()
|
||||
}
|
||||
|
||||
{% endblock %}
|
||||
|
@ -8,20 +8,30 @@
|
||||
{% block appmenu %}
|
||||
<ul class="nav navbar-top-links navbar-left">
|
||||
{% for page in pagesadmin %}
|
||||
{% set forcereload=true %}
|
||||
{% if page.pagecategory.id==1 %}
|
||||
{% set forcereload=false %}
|
||||
{% endif %}
|
||||
|
||||
{% if entity.id is defined and page.id==entity.id %}
|
||||
<li id="menupage-{{page.id}}" class="active" style="cursor:pointer"><a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},{{ page.canupdate }})">{{ page.name }}</a></li>
|
||||
<li id="menupage-{{page.id}}" class="active" style="cursor:pointer"><a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}',{{forcereload}})">{{ page.name }}</a></li>
|
||||
{% else %}
|
||||
<li id="menupage-{{page.id}}"><a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},{{ page.canupdate }})">{{ page.name }}</a></li>
|
||||
<li id="menupage-{{page.id}}"><a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}',{{forcereload}})">{{ page.name }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<ul id="pagesuser" class="nav navbar-top-links navbar-left">
|
||||
{% for page in pagesuser %}
|
||||
{% set forcereload=true %}
|
||||
{% if page.pagecategory.id==1 %}
|
||||
{% set forcereload=false %}
|
||||
{% endif %}
|
||||
|
||||
{% if entity.id is defined and page.id==entity.id %}
|
||||
<li id="menupage-{{page.id}}" class="active" style="cursor:pointer"><a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},{{ page.canupdate }})">{{ page.name }}</a></li>
|
||||
<li id="menupage-{{page.id}}" class="active" style="cursor:pointer"><a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}',{{forcereload}})">{{ page.name }}</a></li>
|
||||
{% else %}
|
||||
<li id="menupage-{{page.id}}"><a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},{{ page.canupdate }})">{{ page.name }}</a></li>
|
||||
<li id="menupage-{{page.id}}"><a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}',{{forcereload}})">{{ page.name }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@ -32,10 +42,15 @@
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Partagés <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
{% for page in pagesshared %}
|
||||
{% set forcereload=true %}
|
||||
{% if page.pagecategory.id==1 %}
|
||||
{% set forcereload=false %}
|
||||
{% endif %}
|
||||
|
||||
{% if entity.id is defined and page.id==entity.id %}
|
||||
<li id="menupage-{{page.id}}" class="active" style="cursor:pointer"><a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},{{ page.canupdate }})">{{ page.name }}</a></li>
|
||||
<li id="menupage-{{page.id}}" class="active" style="cursor:pointer"><a onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}',{{forcereload}})">{{ page.name }}</a></li>
|
||||
{% else %}
|
||||
<li id="menupage-{{page.id}}"><a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},{{ page.canupdate }})">{{ page.name }}</a></li>
|
||||
<li id="menupage-{{page.id}}"><a style="cursor:pointer" onClick="showPage({{ page.id }},{{ page.pagecategory.id }},'{{ page.canupdate }}',{{forcereload}})">{{ page.name }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@ -57,8 +72,6 @@
|
||||
{% block pagewrapper %}
|
||||
<div id="pagecontainer" style="margin: 0px -30px;"></div>
|
||||
|
||||
|
||||
|
||||
<div id="selwidget" class="modal fade bs-item-modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
@ -127,7 +140,7 @@
|
||||
$("#pagesuser").sortable({
|
||||
axis: "x",
|
||||
forcePlaceholderSize: true,
|
||||
placeholder: "li-placeholder",
|
||||
placeholder: "placeholder",
|
||||
update: function( event, ui ) {
|
||||
$('#pagesuser li').each(function(order) {
|
||||
var idpage=$(this).attr('id').replace("menupage-","");
|
||||
@ -149,7 +162,7 @@
|
||||
responsive: true,
|
||||
iDisplayLength: 10,
|
||||
order: [[ 1, "asc" ]],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
@ -174,25 +187,28 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Affichage des frames associés aux items de bureau
|
||||
function showFrameitem(id,url,forcereload) {
|
||||
$(".pageframe").hide();
|
||||
|
||||
if($("#frameitem-"+id).length) {
|
||||
if(forcereload) {
|
||||
$("#frameitem-"+id).attr("src",url);
|
||||
}
|
||||
$("#frameitem-"+id).show();
|
||||
}
|
||||
else {
|
||||
$("#pagecontainer").append("<iframe id='frameitem-"+id+"' class='pageframe' src='"+url+"' style='border:none; width:100%'></iframe>");
|
||||
}
|
||||
// Si force le rechargement et frame existante on la détruit
|
||||
if(forcereload&&$("#frameitem-"+id).length)
|
||||
$("#frameitem-"+id).remove();
|
||||
|
||||
// Si la frame en cours existe déjà on l'affiche
|
||||
if($("#frameitem-"+id).length)
|
||||
$("#frameitem-"+id).show();
|
||||
// Sinon on la génère
|
||||
else
|
||||
$("#pagecontainer").append("<iframe id='frameitem-"+id+"' class='pageframe' src='"+url+"' style='border:none; width:100%'></iframe>");
|
||||
|
||||
|
||||
resizeFrame();
|
||||
}
|
||||
|
||||
// Affichages des pages
|
||||
function showPage(id,catid,canupdate) {
|
||||
function showPage(id,catid,canupdate,forcereload) {
|
||||
// Sauvegarder la page en cours
|
||||
idpage=id;
|
||||
|
||||
@ -202,18 +218,22 @@
|
||||
// Rendre actif le page en cours dans le menu
|
||||
$(".navbar-top-links li").removeClass("active");
|
||||
$("#menupage-"+id).addClass("active");
|
||||
|
||||
var url="{{ path('cadoles_portal_user_page_view',{id:'xx'}) }}";
|
||||
url=url.replace('xx',id);
|
||||
|
||||
// Si la page en cours existe déjà on l'affiche
|
||||
if($("#page-"+id).length) {
|
||||
// Si force le rechargement et frame existante on la détruit
|
||||
if(forcereload&&$("#page-"+id).length)
|
||||
$("#page-"+id).remove();
|
||||
|
||||
// Si la frame en cours existe déjà on l'affiche
|
||||
if($("#page-"+id).length)
|
||||
$("#page-"+id).show();
|
||||
}
|
||||
// Sinon on la génère
|
||||
else {
|
||||
var url="{{ path('cadoles_portal_user_page_view',{id:'xx'}) }}";
|
||||
url=url.replace('xx',id);
|
||||
else
|
||||
$("#pagecontainer").append("<iframe id='page-"+id+"' data-category='"+catid+"' class='pageframe' src='"+url+"' style='border:none; width:100%'></iframe>");
|
||||
}
|
||||
|
||||
|
||||
// Cacher les actions possibles sur la page
|
||||
$("#menuupdate").hide();
|
||||
$("#menushare").hide();
|
||||
|
@ -0,0 +1,64 @@
|
||||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block pagewrapper %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
Modification Page {{ entity.pagecategory.name}}
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{{ form_widget(form.submit) }}
|
||||
{% if access=="config" %}
|
||||
<a class="btn btn-default" href="{{ path('cadoles_portal_config_page_view',{id:entity.id}) }}">Annuler</a>
|
||||
{% else %}
|
||||
<a class="btn btn-default" href="{{ path('cadoles_core_home',{id:entity.id}) }}">Annuler</a>
|
||||
{% endif %}
|
||||
|
||||
{% if mode=="update" %}
|
||||
<a href={{ path('cadoles_portal_'~access~'_page_delete',{'id':entity.id}) }}
|
||||
class="btn btn-danger pull-right"
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cette page ?">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="form-group row clearfix">
|
||||
{% if form.roles is defined %}
|
||||
<div class="col-md-8">
|
||||
{% else %}
|
||||
<div class="col-md-12">
|
||||
{% endif %}
|
||||
|
||||
{{ form_row(form.name) }}
|
||||
{{ form_row(form.roworder) }}
|
||||
</div>
|
||||
|
||||
{% if form.roles is defined %}
|
||||
<div class="col-md-4">
|
||||
{{ form_row(form.roles) }}
|
||||
{{ form_row(form.groups) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
@ -13,6 +13,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div id="loader"><img src="/{{alias}}/bundles/cadolescore/images/loading.gif" width="50px"></div>
|
||||
|
||||
<div id="gridtemplate" style="{% if entity.maxwidth>0%} max-width:{{ entity.maxwidth }}px; margin:auto; {% endif %} margin-bottom:30px">
|
||||
|
||||
@ -194,7 +195,7 @@
|
||||
|
||||
|
||||
// Création des grilles d'items
|
||||
var optiongrid={columnWidth: '.grid-sizer',itemSelector: '.grid-item'};
|
||||
var optiongrid={columnWidth: '.grid-sizer', itemSelector: '.grid-item', gutter: '.grid-gutter-sizer'};
|
||||
var grid = $('.grid').masonry(optiongrid);
|
||||
|
||||
// Preview item de bureau
|
||||
@ -227,8 +228,11 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Création des slick
|
||||
slick();
|
||||
|
||||
// cacher le loader
|
||||
$("#loader").hide();
|
||||
});
|
||||
|
||||
// function slick
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -7,7 +12,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate %}
|
||||
<div class="widgetmenu">
|
||||
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
|
@ -0,0 +1,79 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
||||
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
||||
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
{% set color = app.session.get('color') %}
|
||||
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% set colorbodyfont = color['fontcolorhover'] %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyback = entity.colorbodyback %}
|
||||
{% if colorbodyback is null %}
|
||||
{% set colorbodyback = color['main'] %}
|
||||
{% endif %}
|
||||
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% if colorbodyback==color['fontcolorhover'] %}
|
||||
{% set colorbodyfont = color['main'] %}
|
||||
{% else %}
|
||||
{% set colorbodyfont = color['fontcolorhover'] %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
<i class="fa fa-file fa-fw" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
|
||||
<a onClick="showFrameitem('blog','{{ path('cadoles_portal_'~access~'_blog_view') }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-paper-plane fa-fw"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
||||
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
|
||||
<span class="title">{{ entity.name }}</span>
|
||||
</div>
|
||||
|
||||
<div class="widgetbody" style="{{ stylewidgetbody }} {% if not entity.border %} padding-top:10px; {% endif %}">
|
||||
<div class="grid clearfix">
|
||||
{% for blogarticle in blogarticles %}
|
||||
{% if loop.index==1 %}
|
||||
<div class="grid-sizer grid-preview"></div>
|
||||
<div class="grid-gutter-sizer grid-gutter-sizer-preview"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item grid-preview">
|
||||
<a href onClick="showFrameitem('blog','{{ path('cadoles_portal_'~access~'_blogarticle_view',{'id':blogarticle.id}) }}',true)">
|
||||
{% if blogarticle.image is not empty %}
|
||||
<img src="/{{alias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%">
|
||||
{% endif %}
|
||||
<div class="caption" style="background-color: #{{ colorbodyfont }}; color: #{{ colorbodyback }};">
|
||||
<h1 class="grid-preview-title" style="color: #{{ colorbodyback }};">{{ blogarticle.name}}</h1>
|
||||
<small>publié par {{ blogarticle.user.username }} le {{ blogarticle.submit|date("d/m/Y à H:i") }}<br>dans le blog {{blogarticle.blog.name }}</small>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -18,7 +23,7 @@
|
||||
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
|
||||
{% endif %}
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate or canadd %}
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
@ -43,6 +48,7 @@
|
||||
<div class="bookmark-container">
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer {{ stylegrid }}"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% for bookmark in bookmarks %}
|
||||
<div class="grid-item {{ stylegrid }}">
|
||||
<div class="grid-item-content" style="background-color: {{ bookmark.color ? bookmark.color : '#FFF' }};">
|
||||
@ -81,6 +87,7 @@
|
||||
<h3 class="grid-title" data-idcategory="bookmark" style="{{ colorbodyfont }}">Favoris</h3>
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer {{ stylegrid }}"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -12,13 +17,13 @@
|
||||
|
||||
</style>
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
<i class="fa fa-file fa-fw" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
{% endif %}
|
||||
<a href="{{ path("cadoles_portal_"~access~"_calendar_view") }}" style="{{ stylewidgetmenu }}" target="_top"><i class="fa fa-calendar fa-fw"></i></a>
|
||||
<a onClick="showFrameitem('calendar','{{ path('cadoles_portal_'~access~'_calendar_view') }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-calendar fa-fw"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -5,7 +10,7 @@
|
||||
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
||||
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate %}
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -19,7 +24,7 @@
|
||||
{% set colorbodyfont = color['fontcolorhover'] %}
|
||||
{% endif %}
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate or canadd %}
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
@ -44,6 +49,7 @@
|
||||
{% for file in files|sort %}
|
||||
{% if loop.index==1 %}
|
||||
<div class="grid-sizer grid-small"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item grid-small">
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -12,7 +17,7 @@
|
||||
|
||||
</style>
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate %}
|
||||
<div class="widgetmenu">
|
||||
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
@ -40,7 +45,7 @@
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="cat-list-item" onClick="showFlux({{ entity.id}},{{ flux.id }})" style="{{ stylefeed }}">{{ flux.title }}</div>
|
||||
<div class="cat-list-feed" onClick="showFlux({{ entity.id}},{{ flux.id }})" style="{{ stylefeed }}">{{ flux.title }}</div>
|
||||
{% endfor %}
|
||||
|
||||
{% for feed in feeds %}
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -17,7 +22,7 @@
|
||||
{% set colorbodyfont = color['fontcolorhover'] %}
|
||||
{% endif %}
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate %}
|
||||
<div class="widgetmenu">
|
||||
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
@ -28,7 +33,7 @@
|
||||
|
||||
{% if onheader %}
|
||||
<div class="widgetheader" style="{{ stylewidgetbodyimage }}">
|
||||
<iframe src="{{ path(tool,{'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont}) }}" style="margin-top:50px" class="{% if entity.autoajust %}frameajust {% endif %}"></iframe>
|
||||
<iframe src="{{ path(tool,{'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont}) }}" style="margin-top:30px" class="{% if entity.autoajust %}frameajust {% endif %}"></iframe>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -19,7 +24,7 @@
|
||||
{% set colorbodyfont = color['fontcolorhover'] %}
|
||||
{% endif %}
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate or canadd %}
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
@ -43,7 +48,8 @@
|
||||
<div class="grid clearfix">
|
||||
{% for file in files|sort %}
|
||||
{% if loop.index==1 %}
|
||||
<div class="grid-sizer grid-image"></div>
|
||||
<div class="grid-sizer grid-image"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item grid-image">
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -18,7 +23,7 @@
|
||||
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
|
||||
{% endif %}
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate or canadd %}
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
@ -44,6 +49,7 @@
|
||||
<h3 class="grid-title" data-idcategory="bookmark" style="{{ colorbodyfont }}">Favoris</h3>
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer {{ stylegrid }}"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% for bookmark in bookmarks %}
|
||||
<div class="grid-item {{ stylegrid }}">
|
||||
<div class="grid-item-content" style="background-color: {{ bookmark.color ? bookmark.color : '#FFF' }};">
|
||||
@ -82,6 +88,7 @@
|
||||
<h3 class="grid-title" data-idcategory="bookmark" style="{{ colorbodyfont }}">Favoris</h3>
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer {{ stylegrid }}"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -98,6 +105,7 @@
|
||||
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer {{ stylegrid }}"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item {{ stylegrid }}" data-idcategory="{{ item.itemcategory.id }}" data-iditem="{{ item.id }}">
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -13,7 +18,7 @@
|
||||
{% set stylelink = "color:#" ~ color['fontcolorhover'] %}
|
||||
{% endif %}
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate %}
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
|
@ -0,0 +1,57 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
||||
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
||||
{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %}
|
||||
{% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(entity) %}
|
||||
|
||||
{% set color = app.session.get('color') %}
|
||||
{% set colorbodyfont = entity.colorbodyfont %}
|
||||
{% if colorbodyfont is null %}
|
||||
{% set colorbodyfont = color['main'] %}
|
||||
{% endif %}
|
||||
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate %}
|
||||
<div class="widgetmenu">
|
||||
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
<i class="fa fa-file fa-fw" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="widgetheader" style="{{ stylewidgetbodyimage }}">
|
||||
{% if seeicon %}
|
||||
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" />
|
||||
{% endif %}
|
||||
|
||||
{% if seetitle %}
|
||||
<span class="title">{{ entity.name }}</span>
|
||||
{% else %}
|
||||
<style>
|
||||
div.separator {
|
||||
width: 100%;
|
||||
height: 5px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
background-color:#{{colorbodyfont}};
|
||||
float:left;
|
||||
position: relative;
|
||||
top: 20px;
|
||||
}
|
||||
</style>
|
||||
<div class="separator"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
@ -1,3 +1,8 @@
|
||||
{% set theme = app.session.get('theme') %}
|
||||
{% if theme is not empty %}
|
||||
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
||||
{% endif %}
|
||||
|
||||
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
||||
|
||||
{% set stylewidget = constants.mystylewidget(entity) %}
|
||||
@ -12,7 +17,7 @@
|
||||
{% set stylelink = "color:#" ~ color['fontcolorhover'] ~ ";" %}
|
||||
{% endif %}
|
||||
|
||||
<div class="widget" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||
{% if canupdate or canadd %}
|
||||
<div class="widgetmenu">
|
||||
{% if canupdate %}
|
||||
|