Skip to content
Snippets Groups Projects
Commit d68e9ec2 authored by Tarje Lavik's avatar Tarje Lavik
Browse files

Add possibility for embedding video in body text.

parent b92ce5ca
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<h1><span itemprop="name">{% for row in models.main %}{% if row.title && row.title.value != "" %}{{row.title.value}}{% else %}{% if row.label && row.label.value != "" %}{{row.label.value}}{% else %} {{row.identifier.value}}{%endif%}{%endif%}{% endfor %}</span> <span class="badge">{{ first.count.total.value }}</span></h1> <h1><span itemprop="name">{% for row in models.main %}{% if row.title && row.title.value != "" %}{{row.title.value}}{% else %}{% if row.label && row.label.value != "" %}{{row.label.value}}{% else %} {{row.identifier.value}}{%endif%}{%endif%}{% endfor %}</span> <span class="badge">{{ first.count.total.value }}</span></h1>
<div class="row"> <div class="row">
<div class="col-sm-8 col-md-8"> <div class="col-sm-7 col-md-7">
{% for row in models.main %} {% for row in models.main %}
{% if row.alternative %} {% if row.alternative %}
<h2 itemprop="alternativeHeadline"><small>{{first.main.alternative.value}}</small></h2> <h2 itemprop="alternativeHeadline"><small>{{first.main.alternative.value}}</small></h2>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div class="decode-description" itemprop="description">{% autoescape off %}{{ first.description.descriptions.value|decodedescription }}{% endautoescape %}</div> <div class="decode-description" itemprop="description">{% autoescape off %}{{ first.description.descriptions.value|decodedescription }}{% endautoescape %}</div>
</div> </div>
<div class="col-sm-3 col-md-3"> <div class="col-sm-5 col-md-5">
{% if first.main.logo != null %} {% if first.main.logo != null %}
<div class="col-md-12"> <div class="col-md-12">
<img itemprop="primaryImageOfPage" class="collection-logo img-circle img-border img-responsive" src="{{first.main.logo.value}}"> <img itemprop="primaryImageOfPage" class="collection-logo img-circle img-border img-responsive" src="{{first.main.logo.value}}">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="{% if row.logo %}col-md-9 col-sm-9 col-lg-9{% else %}col-sm-10 col-md-10{% endif %}"> <div class="{% if row.logo %}col-md-9 col-sm-9 col-lg-9{% else %}col-sm-10 col-md-10{% endif %}">
<h3><a href="{{ row.uri.value }}">{{ row.label.value }}</a></h3> <h3><a href="{{ row.uri.value }}">{{ row.label.value }}</a></h3>
{% if row.alternative %}<h4>{{ row.alternative.value }}</h4>{% endif %} {% if row.alternative %}<h4>{{ row.alternative.value }}</h4>{% endif %}
<div class="decode-description">{% autoescape off %}{{ row.description.value|decodedescription }}{% endautoescape %}</div> <div class="decode-description">{% autoescape off %}{{ row.description.value|decodedescription|truncatewords:28}}{% endautoescape %}</div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
......
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
class Haanga_Extension_Filter_Decodedescription class Haanga_Extension_Filter_Decodedescription
{ {
static function main($text) { static function main($text) {
$allowed_tags ="<u><b><i><strong><br><p><ul><ol><li>"; $allowed_tags ="<u><b><i><strong><br><p><ul><ol><li><iframe><a>";
$allowed_tags_regex= preg_replace('/\|$/','',preg_replace('/<([^>^\s]+)>/','$1|',$allowed_tags)); $allowed_tags_regex= preg_replace('/\|$/','',preg_replace('/<([^>^\s]+)>/','$1|',$allowed_tags));
$allowed_tags_regex_strip_not_name = "/<(". $allowed_tags_regex . ")\s+[^>]+>/"; $allowed_tags_regex_strip_not_name = "/<(". $allowed_tags_regex . ")\s+[^>]+>/";
$description= preg_replace($allowed_tags_regex_strip_not_name,'<$1>',strip_tags(html_entity_decode(htmlspecialchars(html_entity_decode($text,ENT_QUOTES,"UTF-8"),ENT_QUOTES,"UTF-8"),ENT_QUOTES,"UTF-8"),$allowed_tags)); $description= strip_tags(html_entity_decode(htmlspecialchars(html_entity_decode($text,ENT_QUOTES,"UTF-8"),ENT_QUOTES,"UTF-8"),ENT_QUOTES,"UTF-8"),$allowed_tags);
preg_match("/<p(\s[^>]*)?>/i",$description,$matches); preg_match("/<p(\s[^>]*)?>/i",$description,$matches);
if ($matches) if ($matches)
{} {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment