<?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\Administrator\Viewers;

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

use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Pagination\Pagination;
use BlackSheepResearch\Component\UserPoints\Site\UserPoints;

class ActivitiesHTML extends AdminHTML {

	function show ($tpl = null) {

		$document	=  Factory::getDocument();

		$logo = '<img src="'. Uri::root() . 'administrator/components/com_userpoints/assets/images/icon-48-userpoints.png" />&nbsp;&nbsp;';

		ToolbarHelper::title( $logo . 'UserPoints :: ' .  Text::_( 'AUP_ACTIVITY' ), 'searchtext' );
		$this->getCpanelToolbar();

		if (UserPoints::getUser()->authorise('core.create', 'com_userpoints')) {
			ToolbarHelper::custom( 'exportallactivitiesallusers', 'upload.png', 'upload.png', Text::_('AUP_EXPORT_ACTIVITIES'), false );
		}

		$this->getPrefHelpToolbar();

		$this->pagination = new Pagination( $this->total, $this->limitstart, $this->limit );

		parent::display( $tpl) ;
	}

}
