diff --git a/VERSIONS_HOTLINE/30015 b/VERSIONS_HOTLINE/30015 new file mode 100644 index 0000000000000000000000000000000000000000..1ca6e686ed35b5126076401fb812cfd224b83399 --- /dev/null +++ b/VERSIONS_HOTLINE/30015 @@ -0,0 +1 @@ + - ticket #30015 : Pas de lien de retour vers le front ou vers le back office depuis l'explorateur de fichiers \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php index 36cba89c7f8fa0e6e82488a5d60aeb81a2988830..42ac2b9980388747b4c783978b9ad72ec87c3dd4 100644 --- a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php +++ b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php @@ -78,11 +78,11 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base .$this->addMenu("moderation_16.png", $this->translate()->_("Modération"), "/admin/modo/", $this->filterAll($this->user), - $nb_moderations) + ['extra_infos' => $nb_moderations]) .$this->addMenu("demande_inscri_16.png", $this->translate()->_("Demandes d'inscription"), "/admin/modo/membreview", $this->filterAll($this->user), - $demandes_inscription) + ['extra_infos' => $demandes_inscription]) .$this->addMenu("lettres_16.png", $this->translate()->_("Lettres d'information"), "/admin/newsletter", $this->filterAdmin($this->user) || $this->user->hasRightToAccess(Class_UserGroup::RIGHT_USER_SITOTHEQUE)) @@ -234,7 +234,8 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base $this->openBoite($this->translate()->_("Système")) .$this->addMenu("database.png", $this->translate()->_("Accès à Cosmogramme"), Class_AdminVar::get("URL_COSMOGRAMME"), - $this->filterAdminPortail($this->user)) + $this->filterAdminPortail($this->user), + ['target' => '_blank']) .$this->addMenu("batch_16.png", $this->translate()->_("Batchs"), "/admin/batch", $this->filterAdminPortail($this->user)) @@ -263,7 +264,8 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base .$this->addMenu("file_browser.png", $this->translate()->_("Explorateur de fichiers"), 'http://' . $_SERVER['SERVER_NAME'].CKBASEURL."core_five_filemanager/index.html?ServerPath=".USERFILESURL, - $this->filterAdminPortail($this->user)) + $this->filterAdminPortail($this->user), + ['target' => '_blank']) .$this->addMenu('proprietes.gif', $this->translate()->_('Champs personnalisés'), @@ -331,17 +333,21 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base return($html); } - function addMenu($img,$titre,$lien, $access_allowed, $extra_infos='') { + function addMenu($img,$titre,$lien, $access_allowed, $options=[]) { if (!$access_allowed) return ''; if(!preg_match('^http://^',$lien)) $lien = BASE_URL.$lien; + $target = isset($options['target']) + ? ' target="' . $options['target'] . '"' + : ''; + $ico = '<img src="'.URL_ADMIN_IMG.'picto/'.$img.'" alt="'.$titre.'" />'; - $url= ['START'=>'<a href="'.$lien.'">', + $url= ['START'=>'<a href="'.$lien.'"'.$target.'>', 'END'=>'</a>']; - $extra_infos = !empty($extra_infos) - ? "<span class='menu_info'>$extra_infos</span>" + $extra_infos = isset($options['extra_infos']) + ? '<span class="menu_info">' . $options['extra_infos'] . '</span>' : ''; $class_selected = ''; diff --git a/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php b/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php index 157adc362f31819904ec797ee5770ebc28358ab7..3f5a727d3a7dea59266a0b7eefe810e24c3a69f6 100644 --- a/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php +++ b/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php @@ -112,6 +112,18 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdminVariableAsAdminTest extends ZendA public function menuGaucheAdminShouldContainsJamendo() { $this->assertXPath($this->html, '//a[contains(@href, "/admin/harvest/jamendo-browse")]'); } + + + /** @test */ + public function fileExplorerShouldHaveTargetBlank() { + $this->assertXPath($this->html, '//a[contains(@href, "/ckeditor/core_five_filemanager")][@target="_blank"]'); + } + + + /** @test */ + public function cosmogrammeAccessShouldHaveTargetBlank() { + $this->assertXPathContentContains($this->html, '//a[@target="_blank"]', utf8_encode('Accès à Cosmogramme')); + } }