<?php

/*
 * @component UserPoints
 * @copyright Copyright (C) 2015-2023 Martin Brampton
 * @license : GNU/GPL
 * @Website : https://remository.com
 */
namespace BlackSheepResearch\Component\UserPoints\Site\Utils;

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\CMSPlugin;
use BlackSheepResearch\Component\UserPoints\Site\UserPoints;

/**
 * UserPoints Common Plugin parent
 *
 * @package		Joomla
 * @subpackage	UserPoints
 * @since 		1.6
 */

class PluginCommon extends CMSPlugin {
    
    protected $app = null;
    protected $user = null;
    protected $view = '';
    protected $option = '';

    public function __construct(&$subject, $config = []) {
        $this->app = Factory::getApplication();
        $this->view = $this->app->input->get('view', '');
        $this->option = $this->app->input->get('option', '');
        $this->user = UserPoints::getUser();
        parent::__construct($subject, $config);
    }
    
    public function loadLanguage ($extension = '', $basepath = JPATH_ADMINISTRATOR) {
        parent::loadLanguage('com_userpoints', JPATH_SITE);        
    }
}