1<?php
2###############################################################################
3# Gregarius - A PHP based RSS aggregator.
4# Copyright (C) 2003 - 2006 Marco Bonetti
5#
6###############################################################################
7# This program is free software and open source software; you can redistribute
8# it and/or modify it under the terms of the GNU General Public License as
9# published by the Free Software Foundation; either version 2 of the License,
10# or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful, but WITHOUT
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15# more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with this program; if not, write to the Free Software Foundation, Inc.,
19# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  or visit
20# http://www.gnu.org/licenses/gpl.html
21#
22###############################################################################
23# E-mail:      mbonetti at gmail dot com
24# Web page:    http://gregarius.net/
25#
26###############################################################################
27
28///// ITEMLIST WRAPPERS /////
29function rss_itemlist_title() {
30
31	return ($GLOBALS['rss'] -> currentItemList -> renderOptions & IL_TITLE_NO_ESCAPE ?
32			$GLOBALS['rss']->currentItemList ->title :
33			rss_htmlspecialchars($GLOBALS['rss']->currentItemList ->title)
34	);
35}
36
37function rss_itemlist_anchor() {
38	$anchor = "";
39	if (!defined('FEEDCONTENT_ANCHOR_SET')) {
40		$anchor = " id=\"feedcontent\"";
41		define('FEEDCONTENT_ANCHOR_SET', true);
42	}
43	return $anchor;
44}
45
46function rss_itemlist_icon() {
47
48	if (($GLOBALS['rss']->renderOptions & IL_CHANNEL_VIEW) &&
49		getConfig('rss.output.showfavicons') &&
50		count($GLOBALS['rss'] -> currentItemList -> feeds)) {
51			$key = array_keys($GLOBALS['rss'] -> currentItemList -> feeds);
52			return $GLOBALS['rss'] -> currentItemList -> feeds[$key[0]] -> iconUrl;
53	} elseif (($GLOBALS['rss']->renderOptions & IL_FOLDER_VIEW) &&
54			getConfig('rss.output.showfavicons')) {
55		return getExternalThemeFile("media/folder.gif");
56	}
57
58	return null;
59
60}
61
62function rss_itemlist_has_extractions() {
63	return count(isset($GLOBALS['rss'] -> currentItemList-> preRender)) > 0;
64}
65
66
67function rss_itemlist_prerender_callback() {
68	if (isset($GLOBALS['rss'] -> currentItemList->preRender) &&
69		  count($GLOBALS['rss'] -> currentItemList->preRender)) {
70		foreach($GLOBALS['rss'] -> currentItemList->preRender as $prAction) {
71			list($prAfnct,$prAargs)=$prAction;
72			call_user_func($prAfnct, $prAargs);
73		}
74	}
75	rss_plugin_hook( 'rss.plugins.items.beforeitemsimmediate', null );
76}
77
78function rss_itemlist_feeds() {
79
80	foreach($GLOBALS['rss'] -> currentItemList->feeds as $feed) {
81		$feed->render();
82	}
83}
84
85function rss_itemlist_before_list() {
86	return $GLOBALS['rss'] -> currentItemList-> beforeList;
87}
88
89function rss_itemlist_after_list() {
90	return $GLOBALS['rss'] -> currentItemList-> afterList;
91}
92
93function rss_itemlist_navigation() {
94	if (isset($GLOBALS['rss'] -> currentItemList -> navigation)) {
95		$GLOBALS['rss'] -> currentItemList -> navigation -> render();
96	}
97}
98
99function rss_itemlist_navigation_pages() {
100	if (isset($GLOBALS['rss'] -> currentItemList -> navigation)) {
101		return $GLOBALS['rss'] -> currentItemList -> navigation -> pages;
102	}
103}
104?>