<?php

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

use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Component\ComponentHelper;
// use BlackSheepResearch\Component\UserPoints\Administrator\Viewers\UPJPane;

class AccountHTML extends UserView {

    function _display($tpl = null) {
        // JHTML::_('behavior.calendar');
        // $pane = UPJPane::getInstance('tabs');
        // $slider = UPJPane::getInstance('sliders');
        // $document->addStyleSheet(Uri::base(true) . '/components/com_userpoints/assets/css/userpoints.css');
        //$document->addStyleSheet(Uri::base(true).'/components/com_userpoints/assets/css/bar.css');
        //$document->addScript(Uri::base(true).'/components/com_userpoints/assets/ajax/maxlength.js');
        // CROP AVATAR
        /*
          $document->addStyleSheet(Uri::base(true).'/components/com_userpoints/assets/crop/css/uvumi-crop.css', 'text/css', 'screen');
          $document->addScript(Uri::base(true).'/components/com_userpoints/assets/crop/js/UvumiCrop-compressed.js');
          $scriptCrop = "cropperAvatar = new uvumiCropper('cropAvatar',{
          coordinates:true,
          preview:true,
          downloadButton:false,
          saveButton:true
          });";
          $document->addScriptDeclaration($scriptCrop, '');
         */

        $this->isIEAdm();

        // get params definitions
        $this->enabledUDDEIM = ComponentHelper::getParams('com_userpoints')->get('showUddeimTab', '0');

        Factory::getDocument()->setTitle($this->myusername . ' - ' . getFormattedPoints($this->currenttotalpoints) . ' ' . Text::_('AUP_POINTS'));
        parent::display($tpl);
    }

}
