本文整理汇总了PHP中X2Html::defaultAvatar方法的典型用法代码示例。如果您正苦于以下问题:PHP X2Html::defaultAvatar方法的具体用法?PHP X2Html::defaultAvatar怎么用?PHP X2Html::defaultAvatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类X2Html
的用法示例。
在下文中一共展示了X2Html::defaultAvatar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$logoSize = @getimagesize(Yii::app()->params->logo);
if($logoSize)
$logoSize = array(min($logoSize[0], 200), min($logoSize[1], 30));
else
$logoSize = array(92, 30);
$logoOptions['width'] = $logoSize[0];
$logoOptions['height'] = $logoSize[1];
}*/
/* Construction of the user menu */
$notifCount = X2Model::model('Notification')->countByAttributes(array('user' => Yii::app()->user->getName()), 'createDate < ' . time());
$searchbarHtml = CHtml::beginForm(array('/search/search'), 'get') . '<button class="x2-button black" type="submit"><span></span></button>' . CHtml::textField('term', Yii::t('app', 'Search for contact, action, deal...'), array('id' => 'search-bar-box', 'onfocus' => 'x2.forms.toggleTextResponsive(this);', 'onblur' => 'x2.forms.toggleTextResponsive(this);', 'data-short-default-text' => Yii::t('app', 'Search'), 'data-long-default-text' => Yii::t('app', 'Search for contact, action, deal...'), 'autocomplete' => 'off')) . '</form>';
if (!empty($profile->avatar) && file_exists($profile->avatar)) {
$avatar = Profile::renderAvatarImage($profile->id, 25, 25);
} else {
$avatar = X2Html::defaultAvatar(25);
}
$widgetsImageUrl = $themeUrl . '/images/admin_settings.png';
if (!Yii::app()->user->isGuest) {
$widgetMenu = $profile->getWidgetMenu();
} else {
$widgetMenu = "";
}
$userMenu = array(array('label' => Yii::t('app', 'Admin'), 'url' => array('/admin/index'), 'active' => $module == 'admin' ? true : null, 'visible' => $isAdmin, 'itemOptions' => array('id' => 'admin-user-menu-link', 'class' => 'user-menu-link ' . ($isAdmin ? 'x2-first' : ''))), array('label' => Yii::t('app', 'Profile'), 'url' => array('/profile/view', 'id' => Yii::app()->user->getId()), 'itemOptions' => array('id' => 'profile-user-menu-link', 'class' => 'user-menu-link ' . ($isAdmin ? '' : 'x2-first'))), array('label' => Yii::t('app', 'Users'), 'url' => array('/users/users/admin'), 'visible' => $isAdmin, 'itemOptions' => array('id' => 'admin-users-user-menu-link', 'class' => 'user-menu-link')), array('label' => Yii::t('app', 'Users'), 'url' => array('/profile/profiles'), 'visible' => !$isAdmin, 'itemOptions' => array('id' => 'non-admin-users-user-menu-link', 'class' => 'user-menu-link')), array('label' => $searchbarHtml, 'itemOptions' => array('id' => 'search-bar', 'class' => 'special')));
$userMenuItems = array(array('label' => Yii::t('app', 'Profile'), 'url' => array('/profile/view', 'id' => Yii::app()->user->getId())), array('label' => Yii::t('app', 'Notifications'), 'url' => array('/site/viewNotifications')), array('label' => Yii::t('app', 'Preferences'), 'url' => array('/profile/settings')), array('label' => Yii::t('profile', 'Manage Apps'), 'url' => array('/profile/manageCredentials')), array('label' => Yii::t('help', 'Icon Reference'), 'url' => array('/site/page', 'view' => 'iconreference')), array('label' => Yii::t('help', 'Help'), 'url' => 'http://www.x2crm.com/reference_guide', 'linkOptions' => array('target' => '_blank')), array('label' => Yii::t('app', 'Report A Bug'), 'url' => array('/site/bugReport')), array('label' => Yii::t('app', '---'), 'itemOptions' => array('class' => 'divider')), array('label' => Yii::app()->params->sessionStatus ? Yii::t('app', 'Go Invisible') : Yii::t('app', 'Go Visible'), 'url' => '#', 'linkOptions' => array('submit' => array('/site/toggleVisibility', 'visible' => !Yii::app()->params->sessionStatus, 'redirect' => Yii::app()->request->requestUri), 'csrf' => true, 'confirm' => 'Are you sure you want to toggle your session status?')), array('label' => Yii::t('app', 'Logout'), 'url' => array('/site/logout')));
if (!$isGuest) {
$userMenu2 = array(array('label' => CHtml::link('<span>' . $notifCount . '</span>', '#', array('id' => 'main-menu-notif', 'style' => 'z-index:999;')), 'itemOptions' => array('class' => 'special')), array('label' => CHtml::link('<i class="fa fa-lg fa-toggle-right"></i>', '#', array('class' => 'x2-button', 'id' => 'fullscreen-button', 'title' => Yii::t('app', 'toggle widgets'))), 'itemOptions' => array('class' => 'search-bar special')), array('label' => CHtml::link('<div class="widget-icon"><i class="fa fa-lg fa-cog"></i></div>', '#', array('id' => 'widget-button', 'class' => 'x2-button', 'title' => 'hidden widgets')) . $widgetMenu, 'itemOptions' => array('class' => 'search-bar special')), array('label' => $avatar . Yii::app()->suModel->alias, 'itemOptions' => array('id' => 'profile-dropdown', 'class' => 'dropdown'), 'items' => $userMenuItems));
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php