diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/OfflineMode.php b/module/VuFind/src/VuFind/Theme/Root/Helper/OfflineMode.php new file mode 100644 index 0000000000000000000000000000000000000000..d9dce6ade2502c0025d2b5c52c96b00c54373f01 --- /dev/null +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/OfflineMode.php @@ -0,0 +1,56 @@ +<?php +/** + * "Offline mode" view 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\Search\Options, Zend\View\Helper\AbstractHelper; + +/** + * "Offline mode" view 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 OfflineMode extends AbstractHelper +{ + /** + * Wrapper function to the VF_Search_Options getInstance function + * + * @param string $type The search type of the object to retrieve + * + * @return SearchOptions + */ + public function __invoke() + { + /* TODO: + return VF_Connection_Manager::connectToCatalog()->getOfflineMode(); + */ + return ''; + } +} \ No newline at end of file diff --git a/themes/vufind/blueprint/templates/search/home.phtml b/themes/vufind/blueprint/templates/search/home.phtml index 1cdd484186e5aa6fc0c5fd51780383c07ed76bdf..8afe6dc6659789985480fb18f829db04fcf198a7 100644 --- a/themes/vufind/blueprint/templates/search/home.phtml +++ b/themes/vufind/blueprint/templates/search/home.phtml @@ -16,7 +16,7 @@ $advSearch = $options->getAdvancedSearchAction(); ?> <div class="searchHomeContent"> - <? if (VF_Connection_Manager::connectToCatalog()->getOfflineMode() == "ils-offline"): ?> + <? if ($this->offlineMode() == "ils-offline"): ?> <div class="sysInfo"> <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> diff --git a/themes/vufind/jquerymobile/templates/search/home.phtml b/themes/vufind/jquerymobile/templates/search/home.phtml index 8586a01848e5069f8f02f5bea8f9b5ae0523d2c5..46a26c505d032198fd9b923f38c113d50795f2c7 100644 --- a/themes/vufind/jquerymobile/templates/search/home.phtml +++ b/themes/vufind/jquerymobile/templates/search/home.phtml @@ -5,7 +5,7 @@ <div data-role="page" id="Search-home"> <?=$this->mobileMenu()->header(array('searchLink' => false, 'results' => null))?> <div data-role="content"> - <? if (VF_Connection_Manager::connectToCatalog()->getOfflineMode() == "ils-offline"): ?> + <? if ($this->offlineMode() == "ils-offline"): ?> <div class="sysInfo"> <h2><?=$this->transEsc('ils_offline_title')?></h2> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> diff --git a/themes/vufind/root/theme.ini b/themes/vufind/root/theme.ini index 308b7e07c08bd79f48ab6d9ebfc5d92767b9edbb..ce161257c142e218935111b2fdc1757f8fb4585c 100644 --- a/themes/vufind/root/theme.ini +++ b/themes/vufind/root/theme.ini @@ -7,6 +7,7 @@ helpers_to_register[] = "HeadScript" helpers_to_register[] = "HeadThemeResources" helpers_to_register[] = "ImageLink" helpers_to_register[] = "MobileUrl" +helpers_to_register[] = "OfflineMode" helpers_to_register[] = "SearchOptions" helpers_to_register[] = "TransEsc" helpers_to_register[] = "Translate"