EndShowInvitationSuccess: After showing invitations success msg
- $action: invitation action
+StartUpgrade: when starting a site upgrade
+
+EndUpgrade: when ending a site upgrade; good place to do your own upgrades
+
README
------
-StatusNet 1.0.0beta3
-27 August 2011
+StatusNet 1.0.0beta4
+16 September 2011
This is the README file for StatusNet, the Open Source social
networking platform. It includes installation instructions,
$this->script('xbImportNode.js');
$this->script('geometa.js');
}
- $this->inlineScript('var _peopletagAC = "' .
- common_local_url('peopletagautocomplete') . '";');
+ // This route isn't available in single-user mode.
+ // Not sure why, but it causes errors here.
+ if (!common_config('singleuser', 'enabled')) {
+ $this->inlineScript('var _peopletagAC = "' .
+ common_local_url('peopletagautocomplete') . '";');
+ }
$this->showScriptMessages();
// Anti-framing code to avoid clickjacking attacks in older browsers.
// This will show a blank page if the page is being framed, which is
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
define('STATUSNET_BASE_VERSION', '1.0.0');
-define('STATUSNET_LIFECYCLE', 'beta3'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
+define('STATUSNET_LIFECYCLE', 'beta4'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
define('STATUSNET_VERSION', STATUSNET_BASE_VERSION . STATUSNET_LIFECYCLE);
define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility
*/
function mail_send($recipients, $headers, $body)
{
- // XXX: use Mail_Queue... maybe
- $backend = mail_backend();
- if (!isset($headers['Content-Type'])) {
- $headers['Content-Type'] = 'text/plain; charset=UTF-8';
- }
- assert($backend); // throws an error if it's bad
- $sent = $backend->send($recipients, $headers, $body);
- if (PEAR::isError($sent)) {
- common_log(LOG_ERR, 'Email error: ' . $sent->getMessage());
+ try {
+ // XXX: use Mail_Queue... maybe
+ $backend = mail_backend();
+
+ if (!isset($headers['Content-Type'])) {
+ $headers['Content-Type'] = 'text/plain; charset=UTF-8';
+ }
+
+ assert($backend); // throws an error if it's bad
+ $sent = $backend->send($recipients, $headers, $body);
+ return true;
+ } catch (PEAR_Exception $e) {
+ common_log(
+ LOG_ERR,
+ "Unable to send email - '{$e->getMessage()}'. "
+ . 'Is your mail subsystem set up correctly?'
+ );
return false;
}
- return true;
}
/**
$this->action->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartPublicGroupNav', array($this))) {
- // TRANS: Menu item in search group navigation panel.
- $this->out->menuItem(common_local_url('public'), _m('MENU','Public'),
- // TRANS: Menu item title in search group navigation panel.
- _('Public timeline'), $this->actionName == 'public', 'nav_timeline_public');
+ if (!common_config('singleuser', 'enabled')) {
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('public'), _m('MENU','Public'),
+ // TRANS: Menu item title in search group navigation panel.
+ _('Public timeline'), $this->actionName == 'public', 'nav_timeline_public');
+ }
// TRANS: Menu item in search group navigation panel.
$this->out->menuItem(common_local_url('groups'), _m('MENU','Groups'),
_('Featured users'), $this->actionName == 'featured', 'nav_featured');
}
- // TRANS: Menu item in search group navigation panel.
- $this->out->menuItem(common_local_url('favorited'), _m('MENU','Popular'),
- // TRANS: Menu item title in search group navigation panel.
- _('Popular notices'), $this->actionName == 'favorited', 'nav_timeline_favorited');
+ if (!common_config('singleuser', 'enabled')) {
+ // TRANS: Menu item in search group navigation panel.
+ $this->out->menuItem(common_local_url('favorited'), _m('MENU','Popular'),
+ // TRANS: Menu item title in search group navigation panel.
+ _('Popular notices'), $this->actionName == 'favorited', 'nav_timeline_favorited');
+ }
Event::handle('EndPublicGroupNav', array($this));
}
* Copyright (C) 2011, StatusNet, Inc.
*
* URL mapper
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
* Converts a path into a set of parameters, and vice versa
*
* We used to use Net_URL_Mapper, so there's a wrapper class at Router, q.v.
- *
+ *
* NUM's vagaries are the main reason we have weirdnesses here.
*
* @category URL
protected $statics = array();
protected $variables = array();
protected $reverse = array();
+ protected $allpaths = array();
function connect($path, $args, $paramPatterns=array())
{
throw new Exception(sprintf("Can't connect %s; path has no action.", $path));
}
+ $allpaths[] = $path;
+
$action = $args[self::ACTION];
$paramNames = $this->getParamNames($path);
return $results;
}
}
-
+
throw new Exception(sprintf('No match for path "%s"', $path));
}
$path = vsprintf($format, $toFormat);
}
- if (!empty($qstring)) {
+ if (!empty($qstring)) {
$formatted = http_build_query($qstring);
$path .= '?' . $formatted;
}
return $format;
}
+
+ public function getPaths()
+ {
+ return $this->allpaths;
+ }
}
class PatternReplacer
// TRANS: Application title.
return _m('TITLE','Bookmark');
}
+
+ function onEndUpgrade()
+ {
+ // Version 0.9.x of the plugin didn't stamp notices
+ // with verb and object-type (for obvious reasons). Update
+ // those notices here.
+
+ $notice = new Notice();
+
+ $notice->whereAdd('exists (select uri from bookmark where bookmark.uri = notice.uri)');
+ $notice->whereAdd('((object_type is null) or (object_type = "' .ActivityObject::NOTE.'"))');
+
+ $notice->find();
+
+ while ($notice->fetch()) {
+ $original = clone($notice);
+ $notice->verb = ActivityVerb::POST;
+ $notice->object_type = ActivityObject::BOOKMARK;
+ $notice->update($original);
+ }
+ }
}
function main()
{
- updateSchemaCore();
- updateSchemaPlugins();
+ if (Event::handle('StartUpgrade')) {
+ updateSchemaCore();
+ updateSchemaPlugins();
- // These replace old "fixup_*" scripts
+ // These replace old "fixup_*" scripts
- fixupNoticeRendered();
- fixupNoticeConversation();
- initConversation();
- initInbox();
- fixupGroupURI();
+ fixupNoticeRendered();
+ fixupNoticeConversation();
+ initConversation();
+ initInbox();
+ fixupGroupURI();
- initLocalGroup();
- initNoticeReshare();
+ initLocalGroup();
+ initNoticeReshare();
- initFaveURI();
- initSubscriptionURI();
- initGroupMemberURI();
+ initFaveURI();
+ initSubscriptionURI();
+ initGroupMemberURI();
+
+ Event::handle('EndUpgrade');
+ }
}
function tableDefs()