Skip to content
Snippets Groups Projects
Commit 11d69613 authored by Chris Hallberg's avatar Chris Hallberg Committed by Demian Katz
Browse files

Rename sidebarOnLeft property in layout helpers for clarity (#972)

parent 66811470
No related merge requests found
......@@ -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;
}
......
......@@ -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);
}
/**
......
......@@ -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';
}
......
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