<?php

/*
 * @component UserPoints
 * @copyright Copyright (C) 2015-2022 Bernard Gilly - Adrien Roussel - Martin Brampton
 * @license : GNU/GPL
 * @Website : https://remository.com
 */
// no direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use BlackSheepResearch\Component\UserPoints\Site\UserController;

require_once JPATH_SITE.'/components/com_userpoints/userpoints_setup.php';

$app = Factory::getApplication();

$doc = Factory::getDocument();
$direction = $doc->direction;

// Add JavaScript Frameworks
HTMLHelper::_('bootstrap.framework');
// Load optional RTL Bootstrap CSS
HTMLHelper::_('bootstrap.loadCss', false, $direction);

// Require specific controller if requested
if ($app->input->get('task', 'display', 'cmd') == 'showRSSAUPActivity') {
    $app->input->set('view', 'rssactivity');
}

$view = $app->input->getCmd('controller', '');
if (empty($view)) {
    $view = $app->input->getCmd('view', 'account');
}

require_once(JPATH_SITE.'/components/com_userpoints/helpers/helpers.php');

// Create the controller and Perform the Request task
(new UserController( ))->execute($view);
// $controller->redirect();
