<?php

/*
 * @component AltaUserPoints
 * @copyright Copyright (C) 2008-2016 Bernard Gilly - Adrien Roussel
 * @license : GNU/GPL
 * @Website : https://www.nordmograph.com/extensions
 */
defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Language\Text;
use BlackSheepResearch\Component\UserPoints\Site\UserPoints;
use BlackSheepResearch\Component\UserPoints\Site\Problems\PointsUser;

class plgGeekformUp_submit extends CMSPlugin {

    public function onGeekFormSubmit($data, $options = array()) {
        // *** Login rule available only on frontend ***
        $lang = Factory::getLanguage();
        $lang->load('com_userpoints', JPATH_SITE);
        $rule_id = 'up_geekform_submit';
        UserPoints::userpoints($rule_id, '', 0.0, '', Text::_('Points awarded for form submission'));
    }
}
