Skip to content
Snippets Groups Projects
Commit e1d10442 authored by Demian Katz's avatar Demian Katz
Browse files

Introduced "offline mode" view helper.

parent cd835c8b
No related merge requests found
<?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
......@@ -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>
......
......@@ -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>
......
......@@ -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"
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment