From 11d69613a179dbb2709cf1ceddd36738af7255c9 Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Wed, 24 May 2017 10:55:24 -0400
Subject: [PATCH] Rename sidebarOnLeft property in layout helpers for clarity
 (#972)

---
 .../VuFind/src/VuFind/View/Helper/AbstractLayoutClass.php   | 4 ++--
 module/VuFind/src/VuFind/View/Helper/Bootstrap3/Factory.php | 6 +++---
 .../src/VuFind/View/Helper/Bootstrap3/LayoutClass.php       | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/module/VuFind/src/VuFind/View/Helper/AbstractLayoutClass.php b/module/VuFind/src/VuFind/View/Helper/AbstractLayoutClass.php
index af9b84e6c0b..33a1115d55e 100644
--- a/module/VuFind/src/VuFind/View/Helper/AbstractLayoutClass.php
+++ b/module/VuFind/src/VuFind/View/Helper/AbstractLayoutClass.php
@@ -43,7 +43,7 @@ abstract class AbstractLayoutClass extends \Zend\View\Helper\AbstractHelper
      *
      * @var bool
      */
-    protected $left;
+    protected $sidebarOnLeft;
 
     /**
      * Is the sidebar offcanvas?
@@ -60,7 +60,7 @@ abstract class AbstractLayoutClass extends \Zend\View\Helper\AbstractHelper
      */
     public function __construct($left = false, $offcanvas = false)
     {
-        $this->left = $left;
+        $this->sidebarOnLeft = $left;
         $this->offcanvas = $offcanvas;
     }
 
diff --git a/module/VuFind/src/VuFind/View/Helper/Bootstrap3/Factory.php b/module/VuFind/src/VuFind/View/Helper/Bootstrap3/Factory.php
index fb2ad863b1e..ee0d9d8608f 100644
--- a/module/VuFind/src/VuFind/View/Helper/Bootstrap3/Factory.php
+++ b/module/VuFind/src/VuFind/View/Helper/Bootstrap3/Factory.php
@@ -65,7 +65,7 @@ class Factory
     public static function getLayoutClass(ServiceManager $sm)
     {
         $config = $sm->getServiceLocator()->get('VuFind\Config')->get('config');
-        $left = !isset($config->Site->sidebarOnLeft)
+        $sidebarOnLeft = !isset($config->Site->sidebarOnLeft)
             ? false : $config->Site->sidebarOnLeft;
         $mirror = !isset($config->Site->mirrorSidebarInRTL)
             ? true : $config->Site->mirrorSidebarInRTL;
@@ -76,9 +76,9 @@ class Factory
         // the mirror setting appropriately.
         $layout = $sm->getServiceLocator()->get('viewmanager')->getViewModel();
         if ($layout->rtl && !$mirror) {
-            $left = !$left;
+            $sidebarOnLeft = !$sidebarOnLeft;
         }
-        return new LayoutClass($left, $offcanvas);
+        return new LayoutClass($sidebarOnLeft, $offcanvas);
     }
 
     /**
diff --git a/module/VuFind/src/VuFind/View/Helper/Bootstrap3/LayoutClass.php b/module/VuFind/src/VuFind/View/Helper/Bootstrap3/LayoutClass.php
index 92cc9f527ca..9d4a9dd4422 100644
--- a/module/VuFind/src/VuFind/View/Helper/Bootstrap3/LayoutClass.php
+++ b/module/VuFind/src/VuFind/View/Helper/Bootstrap3/LayoutClass.php
@@ -53,18 +53,18 @@ class LayoutClass extends \VuFind\View\Helper\AbstractLayoutClass
     {
         switch ($class) {
         case 'mainbody':
-            return $this->left
+            return $this->sidebarOnLeft
                 ? 'col-sm-9 col-sm-push-3'
                 : 'col-sm-9';
         case 'sidebar':
-            return $this->left
+            return $this->sidebarOnLeft
                 ? 'sidebar col-sm-3 col-sm-pull-9 hidden-print'
                 : 'sidebar col-sm-3 hidden-print';
         case 'offcanvas-row':
             if (!$this->offcanvas) {
                 return "";
             }
-            return $this->left
+            return $this->sidebarOnLeft
                 ? 'offcanvas offcanvas-left flip'
                 : 'offcanvas offcanvas-right flip';
         }
-- 
GitLab