本文整理匯總了PHP中CommonFunctions::isAdminUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonFunctions::isAdminUser方法的具體用法?PHP CommonFunctions::isAdminUser怎麽用?PHP CommonFunctions::isAdminUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonFunctions
的用法示例。
在下文中一共展示了CommonFunctions::isAdminUser方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
<title><?php
echo CHtml::encode($this->pageTitle);
?>
</title>
</head>
<body>
<?php
// build groups list
$groups = Group::model()->findAll();
$group_menu = array();
foreach ($groups as $key => $value) {
$group_menu[] = array('label' => $value->name, 'url' => array('/site/changeGroup', 'group' => $value->id));
}
$this->widget('bootstrap.widgets.TbNavbar', array('type' => null, 'brand' => Yii::app()->name, 'brandUrl' => Yii::app()->request->baseUrl, 'collapse' => true, 'fixed' => false, 'items' => array(array('class' => 'bootstrap.widgets.TbMenu', 'items' => array(array('label' => 'Matches', 'url' => array('/event/listing'), 'active' => false), array('label' => 'Ranking', 'url' => array('/user/ranking'), 'active' => false), array('label' => 'My Bets', 'url' => array('/betOptionUser/index'), 'active' => false), array('label' => 'Settings', 'url' => '#', 'visible' => CommonFunctions::isAdminUser(Yii::app()->user->name), 'items' => array(array('label' => 'MATCHES'), array('label' => 'Create match', 'url' => array('/event/create')), array('label' => 'Manage matches', 'url' => array('/event/admin')), '---', array('label' => 'USERS'), array('label' => 'Create user', 'url' => array('/user/create')), array('label' => 'Manage users', 'url' => array('/user/admin')), '---', array('label' => 'GROUPS', 'visible' => CommonFunctions::isSuperUser(Yii::app()->user->name)), array('label' => 'Create group', 'url' => array('/group/create'), 'visible' => CommonFunctions::isSuperUser(Yii::app()->user->name)), array('label' => 'Manage groups', 'url' => array('/group/admin'), 'visible' => CommonFunctions::isSuperUser(Yii::app()->user->name)))), array('label' => 'Change Group', 'url' => '#', 'items' => $group_menu), array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest, 'itemOptions' => array('style' => 'right:0;position:fixed;', 'class' => 'facebook')), array('label' => 'Logout (' . Yii::app()->user->name . ')' . '-' . (isset(Yii::app()->user->user) ? User::model()->findByPk(Yii::app()->user->id)->points : ''), 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest, 'itemOptions' => array('id' => 'logout_link', 'style' => 'right:0;position:fixed;', 'class' => 'facebook')))))));
?>
<?php
echo $content;
?>
<div class="clear"></div>
<div id="footer">
Copyright © <?php
echo date('Y');
?>
by Minh Ha.<br/>
All Rights Reserved.<br/>
<?php