当前位置: 首页>>代码示例>>PHP>>正文


PHP RoleModel::GetApplicantCount方法代码示例

本文整理汇总了PHP中RoleModel::GetApplicantCount方法的典型用法代码示例。如果您正苦于以下问题:PHP RoleModel::GetApplicantCount方法的具体用法?PHP RoleModel::GetApplicantCount怎么用?PHP RoleModel::GetApplicantCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RoleModel的用法示例。


在下文中一共展示了RoleModel::GetApplicantCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handleApplicant

 /**
  * Handle a user application.
  *
  * @since 2.0.0
  * @access private
  * @see self::Decline, self::Approve
  * @param string $Action Approve or Decline.
  * @param int $UserID Unique ID.
  */
 private function handleApplicant($Action, $UserID)
 {
     $this->permission('Garden.Users.Approve');
     //$this->_DeliveryType = DELIVERY_TYPE_BOOL;
     if (!in_array($Action, array('Approve', 'Decline')) || !is_numeric($UserID)) {
         $this->Form->addError('ErrorInput');
         $Result = false;
     } else {
         $Session = Gdn::session();
         $UserModel = new UserModel();
         if (is_numeric($UserID)) {
             try {
                 $this->EventArguments['UserID'] = $UserID;
                 $this->fireEvent("Before{$Action}User");
                 $Email = new Gdn_Email();
                 $Result = $UserModel->{$Action}($UserID, $Email);
                 // Re-calculate applicant count
                 $RoleModel = new RoleModel();
                 $RoleModel->GetApplicantCount(true);
                 $this->fireEvent("After{$Action}User");
             } catch (Exception $ex) {
                 $Result = false;
                 $this->Form->addError(strip_tags($ex->getMessage()));
             }
         }
     }
 }
开发者ID:mcnasby,项目名称:datto-vanilla,代码行数:36,代码来源:class.usercontroller.php

示例2: SiteNavModule_default_handler

 /**
  * @param SiteNavModule $sender
  */
 public function SiteNavModule_default_handler($sender)
 {
     if (Gdn::Session()->IsValid()) {
         $sender->addLink('main.profile', array('text' => t('Profile'), 'url' => '/profile', 'icon' => icon('user'), 'sort' => 10));
     }
     $sender->addLink('main.activity', array('text' => t('Activity'), 'url' => '/activity', 'icon' => icon('time'), 'sort' => 10));
     // Add the moderation items.
     $sender->addGroup('moderation', array('text' => t('Moderation'), 'sort' => 90));
     if (Gdn::Session()->CheckPermission('Garden.Users.Approve')) {
         $RoleModel = new RoleModel();
         $applicant_count = (int) $RoleModel->GetApplicantCount();
         if ($applicant_count > 0 || true) {
             $sender->addLink('moderation.applicants', array('text' => t('Applicants'), 'url' => '/user/applicants', 'icon' => icon('user'), 'badge' => countString($applicant_count)));
         }
     }
     if (Gdn::Session()->CheckPermission('Garden.Modertion.Manage')) {
         $sender->addLink('moderation.spam', array('text' => 'Spam Queue', 'url' => '/log/spam', 'icon' => icon('spam')));
         //         $sender->addLink('moderation.queue', array('text' => 'Moderaton Queue', 'url' => '/log/moderation', 'icon' => icon('report')));
     }
     if (Gdn::Session()->CheckPermission('Garden.Settings.Manage')) {
         $sender->addLink('etc.dashboard', array('text' => t('Dashboard'), 'url' => '/settings', 'icon' => icon('dashboard')));
     }
 }
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:26,代码来源:class.hooks.php

示例3: LogModel

$CssClass = '';
if ($this->CssClass) {
    $CssClass .= ' ' . $this->CssClass;
}
$DashboardCount = 0;
// Spam & Moderation Queue
if ($Session->CheckPermission('Garden.Settings.Manage') || $Session->CheckPermission('Garden.Moderation.Manage')) {
    $LogModel = new LogModel();
    $SpamCount = $LogModel->GetOperationCount('spam');
    $ModerationCount = $LogModel->GetOperationCount('moderate');
    $DashboardCount += $SpamCount + $ModerationCount;
}
// Applicant Count
if ($Session->CheckPermission('Garden.Applicants.Manage')) {
    $RoleModel = new RoleModel();
    $ApplicantCount = $RoleModel->GetApplicantCount();
    $DashboardCount += $ApplicantCount;
}
if ($Session->IsValid()) {
    echo '<div class="MeBox' . $CssClass . '">';
    echo UserPhoto($User);
    echo '<div class="WhoIs">';
    echo UserAnchor($User, 'Username');
    echo '<div class="MeMenu">';
    // Notifications
    $CountNotifications = $User->CountNotifications;
    $CNotifications = is_numeric($CountNotifications) && $CountNotifications > 0 ? '<span class="Alert">' . $CountNotifications . '</span>' : '';
    echo '<span class="ToggleFlyout" rel="/profile/notificationspopin">';
    echo Anchor(Sprite('SpNotifications', 'Sprite Sprite16') . Wrap(T('Notifications'), 'em') . $CNotifications, UserUrl($User), 'MeButton FlyoutButton', array('title' => T('Notifications')));
    echo Sprite('SpFlyoutHandle', 'Arrow');
    echo '<div class="Flyout FlyoutMenu"></div></span>';
开发者ID:robhazkes,项目名称:Garden,代码行数:31,代码来源:me.php

示例4: ApplicantCount

 /**
  * Show how many applicants are in the queue.
  *
  * @since 2.0.0
  * @access public
  */
 public function ApplicantCount()
 {
     $this->Permission('Garden.Applicants.Manage');
     $RoleModel = new RoleModel();
     $Count = $RoleModel->GetApplicantCount();
     if ($Count > 0) {
         echo '<span class="Alert">', $Count, '</span>';
     }
 }
开发者ID:rnovino,项目名称:Garden,代码行数:15,代码来源:class.usercontroller.php


注:本文中的RoleModel::GetApplicantCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。