Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x
This commit is contained in:
commit
cac5a417f2
@ -117,61 +117,13 @@ class ApiGroupCreateAction extends ApiAuthAction
|
||||
return;
|
||||
}
|
||||
|
||||
$group = new User_group();
|
||||
|
||||
$group->query('BEGIN');
|
||||
|
||||
$group->nickname = $this->nickname;
|
||||
$group->fullname = $this->fullname;
|
||||
$group->homepage = $this->homepage;
|
||||
$group->description = $this->description;
|
||||
$group->location = $this->location;
|
||||
$group->created = common_sql_now();
|
||||
|
||||
$result = $group->insert();
|
||||
|
||||
if (!$result) {
|
||||
common_log_db_error($group, 'INSERT', __FILE__);
|
||||
$this->serverError(
|
||||
_('Could not create group.'),
|
||||
500,
|
||||
$this->format
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$result = $group->setAliases($this->aliases);
|
||||
|
||||
if (!$result) {
|
||||
$this->serverError(
|
||||
_('Could not create aliases.'),
|
||||
500,
|
||||
$this->format
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$member = new Group_member();
|
||||
|
||||
$member->group_id = $group->id;
|
||||
$member->profile_id = $this->user->id;
|
||||
$member->is_admin = 1;
|
||||
$member->created = $group->created;
|
||||
|
||||
$result = $member->insert();
|
||||
|
||||
if (!$result) {
|
||||
common_log_db_error($member, 'INSERT', __FILE__);
|
||||
$this->serverError(
|
||||
_('Could not set group membership.'),
|
||||
500,
|
||||
$this->format
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$group->query('COMMIT');
|
||||
|
||||
$group = User_group::register(array('nickname' => $this->nickname,
|
||||
'fullname' => $this->fullname,
|
||||
'homepage' => $this->homepage,
|
||||
'description' => $this->description,
|
||||
'location' => $this->location,
|
||||
'aliases' => $this->aliases,
|
||||
'userid' => $this->user->id));
|
||||
switch($this->format) {
|
||||
case 'xml':
|
||||
$this->showSingleXmlGroup($group);
|
||||
|
@ -85,7 +85,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
|
||||
$this->lat = $this->trimmed('lat');
|
||||
$this->lon = $this->trimmed('long');
|
||||
|
||||
if (empty($this->source) || in_array($source, self::$reserved_sources)) {
|
||||
if (empty($this->source) || in_array($this->source, self::$reserved_sources)) {
|
||||
$this->source = 'api';
|
||||
}
|
||||
|
||||
|
@ -186,45 +186,13 @@ class NewgroupAction extends Action
|
||||
|
||||
assert(!is_null($cur));
|
||||
|
||||
$group = new User_group();
|
||||
|
||||
$group->query('BEGIN');
|
||||
|
||||
$group->nickname = $nickname;
|
||||
$group->fullname = $fullname;
|
||||
$group->homepage = $homepage;
|
||||
$group->description = $description;
|
||||
$group->location = $location;
|
||||
$group->created = common_sql_now();
|
||||
|
||||
$result = $group->insert();
|
||||
|
||||
if (!$result) {
|
||||
common_log_db_error($group, 'INSERT', __FILE__);
|
||||
$this->serverError(_('Could not create group.'));
|
||||
}
|
||||
|
||||
$result = $group->setAliases($aliases);
|
||||
|
||||
if (!$result) {
|
||||
$this->serverError(_('Could not create aliases.'));
|
||||
}
|
||||
|
||||
$member = new Group_member();
|
||||
|
||||
$member->group_id = $group->id;
|
||||
$member->profile_id = $cur->id;
|
||||
$member->is_admin = 1;
|
||||
$member->created = $group->created;
|
||||
|
||||
$result = $member->insert();
|
||||
|
||||
if (!$result) {
|
||||
common_log_db_error($member, 'INSERT', __FILE__);
|
||||
$this->serverError(_('Could not set group membership.'));
|
||||
}
|
||||
|
||||
$group->query('COMMIT');
|
||||
$group = User_group::register(array('nickname' => $nickname,
|
||||
'fullname' => $fullname,
|
||||
'homepage' => $homepage,
|
||||
'description' => $description,
|
||||
'location' => $location,
|
||||
'aliases' => $aliases,
|
||||
'userid' => $cur->id));
|
||||
|
||||
common_redirect($group->homeUrl(), 303);
|
||||
}
|
||||
|
@ -354,4 +354,66 @@ class User_group extends Memcached_DataObject
|
||||
|
||||
return $xs->getString();
|
||||
}
|
||||
|
||||
static function register($fields) {
|
||||
|
||||
// MAGICALLY put fields into current scope
|
||||
|
||||
extract($fields);
|
||||
|
||||
$group = new User_group();
|
||||
|
||||
$group->query('BEGIN');
|
||||
|
||||
$group->nickname = $nickname;
|
||||
$group->fullname = $fullname;
|
||||
$group->homepage = $homepage;
|
||||
$group->description = $description;
|
||||
$group->location = $location;
|
||||
$group->created = common_sql_now();
|
||||
|
||||
$result = $group->insert();
|
||||
|
||||
if (!$result) {
|
||||
common_log_db_error($group, 'INSERT', __FILE__);
|
||||
$this->serverError(
|
||||
_('Could not create group.'),
|
||||
500,
|
||||
$this->format
|
||||
);
|
||||
return;
|
||||
}
|
||||
$result = $group->setAliases($aliases);
|
||||
|
||||
if (!$result) {
|
||||
$this->serverError(
|
||||
_('Could not create aliases.'),
|
||||
500,
|
||||
$this->format
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$member = new Group_member();
|
||||
|
||||
$member->group_id = $group->id;
|
||||
$member->profile_id = $userid;
|
||||
$member->is_admin = 1;
|
||||
$member->created = $group->created;
|
||||
|
||||
$result = $member->insert();
|
||||
|
||||
if (!$result) {
|
||||
common_log_db_error($member, 'INSERT', __FILE__);
|
||||
$this->serverError(
|
||||
_('Could not set group membership.'),
|
||||
500,
|
||||
$this->format
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$group->query('COMMIT');
|
||||
return $group;
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ VALUES
|
||||
('mbpidgin','mbpidgin','http://code.google.com/p/microblog-purple/', now()),
|
||||
('Mobidentica', 'Mobidentica', 'http://www.substanceofcode.com/software/mobidentica/', now()),
|
||||
('moconica','Moconica','http://moconica.com/', now()),
|
||||
('mustard', 'MuSTArDroid', 'https://launchpad.net/mustardroid', now()),
|
||||
('nambu','Nambu','http://www.nambu.com/', now()),
|
||||
('peoplebrowsr', 'PeopleBrowsr', 'http://www.peoplebrowsr.com/', now()),
|
||||
('Pikchur','Pikchur','http://www.pikchur.com/', now()),
|
||||
|
@ -77,6 +77,6 @@ class UnblockForm extends ProfileActionForm
|
||||
|
||||
function description()
|
||||
{
|
||||
return _('Unlock this user');
|
||||
return _('Unblock this user');
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -118,6 +118,13 @@ class RealtimePlugin extends Plugin
|
||||
return true;
|
||||
}
|
||||
|
||||
function onEndShowStatusNetStyles($action)
|
||||
{
|
||||
$action->cssLink(common_path('plugins/Realtime/realtimeupdate.css'),
|
||||
null, 'screen, projection, tv');
|
||||
return true;
|
||||
}
|
||||
|
||||
function onEndNoticeSave($notice)
|
||||
{
|
||||
$paths = array();
|
||||
|
49
plugins/Realtime/realtimeupdate.css
Normal file
49
plugins/Realtime/realtimeupdate.css
Normal file
@ -0,0 +1,49 @@
|
||||
#notices_primary {
|
||||
position:relative;
|
||||
}
|
||||
|
||||
#realtime_actions {
|
||||
position: absolute;
|
||||
top: -20px;
|
||||
right: 0;
|
||||
margin: 0 0 11px 0;
|
||||
}
|
||||
|
||||
#realtime_actions li {
|
||||
margin-left: 18px;
|
||||
list-style-type: none;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#realtime_actions button {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: block;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
text-indent: -9999px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#realtime_play {
|
||||
background: url(icon_play.gif) no-repeat 47% 47%;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
#realtime_pause {
|
||||
background: url(icon_pause.gif) no-repeat 47% 47%;
|
||||
}
|
||||
|
||||
#realtime_popup {
|
||||
background: url(icon_external.gif) no-repeat 0 30%;
|
||||
}
|
||||
|
||||
#queued_counter {
|
||||
float:left;
|
||||
line-height:1.2;
|
||||
}
|
||||
|
||||
#showstream #notices_primary {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
@ -66,26 +66,26 @@ RealtimeUpdate = {
|
||||
|
||||
receive: function(data)
|
||||
{
|
||||
id = data.id;
|
||||
|
||||
// Don't add it if it already exists
|
||||
if ($("#notice-"+id).length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (RealtimeUpdate._paused === false) {
|
||||
RealtimeUpdate.purgeLastNoticeItem();
|
||||
|
||||
RealtimeUpdate.insertNoticeItem(data);
|
||||
|
||||
RealtimeUpdate.updateWindowCounter();
|
||||
}
|
||||
else {
|
||||
RealtimeUpdate._queuedNotices.push(data);
|
||||
|
||||
RealtimeUpdate.updateQueuedCounter();
|
||||
}
|
||||
|
||||
RealtimeUpdate.updateWindowCounter();
|
||||
},
|
||||
|
||||
insertNoticeItem: function(data) {
|
||||
// Don't add it if it already exists
|
||||
if ($("#notice-"+data.id).length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var noticeItem = RealtimeUpdate.makeNoticeItem(data);
|
||||
$("#notices_primary .notices").prepend(noticeItem);
|
||||
$("#notices_primary .notice:first").css({display:"none"});
|
||||
@ -192,21 +192,7 @@ RealtimeUpdate = {
|
||||
initActions: function(url, timeline, path)
|
||||
{
|
||||
var NP = $('#notices_primary');
|
||||
NP.prepend('<ul id="realtime_actions"><li id="realtime_pauseplay"></li><li id="realtime_timeline"></li></ul>');
|
||||
NP.css({'position':'relative'});
|
||||
|
||||
$('#realtime_actions').css({
|
||||
'position':'absolute',
|
||||
'top':'-20px',
|
||||
'right':'0',
|
||||
'margin':'0 0 11px 0'
|
||||
});
|
||||
|
||||
$('#realtime_actions li').css({
|
||||
'margin-left':'18px',
|
||||
'list-style-type':'none',
|
||||
'float':'left'
|
||||
});
|
||||
NP.prepend('<ul id="realtime_actions"><li id="realtime_playpause"></li><li id="realtime_timeline"></li></ul>');
|
||||
|
||||
RealtimeUpdate._pluginPath = path;
|
||||
|
||||
@ -221,20 +207,11 @@ RealtimeUpdate = {
|
||||
|
||||
showPause: function()
|
||||
{
|
||||
RT_PP = $('#realtime_pauseplay');
|
||||
RT_PP = $('#realtime_playpause');
|
||||
RT_PP.empty();
|
||||
RT_PP.append('<button id="realtime_pause" class="pause" title="Pause">Pause</button>');
|
||||
|
||||
RT_P = $('#realtime_pause');
|
||||
$('#realtime_pause').css({
|
||||
'background':'url('+RealtimeUpdate._pluginPath+'icon_pause.gif) no-repeat 47% 47%',
|
||||
'width':'16px',
|
||||
'height':'16px',
|
||||
'display':'block',
|
||||
'border':'none',
|
||||
'cursor':'pointer',
|
||||
'text-indent':'-9999px'
|
||||
});
|
||||
RT_P.bind('click', function() {
|
||||
RealtimeUpdate._paused = true;
|
||||
|
||||
@ -245,20 +222,11 @@ RealtimeUpdate = {
|
||||
|
||||
showPlay: function()
|
||||
{
|
||||
RT_PP = $('#realtime_pauseplay');
|
||||
RT_PP = $('#realtime_playpause');
|
||||
RT_PP.empty();
|
||||
RT_PP.append('<button id="realtime_play" class="play" title="Play">Play</button>');
|
||||
RT_PP.append('<span id="queued_counter"></span> <button id="realtime_play" class="play" title="Play">Play</button>');
|
||||
|
||||
RT_P = $('#realtime_play');
|
||||
RT_P.css({
|
||||
'background':'url('+RealtimeUpdate._pluginPath+'icon_play.gif) no-repeat 47% 47%',
|
||||
'width':'16px',
|
||||
'height':'16px',
|
||||
'display':'block',
|
||||
'border':'none',
|
||||
'cursor':'pointer',
|
||||
'text-indent':'-9999px'
|
||||
});
|
||||
RT_P.bind('click', function() {
|
||||
RealtimeUpdate._paused = false;
|
||||
|
||||
@ -270,12 +238,25 @@ RealtimeUpdate = {
|
||||
});
|
||||
},
|
||||
|
||||
showQueuedNotices: function() {
|
||||
showQueuedNotices: function()
|
||||
{
|
||||
$.each(RealtimeUpdate._queuedNotices, function(i, n) {
|
||||
RealtimeUpdate.insertNoticeItem(n);
|
||||
});
|
||||
|
||||
RealtimeUpdate._queuedNotices = [];
|
||||
|
||||
RealtimeUpdate.removeQueuedCounter();
|
||||
},
|
||||
|
||||
updateQueuedCounter: function()
|
||||
{
|
||||
$('#realtime_playpause #queued_counter').html('('+RealtimeUpdate._queuedNotices.length+')');
|
||||
},
|
||||
|
||||
removeQueuedCounter: function()
|
||||
{
|
||||
$('#realtime_playpause #queued_counter').empty();
|
||||
},
|
||||
|
||||
initAddPopup: function(url, timeline, path)
|
||||
@ -284,17 +265,6 @@ RealtimeUpdate = {
|
||||
NP.append('<button id="realtime_popup" title="Pop up in a window">Pop up</button>');
|
||||
|
||||
var PP = $('#realtime_popup');
|
||||
PP.css({
|
||||
'background':'transparent url('+ path + 'icon_external.gif) no-repeat 0 30%',
|
||||
'width':'16px',
|
||||
'height':'16px',
|
||||
'display':'block',
|
||||
'border':'none',
|
||||
'cursor':'pointer',
|
||||
'text-indent':'-9999px'
|
||||
});
|
||||
$('#showstream #notices_primary').css({'margin-top':'18px'});
|
||||
|
||||
PP.bind('click', function() {
|
||||
window.open(url,
|
||||
'',
|
||||
|
Loading…
Reference in New Issue
Block a user