diff --git a/library/ZendAfi/View/Helper/SkinImageUrl.php b/library/ZendAfi/View/Helper/SkinImageUrl.php new file mode 100644 index 0000000000000000000000000000000000000000..11677929831b6646c2c71747f1f5a486fbe92089 --- /dev/null +++ b/library/ZendAfi/View/Helper/SkinImageUrl.php @@ -0,0 +1,30 @@ +<?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 ZendAfi_View_Helper_SkinImageUrl { + public function skinImageUrl($image_path) { + return file_exists(Class_Profil::getCurrentProfil()->getSkinImagePath($image_path)) + ? URL_IMG . $image_path + : URL_SHARED_IMG . $image_path; + } +} +?> \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/SocialShare.php b/library/ZendAfi/View/Helper/SocialShare.php index bc551ef31619735c19585155cbfca1ce4f49054f..52808e2cc2dd0f5aade089a16e4a12c263f1cd9a 100644 --- a/library/ZendAfi/View/Helper/SocialShare.php +++ b/library/ZendAfi/View/Helper/SocialShare.php @@ -56,8 +56,7 @@ class ZendAfi_View_Helper_SocialShare extends Zend_View_Helper_HtmlElement { public function networkImgUrl($network) { - $file = $network.'.png'; - return file_exists(Class_Profil::getCurrentProfil()->getSkinImagePath('reseaux/'.$file)) ? URL_IMG.'reseaux/'.$file : URL_SHARED_IMG.'reseaux/'.$file; + return $this->view->skinImageUrl('reseaux/' . $network . '.png'); } }