本文整理汇总了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()));
}
}
}
}
示例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')));
}
}
示例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>';
示例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>';
}
}