Skip to content
Snippets Groups Projects
Commit 7f509ca7 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Merge branch 'release-2.3'

parents 0145d7cc 4fd471a0
No related merge requests found
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -22,25 +22,33 @@ ...@@ -22,25 +22,33 @@
<? $pageLinks = ob_get_contents(); ?> <? $pageLinks = ob_get_contents(); ?>
<? ob_end_clean(); ?> <? ob_end_clean(); ?>
<div class="<?=$this->layoutClass('mainbody')?>"> <div>
<div> <form class="form-inline" method="get" action="<?=$this->url('alphabrowse-home')?>" name="alphaBrowseForm" id="alphaBrowseForm">
<form class="form-inline" method="get" action="<?=$this->url('alphabrowse-home')?>" name="alphaBrowseForm" id="alphaBrowseForm"> <label for="alphaBrowseForm_source"><?=$this->transEsc('Browse Alphabetically') ?></label>
<label for="alphaBrowseForm_source"><?=$this->transEsc('Browse Alphabetically') ?></label> <select id="alphaBrowseForm_source" name="source">
<select id="alphaBrowseForm_source" name="source"> <? foreach ($this->alphaBrowseTypes as $key => $item): ?>
<? foreach ($this->alphaBrowseTypes as $key => $item): ?> <option value="<?=$this->escapeHtmlAttr($key) ?>"<? if ($this->source == $key): ?> selected="selected"<? endif; ?>><?=$this->transEsc($item) ?></option>
<option value="<?=$this->escapeHtmlAttr($key) ?>"<? if ($this->source == $key): ?> selected="selected"<? endif; ?>><?=$this->transEsc($item) ?></option> <? endforeach; ?>
<? endforeach; ?> </select>
</select> <label for="alphaBrowseForm_from"><?=$this->transEsc('starting from') ?></label>
<label for="alphaBrowseForm_from"><?=$this->transEsc('starting from') ?></label> <input type="text" name="from" id="alphaBrowseForm_from" value="<?=$this->escapeHtmlAttr($this->from) ?>"/>
<input type="text" name="from" id="alphaBrowseForm_from" value="<?=$this->escapeHtmlAttr($this->from) ?>"/> <input class="btn" type="submit" value="<?=$this->transEsc('Browse') ?>"/>
<input class="btn" type="submit" value="<?=$this->transEsc('Browse') ?>"/> </form>
</form> </div>
</div>
<? if ($this->result): ?> <? if ($this->result): ?>
<?=$pageLinks ?> <?=$pageLinks ?>
<table class="table table-striped"> <table class="table table-striped">
<tr><td></td><th><?=$this->transEsc("alphabrowse_matches") ?></th></tr> <thead>
<tr>
<th class="<?=$this->source ?>"></th>
<? foreach ($this->extras as $e): ?>
<th></th>
<? endforeach; ?>
<th class="titles"><?=$this->transEsc("alphabrowse_matches") ?></th>
</tr>
</thead>
<tbody>
<? foreach ($this->result['Browse']['items'] as $i => $item): ?> <? foreach ($this->result['Browse']['items'] as $i => $item): ?>
<tr> <tr>
<td> <td>
...@@ -53,16 +61,15 @@ ...@@ -53,16 +61,15 @@
<? else: ?> <? else: ?>
<? $query = array('type' => ucwords($this->source) . 'Browse', 'lookfor' => '"' . addcslashes($item['heading'], '"') . '"'); ?> <? $query = array('type' => ucwords($this->source) . 'Browse', 'lookfor' => '"' . addcslashes($item['heading'], '"') . '"'); ?>
<? endif; ?> <? endif; ?>
<a class="span6" href="<?=$this->escapeHtmlAttr($this->url('search-results', array(), array('query' => $query)))?>"><?=$this->escapeHtml($item['heading'])?></a> <a href="<?=$this->escapeHtmlAttr($this->url('search-results', array(), array('query' => $query)))?>"><?=$this->escapeHtml($item['heading'])?></a>
<? else: ?> <? else: ?>
<span class="span6"><?=$this->escapeHtml($item['heading'])?></span> <span><?=$this->escapeHtml($item['heading'])?></span>
<? endif; ?> <? endif; ?>
<? <? foreach ($this->extras as $ei => $extraName):
foreach ($this->extras as $ei => $extraName):
$extraData = $item['extras'][$extraName]; $extraData = $item['extras'][$extraName];
?> ?>
<div class="span<?=floor(6/count($this->extras)) ?>"> <td>
<? <?
$extraDisplayArray = array(); $extraDisplayArray = array();
foreach ($extraData as $j => $e) { foreach ($extraData as $j => $e) {
...@@ -70,43 +77,42 @@ ...@@ -70,43 +77,42 @@
} }
echo (empty($extraDisplayArray)) ? '&nbsp;' : implode('<br />', $extraDisplayArray); echo (empty($extraDisplayArray)) ? '&nbsp;' : implode('<br />', $extraDisplayArray);
?> ?>
</div> </td>
<? endforeach; ?> <? endforeach; ?>
<div class="clearfix"></div>
<? if (count($item['useInstead']) > 0): ?> <? if (count($item['useInstead']) > 0): ?>
<div> <td>
<?=$this->transEsc('Use instead') ?>: <?=$this->transEsc('Use instead') ?>:
<ul> <ul>
<? foreach ($item['useInstead'] as $heading): ?> <? foreach ($item['useInstead'] as $heading): ?>
<li><a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', array(), array('query' => array('from' => $heading) + $baseQuery)))?>"><?=$this->escapeHtml($heading)?></a></li> <li><a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', array(), array('query' => array('from' => $heading) + $baseQuery)))?>"><?=$this->escapeHtml($heading)?></a></li>
<? endforeach; ?> <? endforeach; ?>
</ul> </ul>
</div> </td>
<? endif; ?> <? endif; ?>
<? if (count($item['seeAlso']) > 0): ?> <? if (count($item['seeAlso']) > 0): ?>
<div> <td>
<?=$this->transEsc('See also') ?>: <?=$this->transEsc('See also') ?>:
<ul> <ul>
<? foreach ($item['seeAlso'] as $heading): ?> <? foreach ($item['seeAlso'] as $heading): ?>
<li><a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', array(), array('query' => array('from' => $heading) + $baseQuery)))?>"><?=$this->escapeHtml($heading)?></a></li> <li><a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', array(), array('query' => array('from' => $heading) + $baseQuery)))?>"><?=$this->escapeHtml($heading)?></a></li>
<? endforeach; ?> <? endforeach; ?>
</ul> </ul>
</div> </td>
<? endif; ?> <? endif; ?>
<? if ($item['note']): ?> <? if ($item['note']): ?>
<div> <td>
<?=$this->transEsc('Note') ?>: <?=$this->transEsc('Note') ?>:
<ul> <ul>
<li><?=$this->escapeHtml($item['note'])?></li> <li><?=$this->escapeHtml($item['note'])?></li>
</ul> </ul>
</div> </td>
<? endif; ?> <? endif; ?>
</td> </td>
<td><? if ($item['count'] > 0): echo $item['count']; endif; ?></td> <td><? if ($item['count'] > 0): echo $item['count']; endif; ?></td>
<? endforeach; ?> <? endforeach; ?>
</table> </tbody>
<?= $pageLinks ?> </table>
<? endif; ?> <?= $pageLinks ?>
</div> <? endif; ?>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -30,7 +30,10 @@ label.list-group-item {border-radius:0;font-weight:normal;margin-top:0;padding-l ...@@ -30,7 +30,10 @@ label.list-group-item {border-radius:0;font-weight:normal;margin-top:0;padding-l
.tab-content {padding:4px} .tab-content {padding:4px}
/* --- Alphabrowse --- */ /* --- Alphabrowse --- */
td.lcc,th.lcc {width:20%;} .alphabrowse {
.lcc {max-width:20%;}
.titles {max-width:20%;}
}
/* --- Autocomplete --- */ /* --- Autocomplete --- */
.twitter-typeahead { .twitter-typeahead {
......
...@@ -36,20 +36,18 @@ ...@@ -36,20 +36,18 @@
<? if ($this->result): ?> <? if ($this->result): ?>
<?=$pageLinks ?> <?=$pageLinks ?>
<table class="table table-striped"> <table class="alphabrowse table table-striped">
<? foreach ($this->result['Browse']['items'] as $i => $item): ?> <thead>
<? if ($i == 0): ?> <tr>
<thead> <th class="<?=$this->source ?>"></th>
<tr> <? foreach ($this->extras as $e): ?>
<th class="<?=$this->source ?>"><?=$this->transEsc($this->source) ?></th> <th></th>
<? if(!empty($this->extras) || !empty($item['seeAlso']) || $item['note']): ?> <? endforeach; ?>
<th><?=$this->transEsc("information") ?></th> <th class="titles"><?=$this->transEsc("alphabrowse_matches") ?></th>
<? endif; ?> </tr>
<th><?=$this->transEsc("count") ?></th> </thead>
</tr> <tbody>
</thead> <? foreach ($this->result['Browse']['items'] as $item): ?>
<tbody>
<? endif; ?>
<tr> <tr>
<td class="<?=$this->source ?>"> <td class="<?=$this->source ?>">
<? if ($item['count'] > 0): ?> <? if ($item['count'] > 0): ?>
...@@ -67,32 +65,39 @@ ...@@ -67,32 +65,39 @@
<? endif; ?> <? endif; ?>
</td> </td>
<? if(!empty($this->extras) || !empty($item['seeAlso']) || $item['note']): ?> <? foreach ($this->extras as $extraName): ?>
<td> <td>
<? foreach ($this->extras as $extraName): ?> <?
<? foreach ($item['extras'][$extraName] as $data): ?> $extraDisplayArray = array();
<div><?=implode(', ', $data) ?></div> foreach ($item['extras'][$extraName] as $j => $e):
<? endforeach; ?> $extraDisplayArray = array_unique(array_merge($extraDisplayArray, $e));
<? endforeach; ?> endforeach;
echo empty($extraDisplayArray) ? '&nbsp;' : implode('<br />', $extraDisplayArray);
?>
</td>
<? endforeach; ?>
<? if (count($item['seeAlso']) > 0): ?> <? if (count($item['seeAlso']) > 0): ?>
<?=$this->transEsc('See also') ?>: <td>
<ul> <?=$this->transEsc('See also') ?>:
<? foreach ($item['seeAlso'] as $heading): ?> <ul>
<li><a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', array(), array('query' => array('from' => $heading) + $baseQuery)))?>"><?=$this->escapeHtml($heading)?></a></li> <? foreach ($item['seeAlso'] as $heading): ?>
<? endforeach; ?> <li><a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', array(), array('query' => array('from' => $heading) + $baseQuery)))?>"><?=$this->escapeHtml($heading)?></a></li>
</ul> <? endforeach; ?>
<? endif; ?> </ul>
</td>
<? endif; ?>
<? if ($item['note']): ?> <? if ($item['note']): ?>
<?=$this->transEsc('Note') ?>: <td>
<ul> <?=$this->transEsc('Note') ?>:
<li><?=$this->escapeHtml($item['note'])?></li> <ul>
</ul> <li><?=$this->escapeHtml($item['note'])?></li>
<? endif; ?> </ul>
</td> </td>
<? endif; ?> <? endif; ?>
<td>
<td class="titles">
<? if ($item['count'] > 0): ?> <? if ($item['count'] > 0): ?>
<?=$item['count']; ?> <?=$item['count']; ?>
<? elseif (count($item['useInstead']) > 0): ?> <? elseif (count($item['useInstead']) > 0): ?>
......
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