Commit 4c01c90c authored by Maxime Frieh's avatar Maxime Frieh
Browse files

add Map and Info configuration options by admin

parent 8080b76c
......@@ -28,5 +28,5 @@ ssh_password
*.csv
/web/assets/images/*
pdcn-home-script\.js
*~
TODO_MULTI_INSTANCE
......@@ -10,7 +10,7 @@ Feel free to add some more informations if you solve installation issues !
Requirements
------------
1. Php
1. Php (Sur Linux : php7.2-curl)
2. [Composer](https://getcomposer.org/download/)
3. [Nodejs](https://nodejs.org/en/download/)
4. [Git](https://git-scm.com/)
......
......@@ -51,10 +51,15 @@ class RegistrationFormHandler
if ('POST' === $this->request->getMethod()) {
$form->handleRequest($this->request);
$user = $form->getData();
$usersSameEmail = $this->userManager->findUserByEmail($user->getEmail());
$alreadyUsedEmail = $usersSameEmail === null ? false : count($usersSameEmail) > 1;
$userSameName = $this->userManager->findUserByUsername($user->getUsername());
array $alreadyUsedUserName() = $userSameName === null ? false : count($userSameName);
$alreadyUsedEmail = count($this->userManager->findUserByEmail($user->getEmail())) > 0;
$alreadyUsedUserName = count($this->userManager->findUserByUsername($user->getUsername())) > 0;
$locoationSetToReceiveNewsletter = $user->getNewsletterFrequency() > 0 && !$user->getLocation();
$geocodeError = false;
if ($user->getLocation()) {
try
......
......@@ -39,8 +39,8 @@ class ConfigurationHomeAdmin extends AbstractAdmin
->add('activateHomePage', null, array('label' => "Activer la page d'accueil", 'required' => false))
->add('backgroundImage', 'sonata_type_model', array_replace($imagesOptions,['label' => 'Image de fond (le nom du fichier ne doit pas contenir d\'espaces ou de caractères spéciaux']))
->add('home.displayCategoriesToPick', 'checkbox', array('label' => "Afficher les catégories principales selectionnables pour la recherche", 'required' => false))
->add('home.addElementHintText', null, array('label' => "Texte au dessus du bouton \"Ajouter un élément\"", 'required' => false))
->add('home.seeMoreButtonText', null, array('label' => "Texte pour inviter à scroller (si des bandeaux de la page d'accueil existent)", 'required' => false))
->add('home.addElementHintText', 'text', array('label' => "Texte au dessus du bouton \"Ajouter un élément\"", 'required' => false))
->add('home.seeMoreButtonText', 'text', array('label' => "Texte pour inviter à scroller (si des bandeaux de la page d'accueil existent)", 'required' => false))
;
}
}
\ No newline at end of file
......@@ -71,12 +71,20 @@ class ConfigurationMapAdmin extends AbstractAdmin
->end()
->end()
->tab('Menu')
->add('map.width', null, array('label' => "Largueur du menu", 'required' => false))
->add('map.smallWidthStyle', 'checkbox', array('required' => false))
->add('map.showOnePanePerMainOption', 'checkbox', array('required' => false))
->add('map.showCheckboxForMainFilterPane', 'checkbox', array('required' => false))
->add('map.showCheckboxForSubFilterPane', 'checkbox', array('required' => false))
->with('Menu')
->add('menu.width', 'number', array('label' => "Largueur du menu", 'required' => false))
->add('menu.smallWidthStyle', 'checkbox', array('required' => false))
->add('menu.showOnePanePerMainOption', 'checkbox', array('required' => false))
->add('menu.showCheckboxForMainFilterPane', 'checkbox', array('required' => false))
->add('menu.showCheckboxForSubFilterPane', 'checkbox', array('required' => false))
->end()
->end()
;
->tab('Infobar')
->with('Infobar')
->add('infobar.width', 'number', array('label' => "Largeur de la barre d'info", 'required' => false))
->add('infobar.activate', 'checkbox', array('required' => false))
->add('infobar.BodyTemplate', 'checkbox', array('required' => false))
->end()
->end();
}
}
\ No newline at end of file
}
......@@ -6,7 +6,8 @@ use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
use Gedmo\Mapping\Annotation as Gedmo;
use Biopen\CoreBundle\Document\ConfImage;
use Biopen\CoreBundle\Document\Configuration\ConfigurationUser;
use Biopen\CoreBundle\Document\Configuration\ConfigurationMap;
use Biopen\CoreBundle\Document\Configuration\ConfigurationMenu;
use Biopen\CoreBundle\Document\Configuration\ConfigurationInfobar;
/**
......@@ -185,8 +186,11 @@ class Configuration
// --------- MAP -----------
// -------------------------
/** @MongoDB\EmbedOne(targetDocument="Biopen\CoreBundle\Document\Configuration\ConfigurationMap") */
protected $map;
/** @MongoDB\EmbedOne(targetDocument="Biopen\CoreBundle\Document\Configuration\ConfigurationMenu") */
protected $menu;
/** @MongoDB\EmbedOne(targetDocument="Biopen\CoreBundle\Document\Configuration\ConfigurationInfobar") */
protected $infobar;
/** @MongoDB\ReferenceOne(targetDocument="Biopen\CoreBundle\Document\TileLayer") */
protected $defaultTileLayer;
......@@ -403,7 +407,23 @@ class Configuration
$this->directModerationFeature = new InteractionConfiguration();
$this->user = new ConfigurationUser();
$this->map = new ConfigurationMap();
$this->menu = new ConfigurationMenu();
$this->infobar = new ConfigurationInfobar();
/*
listMode
searchPlace
searchGeolocate
directions: {},
layers: {},
mapdefaultview: {}
avec model FeatureConfiguration
saveViewportInCookies : true,
saveTileLayerInCookies : true,
*/
}
......@@ -2314,6 +2334,7 @@ class Configuration
*/
public function getHome()
{
if(!$this->home) $this->home = new ConfigurationHome();
return $this->home;
}
......@@ -2529,24 +2550,48 @@ class Configuration
}
/**
* Set map
* Set menu
*
* @param Biopen\CoreBundle\Document\Configuration\ConfigurationMenu $menu
* @return $this
*/
public function setMenu(\Biopen\CoreBundle\Document\Configuration\ConfigurationMenu $menu)
{
$this->menu = $menu;
return $this;
}
/**
* Get menu
*
* @return Biopen\CoreBundle\Document\Configuration\ConfigurationMenu $menu
*/
public function getMenu()
{
if(!$this->menu) $this->menu = new ConfigurationMenu();
return $this->menu;
}
/**
* Set infobar
*
* @param Biopen\CoreBundle\Document\Configuration\ConfigurationMap $map
* @param Biopen\CoreBundle\Document\Configuration\ConfigurationInfobar $infobar
* @return $this
*/
public function setMap(\Biopen\CoreBundle\Document\Configuration\ConfigurationMap $map)
public function setInfobar(\Biopen\CoreBundle\Document\Configuration\ConfigurationInfobar $infobar)
{
$this->map = $map;
$this->infobar = $infobar;
return $this;
}
/**
* Get map
* Get infobar
*
* @return Biopen\CoreBundle\Document\Configuration\ConfigurationMap $map
* @return Biopen\CoreBundle\Document\Configuration\ConfigurationInfobar $infobar
*/
public function getMap()
public function getInfobar()
{
return $this->map;
if(!$this->infobar) $this->infobar = new ConfigurationInfobar();
return $this->infobar;
}
}
<?php
namespace Biopen\CoreBundle\Document\Configuration;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
/** @MongoDB\EmbeddedDocument */
class ConfigurationInfobar
{
/** @MongoDB\Field(type="int") */
protected $width = null;
/** @MongoDB\Field(type="bool") */
protected $activate = true;
/** @MongoDB\Field(type="int") */
protected $bodyTemplate = null;
/**
* Set width
*
* @param int $width
* @return $this
*/
public function setWidth($width)
{
$this->width = $width;
return $this;
}
/**
* Get width
*
* @return int $width
*/
public function getWidth()
{
return $this->width;
}
/**
* Set activate
*
* @param bool $activate
* @return $this
*/
public function setActivate($activate)
{
$this->activate = $activate;
return $this;
}
/**
* Get activate
*
* @return bool $activate
*/
public function getActivate()
{
return $this->activate;
}
/**
* Set bodyTemplate
*
* @param int $bodyTemplate
* @return $this
*/
public function setBodyTemplate($bodyTemplate)
{
$this->bodyTemplate = $bodyTemplate;
return $this;
}
/**
* Get bodyTemplate
*
* @return int $bodyTemplate
*/
public function getBodyTemplate()
{
return $this->bodyTemplate;
}
}
......@@ -5,7 +5,7 @@ namespace Biopen\CoreBundle\Document\Configuration;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
/** @MongoDB\EmbeddedDocument */
class ConfigurationMap
class ConfigurationMenu
{
/** @MongoDB\Field(type="int") */
protected $width = null;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment