Actualización

This commit is contained in:
Xes
2025-04-10 12:36:07 +02:00
parent 1da7c3f3b9
commit 4aff98e77b
3147 changed files with 320647 additions and 0 deletions

4
plugin/rss/README.md Normal file
View File

@@ -0,0 +1,4 @@
RSS plugin
===
This plugin displays RSS feeds.

35
plugin/rss/index.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
/* For licensing terms, see /license.txt */
use Zend\Feed\Reader\Feed\FeedInterface;
use Zend\Feed\Reader\Reader;
$plugin = RssPlugin::create();
$url = $plugin->get_rss();
$title = $plugin->get_block_title();
$title = $title ? "<h4>$title</h4>" : '';
$css = $plugin->get_css();
if (empty($url)) {
echo Display::return_message(get_lang('NoRSSItem'), 'warning');
return;
}
try {
$channel = Reader::import($url);
if (!empty($channel)) {
/** @var FeedInterface $item */
foreach ($channel as $item) {
$title = $item->getTitle();
$link = $item->getLink();
if (!empty($link)) {
$title = Display::url($title, $link, ['target' => '_blank']);
}
echo Display::panel($item->getDescription(), $title);
}
}
} catch (Exception $e) {
echo Display::return_message($plugin->get_lang('no_valid_rss'), 'warning');
error_log($e->getMessage());
}

View File

@@ -0,0 +1,16 @@
<?php
/**
* @copyright (c) 2012 University of Geneva
* @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
* @author Laurent Opprecht <laurent@opprecht.info>
*/
$strings['plugin_title'] = "RSS";
$strings['plugin_comment'] = "Display RSS content.";
$strings['rss'] = "RSS";
$strings['block_title'] = "Block title";
$strings['title'] = "Title";
$strings['no_rss'] = "There is no RSS configured. Please add a RSS";
$strings['no_valid_rss'] = "Please check if the URL contains a valid RSS URL";

View File

@@ -0,0 +1,11 @@
<?php
/**
* @copyright (c) 2012 University of Geneva
* @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
* @author Laurent Opprecht <laurent@opprecht.info>
*/
$strings['plugin_title'] = "RSS (Flux)";
$strings['plugin_comment'] = "Affiche le contenu de flux RSS.";
$strings['title'] = "Titre";
$strings['no_rss'] = "Veuillez configurer";

View File

@@ -0,0 +1,9 @@
<?php
$strings['plugin_title'] = "RSS";
$strings['plugin_comment'] = "Muestra contenido RSS.";
$strings['rss'] = "RSS";
$strings['block_title'] = "Título del bloque";
$strings['title'] = "Título";
$strings['no_rss'] = "RSS no está configurado. Favor de agregar una fuente RSS";

View File

@@ -0,0 +1,38 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @copyright (c) 2012 University of Geneva
* @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
* @author Laurent Opprecht <laurent@opprecht.info>
*/
class RssPlugin extends Plugin
{
/**
* RssPlugin constructor.
*/
public function __construct()
{
parent::__construct('1.1', 'Laurent Opprecht, Julio Montoya', ['block_title' => 'text', 'rss' => 'text']);
}
/**
* @return RssPlugin
*/
public static function create()
{
static $result = null;
return $result ? $result : $result = new self();
}
public function get_block_title()
{
return $this->get('block_title');
}
public function get_rss()
{
return $this->get('rss');
}
}

3
plugin/rss/plugin.php Normal file
View File

@@ -0,0 +1,3 @@
<?php
$plugin_info = RssPlugin::create()->get_info();