- md5
- 12455ed092f1fa03dff51ed68581b4c0
- sha1
- 6e7fe5c832623705657f455c5e30220f5c6f3f65
- sha256
- c419578759cb180e5185955f906466fa83b6197102ab31443f91fb137a101b38
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
<?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Content\Administrator\Controller;
defined('_JEXEC') or die;
/**
* 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
\JSession::checkToken() or jexit(\JText::_('JINVALID_TOKEN'));
$user = \JFactory::getUser();
$ids = $this->input->get('cid', array(), 'array');
// Access checks.
foreach ($ids as $i => $id)
{
if (!$user->authorise('core.delete', 'com_content.article.' . (int) $id))
{
// Prune items that you can't delete.
unset($ids[$i]);
\JFactory::getApplication()->enqueueMessage(\JText::_('JERROR_CORE_DELETE_NOT_PERMITTED'), 'notice');
}
}
if (empty($ids))
{
\JFactory::getApplication()->enqueueMessage(\JText::_('JERROR_NO_ITEMS_SELECTED'), 'error');
}
else
{
// Get the model.
/** @var \Joomla\Component\Content\Administrator\Model\FeatureModel $model */
$model = $this->getModel();
// Remove the items.
if (!$model->featured($ids, 0))
{
\JFactory::getApplication()->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);
}
}
No other release has this exact content. See every version of this file.