From f67532d582a7e25e68dac5f2677b33bbcd653b60 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Fri, 31 Aug 2012 10:14:02 -0400
Subject: [PATCH] Eliminated redundant view helper.

---
 .../VuFind/Theme/Root/Helper/OfflineMode.php  | 52 -------------------
 themes/blueprint/templates/search/home.phtml  |  2 +-
 .../jquerymobile/templates/search/home.phtml  |  2 +-
 themes/root/theme.ini                         |  1 -
 4 files changed, 2 insertions(+), 55 deletions(-)
 delete mode 100644 module/VuFind/src/VuFind/Theme/Root/Helper/OfflineMode.php

diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/OfflineMode.php b/module/VuFind/src/VuFind/Theme/Root/Helper/OfflineMode.php
deleted file mode 100644
index 1d23c17a1ce..00000000000
--- a/module/VuFind/src/VuFind/Theme/Root/Helper/OfflineMode.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?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\Connection\Manager as ConnectionManager,
-    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 get the catalog's current offline mode.
-     *
-     * @return string
-     */
-    public function __invoke()
-    {
-        return ConnectionManager::connectToCatalog()->getOfflineMode();
-    }
-}
\ No newline at end of file
diff --git a/themes/blueprint/templates/search/home.phtml b/themes/blueprint/templates/search/home.phtml
index 57ad5e5cfa8..eaf3e74d80a 100644
--- a/themes/blueprint/templates/search/home.phtml
+++ b/themes/blueprint/templates/search/home.phtml
@@ -16,7 +16,7 @@
     $advSearch = $options->getAdvancedSearchAction();
 ?>
 <div class="searchHomeContent">
-  <? if ($this->offlineMode() == "ils-offline"): ?>
+  <? if ($this->ils()->getOfflineMode() == "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/jquerymobile/templates/search/home.phtml b/themes/jquerymobile/templates/search/home.phtml
index 5951e27443a..57e2620860c 100644
--- a/themes/jquerymobile/templates/search/home.phtml
+++ b/themes/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 ($this->offlineMode() == "ils-offline"): ?>
+    <? if ($this->ils()->getOfflineMode() == "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/root/theme.ini b/themes/root/theme.ini
index 0a40eaebf66..8a29b3c6633 100644
--- a/themes/root/theme.ini
+++ b/themes/root/theme.ini
@@ -24,7 +24,6 @@ helpers_to_register[] = "ImageLink"
 helpers_to_register[] = "InlineScript"
 helpers_to_register[] = "JqueryValidation"
 helpers_to_register[] = "MobileUrl"
-helpers_to_register[] = "OfflineMode"
 helpers_to_register[] = "OpenUrl"
 helpers_to_register[] = "Printms"
 helpers_to_register[] = "ProxyUrl"
-- 
GitLab