Пример #1
0
 /**
  * Updated mediafile by id
  * @param $id
  * @return array
  */
 public function actionUpdate($id)
 {
     $model = Mediafile::findOne($id);
     $message = Module::t('main', 'Changes not saved.');
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         $message = Module::t('main', 'Changes saved!');
     }
     Yii::$app->session->setFlash('mediafileUpdateResult', $message);
     Yii::$app->assetManager->bundles = false;
     return $this->renderAjax('info', ['model' => $model, 'strictThumb' => null]);
 }
Пример #2
0
<?php

use ut8ia\filemanager\Module;
use ut8ia\filemanager\assets\ModalAsset;
use yii\helpers\Url;
/* @var $this yii\web\View */
$this->title = Module::t('main', 'Files');
$this->params['breadcrumbs'][] = ['label' => Module::t('main', 'File manager'), 'url' => ['default/index']];
$this->params['breadcrumbs'][] = $this->title;
ModalAsset::register($this);
?>

<iframe src="<?php 
echo Url::to(['file/filemanager']);
?>
" id="post-original_thumbnail-frame" frameborder="0" role="filemanager-frame"></iframe>
Пример #3
0
<?php

use ut8ia\filemanager\Module;
use ut8ia\filemanager\models\Tag;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
/* @var $this yii\web\View */
$form = ActiveForm::begin(['action' => '?', 'method' => 'get']);
?>
	<?php 
echo $form->field($model, 'tagIds')->widget(\kartik\select2\Select2::className(), ['maintainOrder' => true, 'data' => ArrayHelper::map(Tag::find()->all(), 'id', 'name'), 'options' => ['multiple' => true], 'addon' => ['append' => ['content' => Html::submitButton(Module::t('main', 'Search'), ['class' => 'btn btn-primary']), 'asButton' => true]]])->label(false);
ActiveForm::end();
Пример #4
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => 'ID', 'name' => Module::t('main', 'Tag')];
 }
Пример #5
0
<?php

use dosamigos\fileupload\FileUploadUI;
use ut8ia\filemanager\Module;
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $searchModel ut8ia\filemanager\models\Mediafile */
?>

<header id="header"><span class="glyphicon glyphicon-upload"></span> <?php 
echo Module::t('main', 'Upload manager');
?>
</header>

<div id="uploadmanager">
    <p><?php 
echo Html::a('← ' . Module::t('main', 'Back to file manager'), ['file/filemanager']);
?>
</p>
    <?php 
echo FileUploadUI::widget(['model' => $model, 'attribute' => 'file', 'clientOptions' => ['autoUpload' => Yii::$app->getModule('filemanager')->autoUpload], 'clientEvents' => ['fileuploadsubmit' => "function (e, data) { data.formData = [{name: 'tagIds', value: \$('#filemanager-tagIds').val()}]; }"], 'url' => ['upload'], 'gallery' => false, 'formView' => '/file/_upload_form']);
?>
</div>
Пример #6
0
}
?>
            <p><?php 
echo Module::t('main', 'Now using next thumbnails presets');
?>
:</p>
            <ul>
                <?php 
foreach ($this->context->module->thumbs as $preset) {
    ?>
                    <li><strong><?php 
    echo $preset['name'];
    ?>
:</strong> <?php 
    echo $preset['size'][0] . ' x ' . $preset['size'][1];
    ?>
</li>
                <?php 
}
?>
            </ul>
            <p><?php 
echo Module::t('main', 'If you change the thumbnails sizes, it is strongly recommended to make resize all thumbnails.');
?>
</p>
            <?php 
echo Html::a(Module::t('main', 'Do resize thumbnails'), ['file/resize'], ['class' => 'btn btn-danger']);
?>
        </div>
    </div>
</div>
Пример #7
0
    <div class="row">
        <div class="col-md-6">

            <div class="text-center">
                <h2>
                    <?php 
echo Html::a(Module::t('main', 'Files'), ['file/index']);
?>
                </h2>
                <?php 
echo Html::a(Html::img($assetPath . '/images/files.png', ['alt' => 'Files']), ['file/index']);
?>
            </div>
        </div>

        <div class="col-md-6">

            <div class="text-center">
                <h2>
                    <?php 
echo Html::a(Module::t('main', 'Settings'), ['default/settings']);
?>
                </h2>
                <?php 
echo Html::a(Html::img($assetPath . '/images/settings.png', ['alt' => 'Tools']), ['default/settings']);
?>
            </div>
        </div>
    </div>
</div>
Пример #8
0
} else {
    ?>
        <?php 
    echo Html::hiddenInput('url', $model->url);
    ?>
    <?php 
}
?>

    <?php 
echo Html::hiddenInput('id', $model->id);
?>

    <?php 
echo Html::button(Module::t('main', 'Insert'), ['id' => 'insert-btn', 'class' => 'btn btn-primary btn-sm']);
?>

    <?php 
echo Html::submitButton(Module::t('main', 'Save'), ['class' => 'btn btn-success btn-sm']);
?>

    <?php 
if ($message = Yii::$app->session->getFlash('mediafileUpdateResult')) {
    ?>
        <div class="text-success"><?php 
    echo $message;
    ?>
</div>
    <?php 
}
ActiveForm::end();
Пример #9
0
 /**
  * @param Module $module
  * @return array images list
  */
 public function getImagesList(Module $module)
 {
     $thumbs = $this->getThumbs();
     $list = [];
     $originalImageSize = $this->getOriginalImageSize($module->routes);
     $list[$this->url] = Module::t('main', 'Original') . ' ' . $originalImageSize;
     foreach ($thumbs as $alias => $url) {
         $preset = $module->thumbs[$alias];
         $list[$url] = $preset['name'] . ' ' . $preset['size'][0] . ' × ' . $preset['size'][1];
     }
     return $list;
 }
Пример #10
0
<header id="header"><span class="glyphicon glyphicon-picture"></span> <?php 
echo Module::t('main', 'File manager');
?>
</header>

<div id="filemanager" data-url-info="<?php 
echo Url::to(['file/info']);
?>
">

	<?php 
$searchForm = $this->render('_search_form', ['model' => $model]);
?>
    <?php 
echo ListView::widget(['dataProvider' => $dataProvider, 'layout' => $searchForm . '<div class="items">{items}</div>{pager}', 'itemOptions' => ['class' => 'item'], 'itemView' => function ($model, $key, $index, $widget) {
    return Html::a(Html::img($model->getDefaultThumbUrl($this->params['moduleBundle']->baseUrl)) . '<span class="checked glyphicon glyphicon-check"></span>', '#mediafile', ['data-key' => $key]);
}]);
?>

    <div class="dashboard">
        <p><?php 
echo Html::a('<span class="glyphicon glyphicon-upload"></span> ' . Module::t('main', 'Upload manager'), ['file/uploadmanager'], ['class' => 'btn btn-default']);
?>
</p>
        <div id="fileinfo">

        </div>
    </div>
</div>