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

Added simple Libraryh3lp widget.

- Resolves VUFIND-1134.
parent ec2dffe4
No related merge requests found
......@@ -351,6 +351,10 @@ CallNumber = callnumber-sort
;
; AlphaBrowseLink:index
; Use the query to generate a link to the specified alphabrowse index
; Libraryh3lp:[type]:[id]:[skin]
; Display a chat box for the Libraryh3lp service. [type] indicats the type
; of chat being used (either "queue" or "user"). [id] is the name of the
; queue or user. [skin] is optional and specifies a skin number to use.
; SwitchQuery:[backend]:[opt-out checks to skip]:[opt-in checks to add]
; This module analyzes the user's query and offers suggestions for ways to
; improve it. [backend] is the name of the search backend currently in use,
......
......@@ -431,6 +431,7 @@ $config = [
'alphabrowselink' => 'VuFind\Recommend\AlphaBrowseLink',
'europeanaresultsdeferred' => 'VuFind\Recommend\EuropeanaResultsDeferred',
'facetcloud' => 'VuFind\Recommend\FacetCloud',
'libraryh3lp' => 'VuFind\Recommend\Libraryh3lp',
'openlibrarysubjects' => 'VuFind\Recommend\OpenLibrarySubjects',
'openlibrarysubjectsdeferred' => 'VuFind\Recommend\OpenLibrarySubjectsDeferred',
'pubdatevisajax' => 'VuFind\Recommend\PubDateVisAjax',
......
<?php
/**
* Libraryh3lp Recommendations Module
*
* PHP version 5
*
* Copyright (C) Villanova University 2010.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @category VuFind2
* @package Recommendations
* @author Demian Katz <demian.katz@villanova.edu>
* @author Chris Hallberg <challber@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org/wiki/vufind2:recommendation_modules Wiki
*/
namespace VuFind\Recommend;
/**
* Libraryh3lp Recommendations Module
*
* This class provides access to the Libraryh3lp chat service.
*
* @category VuFind2
* @package Recommendations
* @author Demian Katz <demian.katz@villanova.edu>
* @author Chris Hallberg <challber@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org/wiki/vufind2:recommendation_modules Wiki
*/
class Libraryh3lp implements RecommendInterface
{
/**
* Chat identifier
*
* @var string
*/
protected $chatId;
/**
* Widget skin number
*
* @var int
*/
protected $skin;
/**
* Store the configuration of the recommendation module.
*
* @param string $settings Settings from searches.ini.
*
* @return void
*/
public function setConfig($settings)
{
$params = explode(':', $settings);
$this->chatId = $params[0] === 'user'
? $params[1] . '@libraryh3lp.com' // user
: $params[1] . '@chat.libraryh3lp.com'; // queue
$this->skin = isset($params[2]) ? $params[2] : 11977;
}
/**
* Called at the end of the Search Params objects' initFromRequest() method.
* This method is responsible for setting search parameters needed by the
* recommendation module and for reading any existing search parameters that may
* be needed.
*
* @param \VuFind\Search\Base\Params $params Search parameter object
* @param \Zend\StdLib\Parameters $request Parameter object representing user
* request.
*
* @return void
*/
public function init($params, $request)
{
}
/**
* Called after the Search Results object has performed its main search. This
* may be used to extract necessary information from the Search Results object
* or to perform completely unrelated processing.
*
* @param \VuFind\Search\Base\Results $results Search results object
*
* @return void
*/
public function process($results)
{
}
/**
* Get queue name
*
* @return string
*/
public function getChatId()
{
return $this->chatId;
}
/**
* Get skin number
*
* @return int
*/
public function getSkin()
{
return $this->skin;
}
}
\ No newline at end of file
<iframe src="https://us.libraryh3lp.com/chat/<?=$this->escapeHtmlAttr($this->recommend->getChatId())?>?skin=<?=urlencode($this->recommend->getSkin())?>" frameborder="1" style="border: 2px inset black; width: 350px; height: 300px;"></iframe>
\ No newline at end of file
<iframe src="https://us.libraryh3lp.com/chat/<?=$this->escapeHtmlAttr($this->recommend->getChatId())?>?skin=<?=urlencode($this->recommend->getSkin())?>" frameborder="1" style="border: 2px inset black; width: 350px; height: 300px;"></iframe>
\ No newline at end of file
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