Files
sysPass/lib/SP/Controller/GridTabControllerBase.php

77 lines
2.1 KiB
PHP

<?php
/**
* sysPass
*
* @author nuxsmin
* @link http://syspass.org
* @copyright 2012-2017, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
* sysPass is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* sysPass is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sysPass. If not, see <http://www.gnu.org/licenses/>.
*/
namespace SP\Controller;
defined('APP_ROOT') || die();
use SP\Controller\Grids\Items;
use SP\Core\SessionUtil;
use SP\Core\Template;
use SP\Modules\Web\Controllers\ControllerBase;
/**
* Class GridTabController para la construcción de clases que utilicen el grid de pestañas
*
* @package SP\Controller
*/
abstract class GridTabControllerBase extends ControllerBase
{
/**
* Máximo numero de acciones antes de agrupar
*/
const MAX_NUM_ACTIONS = 3;
/**
* @var mixed
*/
protected $Grids;
/**
* Constructor
*
* @param $template Template con instancia de plantilla
*/
public function __construct(Template $template = null)
{
parent::__construct($template);
$this->view->assign('isDemo', $this->configData->isDemoEnabled());
$this->view->assign('sk', SessionUtil::getSessionKey(true));
}
/**
* Inicializar las plantillas para las pestañas
*/
public function useTabs()
{
$this->Grids = new Items();
$this->Grids->setQueryTimeStart($this->view->queryTimeStart);
$this->view->addTemplate('datatabs-grid', 'grid');
$this->view->assign('tabs', []);
$this->view->assign('activeTab', 0);
$this->view->assign('maxNumActions', self::MAX_NUM_ACTIONS);
}
}