Index: interface/themes/blueprint/Search/list-grid.tpl =================================================================== --- interface/themes/blueprint/Search/list-grid.tpl (revision 0) +++ interface/themes/blueprint/Search/list-grid.tpl (revision 0) @@ -0,0 +1,33 @@ +{js filename="check_item_statuses.js"} +{js filename="check_save_statuses.js"} +{js filename="jquery.cookie.js"} +{js filename="cart.js"} +{js filename="openurl.js"} +{if $showPreviews} +{js filename="preview.js"} +{/if} + +
+ {* hide until complete +
+ + +
+
+ *} + + + {foreach from=$recordSet item=record name="recordLoop"} + + {if (($smarty.foreach.recordLoop.iteration % 4) == 0) && (!$smarty.foreach.recordLoop.last)}{/if} + {/foreach} + +
+ {$recordStart+$smarty.foreach.recordLoop.iteration-1} + {* This is raw HTML -- do not escape it: *}{$record} +
+
\ No newline at end of file Index: interface/themes/classic/Search/list-grid.tpl =================================================================== --- interface/themes/classic/Search/list-grid.tpl (revision 0) +++ interface/themes/classic/Search/list-grid.tpl (revision 0) @@ -0,0 +1,22 @@ +
+ + + {foreach from=$recordSet item=record name="recordLoop"} + + {if (($smarty.foreach.recordLoop.iteration % 4) == 0) && (!$smarty.foreach.recordLoop.last)}{/if} + {/foreach} + +
{* This is raw HTML -- do not escape it: *}{$record}
+
+ + Index: interface/themes/default/Search/list-grid.tpl =================================================================== --- interface/themes/default/Search/list-grid.tpl (revision 0) +++ interface/themes/default/Search/list-grid.tpl (revision 0) @@ -0,0 +1,22 @@ +
+ + + {foreach from=$recordSet item=record name="recordLoop"} + + {if (($smarty.foreach.recordLoop.iteration % 4) == 0) && (!$smarty.foreach.recordLoop.last)}{/if} + {/foreach} + +
{* This is raw HTML -- do not escape it: *}{$record}
+
+ + Index: interface/themes/blueprint/RecordDrivers/Index/result-grid.tpl =================================================================== --- interface/themes/blueprint/RecordDrivers/Index/result-grid.tpl (revision 0) +++ interface/themes/blueprint/RecordDrivers/Index/result-grid.tpl (revision 0) @@ -0,0 +1,30 @@ +
+ + + {if $summThumbLarge} + {translate text='Cover Image'} + {else} + {translate text='No Cover Image'} + {/if} + + + + + {if !$summTitle}{translate text='Title not available'}{else}{$summTitle|truncate:55:"..."|highlight:$lookfor}{/if} + + {if $summOpenUrl || !empty($summURLs)} + {if $summOpenUrl} + {include file="Search/openurl.tpl" openUrl=$summOpenUrl} + {/if} + {foreach from=$summURLs key=recordurl item=urldesc} +
{if $recordurl == $urldesc}{translate text='Get full text'}{else}{$urldesc|escape}{/if} + {/foreach} + {else} +
+ {translate text='Loading'}... +
+ {/if} +
+
+ +{if $summCOinS}{/if} \ No newline at end of file Index: interface/themes/classic/RecordDrivers/Index/result-grid.tpl =================================================================== --- interface/themes/classic/RecordDrivers/Index/result-grid.tpl (revision 0) +++ interface/themes/classic/RecordDrivers/Index/result-grid.tpl (revision 0) @@ -0,0 +1,48 @@ +
+ + + {if $summThumbLarge} + {translate text='Cover Image'} + {else} + {translate text='No Cover Image'} + {/if} + + + + + {if !$summTitle}{translate text='Title not available'}{else}{$summTitle|truncate:80:"..."|highlight:$lookfor}{/if} + + {if $summOpenUrl || !empty($summURLs)} + {if $summOpenUrl} + {include file="Search/openurl.tpl" openUrl=$summOpenUrl} + {/if} + {foreach from=$summURLs key=recordurl item=urldesc} +
+ {if $recordurl == $urldesc}{translate text='Get full text'}{else}{$urldesc|escape}{/if} +
+ {/foreach} + {else} +
+ {translate text='Loading'}... +
+ {/if} +
+
+ +{if $summCOinS}{/if} + +{if $summAjaxStatus} + +{/if} +{if $showPreviews} + +{/if} Index: interface/themes/default/RecordDrivers/Index/result-grid.tpl =================================================================== --- interface/themes/default/RecordDrivers/Index/result-grid.tpl (revision 0) +++ interface/themes/default/RecordDrivers/Index/result-grid.tpl (revision 0) @@ -0,0 +1,48 @@ +
+ + + {if $summThumbLarge} + {translate text='Cover Image'} + {else} + {translate text='No Cover Image'} + {/if} + + + + + {if !$summTitle}{translate text='Title not available'}{else}{$summTitle|truncate:80:"..."|highlight:$lookfor}{/if} + + {if $summOpenUrl || !empty($summURLs)} + {if $summOpenUrl} + {include file="Search/openurl.tpl" openUrl=$summOpenUrl} + {/if} + {foreach from=$summURLs key=recordurl item=urldesc} +
+ {if $recordurl == $urldesc}{translate text='Get full text'}{else}{$urldesc|escape}{/if} +
+ {/foreach} + {else} +
+ {translate text='Loading'}... +
+ {/if} +
+
+ +{if $summCOinS}{/if} + +{if $summAjaxStatus} + +{/if} +{if $showPreviews} + +{/if} Index: interface/themes/blueprint/RecordDrivers/Index/result-list.tpl =================================================================== --- interface/themes/blueprint/RecordDrivers/Index/result-list.tpl (revision 0) +++ interface/themes/blueprint/RecordDrivers/Index/result-list.tpl (revision 0) @@ -0,0 +1,99 @@ +
+ {* hide until complete + + + *} +
+ {if $summThumb} + {translate text='Cover Image'} + {else} + {translate text='No Cover Image'} + {/if} +
+
+ + +
+ {if !empty($summAuthor)} + {translate text='by'} + {if !empty($summHighlightedAuthor)}{$summHighlightedAuthor|highlight}{else}{$summAuthor|escape}{/if} + {/if} + + {if $summDate}{translate text='Published'} {$summDate.0|escape}{/if} +
+ +
+ {if !empty($summSnippetCaption)}{translate text=$summSnippetCaption}:{/if} + {if !empty($summSnippet)}...{$summSnippet|highlight}...
{/if} + {if $summAjaxStatus} + {translate text='Call Number'}: {translate text='Loading'}...
+ {translate text='Located'}: {translate text='Loading'}... + {elseif !empty($summCallNo)} + {translate text='Call Number'}: {$summCallNo|escape} + {/if} + + {if $summOpenUrl || !empty($summURLs)} + {if $summOpenUrl} +
+ {include file="Search/openurl.tpl" openUrl=$summOpenUrl} + {/if} + {foreach from=$summURLs key=recordurl item=urldesc} +
{if $recordurl == $urldesc}{translate text='Get full text'}{else}{$urldesc|escape}{/if} + {/foreach} + {/if} + +
+ {foreach from=$summFormats item=format} + {translate text=$format} + {/foreach} + + {if !$summOpenUrl && empty($summURLs)} + {translate text='Loading'}... + {/if} +
+ + {if $showPreviews} + {if (!empty($summLCCN)|!empty($summISBN)|!empty($summOCLC))} +
+ {if $showGBSPreviews} +
+ + {translate text='Preview'} + +
+ {/if} + {if $showOLPreviews} +
+ + {translate text='Preview'} + +
+ {/if} + {if $showHTPreviews} +
+ + {translate text='Preview'} + +
+ {/if} + +
+ {/if} + {/if} +
+ +
+ {translate text='Add to favorites'} + + {* Display the lists that this record is saved to *} +
+ {translate text="Saved in"}: +
+
+ +
+
+ +{if $summCOinS}{/if} Index: interface/themes/classic/RecordDrivers/Index/result-list.tpl =================================================================== --- interface/themes/classic/RecordDrivers/Index/result-list.tpl (revision 0) +++ interface/themes/classic/RecordDrivers/Index/result-list.tpl (revision 0) @@ -0,0 +1,104 @@ +
+
+ {if $summThumb} + {translate text='Cover Image'} + {else} + {translate text='No Cover Image'} + {/if} +
+ + +
+ {if !empty($summAuthor)} + {translate text='by'} + {if !empty($summHighlightedAuthor)}{$summHighlightedAuthor|highlight}{else}{$summAuthor|escape}{/if} + {/if} + + {if $summDate}{translate text='Published'} {$summDate.0|escape}{/if} +
+ +
+ {if !empty($summSnippetCaption)}{translate text=$summSnippetCaption}:{/if} + {if !empty($summSnippet)}...{$summSnippet|highlight}...
{/if} + {if $summAjaxStatus} + {translate text='Call Number'}: {translate text='Loading'}
+ {translate text='Located'}: {translate text='Loading'} + {elseif !empty($summCallNo)} + {translate text='Call Number'}: {$summCallNo|escape} + {/if} + + {if $summOpenUrl || !empty($summURLs)} + {if $summOpenUrl} +
+ {include file="Search/openurl.tpl" openUrl=$summOpenUrl} + {/if} + {foreach from=$summURLs key=recordurl item=urldesc} +
{if $recordurl == $urldesc}{translate text='Get full text'}{else}{$urldesc|escape}{/if} + {/foreach} + {elseif $summAjaxStatus} +
+ {translate text='Loading'}... +
+ {/if} +
+ {foreach from=$summFormats item=format} + {translate text=$format} + {/foreach} +
+
+ +
+
+ {translate text='Add to favorites'} +
    + +
    + {if $showPreviews} + {if (!empty($summLCCN)|!empty($summISBN)|!empty($summOCLC))} + {if $showGBSPreviews} +
    + +
    + {/if} + {if $showOLPreviews} +
    + +
    + {/if} + {if $showHTPreviews} +
    + +
    + {/if} + {/if} + {/if} +
    +
    + +{if $summCOinS}{/if} + +{if $summAjaxStatus} + +{/if} +{if $showPreviews} + +{/if} Index: interface/themes/default/RecordDrivers/Index/result-list.tpl =================================================================== --- interface/themes/default/RecordDrivers/Index/result-list.tpl (revision 0) +++ interface/themes/default/RecordDrivers/Index/result-list.tpl (revision 0) @@ -0,0 +1,104 @@ +
    +
    + {if $summThumb} + {translate text='Cover Image'} + {else} + {translate text='No Cover Image'} + {/if} +
    + + +
    + {if !empty($summAuthor)} + {translate text='by'} + {if !empty($summHighlightedAuthor)}{$summHighlightedAuthor|highlight}{else}{$summAuthor|escape}{/if} + {/if} + + {if $summDate}{translate text='Published'} {$summDate.0|escape}{/if} +
    + +
    + {if !empty($summSnippetCaption)}{translate text=$summSnippetCaption}:{/if} + {if !empty($summSnippet)}...{$summSnippet|highlight}...
    {/if} + {if $summAjaxStatus} + {translate text='Call Number'}: {translate text='Loading'}
    + {translate text='Located'}: {translate text='Loading'} + {elseif !empty($summCallNo)} + {translate text='Call Number'}: {$summCallNo|escape} + {/if} + + {if $summOpenUrl || !empty($summURLs)} + {if $summOpenUrl} +
    + {include file="Search/openurl.tpl" openUrl=$summOpenUrl} + {/if} + {foreach from=$summURLs key=recordurl item=urldesc} +
    {if $recordurl == $urldesc}{translate text='Get full text'}{else}{$urldesc|escape}{/if} + {/foreach} + {elseif $summAjaxStatus} +
    + {translate text='Loading'}... +
    + {/if} +
    + {foreach from=$summFormats item=format} + {translate text=$format} + {/foreach} +
    +
    + +
    +
    + {translate text='Add to favorites'} +
      + +
      + {if $showPreviews} + {if (!empty($summLCCN)|!empty($summISBN)|!empty($summOCLC))} + {if $showGBSPreviews} +
      + +
      + {/if} + {if $showOLPreviews} +
      + +
      + {/if} + {if $showHTPreviews} +
      + +
      + {/if} + {/if} + {/if} +
      +
      + +{if $summCOinS}{/if} + +{if $summAjaxStatus} + +{/if} +{if $showPreviews} + +{/if} Index: interface/themes/blueprint/css/styles.css =================================================================== --- interface/themes/blueprint/css/styles.css (revision 3738) +++ interface/themes/blueprint/css/styles.css (working copy) @@ -336,9 +336,10 @@ font-size: 90%; } .resulthead { - padding:.4em; - margin-bottom:.5em; + padding:.4em .4em 0em .4em; border-bottom: 1px #eee solid; + position: relative; + height: 100%; } .savedLists { margin-top: .4em; @@ -1150,3 +1151,49 @@ text-align:right; text-decoration:none; } + +/* Grid View */ + +.hitCount { + position: absolute; + bottom: 0px; +} + +.viewButtons { + text-align: right; +} + +.gridImageBox { + text-align:center; + width:155px; + height:130px; + overflow:hidden; + display:block; +} + +.gridImage{ + height:130px; +} + +.gridTitleBox { + height:55px; + display:block; + text-align:center; + font-size:86%; + width:155px; +} + +.gridTitle { + display:block; + height:40px; +} + +td.gridCell { + width: 25%; +} + +tr:nth-child(even) td.gridCell {background-color:#f5f5f5;} + +.gridMouseOver { + background-color:#f5f5f5; +} Index: interface/themes/classic/css/styles.css =================================================================== --- interface/themes/classic/css/styles.css (revision 3669) +++ interface/themes/classic/css/styles.css (working copy) @@ -195,10 +195,15 @@ background-color:#fff; } .toggle { + position: absolute; + bottom: 0px; + right: 0px; + margin-bottom: 1px; text-align:right; } .toggle img { vertical-align:text-bottom; + margin: 0px 0px 3px 2px; } .resultitem { margin-left:100px; @@ -207,7 +212,9 @@ padding:10px 10px 5px 10px; margin-bottom:1.5em; border-bottom: 1px solid #eee; + position: relative; } + .searchbox { padding:15px 20px; } @@ -625,10 +632,9 @@ .pagination { font-size:90%; - padding:1.5em 0 1.5em 0; + padding:0.5em 0 1.5em 0; margin:1.5em 0; text-align:center; - border-top: 1px solid #eee; } .pagination a { padding: .2em .3em; @@ -1228,3 +1234,39 @@ text-align:right; text-decoration:none; } + +/* Grid View */ +.gridRecordBox { + margin: 0px 3px 3px 3px; + padding: 5px 1px 3px 3px +} + +.gridImageBox { + text-align:center; + width:155px; + height:130px; + overflow:hidden; + display:block; +} + +.gridImage{ + height:130px; +} + +.gridTitleBox { + height:55px; + display:block; + text-align:center; + font-size:86%; + width:155px; +} + +.gridTitle { + display:block; + height:40px; +} + +.gridMouseOver { + background-color:#f5f5f5; +} + Index: interface/themes/default/css/styles.css =================================================================== --- interface/themes/default/css/styles.css (revision 3669) +++ interface/themes/default/css/styles.css (working copy) @@ -282,10 +282,15 @@ background-color:#fff; } .toggle { + position: absolute; + bottom: 0px; + right: 5px; + margin-bottom: 1px; text-align:right; } .toggle img { vertical-align:text-bottom; + margin: 0px 0px 3px 2px; } .authorbox { padding:0 0 1em 1em; @@ -301,9 +306,10 @@ } .resulthead { - padding:0px 10px 0 10px; + padding:25px 10px 0 10px; margin-bottom:.5em; border-bottom: 1px #eee solid; + position: relative; } .searchtools { @@ -1300,3 +1306,42 @@ text-align:right; text-decoration:none; } + +/* Grid View */ +.gridRecordBox { + margin: 0px 3px 3px 3px; + padding: 5px 1px 3px 15px; +} + +.gridImageBox { + text-align:center; + width:155px; + height:130px; + overflow:hidden; + display:block; +} + +.gridImage{ + height:130px; +} + +.gridTitleBox { + height:55px; + display:block; + text-align:center; + font-size:86%; + width:155px; +} + +.gridTitle { + display:block; + height:40px; +} + +.gridMouseOver { + background-color:#f5f5f5; +} + +.gridline { + border-bottom: 1px solid #EEEEEE; +} Index: conf/searches.ini =================================================================== --- conf/searches.ini (revision 3738) +++ conf/searches.ini (working copy) @@ -8,6 +8,10 @@ ; below. default_sort = relevance +; This setting controls the default view for search results; the selected option +; should be one of the options present in the [Views] section below. +default_view = list + ; If this setting is true, boolean operators in searches (AND/OR/NOT) will only ; be recognized if they are ALL UPPERCASE. If set to false, they will be ; recognized regardless of case. @@ -179,12 +183,11 @@ ; ; You can build your own recommendations modules if you wish. See the developer's ; guide here: -; ; http://vufind.org/wiki/building_a_recommendations_module [SideRecommendations] ; No search-specific settings by default -- add your own here. -;Subject[] = SideFacets -;Subject[] = OpenLibrarySubjectsDeferred:lookfor:5:true:topic,place,person,time +;Subject[] = SideFacets +;Subject[] = OpenLibrarySubjectsDeferred:lookfor:5:true:topic,place,person,time [TopRecommendations] Author[] = AuthorFacets @@ -303,3 +306,11 @@ ; Put in the fields to strip here in the following format: ; shard name = fieldname,another fieldname,... [StripFields] + +; This section defines the view options available on standard search results. +; If only one view is required, set default_view under [General] above, and +; leave this section commented out. +[Views] +list = List +grid = Grid + Index: interface/themes/blueprint/js/common.js =================================================================== --- interface/themes/blueprint/js/common.js (revision 3738) +++ interface/themes/blueprint/js/common.js (working copy) @@ -53,6 +53,16 @@ $('input[type="checkbox"].selectAllCheckboxes').change(function(){ $(this.form).find('input[type="checkbox"]').attr('checked', $(this).attr('checked')); }); + + // attach mouseover event to grid view records + $('.gridCellHover').mouseover(function() { + $(this).addClass('gridMouseOver') + }); + + // attach mouseout event to grid view records + $('.gridCellHover').mouseout(function() { + $(this).removeClass('gridMouseOver') + }); }); function toggleMenu(elemId) { Index: sys/SearchObject/Base.php =================================================================== --- sys/SearchObject/Base.php (revision 3738) +++ sys/SearchObject/Base.php (working copy) @@ -46,6 +46,7 @@ // SEARCH PARAMETERS // RSS feed? protected $view = null; + protected $defaultView = 'list'; // Search terms protected $searchTerms = array(); // Sorting @@ -77,6 +78,8 @@ protected $defaultIndex = null; // Available sort options protected $sortOptions = array(); + // Available view options + protected $viewOptions = array(); // An ID number for saving/retrieving search protected $searchId = null; protected $savedSearch = false; @@ -551,10 +554,28 @@ */ protected function initView() { - //******************** - // RSS feed? We should only see this in GET from a url. - if (isset($_REQUEST['view']) && ($_REQUEST['view'] == 'rss')) { - $this->view = 'rss'; + // Check for a view parameter in the url. + if (isset($_REQUEST['view'])) { + if ($_REQUEST['view'] == 'rss') { + // we don't want to store rss in the Session variable + $this->view = 'rss'; + } else { + // store non-rss views in Session for persistence + $validViews = $this->getViewOptions(); + // make sure the url parameter is a valid view + if (in_array($_REQUEST['view'], array_keys($validViews))) { + $this->view = $_REQUEST['view']; + $_SESSION['lastView'] = $this->view; + } else { + $this->view = $this->defaultView; + } + } + } else if (isset($_SESSION['lastView'])) { + // if there is nothing in the URL, check the Session variable + $this->view = $_SESSION['lastView']; + } else { + // otherwise load the default + $this->view = $this->defaultView; } } @@ -815,8 +836,51 @@ } return $list; } + /** + * Return a url for the current search with a new view + * + * @param string $newView The new view + * + * @return string URL of a new search + * @access public + */ + public function renderLinkWithView($newView) + { + // Stash our old data for a minute + $oldView = $this->view; + // Add the new sort + $this->view = $newView; + // Get the new url + $url = $this->renderSearchUrl(); + // Restore the old data + $this->view = $oldView; + // Return the URL + return $url; + } /** + * Return a list of urls for possible views, along with which option + * should be currently selected. + * + * @access public + * @return array View urls, descriptions and selected flags + */ + public function getViewList() + { + // Loop through all the current filter fields + $valid = $this->getViewOptions(); + $list = array(); + foreach ($valid as $view => $desc) { + $list[$view] = array( + 'viewType' => $view, + 'viewUrl' => $this->renderLinkWithView($view), + 'desc' => $desc, + 'selected' => ($view == $this->view) + ); + } + return $list; + } + /** * Basic 'getter' for advanced types. * * @return array @@ -1003,8 +1067,19 @@ { return $this->sortOptions; } - /** + * Get an array of view options; protected since this should not be used + * outside of the class. + * + * @access protected + * @return array + */ + protected function getViewOptions() + { + return $this->viewOptions; + } + + /** * Reset a simple query against the default index. * * @param string $query Query string Index: RecordDrivers/IndexRecord.php =================================================================== --- RecordDrivers/IndexRecord.php (revision 3738) +++ RecordDrivers/IndexRecord.php (working copy) @@ -660,10 +660,12 @@ * load in order to display a summary of the item suitable for use in * search results. * + * @param string $view The current view. + * * @return string Name of Smarty template file to display. * @access public */ - public function getSearchResult() + public function getSearchResult($view = 'list') { global $configArray; global $interface; @@ -677,6 +679,7 @@ $interface->assign('summDate', $this->getPublicationDates()); $interface->assign('summISBN', $this->getCleanISBN()); $interface->assign('summThumb', $this->getThumbnail()); + $interface->assign('summThumbLarge', $this->getThumbnail('large')); $issn = $this->getCleanISSN(); $interface->assign('summISSN', $issn); $interface->assign('summLCCN', $this->getLCCN()); @@ -717,7 +720,7 @@ $interface->assign('summAjaxStatus', false); // Send back the template to display: - return 'RecordDrivers/Index/result.tpl'; + return 'RecordDrivers/Index/result-' . $view . '.tpl'; } /** Index: RecordDrivers/Interface.php =================================================================== --- RecordDrivers/Interface.php (revision 3738) +++ RecordDrivers/Interface.php (working copy) @@ -210,14 +210,16 @@ public function getReviews(); /** - * Assign necessary Smarty variables and return a template name to + * Assign necessary Smarty variables and return a template name for the current view to * load in order to display a summary of the item suitable for use in * search results. * + * @param string $view The current view. + * * @return string Name of Smarty template file to display. * @access public */ - public function getSearchResult(); + public function getSearchResult($view = 'list'); /** * Assign necessary Smarty variables and return a template name to Index: RecordDrivers/MarcRecord.php =================================================================== --- RecordDrivers/MarcRecord.php (revision 3669) +++ RecordDrivers/MarcRecord.php (working copy) @@ -190,21 +190,23 @@ } /** - * Assign necessary Smarty variables and return a template name to + * Assign necessary Smarty variables and return a template name for the current view to * load in order to display a summary of the item suitable for use in * search results. * + * @param string $view The current view. + * * @return string Name of Smarty template file to display. * @access public */ - public function getSearchResult() + public function getSearchResult($view = 'list') { global $interface; // MARC results work just like index results, except that we want to // enable the AJAX status display since we assume that MARC records // come from the ILS: - $template = parent::getSearchResult(); + $template = parent::getSearchResult($view); $interface->assign('summAjaxStatus', true); return $template; } Index: services/Search/Results.php =================================================================== --- services/Search/Results.php (revision 3669) +++ services/Search/Results.php (working copy) @@ -99,6 +99,7 @@ // Those we can construct BEFORE the search is executed $interface->setPageTitle('Search Results'); $interface->assign('sortList', $searchObject->getSortList()); + $interface->assign('viewList', $searchObject->getViewList()); $interface->assign('rssLink', $searchObject->getRSSUrl()); // Process Search @@ -176,7 +177,10 @@ $interface->assign('recordSet', $searchObject->getResultRecordHTML()); // Setup Display - $interface->assign('subpage', 'Search/list-list.tpl'); + + //Get view & load template + $currentView = $searchObject->getView(); + $interface->assign('subpage', 'Search/list-' . $currentView .'.tpl'); $interface->setTemplate('list.tpl'); // Process Paging Index: sys/SearchObject/Solr.php =================================================================== --- sys/SearchObject/Solr.php (revision 3738) +++ sys/SearchObject/Solr.php (working copy) @@ -115,9 +115,11 @@ if (isset($searchSettings['General']['default_sort'])) { $this->defaultSort = $searchSettings['General']['default_sort']; } - if (isset($searchSettings['DefaultSortingByType']) - && is_array($searchSettings['DefaultSortingByType']) - ) { + if (isset($searchSettings['General']['default_view'])) { + $this->defaultView = $searchSettings['General']['default_view']; + } + if (isset($searchSettings['DefaultSortingByType']) && + is_array($searchSettings['DefaultSortingByType'])) { $this->defaultSortByType = $searchSettings['DefaultSortingByType']; } if (isset($searchSettings['Basic_Searches'])) { @@ -139,6 +141,15 @@ 'callnumber' => 'sort_callnumber', 'author' => 'sort_author', 'title' => 'sort_title'); } + + // Load view preferences (or defaults if none in .ini file): + if (isset($searchSettings['Views'])) { + $this->viewOptions = $searchSettings['Views']; + } elseif (isset($searchSettings['General']['default_view'])) { + $this->viewOptions = array($this->defaultView => $this->defaultView); + } else { + $this->viewOptions = array('list' => 'List'); + } // Load Spelling preferences $this->spellcheck = $configArray['Spelling']['enabled']; @@ -476,12 +487,13 @@ public function getResultRecordHTML() { global $interface; - + + $currentView = $this->getView(); $html = array(); for ($x = 0; $x < count($this->indexResult['response']['docs']); $x++) { $current = & $this->indexResult['response']['docs'][$x]; $record = RecordDriverFactory::initRecordDriver($current); - $html[] = $interface->fetch($record->getSearchResult()); + $html[] = $interface->fetch($record->getSearchResult($currentView)); } return $html; } Index: interface/themes/classic/Search/list-list.tpl =================================================================== --- interface/themes/classic/Search/list-list.tpl (revision 3569) +++ interface/themes/classic/Search/list-list.tpl (working copy) @@ -4,6 +4,7 @@ {* This is raw HTML -- do not escape it: *} {$record} + {if $smarty.foreach.recordLoop.last}
      {/if} {/foreach} Index: interface/themes/default/Search/list-list.tpl =================================================================== --- interface/themes/default/Search/list-list.tpl (revision 3569) +++ interface/themes/default/Search/list-list.tpl (working copy) @@ -4,6 +4,7 @@ {* This is raw HTML -- do not escape it: *} {$record} + {if $smarty.foreach.recordLoop.last}
      {/if} {/foreach} Index: interface/themes/blueprint/Search/list.tpl =================================================================== --- interface/themes/blueprint/Search/list.tpl (revision 3414) +++ interface/themes/blueprint/Search/list.tpl (working copy) @@ -9,7 +9,7 @@ {* Listing Options *}
      -
      +
      {if $recordCount} {translate text="Showing"} {$recordStart} - {$recordEnd} @@ -28,6 +28,14 @@
      +
      + {if $viewList|@count gt 1} + {foreach from=$viewList item=viewData key=viewLabel} + {if !$viewData.selected}{/if} + + {if !$viewData.selected}{/if} + {/foreach} + {/if}
      Index: interface/themes/default/Search/list.tpl =================================================================== --- interface/themes/default/Search/list.tpl (revision 3669) +++ interface/themes/default/Search/list.tpl (working copy) @@ -34,6 +34,13 @@
      + {if $viewList|@count gt 1} + {foreach from=$viewList item=viewData key=viewLabel} + {if !$viewData.selected}{/if} + + {if !$viewData.selected}{/if} + {/foreach} + {/if}