Commit 13d0bfa7 authored by lecluse's avatar lecluse
Browse files

Conversion de tableaux en syntaxe courte

parent abe47ad6
......@@ -2,7 +2,7 @@
$env = getenv('APP_ENV') ?: 'production';
$modules = array(
$modules = [
'ZfcBase', 'DoctrineModule', 'DoctrineORMModule', 'ZfcUser', 'ZfcUserDoctrineORM', 'BjyAuthorize',
'UnicaenApp', //'AssetManager',
'UnicaenAuth',
......@@ -10,7 +10,7 @@ $modules = array(
'Common',
'Import',
'Application'
);
];
if ($env == 'development') {
if ( 'dig-40' == getenv('HTTP_HOST')){
......@@ -18,15 +18,15 @@ if ($env == 'development') {
}
}
return array(
return [
'modules' => $modules,
'module_listener_options' => array(
'config_glob_paths' => array(
'module_listener_options' => [
'config_glob_paths' => [
'config/autoload/{,*.}{global,local}.php',
),
'module_paths' => array(
],
'module_paths' => [
'./module',
'./vendor',
),
),
);
],
],
];
<?php
return array(
'translator' => array(
return [
'translator' => [
'locale' => 'fr_FR',
),
);
],
];
<?php
return array(
'view_manager' => array(
return [
'view_manager' => [
'display_not_found_reason' => false,
'display_exceptions' => false,
),
);
],
];
......@@ -2,31 +2,31 @@
/**
* UnicaenApp Global Configuration
*
* If you have a ./config/autoload/ directory set up for your project,
* If you have a ./config/autoload/ directory set up for your project,
* drop this config file in it and change the values as you wish.
*/
$settings = array(
$settings = [
/**
* Informations concernant cette application
*/
'app_infos' => array(
'app_infos' => [
'nom' => "OSE",
'desc' => "Organisation des Services d'Enseignement",
'version' => "1.4.4",
'date' => "17/03/2015",
'contact' => array('mail' => "Contactez votre composante.", /*'tel' => "01 02 03 04 05"*/),
'contact' => ['mail' => "Contactez votre composante.", /*'tel' => "01 02 03 04 05"*/],
'mentionsLegales' => "http://www.unicaen.fr/outils-portail-institutionnel/mentions-legales/",
'informatiqueEtLibertes' => "http://www.unicaen.fr/outils-portail-institutionnel/informatique-et-libertes/",
),
],
/**
* Période d'exécution de la requête de rafraîchissement de la session utilisateur, en millisecondes.
*/
'session_refresh_period' => 600000, // 10*60*1000 ms = 10 min
);
];
/**
* You do not need to edit below this line
*/
return array(
return [
'unicaen-app' => $settings,
);
\ No newline at end of file
];
\ No newline at end of file
......@@ -5,7 +5,7 @@
* If you have a ./config/autoload/ directory set up for your project, you can
* drop this config file in it and change the values as you wish.
*/
$settings = array(
$settings = [
/**
* Flag indiquant si l'utilisateur authenitifié avec succès via l'annuaire LDAP doit
* être enregistré/mis à jour dans la table des utilisateurs de l'appli.
......@@ -17,14 +17,14 @@ $settings = array(
* Accepted values: boolean true or false
*/
'enable_registration' => false,
);
];
/**
* You do not need to edit below this line
*/
return array(
return [
'unicaen-auth' => $settings,
'zfcuser' => array(
'zfcuser' => [
$k='enable_registration' => isset($settings[$k]) ? $settings[$k] : false,
),
);
\ No newline at end of file
],
];
\ No newline at end of file
<?php
$settings = array(
);
$settings = [
];
return array(
return [
'unicaen-ldap' => $settings
);
];
......@@ -35,7 +35,7 @@ class Module implements ControllerPluginProviderInterface, ViewHelperProviderInt
$moduleRouteListener->attach($eventManager);
$eventManager->attach($sm->get('AuthenticatedUserSavedListener'));
/* Utilise un layout spécial si on est en AJAX. Valable pour TOUS les modules de l'application */
$eventManager->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController','dispatch',
function( \Zend\Mvc\MvcEvent $e) {
......@@ -44,9 +44,9 @@ class Module implements ControllerPluginProviderInterface, ViewHelperProviderInt
}
}
);
$eventManager->attach(MvcEvent::EVENT_ROUTE, array($this, 'injectRouteEntitiesInEvent'), -90);
$eventManager->attach(MvcEvent::EVENT_ROUTE, array($this, 'checkRouteParams'), -100);
$eventManager->attach(MvcEvent::EVENT_ROUTE, [$this, 'injectRouteEntitiesInEvent'], -90);
$eventManager->attach(MvcEvent::EVENT_ROUTE, [$this, 'checkRouteParams'], -100);
}
public function injectPublicFiles(ServiceLocatorInterface $serviceLocator)
......@@ -56,7 +56,7 @@ class Module implements ControllerPluginProviderInterface, ViewHelperProviderInt
$cssFiles = []; if (isset($config['css'])) $cssFiles = $config['css'];
$basePath = $serviceLocator->get('viewhelpermanager')->get('basePath')->__invoke();
$offset = 10;
foreach( $jsFiles as $jsFile ){
$offset++;
......@@ -72,8 +72,8 @@ class Module implements ControllerPluginProviderInterface, ViewHelperProviderInt
/**
* Recherche de chaque entité spécifiée par son identifiant dans la requête courante,
* et injection de cette entité dans l'événement MVC courant.
*
* et injection de cette entité dans l'événement MVC courant.
*
* @param \Zend\Mvc\MvcEvent $e
* @see Service\NavigationPagesProvider
*/
......@@ -98,9 +98,9 @@ class Module implements ControllerPluginProviderInterface, ViewHelperProviderInt
}
/**
* Si l'utilisateur connecté a le profil "Intervenant", vérification que l'intervenant spécifié dans
* Si l'utilisateur connecté a le profil "Intervenant", vérification que l'intervenant spécifié dans
* la requête est bien celui connecté.
*
*
* @param \Zend\Mvc\MvcEvent $e
*/
public function checkRouteParams(MvcEvent $e)
......@@ -122,18 +122,18 @@ class Module implements ControllerPluginProviderInterface, ViewHelperProviderInt
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
return [
'Zend\Loader\StandardAutoloader' => [
'namespaces' => [
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
],
],
];
}
/**
* Retourne les fichiers javascript et CSS à ajouter au HEAD
*
*
* @return array
*/
public function getPublicFilesConfig()
......@@ -157,12 +157,12 @@ class Module implements ControllerPluginProviderInterface, ViewHelperProviderInt
*/
public function getControllerPluginConfig()
{
return array(
'invokables' => array(
return [
'invokables' => [
'em' => 'Application\Controller\Plugin\Em',
'context' => 'Application\Controller\Plugin\Context',
),
);
],
];
}
/**
......@@ -174,30 +174,30 @@ class Module implements ControllerPluginProviderInterface, ViewHelperProviderInt
*/
public function getViewHelperConfig()
{
return array(
'factories' => array(
),
'invokables' => array(
return [
'factories' => [
],
'invokables' => [
'intervenantDl' => 'Application\View\Helper\IntervenantDl',
'adresseDl' => 'Application\View\Helper\AdresseDl',
'elementPedagogiqueDl' => 'Application\View\Helper\OffreFormation\ElementPedagogiqueDl',
'etapeDl' => 'Application\View\Helper\OffreFormation\EtapeDl',
'fieldsetElementPedagogiqueRecherche' => 'Application\View\Helper\OffreFormation\FieldsetElementPedagogiqueRecherche',
),
);
],
];
}
public function getConsoleUsage(ConsoleAdapterInterface $console)
{
return array(
return [
"Notifications",
'notifier indicateurs [--force] --requestUriHost= [--requestUriScheme=]' => "Notification par mail des personnes abonnées à des indicateurs",
array('--force', "Facultatif", "Envoie les mails sytématiquement, sans tenir compte de la fréquence de notification."),
array('--requestUriHost', "Obligatoire", "Exemples: \"/ose.unicaen.fr\", \"/test.unicaen.fr/ose\"."),
array('--requestUriScheme', "Facultatif", "Exemples: \"http\" (par défaut), \"https\"."),
);
['--force', "Facultatif", "Envoie les mails sytématiquement, sans tenir compte de la fréquence de notification."],
['--requestUriHost', "Obligatoire", "Exemples: \"/ose.unicaen.fr\", \"/test.unicaen.fr/ose\"."],
['--requestUriScheme', "Facultatif", "Exemples: \"http\" (par défaut), \"https\"."],
];
}
public function getConsoleBanner(ConsoleAdapterInterface $console)
{
return "OSE Application Module";
......@@ -207,5 +207,5 @@ class Module implements ControllerPluginProviderInterface, ViewHelperProviderInt
class Listener extends \BjyAuthorize\Guard\Controller
{
}
......@@ -22,237 +22,237 @@ use Application\Acl\FoadRole;
use Application\Acl\ResponsableFoadRole;
use Application\Controller\AgrementController;
return array(
'router' => array(
'routes' => array(
'intervenant' => array(
'child_routes' => array(
'agrement' => array(
return [
'router' => [
'routes' => [
'intervenant' => [
'child_routes' => [
'agrement' => [
'type' => 'Segment',
'options' => array(
'options' => [
'route' => '/:intervenant/agrement',
'constraints' => array(
'constraints' => [
'intervenant' => '[0-9]*',
),
'defaults' => array(
],
'defaults' => [
'controller' => 'Agrement',
'action' => 'index',
),
),
],
],
'may_terminate' => true,
'child_routes' => array(
'liste' => array(
'child_routes' => [
'liste' => [
'type' => 'Segment',
'options' => array(
'options' => [
'route' => '/:typeAgrement',
'constraints' => array(
'constraints' => [
'typeAgrement' => '[0-9]*',
),
'defaults' => array(
],
'defaults' => [
'action' => 'lister',
),
),
),
'ajouter' => array(
],
],
],
'ajouter' => [
'type' => 'Segment',
'options' => array(
'options' => [
'route' => '/:typeAgrement/ajouter',
'constraints' => array(
'constraints' => [
'typeAgrement' => '[0-9]*',
),
'defaults' => array(
],
'defaults' => [
'action' => AgrementController::ACTION_AJOUTER,
),
),
),
'voir' => array(
],
],
],
'voir' => [
'type' => 'Segment',
'options' => array(
'options' => [
'route' => '/voir/:agrement',
'constraints' => array(
'constraints' => [
'agrement' => '[0-9]*',
),
'defaults' => array(
],
'defaults' => [
'action' => AgrementController::ACTION_VOIR,
),
),
),
'voir-str' => array(
],
],
],
'voir-str' => [
'type' => 'Segment',
'options' => array(
'options' => [
'route' => '/:typeAgrement/voir-str[/:structure]',
'constraints' => array(
'constraints' => [
'typeAgrement' => '[0-9]*',
'structure' => '[0-9]*',
),
'defaults' => array(
],
'defaults' => [
'action' => AgrementController::ACTION_VOIR_STR,
),
),
),
'modifier' => array(
],
],
],
'modifier' => [
'type' => 'Segment',
'options' => array(
'options' => [
'route' => '/modifier/:agrement',
'constraints' => array(
'constraints' => [
'agrement' => '[0-9]*',
),
'defaults' => array(
],
'defaults' => [
'action' => AgrementController::ACTION_MODIFIER,
),
),
),
),
),
),
),
'gestion' => array(
'child_routes' => array(
'agrement' => array(
],
],
],
],
],
],
],
'gestion' => [
'child_routes' => [
'agrement' => [
'type' => 'Literal',
'options' => array(
'options' => [
'route' => '/agrement',
'defaults' => array(
'defaults' => [
'controller' => 'Agrement',
'action' => 'index'
),
),
],
],
'may_terminate' => true,
'child_routes' => array(
'ajouter-lot' => array(
'child_routes' => [
'ajouter-lot' => [
'type' => 'Segment',
'options' => array(
'options' => [
'route' => '/:typeAgrement/ajouter-lot',
'constraints' => array(
'constraints' => [
'typeAgrement' => '[0-9]*',
),
'defaults' => array(
],
'defaults' => [
'action' => AgrementController::ACTION_AJOUTER_LOT,
),
),
),
),
),
),
),
),
),
'navigation' => array(
'default' => array(
'home' => array(
'pages' => array(
'intervenant' => array(
'pages' => array(
'agrement' => array(
],
],
],
],
],
],
],
],
],
'navigation' => [
'default' => [
'home' => [
'pages' => [
'intervenant' => [
'pages' => [
'agrement' => [
'label' => "Agrément",
'title' => "Agrément de l'intervenant",
'route' => 'intervenant/agrement',
'paramsInject' => array(
'paramsInject' => [
'intervenant',
),
],
'withtarget' => true,
'resource' => 'controller/Application\Controller\Agrement:index',
'visible' => 'IntervenantNavigationPageVisibility',
'pagesProvider' => array(
'pagesProvider' => [
'type' => 'AgrementIntervenantNavigationPagesProvider',
'route' => 'intervenant/agrement/liste',
'paramsInject' => array(
'paramsInject' => [
'intervenant',
),
],
'withtarget' => true,
'resource' => 'controller/Application\Controller\Agrement:lister',
'visible' => 'IntervenantNavigationPageVisibility',
),
),
),
),
'gestion' => array(
'pages' => array(
'agrement' => array(
],
],
],
],
'gestion' => [
'pages' => [
'agrement' => [
'label' => "Agréments par lot",
'title' => "Gestion des agréments par lot",
'route' => 'gestion/agrement',
'resource' => 'controller/Application\Controller\Agrement:index',
'pagesProvider' => array(
'pagesProvider' => [
'type' => 'AgrementNavigationPagesProvider',
'route' => 'gestion/agrement/ajouter-lot',
'withtarget' => true,
'resource' => 'controller/Application\Controller\Agrement:' . AgrementController::ACTION_AJOUTER_LOT,
'privilege' => AgrementController::ACTION_AJOUTER_LOT,
// NB: le code du type d'agrément sera concaténé au 'privilege' par le AgrementNavigationPagesProvider
),
),
),
),
),
),
),
),
'bjyauthorize' => array(
'guards' => array(
'BjyAuthorize\Guard\Controller' => array(
array(
],
],
],
],
],
],
],
],
'bjyauthorize' => [
'guards' => [
'BjyAuthorize\Guard\Controller' => [
[
'controller' => 'Application\Controller\Agrement',
'action' => array('index', 'lister', 'voir'),
'roles' => array(IntervenantRole::ROLE_ID, ComposanteRole::ROLE_ID, AdministrateurRole::ROLE_ID),
'action' => ['index', 'lister', 'voir'],
'roles' => [IntervenantRole::ROLE_ID, ComposanteRole::ROLE_ID, AdministrateurRole::ROLE_ID],
'assertion' => 'AgrementAssertion',
),
array(
],
[
'controller' => 'Application\Controller\Agrement',
'action' => array('ajouter', 'ajouter-lot', 'modifier', 'supprimer', 'voir-str'),
'roles' => array(ComposanteRole::ROLE_ID, AdministrateurRole::ROLE_ID),
'action' => ['ajouter', 'ajouter-lot', 'modifier', 'supprimer', 'voir-str'],
'roles' => [ComposanteRole::ROLE_ID, AdministrateurRole::ROLE_ID],
'assertion' => 'AgrementAssertion',
),
),
),
'resource_providers' => array(
'BjyAuthorize\Provider\Resource\Config' => array(
'Agrement' => array(),
),
<