Ejemplo n.º 1
0
 public function run()
 {
     if (!$this->emailHash) {
         $this->defaultImage = '';
     }
     return parent::run();
 }
Ejemplo n.º 2
0
 /**
  * Renders the image.
  * Based on user settings the avatar can be uploaded image, Gravatar image or default one.
  * @return string
  */
 public function run()
 {
     if ($this->author instanceof User) {
         $avatar = Html::img(Helper::defaultAvatar(), ['class' => 'podium-avatar img-circle img-responsive center-block', 'alt' => Html::encode($this->author->podiumName)]);
         $meta = $this->author->meta;
         if ($meta) {
             if (!empty($meta->gravatar)) {
                 $avatar = Gravatar::widget(['email' => $this->author->email, 'defaultImage' => 'identicon', 'rating' => 'r', 'options' => ['alt' => Html::encode($this->author->podiumName), 'class' => 'podium-avatar img-circle img-responsive center-block']]);
             } elseif (!empty($meta->avatar)) {
                 $avatar = Html::img('/avatars/' . $meta->avatar, ['class' => 'podium-avatar img-circle img-responsive center-block', 'alt' => Html::encode($this->author->podiumName)]);
             }
         }
         $name = $this->showName ? $this->author->podiumTag : '';
     } else {
         $avatar = Html::img(Helper::defaultAvatar(), ['class' => 'podium-avatar img-circle img-responsive center-block', 'alt' => Yii::t('podium/view', 'User deleted')]);
         $name = $this->showName ? Helper::deletedUserTag(true) : '';
     }
     $name = $this->showName ? Html::tag('p', $name, ['class' => 'avatar-name']) : '';
     return $avatar . $name;
 }
Ejemplo n.º 3
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     if (strtolower($this->position) == 'header') {
         if (!Yii::$app->user->isGuest) {
             $user = Yii::$app->user->identity;
             $avatar = \cebe\gravatar\Gravatar::widget(['email' => $user->email, 'options' => ['alt' => '', 'class' => 'avatar', 'width' => 24, 'height' => 24], 'defaultImage' => 'retro', 'size' => 24]);
             $items[] = ['label' => $avatar . Yii::$app->user->identity->username, 'url' => ['/user/default/view', 'id' => Yii::$app->user->id], 'options' => ['class' => 'navbar-nav-profile']];
         }
         if (Yii::$app->user->isGuest) {
             $items[] = ['label' => 'Регистрация', 'url' => ['/user/identity/registration']];
             $items[] = ['label' => 'Вход', 'url' => ['/user/identity/login']];
         } else {
             $items[] = ['label' => 'Выход', 'url' => ['/user/identity/logout']];
         }
         return Menu::widget(['items' => $items, 'encodeLabels' => false, 'options' => ['class' => 'navbar-nav']]);
     } elseif (strtolower($this->position) == 'sub_header') {
         $items[] = ['label' => 'Последние темы', 'url' => ['/topic/default/list']];
         if (!Yii::$app->getUser()->getIsGuest()) {
             $id = Yii::$app->getUser()->getIdentity()->id;
             $notifications = UserMention::countByUser($id);
             if ($notifications > 0) {
                 $items[] = ['label' => 'Уведомления <span class="counter">' . $notifications . '</span>', 'url' => ['/notify/default/view']];
             } else {
                 $items[] = ['label' => 'Уведомления', 'url' => ['/notify/default/view']];
             }
         }
         $items[] = ['label' => 'Пользователи', 'url' => ['/user/default/list']];
         if (!Yii::$app->getUser()->getIsGuest()) {
             $items[] = ['label' => 'Создать тему', 'url' => ['/topic/default/create']];
         }
         return Menu::widget(['items' => $items, 'encodeLabels' => false, 'options' => ['class' => 'sub-navbar-nav']]);
     } elseif (strtolower($this->position) == 'footer') {
         $items = [['label' => 'Правила пользования', 'url' => ['/frontend/default/terms']], ['label' => '&bull;'], ['label' => 'Обратная связь', 'url' => ['/frontend/default/feedback']]];
         return Menu::widget(['encodeLabels' => false, 'items' => $items]);
     }
     return null;
 }
Ejemplo n.º 4
0
<?php

use yii\helpers\Html;
?>

<!-- Sidebar user panel -->
<?php 
if (!\Yii::$app->user->isGuest) {
    ?>
    <div class="user-panel">
        <div class="pull-left image">
            <?php 
    echo \cebe\gravatar\Gravatar::widget(['email' => \Yii::$app->user->identity->email, 'options' => ['alt' => \Yii::$app->user->identity->username], 'size' => 64]);
    ?>
        </div>
        <div class="pull-left info">
            <p><?php 
    echo \Yii::$app->user->identity->username;
    ?>
</p>

            <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
        </div>
    </div>
<?php 
}
?>


<!-- search form -->
<!--<form action="#" method="get" class="sidebar-form">
Ejemplo n.º 5
0
</p>
                    </div>
                    <p class="reply">Reply</p>
                </article>
                    <?php 
        foreach ($post->comments as $childComment) {
            ?>
                        <?php 
            if (!empty($childComment->parentComment) && $childComment->parentComment->id == $comment->id) {
                ?>
                <ul class="children">
                    <li class="comment">
                        <article class="media">
                            <a class="pull-left" href="#">
                                <?php 
                echo \cebe\gravatar\Gravatar::widget(['email' => $comment->email, 'options' => ['alt' => $comment->name, 'class' => 'media-object'], 'size' => 87]);
                ?>
                            </a>
                            <div class="media-body">
                                <h5 class="media-heading"><?php 
                echo $comment->name;
                ?>
</h5>
                                <p class="comment-date"><?php 
                echo date('F j, Y \\a\\t g:i a', strtotime($comment->created_at));
                ?>
</p>
                                <p><?php 
                echo kartik\markdown\Markdown::convert($comment->body);
                ?>
</p>
Ejemplo n.º 6
0
<?php

use app\models\User;
use cebe\gravatar\Gravatar;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', ['label' => 'Gravatar', 'attribute' => 'email', 'value' => function (User $user) {
    return Gravatar::widget(['email' => $user->email, 'size' => 32]);
}, 'format' => 'raw'], 'email:email', 'created_at:datetime', 'updated_at:datetime', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Ejemplo n.º 7
0
    /**
     * @param     $comment
     * @param int $depth
     *
     * @throws \Exception
     */
    protected function displayComment($comment, $depth = 0)
    {
        echo Html::beginTag('div', ['id' => 'comment-' . $comment->id, 'class' => $comment->child ? 'parent depth-' . $depth : 'depth-' . $depth]);
        ?>

        <?php 
        if (Option::get('show_avatars')) {
            ?>
            <div class="media-left avatar">
                <?php 
            echo Gravatar::widget(['email' => $comment->comment_author_email, 'options' => ['alt' => $comment->comment_author, 'class' => 'avatar', 'width' => $this->avatarSize, 'height' => $this->avatarSize], 'defaultImage' => Option::get('avatar_default'), 'rating' => Option::get('avatar_rating'), 'size' => $this->avatarSize]);
            ?>
            </div>
        <?php 
        }
        ?>
        <div class="media-body comment-body">
            <p class="meta">
                <strong class="author vcard">
                    <span class="fn">
                        <?php 
        echo $comment->comment_author ? $comment->comment_author : \Yii::t('writesdown', 'Anonymous');
        ?>
                    </span>
                </strong>
                -
                <time class="date published" datetime="<?php 
        echo \Yii::$app->formatter->asDatetime($comment->comment_date);
        ?>
">
                    <?php 
        echo \Yii::$app->formatter->asDate($comment->comment_date);
        ?>
                </time>
                <?php 
        if ($depth < $this->maxDepth && $this->enableThreadComments) {
            echo Html::a(\Yii::t('writesdown', 'Reply'), '#', ['class' => 'comment-reply-link', 'data-id' => $comment->id]);
        }
        ?>
            </p>
            <div class="comment-content">
                <?php 
        echo $comment->comment_content;
        ?>
            </div>
        </div>
        <?php 
        echo Html::endTag('div');
    }
Ejemplo n.º 8
0
    ?>
</strong>
                    </div>
                </div>
            </div>
<?php 
}
?>
        </div>
    </div>
    <div class="col-sm-3">
<?php 
if (!empty($model->meta->gravatar)) {
    ?>
        <?php 
    echo Gravatar::widget(['email' => PodiumModule::getInstance()->userComponent == PodiumModule::USER_OWN ? $model->email : $model->getEmail(), 'defaultImage' => 'identicon', 'rating' => 'r', 'options' => ['alt' => Yii::t('podium/view', 'Your Gravatar image'), 'class' => 'img-circle img-responsive']]);
} elseif (!empty($model->meta->avatar)) {
    ?>
        <img class="img-circle img-responsive" src="/avatars/<?php 
    echo $model->meta->avatar;
    ?>
" alt="<?php 
    echo Yii::t('podium/view', 'Your avatar');
    ?>
">
<?php 
} else {
    ?>
        <img class="img-circle img-responsive" src="<?php 
    echo Helper::defaultAvatar();
    ?>
 /**
  * @inheritdoc
  */
 protected function buildImgTag()
 {
     return Gravatar::widget($this->gravatarOptions);
 }
Ejemplo n.º 10
0
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a class="text-center" href="#">
                            <strong>See All Alerts</strong>
                            <i class="fa fa-angle-right"></i>
                        </a>
                    </li>
                </ul>
                <!-- /.dropdown-alerts -->
            </li>
            <!-- /.dropdown -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <?php 
echo Gravatar::widget(['email' => Yii::$app->user->identity->email, 'size' => 16]);
?>
  <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-user">
                    <li>
                        <p class="navbar-text">
                            <?php 
echo Yii::$app->user->identity->email;
?>
                        </p>
                    </li>
                    <li class="divider"></li>
                    <li><?php 
echo Html::a('<i class="fa fa-user fa-fw"></i> ' . Yii::t('app', 'User Profile'), ['/profile/index']);
?>
Ejemplo n.º 11
0
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
    <div class="col-sm-3">
        <?php 
echo $this->render('/elements/profile/_navbar', ['active' => 'profile']);
?>
    </div>
    <div class="col-sm-9">
        <div class="panel panel-default">
            <div class="panel-body">
<?php 
if (!empty($model->meta->gravatar)) {
    ?>
                <?php 
    echo Gravatar::widget(['email' => $model->email, 'defaultImage' => 'identicon', 'rating' => 'r', 'options' => ['alt' => Html::encode($model->podiumName), 'class' => 'podium-avatar img-circle img-responsive pull-right']]);
} elseif (!empty($model->meta->avatar)) {
    ?>
                <img class="podium-avatar img-circle img-responsive pull-right" src="/avatars/<?php 
    echo $model->meta->avatar;
    ?>
" alt="<?php 
    echo Html::encode($model->podiumName);
    ?>
">
<?php 
} else {
    ?>
                <img class="podium-avatar img-circle img-responsive pull-right" src="<?php 
    echo Helper::defaultAvatar();
    ?>
Ejemplo n.º 12
0
<!-- Sidebar user panel -->
<?php 
if (!\Yii::$app->user->isGuest) {
    ?>
    <div class="user-panel">
        <div class="pull-left image">
            <?php 
    echo \cebe\gravatar\Gravatar::widget(['email' => \Yii::$app->user->identity->profile->gravatar_email === null ? \Yii::$app->user->identity->email : \Yii::$app->user->identity->profile->gravatar_email, 'options' => ['alt' => \Yii::$app->user->identity->username], 'size' => 64]);
    ?>
        </div>
        <div class="pull-left info">
            <p><?php 
    echo \Yii::$app->user->identity->username;
    ?>
</p>

            <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
        </div>
    </div>
<?php 
}
?>


<!-- search form -->
<!--<form action="#" method="get" class="sidebar-form">
    <div class="input-group">
        <input type="text" name="q" class="form-control" placeholder="Search..."/>
        <span class="input-group-btn">
            <button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>
Ejemplo n.º 13
0
">
                                <time is="time-ago" datetime="<?php 
    echo Yii::$app->formatter->asDatetime($topic->first_post_created_at, 'php:c');
    ?>
" title="<?php 
    echo Yii::$app->formatter->asDatetime($topic->first_post_created_at, 'long');
    ?>
"><?php 
    echo $dateTimeAgo->get($topic->first_post_created_at);
    ?>
</time>
                            </a>
                        </div>
                        <div class="question-author-avatar">
                            <?php 
    echo \cebe\gravatar\Gravatar::widget(['email' => $topic->firstPostUser->email, 'options' => ['alt' => $topic->firstPostUser->username, 'class' => 'avatar', 'width' => 32, 'height' => 32], 'defaultImage' => 'retro', 'size' => 32]);
    ?>
                        </div>
                        <div class="question-author-info">
                            <a href="<?php 
    echo Url::toRoute(['/user/default/view', 'id' => $topic->first_post_user_id]);
    ?>
"><?php 
    echo $formatter->asText($topic->first_post_username);
    ?>
</a>
                        </div>
                    </div>
                </div>
            </div>
            <?php 
Ejemplo n.º 14
0
<div class="component-comments lang-en" id="comments">
    <?php 
if (!empty($comments)) {
    ?>
        <ol>
        <?php 
    foreach ($comments as $comment) {
        ?>
            <li class="row">
                <div class="col-xs-1 author" id="c<?php 
        echo $comment->id;
        ?>
">
                    <?php 
        echo \cebe\gravatar\Gravatar::widget(['email' => $comment->user->email, 'options' => ['alt' => $comment->user->username], 'size' => 32]);
        ?>
                    <?php 
        echo Html::encode($comment->user->username);
        ?>
                </div>
                <div class="col-xs-8 text">
                    <?php 
        echo \yii\helpers\Markdown::process($comment->text);
        ?>
                </div>
                <div class="col-xs-3">
                    <a href="#c<?php 
        echo $comment->id;
        ?>
">#<?php 
Ejemplo n.º 15
0
            </h3>

            <p>
                <?php 
echo '<span class="label label-default">' . implode("</span><br/><span class='label label-default'>", $version->keywords) . '</span><br/>';
?>
            </p>
            <?php 
// TODO: WE CANNOT REMOVE isset(), fires error if not defined.
if (isset($model->authors)) {
    ?>
                <h5>Maintainers</h5>
                <?php 
    foreach ($model->authors as $author) {
        echo "<p>";
        if (isset($author->email)) {
            echo Html::a(Gravatar::widget(['email' => $author->email, 'options' => ['alt' => isset($author->name) ? $author->name : ''], 'size' => 32]), isset($author->homepage) ? $author->homepage : '#');
        }
        echo " " . (isset($author->name) ? $author->name : '');
        echo "</p>";
    }
    ?>
            <?php 
}
?>
        </div>
    </div>

    <!-- Modals -->
<?php 
echo $this->render('_modals', ['name' => $model->name]);
Ejemplo n.º 16
0
        echo Html::beginTag('li', ['class' => $answer['is_answer'] ? 'out' : 'in', 'id' => 'answer-' . $answer['answer_id']]);
        ?>
                        <?php 
        if ($answer['author'] == 'anonym') {
            ?>
                            <?php 
            $answer['email'] = $model->anonym_email;
            ?>
                        <?php 
        }
        ?>
                        <?php 
        if (isset($answer['email']) && filter_var($answer['email'], FILTER_VALIDATE_EMAIL)) {
            ?>
                            <?php 
            echo Gravatar::widget(['email' => $answer['email'], 'defaultImage' => 'identicon', 'options' => ['alt' => $answer['author'], 'class' => 'avatar'], 'size' => 45]);
            ?>
                        <?php 
        }
        ?>

                        <div class="message">
                            <span class="arrow"></span>

                            <div class="info">
                                <?php 
        echo Html::a($answer['author'], ['@client/view', 'id' => $answer['author_id']], ['class' => 'name']);
        ?>
&nbsp;
                                <?php 
        echo Html::tag('span', Yii::$app->formatter->asDatetime($answer['create_time']), ['class' => 'datetime']);
Ejemplo n.º 17
0
                        <li class="user-header">
                            <?php 
if ($userIdentity->userProfile->avatar != '') {
    ?>
                                <img class="img-circle" src="<?php 
    echo $userIdentity->userProfile->getThumbUploadUrl('avatar');
    ?>
" alt="<?php 
    echo Yii::t('app', 'Avatar image for {username}', ['username' => $userIdentity->username]);
    ?>
">
                            <?php 
} else {
    ?>
                            <?php 
    echo \cebe\gravatar\Gravatar::widget(['email' => $userIdentity->email, 'size' => 160, 'options' => ['alt' => Yii::t('app', 'Avatar image for {username}', ['username' => $userIdentity->username]), 'class' => 'img-circle']]);
    ?>
                            <?php 
}
?>
                            <p>
                                <?php 
echo $userIdentity->publicIdentity;
?>
 - <?php 
echo $userIdentity->username;
?>
                                <small><?php 
echo Yii::t('app', 'Joined in {datetime}', ['datetime' => Yii::$app->formatter->asDatetime($userIdentity->created_at)]);
?>
</small>
Ejemplo n.º 18
0
echo Yii::t('podium/view', 'Posts');
?>
 <span class="badge"><?php 
echo $model->getPostsCount();
?>
</span></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="col-sm-3">
<?php 
if (!empty($model->meta->gravatar)) {
    ?>
        <?php 
    echo Gravatar::widget(['email' => $model->getEmail(), 'defaultImage' => 'identicon', 'rating' => 'r', 'options' => ['alt' => Yii::t('podium/view', 'Your Gravatar image'), 'class' => 'img-circle img-responsive']]);
} elseif (!empty($model->meta->avatar)) {
    ?>
        <img class="img-circle img-responsive" src="/avatars/<?php 
    echo $model->meta->avatar;
    ?>
" alt="<?php 
    echo Yii::t('podium/view', 'Your avatar');
    ?>
">
<?php 
} else {
    ?>
        <img class="img-circle img-responsive" src="<?php 
    echo Helper::defaultAvatar();
    ?>
Ejemplo n.º 19
0
<?php

use cebe\gravatar\Gravatar;
use yii\helpers\Url;
/* @var \app\components\View $this */
/* @var \user\models\User $user */
$this->title = $user->username;
$this->params['page'] = 'login';
$formatter = Yii::$app->formatter;
?>
<div class="page-profile">
    <div class="vcard">
        <div class="profile-avatar">
        <?php 
echo Gravatar::widget(['email' => $user->email, 'options' => ['alt' => $user->username, 'class' => 'avatar', 'width' => 250, 'height' => 250], 'defaultImage' => 'retro', 'size' => 250]);
?>
        </div>
        <?php 
if (Yii::$app->getUser()->can('updateProfile', ['user' => $user])) {
    ?>
            <?php 
    if (Yii::$app->getUser()->getIdentity()->getId() == $user->id) {
        ?>
            <a class="btn profile-edit-btn" href="<?php 
        echo Url::toRoute(['/user/settings/profile']);
        ?>
"><span class="octicon octicon-pencil"></span> Редактировать профиль</a>
            <?php 
    } else {
        ?>
            <a class="btn profile-edit-btn" href="<?php 
Ejemplo n.º 20
0
                </div>
           <div class="tab-pane vertical-pad" id="photo">

             <?php 
echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png']]]);
?>
           </div> <!-- end of upload photo tab -->
           <div class="form-group">
               <?php 
echo Html::submitButton(Yii::t('frontend', 'Save Settings'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
           </div>
         </div> <!-- end tab content -->
         </div> <!--end left col -->
         <div class="col-md-4">
           <?php 
if ($model->avatar != '') {
    echo '<img src="' . Yii::getAlias('@web') . '/uploads/avatar/sqr_' . $model->avatar . '" class="profile-image"/>';
} else {
    echo \cebe\gravatar\Gravatar::widget(['email' => common\models\User::find()->where(['id' => Yii::$app->user->getId()])->one()->email, 'options' => ['class' => 'profile-image', 'alt' => common\models\User::find()->where(['id' => Yii::$app->user->getId()])->one()->username], 'size' => 128]);
}
?>
           
           
         </div> <!--end rt col -->
    <?php 
ActiveForm::end();
?>

</div>
Ejemplo n.º 21
0
echo Yii::t('admin', 'Live edit');
?>
</span>
    </div>

    <div class="user-menu">
        <a href="#"><?php 
echo $userIdentity->username;
?>
</a>
        <div class="sub-wrapper">
            <ul class="submenu">
                <li>
                    <a href="#">
                        <?php 
echo \cebe\gravatar\Gravatar::widget(['email' => $userIdentity->email, 'size' => 64, 'options' => ['alt' => Yii::t('admin', 'Avatar image for {username}', ['username' => $userIdentity->username]), 'class' => 'avatar']]);
?>
                        <span class="full-name">
                            <?php 
echo $userIdentity->publicIdentity;
?>
                            (<small class="username"><?php 
echo $userIdentity->username;
?>
</small>)
                        </span>
                    </a>
                </li>
                <li>
                    <a href="<?php 
echo Url::to(['/user/default/logout']);
Ejemplo n.º 22
0
<?php

/*
 * AdminLte Theme for hiqdev/yii2-thememanager
 *
 * @link      https://github.com/hiqdev/yii2-theme-adminlte
 * @package   yii2-theme-adminlte
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
 */
use cebe\gravatar\Gravatar;
if (empty($email) && isset(Yii::$app->user->identity->email)) {
    $email = Yii::$app->user->identity->email;
}
echo Gravatar::widget(['email' => $email, 'defaultImage' => 'identicon', 'options' => ['alt' => isset($alt) ? $alt : Yii::$app->user->identity->username, 'class' => !isset($class) ? 'img-circle' : $class], 'size' => !isset($size) ? 25 : $size]);
?>
 installs<br/>
                <span class="label label-warning">This month</span> <?php 
echo $model->downloads->monthly;
?>
 downloads<br/>
                <span class="label label-warning">Today</span> <?php 
echo $model->downloads->daily;
?>
 downloads<br/>
            </p>


            <h5>Maintainers</h5>
            <?php 
foreach ($model->maintainers as $author) {
    echo "<p>";
    if ($author->email) {
        echo Html::a(Gravatar::widget(['email' => $author->email, 'defaultImage' => 'monsterid', 'options' => ['alt' => isset($author->name) ? $author->name : ''], 'size' => 32]), $author->homepage ? $author->homepage : '#');
    }
    echo " " . ($author->name ? $author->name : '');
    echo "</p>";
}
?>
        </div>
    </div>


    <!-- Modal -->
<?php 
echo $this->render('_modals', ['name' => $model->name]);
Ejemplo n.º 24
0
 public function init()
 {
     parent::init();
     $this->options['alt'] = $this->alt;
     $this->options = array_merge($this->defaultOptions, (array) $this->options);
 }
Ejemplo n.º 25
0
                            <?php 
echo Yii::t('writesdown', '{userCount} Members', ['userCount' => $userCount]);
?>
                        </span>
                        <button data-widget="collapse" class="btn btn-box-tool"><i class="fa fa-minus"></i></button>
                        <button data-widget="remove" class="btn btn-box-tool"><i class="fa fa-times"></i></button>
                    </div>
                </div>
                <div class="box-body no-padding">
                    <ul class="users-list clearfix">
                        <?php 
foreach ($users as $user) {
    ?>
                            <li>
                                <?php 
    echo Gravatar::widget(['email' => $user->email, 'options' => ['alt' => $user->username], 'size' => 128]);
    ?>
                                <?php 
    echo Html::a($user->display_name, $user->url, ['class' => 'users-list-name']);
    ?>
                                <?php 
    echo Html::tag('span', Yii::$app->formatter->asDate($user->created_at), ['class' => 'users-list-date']);
    ?>
                            </li>
                        <?php 
}
?>
                    </ul>
                </div>
            </div>
        </div>
Ejemplo n.º 26
0
if (!Yii::$app->user->isGuest) {
    ?>
                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <?php 
    echo Gravatar::widget(['email' => Yii::$app->user->identity->email, 'options' => ['alt' => Yii::$app->user->identity->username, 'class' => 'user-image'], 'size' => 25]);
    ?>
                            <span class="hidden-xs"><?php 
    echo Yii::$app->user->identity->username;
    ?>
</span>
                        </a>
                        <ul class="dropdown-menu">
                            <li class="user-header">
                                <?php 
    echo Gravatar::widget(['email' => Yii::$app->user->identity->email, 'options' => ['alt' => Yii::$app->user->identity->username, 'class' => 'img-circle'], 'size' => 84]);
    ?>
                                <p>
                                    <?php 
    echo Yii::$app->user->identity->username;
    ?>
                                    <small><?php 
    echo Yii::t('writesdown', 'Member since {date}', ['date' => Yii::$app->formatter->asDate(Yii::$app->user->identity->created_at, 'php:F d, Y')]);
    ?>
</small>
                                </p>
                            </li>
                            <li class="user-footer">
                                <div class="pull-left">
                                    <?php 
    echo Html::a(Yii::t('writesdown', 'Profile'), ['/user/profile'], ['class' => 'btn btn-default btn-flat']);
Ejemplo n.º 27
0
echo Yii::$app->name;
?>
                </small>
            </a>
        </div>

        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">
                <li class="light-blue">

                    <?php 
if (Yii::$app->user && !Yii::$app->user->isGuest) {
    ?>
                        <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                            <?php 
    echo Gravatar::widget(['email' => Yii::$app->user->identity->email, 'options' => ['class' => 'nav-user-photo', 'alt' => Yii::$app->user->identity->username], 'size' => 40]);
    ?>
                            <span class="user-info">
								<small>Welcome,</small> <?php 
    echo Yii::$app->user->identity->username;
    ?>
    						</span>
                            <i class="ace-icon fa fa-caret-down"></i>

                        </a>
                        <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                            <li>
                                <a href="<?php 
    echo \yii\helpers\Url::to(['/user/settings/profile']);
    ?>
"><i class="ace-icon fa fa-user"></i> Profile</a>