*
* @return void
*/
- function __construct($group, $indent = true) {
- parent::__construct($indent);
+ 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);
if (DIRECTORY_SEPARATOR !== '/') {
$path = strtr($path, DIRECTORY_SEPARATOR, '/');
}
- $cut = strpos($path, '/plugins/');
- if ($cut) {
- $cut += strlen('/plugins/');
+ $plug = strpos($path, '/plugins/');
+ if ($plug === false) {
+ // We're not in a plugin; return null for the default domain.
+ return null;
+ } else {
+ $cut = $plug + 9;
$cut2 = strpos($path, '/', $cut);
- if ($cut && $cut2) {
- $final = substr($path, $cut, $cut2 - $cut);
+ if ($cut2) {
+ $cached[$path] = substr($path, $cut, $cut2 - $cut);
+ } else {
+ // We might be running directly from the plugins dir?
+ // If so, there's no place to store locale info.
+ return null;
}
}
+ $cached[$path] = $final;
}
return $cached[$path];
}
$this->message(_m('Error connecting user.'));
return;
}
- if ($sreg) {
- if (!oid_update_user($cur, $sreg)) {
- // TRANS: message in case the user or the user profile cannot be saved in StatusNet.
- $this->message(_m('Error updating profile'));
- return;
+ if (Event::handle('StartOpenIDUpdateUser', array($cur, $canonical, &$sreg))) {
+ if ($sreg) {
+ if (!oid_update_user($cur, $sreg)) {
++ // TRANS: message in case the user or the user profile cannot be saved in StatusNet.
+ $this->message(_m('Error updating profile'));
+ return;
+ }
}
}
+ Event::handle('EndOpenIDUpdateUser', array($cur, $canonical, $sreg));
// success!