Example #1
0
        <div class="ew-navigation main-nav">
            <?php 
$noticeLabel = Yii::t('app', "提醒");
$messageLabel = Yii::t('app', "私信");
if (!Yii::app()->user->isGuest) {
    $me = UserInfo::model()->with('unisCheckedMessageCount', 'unisCheckedNoticeCount')->findByPk(Yii::app()->user->id);
    if (!empty($me) && $me->unisCheckedNoticeCount > 0 && !(Yii::app()->controller->id == "notice")) {
        $noticeLabel .= '&nbsp;<span class="badge alert-danger">' . $me->unisCheckedNoticeCount . '</span>';
    }
    $noticeLabel = '<span class="dxd-notice">' . $noticeLabel . '</span>';
    if (!empty($me) && $me->unisCheckedMessageCount > 0 && !(Yii::app()->controller->id == "message")) {
        $messageLabel .= '&nbsp;<span class="badge alert-danger">' . $me->unisCheckedMessageCount . '</span>';
    }
} else {
}
$items = Nav::getTopItems();
?>
            <?php 
$this->widget('booster.widgets.TbNavbar', array('brand' => 'EduWind', 'fixed' => false, 'htmlOptions' => array('style' => 'margin-bottom:0;', 'class' => ''), 'items' => array(array('class' => 'booster.widgets.TbMenu', 'type' => 'navbar', 'encodeLabel' => false, 'items' => $items, 'htmlOptions' => array('class' => '')), array('class' => 'booster.widgets.TbMenu', 'htmlOptions' => array('class' => 'pull-right launchpad hidden-xs'), 'type' => 'navbar', 'items' => array(array('url' => array('//notice/index'), 'visible' => !Yii::app()->user->isGuest, 'label' => $noticeLabel, 'active' => $this->activeMenu == 'notice', 'class' => 'dxd-notice-link', 'htmlOptions' => array('class' => 'dxd-notice-link')), array('url' => array('//message/index'), 'visible' => !Yii::app()->user->isGuest, 'label' => $messageLabel, 'active' => $this->activeMenu == 'message'), array('label' => isset(Yii::app()->user->displayName) ? Yii::app()->user->displayName : "", 'url' => '#', 'visible' => !Yii::app()->user->isGuest, 'items' => array(array('label' => Yii::t('app', '我的课程'), 'url' => array('//course/me'), 'active' => false), array('label' => Yii::t('app', '设置'), 'url' => array('//me/setBasic')), '---', array('label' => Yii::t('app', '退出'), 'url' => array('//u/logout'), 'htmlOptions' => array('class' => 'dxd-logout-link')))), array('label' => Yii::t('app', '后台管理'), 'url' => Yii::app()->user->checkAccess('admin') ? array('//admin') : "", 'visible' => Yii::app()->user->checkAccess('admin'), 'visible' => Yii::app()->user->checkAccess('admin')), array('label' => Yii::t('app', '注册'), 'url' => array('//u/register'), 'visible' => Yii::app()->user->isGuest), array('label' => Yii::t('app', '登陆'), 'url' => array('//u/login'), 'visible' => Yii::app()->user->isGuest)), 'encodeLabel' => false))));
?>
        </div>
    </div>


    <!-- Flash 通知信息 -->
    <?php 
$this->renderPartial('//layouts/_flash_messages');
?>

    <?php 
if (Yii::app()->controller->id == "site" && Yii::app()->controller->action->id == "index") {