<?php
/**
 * @package     DOCman
 * @copyright   Copyright (C) 2019 Timble CVBA. (http://www.timble.net)
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://github.com/joomlatools/textman for the canonical source repository
 */

namespace Foliolabs\Docman\Site;

use Foliolabs\Docman;
use Foliolabs\Library;

class ControllerToolbarSubmit extends Docman\ControllerToolbarActionbar
{
    protected function _afterRead(Library\ControllerContext $context)
    {
        $controller = $this->getController();

        if($controller->getView()->show_form) {
            $this->addCommand('save', [
                'allowed' => true,
                'label'   => 'Submit',
                'attribs' => [
                    'class' => ['btn btn-default']
                ]
            ]);
        }
    }
}
