| Current Path : /var/www/html/administrator/components/com_community/controllers/ |
| Current File : /var/www/html/administrator/components/com_community/controllers/memberlist.php |
<?php
/**
* @copyright (C) 2013 iJoomla, Inc. - All rights reserved.
* @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html)
* @author iJoomla.com <webmaster@ijoomla.com>
* @url https://www.jomsocial.com/license-agreement
* The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
* More info at https://www.jomsocial.com/license-agreement
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Table\Table;
// Disallow direct access to this file
defined('_JEXEC') or die('Restricted access');
jimport( 'joomla.application.component.controller' );
Table::addIncludePath( JPATH_ROOT . '/components/com_community/tables' );
class CommunityControllerMemberlist extends CommunityController
{
public function __construct()
{
parent::__construct();
}
public function delete()
{
$mainframe = Factory::getApplication();
$jinput = $mainframe->input;
$data = $jinput->get('cid' , '', 'NONE');
$error = array();
$list = Table::getInstance( 'Memberlist' , 'CTable' );
if( !is_array( $data ) )
{
$data[] = $data;
}
if( empty($data) )
{
Factory::getApplication()->enqueueMessage(Text::_('COM_COMMUNITY_INVALID_ID'), 'error');
}
foreach($data as $id)
{
$list->load( $id );
if( !$list->delete() )
{
$error[] = true;
}
}
$mainframe = Factory::getApplication();
if( in_array( $error , true ) )
{
$this->setRedirect( 'index.php?option=com_community&view=memberlist' , Text::_('COM_COMMUNITY_MEMBERLIST_REMOVING_ERROR') , 'error' );
}
else
{
$this->setRedirect( 'index.php?option=com_community&view=memberlist' , Text::_('COM_COMMUNITY_MEMBERLIST_DELETED'),'message' );
}
}
}