Skip to content
Snippets Groups Projects
Commit c4b0109a authored by Robert Lange's avatar Robert Lange
Browse files

refs #21064 [fid] AjaxHandler: reduce line length to 85

parent 169a1918
No related merge requests found
......@@ -68,8 +68,8 @@ class GetResolverLinks extends \VuFind\AjaxHandler\GetResolverLinks
* @param SessionSettings $ss Session settings
* @param ResolverManager $pm Resolver driver plugin manager
* @param RendererInterface $renderer View renderer
* @param Config $config Top-level VuFind configuration (config.ini)
* @param Config $resolver Top-level VuFind configuration (Resolver.ini)
* @param Config $config Top-level VuFind config (config.ini)
* @param Config $resolver Top-level VuFind config (Resolver.ini)
*/
public function __construct(
SessionSettings $ss,
......@@ -107,7 +107,8 @@ class GetResolverLinks extends \VuFind\AjaxHandler\GetResolverLinks
if (in_array($requestedResolver, $resolvers)
&& isset($this->resolverConfig->$requestedResolver)
) {
$resolverType = $this->resolverConfig->$requestedResolver->resolver ?? 'generic';
$resolverType = $this->resolverConfig
->$requestedResolver->resolver ?? 'generic';
if (!$this->pluginManager->has($resolverType)) {
return $this->formatResponse(
$this->translate("Could not load driver for $resolverType"),
......@@ -163,8 +164,8 @@ class GetResolverLinks extends \VuFind\AjaxHandler\GetResolverLinks
if (isset($this->resolverConfig->$requestedResolver)
&& isset($this->resolverConfig->$requestedResolver->url)
) {
// Trim off any parameters (for legacy compatibility -- default config
// used to include extraneous parameters):
// Trim off any parameters for legacy compatibility
// default config used to include extraneous parameters):
[$base] = explode(
'?',
$this->resolverConfig->$requestedResolver->url
......@@ -178,9 +179,13 @@ class GetResolverLinks extends \VuFind\AjaxHandler\GetResolverLinks
// Render the links using the view:
$view = [
'openUrlBase' => $base, 'openUrl' => $openUrl,
'electronic' => $electronic, 'unknown' => $unknown, 'services' => $services,
'searchClassId' => $searchClassId, 'resolver' => $requestedResolver,
'openUrlBase' => $base,
'openUrl' => $openUrl,
'electronic' => $electronic,
'unknown' => $unknown,
'services' => $services,
'searchClassId' => $searchClassId,
'resolver' => $requestedResolver,
'moreOptionsLink' => $moreOptionsLink
];
$viewPrint = [
......@@ -193,9 +198,18 @@ class GetResolverLinks extends \VuFind\AjaxHandler\GetResolverLinks
];
}
$html = $this->renderer->render("ajax/resolverLinks.phtml", $view);
$print = $this->renderer->render("ajax/resolverLinks-print.phtml", $viewPrint);
$button = $this->renderer->render("ajax/resolverLinks-button.phtml", $viewButton);
$html = $this->renderer->render(
"ajax/resolverLinks.phtml",
$view
);
$print = $this->renderer->render(
"ajax/resolverLinks-print.phtml",
$viewPrint
);
$button = $this->renderer->render(
"ajax/resolverLinks-button.phtml",
$viewButton
);
// output HTML encoded in JSON object
return $this->formatResponse(compact('html', 'print', 'button'));
......
......@@ -30,6 +30,7 @@
namespace fid\AjaxHandler;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;
/**
* Factory for GetResolverLinks AJAX handler.
......@@ -41,7 +42,7 @@ use Interop\Container\ContainerInterface;
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development Wiki
*/
class GetResolverLinksFactory implements \Zend\ServiceManager\Factory\FactoryInterface
class GetResolverLinksFactory implements FactoryInterface
{
/**
* Create an object
......
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