<?php

namespace ThurData\Servers\KerioEmail\Core\UI\Widget\Buttons;

use \ThurData\Servers\KerioEmail\Core\UI\Builder\BaseContainer;

/**
 * base button for submiting standalone forms
 *
 * @autor ThurData <info@thurdata.ch>
 */
class ButtonSubmitForm extends BaseContainer
{
    use \ThurData\Servers\KerioEmail\Core\UI\Traits\SubmitButton;
    
    protected $id             = 'baseSubmitButton';
    protected $class          = ['lu-btn lu-btn--success mg-submit-form'];
    protected $title          = 'submit';
    protected $htmlAttributes = [
        'href' => 'javascript:;'
    ];

    public function initContent()
    {
        $this->htmlAttributes['@click'] = 'submitForm(\'' . $this->getFormId() . '\', $event)';
        $this->htmlAttributes['@keyup'] = 'submitForm(\'' . $this->getFormId() . '\', $event)';
    }
}
