Skip to content
Snippets Groups Projects
Commit f6ce2112 authored by Demian Katz's avatar Demian Katz
Browse files

Merge branch 'master' into error_codes

parents 07afa01a 63b19c64
No related merge requests found
Showing with 539 additions and 255 deletions
...@@ -613,7 +613,9 @@ coverimagesCache = true ...@@ -613,7 +613,9 @@ coverimagesCache = true
; These settings control the image to display when no book cover is available. ; These settings control the image to display when no book cover is available.
; If makeDynamicCovers is not false and the GD library is installed, VuFind will draw ; If makeDynamicCovers is not false and the GD library is installed, VuFind will draw
; cover images on the fly. Possible values: false, solid, grid ; cover images on the fly. See [DynamicCovers] below for more settings. If set to
; a non-Boolean value, for legacy reasons, the makeDynamicCovers setting will
; be used as the backgroundMode setting of [DynamicCovers] if that setting is unset.
;makeDynamicCovers = true ;makeDynamicCovers = true
; Otherwise, you can use noCoverAvailableImage to specify a ; Otherwise, you can use noCoverAvailableImage to specify a
...@@ -662,14 +664,84 @@ authors = Wikipedia ...@@ -662,14 +664,84 @@ authors = Wikipedia
; You can select from Google, OpenLibrary, HathiTrust. You should consult ; You can select from Google, OpenLibrary, HathiTrust. You should consult
; http://code.google.com/apis/books/branding.html before using Google Book Search. ; http://code.google.com/apis/books/branding.html before using Google Book Search.
; previews = Google,OpenLibrary,HathiTrust ; previews = Google,OpenLibrary,HathiTrust
; This section controls the behavior of the cover generator when makeDynamicCovers
; above is non-false.
[DynamicCovers]
; This controls the background layer of the generated image; options:
; - solid: display a solid color
; - grid: display a symmetrical random pattern seeded by title/callnumber
;backgroundMode = grid
; This controls the text layer of the generated image; options:
; - default: display a title at the top and an author at the bottom
; - initial: display only the first letter of the title as a stylized initial
;textMode = default
; Font files specified here should exist in the css/font subdirectory of a theme.
; Some options are available by default inside the root theme.
;authorFont = "Roboto-Light.ttf"
;titleFont = "RobotoCondensed-Bold.ttf"
; In 'default' textMode, covers are generated using title and author name; VuFind
; will try to display everything by doing the following: break the title into
; lines, and if the title is too long (more than maxTitleLines lines), it will
; display ellipses at the last line.
;
; All text will be drawn using the specified textAlign alignment value using the
; relevant titleFontSize or authorFontSize setting, except that author names will
; be reduced to the minAuthorFontSize option if needed, and if that doesn't make
; it fit, text will be aligned left and truncated.
;
; When using 'initial' textMode, maxTitleLines and author-related settings are
; ignored as they do not apply.
;textAlign = center
;titleFontSize = 9
;authorFontSize = 8
;minAuthorFontSize = 7
;maxTitleLines = 4
; All color options support the same basic set of values:
; - The 16 named colors from HTML4
; - Arbitrary HTML hex colors in the form #RRGGBB (e.g. #FFFF00 for yellow)
; Some color options also support additional options.
; - authorFillColor,titleFillColor: the main color used
; - authorBorderColor,titleBorderColor: the color used to make a border; "none" is
; a legal option in addition to colors.
; - baseColor: When using grid backgrounds, you may also choose a base color drawn
; beneath the grid. Default is white.
; - accentColor: When using solid backgrounds, this is the background color; when
; using grid backgrounds, this is the color of the grid pattern beneath the text.
; You may set this to "random" to select a random color seeded with text from
; the cover and adjusted with the "lightness" and "saturation" settings below.
;titleFillColor = black
;titleBorderColor = none
;authorFillColor = white
;authorBorderColor = black
;baseColor = white
;accentColor = random
; Note: lightness and saturation are only used when accentColor = random. Legal
; ranges are 0-255 for each value.
;lightness = 220
;saturation = 80
; These settings control the size of the image -- if size is a single number, a
; square will be created; if it is a string containing an "x" (i.e. 160x190) it
; defines a WxH rectangle. wrapWidth constrains the text size (and must be no
; larger than the width of the canvas). topPadding and bottomPadding push the
; text away from the edges of the canvas.
;size = 128
;topPadding = 19
;bottomPadding = 3
;wrapWidth = 110
; This section is needed for Buchhandel.de cover loading. You need an authentication ; This section is needed for Buchhandel.de cover loading. You need an authentication
; token. It may also be necessary to customize your templates in order to comply with ; token. It may also be necessary to customize your templates in order to comply with
; terms of service; please look at http://info.buchhandel.de/handbuch_links for ; terms of service; please look at http://info.buchhandel.de/handbuch_links for
; details before turning this on. ; details before turning this on.
[Buchhandel] [Buchhandel]
url = "https://api.vlb.de/api/v1/cover/" url = "https://api.vlb.de/api/v1/cover/"
; token = "XXXXXX-XXXX-XXXXX-XXXXXXXXXXXX" ; token = "XXXXXX-XXXX-XXXXX-XXXXXXXXXXXX"
; Possible HathiRights options = pd,ic,op,orph,und,umall,ic-world,nobody,pdus,cc-by,cc-by-nd, ; Possible HathiRights options = pd,ic,op,orph,und,umall,ic-world,nobody,pdus,cc-by,cc-by-nd,
; cc-by-nc-nd,cc-by-nc,cc-by-nc-sa,cc-by-sa,orphcand,cc-zero,und-world,icus ; cc-by-nc-nd,cc-by-nc,cc-by-nc-sa,cc-by-sa,orphcand,cc-zero,und-world,icus
...@@ -1041,7 +1113,7 @@ era = true ; allow browsing of era subdivisions ...@@ -1041,7 +1113,7 @@ era = true ; allow browsing of era subdivisions
; <result_limit> most popular entries -- it only affects display order. ; <result_limit> most popular entries -- it only affects display order.
;alphabetical_order = true ;alphabetical_order = true
; This section controls the availability of export methods. ; This section controls the availability of export methods.
; ;
; Each entry may be a comma-separated list of contexts in which the export ; Each entry may be a comma-separated list of contexts in which the export
; option will be presented. Valid options: ; option will be presented. Valid options:
......
This diff is collapsed.
...@@ -156,10 +156,14 @@ class Loader extends \VuFind\ImageLoader ...@@ -156,10 +156,14 @@ class Loader extends \VuFind\ImageLoader
*/ */
public function getCoverGenerator() public function getCoverGenerator()
{ {
return new \VuFind\Cover\Generator( $settings = isset($this->config->DynamicCovers)
$this->themeTools, ? $this->config->DynamicCovers->toArray() : [];
['mode' => $this->config->Content->makeDynamicCovers] if (!isset($settings['backgroundMode'])
); && isset($this->config->Content->makeDynamicCovers)
) {
$settings['backgroundMode'] = $this->config->Content->makeDynamicCovers;
}
return new \VuFind\Cover\Generator($this->themeTools, $settings);
} }
/** /**
......
...@@ -186,9 +186,9 @@ class DeduplicationListener ...@@ -186,9 +186,9 @@ class DeduplicationListener
$config = $this->serviceLocator->get('VuFind\Config'); $config = $this->serviceLocator->get('VuFind\Config');
$searchConfig = $config->get($this->searchConfig); $searchConfig = $config->get($this->searchConfig);
$dataSourceConfig = $config->get($this->dataSourceConfig); $dataSourceConfig = $config->get($this->dataSourceConfig);
$recordSources = isset($searchConfig->Records->sources) $recordSources = !empty($searchConfig->Records->sources)
? $searchConfig->Records->sources ? explode(',', $searchConfig->Records->sources)
: ''; : [];
$sourcePriority = $this->determineSourcePriority($recordSources); $sourcePriority = $this->determineSourcePriority($recordSources);
$params = $event->getParam('params'); $params = $event->getParam('params');
$buildingPriority = $this->determineBuildingPriority($params); $buildingPriority = $this->determineBuildingPriority($params);
...@@ -212,7 +212,7 @@ class DeduplicationListener ...@@ -212,7 +212,7 @@ class DeduplicationListener
$localPriority = null; $localPriority = null;
list($source) = explode('.', $localId, 2); list($source) = explode('.', $localId, 2);
// Ignore ID if source is not in the list of allowed record sources: // Ignore ID if source is not in the list of allowed record sources:
if (!empty($sourcePriority) && !isset($sourcePriority[$source])) { if ($recordSources && !in_array($source, $recordSources)) {
continue; continue;
} }
if (!empty($buildingPriority)) { if (!empty($buildingPriority)) {
...@@ -304,10 +304,10 @@ class DeduplicationListener ...@@ -304,10 +304,10 @@ class DeduplicationListener
* two parameters are unused in this default method, but they may be useful for * two parameters are unused in this default method, but they may be useful for
* custom behavior in subclasses. * custom behavior in subclasses.
* *
* @param array $localRecordData Local record data * @param array $localRecordData Local record data
* @param array $dedupRecordData Dedup record data * @param array $dedupRecordData Dedup record data
* @param string $recordSources List of active record sources, empty if all * @param array $recordSources List of active record sources, empty if all
* @param array $sourcePriority Array of source priorities keyed by source id * @param array $sourcePriority Array of source priorities keyed by source id
* *
* @return array Local record data * @return array Local record data
* *
...@@ -323,7 +323,7 @@ class DeduplicationListener ...@@ -323,7 +323,7 @@ class DeduplicationListener
/** /**
* Function that determines the priority for sources * Function that determines the priority for sources
* *
* @param object $recordSources Record sources defined in searches.ini * @param array $recordSources Record sources defined in searches.ini
* *
* @return array Array keyed by source with priority as the value * @return array Array keyed by source with priority as the value
*/ */
...@@ -332,7 +332,7 @@ class DeduplicationListener ...@@ -332,7 +332,7 @@ class DeduplicationListener
if (empty($recordSources)) { if (empty($recordSources)) {
return []; return [];
} }
return array_flip(explode(',', $recordSources)); return array_flip($recordSources);
} }
/** /**
......
...@@ -354,16 +354,6 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -354,16 +354,6 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase
$this->findCss($page, 'a.title')->getText() $this->findCss($page, 'a.title')->getText()
); );
/* TODO: uncomment this test when Bootstrap bug stops making it fail...
* Specifically, at the time of this writing, if you click the dropdown
* menu to get "Yes" and "No" options, then click "No," then the next
* time you attempt to pop down the dropdown, it quickly closes itself
* before "Yes" can be clicked. This appears to be a bug on the Bootstrap
* side affecting Firefox only. Once it is resolved, we should add this
* check to the test to prevent regressions... but for now better to leave
* this commented out so a bug beyond our control does not break VuFind's
* test suite.
*
// Click cancel but bail out with no... item should still be there. // Click cancel but bail out with no... item should still be there.
$this->findCss($page, '#cancelAll')->click(); $this->findCss($page, '#cancelAll')->click();
$this->clickButtonGroupLink($page, 'No'); $this->clickButtonGroupLink($page, 'No');
...@@ -373,7 +363,6 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -373,7 +363,6 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase
. ' the journal of the Institute for Rational-Emotive Therapy.', . ' the journal of the Institute for Rational-Emotive Therapy.',
$this->findCss($page, 'a.title')->getText() $this->findCss($page, 'a.title')->getText()
); );
*/
// Now cancel for real: // Now cancel for real:
$this->findCss($page, '#cancelAll')->click(); $this->findCss($page, '#cancelAll')->click();
......
...@@ -303,10 +303,7 @@ class Connector implements \Zend\Log\LoggerAwareInterface ...@@ -303,10 +303,7 @@ class Connector implements \Zend\Log\LoggerAwareInterface
} }
// QUERYSTRING: indx (start record) // QUERYSTRING: indx (start record)
$recordStart = $args["pageNumber"]; $recordStart = ($args["pageNumber"] - 1) * $args['limit'] + 1;
if ($recordStart != 1) {
$recordStart = ($recordStart * 10) + 1;
}
$qs[] = "indx=$recordStart"; $qs[] = "indx=$recordStart";
// TODO: put bulksize in conf file? set a reasonable cap... // TODO: put bulksize in conf file? set a reasonable cap...
......
.btn:focus{outline:dotted 2px #000}div.active:focus{outline:dotted 1px #000}a:focus{outline:dotted 1px #000}.close:hover,.close:focus{outline:dotted 1px #000}.nav>li>a:hover,.nav>li>a:focus{outline:dotted 1px #000}.carousel-indicators li,.carousel-indicators li.active{height:18px;width:18px;border-width:2px;position:relative;box-shadow:0px 0px 0px 1px #808080;-moz-boxshadow:0px 0px 0px 1px #808080;-webkit-boxshadow:0px 0px 0px 1px #808080}.carousel-indicators.active li{background-color:rgba(100,149,253,0.6)}.carousel-indicators.active li.active{background-color:white}.carousel-tablist-highlight{display:block;position:absolute;outline:2px solid transparent;background-color:transparent;box-shadow:0px 0px 0px 1px transparent;-moz-boxshadow:0px 0px 0px 1px transparent;-webkit-boxshadow:0px 0px 0px 1px transparent}.carousel-tablist-highlight.focus{outline:2px solid #6495ED;background-color:rgba(0,0,0,0.4)}a.carousel-control:focus{outline:2px solid #6495ED;background-image:linear-gradient(to right, transparent 0px, rgba(0,0,0,0.5) 100%);box-shadow:0px 0px 0px 1px #000000;-moz-boxshadow:0px 0px 0px 1px #000000;-webkit-boxshadow:0px 0px 0px 1px #000000}.carousel-pause-button{position:absolute;top:-30em;left:-300em;display:block}.carousel-pause-button.focus{top:0.5em;left:0.5em}.carousel:hover .carousel-caption,.carousel.contrast .carousel-caption{background-color:rgba(0,0,0,0.5);z-index:10}.alert-success{color:#2d4821}.alert-info{color:#214c62}.alert-warning{color:#6c4a00;background-color:#f9f1c6}.alert-danger{color:#d2322d}.alert-danger:hover{color:#a82824} .btn:focus{outline:dotted 2px #000}div.active:focus{outline:dotted 1px #000}a:focus{outline:dotted 1px #000}.close:hover,.close:focus{outline:dotted 1px #000}.nav>li>a:hover,.nav>li>a:focus{outline:dotted 1px #000}.carousel-indicators li,.carousel-indicators li.active{height:18px;width:18px;border-width:2px;position:relative;box-shadow:0px 0px 0px 1px #808080}.carousel-indicators.active li{background-color:rgba(100,149,253,0.6)}.carousel-indicators.active li.active{background-color:white}.carousel-tablist-highlight{display:block;position:absolute;outline:2px solid transparent;background-color:transparent;box-shadow:0px 0px 0px 1px transparent}.carousel-tablist-highlight.focus{outline:2px solid #6495ED;background-color:rgba(0,0,0,0.4)}a.carousel-control:focus{outline:2px solid #6495ED;background-image:linear-gradient(to right, transparent 0px, rgba(0,0,0,0.5) 100%);box-shadow:0px 0px 0px 1px #000000}.carousel-pause-button{position:absolute;top:-30em;left:-300em;display:block}.carousel-pause-button.focus{top:0.5em;left:0.5em}.carousel:hover .carousel-caption,.carousel.contrast .carousel-caption{background-color:rgba(0,0,0,0.5);z-index:10}.alert-success{color:#2d4821}.alert-info{color:#214c62}.alert-warning{color:#6c4a00;background-color:#f9f1c6}.alert-danger{color:#d2322d}.alert-danger:hover{color:#a82824}
\ No newline at end of file \ No newline at end of file
File added
File added
File added
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