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

Basic right-to-left support for bootstrap3/bootprint3.

parent 20d784f6
Branches
Tags
No related merge requests found
Showing
with 94 additions and 27 deletions
...@@ -953,6 +953,11 @@ da = "Danish" ...@@ -953,6 +953,11 @@ da = "Danish"
sl = "Slovene" sl = "Slovene"
ar = "Arabic" ar = "Arabic"
; This section contains special cases for languages such as right-to-left support
[LanguageSettings]
; Comma-separated list of languages to display in right-to-left mode
rtl_langs = "ar,he"
; This section controls the behavior of the Browse module. The result_limit ; This section controls the behavior of the Browse module. The result_limit
; setting controls the maximum number of results that may display in any given ; setting controls the maximum number of results that may display in any given
; result box on the Browse screen. You can set to -1 for no limit; however, ; result box on the Browse screen. You can set to -1 for no limit; however,
......
...@@ -342,6 +342,10 @@ class Bootstrapper ...@@ -342,6 +342,10 @@ class Bootstrapper
$viewModel = $sm->get('viewmanager')->getViewModel(); $viewModel = $sm->get('viewmanager')->getViewModel();
$viewModel->setVariable('userLang', $language); $viewModel->setVariable('userLang', $language);
$viewModel->setVariable('allLangs', $config->Languages); $viewModel->setVariable('allLangs', $config->Languages);
$rtlLangs = array_map(
'trim', explode(',', $config->LanguageSettings->rtl_langs)
);
$viewModel->setVariable('rtl', in_array($language, $rtlLangs));
}; };
$this->events->attach('dispatch.error', $callback, 10000); $this->events->attach('dispatch.error', $callback, 10000);
$this->events->attach('dispatch', $callback, 10000); $this->events->attach('dispatch', $callback, 10000);
......
...@@ -56,11 +56,12 @@ abstract class AbstractLayoutClass extends \Zend\View\Helper\AbstractHelper ...@@ -56,11 +56,12 @@ abstract class AbstractLayoutClass extends \Zend\View\Helper\AbstractHelper
* Constructor * Constructor
* *
* @param bool $left Does the sidebar go on the left? * @param bool $left Does the sidebar go on the left?
* @param bool $offcanvas Offcanvas config setting * @param bool $offcanvas Is offcanvas menu active?
* @param bool $rtl Are we displaying right-to-left?
*/ */
public function __construct($left = false, $offcanvas = false) public function __construct($left = false, $offcanvas = false, $rtl = false)
{ {
$this->left = $left; $this->left = (bool) $left ^ (bool) $rtl;
$this->offcanvas = $offcanvas; $this->offcanvas = $offcanvas;
} }
......
...@@ -69,6 +69,9 @@ class Factory ...@@ -69,6 +69,9 @@ class Factory
? false : $config->Site->sidebarOnLeft; ? false : $config->Site->sidebarOnLeft;
$offcanvas = !isset($config->Site->offcanvas) $offcanvas = !isset($config->Site->offcanvas)
? false : $config->Site->offcanvas; ? false : $config->Site->offcanvas;
return new LayoutClass($left, $offcanvas); // The right-to-left setting is injected into the layout by the Bootstrapper;
// pull it back out here to avoid duplicate effort.
$layout = $sm->getServiceLocator()->get('viewmanager')->getViewModel();
return new LayoutClass($left, $offcanvas, $layout->rtl);
} }
} }
\ No newline at end of file
...@@ -65,8 +65,8 @@ class LayoutClass extends \VuFind\View\Helper\AbstractLayoutClass ...@@ -65,8 +65,8 @@ class LayoutClass extends \VuFind\View\Helper\AbstractLayoutClass
return ""; return "";
} }
return $this->left return $this->left
? 'offcanvas offcanvas-left' ? 'offcanvas offcanvas-left flip'
: 'offcanvas offcanvas-right'; : 'offcanvas offcanvas-right flip';
} }
} }
} }
This diff is collapsed.
...@@ -572,7 +572,7 @@ li.jstree-facet ul {padding-left: 20px;} ...@@ -572,7 +572,7 @@ li.jstree-facet ul {padding-left: 20px;}
padding-right: 0; padding-right: 0;
overflow-y: auto; overflow-y: auto;
h4 {padding-left: @padding-base-horizontal;} h4 {padding-left: @padding-base-horizontal;}
.checkbox {margin-left: calc(20px + @padding-base-horizontal);} .checkbox {margin-left: 20px + @padding-base-horizontal;}
.list-group, .list-group-item { .list-group, .list-group-item {
border-left: 0; border-left: 0;
border-right: 0; border-right: 0;
...@@ -581,7 +581,7 @@ li.jstree-facet ul {padding-left: 20px;} ...@@ -581,7 +581,7 @@ li.jstree-facet ul {padding-left: 20px;}
} }
&.active {overflow-y: hidden;} &.active {overflow-y: hidden;}
&.offcanvas-left { &.offcanvas-left {
padding-left: calc(@offcanvas-padding - @grid-gutter-width/2); padding-left: @offcanvas-padding - @grid-gutter-width/2;
& .main {background: #FFF;} & .main {background: #FFF;}
&.active { &.active {
margin-left: @offcanvas-offset; margin-left: @offcanvas-offset;
...@@ -598,7 +598,7 @@ li.jstree-facet ul {padding-left: 20px;} ...@@ -598,7 +598,7 @@ li.jstree-facet ul {padding-left: 20px;}
} }
} }
&.offcanvas-right { &.offcanvas-right {
padding-right: calc(@offcanvas-padding - @grid-gutter-width/2); padding-right: @offcanvas-padding - @grid-gutter-width/2;
& .main > .container {background: #FFF;} & .main > .container {background: #FFF;}
&.active { &.active {
margin-left: -@offcanvas-offset; margin-left: -@offcanvas-offset;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<h2><?=$this->info['name'] ?></h2> <h2><?=$this->info['name'] ?></h2>
<? if (isset($this->info['image'])): ?> <? if (isset($this->info['image'])): ?>
<img class="pull-left" src="<?=$this->info['image'] ?>" alt="<?=$this->escapeHtmlAttr($this->info['altimage']) ?>" width="150px"/> <img class="pull-left flip" src="<?=$this->info['image'] ?>" alt="<?=$this->escapeHtmlAttr($this->info['altimage']) ?>" width="150px"/>
<? endif; ?> <? endif; ?>
<?=preg_replace('/___baseurl___/', $this->url('search-results'), $this->info['description']) ?> <?=preg_replace('/___baseurl___/', $this->url('search-results'), $this->info['description']) ?>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<? foreach ($tagFilterList as $filter): ?> <? foreach ($tagFilterList as $filter): ?>
<? $removeLink = $this->currentPath().$results->getUrlQuery()->removeFacet($filter['field'], $filter['value']); ?> <? $removeLink = $this->currentPath().$results->getUrlQuery()->removeFacet($filter['field'], $filter['value']); ?>
<a class="list-group-item active" href="<?=$removeLink?>"> <a class="list-group-item active" href="<?=$removeLink?>">
<span class="pull-right"><i class="fa fa-minus-circle"></i></span> <span class="pull-right flip"><i class="fa fa-minus-circle"></i></span>
<?=$this->escapeHtml($filter['displayText'])?> <?=$this->escapeHtml($filter['displayText'])?>
</a> </a>
<? endforeach; ?> <? endforeach; ?>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<a href="<?=$this->recordLink()->getUrl($driver)?>" class="title <?=$this->record($driver)->getFormatClass($format)?> clearfix"> <a href="<?=$this->recordLink()->getUrl($driver)?>" class="title <?=$this->record($driver)->getFormatClass($format)?> clearfix">
<?=$this->record($driver)->getTitleHtml()?> <?=$this->record($driver)->getTitleHtml()?>
<? $summAuthor = $driver->getPrimaryAuthor(); ?> <? $summAuthor = $driver->getPrimaryAuthor(); ?>
<span class="small<? if (!empty($summAuthor)): ?> pull-right<? endif; ?>"> <span class="small<? if (!empty($summAuthor)): ?> pull-right flip<? endif; ?>">
<? $summDate = $driver->getPublicationDates(); ?> <? $summDate = $driver->getPublicationDates(); ?>
<? if (!empty($summDate)): ?> <? if (!empty($summDate)): ?>
<?=$this->transEsc('Published')?>: (<?=$this->escapeHtml($summDate[0])?>) <?=$this->transEsc('Published')?>: (<?=$this->escapeHtml($summDate[0])?>)
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
} }
?> ?>
<a class="list-group-item active" href="<?=$removeLink?>"> <a class="list-group-item active" href="<?=$removeLink?>">
<span class="pull-right"><i class="fa fa-times"></i></span> <span class="pull-right flip"><i class="fa fa-times"></i></span>
<? if ($filter['operator'] == 'NOT') echo $this->transEsc('NOT') . ' '; if ($filter['operator'] == 'OR' && $i > 0) echo $this->transEsc('OR') . ' '; ?><?=$this->transEsc($field)?>: <?=$this->escapeHtml($filter['displayText'])?> <? if ($filter['operator'] == 'NOT') echo $this->transEsc('NOT') . ' '; if ($filter['operator'] == 'OR' && $i > 0) echo $this->transEsc('OR') . ' '; ?><?=$this->transEsc($field)?>: <?=$this->escapeHtml($filter['displayText'])?>
</a> </a>
<? endforeach; ?> <? endforeach; ?>
...@@ -166,7 +166,7 @@ JS; ...@@ -166,7 +166,7 @@ JS;
<? if ($thisFacet['operator'] == 'OR'): ?> <? if ($thisFacet['operator'] == 'OR'): ?>
<i class="fa fa-check-square-o"></i> <i class="fa fa-check-square-o"></i>
<? else: ?> <? else: ?>
<span class="pull-right"><i class="fa fa-check"></i></span> <span class="pull-right flip"><i class="fa fa-check"></i></span>
<? endif; ?> <? endif; ?>
<?=$this->escapeHtml($thisFacet['displayText'])?> <?=$this->escapeHtml($thisFacet['displayText'])?>
</a> </a>
......
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
<tr> <tr>
<th><?=$this->transEsc('Tags')?>: </th> <th><?=$this->transEsc('Tags')?>: </th>
<td> <td>
<a id="tagRecord" class="btn btn-link modal-link pull-right" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" title="<?=$this->transEsc('Add Tag')?>"> <a id="tagRecord" class="btn btn-link modal-link pull-right flip" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" title="<?=$this->transEsc('Add Tag')?>">
<i class="fa fa-plus"></i> <?=$this->transEsc('Add Tag')?></a> <i class="fa fa-plus"></i> <?=$this->transEsc('Add Tag')?></a>
</a> </a>
<?=$this->context($this)->renderInContext('record/taglist', array('tagList'=>$tagList, 'loggedin'=>$loggedin)) ?> <?=$this->context($this)->renderInContext('record/taglist', array('tagList'=>$tagList, 'loggedin'=>$loggedin)) ?>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<? if ($cover): ?> <? if ($cover): ?>
<div class="col-xs-2 left"> <div class="col-xs-2 left">
<? else: ?> <? else: ?>
<div class="col-xs-1 left"> <div class="col-xs-1 left flip">
<? endif ?> <? endif ?>
<label class="pull-left"><?=$this->record($this->driver)->getCheckbox() ?></label> <label class="pull-left"><?=$this->record($this->driver)->getCheckbox() ?></label>
<input type="hidden" value="<?=$id ?>" class="hiddenId"/> <input type="hidden" value="<?=$id ?>" class="hiddenId"/>
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
<?=$this->recommend($current)?> <?=$this->recommend($current)?>
<? endforeach; ?> <? endforeach; ?>
<div class="clearfix hidden-print"> <div class="clearfix hidden-print">
<div class="pull-left"> <div class="pull-left flip">
<?=$this->transEsc("Showing")?> <?=$this->transEsc("Showing")?>
<strong><?=$this->localizedNumber($results->getStartRecord())?></strong> - <strong><?=$this->localizedNumber($results->getEndRecord())?></strong> <strong><?=$this->localizedNumber($results->getStartRecord())?></strong> - <strong><?=$this->localizedNumber($results->getEndRecord())?></strong>
<? if (!isset($this->skipTotalCount)): ?> <? if (!isset($this->skipTotalCount)): ?>
<?=$this->transEsc('of')?> <strong><?=$this->localizedNumber($recordTotal)?></strong> <?=$this->transEsc('Items')?> <?=$this->transEsc('of')?> <strong><?=$this->localizedNumber($recordTotal)?></strong> <?=$this->transEsc('Items')?>
<? endif; ?> <? endif; ?>
</div> </div>
<div class="pull-right"> <div class="pull-right flip">
<?=$this->render('search/controls/limit.phtml', $searchDetails)?> <?=$this->render('search/controls/limit.phtml', $searchDetails)?>
<?=$this->render('search/controls/sort.phtml', $searchDetails)?> <?=$this->render('search/controls/sort.phtml', $searchDetails)?>
</div> </div>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<? foreach ($this->browseOptions as $item=>$currentOption): ?> <? foreach ($this->browseOptions as $item=>$currentOption): ?>
<a href="<?=$this->url('browse-' . strtolower($currentOption['action'])); ?>" class="list-group-item<? if($currentOption['action'] == $this->currentAction): ?> active<? endif; ?>"> <a href="<?=$this->url('browse-' . strtolower($currentOption['action'])); ?>" class="list-group-item<? if($currentOption['action'] == $this->currentAction): ?> active<? endif; ?>">
<?=$this->transEsc($currentOption['description']) ?> <?=$this->transEsc($currentOption['description']) ?>
<span class="pull-right"><i class="fa fa-angle-right"></i></span> <span class="pull-right flip"><i class="fa fa-angle-right"></i></span>
</a> </a>
<? endforeach; ?> <? endforeach; ?>
</div> </div>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<a href="<?=$BROWSE_BASE ?>?findby=<?=urlencode($findby) ?>&query_field=<?=$this->browse()->getSolrField($findby, $this->currentAction) ?>" class="list-group-item clearfix<? if ($this->findby == $findby): ?> active<? endif; ?>"> <a href="<?=$BROWSE_BASE ?>?findby=<?=urlencode($findby) ?>&query_field=<?=$this->browse()->getSolrField($findby, $this->currentAction) ?>" class="list-group-item clearfix<? if ($this->findby == $findby): ?> active<? endif; ?>">
<? if(is_string($category)): ?> <? if(is_string($category)): ?>
<?=$this->transEsc($category)?> <?=$this->transEsc($category)?>
<span class="pull-right"><i class="fa fa-angle-right"></i></span> <span class="pull-right flip"><i class="fa fa-angle-right"></i></span>
<? else: ?> <? else: ?>
<?=$this->transEsc($category['text'])?> <?=$this->transEsc($category['text'])?>
<span class="badge"><?=number_format($category['count'])?></span> <span class="badge"><?=number_format($category['count'])?></span>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<? if ($this->findby != 'alphabetical' && isset($secondary['count'])): ?> <? if ($this->findby != 'alphabetical' && isset($secondary['count'])): ?>
<span class="badge"><?=number_format($secondary['count']) ?></span> <span class="badge"><?=number_format($secondary['count']) ?></span>
<? else: ?> <? else: ?>
<span class="pull-right"><i class="fa fa-angle-right"></i></span> <span class="pull-right flip"><i class="fa fa-angle-right"></i></span>
<? endif; ?> <? endif; ?>
</a> </a>
<? if($viewRecord): ?> <? if($viewRecord): ?>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<form class="form-inline" action="<?=$this->url('cart-home')?>" method="post" name="cartForm"> <form class="form-inline" action="<?=$this->url('cart-home')?>" method="post" name="cartForm">
<? if (!$this->cart()->isEmpty()): ?> <? if (!$this->cart()->isEmpty()): ?>
<div class="cart-controls clearfix"> <div class="cart-controls clearfix">
<div class="checkbox pull-left"> <div class="checkbox pull-left flip">
<label> <label>
<input type="checkbox" name="selectAll" class="checkbox-select-all"/> <input type="checkbox" name="selectAll" class="checkbox-select-all"/>
<?=$this->transEsc('select_page')?> <?=$this->transEsc('select_page')?>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
$params->setLimit($limit); $params->setLimit($limit);
?> ?>
<? if (isset($currentSearch['more_link']) && $currentSearch['more_link']): ?> <? if (isset($currentSearch['more_link']) && $currentSearch['more_link']): ?>
<div class="pull-right"> <div class="pull-right flip">
<a href="<?=$moreUrl?>" class="btn btn-link"><i class="fa fa-gears"></i> <?=$this->transEsc('More options')?></a> <a href="<?=$moreUrl?>" class="btn btn-link"><i class="fa fa-gears"></i> <?=$this->transEsc('More options')?></a>
</div> </div>
<h2><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['label'])?></a></h2> <h2><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['label'])?></a></h2>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<p><i><?=$this->transEsc($currentSearch['sublabel'])?></i></p> <p><i><?=$this->transEsc($currentSearch['sublabel'])?></i></p>
<? endif; ?> <? endif; ?>
<div class="clearfix"> <div class="clearfix">
<div class="pull-left help-block"> <div class="pull-left flip help-block">
<? if ($recordTotal > 0): ?> <? if ($recordTotal > 0): ?>
<? foreach (($top = $results->getRecommendations('top')) as $current): ?> <? foreach (($top = $results->getRecommendations('top')) as $current): ?>
<?=$this->recommend($current)?> <?=$this->recommend($current)?>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<?=$this->flashmessages();?> <?=$this->flashmessages();?>
<div id="popupDetails" class="confirmDialog"> <div id="popupDetails" class="confirmDialog">
<form class="pull-left" action="<?=$this->escapeHtmlAttr($this->confirm)?>" method="post"> <form class="pull-left flip" action="<?=$this->escapeHtmlAttr($this->confirm)?>" method="post">
<? if (isset($this->extras)): ?> <? if (isset($this->extras)): ?>
<? foreach ($this->extras as $extra=>$value): ?> <? foreach ($this->extras as $extra=>$value): ?>
<? if (is_array($value)): ?> <? if (is_array($value)): ?>
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<div class="accordion-heading"> <div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#missing_<?=$langCode ?>"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#missing_<?=$langCode ?>">
Missing From <?=$this->escapeHtml($diffs['name'])?> (<?=$this->escapeHtml($langCode)?>.ini) Missing From <?=$this->escapeHtml($diffs['name'])?> (<?=$this->escapeHtml($langCode)?>.ini)
<span class="pull-right"></span> <span class="pull-right flip"></span>
</a> </a>
</div> </div>
<div id="missing_<?=$langCode ?>" class="accordion-body collapse"> <div id="missing_<?=$langCode ?>" class="accordion-body collapse">
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<? endif; ?> <? endif; ?>
<? if (!isset($this->layout()->renderingError)): ?> <? if (!isset($this->layout()->renderingError)): ?>
<div class="collapse navbar-collapse" id="header-collapse"> <div class="collapse navbar-collapse" id="header-collapse">
<ul role="navigation" class="nav navbar-nav navbar-right"> <ul role="navigation" class="nav navbar-nav navbar-right flip">
<? if ($this->feedback()->tabEnabled()): ?> <? if ($this->feedback()->tabEnabled()): ?>
<li> <li>
<a id="feedbackLink" class="modal-link" href="<?=$this->url('feedback-home') ?>"><i class="fa fa-envelope"></i> <?=$this->transEsc("Feedback")?></a> <a id="feedbackLink" class="modal-link" href="<?=$this->url('feedback-home') ?>"><i class="fa fa-envelope"></i> <?=$this->transEsc("Feedback")?></a>
......
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