diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/SystemEmail.php b/module/VuFind/src/VuFind/Theme/Root/Helper/SystemEmail.php new file mode 100644 index 0000000000000000000000000000000000000000..cfe0c81911d8b082817c9f70663d2a0a6f412d69 --- /dev/null +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/SystemEmail.php @@ -0,0 +1,51 @@ +<?php +/** + * System contact email helper. + * + * PHP version 5 + * + * Copyright (C) Villanova University 2010. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/building_a_recommendations_module Wiki + */ +namespace VuFind\Theme\Root\Helper; +use VuFind\Config\Reader as ConfigReader, Zend\View\Helper\AbstractHelper; + +/** + * System contact email helper. + * + * @category VuFind2 + * @package View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/building_a_recommendations_module Wiki + */ +class SystemEmail extends AbstractHelper +{ + /** + * System contact email helper. + * + * @return string + */ + public function __invoke() + { + return ConfigReader::getConfig()->Site->email; + } +} \ No newline at end of file diff --git a/themes/blueprint/templates/RecordDriver/SolrDefault/tab-holdings.phtml b/themes/blueprint/templates/RecordDriver/SolrDefault/tab-holdings.phtml index 53cd96e39f7c27a9ce2fe543fdc6d0266a0406ec..a39e9ac3a2212db1d8e46b3b07efcd43e571481f 100644 --- a/themes/blueprint/templates/RecordDriver/SolrDefault/tab-holdings.phtml +++ b/themes/blueprint/templates/RecordDriver/SolrDefault/tab-holdings.phtml @@ -15,7 +15,7 @@ <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> <p><?=$this->transEsc('ils_offline_holdings_message')?></p> - <? $supportEmail = $this->escape(VF_Config_Reader::getConfig()->Site->email); ?> + <? $supportEmail = $this->escape($this->systemEmail()); ?> <p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p> </div> <? endif; ?> diff --git a/themes/blueprint/templates/error/unavailable.phtml b/themes/blueprint/templates/error/unavailable.phtml index 1a306795138a58ac4593d0b2466be1f53142563d..3e226e96b8fd81bfffe48cb376c9dd04cbd303ad 100644 --- a/themes/blueprint/templates/error/unavailable.phtml +++ b/themes/blueprint/templates/error/unavailable.phtml @@ -14,7 +14,7 @@ <p> <?=$this->transEsc('Please contact the Library Reference Department for assistance')?> <br/> - <? $supportEmail = $this->escape(VF_Config_Reader::getConfig()->Site->email); ?> + <? $supportEmail = $this->escape($this->systemEmail()); ?> <a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a> </p> </div> diff --git a/themes/blueprint/templates/myresearch/cataloglogin.phtml b/themes/blueprint/templates/myresearch/cataloglogin.phtml index 72574b04a12e06b68c333b689f909c35e37025cd..fee5a5c6e6e8e17675d73e5025c4eca40df0df1a 100644 --- a/themes/blueprint/templates/myresearch/cataloglogin.phtml +++ b/themes/blueprint/templates/myresearch/cataloglogin.phtml @@ -15,7 +15,7 @@ <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> <p><?=$this->transEsc('ils_offline_login_message')?></p> - <? $supportEmail = $this->escape(VF_Config_Reader::getConfig()->Site->email); ?> + <? $supportEmail = $this->escape($this->systemEmail()); ?> <p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p> </div> <? else: ?> diff --git a/themes/blueprint/templates/myresearch/login.phtml b/themes/blueprint/templates/myresearch/login.phtml index 0efadba906342c5d7d1d382a154a90fc2c8a810b..092b9c44da2efe62f63abbca9f1feef1900d7aa1 100644 --- a/themes/blueprint/templates/myresearch/login.phtml +++ b/themes/blueprint/templates/myresearch/login.phtml @@ -23,7 +23,7 @@ <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> <p><?=$this->transEsc('ils_offline_login_message')?></p> - <? $supportEmail = $this->escape(VF_Config_Reader::getConfig()->Site->email); ?> + <? $supportEmail = $this->escape($this->systemEmail()); ?> <p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p> </div> <? endif; ?> diff --git a/themes/blueprint/templates/search/home.phtml b/themes/blueprint/templates/search/home.phtml index 37345646355f240f14c93f0557669c651afc4c9d..22f57f76ef3cb86cc17a8047057161dc86fdcaf4 100644 --- a/themes/blueprint/templates/search/home.phtml +++ b/themes/blueprint/templates/search/home.phtml @@ -21,7 +21,7 @@ <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> <p><?=$this->transEsc('ils_offline_home_message')?></p> - <? $supportEmail = $this->escape(VF_Config_Reader::getConfig()->Site->email); ?> + <? $supportEmail = $this->escape($this->systemEmail()); ?> <p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p> </div> <? endif; ?> diff --git a/themes/jquerymobile/templates/RecordDriver/SolrDefault/tab-holdings.phtml b/themes/jquerymobile/templates/RecordDriver/SolrDefault/tab-holdings.phtml index f243908d4ae21c6fa4d78ce68bf258897e40babd..30403f246d29ea04643a468e76f2d181e5feaaf1 100644 --- a/themes/jquerymobile/templates/RecordDriver/SolrDefault/tab-holdings.phtml +++ b/themes/jquerymobile/templates/RecordDriver/SolrDefault/tab-holdings.phtml @@ -15,7 +15,7 @@ <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> <p><?=$this->transEsc('ils_offline_holdings_message')?></p> - <? $supportEmail = $this->escape(VF_Config_Reader::getConfig()->Site->email); ?> + <? $supportEmail = $this->escape($this->systemEmail()); ?> <p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p> </div> <? endif; ?> diff --git a/themes/jquerymobile/templates/error/unavailable.phtml b/themes/jquerymobile/templates/error/unavailable.phtml new file mode 100644 index 0000000000000000000000000000000000000000..ccae83f0bb2c12b7f110acd4cb77aaa2533debd8 --- /dev/null +++ b/themes/jquerymobile/templates/error/unavailable.phtml @@ -0,0 +1,21 @@ +<? + // Set page title. + $this->headTitle($this->translate('System Unavailable')); +?> +<div data-role="page" id="Search-home"> + <?=$this->mobileMenu()->header(array('searchLink' => false))?> + <div data-role="content"> + <div class="error unavailable"> + <p> + <?=$this->transEsc('The system is currently unavailable due to system maintenance')?>. + <?=$this->transEsc('Please check back soon')?>. + </p> + <p> + <?=$this->transEsc('Please contact the Library Reference Department for assistance')?> + <br/> + <? $supportEmail = $this->escape($this->systemEmail()); ?> + <a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a> + </p> + </div> + </div> +</div> \ No newline at end of file diff --git a/themes/jquerymobile/templates/myresearch/cataloglogin.phtml b/themes/jquerymobile/templates/myresearch/cataloglogin.phtml index de391b93d7106436cc3994f3ed3a5f010de9dbb6..4b2a04f8f3e2329eff8532082fc2cdf9fa1f9448 100644 --- a/themes/jquerymobile/templates/myresearch/cataloglogin.phtml +++ b/themes/jquerymobile/templates/myresearch/cataloglogin.phtml @@ -13,7 +13,7 @@ <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> <p><?=$this->transEsc('ils_offline_login_message')?></p> - <? $supportEmail = $this->escape(VF_Config_Reader::getConfig()->Site->email); ?> + <? $supportEmail = $this->escape($this->systemEmail()); ?> <p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p> </div> <? else: ?> diff --git a/themes/jquerymobile/templates/myresearch/login.phtml b/themes/jquerymobile/templates/myresearch/login.phtml index 2be28f8952ea751aa32b89497540dd29794f37e8..72ca8b48f095b357435419206a19937c2106bb15 100644 --- a/themes/jquerymobile/templates/myresearch/login.phtml +++ b/themes/jquerymobile/templates/myresearch/login.phtml @@ -15,7 +15,7 @@ <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> <p><?=$this->transEsc('ils_offline_login_message')?></p> - <? $supportEmail = $this->escape(VF_Config_Reader::getConfig()->Site->email); ?> + <? $supportEmail = $this->escape($this->systemEmail()); ?> <p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p> </div> <? elseif ($hideLogin): ?> diff --git a/themes/jquerymobile/templates/search/advanced.phtml b/themes/jquerymobile/templates/search/advanced.phtml index 120649050683ecb27baa60da26edbf87e4e1f5d8..00e29fbec286e7422ae1a4322fae7be03d87038d 100644 --- a/themes/jquerymobile/templates/search/advanced.phtml +++ b/themes/jquerymobile/templates/search/advanced.phtml @@ -22,7 +22,7 @@ <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> <p><?=$this->transEsc('ils_offline_home_message')?></p> - <? $supportEmail = $this->escape(VF_Config_Reader::getConfig()->Site->email); ?> + <? $supportEmail = $this->escape($this->systemEmail()); ?> <p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p> </div> <? endif; ?> diff --git a/themes/jquerymobile/templates/search/home.phtml b/themes/jquerymobile/templates/search/home.phtml index d09ddac60aa19f47b174197e120560e7f8f0a46b..b8b537a1231d5b0738058937ce46418977582357 100644 --- a/themes/jquerymobile/templates/search/home.phtml +++ b/themes/jquerymobile/templates/search/home.phtml @@ -10,7 +10,7 @@ <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> <p><?=$this->transEsc('ils_offline_home_message')?></p> - <? $supportEmail = $this->escape(VF_Config_Reader::getConfig()->Site->email); ?> + <? $supportEmail = $this->escape($this->systemEmail()); ?> <p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p> </div> <? endif; ?> diff --git a/themes/root/theme.ini b/themes/root/theme.ini index ce161257c142e218935111b2fdc1757f8fb4585c..0670dd593b36539d44429d8d2c49cd6e795e04f8 100644 --- a/themes/root/theme.ini +++ b/themes/root/theme.ini @@ -9,5 +9,6 @@ helpers_to_register[] = "ImageLink" helpers_to_register[] = "MobileUrl" helpers_to_register[] = "OfflineMode" helpers_to_register[] = "SearchOptions" +helpers_to_register[] = "SystemEmail" helpers_to_register[] = "TransEsc" helpers_to_register[] = "Translate"