Files
sysPass/inc/SP/Controller/GridTabController.class.php
2015-11-25 16:47:34 +01:00

71 lines
1.9 KiB
PHP

<?php
/**
* sysPass
*
* @author nuxsmin
* @link http://syspass.org
* @copyright 2012-2015 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;
use SP\Core\SessionUtil;
use SP\Core\Template;
use SP\Util\Checks;
abstract class GridTabController extends Controller
{
/**
* Máximo numero de acciones antes de agrupar
*/
const MAX_NUM_ACTIONS = 3;
/**
* @var Grids
*/
protected $_grids;
/**
* Constructor
*
* @param $template Template con instancia de plantilla
*/
public function __construct(Template $template = null)
{
parent::__construct($template);
$this->view->assign('isDemo', Checks::demoIsEnabled());
$this->view->assign('sk', SessionUtil::getSessionKey(true));
}
/**
* Inicializar las plantillas para las pestañas
*/
public function useTabs()
{
$this->_grids = new Grids();
$this->_grids->setQueryTimeStart($this->view->queryTimeStart);
$this->view->addTemplate('datatabs-grid');
$this->view->assign('tabs', array());
$this->view->assign('activeTab', 0);
$this->view->assign('maxNumActions', self::MAX_NUM_ACTIONS);
}
}