Retriever version 1.0

This commit is contained in:
Matthew Exon 2016-02-03 10:13:09 +01:00
parent 381e23da12
commit 45cc7c6cd1
7 changed files with 236 additions and 138 deletions

View file

@ -1,18 +1,26 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="text()"/>
<xsl:template match="{{$include}}">
{{function clause_xpath}}
{{if !$clause.attribute}}
{{$clause.element}}{{elseif $clause.attribute == 'class'}}
{{$clause.element}}[contains(concat(' ', normalize-space(@class), ' '), '{{$clause.value}}')]{{else}}
{{$clause.element}}[@{{$clause.attribute}}='{{$clause.value}}']{{/if}}
{{/function}}
{{foreach $spec.include as $clause}}
<xsl:template match="{{clause_xpath clause=$clause}}">
<xsl:copy>
<xsl:apply-templates select="node()|@*" mode="remove"/>
</xsl:copy>
</xsl:template>
{{/foreach}}
{{foreach $spec.exclude as $clause}}
<xsl:template match="{{clause_xpath clause=$clause}}" mode="remove"/>
{{/foreach}}
<xsl:template match="node()|@*" mode="remove">
<xsl:copy>
@ -20,22 +28,4 @@
</xsl:copy>
</xsl:template>
{{if $exclude}}
<xsl:template match="{{$exclude}}" mode="remove"/>
{{/if}}
<!-- attempt to replace relative URLs with absolute URLs -->
<!-- http://stackoverflow.com/questions/3824631/replace-href-value-in-anchor-tags-of-html-using-xslt -->
<xsl:template match="*/@src[starts-with(.,'.')]" mode="remove">
<xsl:attribute name="src">
<xsl:value-of select="concat('{{$dirurl}}',.)"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="*/@src[starts-with(.,'/')]" mode="remove">
<xsl:attribute name="src">
<xsl:value-of select="concat('{{$rooturl}}',.)"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- attempt to replace relative URLs with absolute URLs -->
<!-- http://stackoverflow.com/questions/3824631/replace-href-value-in-anchor-tags-of-html-using-xslt -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*/@src[starts-with(.,'.')]">
<xsl:attribute name="src">
<xsl:value-of select="concat('{{$dirurl}}',.)"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="*/@src[starts-with(.,'/')]">
<xsl:attribute name="src">
<xsl:value-of select="concat('{{$rooturl}}',.)"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>

View file

@ -1,8 +1,3 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<h2>Retriever Plugin Help</h2>
<p>
This plugin replaces the short excerpts you normally get in RSS feeds
@ -147,7 +142,7 @@ Photos" box in the "Retriever Settings" section and click "Submit".
</p>
<h2>Configure Feeds:</h2>
<div>
{{ for $feeds as $feed }}
{{ inc contact_template.tpl with $contact=$feed }}{{ endinc }}
{{ endfor }}
{{foreach $feeds as $feed}}
{{include file='contact_template.tpl' contact=$feed}}
{{/foreach}}
</div>

View file

@ -1,8 +1,3 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<div class="settings-block">
<script language="javascript">
function retriever_add_row(id)
@ -47,7 +42,7 @@ function retriever_remove_row(id, number)
}
</script>
<h2>{{$title}}</h2>
<p><a href="{{$help}}">Get Help</a></p>
<p><a href="{{$help}}">{{$help_t}}</a></p>
<form method="post">
<input type="hidden" name="id" value="{{$id}}">
{{include file="field_checkbox.tpl" field=$enable}}
@ -111,6 +106,7 @@ function retriever_remove_row(id, number)
</table>
<input type="button" onclick="retriever_add_row('retriever-exclude')" value="{{$add_t}}">
</div>
<input type="submit" size="70" value="{{$submit}}">
{{include file="field_textarea.tpl" field=$customxslt}}
<input type="submit" size="70" value="{{$submit_t}}">
</form>
</div>

View file

@ -1,22 +1,9 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<div class="settings-block">
<h3>{{$title}}</h3>
<p>
<a href="{{$help}}">Get Help</a>
</p>
<table>
<tbody>
<tr>
<td>{{$all_photos_t}}:</td>
<td><input class="checkbox" type="checkbox" name="all_photos" {{$all_photos}}></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="{{$submit}}"></td>
</tr>
</tbody>
</table>
{{include file="field_checkbox.tpl" field=$allphotos}}
{{include file="field_checkbox.tpl" field=$oembed}}
<input type="submit" value="{{$submit}}">
</div>