From efba73cd9481efd17049d656de0486d0861c326f Mon Sep 17 00:00:00 2001
From: gloas <gloas@afi-sa.fr>
Date: Mon, 26 Mar 2018 16:02:26 +0200
Subject: [PATCH] dev #68179 add menu entry

---
 .../digital_resources/StoryPlayR/Config.php   |  3 +++
 .../StoryPlayR/ModuleMenu.php                 | 23 +++++++++++++++++++
 .../StoryPlayR/tests/StoryPlayRTest.php       | 10 ++++++++
 3 files changed, 36 insertions(+)
 create mode 100644 library/digital_resources/StoryPlayR/ModuleMenu.php

diff --git a/library/digital_resources/StoryPlayR/Config.php b/library/digital_resources/StoryPlayR/Config.php
index 50b8d7aea83..940f4cbf00c 100644
--- a/library/digital_resources/StoryPlayR/Config.php
+++ b/library/digital_resources/StoryPlayR/Config.php
@@ -34,6 +34,9 @@ class StoryPlayR_Config extends Class_DigitalResource_Config {
             'Url' => 'https://www.storyplayr.com/',
             'Icon' => 'https://www.storyplayr.com/images/v2/logo.png',
 
+            'MenuLabel' => $this->_('Lien vers StoryPlay*r'),
+            'ModuleMenu' => $this->withNameSpace('ModuleMenu'),
+
             'NotAllowedMessage' => $this->_('Vous devez être abonné pour accéder à cette ressource.'),
     ];
   }
diff --git a/library/digital_resources/StoryPlayR/ModuleMenu.php b/library/digital_resources/StoryPlayR/ModuleMenu.php
new file mode 100644
index 00000000000..07b0a45368e
--- /dev/null
+++ b/library/digital_resources/StoryPlayR/ModuleMenu.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * 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
+ */
+
+
+class StoryPlayR_ModuleMenu extends Class_DigitalResource_ModuleMenu {}
\ No newline at end of file
diff --git a/library/digital_resources/StoryPlayR/tests/StoryPlayRTest.php b/library/digital_resources/StoryPlayR/tests/StoryPlayRTest.php
index 0b3a59561ae..5091e3a84d4 100644
--- a/library/digital_resources/StoryPlayR/tests/StoryPlayRTest.php
+++ b/library/digital_resources/StoryPlayR/tests/StoryPlayRTest.php
@@ -153,4 +153,14 @@ class StoryPlayRAuthValidateTest extends StoryPlayRActivatedTestCase {
                                      'message' => 'Le jeton d\'accès est périmé']),
                         $this->_response->getBody());
   }
+}
+
+
+
+class StoryPlayRModuleMenuTest extends StoryPlayRActivatedTestCase {
+  /** @test */
+  public function storyPlayRMenuShouldBeAvailable() {
+    $modules_menu = new Class_Systeme_ModulesMenu;
+    $this->assertEquals('Lien vers StoryPlay*r', $modules_menu->getFonction('StoryPlayR')->getLibelle());
+  }
 }
\ No newline at end of file
-- 
GitLab