diff --git a/module/VuFind/src/VuFind/View/Helper/Bootstrap/Highlight.php b/module/VuFind/src/VuFind/View/Helper/Bootstrap/Highlight.php new file mode 100644 index 0000000000000000000000000000000000000000..453b54690ff0abaa67c2e0aed3d63fdd52842f0d --- /dev/null +++ b/module/VuFind/src/VuFind/View/Helper/Bootstrap/Highlight.php @@ -0,0 +1,49 @@ +<?php +/** + * Highlight 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\Bootstrap; + +/** + * Highlight 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 Highlight extends \VuFind\View\Helper\Root\Highlight +{ + /** + * Constructor + */ + public function __construct() + { + $this->startTag = '<mark>'; + $this->endTag = '</mark>'; + } +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Highlight.php b/module/VuFind/src/VuFind/View/Helper/Root/Highlight.php index e77f88d233f20dea910f93b15d158610e34b85b6..c98f06adbebb2f96d3c0a78a6fc44e28d0a67d4f 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Highlight.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Highlight.php @@ -39,6 +39,20 @@ use Zend\View\Helper\AbstractHelper; */ class Highlight extends AbstractHelper { + /** + * Start tag for highlighitng + * + * @var string + */ + protected $startTag = '<span class="highlight">'; + + /** + * End tag for highlighitng + * + * @var string + */ + protected $endTag = '</span>'; + /** * Adds a span tag with class "highlight" around a specific phrase for * highlighting @@ -76,7 +90,7 @@ class Highlight extends AbstractHelper // URL encode the string, then put in the highlight spans: $haystack = str_replace( array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), - array('<span class="highlight">', '</span>'), + array($this->startTag, $this->endTag), htmlspecialchars($haystack) ); diff --git a/themes/bootprint/css/style.css b/themes/bootprint/css/style.css index 8c20701fd6a1c5365bfd603da4745e20020099c9..53ef5530171120522d1c01fec5333611c87cd227 100644 --- a/themes/bootprint/css/style.css +++ b/themes/bootprint/css/style.css @@ -26,6 +26,7 @@ hr {margin:4px 0} input[type="text"] {border-color:#AAA;font-size:12px} input[type="text"]:focus {border-color:#619144;box-shadow:inset 0px 1px 2px rgba(0,0,0,.14)} .label {font-size:11px} +mark {background:0;color:inherit;font-weight:bold} .modal a {color:#08C} .nav-list li.active > a {border-color:#C6D880;color:#FFF} .nav-pills > li > a {border-radius:2px;margin:0} diff --git a/themes/bootstrap/css/screen.css b/themes/bootstrap/css/screen.css index d5014a27c6cf116024b28a3989436d70b6fc4c27..fb815c89befccace80f7d2cf687603a0a299eeb7 100644 --- a/themes/bootstrap/css/screen.css +++ b/themes/bootstrap/css/screen.css @@ -8,7 +8,6 @@ .comment .popover {display:block;margin-top:6px;max-width:none;position:relative} form.comment .span3 {padding-top:60px} .front { position:absolute;top:0;left:0;width:100%;padding-top:20%;z-index:5 } -.highlight { font-weight:bold } * html .centered-pills ul.nav-pills { display:inline } /* IE6 */ *+html .centered-pills ul.nav-pills { display:inline } /* IE7 */ li a.hidden {display:none} diff --git a/themes/bootstrap/theme.config.php b/themes/bootstrap/theme.config.php index e86a29543e4b44841e7d87b36fc98ae2767f8bb0..178671510f1e209a05f8d6d8e29fccc82b18e93e 100644 --- a/themes/bootstrap/theme.config.php +++ b/themes/bootstrap/theme.config.php @@ -33,6 +33,7 @@ return array( }, ), 'invokables' => array( + 'highlight' => 'VuFind\View\Helper\Bootstrap\Highlight', 'search' => 'VuFind\View\Helper\Bootstrap\Search', 'vudl' => 'VuDL\View\Helper\Bootstrap\VuDL', )