diff --git a/library/Class/Feature.php b/library/Class/Feature.php index 1e1742cf1322096294b23008d7abcb3059352776..abcac560bb3e8d9f4d01e70af1bd9422390718de 100644 --- a/library/Class/Feature.php +++ b/library/Class/Feature.php @@ -25,7 +25,7 @@ class Class_Feature { Trait_Translator, Trait_StaticFileSystem; - protected static $_json_features; + protected static $_features; public function hasNew() { @@ -100,7 +100,11 @@ class Class_Feature { protected function _getFeatures() { - return array_map([$this, '_createInstances'], array_keys($FEATURES_LIST), $FEATURES_LIST); + if(static::$_features) + return static::$_features; + + $features = (new Class_Feature_List)->getFeatures(); + return static::$_features = array_map([$this, '_createInstances'], array_keys($features), $features); } diff --git a/library/Class/Feature/List.php b/library/Class/Feature/List.php index 2112a1390df60737e42779ccc12189d2db11581c..f7bbb4ab4ed922b46152c524a3e2dce80cb24146 100644 --- a/library/Class/Feature/List.php +++ b/library/Class/Feature/List.php @@ -1,22 +1,45 @@ <?php -$FEATURES_LIST = - [ +/** + * Copyright (c) 2012-2017, 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 + */ - '64573' => - [ 'label' => 'Essayer une autre charte graphique', - 'desc' => 'Bokeh vous permet de changer la personnalisation de votre OPAC en un clic.', - 'image' => '', - 'video' => '', - 'wiki' => 'http://wiki.bokeh-library-portal.org/index.php?title=7.10.0', - 'test' => '/admin/skin/index', - 'date' => '2017-09-15'], - '61314' => - ['label' => 'Explorateur de fichiers', - 'desc' => 'Gérer les fichiers dont vous avez besoin pour enrichir vos contenus', - 'image' => '', - 'video' => '', - 'wiki' => 'http://wiki.bokeh-library-portal.org/index.php?title=7.10.0', - 'test' => '/admin/file-manager/full_screen/1/display_mode_browser/wall?browser=userfiles/image', - 'date' => '2017-09-15'] - ]; \ No newline at end of file +class Class_Feature_List { + public function getFeatures() { + return [ + '64573' => + [ 'label' => 'Essayer une autre charte graphique', + 'desc' => 'Bokeh vous permet de changer la personnalisation de votre OPAC en un clic.', + 'image' => '', + 'video' => '', + 'wiki' => 'http://wiki.bokeh-library-portal.org/index.php?title=7.10.0', + 'test' => '/admin/skin/index', + 'date' => '2017-09-15'], + + '61314' => + ['label' => 'Explorateur de fichiers', + 'desc' => 'Gérer les fichiers dont vous avez besoin pour enrichir vos contenus', + 'image' => '', + 'video' => '', + 'wiki' => 'http://wiki.bokeh-library-portal.org/index.php?title=7.10.0', + 'test' => '/admin/file-manager/full_screen/1/display_mode_browser/wall?browser=userfiles/image', + 'date' => '2017-09-15'] + ]; + } +} \ No newline at end of file diff --git a/public/opac/js/new_features.json b/public/opac/js/new_features.json deleted file mode 100644 index 828470badc5231ac8098829254edd7bce75f10eb..0000000000000000000000000000000000000000 --- a/public/opac/js/new_features.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "64573" : { - "label" : "Essayer une autre charte graphique", - "desc" : "Bokeh vous permet de changer la personnalisation de votre OPAC en un clic.", - "image" : "", - "video" : "", - "wiki" : "http://wiki.bokeh-library-portal.org/index.php?title=7.10.0", - "test" : "/admin/skin/index", - "date" : "2017-09-15" - }, - - "61314" : { - "label" : "Explorateur de fichiers", - "desc" : "Gérer les fichiers dont vous avez besoin pour enrichir vos contenus", - "image" : "", - "video" : "", - "wiki" : "http://wiki.bokeh-library-portal.org/index.php?title=7.10.0", - "test" : "/admin/file-manager/full_screen/1/display_mode_browser/wall?browser=userfiles/image", - "date" : "2017-09-15" - } -}