diff --git a/application/modules/admin/controllers/IndexController.php b/application/modules/admin/controllers/IndexController.php index 1e233270629cc565600e054b164664938c85479c..891d9b25c479e9d6fb5e0af77491f8701be0d0ed 100644 --- a/application/modules/admin/controllers/IndexController.php +++ b/application/modules/admin/controllers/IndexController.php @@ -20,7 +20,13 @@ */ class Admin_IndexController extends ZendAfi_Controller_Action { public function indexAction() { - $this->view->titre = $this->_('Accueil'); + $this->view->titre = $this->_('Accueil') + . $this->view->tag('span', + $this->_(' version %s', + $this->view->tag('a', BOKEH_RELEASE_NUMBER, + ['href' => BOKEH_REMOTE_FILES . 'blob/' . BOKEH_VERSION . '/VERSIONS'])), + ['class' => 'version']); + $this->view->user = Class_Users::getIdentity(); // Activation - désactivation du site diff --git a/application/modules/admin/views/scripts/index/index.phtml b/application/modules/admin/views/scripts/index/index.phtml index 351d936a34549eedf6e40846a18e018b1eb5d814..35ea741f97c7edce1b856331cc0f927455fccae5 100644 --- a/application/modules/admin/views/scripts/index/index.phtml +++ b/application/modules/admin/views/scripts/index/index.phtml @@ -1,12 +1,4 @@ -<?php -echo $this->tag('h2', - $this->_('Version') . ' : ' . $this->tag('a', - BOKEH_RELEASE_NUMBER, - ['href' => BOKEH_REMOTE_FILES . 'blob/' . BOKEH_VERSION . '/VERSIONS'])); -?> - - - <h2><?php echo $this->traduire('Paramètres du site');?> :</h2> +<h2><?php echo $this->traduire('Paramètres du site');?> :</h2> <?php $profil = Class_Profil::getCurrentProfil(); $lien_edit_site = $lien = $edit_domain_name = ''; diff --git a/tests/application/modules/admin/controllers/IndexControllerTest.php b/tests/application/modules/admin/controllers/IndexControllerTest.php index cdec33f87eed4e18b70b7e605761a7f5685972b1..3c01f362d3f45244033a97c664ecbeb1fdc615e8 100644 --- a/tests/application/modules/admin/controllers/IndexControllerTest.php +++ b/tests/application/modules/admin/controllers/IndexControllerTest.php @@ -1,49 +1,49 @@ <?php - /** - * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved. - * - * BOKEH 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). - * - * BOKEH 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 BOKEH; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - require_once 'AdminAbstractControllerTestCase.php'; - - abstract class Admin_IndexControllerTestCase extends Admin_AbstractControllerTestCase { - protected - $_storm_default_to_volatile = true, - $_cms_menu_path = '//div[@class="menuGaucheAdmin"][.//td[text()="Gestionnaire de contenu"]]', - $_bibnum_menu_path = '//div[@class="menuGaucheAdmin"][.//td[text()="Bibliothèque numérique"]]'; - } - - - - class Admin_IndexControllerTest extends Admin_IndexControllerTestCase { - - public function setUp() { - parent::setUp(); - $this->fixture('Class_AdminVar', - ['id' => 'NOM_DOMAINE', - 'clef' => 'NOM_DOMAINE', - 'valeur' => 'http://bokeh-library-portal.org']); - - $this->dispatch('/admin/index/index', true); - } - - - /** @test */ +/** + * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH 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). + * + * BOKEH 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 BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +require_once 'AdminAbstractControllerTestCase.php'; + +abstract class Admin_IndexControllerTestCase extends Admin_AbstractControllerTestCase { + protected + $_storm_default_to_volatile = true, + $_cms_menu_path = '//div[@class="menuGaucheAdmin"][.//td[text()="Gestionnaire de contenu"]]', + $_bibnum_menu_path = '//div[@class="menuGaucheAdmin"][.//td[text()="Bibliothèque numérique"]]'; +} + + + +class Admin_IndexControllerTest extends Admin_IndexControllerTestCase { + + public function setUp() { + parent::setUp(); + $this->fixture('Class_AdminVar', + ['id' => 'NOM_DOMAINE', + 'clef' => 'NOM_DOMAINE', + 'valeur' => 'http://bokeh-library-portal.org']); + + $this->dispatch('/admin/index/index', true); + } + + + /** @test */ public function fileBokeh74ShouldBeLoaded() { $this->assertXPath('//link[contains(@href, "bokeh74/global.css")]'); } @@ -74,6 +74,12 @@ } + /** @test */ + public function titleShouldContainsVersion() { + $this->assertXPathContentContains('//div[@class="modules"]//h1//a', BOKEH_RELEASE_NUMBER); + } + + /** @test */ public function domaineNameShouldPresent() { $this->assertXPathContentContains('//div/b', 'http://bokeh-library-portal.org'); @@ -92,12 +98,6 @@ } - /** @test */ - public function linkToDocShouldBePresent() { - $this->assertXPathContentContains('//h2/a[contains(@href, "/blob/' . BOKEH_VERSION . '/VERSIONS")]', BOKEH_RELEASE_NUMBER); - } - - /** @test */ public function onloadUtilsJsShouldBeLoaded() { $this->assertXPath('//script[contains(@src, "onload_utils.js")]'); @@ -244,12 +244,12 @@ class Admin_IndexControllerWithSkinSelectorTest extends Admin_AbstractController parent::setUp(); Class_Admin_Skin::setFileSystem( - (new Storm_FileSystem_Volatile()) - ->mkdir(Class_Admin_Skin::DEFAULT_ADMIN_PATH . 'bokeh88') - ->mkdir(Class_Admin_Skin::DEFAULT_ADMIN_PATH . 'bokeh2000') - ->mkdir(Class_Admin_Skin::DEFAULT_ADMIN_PATH . 'bokeh88/' . Class_Admin_Skin::ADMIN_COLORS_FOLDER) - ->mkdir(Class_Admin_Skin::DEFAULT_ADMIN_PATH . 'bokeh2000/' . Class_Admin_Skin::ADMIN_COLORS_FOLDER) - ->touch(Class_Admin_Skin::DEFAULT_ADMIN_PATH . 'bokeh2000/' . Class_Admin_Skin::ADMIN_COLORS_FOLDER . '/blue.css') + (new Storm_FileSystem_Volatile()) + ->mkdir(Class_Admin_Skin::DEFAULT_ADMIN_PATH . 'bokeh88') + ->mkdir(Class_Admin_Skin::DEFAULT_ADMIN_PATH . 'bokeh2000') + ->mkdir(Class_Admin_Skin::DEFAULT_ADMIN_PATH . 'bokeh88/' . Class_Admin_Skin::ADMIN_COLORS_FOLDER) + ->mkdir(Class_Admin_Skin::DEFAULT_ADMIN_PATH . 'bokeh2000/' . Class_Admin_Skin::ADMIN_COLORS_FOLDER) + ->touch(Class_Admin_Skin::DEFAULT_ADMIN_PATH . 'bokeh2000/' . Class_Admin_Skin::ADMIN_COLORS_FOLDER . '/blue.css') ); Class_Users::getIdentity()->setAdminSkin([Class_User_Settings::ADMIN_SKIN => 'bokeh2000',