本文整理汇总了PHP中User_group::defaultLogo方法的典型用法代码示例。如果您正苦于以下问题:PHP User_group::defaultLogo方法的具体用法?PHP User_group::defaultLogo怎么用?PHP User_group::defaultLogo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User_group
的用法示例。
在下文中一共展示了User_group::defaultLogo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param Group $group the group for the feed
* @param User $cur the current authenticated user, if any
* @param boolean $indent flag to turn indenting on or off
*
* @return void
*/
function __construct($group, $cur = null, $indent = true)
{
parent::__construct($cur, $indent);
$this->group = $group;
// TRANS: Title in atom group notice feed. %s is a group name.
$title = sprintf(_("%s timeline"), $group->nickname);
$this->setTitle($title);
$sitename = common_config('site', 'name');
$subtitle = sprintf(_('Updates from %1$s on %2$s!'), $group->nickname, $sitename);
$this->setSubtitle($subtitle);
$avatar = $group->homepage_logo;
$logo = $avatar ? $avatar : User_group::defaultLogo(AVATAR_PROFILE_SIZE);
$this->setLogo($logo);
$this->setUpdated('now');
$self = common_local_url('ApiTimelineGroup', array('id' => $group->id, 'format' => 'atom'));
$this->setId($self);
$this->setSelfLink($self);
// For groups, we generate an author _AND_ an <activity:subject>
// Versions of StatusNet under 0.9.7 treat <author> as a person
// XXX: remove this workaround in future versions
$ao = ActivityObject::fromGroup($group);
$this->addAuthorRaw($ao->asString('author'));
$depMsg = 'Deprecation warning: activity:subject is present ' . 'only for backward compatibility. It will be ' . 'removed in the next version of StatusNet.';
$this->addAuthorRaw("<!--{$depMsg}-->\n" . $ao->asString('activity:subject'));
$this->addLink($group->homeUrl());
}
示例2: showGroup
function showGroup()
{
$this->out->elementStart('li', array('class' => 'profile h-card', 'id' => 'group-' . $this->group->id));
$user = common_current_user();
$this->out->elementStart('div', 'entity_profile');
$logo = $this->group->stream_logo ?: User_group::defaultLogo(AVATAR_STREAM_SIZE);
$this->out->elementStart('a', array('href' => $this->group->homeUrl(), 'class' => 'u-url p-nickname', 'rel' => 'contact group'));
$this->out->element('img', array('src' => $logo, 'class' => 'avatar u-photo', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => $this->group->getBestName()));
$this->out->text($this->group->getNickname());
$this->out->elementEnd('a');
if ($this->group->fullname) {
$this->out->text(' ');
$this->out->elementStart('span', 'p-name');
$this->out->raw($this->highlight($this->group->fullname));
$this->out->elementEnd('span');
}
if ($this->group->location) {
$this->out->text(' ');
$this->out->elementStart('span', 'label');
$this->out->raw($this->highlight($this->group->location));
$this->out->elementEnd('span');
}
if ($this->group->homepage) {
$this->out->text(' ');
$this->out->elementStart('a', array('href' => $this->group->homepage, 'class' => 'u-url'));
$this->out->raw($this->highlight($this->group->homepage));
$this->out->elementEnd('a');
}
if ($this->group->description) {
$this->out->elementStart('p', 'note');
$this->out->raw($this->highlight($this->group->description));
$this->out->elementEnd('p');
}
// If we're on a list with an owner (subscriptions or subscribers)...
if (!empty($user) && !empty($this->owner) && $user->id == $this->owner->id) {
$this->showOwnerControls();
}
$this->out->elementEnd('div');
if ($user) {
$this->out->elementStart('div', 'entity_actions');
$this->out->elementStart('ul');
$this->out->elementStart('li', 'entity_subscribe');
// XXX: special-case for user looking at own
// subscriptions page
if ($user->isMember($this->group)) {
$lf = new LeaveForm($this->out, $this->group);
$lf->show();
} else {
if (!Group_block::isBlocked($this->group, $user->getProfile())) {
$jf = new JoinForm($this->out, $this->group);
$jf->show();
}
}
$this->out->elementEnd('li');
$this->out->elementEnd('ul');
$this->out->elementEnd('div');
}
$this->out->elementEnd('li');
}
示例3: showGroup
function showGroup()
{
$this->out->elementStart('li', 'h-card');
$this->out->elementStart('a', array('title' => $this->group->getBestName(), 'href' => $this->group->homeUrl(), 'rel' => 'contact group', 'class' => 'p-name u-url org'));
$logo = $this->group->mini_logo ? $this->group->mini_logo : User_group::defaultLogo(AVATAR_MINI_SIZE);
$this->out->element('img', array('src' => $logo, 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar photo', 'alt' => $this->group->getBestName()));
$this->out->elementEnd('a');
$this->out->elementEnd('li');
}
示例4: showGroup
function showGroup()
{
$this->out->elementStart('li', 'vcard');
$this->out->elementStart('a', array('title' => $this->group->fullname ? $this->group->fullname : $this->group->nickname, 'href' => $this->group->homeUrl(), 'rel' => 'contact group', 'class' => 'url'));
$logo = $this->group->mini_logo ? $this->group->mini_logo : User_group::defaultLogo(AVATAR_MINI_SIZE);
$this->out->element('img', array('src' => $logo, 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar photo', 'alt' => $this->group->fullname ? $this->group->fullname : $this->group->nickname));
$this->out->element('span', 'fn org nickname', $this->group->nickname);
$this->out->elementEnd('a');
$this->out->elementEnd('li');
}
示例5: fromFilename
static function fromFilename($filename, $size)
{
$alink = new AvatarLink();
$alink->url = $filename;
$alink->height = $size;
$alink->width = $size;
if (!empty($filename)) {
$alink->type = self::mediatype($filename);
} else {
$alink->url = User_group::defaultLogo($size);
$alink->type = 'image/png';
}
return $alink;
}
示例6: showGroup
function showGroup($group)
{
$this->out->elementStart('tr');
$this->out->elementStart('td');
$this->out->elementStart('a', array('title' => $group->getBestName(), 'href' => $group->homeUrl(), 'rel' => 'contact group', 'class' => 'h-card org nickname'));
$logo = $group->stream_logo ?: User_group::defaultLogo(AVATAR_STREAM_SIZE);
$this->out->element('img', array('src' => $logo, 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar u-photo', 'alt' => $group->getBestName()));
$this->out->text($group->nickname);
$this->out->elementEnd('a');
$this->out->elementEnd('td');
if ($group->value) {
$this->out->element('td', 'value', $group->value);
}
$this->out->elementEnd('tr');
}
示例7: showGroup
function showGroup($group)
{
$this->out->elementStart('tr');
$this->out->elementStart('td');
$this->out->elementStart('span', 'vcard');
$this->out->elementStart('a', array('title' => $group->fullname ? $group->fullname : $group->nickname, 'href' => $group->homeUrl(), 'rel' => 'contact group', 'class' => 'url'));
$logo = $group->stream_logo ? $group->stream_logo : User_group::defaultLogo(AVATAR_STREAM_SIZE);
$this->out->element('img', array('src' => $logo, 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar photo', 'alt' => $group->fullname ? $group->fullname : $group->nickname));
$this->out->element('span', 'fn org nickname', $group->nickname);
$this->out->elementEnd('a');
$this->out->elementEnd('span');
$this->out->elementEnd('td');
if ($group->value) {
$this->out->element('td', 'value', $group->value);
}
$this->out->elementEnd('tr');
}
示例8: __construct
/**
* Constructor
*
* @param Group $group the group for the feed
* @param boolean $indent flag to turn indenting on or off
*
* @return void
*/
function __construct($group, $indent = true)
{
parent::__construct($indent);
$this->group = $group;
$title = sprintf(_("%s timeline"), $group->nickname);
$this->setTitle($title);
$sitename = common_config('site', 'name');
$subtitle = sprintf(_('Updates from %1$s on %2$s!'), $group->nickname, $sitename);
$this->setSubtitle($subtitle);
$avatar = $group->homepage_logo;
$logo = $avatar ? $avatar : User_group::defaultLogo(AVATAR_PROFILE_SIZE);
$this->setLogo($logo);
$this->setUpdated('now');
$self = common_local_url('ApiTimelineGroup', array('id' => $group->id, 'format' => 'atom'));
$this->setId($self);
$this->setSelfLink($self);
$this->addAuthorRaw($group->asAtomAuthor());
$this->setActivitySubject($group->asActivitySubject());
$this->addLink($group->homeUrl());
}
示例9: __construct
/**
* Constructor
*
* @param Group $group the group for the feed
* @param User $cur the current authenticated user, if any
* @param boolean $indent flag to turn indenting on or off
*
* @return void
*/
function __construct($group, $cur = null, $indent = true)
{
parent::__construct($cur, $indent);
$this->group = $group;
// TRANS: Title in atom group notice feed. %s is a group name.
$title = sprintf(_("%s timeline"), $group->nickname);
$this->setTitle($title);
$sitename = common_config('site', 'name');
$subtitle = sprintf(_('Updates from %1$s on %2$s!'), $group->nickname, $sitename);
$this->setSubtitle($subtitle);
$avatar = $group->homepage_logo;
$logo = $avatar ? $avatar : User_group::defaultLogo(AVATAR_PROFILE_SIZE);
$this->setLogo($logo);
$this->setUpdated('now');
$self = common_local_url('ApiTimelineGroup', array('id' => $group->id, 'format' => 'atom'));
$this->setId($self);
$this->setSelfLink($self);
$ao = ActivityObject::fromGroup($group);
$this->addAuthorRaw($ao->asString('author'));
$this->addLink($group->homeUrl());
}
示例10: getAvatar
function getAvatar()
{
return empty($this->homepage_logo) ? User_group::defaultLogo(AVATAR_PROFILE_SIZE) : $this->homepage_logo;
}
示例11: handle
protected function handle()
{
parent::handle();
$results = array();
foreach ($this->profiles as $profile) {
$avatarUrl = $profile->avatarUrl(AVATAR_MINI_SIZE);
$results[] = array('value' => '@' . $profile->nickname, 'nickname' => $profile->nickname, 'label' => $profile->getFancyName(), 'avatar' => $avatarUrl, 'type' => 'user');
}
foreach ($this->groups as $group) {
// sigh.... encapsulate this upstream!
if ($group->mini_logo) {
$avatarUrl = $group->mini_logo;
} else {
$avatarUrl = User_group::defaultLogo(AVATAR_MINI_SIZE);
}
$results[] = array('value' => '!' . $group->nickname, 'nickname' => $group->nickname, 'label' => $group->getFancyName(), 'avatar' => $avatarUrl, 'type' => 'group');
}
print json_encode($results);
}
示例12: handle
function handle($args)
{
parent::handle($args);
$results = array();
foreach ($this->users as $user) {
$profile = $user->getProfile();
$avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
// sigh.... encapsulate this upstream!
if ($avatar) {
$avatar = $avatar->displayUrl();
} else {
$avatar = Avatar::defaultImage(AVATAR_MINI_SIZE);
}
$results[] = array('nickname' => $user->nickname, 'fullname' => $profile->fullname, 'avatar' => $avatar, 'type' => 'user');
}
foreach ($this->groups as $group) {
// sigh.... encapsulate this upstream!
if ($group->mini_logo) {
$avatar = $group->mini_logo;
} else {
$avatar = User_group::defaultLogo(AVATAR_MINI_SIZE);
}
$results[] = array('nickname' => $group->nickname, 'fullname' => $group->fullname, 'avatar' => $avatar, 'type' => 'group');
}
foreach ($results as $result) {
print json_encode($result) . "\n";
}
}
示例13: showAvatar
function showAvatar()
{
$logo = $this->profile->stream_logo ? $this->profile->stream_logo : User_group::defaultLogo(AVATAR_STREAM_SIZE);
$this->out->elementStart('a', array('href' => $this->profile->homeUrl(), 'class' => 'url entry-title', 'rel' => 'contact group'));
$this->out->element('img', array('src' => $logo, 'class' => 'photo avatar', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => $this->profile->fullname ? $this->profile->fullname : $this->profile->nickname));
$this->out->text(' ');
$hasFN = $this->profile->fullname ? 'nickname' : 'fn org nickname';
$this->out->elementStart('span', $hasFN);
$this->out->raw($this->highlight($this->profile->nickname));
$this->out->elementEnd('span');
$this->out->elementEnd('a');
}
示例14: handle
protected function handle()
{
parent::handle();
$results = array();
foreach ($this->profiles as $profile) {
$avatarUrl = $profile->avatarUrl(AVATAR_MINI_SIZE);
$acct = $profile->getAcctUri();
$identifier = explode(':', $profile->getAcctUri(), 2)[1];
$results[] = array('value' => '@' . $identifier, 'nickname' => $profile->getNickname(), 'acct_uri' => $acct, 'label' => "{$identifier} (" . $profile->getFullname() . ")", 'avatar' => $avatarUrl, 'type' => 'user');
}
foreach ($this->groups as $group) {
$profile = $group->getProfile();
// sigh.... encapsulate this upstream!
if ($group->mini_logo) {
$avatarUrl = $group->mini_logo;
} else {
$avatarUrl = User_group::defaultLogo(AVATAR_MINI_SIZE);
}
$acct = $profile->getAcctUri();
$identifier = explode(':', $profile->getAcctUri(), 2)[1];
$results[] = array('value' => '!' . $group->getNickname(), 'nickname' => $group->getNickname(), 'acct_uri' => $acct, 'label' => "{$identifier} (" . $group->getFullname() . ")", 'avatar' => $avatarUrl, 'type' => 'group');
}
print json_encode($results);
}
示例15: showAvatar
function showAvatar(Profile $profile, $size = null)
{
$logo = $profile->getGroup()->stream_logo ?: User_group::defaultLogo($size ?: $this->avatarSize());
$this->out->element('img', array('src' => $logo, 'class' => 'avatar u-photo', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => $profile->getBestName()));
}