]>
git.wh0rd.org - tt-rss.git/blob - plugins/af_comics/init.php
efc51d187a16bab9953fa3ea2a1fb27e42716ee6
2 class Af_Comics
extends Plugin
{
5 private $filters = array();
9 "Fixes RSS feeds of assorted comic strips",
13 function init($host) {
16 $host->add_hook($host::HOOK_ARTICLE_FILTER
, $this);
17 $host->add_hook($host::HOOK_PREFS_TAB
, $this);
19 require_once __DIR__
. "/filter_base.php";
21 $filters = glob(__DIR__
. "/filters/*.php");
23 foreach ($filters as $file) {
25 $filter_name = preg_replace("/\..*$/", "", basename($file));
27 $filter = new $filter_name();
29 if (is_subclass_of($filter, "Af_ComicFilter")) {
30 array_push($this->filters
, $filter);
36 function hook_prefs_tab($args) {
37 if ($args != "prefPrefs") return;
39 print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Feeds supported by af_comics')."\">";
41 print "<p>" . __("The following comics are currently supported:") . "</p>";
45 foreach ($this->filters
as $f) {
46 foreach ($f->supported() as $comic) {
47 array_push($comics, $comic);
53 print "<ul class=\"browseFeedList\" style=\"border-width : 1px\">";
54 foreach ($comics as $comic) {
55 print "<li>$comic</li>";
62 function hook_article_filter($article) {
63 $owner_uid = $article["owner_uid"];
65 foreach ($this->filters
as $f) {
66 if ($f->process($article))
74 function api_version() {