當前位置: 首頁>>代碼示例>>PHP>>正文


PHP X2Html::defaultAvatar方法代碼示例

本文整理匯總了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 
開發者ID:shuvro35,項目名稱:X2CRM,代碼行數:31,代碼來源:main.php


注:本文中的X2Html::defaultAvatar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。