Пример #1
0
<?php

use app\helpers\Html;
\app\widgets\FileAsset::register($this);
echo $content = Html::button($params['btn-text'], ['class' => 'choose-file-btn form-control btn', 'id' => 'btn' . $params['id'], 'value' => '1', 'type' => 'button', 'onclick' => "choose_file('{$params['id']}')"]);
echo '<input type="hidden" id="' . $params['id'] . '" name="' . $params['name'] . '">';
$files = '';
foreach ($params['files'] as $k => $v) {
    if (isset($model) && $model->{$params}['pureAttribute'] == $v['id']) {
        $is_checked = true;
    } else {
        $is_checked = false;
    }
    $files .= \app\globals\ApiGlobals::file_row('radio', $v['vneshnee_imya_fajla'], $v['id'], $params['id'], $is_checked);
}
if (!$files) {
    $files = '\\';
}
$files_from = '<div class="dark_fon hidden" tabindex="10" onkeydown="darkKeyDown(event,\\\'' . $params['id'] . '\\\')" id="' . $params['id'] . '_form">\\
         <div class="add_files_form">\\
              <div class="file_add_section">\\
                <form id="add_files' . $params['id'] . '"  method="POST" action="" enctype="multipart/form-data">\\
                    <label for="' . $params['id'] . '_input" id="lable' . $params['id'] . '" class="add-file-button btn btn-primary">Загрузить файл</label>\\
                    <input onchange="change_file' . $params['id'] . '()" type="file" class="file-input" id="' . $params['id'] . '_input" name="' . $params['id'] . '_input[]">\\
                    <div class="myprogress hidden" id="progress' . $params['id'] . '">\\
                        <div class="bar"></div>\\
                        <div class="percent">0%</div >\\
                    </div>\\
                </form>\\
              </div>\\
              <div class="center_files_form">\\