first commit

This commit is contained in:
2025-06-17 11:53:18 +02:00
commit 9f0f7ba12b
8804 changed files with 1369176 additions and 0 deletions

View File

@ -0,0 +1,29 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
// Add strings for translations in Javascript.
Text::script('JGLOBAL_EXPAND_CATEGORIES');
Text::script('JGLOBAL_COLLAPSE_CATEGORIES');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_categories');
$wa->useScript('com_categories.shared-categories-accordion');
?>
<div class="com-newsfeeds-categories categories-list">
<?php echo LayoutHelper::render('joomla.content.categories_default', $this); ?>
<?php echo $this->loadTemplate('items'); ?>
</div>

View File

@ -0,0 +1,332 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<layout title="COM_NEWSFEEDS_CATEGORIES_VIEW_DEFAULT_TITLE" option="COM_NEWSFEEDS_CATEGORIES_VIEW_DEFAULT_OPTION">
<help
key = "Menu_Item:_List_All_News_Feed_Categories"
/>
<message>
<![CDATA[COM_NEWSFEEDS_CATEGORIES_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request"
>
<field
name="id"
type="category"
label="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_LABEL"
extension="com_newsfeeds"
show_root="true"
required="true"
/>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<fieldset name="basic" label="JGLOBAL_CATEGORIES_OPTIONS">
<field
name="show_base_description"
type="list"
label="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="categories_description"
type="textarea"
label="JGLOBAL_FIELD_CATEGORIES_DESC_LABEL"
cols="25"
rows="5"
/>
<field
name="maxLevelcat"
type="list"
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
useglobal="true"
validate="options"
>
<option value="-1">JALL</option>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
</field>
<field
name="show_empty_categories_cat"
type="list"
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_subcat_desc_cat"
type="list"
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_cat_items_cat"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_CAT_ITEMS_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
<fieldset name="category" label="JGLOBAL_CATEGORY_OPTIONS" description="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL">
<field
name="show_category_title"
type="list"
label="JGLOBAL_SHOW_CATEGORY_TITLE"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_description"
type="list"
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_description_image"
type="list"
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="maxLevel"
type="list"
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
useglobal="true"
validate="options"
>
<option value="-1">JALL</option>
<option value="0">JNONE</option>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
</field>
<field
name="show_empty_categories"
type="list"
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_subcat_desc"
type="list"
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_cat_items"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_CAT_ITEMS_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS" description="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL">
<field
name="filter_field"
type="list"
label="JGLOBAL_FILTER_FIELD_LABEL"
default=""
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="hide">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_pagination_limit"
type="list"
label="JGLOBAL_DISPLAY_SELECT_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_headings"
type="list"
label="JGLOBAL_SHOW_HEADINGS_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_articles"
type="list"
label="COM_NEWSFEEDS_FIELD_NUM_ARTICLES_COLUMN_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_link"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_LINKS_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_pagination"
type="list"
label="JGLOBAL_PAGINATION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">JGLOBAL_AUTO</option>
</field>
<field
name="show_pagination_results"
type="list"
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
<fieldset name="newsfeed" label="COM_NEWSFEEDS_FIELDSET_MORE_OPTIONS_LABEL">
<field
name="show_feed_image"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_feed_description"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_item_description"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="feed_character_count"
type="number"
label="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_LABEL"
description="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_DESC"
filter="integer"
useglobal="true"
/>
</fieldset>
</fields>
</metadata>

View File

@ -0,0 +1,66 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Component\Newsfeeds\Site\Helper\RouteHelper;
?>
<?php if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) : ?>
<?php foreach ($this->items[$this->parent->id] as $id => $item) : ?>
<?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : ?>
<div class="com-newsfeeds-categories__items">
<h3 class="page-header item-title">
<a href="<?php echo Route::_(RouteHelper::getCategoryRoute($item->id, $item->language)); ?>">
<?php echo $this->escape($item->title); ?>
</a>
<?php if ($this->params->get('show_cat_items_cat') == 1) : ?>
<span class="badge bg-info">
<?php echo Text::_('COM_NEWSFEEDS_NUM_ITEMS'); ?>&nbsp;
<?php echo $item->numitems; ?>
</span>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
<button
type="button"
id="category-btn-<?php echo $item->id; ?>"
data-bs-target="#category-<?php echo $item->id; ?>"
data-bs-toggle="collapse"
class="btn btn-secondary btn-sm float-end"
aria-label="<?php echo Text::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"
>
<span class="icon-plus" aria-hidden="true"></span>
</button>
<?php endif; ?>
</h3>
<?php if ($this->params->get('show_subcat_desc_cat') == 1) : ?>
<?php if ($item->description) : ?>
<div class="com-newsfeeds-categories__description category-desc">
<?php echo HTMLHelper::_('content.prepare', $item->description, '', 'com_newsfeeds.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
<div class="com-newsfeeds-categories__children collapse fade" id="category-<?php echo $item->id; ?>">
<?php $this->items[$item->id] = $item->getChildren(); ?>
<?php $this->parent = $item; ?>
<?php $this->maxLevelcat--; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php $this->parent = $item->getParent(); ?>
<?php $this->maxLevelcat++; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>

View File

@ -0,0 +1,61 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
$htag = $this->params->get('show_page_heading') ? 'h2' : 'h1';
?>
<div class="com-newsfeeds-category newsfeed-category">
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_category_title', 1)) : ?>
<<?php echo $htag; ?>>
<?php echo HTMLHelper::_('content.prepare', $this->category->title, '', 'com_newsfeeds.category.title'); ?>
</<?php echo $htag; ?>>
<?php endif; ?>
<?php if ($this->params->get('show_tags', 1) && !empty($this->category->tags->itemTags)) : ?>
<?php $this->category->tagLayout = new FileLayout('joomla.content.tags'); ?>
<?php echo $this->category->tagLayout->render($this->category->tags->itemTags); ?>
<?php endif; ?>
<?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
<div class="com-newsfeeds-category__description category-desc">
<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $this->category->getParams()->get('image'),
'alt' => empty($this->category->getParams()->get('image_alt')) && empty($this->category->getParams()->get('image_alt_empty')) ? false : $this->category->getParams()->get('image_alt'),
]
); ?>
<?php endif; ?>
<?php if ($this->params->get('show_description') && $this->category->description) : ?>
<?php echo HTMLHelper::_('content.prepare', $this->category->description, '', 'com_newsfeeds.category'); ?>
<?php endif; ?>
<div class="clr"></div>
</div>
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php if ($this->maxLevel != 0 && !empty($this->children[$this->category->id])) : ?>
<div class="com-newsfeeds-category__children cat-children">
<h3>
<?php echo Text::_('JGLOBAL_SUBCATEGORIES'); ?>
</h3>
<?php echo $this->loadTemplate('children'); ?>
</div>
<?php endif; ?>
</div>

View File

@ -0,0 +1,259 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<layout title="COM_NEWSFEEDS_CATEGORY_VIEW_DEFAULT_TITLE" option="COM_NEWSFEEDS_CATEGORY_VIEW_DEFAULT_OPTION">
<help
key = "Menu_Item:_List_News_Feeds_in_a_Category"
/>
<message>
<![CDATA[COM_NEWSFEEDS_CATEGORY_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset
name="request"
addfieldprefix="Joomla\Component\Categories\Administrator\Field"
>
<field
name="id"
type="modal_category"
label="JCATEGORY"
extension="com_newsfeeds"
required="true"
select="true"
new="true"
edit="true"
clear="true"
/>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<fieldset name="basic" label="JGLOBAL_CATEGORY_OPTIONS" description="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL">
<field
name="show_category_title"
type="list"
label="JGLOBAL_SHOW_CATEGORY_TITLE"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_description"
type="list"
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_description_image"
type="list"
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="maxLevel"
type="list"
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
useglobal="true"
validate="options"
>
<option value="-1">JALL</option>
<option value="0">JNONE</option>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
</field>
<field
name="show_empty_categories"
type="list"
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_subcat_desc"
type="list"
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_cat_items"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_CAT_ITEMS_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS" description="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL">
<field
name="filter_field"
type="list"
label="JGLOBAL_FILTER_FIELD_LABEL"
default=""
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="hide">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_pagination_limit"
type="list"
label="JGLOBAL_DISPLAY_SELECT_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_articles"
type="list"
label="COM_NEWSFEEDS_FIELD_NUM_ARTICLES_COLUMN_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_link"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_LINKS_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_pagination"
type="list"
label="JGLOBAL_PAGINATION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">JGLOBAL_AUTO</option>
</field>
<field
name="show_pagination_results"
type="list"
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
<fieldset name="newsfeed" label="COM_NEWSFEEDS_FIELDSET_MORE_OPTIONS_LABEL">
<field
name="show_feed_image"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_feed_description"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_item_description"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="feed_character_count"
type="number"
label="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_LABEL"
description="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_DESC"
filter="integer"
useglobal="true"
/>
<field
name="feed_display_order"
type="list"
label="COM_NEWSFEEDS_FIELD_FEED_DISPLAY_ORDER_LABEL"
useglobal="true"
validate="options"
>
<option value="des">JGLOBAL_MOST_RECENT_FIRST</option>
<option value="asc">JGLOBAL_OLDEST_FIRST</option>
</field>
</fieldset>
</fields>
</metadata>

View File

@ -0,0 +1,54 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Component\Newsfeeds\Site\Helper\RouteHelper;
defined('_JEXEC') or die;
?>
<?php if ($this->maxLevel != 0 && count($this->children[$this->category->id]) > 0) : ?>
<ul>
<?php foreach ($this->children[$this->category->id] as $id => $child) : ?>
<?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) : ?>
<li>
<span class="item-title">
<a href="<?php echo Route::_(RouteHelper::getCategoryRoute($child->id, $child->language)); ?>">
<?php echo $this->escape($child->title); ?>
</a>
</span>
<?php if ($this->params->get('show_subcat_desc') == 1) : ?>
<?php if ($child->description) : ?>
<div class="category-desc">
<?php echo HTMLHelper::_('content.prepare', $child->description, '', 'com_newsfeeds.category'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_items') == 1) : ?>
<span class="badge bg-info">
<?php echo Text::_('COM_NEWSFEEDS_CAT_NUM'); ?>&nbsp;
<?php echo $child->numitems; ?>
</span>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0) : ?>
<?php $this->children[$child->id] = $child->getChildren(); ?>
<?php $this->category = $child; ?>
<?php $this->maxLevel--; ?>
<?php echo $this->loadTemplate('children'); ?>
<?php $this->category = $child->getParent(); ?>
<?php $this->maxLevel++; ?>
<?php endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif;

View File

@ -0,0 +1,98 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\String\PunycodeHelper;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Newsfeeds\Site\Helper\RouteHelper;
$n = count($this->items);
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<div class="com-newsfeeds-category__items">
<?php if (empty($this->items)) : ?>
<p><?php echo Text::_('COM_NEWSFEEDS_NO_ARTICLES'); ?></p>
<?php else : ?>
<form action="<?php echo htmlspecialchars(Uri::getInstance()->toString(), ENT_COMPAT, 'UTF-8'); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('filter_field') !== 'hide' || $this->params->get('show_pagination_limit')) : ?>
<fieldset class="com-newsfeeds-category__filters filters">
<?php if ($this->params->get('filter_field') !== 'hide' && $this->params->get('filter_field') == '1') : ?>
<div class="btn-group">
<label class="filter-search-lbl visually-hidden" for="filter-search">
<?php echo Text::_('COM_NEWSFEEDS_FILTER_LABEL') . '&#160;'; ?>
</label>
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" placeholder="<?php echo Text::_('COM_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>">
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="btn-group float-end">
<label for="limit" class="visually-hidden">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</fieldset>
<?php endif; ?>
<ul class="com-newsfeeds-category__category list-group list-unstyled">
<?php foreach ($this->items as $item) : ?>
<li class="list-group-item">
<?php if ($this->params->get('show_articles')) : ?>
<span class="list-hits badge bg-info float-end">
<?php echo Text::sprintf('COM_NEWSFEEDS_NUM_ARTICLES_COUNT', $item->numarticles); ?>
</span>
<?php endif; ?>
<span class="list float-start">
<div class="list-title">
<a href="<?php echo Route::_(RouteHelper::getNewsfeedRoute($item->slug, $item->catid)); ?>">
<?php echo $item->name; ?>
</a>
</div>
</span>
<?php if ($item->published == 0) : ?>
<span class="badge bg-warning text-light">
<?php echo Text::_('JUNPUBLISHED'); ?>
</span>
<?php endif; ?>
<br>
<?php if ($this->params->get('show_link')) : ?>
<?php $link = PunycodeHelper::urlToUTF8($item->link); ?>
<span class="list float-start">
<a href="<?php echo $item->link; ?>">
<?php echo $link; ?>
</a>
</span>
<br>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php // Add pagination links ?>
<?php if (!empty($this->items)) : ?>
<?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
<div class="com-newsfeeds-category__pagination w-100">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter float-end pt-3 pe-2">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
</form>
<?php endif; ?>
</div>

View File

@ -0,0 +1,156 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\Filter\OutputFilter;
?>
<?php if (!empty($this->msg)) : ?>
<?php echo $this->msg; ?>
<?php else : ?>
<?php $lang = $this->getLanguage(); ?>
<?php $myrtl = $this->item->rtl; ?>
<?php $direction = ' '; ?>
<?php $isRtl = $lang->isRtl(); ?>
<?php if ($isRtl && $myrtl == 0) : ?>
<?php $direction = ' redirect-rtl'; ?>
<?php elseif ($isRtl && $myrtl == 1) : ?>
<?php $direction = ' redirect-ltr'; ?>
<?php elseif ($isRtl && $myrtl == 2) : ?>
<?php $direction = ' redirect-rtl'; ?>
<?php elseif ($myrtl == 0) : ?>
<?php $direction = ' redirect-ltr'; ?>
<?php elseif ($myrtl == 1) : ?>
<?php $direction = ' redirect-ltr'; ?>
<?php elseif ($myrtl == 2) : ?>
<?php $direction = ' redirect-rtl'; ?>
<?php endif; ?>
<?php $images = json_decode($this->item->images); ?>
<div class="com-newsfeeds-newsfeed newsfeed<?php echo $direction; ?>">
<?php if ($this->params->get('display_num')) : ?>
<h1 class="<?php echo $direction; ?>">
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<h2 class="<?php echo $direction; ?>">
<?php if ($this->item->published == 0) : ?>
<span class="badge bg-warning text-light"><?php echo Text::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<a href="<?php echo $this->item->link; ?>" target="_blank" rel="noopener">
<?php echo str_replace('&apos;', "'", $this->item->name); ?>
</a>
</h2>
<?php if ($this->params->get('show_tags', 1)) : ?>
<?php $this->item->tagLayout = new FileLayout('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
<!-- Show Images from Component -->
<?php if (isset($images->image_first) && !empty($images->image_first)) : ?>
<?php $imgfloat = empty($images->float_first) ? $this->params->get('float_first') : $images->float_first; ?>
<div class="com-newsfeeds-newsfeed__first-image img-intro-<?php echo $this->escape($imgfloat); ?>">
<figure>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $images->image_first,
'alt' => empty($images->image_first_alt) && empty($images->image_first_alt_empty) ? false : $images->image_first_alt,
]
); ?>
<?php if ($images->image_first_caption) : ?>
<figcaption class="caption"><?php echo $this->escape($images->image_first_caption); ?></figcaption>
<?php endif; ?>
</figure>
</div>
<?php endif; ?>
<?php if (isset($images->image_second) && !empty($images->image_second)) : ?>
<?php $imgfloat = empty($images->float_second) ? $this->params->get('float_second') : $images->float_second; ?>
<div class="com-newsfeeds-newsfeed__second-image float-<?php echo $this->escape($imgfloat); ?> item-image">
<figure>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $images->image_second,
'alt' => empty($images->image_second_alt) && empty($images->image_second_alt_empty) ? false : $images->image_second_alt,
]
); ?>
<?php if ($images->image_second_caption) : ?>
<figcaption class="caption"><?php echo $this->escape($images->image_second_caption); ?></figcaption>
<?php endif; ?>
</figure>
</div>
<?php endif; ?>
<!-- Show Description from Component -->
<?php echo $this->item->description; ?>
<!-- Show Feed's Description -->
<?php if ($this->params->get('show_feed_description')) : ?>
<div class="com-newsfeeds-newsfeed__description feed-description">
<?php echo str_replace('&apos;', "'", $this->rssDoc->description); ?>
</div>
<?php endif; ?>
<!-- Show Image -->
<?php if ($this->rssDoc->image && $this->params->get('show_feed_image')) : ?>
<div class="com-newsfeeds-newsfeed__feed-image">
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $this->rssDoc->image->uri,
'alt' => $this->rssDoc->image->title,
]
); ?>
</div>
<?php endif; ?>
<!-- Show items -->
<?php if (!empty($this->rssDoc[0])) : ?>
<ul class="com-newsfeeds-newsfeed__items">
<?php for ($i = 0; $i < $this->item->numarticles; $i++) : ?>
<?php if (empty($this->rssDoc[$i])) : ?>
<?php break; ?>
<?php endif; ?>
<?php $uri = $this->rssDoc[$i]->uri || !$this->rssDoc[$i]->isPermaLink ? trim($this->rssDoc[$i]->uri) : trim($this->rssDoc[$i]->guid); ?>
<?php $uri = !$uri || stripos($uri, 'http') !== 0 ? $this->item->link : $uri; ?>
<?php $text = $this->rssDoc[$i]->content !== '' ? trim($this->rssDoc[$i]->content) : ''; ?>
<li>
<?php if (!empty($uri)) : ?>
<h3 class="feed-link">
<a href="<?php echo htmlspecialchars($uri); ?>" target="_blank" rel="noopener">
<?php echo trim($this->rssDoc[$i]->title); ?>
</a>
</h3>
<?php else : ?>
<h3 class="feed-link"><?php echo trim($this->rssDoc[$i]->title); ?></h3>
<?php endif; ?>
<?php if ($this->params->get('show_item_description') && $text !== '') : ?>
<div class="feed-item-description">
<?php if ($this->params->get('show_feed_image', 0) == 0) : ?>
<?php $text = OutputFilter::stripImages($text); ?>
<?php endif; ?>
<?php $text = HTMLHelper::_('string.truncate', $text, $this->params->get('feed_character_count')); ?>
<?php echo str_replace('&apos;', "'", $text); ?>
</div>
<?php endif; ?>
</li>
<?php endfor; ?>
</ul>
<?php endif; ?>
</div>
<?php endif; ?>

View File

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<layout title="COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_TITLE" option="COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_OPTION">
<help
key = "Menu_Item:_Single_News_Feed"
/>
<message>
<![CDATA[COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request"
addfieldprefix="Joomla\Component\Newsfeeds\Administrator\Field"
>
<field
name="id"
type="modal_newsfeed"
label="COM_NEWSFEEDS_FIELD_SELECT_FEED_LABEL"
required="true"
select="true"
new="true"
edit="true"
clear="true"
/>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<!-- Basic options. -->
<fieldset name="basic" label="COM_NEWSFEEDS_FIELDSET_MORE_OPTIONS_LABEL">
<field
name="show_feed_image"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_feed_description"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_item_description"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_tags"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_TAGS_LABEL"
useglobal="true"
class="form-select-color-state"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="feed_character_count"
type="number"
label="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_LABEL"
description="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_DESC"
filter="integer"
useglobal="true"
/>
<field
name="feed_display_order"
type="list"
label="COM_NEWSFEEDS_FIELD_FEED_DISPLAY_ORDER_LABEL"
useglobal="true"
validate="options"
>
<option value="des">JGLOBAL_MOST_RECENT_FIRST</option>
<option value="asc">JGLOBAL_OLDEST_FIRST</option>
</field>
</fieldset>
</fields>
</metadata>