Пример #1
3
    /**
     * Runs the widget.
     */
    public function run()
    {
        // Print elfinder widget in modal
        Modal::begin(['toggleButton' => false, 'id' => $this->options['id'] . '-dialog', 'size' => Modal::SIZE_LARGE]);
        echo ElFinder::widget(['language' => $this->language, 'controller' => $this->controller, 'path' => $this->path, 'filter' => 'image', 'callbackFunction' => new JsExpression('function(file, id){

                console.log( file.url, "' . $this->buttonOptions['id'] . '" );

                $("#' . $this->options['id'] . '").val( file.url );
                $("#' . $this->options['id'] . '-thumb").attr("src", file.url ).show();
                $("#' . $this->options['id'] . '-dialog").modal("hide");

            }'), 'path' => $this->path, 'frameOptions' => ['style' => 'width: 100%; height: 500px; border: 0px;']]);
        Modal::end();
        // Render input and upload button
        if ($this->hasModel()) {
            $attr = $this->attribute;
            $hidden = $this->model->{$attr} ? '' : 'display:none;';
            $replace['{image}'] = '<img id="' . $this->options['id'] . '-thumb" class="thumbnail" src="' . $this->model->{$attr} . '" style="max-width: 150px; max-height: 150px; ' . $hidden . '" />';
            $replace['{input}'] = Html::activeTextInput($this->model, $this->attribute, $this->options);
        } else {
            $hidden = $this->value ? '' : 'display:none;';
            $replace['{image}'] = '<img id="' . $this->options['id'] . '-thumb" src="' . $this->value . '"  style="max-width: 150px; max-height: 150px; ' . $hidden . '" />';
            $replace['{input}'] = Html::textInput($this->name, $this->value, $this->options);
        }
        $replace['{button}'] = Html::tag($this->buttonTag, $this->buttonName, $this->buttonOptions);
        echo strtr($this->template, $replace);
        // Publish assets
        AssetsCallBack::register($this->getView());
        if (!empty($this->multiple)) {
            $this->getView()->registerJs("\n\n            mihaildev.elFinder.register(" . Json::encode($this->options['id']) . ",\n                function(files, id){\n                    var _f = [];\n                    for (var i in files) { _f.push(files[i].url); }\n                    \$('#' + id).val(_f.join(', ')).trigger('change');\n                    return true;\n                });\n\n            \$(document).on('click','#" . $this->buttonOptions['id'] . "',\n                function(){\n                    mihaildev.elFinder.openManager(" . Json::encode($this->_managerOptions) . ");\n                }\n            );");
        } else {
            $this->getView()->registerJs("\n\n                mihaildev.elFinder.register(" . Json::encode($this->options['id']) . ", function(file, id){\n                    \$('#' + id).val(file.url).trigger('change');\n                    return true;\n                });\n\n                \$(document).on('click',\n                    '#" . $this->buttonOptions['id'] . "',\n                    function(){\n                        //mihaildev.elFinder.openManager(" . Json::encode($this->_managerOptions) . ");\n                        \$('#" . $this->options['id'] . "-dialog').modal('show');\n                    }\n                );");
        }
    }
Пример #2
0
<?php

/**
 * @package   yii2-cms
 * @author    Yuri Shekhovtsov <*****@*****.**>
 * @copyright Copyright &copy; Yuri Shekhovtsov, lowbase.ru, 2015 - 2016
 * @version   1.0.0
 */
use mihaildev\elfinder\ElFinder;
use yii\web\JsExpression;
$this->title = 'Файловый менеджер';
echo ElFinder::widget(['language' => 'ru', 'controller' => 'elfinder', 'filter' => 'image', 'callbackFunction' => new JsExpression('function(file, id){}'), 'frameOptions' => ['style' => "width: 100%; height: 500px; border: 0;"]]);
Пример #3
0
<?php

/**
 * index
 *
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010-2014 SkeekS (Sx)
 * @date 06.02.2015
 * @since 1.0.0
 */
?>

<?php 
echo \mihaildev\elfinder\ElFinder::widget(['language' => \Yii::$app->admin->languageCode, 'controller' => 'cms/elfinder-full', 'callbackFunction' => new \yii\web\JsExpression('function(file, id){}'), 'frameOptions' => ['style' => 'width: 100%; height: 800px;']]);
/*echo \mihaildev\elfinder\InputFile::widget([
    'language'   => 'ru',
    'controller' => 'cms/elfinder', // вставляем название контроллера, по умолчанию равен elfinder
    'filter'     => 'image',    // фильтр файлов, можно задать массив фильтров https://github.com/Studio-42/elFinder/wiki/Client-configuration-options#wiki-onlyMimes
    'name'       => 'myinput',
    'value'      => '',
]);*/
Пример #4
0
<?php

use mihaildev\elfinder\ElFinder;
?>

    
<div class="container-fluid" style="height:800px">

    <?php 
echo 'File Manager';
echo ElFinder::widget(['language' => 'en', 'controller' => 'blog/elfinder', 'filter' => 'image', 'containerOptions' => ['resizable' => 'true', 'style' => 'height:100%']]);
?>

</div>

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

/* @var $this yii\web\View */
$this->title = Yii::t('backend', 'File Manager');
?>

<div class="row">
    <div class="col-xs-12">
        <?php 
echo \mihaildev\elfinder\ElFinder::widget(['language' => 'zh_CN', 'controller' => 'file-manager-elfinder', 'frameOptions' => ['style' => 'min-height: 500px; width: 100%; border: 0']]);
?>
    </div>
</div>
Пример #6
0
<?php

/**
 * @var $this \yii\web\View
 */
use mihaildev\elfinder\ElFinder;
use yii\helpers\Html;
$this->title = Yii::t('cms', 'Files');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="files-index">

    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">
                <?php 
echo Html::encode($this->title);
?>
            </h1>
        </div>
    </div>

    <?php 
echo ElFinder::widget(['controller' => 'elfinder-backend', 'frameOptions' => ['style' => 'min-height: 500px; width:100%']]);
?>

</div>
Пример #7
0
<?php

/* @var $this yii\web\View */
use mihaildev\elfinder\InputFile;
use mihaildev\elfinder\ElFinder;
use yii\web\JsExpression;
?>

<?php 
echo ElFinder::widget(['language' => 'ru', 'frameOptions' => ['style' => 'height:100%;width:100%;'], 'containerOptions' => ['style' => 'height:calc(100vh - 70px);width:100%;'], 'controller' => 'elfinder', 'filter' => ['image', 'application', 'text', 'video'], 'callbackFunction' => new JsExpression('function(file, id){}')]);
Пример #8
0
<?php

use mihaildev\elfinder\InputFile;
use mihaildev\elfinder\ElFinder;
use yii\web\JsExpression;
//mihaildev\elfinder\Assets::noConflict($this);
$this->title = Yii::t('backend', 'File Manager');
?>

<div class="row">
    <div class="col-xs-12">
        <?php 
echo ElFinder::widget(['language' => 'ru', 'controller' => 'elfinder', 'filter' => ['image', 'application'], 'frameOptions' => ['style' => 'min-height: 500px; width: 100%; border: 0']]);
?>
    </div>
</div>


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

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 19.07.2016
 */
?>

<?
echo \mihaildev\elfinder\ElFinder::widget([
    'controller'       => 'cms/elfinder-full', // вставляем название контроллера, по умолчанию равен elfinder
    'callbackFunction' => new \yii\web\JsExpression('function(file, id){}'), // id - id виджета
    'frameOptions' => [
        'style' => 'width: 100%; height: 800px;'
    ]
]);
?>
Пример #10
0
<?php

/* @var $this yii\web\View */
$this->title = Yii::t('admin', 'File Manager');
?>

<div class="row">
    <div class="col-xs-12">
        <?php 
echo \mihaildev\elfinder\ElFinder::widget(['controller' => '/admin/file-manager-elfinder', 'frameOptions' => ['style' => 'min-height: 550px; width: 100%; border: 0']]);
?>
    </div>
</div>
Пример #11
0
            ]
        ]); */?>
    <?php 
echo $form->fieldSetEnd();
?>
<? endif; ?>

<?php 
echo $form->fieldSet(\Yii::t('skeeks/cms', 'File manager'));
?>
    <?
        echo \mihaildev\elfinder\ElFinder::widget([
            'controller'       => 'cms/elfinder-full', // вставляем название контроллера, по умолчанию равен elfinder
            //'filter'           => 'image',    // фильтр файлов, можно задать массив фильтров https://github.com/Studio-42/elFinder/wiki/Client-configuration-options#wiki-onlyMimes
            'callbackFunction' => new \yii\web\JsExpression('function(file, id){
                sx.SelectFile.submit(file.url);
            }'), // id - id виджета
            'frameOptions' => [
                'style' => 'width: 100%; height: 800px;'
            ]
        ]);
    ?>
<?php 
echo $form->fieldSetEnd();
?>

<?php 
echo $form->fieldSet(\Yii::t('skeeks/cms', 'File storage'));
?>


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

use mihaildev\elfinder\ElFinder;
?>
<h1><?php 
echo \Yii::t($this->context->tFile, 'FileManager');
?>
</h1>
<?php 
// @TOFIX заменить файловый менеджер на более конфигурируемый
echo ElFinder::widget(['language' => 'ru', 'controller' => 'elfinder', 'containerOptions' => ['style' => 'height: 400px;']]);
Пример #13
0
<?php

use yii\helpers\Html;
use yii\helpers\Url;
/**
 * @var \yii\web\View $this
 */
$this->title = Yii::t('admin/elfinder', 'File manager');
$this->params['breadcrumbs'][] = $this->title;
$this->params['header'] = $this->title;
?>

<?php 
echo \mihaildev\elfinder\ElFinder::widget(['controller' => '/filemanager/elfinder']);
?>

<?php 
$css = <<<CSS
section.content > div {
    height: 100%;
}
CSS;
$js = <<<JS
(function() {
    function resize() {
        var content = \$('section.content');
        content.css('height', \$(window).innerHeight() - content.offset().top);
    }
    \$(window).resize(resize);
    resize();
})();
Пример #14
0
                        'attribute' => 'size'
                    ],
                ]
            ]); */
    ?>
    <?php 
    echo $form->fieldSetEnd();
}
?>

<?php 
echo $form->fieldSet(\Yii::t('app', 'File manager'));
?>
    <?php 
echo \mihaildev\elfinder\ElFinder::widget(['language' => 'ru', 'controller' => 'cms/elfinder-full', 'callbackFunction' => new \yii\web\JsExpression('function(file, id){
                sx.SelectFile.submit(file.url);
            }'), 'frameOptions' => ['style' => 'width: 100%; height: 800px;']]);
echo $form->fieldSetEnd();
?>

<?php 
echo $form->fieldSet(\Yii::t('app', 'File storage'));
?>


        <?php 
$search = new \skeeks\cms\models\Search(\skeeks\cms\models\StorageFile::className());
$dataProvider = $search->getDataProvider();
$dataProvider->sort->defaultOrder = ['created_at' => SORT_DESC];
?>
        <?php 
Пример #15
0
<?php

use mihaildev\elfinder\ElFinder;
/* @var $this yii\web\View */
$this->title = Yii::t('backend', 'File manager');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="file-manager-index">

    <?php 
echo ElFinder::widget(['controller' => 'file-manager-elfinder', 'frameOptions' => ['style' => 'min-height: 500px; width: 100%; border: 0']]);
?>

</div>