diff --git a/config/vufind/config.ini b/config/vufind/config.ini index 0ddb9dc1734ee43a8ac38ba4e17d820b6e63d9c1..56f5be402a934d52db63c4fe99b2066314b40fbd 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -517,9 +517,6 @@ noCoverAvailableImage = images/noCover2.gif ; You can select from Syndetics or SyndeticsPlus ;authorNotes = Syndetics:MySyndeticsId,SyndeticsPlus:MySyndeticsId -; You can select from Syndetics or SyndeticsPlus -;videoClips = Syndetics:MySyndeticsId,SyndeticsPlus:MySyndeticsId - ; You can select from Wikipedia ; See also the AuthorInfo recommendation module setting in searches.ini; this ; includes notes on improving the accuracy of Wikipedia retrievals. diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Factory.php b/module/VuFind/src/VuFind/View/Helper/Root/Factory.php index 2c0b922484d4673e34e2212947c3d0bbdec36c43..d12e28bf3618cf440d9e0ff05e7b12995bdba5a8 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Factory.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Factory.php @@ -496,20 +496,6 @@ class Factory return new UserTags($mode); } - /** - * Construct the VideoClips helper. - * - * @param ServiceManager $sm Service manager. - * - * @return VideoClips - */ - public static function getVideoClips(ServiceManager $sm) - { - return new VideoClips( - $sm->getServiceLocator()->get('VuFind\Config')->get('config') - ); - } - /** * Construct the WorldCat helper. * @@ -522,4 +508,4 @@ class Factory $bm = $sm->getServiceLocator()->get('VuFind\Search\BackendManager'); return new WorldCat($bm->get('WorldCat')->getConnector()); } -} \ No newline at end of file +} diff --git a/module/VuFind/src/VuFind/View/Helper/Root/VideoClips.php b/module/VuFind/src/VuFind/View/Helper/Root/VideoClips.php deleted file mode 100644 index 66972ec1840104a36dc6bf9137aa6b07ffdc1216..0000000000000000000000000000000000000000 --- a/module/VuFind/src/VuFind/View/Helper/Root/VideoClips.php +++ /dev/null @@ -1,158 +0,0 @@ -<?php -/** - * Video clip view helper - * - * 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 View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:developer_manual Wiki - */ -namespace VuFind\View\Helper\Root; - -/** - * Video clip view helper - * - * @category VuFind2 - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:developer_manual Wiki - */ -class VideoClips extends AbstractSyndetics -{ - /** - * Do the actual work of loading the clips. - * - * @param string $isbn ISBN of book to find clips for - * - * @return array - */ - public function __invoke($isbn) - { - $providers = isset($this->config->Content->videoClips) - ? $this->config->Content->videoClips : ''; - return $this->getResults($isbn, $providers); - } - - /** - * This method is responsible for connecting to Syndetics and abstracting - * clips. - * - * It first queries the master url for the ISBN entry seeking a clip URL. - * If a clip URL is found, the script will then use HTTP request to - * retrieve the script. The script will then parse the clip according to - * US MARC (I believe). It will provide a link to the URL master HTML page - * for more information. - * Configuration: Sources are processed in order - refer to $sourceList. - * - * @param string $id Client access key - * @param bool $s_plus Are we operating in Syndetics Plus mode? - * - * @throws \Exception - * @return array Returns array with video clip data. - * @author Joel Timothy Norman <joel.t.norman@wmich.edu> - * @author Andrew Nagy <vufind-tech@lists.sourceforge.net> - */ - protected function loadSyndetics($id, $s_plus=false) - { - $sourceList = array( - 'VIDEOCLIP' => array( - 'title' => 'Video Clips', - 'file' => 'VIDEOCLIP.XML', - 'div' => '<div id="syn_video_clip"></div>' - ) - ); - - // Initialize return value: - $vclips = array(); - - // Find out if there are any clips - $url = $this->getSyndeticsUrl($id); - $result = $this->getHttpClient($url)->send(); - if (!$result->isSuccess()) { - return $vclips; - } - - // Test XML Response - if (!($xmldoc = $this->xmlToDOMDocument($result->getBody()))) { - throw new \Exception('Invalid XML'); - } - - $i = 0; - foreach ($sourceList as $source => $sourceInfo) { - $nodes = $xmldoc->getElementsByTagName($source); - if ($nodes->length) { - // Load clips - $url = $this->getSyndeticsUrl($id, $sourceInfo['file']); - $result2 = $this->getHttpClient($url)->send(); - if (!$result2->isSuccess()) { - continue; - } - - // Test XML Response - $xmldoc2 = $this->xmlToDOMDocument($result2->getBody()); - if (!$xmldoc2) { - throw new \Exception('Invalid XML'); - } - - // If we have syndetics plus, we don't actually want the content - // we'll just stick in the relevant div - if ($s_plus) { - $vclips[$i]['Content'] = $sourceInfo['div']; - } else { - // Get the field for video clips (VideoLink) - $nodes = $xmldoc2->GetElementsbyTagName("VideoLink"); - if (!$nodes->length) { - // Skip clips with missing text - continue; - } - // stick the link into an embed tag. - $vclips[$i]['Content'] - = '<embed width="400" height="300" type="' . - 'application/x-shockwave-flash"' . - 'allowfullscreen="true" src="' . - html_entity_decode($nodes->item(0)->nodeValue) . - '">'; - - // Get the marc field for copyright (997) - $nodes = $xmldoc->GetElementsbyTagName("Fld997"); - if ($nodes->length) { - $vclips[$i]['Copyright'] = html_entity_decode( - $xmldoc2->saveXML($nodes->item(0)) - ); - } else { - $vclips[$i]['Copyright'] = null; - } - } - - // change the xml to actual title: - $vclips[$i]['Source'] = $sourceInfo['title']; - - $vclips[$i]['ISBN'] = $this->getIsbn10(); //show more link - $vclips[$i]['username'] = $id; - - $i++; - } - } - - return $vclips; - } -} \ No newline at end of file diff --git a/themes/blueprint/templates/RecordTab/description.phtml b/themes/blueprint/templates/RecordTab/description.phtml index 3944c7f0258fc7388cdae5c93c22b92c5cd9ba85..0f968597e70732f57cd36ee370d99f1134c34bfb 100644 --- a/themes/blueprint/templates/RecordTab/description.phtml +++ b/themes/blueprint/templates/RecordTab/description.phtml @@ -217,21 +217,7 @@ </tr> <? endif; ?> - <? $videoClips = empty($isbn) ? array() : $this->videoClips($isbn); if (!empty($videoClips)): ?> - <? $contentDisplayed = true; ?> - <tr valign="top"> - <th><?=$this->transEsc('Video Clips')?>: </th> - <td> - <? foreach ($videoClips as $provider => $list): ?> - <? foreach ($list as $field): ?> - <?=$field['Content']?><br/> - <? if (isset($field['Copyright'])): ?><?=$field['Copyright']?><br/><? endif; ?> - <? endforeach; ?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> <? if (!isset($contentDisplayed) || !$contentDisplayed): // Avoid errors if there were no rows above ?> <tr><td><?=$this->transEsc('no_description')?></td></tr> <? endif; ?> -</table> \ No newline at end of file +</table> diff --git a/themes/bootstrap/templates/RecordTab/description.phtml b/themes/bootstrap/templates/RecordTab/description.phtml index 447a297a4b06d65131dfeea1e2b4bbe882395838..6f5532be3b6eb60923832451e8b910d03021132f 100644 --- a/themes/bootstrap/templates/RecordTab/description.phtml +++ b/themes/bootstrap/templates/RecordTab/description.phtml @@ -217,20 +217,6 @@ </tr> <? endif; ?> - <? $videoClips = empty($isbn) ? array() : $this->videoClips($isbn); if (!empty($videoClips)): ?> - <? $contentDisplayed = true; ?> - <tr valign="top"> - <th><?=$this->transEsc('Video Clips')?>: </th> - <td> - <? foreach ($videoClips as $provider => $list): ?> - <? foreach ($list as $field): ?> - <?=$field['Content']?><br/> - <? if (isset($field['Copyright'])): ?><?=$field['Copyright']?><br/><? endif; ?> - <? endforeach; ?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> <? if (!isset($contentDisplayed) || !$contentDisplayed): // Avoid errors if there were no rows above ?> <tr><td><?=$this->transEsc('no_description')?></td></tr> <? endif; ?> diff --git a/themes/root/theme.config.php b/themes/root/theme.config.php index 5fc1aecb531d8593aea82ef4bb871d06de86f27c..224f8ae0de0fd551a95d321274da4f4f3182b945 100644 --- a/themes/root/theme.config.php +++ b/themes/root/theme.config.php @@ -35,7 +35,6 @@ return array( 'systememail' => 'VuFind\View\Helper\Root\Factory::getSystemEmail', 'userlist' => 'VuFind\View\Helper\Root\Factory::getUserList', 'usertags' => 'VuFind\View\Helper\Root\Factory::getUserTags', - 'videoclips' => 'VuFind\View\Helper\Root\Factory::getVideoClips', 'worldcat' => 'VuFind\View\Helper\Root\Factory::getWorldCat', ), 'invokables' => array(