diff --git a/module/VuFind/src/VuFind/View/Helper/Root/DeferredRecommend.php b/module/VuFind/src/VuFind/View/Helper/Root/DeferredRecommend.php deleted file mode 100644 index 7e6b3f621de..00000000000 --- a/module/VuFind/src/VuFind/View/Helper/Root/DeferredRecommend.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @author Maccabee Levine - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ - -namespace VuFind\View\Helper\Root; - -/** - * Deferred recommendation module view helper - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz - * @author Maccabee Levine - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -class DeferredRecommend extends \Laminas\View\Helper\AbstractHelper -{ - /** - * Render code to load a recommendation module via AJAX. - * - * @param string $containerId HTML ID of the parent container for this recommendation - * - * @return string - */ - public function __invoke( - $containerId, - ) { - // Pass $containerId to the template - $context = compact('containerId'); - - // Save any existing context before the render; restore after. - $view = $this->getView(); - $contextHelper = $view->plugin('context'); - $oldContext = $contextHelper($view)->apply($context); - $html = $view->render('Recommend/Deferred.phtml'); - $contextHelper($view)->restore($oldContext); - return $html; - } -} diff --git a/themes/bootstrap3/templates/Recommend/Deferred.phtml b/themes/bootstrap3/templates/Recommend/AbstractSearchObjectDeferred.phtml similarity index 78% rename from themes/bootstrap3/templates/Recommend/Deferred.phtml rename to themes/bootstrap3/templates/Recommend/AbstractSearchObjectDeferred.phtml index e3335f4e39c..47cfe7db5fe 100644 --- a/themes/bootstrap3/templates/Recommend/Deferred.phtml +++ b/themes/bootstrap3/templates/Recommend/AbstractSearchObjectDeferred.phtml @@ -1,5 +1,7 @@ recommend::class); + $containerId = array_pop($classParts) . 'Recommend'; $loadJs = 'var url = VuFind.path + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' . "VuFind.loadHtml(\$('#$containerId'), url);"; ?> diff --git a/themes/bootstrap3/templates/Recommend/EPFResultsDeferred.phtml b/themes/bootstrap3/templates/Recommend/EPFResultsDeferred.phtml deleted file mode 100644 index 14abd61e2bb..00000000000 --- a/themes/bootstrap3/templates/Recommend/EPFResultsDeferred.phtml +++ /dev/null @@ -1 +0,0 @@ -deferredRecommend('epfResultsDeferredRecommend'); diff --git a/themes/bootstrap3/templates/Recommend/EuropeanaResultsDeferred.phtml b/themes/bootstrap3/templates/Recommend/EuropeanaResultsDeferred.phtml deleted file mode 100644 index d9744a2ff20..00000000000 --- a/themes/bootstrap3/templates/Recommend/EuropeanaResultsDeferred.phtml +++ /dev/null @@ -1 +0,0 @@ -deferredRecommend('EuropeanaDeferredRecommend'); diff --git a/themes/bootstrap3/templates/Recommend/LibGuidesAZResultsDeferred.phtml b/themes/bootstrap3/templates/Recommend/LibGuidesAZResultsDeferred.phtml deleted file mode 100644 index b16675797ee..00000000000 --- a/themes/bootstrap3/templates/Recommend/LibGuidesAZResultsDeferred.phtml +++ /dev/null @@ -1 +0,0 @@ -deferredRecommend('libguidesAzResultsDeferredRecommend'); diff --git a/themes/bootstrap3/templates/Recommend/LibGuidesResultsDeferred.phtml b/themes/bootstrap3/templates/Recommend/LibGuidesResultsDeferred.phtml deleted file mode 100644 index 3513e91111a..00000000000 --- a/themes/bootstrap3/templates/Recommend/LibGuidesResultsDeferred.phtml +++ /dev/null @@ -1 +0,0 @@ -deferredRecommend('libguidesResultsDeferredRecommend'); diff --git a/themes/bootstrap3/templates/Recommend/OpenLibrarySubjectsDeferred.phtml b/themes/bootstrap3/templates/Recommend/OpenLibrarySubjectsDeferred.phtml deleted file mode 100644 index 3d2847ffa10..00000000000 --- a/themes/bootstrap3/templates/Recommend/OpenLibrarySubjectsDeferred.phtml +++ /dev/null @@ -1 +0,0 @@ -deferredRecommend('openLibraryDeferredRecommend'); diff --git a/themes/bootstrap3/templates/Recommend/SummonBestBetsDeferred.phtml b/themes/bootstrap3/templates/Recommend/SummonBestBetsDeferred.phtml deleted file mode 100644 index 0374fb28ba4..00000000000 --- a/themes/bootstrap3/templates/Recommend/SummonBestBetsDeferred.phtml +++ /dev/null @@ -1 +0,0 @@ -deferredRecommend('SummonDeferredBestBets'); diff --git a/themes/bootstrap3/templates/Recommend/SummonDatabasesDeferred.phtml b/themes/bootstrap3/templates/Recommend/SummonDatabasesDeferred.phtml deleted file mode 100644 index 6d16d9253b3..00000000000 --- a/themes/bootstrap3/templates/Recommend/SummonDatabasesDeferred.phtml +++ /dev/null @@ -1 +0,0 @@ -deferredRecommend('SummonDeferredDatabases'); diff --git a/themes/bootstrap3/templates/Recommend/SummonResultsDeferred.phtml b/themes/bootstrap3/templates/Recommend/SummonResultsDeferred.phtml deleted file mode 100644 index 350137a1bcc..00000000000 --- a/themes/bootstrap3/templates/Recommend/SummonResultsDeferred.phtml +++ /dev/null @@ -1 +0,0 @@ -deferredRecommend('SummonDeferredRecommend'); diff --git a/themes/root/theme.config.php b/themes/root/theme.config.php index b95f43843a0..ac51dac288d 100644 --- a/themes/root/theme.config.php +++ b/themes/root/theme.config.php @@ -24,7 +24,6 @@ 'VuFind\View\Helper\Root\CspNonce' => 'VuFind\View\Helper\Root\CspNonceFactory', 'VuFind\View\Helper\Root\CurrentPath' => 'Laminas\ServiceManager\Factory\InvokableFactory', 'VuFind\View\Helper\Root\DateTime' => 'VuFind\View\Helper\Root\DateTimeFactory', - 'VuFind\View\Helper\Root\DeferredRecommend' => 'Laminas\ServiceManager\Factory\InvokableFactory', 'VuFind\View\Helper\Root\DisplayLanguageOption' => 'VuFind\View\Helper\Root\DisplayLanguageOptionFactory', 'VuFind\View\Helper\Root\Doi' => 'VuFind\View\Helper\Root\DoiFactory', 'VuFind\View\Helper\Root\Export' => 'VuFind\View\Helper\Root\ExportFactory', @@ -113,7 +112,6 @@ 'cspNonce' => 'VuFind\View\Helper\Root\CspNonce', 'currentPath' => 'VuFind\View\Helper\Root\CurrentPath', 'dateTime' => 'VuFind\View\Helper\Root\DateTime', - 'deferredRecommend' => 'VuFind\View\Helper\Root\DeferredRecommend', 'displayLanguageOption' => 'VuFind\View\Helper\Root\DisplayLanguageOption', 'doi' => 'VuFind\View\Helper\Root\Doi', 'export' => 'VuFind\View\Helper\Root\Export',