Пример #1
0
 /**
  * Constructor
  *
  * @param User    $user    the user 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($user, $cur = null, $indent = true)
 {
     parent::__construct($cur, $indent);
     $this->user = $user;
     if (!empty($user)) {
         $profile = $user->getProfile();
         $this->addAuthor($profile->nickname, $user->uri);
         $this->setActivitySubject($profile->asActivityNoun('subject'));
     }
     // TRANS: Title in atom user notice feed. %s is a user name.
     $title = sprintf(_("%s timeline"), $user->nickname);
     $this->setTitle($title);
     $sitename = common_config('site', 'name');
     $subtitle = sprintf(_('Updates from %1$s on %2$s!'), $user->nickname, $sitename);
     $this->setSubtitle($subtitle);
     $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
     $logo = $avatar ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE);
     $this->setLogo($logo);
     $this->setUpdated('now');
     $this->addLink(common_local_url('showstream', array('nickname' => $user->nickname)));
     $self = common_local_url('ApiTimelineUser', array('id' => $user->id, 'format' => 'atom'));
     $this->setId($self);
     $this->setSelfLink($self);
     $this->addLink(common_local_url('sup', null, null, $user->id), array('rel' => 'http://api.friendfeed.com/2008/03#sup', 'type' => 'application/json'));
 }
Пример #2
0
 /**
  * Constructor
  *
  * @param User    $user    the user 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($user, $cur = null, $indent = true)
 {
     parent::__construct($cur, $indent);
     $this->user = $user;
     if (!empty($user)) {
         $profile = $user->getProfile();
         $ao = ActivityObject::fromProfile($profile);
         array_push($ao->extra, $profile->profileInfo($cur));
         // XXX: For users, we generate an author _AND_ an <activity:subject>
         // This is for backward compatibility with clients (especially
         // StatusNet's clients) that assume the Atom will conform to an
         // older version of the Activity Streams API. Subject should be
         // removed in future versions of StatusNet.
         $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'));
     }
     // TRANS: Title in atom user notice feed. %s is a user name.
     $title = sprintf(_("%s timeline"), $user->nickname);
     $this->setTitle($title);
     $sitename = common_config('site', 'name');
     $subtitle = sprintf(_('Updates from %1$s on %2$s!'), $user->nickname, $sitename);
     $this->setSubtitle($subtitle);
     $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
     $logo = $avatar ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE);
     $this->setLogo($logo);
     $this->setUpdated('now');
     $this->addLink(common_local_url('showstream', array('nickname' => $user->nickname)));
     $self = common_local_url('ApiTimelineUser', array('id' => $user->id, 'format' => 'atom'));
     $this->setId($self);
     $this->setSelfLink($self);
     $this->addLink(common_local_url('sup', null, null, $user->id), array('rel' => 'http://api.friendfeed.com/2008/03#sup', 'type' => 'application/json'));
 }
 /**
  * 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());
 }
Пример #4
0
 /**
  * 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());
 }
 /**
  * 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());
 }
 /**
  * Constructor
  *
  * @param List    $list    the list 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($list, $cur = null, $indent = true)
 {
     parent::__construct($cur, $indent);
     $this->list = $list;
     $this->tagger = Profile::getKV('id', $list->tagger);
     // TRANS: Title in atom list notice feed. %1$s is a list name, %2$s is a tagger's nickname.
     $title = sprintf(_('Timeline for people in list %1$s by %2$s'), $list->tag, $this->tagger->nickname);
     $this->setTitle($title);
     $sitename = common_config('site', 'name');
     $subtitle = sprintf(_('Updates from %1$s\'s list %2$s on %3$s!'), $this->tagger->nickname, $list->tag, $sitename);
     $this->setSubtitle($subtitle);
     $avatar = $this->tagger->avatarUrl(AVATAR_PROFILE_SIZE);
     $this->setLogo($avatar);
     $this->setUpdated('now');
     $self = common_local_url('ApiTimelineList', array('user' => $this->tagger->nickname, 'id' => $list->tag, 'format' => 'atom'));
     $this->setId($self);
     $this->setSelfLink($self);
     $ao = ActivityObject::fromPeopletag($this->list);
     $this->addAuthorRaw($ao->asString('author'));
     $this->addLink($this->list->getUri());
 }
 /**
  * Constructor
  *
  * @param User    $user    the user 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($user, $cur = null, $indent = true)
 {
     parent::__construct($cur, $indent);
     $this->user = $user;
     if (!empty($user)) {
         $profile = $user->getProfile();
         $ao = $profile->asActivityObject();
         array_push($ao->extra, $profile->profileInfo($this->scoped));
         $this->addAuthorRaw($ao->asString('author'));
     }
     // TRANS: Title in atom user notice feed. %s is a user name.
     $title = sprintf(_("%s timeline"), $user->nickname);
     $this->setTitle($title);
     $sitename = common_config('site', 'name');
     $subtitle = sprintf(_('Updates from %1$s on %2$s!'), $user->nickname, $sitename);
     $this->setSubtitle($subtitle);
     $this->setLogo($profile->avatarUrl(AVATAR_PROFILE_SIZE));
     $this->setUpdated('now');
     $this->addLink(common_local_url('showstream', array('nickname' => $user->nickname)));
     $self = common_local_url('ApiTimelineUser', array('id' => $user->id, 'format' => 'atom'));
     $this->setId($self);
     $this->setSelfLink($self);
     $this->addLink(common_local_url('sup', null, null, $user->id), array('rel' => 'http://api.friendfeed.com/2008/03#sup', 'type' => 'application/json'));
 }