diff --git a/config/vufind/EDS.ini b/config/vufind/EDS.ini index 56404656056371cb0a1839a7a03798f441db0be8..8a8b35f5edca03cb61a7f8408087842326d6a56a 100644 --- a/config/vufind/EDS.ini +++ b/config/vufind/EDS.ini @@ -1,3 +1,8 @@ +; IMPORTANT NOTE: By default, VuFind will block access to certain EDS content +; unless it knows which users are authorized (by IP, etc.). Please configure the +; access.EDSExtendedResults permission in permissions.ini to allow users to +; see this content. You are responsible for complying with your license. + ; This section contains global settings affecting search behavior. [General] ; This setting controls the default sort order of search results; the selected @@ -184,8 +189,9 @@ next_prev_navigation = false ; If using IP Authentication, then the user_id and password should remain blank ; and ip_auth should be set to true. [EBSCO_Account] +; IP authentication for the API ip_auth = false user_name = [USERNAME] password = [PASSWORD] profile = [PROFILE] -organization_id = \ No newline at end of file +organization_id = "VuFind 2.x from MyUniversity" diff --git a/config/vufind/permissions.ini b/config/vufind/permissions.ini index d0950159d3e84c21fcf5186eac9bfc7a4f2cfa86..44ed60c13aeb872803ebef19d6c09bd59d19e9d0 100644 --- a/config/vufind/permissions.ini +++ b/config/vufind/permissions.ini @@ -62,6 +62,7 @@ ; ; access.AdminModule - Controls access to the admin panel (if enabled in config.ini) ; access.DebugMode - Allows ?debug=true GET parameter to turn on debug mode +; access.EDSExtendedResults - Controls visibility of protected EDS results ; access.EITModule - Controls access to the EBSCO EIT module (if active) ; access.StaffViewTab - Controls access to the staff view tab in record mode ; access.SummonExtendedResults - Controls visibility of protected Summon results @@ -82,6 +83,12 @@ permission = access.StaffViewTab ;username[] = admin ;permission = access.DebugMode +; Example for EDS +;[default.EDSModule] +;ipRange[] = "127.0.0.1" +;ipRange[] = "192.168.11" +;permission = access.EDSExtendedResults + ; Examples for Shibboleth ; ; Only users that have either common-lib-terms and entityid from idp1 or diff --git a/languages/fi.ini b/languages/fi.ini index 6ad551bfc9906ea5a17947c908eb3534c4000065..9fa89b309d043cb90db93090bca50ce65711437b 100644 --- a/languages/fi.ini +++ b/languages/fi.ini @@ -772,13 +772,13 @@ renew_all = "Uusi kaikki lainat" renew_determine_fail = "Ei tietoa uusintaoikeudesta. Ota yhteyttä kirjaston asiakaspalveluun." renew_empty_selection = "Yhtään lainaa ei valittu" renew_error = "Lainojasi ei voitu uusia. Ota yhteyttä kirjaston asiakaspalveluun." -renew_fail = "Lainaa ei voitu uusia." +renew_fail = "Lainaa ei voitu uusia" renew_item = "Uusi laina" -renew_item_due = "Laina-aikaa jäljellä alle vuorokausi." -renew_item_limit = "Tämän lainan uusimiskerrat ovat tulleet täyteen." -renew_item_no = "Tätä lainaa ei voida uusia." -renew_item_overdue = "Laina on myöhässä." -renew_item_requested = "Toinen asiakas on varannut tämän kohteen." +renew_item_due = "Laina-aikaa jäljellä alle vuorokausi" +renew_item_limit = "Tämän lainan uusimiskerrat ovat tulleet täyteen" +renew_item_no = "Tätä lainaa ei voida uusia" +renew_item_overdue = "Laina on myöhässä" +renew_item_requested = "Varattu toiselle asiakkaalle" renew_select_box = "Uusi laina" renew_selected = "Uusi valitut lainat" renew_success = "Uusiminen onnistui" diff --git a/module/VuFind/src/VuFind/Controller/EdsrecordController.php b/module/VuFind/src/VuFind/Controller/EdsrecordController.php index ec35238dc3902d9f73068d325a0a784dd65fbeb0..3095a5d06ea5a6b719d373ffaa55cc8113bd9c14 100644 --- a/module/VuFind/src/VuFind/Controller/EdsrecordController.php +++ b/module/VuFind/src/VuFind/Controller/EdsrecordController.php @@ -26,6 +26,7 @@ * @link http://vufind.org Main Site */ namespace VuFind\Controller; +use VuFind\Exception\Forbidden as ForbiddenException; /** * EDS Record Controller @@ -60,11 +61,14 @@ class EdsrecordController extends AbstractRecord { $driver = $this->loadRecord(); //if the user is a guest, redirect them to the login screen. - if (!$this->isAuthenticationIP() && false == $this->getUser()) { - return $this->forceLogin(); - } else { - return $this->redirect()->toUrl($driver->getPdfLink()); + $auth = $this->getAuthorizationService(); + if (!$auth->isGranted('access.EDSExtendedResults')) { + if (!$this->getUser()) { + return $this->forceLogin(); + } + throw new ForbiddenException('Access denied.'); } + return $this->redirect()->toUrl($driver->getPdfLink()); } /** @@ -78,16 +82,4 @@ class EdsrecordController extends AbstractRecord return (isset($config->Record->next_prev_navigation) && $config->Record->next_prev_navigation); } - - /** - * Is IP Authentication being used? - * - * @return bool - */ - protected function isAuthenticationIP() - { - $config = $this->getServiceLocator()->get('VuFind\Config')->get('EDS'); - return (isset($config->EBSCO_Account->ip_auth) - && 'true' == $config->EBSCO_Account->ip_auth); - } } \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Search/Factory/EdsBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/EdsBackendFactory.php index 955cd455494ecf3af0446f677b734a201e97ab6d..995e493ab620b9316dcf23ea17b31bd26d50714e 100644 --- a/module/VuFind/src/VuFind/Search/Factory/EdsBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/EdsBackendFactory.php @@ -103,10 +103,12 @@ class EdsBackendFactory implements FactoryInterface */ protected function createBackend(Connector $connector) { + $auth = $this->serviceLocator->get('ZfcRbac\Service\AuthorizationService'); + $isGuest = !$auth->isGranted('access.EDSExtendedResults'); $backend = new Backend( $connector, $this->createRecordCollectionFactory(), $this->serviceLocator->get('VuFind\CacheManager')->getCache('object'), - new \Zend\Session\Container('EBSCO'), $this->edsConfig + new \Zend\Session\Container('EBSCO'), $this->edsConfig, $isGuest ); $backend->setAuthManager($this->serviceLocator->get('VuFind\AuthManager')); $backend->setLogger($this->logger); diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/EDS/Backend.php b/module/VuFindSearch/src/VuFindSearch/Backend/EDS/Backend.php index 845a9e43133a1a4cb53835a76065d4560a2be448..85711249409e3e9897bde463f7fc94150986bf56 100644 --- a/module/VuFindSearch/src/VuFindSearch/Backend/EDS/Backend.php +++ b/module/VuFindSearch/src/VuFindSearch/Backend/EDS/Backend.php @@ -27,6 +27,8 @@ */ namespace VuFindSearch\Backend\EDS; +use Exception; + use VuFindSearch\Backend\EDS\Zend2 as ApiClient; use VuFindSearch\Query\AbstractQuery; @@ -132,6 +134,13 @@ class Backend extends AbstractBackend */ protected $session; + /** + * Is the current user a guest? + * + * @var bool + */ + protected $isGuest; + /** * Constructor. * @@ -140,16 +149,18 @@ class Backend extends AbstractBackend * @param CacheAdapter $cache Object cache * @param SessionContainer $session Session container * @param Config $config Object representing EDS.ini + * @param bool $isGuest Is the current user a guest? */ public function __construct(ApiClient $client, RecordCollectionFactoryInterface $factory, CacheAdapter $cache, - SessionContainer $session, Config $config = null + SessionContainer $session, Config $config = null, $isGuest = true ) { - // Save dependencies: + // Save dependencies/incoming parameters: $this->client = $client; $this->setRecordCollectionFactory($factory); $this->cache = $cache; $this->session = $session; + $this->isGuest = $isGuest; // Extract key values from configuration: if (isset($config->EBSCO_Account->user_name)) { @@ -297,7 +308,7 @@ class Backend extends AbstractBackend $sessionToken = $this->getSessionToken(true); } $response = $this->client->retrieve( - $an, $dbId, $authenticationToken, $sessionToken, $hlTerms + $an, $dbId, $authenticationToken, $sessionToken, $hlTerms ); } catch(Exception $e) { throw new BackendException($e->getMessage(), $e->getCode(), $e); @@ -498,23 +509,13 @@ class Backend extends AbstractBackend } /** - * Determines whether or not the current user session is identifed as a guest - * session + * Is the current user a guest? If so, return 'y' else 'n'. * - * @return string 'y'|'n' + * @return string */ protected function isGuest() { - // If the user is not logged in, then treat them as a guest. Unless they are - // using IP Authentication. - // If IP Authentication is used, then don't treat them as a guest. - if ($this->ipAuth) { - return 'n'; - } - if (isset($this->authManager)) { - return $this->authManager->isLoggedIn() ? 'n' : 'y'; - } - return 'y'; + return $this->isGuest ? 'y' : 'n'; } /** @@ -531,7 +532,7 @@ class Backend extends AbstractBackend { try { $authToken = $this->getAuthenticationToken(); - $results = $this->client->createSession($profile, $isGuest, $authToken); + $results = $this->client->createSession($profile, $isGuest, $authToken); } catch(\EbscoEdsApiException $e) { $errorCode = $e->getApiErrorCode(); $desc = $e->getApiErrorDescription(); @@ -543,7 +544,7 @@ class Backend extends AbstractBackend try { $authToken = $this->getAuthenticationToken(true); $results = $this->client - ->createSession($this->profile, $isGuest, $authToken); + ->createSession($this->profile, $isGuest, $authToken); } catch(Exception $e) { throw new BackendException( $e->getMessage(), diff --git a/themes/bootstrap3/templates/RecordDriver/EDS/core.phtml b/themes/bootstrap3/templates/RecordDriver/EDS/core.phtml index 7c55930030919d1ef47a2d2c0a42ecc4a9aa2757..a5dfb0931484b7c6ac58f2e81047e5fd556f50f3 100644 --- a/themes/bootstrap3/templates/RecordDriver/EDS/core.phtml +++ b/themes/bootstrap3/templates/RecordDriver/EDS/core.phtml @@ -45,23 +45,6 @@ </a> </span><br /> <? endif; ?> - <? if (!empty($customLinks)): ?> - <span> - <div class="custom-links"> - <? foreach ($customLinks as $customLink): ?> - <? $url = isset($customLink['Url']) ? $customLink['Url'] : ''; - $mot = isset($customLink['MouseOverText'])? $customLink['MouseOverText'] : ''; - $icon = isset ($customLink['Icon']) ? $customLink['Icon'] : ''; - $name = isset($customLink['Name']) ? $customLink['Name'] : '';?> - <span> - <a href="<?=$this->escapeHtmlAttr($url)?>" target="_blank" title="<?=$mot?>" class="custom-link"> - <? if ($icon): ?><img src="<?=$icon?>" /> <? endif; ?><?=$name?> - </a> - </span><br /> - <? endforeach; ?> - </div> - </span> - <? endif; ?> </div> </div> <div class="col-sm-9"> @@ -104,5 +87,24 @@ </tr> <? endif; ?> </table> + + <div class="resultItemLine4 custom-links"> + + <? $customLinks = array_merge($this->driver->getFTCustomLinks(), $this->driver->getCustomLinks()); + if (!empty($customLinks)): ?> + <? foreach ($customLinks as $customLink): ?> + <? $url = isset($customLink['Url']) ? $customLink['Url'] : ''; + $mot = isset($customLink['MouseOverText'])? $customLink['MouseOverText'] : ''; + $icon = isset ($customLink['Icon']) ? $customLink['Icon'] : ''; + $name = isset($customLink['Text']) ? $customLink['Text'] : ''; + ?> + <span> + <a href="<?=$this->escapeHtmlAttr($url)?>" target="_blank" title="<?=$this->escapeHtmlAttr($mot)?>" class="custom-link"> + <? if ($icon): ?><img src="<?=$this->escapeHtmlAttr($icon)?>" /> <? endif; ?><?=$this->escapeHtml($name)?> + </a> + </span> + <? endforeach; ?> + <? endif; ?> + </div> </div> </div> diff --git a/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml b/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml index b805985f5adff28c1ed292d368bb7caab0a39cd6..8fe0ce63967346ca4752464fbcb5485e16bb7ce4 100644 --- a/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml +++ b/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml @@ -3,117 +3,118 @@ $accessLevel = $this->driver->getAccessLevel(); $restrictedView = empty($accessLevel) ? false : true; ?> -<div class="source<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?> recordId<?=$this->driver->supportsAjaxStatus()?' ajaxItemId':''?> col-xs-11"> - <div class="row"> - <div class="col-sm-2 col-xs-3 left"> - <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueID())?>" class="hiddenId" /> - <? if ($summThumb = $this->record($this->driver)->getThumbnail()): ?> - <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="_record_link"> - <img src="<?=$this->escapeHtmlAttr($summThumb)?>" class="recordcover" alt="<?=$this->transEsc('Cover Image')?>"/> - </a> - <? else: ?> - <span class="recordcover pt-icon pt-<?=$this->driver->getPubTypeId()?>"></span> - <div><?=$this->transEsc($this->driver->getPubType())?></div> - <? endif; ?> - </div> - <div class="col-sm-7 col-xs-6 middle"> - <? $items = $this->driver->getItems(); - if (isset($items) && !empty($items)) : - foreach ($items as $item): - if (!empty($item)): ?> - <div class="resultItemLine1"> - <?if('Ti' == $item['Group']): ?> - <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title _record_link" > - <?=$item['Data']?> </a> - <?else:?> +<div class="row col-xs-11 source<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?> recordId<?=$this->driver->supportsAjaxStatus()?' ajaxItemId':''?>"> + <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueID())?>" class="hiddenId" /> + <div class="col-sm-2 left"> + <? if ($summThumb = $this->record($this->driver)->getThumbnail()): ?> + <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="_record_link"> + <img src="<?=$this->escapeHtmlAttr($summThumb)?>" class="recordcover" alt="<?=$this->transEsc('Cover Image')?>"/> + </a> + <? else: ?> + <span class="recordcover pt-icon pt-<?=$this->driver->getPubTypeId()?>"></span> + <div><?=$this->driver->getPubType()?></div> + <? endif; ?> + </div> + <div class="col-sm-7 middle"> + <? $items = $this->driver->getItems(); + if (isset($items) && !empty($items)) : + foreach ($items as $item): + if (!empty($item)): ?> + <div class="resultItemLine1"> + <?if('Ti' == $item['Group']): ?> + <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title _record_link" > + <?=$item['Data']?> </a> + <?else:?> <p> <b><?=$this->transEsc($item['Label'])?>:</b> <?=$item['Data']?> </p> - <?endif;?> - </div> - <? endif; - endforeach; - elseif ($restrictedView): ?> - <div class="resultItemLine1"> - <p> - <?=$this->transEsc('This result is not displayed to guests')?> - <br /> - <a class="login" href="<?=$this->url('myresearch-home')?>"> - <strong><?=$this->transEsc('Login for full access')?></strong> - </a> - </p> - </div> - <? endif; ?> - <? $customLinks = $this->driver->getCustomLinks(); - if (!empty($customLinks)): ?> - <div class="resultItemLine4 custom-links"> - <? foreach ($customLinks as $customLink): ?> - <? $url = isset($customLink['Url']) ? $customLink['Url'] : ''; - $mot = isset($customLink['MouseOverText'])? $customLink['MouseOverText'] : ''; - $icon = isset ($customLink['Icon']) ? $customLink['Icon'] : ''; - $name = isset($customLink['Name']) ? $customLink['Name'] : '';?> - <span> - <a href="<?=$this->escapeHtmlAttr($url)?>" target="_blank" title="<?=$mot?>" class="custom-link"> - <? if ($icon): ?><img src="<?=$icon?>" /> <? endif; ?><?=$name?> - </a> - </span> - <? endforeach; ?> - </div> - <? endif; ?> - - <? if ($this->driver->hasHTMLFullTextAvailable()): ?> - <a href="<?= $this->recordLink()->getUrl($this->driver, 'fulltext') ?>#html" class="icon html fulltext _record_link"> - <?=$this->transEsc('HTML Full Text')?> - </a> - + <?endif;?> + </div> + <? endif; + endforeach; + elseif ($restrictedView): ?> + <div class="resultItemLine1"> + <p> + <?=$this->transEsc('This result is not displayed to guests')?> + <br /> + <a class="login" href="<?=$this->url('myresearch-home')?>"> + <strong><?=$this->transEsc('Login for full access')?></strong> + </a> + </p> + </div> <? endif; ?> - <? if ($this->driver->hasPdfAvailable()): ?> - <a href="<?= $this->recordLink()->getUrl($this->driver).'/PDF'; ?>" class="icon pdf fulltext"> - <?=$this->transEsc('PDF Full Text')?> + <div class="resultItemLine4 custom-links"> + <? $customLinks = array_merge($this->driver->getFTCustomLinks(), $this->driver->getCustomLinks()); + if (!empty($customLinks)): ?> + <? foreach ($customLinks as $customLink): ?> + <? $url = isset($customLink['Url']) ? $customLink['Url'] : ''; + $mot = isset($customLink['MouseOverText'])? $customLink['MouseOverText'] : ''; + $icon = isset ($customLink['Icon']) ? $customLink['Icon'] : ''; + $name = isset($customLink['Text']) ? $customLink['Text'] : ''; + ?> + <span> + <a href="<?=$this->escapeHtmlAttr($url)?>" target="_blank" title="<?=$this->escapeHtmlAttr($mot)?>" class="custom-link"> + <? if ($icon): ?><img src="<?=$this->escapeHtmlAttr($icon)?>" /> <? endif; ?><?=$this->escapeHtml($name)?> </a> - <? endif; ?> + </span> + <? endforeach; ?> + <? endif; ?> </div> - <div class="col-sm-3 right hidden-print"> - <? /* Display qrcode if appropriate: */ ?> - <? if ($QRCode = $this->record($this->driver)->getQRCode("results")): ?> - <? - // Add JS Variables for QrCode - $this->jsTranslations()->addStrings(array('qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show')); - ?> - <span class="hidden-xs"> - <i class="fa fa-fw fa-qrcode"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a> - <div class="qrcode hidden"> - <script type="text/template" class="qrCodeImgTag"> - <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> - </script> - </div><br/> - </span> - <? endif; ?> - <? if ($this->userlist()->getMode() !== 'disabled'): ?> - <? /* Add to favorites */ ?> - <i class="fa fa-fw fa-star"></i> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record modal-link" id="<?=$this->driver->getUniqueId() ?>" title="<?=$this->transEsc('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a><br/> + <? if ($this->driver->hasHTMLFullTextAvailable()): ?> + <a href="<?= $this->recordLink()->getUrl($this->driver, 'fulltext') ?>#html" class="icon html fulltext _record_link" target="_blank"> + <?=$this->transEsc('HTML Full Text')?> + </a> + + <? endif; ?> - <? /* Saved lists */ ?> - <div class="savedLists alert alert-info hidden"> - <strong><?=$this->transEsc("Saved in")?>:</strong> - </div> - <? endif; ?> + <? if ($this->driver->hasPdfAvailable()): ?> + <a href="<?= $this->recordLink()->getUrl($this->driver).'/PDF'; ?>" class="icon pdf fulltext" target="_blank"> + <?=$this->transEsc('PDF Full Text')?> + </a> + <? endif; ?> + </div> - <? /* Hierarchy tree link */ ?> - <? $trees = $this->driver->tryMethod('getHierarchyTrees'); if (!empty($trees)): ?> - <? foreach ($trees as $hierarchyID => $hierarchyTitle): ?> - <div class="hierarchyTreeLink"> - <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId" /> - <i class="fa fa-fw fa-sitemap"></i> - <a class="hierarchyTreeLinkText modal-link" href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>"> - <?=$this->transEsc('hierarchy_view_context')?><? if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><? endif; ?> - </a> - </div> - <? endforeach; ?> - <? endif; ?> - </div> + <div class="col-sm-2 right hidden-print"> + <? /* Display qrcode if appropriate: */ ?> + <? if ($QRCode = $this->record($this->driver)->getQRCode("results")): ?> + <? + // Add JS Variables for QrCode + $this->jsTranslations()->addStrings(array('qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show')); + ?> + <span class="hidden-xs"> + <i class="fa fa-fw fa-qrcode"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a> + <div class="qrcode hidden"> + <script type="text/template" class="qrCodeImgTag"> + <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + </script> + </div><br/> + </span> + <? endif; ?> + + <? if ($this->userlist()->getMode() !== 'disabled'): ?> + <? /* Add to favorites */ ?> + <i class="fa fa-fw fa-star"></i> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record modal-link" id="<?=$this->driver->getUniqueId() ?>" title="<?=$this->transEsc('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a><br/> + + <? /* Saved lists */ ?> + <div class="savedLists alert alert-info hidden"> + <strong><?=$this->transEsc("Saved in")?>:</strong> + </div> + <? endif; ?> + + <? /* Hierarchy tree link */ ?> + <? $trees = $this->driver->tryMethod('getHierarchyTrees'); if (!empty($trees)): ?> + <? foreach ($trees as $hierarchyID => $hierarchyTitle): ?> + <div class="hierarchyTreeLink"> + <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId" /> + <i class="fa fa-fw fa-sitemap"></i> + <a class="hierarchyTreeLinkText modal-link" href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>"> + <?=$this->transEsc('hierarchy_view_context')?><? if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><? endif; ?> + </a> + </div> + <? endforeach; ?> + <? endif; ?> </div> </div> \ No newline at end of file diff --git a/themes/jquerymobile/templates/RecordDriver/EDS/core.phtml b/themes/jquerymobile/templates/RecordDriver/EDS/core.phtml index f24c92407aa07629adc532782e7ccfdf239d178e..9ca1ac3f0520e67c3374f36a4b32153487d647b7 100644 --- a/themes/jquerymobile/templates/RecordDriver/EDS/core.phtml +++ b/themes/jquerymobile/templates/RecordDriver/EDS/core.phtml @@ -33,18 +33,21 @@ <?=$this->transEsc('HTML Full Text')?> </a> <? endif; ?> - <? if (!empty($customLinks)): ?> - <div class="custom-links"> - <? foreach ($customLinks as $customLink): ?> - <? $url = isset($customLink['Url']) ? $customLink['Url'] : ''; - $mot = isset($customLink['MouseOverText'])? $customLink['MouseOverText'] : ''; - $icon = isset ($customLink['Icon']) ? $customLink['Icon'] : ''; - $name = isset($customLink['Name']) ? $customLink['Name'] : '';?> - <a href="<?=$this->escapeHtmlAttr($url)?>" target="_blank" title="<?=$mot?>" class="custom-link"> - <? if ($icon): ?><img src="<?=$icon?>" /> <? endif; ?><?=$name?> - </a><br/> - <? endforeach; ?> - </div> + + <? $customLinks = array_merge($this->driver->getFTCustomLinks(), $this->driver->getCustomLinks()); + if (!empty($customLinks)): ?> + <? foreach ($customLinks as $customLink): ?> + <? $url = isset($customLink['Url']) ? $customLink['Url'] : ''; + $mot = isset($customLink['MouseOverText'])? $customLink['MouseOverText'] : ''; + $icon = isset ($customLink['Icon']) ? $customLink['Icon'] : ''; + $name = isset($customLink['Text']) ? $customLink['Text'] : ''; + ?> + <br /><span> + <a href="<?=$this->escapeHtmlAttr($url)?>" target="_blank" title="<?=$this->escapeHtmlAttr($mot)?>" class="custom-link"> + <? if ($icon): ?><img src="<?=$this->escapeHtmlAttr($icon)?>" /> <? endif; ?><?=$this->escapeHtml($name)?> + </a> + </span> + <? endforeach; ?> <? endif; ?> </div> <? if ($largeThumb): ?></a><? endif; ?> diff --git a/themes/jquerymobile/templates/RecordDriver/EDS/result-list.phtml b/themes/jquerymobile/templates/RecordDriver/EDS/result-list.phtml index 394baed8891f6e32aa4bde32e0db7ea713166591..18b702ea55b7a504d02ad2c9936be9916e34cec6 100644 --- a/themes/jquerymobile/templates/RecordDriver/EDS/result-list.phtml +++ b/themes/jquerymobile/templates/RecordDriver/EDS/result-list.phtml @@ -7,13 +7,20 @@ <div class="result source<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?> recordId<?=$this->driver->supportsAjaxStatus()?' ajaxItemId':''?>"> <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueID())?>" class="hiddenId" /> <? $items = $this->driver->getItems(); + + $titlePrinted=false; + if ($this->driver->getTitle()!="") { + echo '<h3 class="ui-li-heading">'.$this->escapeHtml($this->driver->getTitle()).'</h3>'; + $titlePrinted=true; + } + if (isset($items) && !empty($items)) : foreach ($items as $item): if (!empty($item)): ?> - <? if('Ti' == $item['Group']): ?> - <h3 class="ui-li-heading"><?=$item['Data']?></h3> - <? else: ?> - <p class="ui-li-desc"><strong><?=$this->transEsc($item['Label'])?></strong>: <?=$item['Data']?></p> + <? if( ('Ti' == $item['Group']) && ($titlePrinted==false) ): ?> + <h3 class="ui-li-heading"><?=strip_tags($item['Data'])?></h3> + <? elseif ('Ti' != $item['Group']): ?> + <p class="ui-li-desc"><strong><?=$this->transEsc($item['Label'])?></strong>: <?=strip_tags($item['Data'])?></p> <? endif; ?> <? endif; endforeach; @@ -22,26 +29,5 @@ <strong><?=$this->transEsc('Login for full access')?></strong> </a><br/> <? endif; ?> - <div style="padding-left:1em"> - <? $customLinks = $this->driver->getCustomLinks(); - if (!empty($customLinks)): ?> - <? foreach ($customLinks as $customLink): ?> - <? $url = isset($customLink['Url']) ? $customLink['Url'] : ''; - $mot = isset($customLink['MouseOverText']) ? $customLink['MouseOverText'] : ''; - $icon = isset($customLink['Icon']) ? $customLink['Icon'] : ''; - $name = isset($customLink['Name']) ? $customLink['Name'] : '';?> - <p class="ui-li-desc"><? if ($icon): ?><img src="<?=$icon?>" /> <? endif; ?><?=$name?></p> - <? endforeach; ?> - <? endif; ?> - - <? if ($this->driver->hasHTMLFullTextAvailable()): ?> - <p class="ui-li-desc"><?=$this->transEsc('HTML Full Text')?></p> - - <? endif; ?> - - <? if ($this->driver->hasPdfAvailable()): ?> - <p class="ui-li-desc"><?=$this->transEsc('PDF Full Text')?></p> - <? endif; ?> - </div> </div> </a> \ No newline at end of file