本文整理汇总了PHP中Messages::getCountUnread方法的典型用法代码示例。如果您正苦于以下问题:PHP Messages::getCountUnread方法的具体用法?PHP Messages::getCountUnread怎么用?PHP Messages::getCountUnread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Messages
的用法示例。
在下文中一共展示了Messages::getCountUnread方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$countReviewsPending = Reviews::getCountModeration();
$bageReviews = $countReviewsPending > 0 ? " <span class=\"badge\">{$countReviewsPending}</span>" : '';
}
$bageVacancy = '';
if (issetModule('vacancy')) {
$countVacancyPending = Vacancy::getCountModeration();
$bageVacancy = $countVacancyPending > 0 ? " <span class=\"badge\">{$countVacancyPending}</span>" : '';
}
$bageBooking = '';
if (issetModule('bookingtable')) {
$countNewPending = Bookingtable::getCountNew();
$bageBooking = $countNewPending > 0 ? " <span class=\"badge\">{$countNewPending}</span>" : '';
}
$bageMessages = '';
if (issetModule('messages')) {
$countMessagesUnread = Messages::getCountUnread(Yii::app()->user->id);
$bageMessages = $countMessagesUnread > 0 ? " <span class=\"badge\">{$countMessagesUnread}</span>" : '';
}
?>
<div class="bootnavbar-delimiter"></div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span3">
<div class="well sidebar-nav">
<?php
$this->widget('bootstrap.widgets.TbMenu', array('type' => 'list', 'encodeLabel' => false, 'items' => array(array('label' => tc('Listings'), 'visible' => Yii::app()->user->checkAccess('apartments_admin') || Yii::app()->user->checkAccess('comments_admin') || Yii::app()->user->checkAccess('apartmentsComplain_admin')), array('label' => tc('Listings') . $bageListings, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/apartments/backend/main/admin', 'active' => isActive('apartments'), 'visible' => Yii::app()->user->checkAccess('apartments_admin')), array('label' => tc('List your property'), 'icon' => 'icon-plus-sign', 'url' => $baseUrl . '/apartments/backend/main/create', 'active' => isActive('apartments.create'), 'visible' => Yii::app()->user->checkAccess('apartments_admin')), array('label' => tc('Comments') . $bageComments, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/comments/backend/main/admin', 'active' => isActive('comments'), 'visible' => Yii::app()->user->checkAccess('comments_admin')), array('label' => tc('Complains') . $bageComplain, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/apartmentsComplain/backend/main/admin', 'active' => isActive('apartmentsComplain'), 'visible' => issetModule('apartmentsComplain') && Yii::app()->user->checkAccess('apartmentsComplain_admin')), array('label' => tt('Booking apartment', 'booking') . $bageBooking, 'icon' => 'icon-file', 'url' => $baseUrl . '/bookingtable/backend/main/admin', 'active' => isActive('bookingtable'), 'visible' => issetModule('bookingtable') && Yii::app()->user->checkAccess('bookingtable_admin')), array('label' => tc('Users'), 'visible' => Yii::app()->user->checkAccess('users_admin')), array('label' => tc('Users'), 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/users/backend/main/admin', 'active' => isActive('users'), 'visible' => Yii::app()->user->checkAccess('users_admin')), array('label' => tt('Reviews', 'reviews'), 'visible' => Yii::app()->user->checkAccess('reviews_admin')), array('label' => tt('Reviews_management', 'reviews') . $bageReviews, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/reviews/backend/main/admin', 'active' => isActive('reviews'), 'visible' => Yii::app()->user->checkAccess('reviews_admin')), array('label' => tt('Add_feedback', 'reviews'), 'icon' => 'icon-plus-sign', 'url' => $baseUrl . '/reviews/backend/main/create', 'active' => isActive('reviews.create'), 'visible' => Yii::app()->user->checkAccess('reviews_admin')), array('label' => tt('Vacancy', 'vacancy'), 'visible' => Yii::app()->user->checkAccess('vacancy_admin')), array('label' => tt('Vacancy_management', 'vacancy') . $bageVacancy, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/vacancy/backend/main/admin', 'active' => isActive('vacancy'), 'visible' => Yii::app()->user->checkAccess('vacancy_admin')), array('label' => tt('Add_feedback', 'vacancy'), 'icon' => 'icon-plus-sign', 'url' => $baseUrl . '/vacancy/backend/main/create', 'active' => isActive('vacancy.create'), 'visible' => Yii::app()->user->checkAccess('vacancy_admin')), array('label' => tt('Clients', 'clients'), 'visible' => Yii::app()->user->checkAccess('clients_admin')), array('label' => tt('Clients', 'clients'), 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/clients/backend/main/admin', 'active' => isActive('clients'), 'visible' => Yii::app()->user->checkAccess('clients_admin')), array('label' => tc('Content'), 'visible' => Yii::app()->user->checkAccess('news_admin') || Yii::app()->user->checkAccess('articles_admin') || Yii::app()->user->checkAccess('menumanager_admin')), array('label' => tc('News'), 'icon' => 'icon-file', 'url' => $baseUrl . '/news/backend/main/admin', 'active' => isActive('news'), 'visible' => Yii::app()->user->checkAccess('news_admin')), array('label' => tc('Blog'), 'icon' => 'icon-file', 'url' => $baseUrl . '/blog/backend/main/admin', 'active' => isActive('blog'), 'visible' => Yii::app()->user->checkAccess('blog_admin')), array('label' => tc('Q&As'), 'icon' => 'icon-file', 'url' => $baseUrl . '/articles/backend/main/admin', 'active' => isActive('articles'), 'visible' => Yii::app()->user->checkAccess('articles_admin')), array('label' => tc('Top menu items'), 'icon' => 'icon-file', 'url' => $baseUrl . '/menumanager/backend/main/admin', 'active' => isActive('menumanager'), 'visible' => Yii::app()->user->checkAccess('menumanager_admin')), array('label' => tc('Info pages'), 'icon' => 'icon-file', 'url' => $baseUrl . '/infopages/backend/main/admin', 'active' => isActive('infopages'), 'visible' => Yii::app()->user->checkAccess('infopages_admin')), array('label' => tt('Messages', 'messages'), 'visible' => issetModule('messages') && Yii::app()->user->checkAccess('messages_admin')), array('label' => tt('Messages', 'messages') . $bageMessages, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/messages/backend/main/admin', 'active' => isActive('messages') || isActive('messages.read'), 'visible' => issetModule('messages') && Yii::app()->user->checkAccess('messages_admin')), array('label' => tt('Mailing messages', 'messages'), 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/messages/backend/mailing/admin', 'active' => isActive('messages.mailing'), 'visible' => issetModule('messages') && Yii::app()->user->checkAccess('messages_admin')), array('label' => tc('Payments'), 'visible' => issetModule('payment') && (Yii::app()->user->checkAccess('payment_admin') || Yii::app()->user->checkAccess('paidservices_admin'))), array('label' => tc('Tariff Plans'), 'icon' => 'icon-shopping-cart', 'url' => $baseUrl . '/tariffPlans/backend/main/admin', 'active' => isActive('tariffPlans'), 'visible' => issetModule('tariffPlans') && issetModule('paidservices') && Yii::app()->user->checkAccess('tariff_plans_admin')), array('label' => tc('Paid services'), 'icon' => 'icon-shopping-cart', 'url' => $baseUrl . '/paidservices/backend/main/admin', 'active' => isActive('paidservices'), 'visible' => issetModule('payment') && Yii::app()->user->checkAccess('paidservices_admin')), array('label' => tc('Manage payments') . $bagePayments, 'icon' => 'icon-shopping-cart', 'url' => $baseUrl . '/payment/backend/main/admin', 'active' => isActive('payment'), 'visible' => issetModule('payment') && Yii::app()->user->checkAccess('payment_admin')), array('label' => tc('Payment systems'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/payment/backend/paysystem/admin', 'active' => isActive('payment.paysystem'), 'visible' => issetModule('payment') && Yii::app()->user->checkAccess('payment_admin')), array('label' => tc('References'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Categories of references'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/referencecategories/backend/main/admin', 'active' => isActive('referencecategories'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Values of references'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/referencevalues/backend/main/admin', 'active' => isActive('referencevalues'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Reference "View:"'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/windowto/backend/main/admin', 'active' => isActive('windowto'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Reference "Check-in"'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/timesin/backend/main/admin', 'active' => isActive('timesin'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Reference "Check-out"'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/timesout/backend/main/admin', 'active' => isActive('timesout'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Reference "Property types"'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/apartmentObjType/backend/main/admin', 'active' => isActive('apartmentObjType'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Reference "City/Cities"'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/apartmentCity/backend/main/admin', 'active' => isActive('apartmentCity'), 'visible' => !issetModule('location') && Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Blockip'), 'visible' => Yii::app()->user->checkAccess('blockip_admin')), array('label' => tc('Blockip'), 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/blockIp/backend/main/admin', 'active' => isActive('blockIp'), 'visible' => Yii::app()->user->checkAccess('blockip_admin')), array('label' => tc('Settings'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Settings'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/configuration/backend/main/admin', 'active' => isActive('configuration'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Manage modules'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/modules/backend/main/admin', 'active' => isActive('modules'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Images'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/images/backend/main/index', 'active' => isActive('images'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Change admin password'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/adminpass/backend/main/index', 'active' => isActive('adminpass'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Site service '), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/service/backend/main/admin', 'active' => isActive('service'), 'visible' => issetModule('service'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Authentication services'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/socialauth/backend/main/admin', 'active' => isActive('socialauth'), 'visible' => issetModule('socialauth'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Manage themes'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/themes/backend/main/admin', 'active' => isActive('themes'), 'visible' => issetModule('themes'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Languages and currency'), 'visible' => Yii::app()->user->checkAccess('all_lang_and_currency_admin')), array('label' => tc('Languages'), 'icon' => 'icon-globe', 'url' => $baseUrl . '/lang/backend/main/admin', 'active' => isActive('lang'), 'visible' => !isFree() && Yii::app()->user->checkAccess('all_lang_and_currency_admin')), array('label' => tc('Translations'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/translateMessage/backend/main/admin', 'active' => isActive('translateMessage'), 'visible' => Yii::app()->user->checkAccess('all_lang_and_currency_admin')), array('label' => tc('Currencies'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/currency/backend/main/admin', 'active' => isActive('currency'), 'visible' => issetModule('currency') && Yii::app()->user->checkAccess('all_lang_and_currency_admin')), array('label' => tc('Modules'), 'visible' => Yii::app()->user->checkAccess('all_modules_admin') && (issetModule('notifier') || issetModule('slider') || issetModule('advertising') || issetModule('iecsv') || issetModule('formdesigner') || issetModule('socialposting'))), array('label' => tc('Mail editor'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/notifier/backend/main/admin', 'active' => isActive('notifier'), 'visible' => issetModule('notifier') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tc('Slide-show on the Home page'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/slider/backend/main/admin', 'active' => isActive('slider'), 'visible' => issetModule('slider') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tc('Import / Export'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/iecsv/backend/main/admin', 'active' => isActive('iecsv'), 'visible' => issetModule('iecsv') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tc('Advertising banners'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/advertising/backend/advert/admin', 'active' => isActive('advertising'), 'visible' => issetModule('advertising') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tc('The forms designer'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/formdesigner/backend/main/admin', 'active' => isActive('formdesigner') || isActive('formeditor'), 'visible' => issetModule('formdesigner') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tt('Services of automatic posting', 'socialposting'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/socialposting/backend/main/admin', 'active' => isActive('socialposting'), 'visible' => issetModule('socialposting') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tc('Location module'), 'visible' => issetModule('location') && Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Countries'), 'icon' => 'icon-globe', 'url' => $baseUrl . '/location/backend/country/admin', 'visible' => issetModule('location') && Yii::app()->user->checkAccess('all_reference_admin'), 'active' => isActive('location.country')), array('label' => tc('Regions'), 'icon' => 'icon-globe', 'url' => $baseUrl . '/location/backend/region/admin', 'visible' => issetModule('location') && Yii::app()->user->checkAccess('all_reference_admin'), 'active' => isActive('location.region')), array('label' => tc('Cities'), 'icon' => 'icon-globe', 'url' => $baseUrl . '/location/backend/city/admin', 'visible' => issetModule('location') && Yii::app()->user->checkAccess('all_reference_admin'), 'active' => isActive('location.city')))));
?>
</div>
<!--/.well -->
</div>
示例2: getMenu
public static function getMenu()
{
$user = HUser::getModel();
if (param('useUserads')) {
$menu[] = array('label' => tc('My listings'), 'url' => Yii::app()->createUrl('/usercpanel/main/index'), 'active' => Yii::app()->controller->menuIsActive('my_listings'));
$menu[] = array('label' => tc('Add ad', 'apartments'), 'url' => Yii::app()->createUrl('/userads/main/create'), 'active' => Yii::app()->controller->menuIsActive('add_ad'));
}
if ($user->type == User::TYPE_AGENCY) {
$countAwaitAgent = HUser::getCountAwaitingAgent($user->id);
$bage = $countAwaitAgent ? ' (' . $countAwaitAgent . ')' : '';
$menu[] = array('label' => tt('My agents', 'usercpanel') . $bage, 'url' => Yii::app()->createUrl('/usercpanel/main/agents'), 'active' => Yii::app()->controller->menuIsActive('my_agents'));
}
if (issetModule('messages')) {
$bageMessages = '';
$countMessagesUnread = Messages::getCountUnread(Yii::app()->user->id);
$bageMessages = $countMessagesUnread > 0 ? " ({$countMessagesUnread})" : '';
$menu[] = array('label' => tt('My mailbox', 'messages') . $bageMessages, 'url' => Yii::app()->createUrl('/messages/main/index'), 'active' => Yii::app()->controller->menuIsActive('my_mailbox'));
if ($countMessagesUnread > 0) {
Yii::app()->clientScript->registerScript('init-cnt-unr-messages', '
message("' . Yii::t('module_messages', 'You have {n} unread messages', $countMessagesUnread) . '", "message", 4000);
', CClientScript::POS_READY);
}
}
$menu[] = array('label' => tc('My data'), 'url' => Yii::app()->createUrl('/usercpanel/main/data'), 'active' => Yii::app()->controller->menuIsActive('my_data'));
$menu[] = array('label' => tt('Change your password', 'usercpanel'), 'url' => Yii::app()->createUrl('/usercpanel/main/changepassword'), 'active' => Yii::app()->controller->menuIsActive('my_changepassword'));
if (issetModule('payment')) {
if (issetModule('tariffPlans')) {
$menu[] = array('label' => tc('Tariff Plans'), 'url' => Yii::app()->createUrl('/tariffPlans/main/index'), 'active' => Yii::app()->controller->menuIsActive('tariff_plans'));
}
$menu[] = array('label' => tt('My payments', 'usercpanel'), 'url' => Yii::app()->createUrl('/usercpanel/main/payments'), 'active' => Yii::app()->controller->menuIsActive('my_payments'));
$menu[] = array('label' => tc('My balance') . ' (' . $user->balance . ' ' . Currency::getDefaultCurrencyName() . ')', 'url' => Yii::app()->createUrl('/usercpanel/main/balance'), 'active' => Yii::app()->controller->menuIsActive('my_balance'));
}
if (issetModule('bookingtable')) {
$menu[] = array('label' => tt('Booking applications', 'usercpanel') . ' (' . Bookingtable::getCountNew(true) . ')', 'url' => Yii::app()->createUrl('/bookingtable/main/index'), 'active' => Yii::app()->controller->menuIsActive('booking_applications'));
}
return $menu;
}