コード例 #1
0
ファイル: profile.php プロジェクト: baranov-nt/setyes
/* @var $image common\models\ImagesOfObject */
/* @var $modelUser common\models\User */
/* @var $form ActiveForm */
?>
<div class="container">
    <div class="main-profile">
        <div class="row">
            <div class="col-md-6 col-md-offset-3">
                <div class="form-group">
                    <b>
                        <?php 
echo Yii::t('app', 'Language of the application');
?>
                    </b>
                    <?php 
echo \common\widgets\LanguageSelect\LanguageSelect::widget();
?>
                </div>
            </div>
            <div class="col-md-6 col-md-offset-3">
                <?php 
echo ImageLoadWidget::widget(['modelName' => 'UserProfile', 'id' => 'load-avatar', 'object_id' => $modelUserProfile->user_id, 'imagesObject' => $modelUserProfile->imagesOfObjects, 'images_num' => $modelUserProfile->images_num, 'images_label' => $modelUserProfile->images_label, 'images_temp' => 0, 'imageSmallWidth' => 150, 'imageSmallHeight' => 150, 'headerModal' => 'Загрузить аватар', 'sizeModal' => 'modal-md', 'baseUrl' => '/images/', 'imagePath' => 'avatars/users/' . Yii::$app->user->id . '/', 'noImage' => 'avatars/noavatar.png', 'classesWidget' => ['imageClass' => 'imageAvatar', 'buttonDeleteClass' => 'btn btn-xs btn-danger btn-imageDeleteAvatar glyphicon glyphicon-trash glyphicon', 'imageContainerClass' => 'imageContainerAvatar', 'formImagesContainerClass' => 'formImageContainerAvatar'], 'pluginOptions' => ['aspectRatio' => 1 / 1, 'strict' => true, 'guides' => true, 'center' => true, 'autoCrop' => true, 'autoCropArea' => 0.5, 'dragCrop' => true, 'movable' => true, 'rotatable' => true, 'scalable' => true, 'zoomable' => true, 'preview' => '.img-preview'], 'cropBoxData' => ['left' => 10, 'top' => 10], 'canvasData' => []]);
?>
            </div>
        </div>
        <div class="row">

            <div class="col-md-6 col-md-offset-3">
                <?php 
/*echo PjaxFieldWidget::widget([
      'route' => '/main/user',
コード例 #2
0
ファイル: basic.php プロジェクト: baranov-nt/setyes
    <body>
    <?php 
$this->beginBody();
?>

    <div class="wrap">
        <?php 
NavBar::begin(['options' => ['class' => 'navbar navbar-default', 'style' => 'padding: 0; margin: 0', 'id' => 'main-menu'], 'renderInnerContainer' => true, 'innerContainerOptions' => ['class' => 'container'], 'brandLabel' => Yii::$app->name, 'brandUrl' => ['/ad/view/all'], 'brandOptions' => ['class' => 'navbar-brand']]);
if (Yii::$app->user->can('Администратор')) {
    $menuItems = [['label' => Yii::t('app', 'Rules') . ' <span class="glyphicon glyphicon-question-sign"></span>', 'url' => ['#'], 'linkOptions' => ['data-toggle' => 'modal', 'data-target' => '#modal']], ['label' => Yii::t('app', 'My ads'), 'url' => Url::to(['/ad/view/my']), 'linkOptions' => []], ['label' => Yii::t('app', 'Favorites'), 'url' => Url::to(['/ad/view/favorites']), 'linkOptions' => []], ['label' => Yii::t('app', 'Post ad'), 'url' => Url::to(['/ad/default/index']), 'linkOptions' => []]];
}
if (Yii::$app->user->isGuest) {
    ?>
            <div class="navbar-nav navbar-right nav">
                <?php 
    echo LanguageSelect::widget(['container' => ['style' => 'margin: 12px 0 0 15px']]);
    ?>
            </div>
            <?php 
}
if (!Yii::$app->user->isGuest) {
    $user = Yii::$app->user->identity;
    /* @var $user common\models\User */
    if ($user->userProfile->imagesOfObjects) {
        foreach ($user->userProfile->imagesOfObjects as $one) {
            /* @var $one common\models\ImagesOfObject */
            $image = Html::img('/images/' . $one->image->path_small_image, ['style' => 'width: 35px; border: 2px solid #ffffff; border-radius: 3px;']);
        }
    } else {
        $image = '<span class="btn btn-default glyphicon glyphicon-user" style=""></span>';
    }