forked from vufind-org/vufind
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24a3922
commit 8bcf949
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
module/VuFind/src/VuFind/Recommend/ConsortialVuFindDeferred.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
/** | ||
* ConsortialVuFindDeferred Recommendations Module | ||
* | ||
* PHP version 8 | ||
* | ||
* Copyright (C) Villanova University 2020. | ||
* | ||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
* @category VuFind | ||
* @package Recommendations | ||
* @author Demian Katz <[email protected]> | ||
* @author Maccabee Levine <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development:plugins:recommendation_modules Wiki | ||
*/ | ||
|
||
namespace VuFind\Recommend; | ||
|
||
/** | ||
* ConsortialVuFindDeferred Recommendations Module | ||
* | ||
* This class sets up an AJAX call to trigger a call to the ConsortialVuFind module. | ||
* | ||
* Note: ConsortialVuFind is not actually an AbstractSearchObject subclass. But | ||
* AbstractSearchObjectDeferred does not require that. | ||
* | ||
* @category VuFind | ||
* @package Recommendations | ||
* @author Demian Katz <[email protected]> | ||
* @author Maccabee Levine <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development:plugins:recommendation_modules Wiki | ||
*/ | ||
class ConsortialVuFindDeferred extends AbstractSearchObjectDeferred | ||
{ | ||
|
||
/** | ||
* Number of expected module parameters (from .ini config) | ||
* | ||
* @var int | ||
*/ | ||
protected $paramCount = 3; | ||
|
||
/** | ||
* Store the configuration of the recommendation module. | ||
* | ||
* @return string Module name in call to AjaxHandler | ||
*/ | ||
protected function getAjaxModule() | ||
{ | ||
return 'ConsortialVuFind'; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
themes/bootstrap3/templates/Recommend/ConsortialVuFindDeferred.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
// Set up Javascript for use below: | ||
$loadJs = 'var url = VuFind.path + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' | ||
. "VuFind.loadHtml(\$('#consortialVuFindDeferredRecommend'), url);"; | ||
?> | ||
<div id="consortialVuFindDeferredRecommend"> | ||
<p><?=$this->icon('spinner') ?> <?=$this->transEsc('loading_ellipsis')?></p> | ||
<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $loadJs, 'SET')?> | ||
</div> |