<?php 
/*
 * @component com_vmvendor
 * @copyright Copyright (C) 2010-2015 Adrien ROUSSEL 
 * @license GNU/GPL Version 3
 * @Website : https://remository.com
 */
  
defined('JPATH_BASE') or die;
 
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Form\Field\SqlField;
use BlackSheepResearch\Component\UserPoints\Site\UserPoints;

 /* 
 jimport('joomla.html.html'); 
 jimport('joomla.form.formfield'); 
 jimport('joomla.form.helper'); 
 */ 
 FormHelper::loadFieldClass('sql'); 
  
 /** 
  * Supports an HTML select list of options driven by SQL 
  */ 
 class JFormFieldSender extends SqlField 
 { 
     /** 
      * The form field type. 
      */ 
     public $type = 'sender'; 
  
     /** 
      * Overrides parent's getinput method 
      */ 
     protected function getInput() 
     { 
         // Initialize variables. 
        $html = ''; 
        // Load user 
     	$user = UserPoints::getUser(); 
		$html .= '<input type="text" size="25" name= "'.$this->name.'"  id="'.$this->id.'" value="'.$user->name.'" class="required" required="required" />';	

         // return the HTML 
         return $html; 
     } 
 } 
 