<?php
	
	/**
	* @copyright		(C)2013 DM Digital S.r.l
	* @author 			DM Digital <support@dmjoomlaextensions.com>
	* @link				http://www.dmjoomlaextensions.com
	* @license 			GNU/LGPL http://www.gnu.org/copyleft/gpl.html
	**/
	
	defined('_JEXEC') or die('Restricted access');
	jimport('joomla.application.component.view');
	require_once(JPATH_COMPONENT . DS . 'helpers' . DS . 'dmfumhelper.php');
	
	class DMViewPermissions extends DMView {
		
		function display($tpl = null) {
						$mainframe = JFactory::getApplication();
            jimport('joomla.html.pagination');

            $limitstart = JRequest::getVar('limitstart', 0);
            $limit = JRequest::getVar('limit',$mainframe->getCfg('list_limit'));
            $total = 1;
            $this->pageNav = new JPagination($total,$limitstart,$limit);
			$this->groupList = DMFUMHelper::getDefinedGroups();

            $document = JFactory::getDocument();
            $document->addStyleSheet('components/com_dmfrontendusermanager/styles/style.css');

			$this->addToolBar();
			
			parent::display($tpl);
		}
		
		protected function addToolBar() {
			
			JToolBarHelper::title(JText::_('COM_DMFRONTENDUSERMANAGER_PERMISSION_VIEWTITLE'));

            JToolBarHelper::custom('log', 'log.png', 'log.png', 'log', false, false);

            $group = DMFUMHelper::getUndefinedGroups();
            if (!empty($group)) {
                JToolBarHelper::addNew('add');
            }

            JToolBarHelper::deleteList('', 'delete');

            JToolBarHelper::preferences('com_dmfrontendusermanager', 550, 875, 'Preferences');

        }
		
	}
		
?>
