Skip to content
Snippets Groups Projects
Commit df65156b authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Merge branch 'master' of https://github.com/vufind-org/vufind

parents 071b347e 5dd71f21
Branches
Tags
No related merge requests found
<?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
...@@ -39,6 +39,20 @@ use Zend\View\Helper\AbstractHelper; ...@@ -39,6 +39,20 @@ use Zend\View\Helper\AbstractHelper;
*/ */
class Highlight extends 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 * Adds a span tag with class "highlight" around a specific phrase for
* highlighting * highlighting
...@@ -76,7 +90,7 @@ class Highlight extends AbstractHelper ...@@ -76,7 +90,7 @@ class Highlight extends AbstractHelper
// URL encode the string, then put in the highlight spans: // URL encode the string, then put in the highlight spans:
$haystack = str_replace( $haystack = str_replace(
array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'),
array('<span class="highlight">', '</span>'), array($this->startTag, $this->endTag),
htmlspecialchars($haystack) htmlspecialchars($haystack)
); );
......
...@@ -26,6 +26,7 @@ hr {margin:4px 0} ...@@ -26,6 +26,7 @@ hr {margin:4px 0}
input[type="text"] {border-color:#AAA;font-size:12px} 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)} input[type="text"]:focus {border-color:#619144;box-shadow:inset 0px 1px 2px rgba(0,0,0,.14)}
.label {font-size:11px} .label {font-size:11px}
mark {background:0;color:inherit;font-weight:bold}
.modal a {color:#08C} .modal a {color:#08C}
.nav-list li.active > a {border-color:#C6D880;color:#FFF} .nav-list li.active > a {border-color:#C6D880;color:#FFF}
.nav-pills > li > a {border-radius:2px;margin:0} .nav-pills > li > a {border-radius:2px;margin:0}
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
.comment .popover {display:block;margin-top:6px;max-width:none;position:relative} .comment .popover {display:block;margin-top:6px;max-width:none;position:relative}
form.comment .span3 {padding-top:60px} form.comment .span3 {padding-top:60px}
.front { position:absolute;top:0;left:0;width:100%;padding-top:20%;z-index:5 } .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 } /* IE6 */
*+html .centered-pills ul.nav-pills { display:inline } /* IE7 */ *+html .centered-pills ul.nav-pills { display:inline } /* IE7 */
li a.hidden {display:none} li a.hidden {display:none}
......
...@@ -33,6 +33,7 @@ return array( ...@@ -33,6 +33,7 @@ return array(
}, },
), ),
'invokables' => array( 'invokables' => array(
'highlight' => 'VuFind\View\Helper\Bootstrap\Highlight',
'search' => 'VuFind\View\Helper\Bootstrap\Search', 'search' => 'VuFind\View\Helper\Bootstrap\Search',
'vudl' => 'VuDL\View\Helper\Bootstrap\VuDL', 'vudl' => 'VuDL\View\Helper\Bootstrap\VuDL',
) )
......
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