diff --git a/library/Class/Systeme/ModulesAccueil.php b/library/Class/Systeme/ModulesAccueil.php index e622591820c0259757ef9b4432165646748dfaf3..a675142a2ce2b16d81c65c69f2c928632302b55b 100644 --- a/library/Class/Systeme/ModulesAccueil.php +++ b/library/Class/Systeme/ModulesAccueil.php @@ -126,10 +126,13 @@ class Class_Systeme_ModulesAccueil extends Class_Systeme_ModulesAbstract { 'MULTIMEDIA' => new Class_Systeme_ModulesAccueil_Multimedia, 'HISTORIQUE_RECHERCHES' => new Class_Systeme_ModulesAccueil_HistoriqueRecherches, 'PANIER' => new Class_Systeme_ModulesAccueil_Panier, - 'DOMAIN_BROWSER' => new Class_Systeme_ModulesAccueil_DomainBrowser + 'DOMAIN_BROWSER' => new Class_Systeme_ModulesAccueil_DomainBrowser, ]; } + Class_Adminvar::isFormationEnabled() + ? self::$_modules['FORMATIONS'] = new Class_Systeme_ModulesAccueil_Formations : '' ; + return self::$_modules; } } \ No newline at end of file diff --git a/library/Class/Systeme/ModulesAccueil/Formations.php b/library/Class/Systeme/ModulesAccueil/Formations.php new file mode 100644 index 0000000000000000000000000000000000000000..f86fd136b7ff5949be37f62e54bf86ffb13312a2 --- /dev/null +++ b/library/Class/Systeme/ModulesAccueil/Formations.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved. + * + * AFI-OPAC 2.0 is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * AFI-OPAC 2.0 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with AFI-OPAC 2.0; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +class Class_Systeme_ModulesAccueil_Formations extends Class_Systeme_ModulesAccueil_Null { + protected $_group = Class_Systeme_ModulesAccueil::GROUP_INFO; + + protected $_libelle = 'Formations'; + + protected $_action = ''; + + protected $_popupWidth = 600; + + protected $_popupHeight = 700; + + protected $_defaultValues = ['titre' => 'Formations']; +} +?> \ No newline at end of file diff --git a/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php b/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php index 8cdff99e86b9eb978707ea955de7e0aa615140f0..12723c84b828d6b754039ea51cc3060ec8e1fbed 100644 --- a/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php +++ b/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php @@ -23,6 +23,9 @@ require_once 'AdminAbstractControllerTestCase.php'; abstract class Admin_ProfilControllerPageAccueilJeunesseTestCase extends Admin_AbstractControllerTestCase { public function setUp() { parent::setUp(); + + Class_AdminVar::getLoader()->newInstanceWithId('FORMATIONS') + ->setValeur(1); $cfg_accueil = [ 'page_css' => '', 'use_parent_css' => 1, @@ -166,6 +169,12 @@ class Admin_ProfilControllerPageAccueilJeunesseTest extends Admin_ProfilControll } + /** @test */ + public function boiteFormationsShouldBeAvailable() { + $this->assertXPathContentContains('//ul[@id="allItems"]/li[@id="FORMATIONS"]','Formations'); + } + + /** @test */ public function boiteNewsShouldBeInDivisionOne() { $this->assertXPath('//ul[@id="box1"]/li[@id="NEWS"][@id_module="2"]'); @@ -764,4 +773,4 @@ class Admin_ProfilControllerPageAccueilNoPanierTest extends Admin_ProfilControll $this->assertXPath('//ul[@id="box5"]/li[@id="PANIER"]'); } } -?> +?> \ No newline at end of file