- md5
- e359a847e35986ad64b5319788efec2d
- sha1
- cc19a45b045f801e1dd0478cc5f7285f186ae061
- sha256
- 9119a3beb7b87484ae36a5f39120adfeb27e0ea395096d8b184e0de89f52ecdd
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
<?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @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\Content\Administrator\Controller;
\defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
/**
* Featured content controller class.
*
* @since 1.6
*/
class FeaturedController extends ArticlesController
{
/**
* Removes an item.
*
* @return void
*
* @since 1.6
*/
public function delete()
{
// Check for request forgeries
$this->checkToken();
$user = $this->app->getIdentity();
$ids = (array) $this->input->get('cid', array(), 'int');
// Access checks.
foreach ($ids as $i => $id)
{
// Remove zero value resulting from input filter
if ($id === 0)
{
unset($ids[$i]);
continue;
}
if (!$user->authorise('core.delete', 'com_content.article.' . (int) $id))
{
// Prune items that you can't delete.
unset($ids[$i]);
$this->app->enqueueMessage(Text::_('JERROR_CORE_DELETE_NOT_PERMITTED'), 'notice');
}
}
if (empty($ids))
{
$this->app->enqueueMessage(Text::_('JERROR_NO_ITEMS_SELECTED'), 'error');
}
else
{
/** @var \Joomla\Component\Content\Administrator\Model\FeatureModel $model */
$model = $this->getModel();
// Remove the items.
if (!$model->featured($ids, 0))
{
$this->app->enqueueMessage($model->getError(), 'error');
}
}
$this->setRedirect('index.php?option=com_content&view=featured');
}
/**
* Method to publish a list of articles.
*
* @return void
*
* @since 1.0
*/
public function publish()
{
parent::publish();
$this->setRedirect('index.php?option=com_content&view=featured');
}
/**
* Method to get a model object, loading it if required.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return \Joomla\CMS\MVC\Model\BaseDatabaseModel The model.
*
* @since 1.6
*/
public function getModel($name = 'Feature', $prefix = 'Administrator', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
The same content is in 14 releases, Joomla 4.1.1 to 4.2.0-beta2. See them all, or every version of this file.