Przejdź do głównej treści

Ready_™ Developer TeamMniej niż 1 minuta

<?php

namespace ReadyApp\ExampleApp\View;

use Panel;
use Translator;
use ICustomView;

class ExampleView implements ICustomView {

    private string $name;

    private string $refreshToken = 'return false;';

    public function __construct(string $name, ?Panel $parent = NULL) {
        $this->name = $name;
        $this->refreshToken = 'App.'.$this->name.'asyncRefresh();';
    }

    public function toHtml(): string {
        $html = '<div class="custom-projects gbs sbg b-s-b" style="overflow-y: scroll; height: 100%">  
                    <div class="ready-bootstrap">
                        <div class="row" style="margin-left: 5px; margin-right: 0;">
                                <button class="rbos-btn rbos-btn-secondary no-print" title="'.Translator::translate('Odśwież').'"
                                onclick="'.$this->refreshToken.' return false;">
                            <i style="vertical-align: middle; font-size: 14px; line-height: 30px; margin-right: 3px;"
                               class="eic eic-refresh"></i>'.Translator::translate('Odśwież').'
                        </button>      
                        </div>
                    </div>
                 </div>';
        return $html;
    }

    public function setParams(array $params): void {

    }
}