本文整理汇总了PHP中User_group::getBestName方法的典型用法代码示例。如果您正苦于以下问题:PHP User_group::getBestName方法的具体用法?PHP User_group::getBestName怎么用?PHP User_group::getBestName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User_group
的用法示例。
在下文中一共展示了User_group::getBestName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mail_notify_group_join_pending
/**
* Send notification emails to group administrator.
*
* @param User_group $group
* @param Profile $joiner
*/
function mail_notify_group_join_pending($group, $joiner)
{
$admin = $group->getAdmins();
while ($admin->fetch()) {
// We need a local user for email notifications...
$adminUser = User::staticGet('id', $admin->id);
// @fixme check for email preference?
if ($adminUser && $adminUser->email) {
// use the recipient's localization
common_switch_locale($adminUser->language);
$headers = _mail_prepare_headers('join', $admin->nickname, $joiner->nickname);
$headers['From'] = mail_notify_from();
$headers['To'] = $admin->getBestName() . ' <' . $adminUser->email . '>';
// TRANS: Subject of pending group join request notification e-mail.
// TRANS: %1$s is the joining user's nickname, %2$s is the group name, and %3$s is the StatusNet sitename.
$headers['Subject'] = sprintf(_('%1$s wants to join your group %2$s on %3$s.'), $joiner->getBestName(), $group->getBestName(), common_config('site', 'name'));
// TRANS: Main body of pending group join request notification e-mail.
// TRANS: %1$s is the subscriber's long name, %2$s is the group name, and %3$s is the StatusNet sitename,
// TRANS: %4$s is the URL to the moderation queue page.
$body = sprintf(_('%1$s would like to join your group %2$s on %3$s. ' . 'You may approve or reject their group membership at %4$s'), $joiner->getFancyName(), $group->getFancyName(), common_config('site', 'name'), common_local_url('groupqueue', array('nickname' => $group->nickname))) . mail_profile_block($joiner) . mail_footer_block();
// reset localization
common_switch_locale();
mail_send($adminUser->email, $headers, $body);
}
}
}
示例2: fromGroup
static function fromGroup(User_group $group)
{
$object = new ActivityObject();
if (Event::handle('StartActivityObjectFromGroup', array($group, &$object))) {
$object->type = ActivityObject::GROUP;
$object->id = $group->getUri();
$object->title = $group->getBestName();
$object->link = $group->getUri();
$object->avatarLinks[] = AvatarLink::fromFilename($group->homepage_logo, AVATAR_PROFILE_SIZE);
$object->avatarLinks[] = AvatarLink::fromFilename($group->stream_logo, AVATAR_STREAM_SIZE);
$object->avatarLinks[] = AvatarLink::fromFilename($group->mini_logo, AVATAR_MINI_SIZE);
$object->poco = PoCo::fromGroup($group);
Event::handle('EndActivityObjectFromGroup', array($group, &$object));
}
return $object;
}
示例3: fromGroup
static function fromGroup(User_group $group)
{
$poco = new PoCo();
$poco->preferredUsername = $group->nickname;
$poco->displayName = $group->getBestName();
$poco->note = $group->description;
$paddy = new PoCoAddress();
$paddy->formatted = $group->location;
$poco->address = $paddy;
if (!empty($group->homepage)) {
array_push($poco->urls, new PoCoURL('homepage', $group->homepage, true));
}
return $poco;
}