Merge branch 'master' of /var/www/trunk

This commit is contained in:
Zach Copley 2009-01-23 09:47:09 +00:00
commit d06a929d70
29 changed files with 190 additions and 67 deletions

View File

@ -123,5 +123,10 @@ class AllrssAction extends Rss10Action
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
return $avatar ? $avatar->url : null; return $avatar ? $avatar->url : null;
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -162,12 +162,12 @@ class ApiAction extends Action
if ($this->content_type == 'xml') { if ($this->content_type == 'xml') {
header('Content-Type: application/xml; charset=utf-8'); header('Content-Type: application/xml; charset=utf-8');
common_start_xml(); $this->startXML();
$this->elementStart('hash'); $this->elementStart('hash');
$this->element('error', null, $msg); $this->element('error', null, $msg);
$this->element('request', null, $_SERVER['REQUEST_URI']); $this->element('request', null, $_SERVER['REQUEST_URI']);
$this->elementEnd('hash'); $this->elementEnd('hash');
common_end_xml(); $this->endXML();
} else if ($this->content_type == 'json') { } else if ($this->content_type == 'json') {
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: application/json; charset=utf-8');
$error_array = array('error' => $msg, 'request' => $_SERVER['REQUEST_URI']); $error_array = array('error' => $msg, 'request' => $_SERVER['REQUEST_URI']);

View File

@ -97,5 +97,10 @@ class AvatarbynicknameAction extends Action
} }
common_redirect($url, 302); common_redirect($url, 302);
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -107,4 +107,9 @@ class DocAction extends Action
{ {
return ucfirst($this->title); return ucfirst($this->title);
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -114,5 +114,10 @@ class FavoritesrssAction extends Rss10Action
{ {
return null; return null;
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -51,6 +51,11 @@ class GroupsAction extends Action
var $page = null; var $page = null;
var $profile = null; var $profile = null;
function isReadOnly()
{
return true;
}
function title() function title()
{ {
if ($this->page == 1) { if ($this->page == 1) {

View File

@ -103,5 +103,10 @@ class GroupSearchResults extends GroupList
{ {
return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text)); return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -54,7 +54,7 @@ class LogoutAction extends Action
*/ */
function isReadOnly() function isReadOnly()
{ {
return true; return false;
} }
/** /**

View File

@ -73,4 +73,9 @@ class MicrosummaryAction extends Action
print $user->nickname . ': ' . $notice->content; print $user->nickname . ': ' . $notice->content;
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -222,5 +222,10 @@ class NoticesearchAction extends SearchAction
} while ($count); } while ($count);
return $result; return $result;
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -95,4 +95,9 @@ class NoticesearchrssAction extends Rss10Action
{ {
return null; return null;
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -122,5 +122,10 @@ class NudgeAction extends Action
// XXX: notify by SMS // XXX: notify by SMS
} }
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -90,16 +90,27 @@ class OpenidloginAction extends Action
function showContent() { function showContent() {
$formaction = common_local_url('openidlogin'); $formaction = common_local_url('openidlogin');
$this->elementStart('form', array('method' => 'post', $this->elementStart('form', array('method' => 'post',
'id' => 'openidlogin', 'id' => 'form_openid_login',
'class' => 'form_settings',
'action' => $formaction)); 'action' => $formaction));
$this->elementStart('fieldset');
$this->element('legend', null, _('OpenID login'));
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
$this->input('openid_url', _('OpenID URL'), $this->input('openid_url', _('OpenID URL'),
$this->openid_url, $this->openid_url,
_('Your OpenID URL')); _('Your OpenID URL'));
$this->elementEnd('li');
$this->elementStart('li', array('id' => 'settings_rememberme'));
$this->checkbox('rememberme', _('Remember me'), false, $this->checkbox('rememberme', _('Remember me'), false,
_('Automatically login in the future; ' . _('Automatically login in the future; ' .
'not for shared computers!')); 'not for shared computers!'));
$this->elementEnd('li');
$this->elementEnd('ul');
$this->submit('submit', _('Login')); $this->submit('submit', _('Login'));
$this->elementEnd('fieldset');
$this->elementEnd('form'); $this->elementEnd('form');
} }

View File

@ -83,5 +83,10 @@ class OpensearchAction extends Action
$this->elementEnd('OpenSearchDescription'); $this->elementEnd('OpenSearchDescription');
common_end_xml(); common_end_xml();
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -109,5 +109,10 @@ class PeopleSearchResults extends ProfileList
{ {
return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text)); return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -56,6 +56,11 @@ class PublicAction extends Action
var $page = null; var $page = null;
function isReadOnly()
{
return true;
}
/** /**
* Read and validate arguments * Read and validate arguments
* *
@ -200,8 +205,8 @@ class PublicAction extends Action
function showSections() function showSections()
{ {
$top = new TopPostersSection($this); // $top = new TopPostersSection($this);
$top->show(); // $top->show();
$pop = new PopularNoticeSection($this); $pop = new PopularNoticeSection($this);
$pop->show(); $pop->show();
$gbp = new GroupsByPostsSection($this); $gbp = new GroupsByPostsSection($this);

View File

@ -102,5 +102,10 @@ class PublicrssAction extends Rss10Action
{ {
// nop // nop
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -191,4 +191,9 @@ class RepliesAction extends Action
$this->page, 'replies', $this->page, 'replies',
array('nickname' => $this->user->nickname)); array('nickname' => $this->user->nickname));
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -82,4 +82,9 @@ class RepliesrssAction extends Rss10Action
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
return ($avatar) ? $avatar->url : null; return ($avatar) ? $avatar->url : null;
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -176,4 +176,9 @@ class ShowmessageAction extends MailboxAction
{ {
return ''; return '';
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -60,6 +60,11 @@ class ShowstreamAction extends Action
var $page = null; var $page = null;
var $profile = null; var $profile = null;
function isReadOnly()
{
return true;
}
function title() function title()
{ {
if ($this->page == 1) { if ($this->page == 1) {

View File

@ -103,4 +103,9 @@ class SubscribersList extends ProfileList
'nickname' => $this->owner->nickname)); 'nickname' => $this->owner->nickname));
$bf->show(); $bf->show();
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -66,4 +66,9 @@ class TagrssAction extends Rss10Action
'description' => sprintf(_('Microblog tagged with %s'), $tagname)); 'description' => sprintf(_('Microblog tagged with %s'), $tagname));
return $c; return $c;
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -52,6 +52,11 @@ class UsergroupsAction extends Action
var $page = null; var $page = null;
var $profile = null; var $profile = null;
function isReadOnly()
{
return true;
}
function title() function title()
{ {
if ($this->page == 1) { if ($this->page == 1) {

View File

@ -94,5 +94,10 @@ class UserrssAction extends Rss10Action
header('X-SUP-ID: '.$url); header('X-SUP-ID: '.$url);
parent::initRss($limit); parent::initRss($limit);
} }
function isReadOnly()
{
return true;
}
} }

View File

@ -77,7 +77,7 @@ class LoginGroupNav extends Widget
'register' => 'register' =>
array(_('Register'), array(_('Register'),
_('Sign up for a new account')), _('Sign up for a new account')),
'openid' => 'openidlogin' =>
array(_('OpenID'), array(_('OpenID'),
_('Login or register with OpenID'))); _('Login or register with OpenID')));

View File

@ -158,56 +158,56 @@ class TwitterapiAction extends Action
function show_twitter_xml_status($twitter_status) function show_twitter_xml_status($twitter_status)
{ {
common_element_start('status'); $this->elementStart('status');
foreach($twitter_status as $element => $value) { foreach($twitter_status as $element => $value) {
switch ($element) { switch ($element) {
case 'user': case 'user':
$this->show_twitter_xml_user($twitter_status['user']); $this->show_twitter_xml_user($twitter_status['user']);
break; break;
case 'text': case 'text':
common_element($element, null, common_xml_safe_str($value)); $this->element($element, null, common_xml_safe_str($value));
break; break;
default: default:
common_element($element, null, $value); $this->element($element, null, $value);
} }
} }
common_element_end('status'); $this->elementEnd('status');
} }
function show_twitter_xml_user($twitter_user, $role='user') function show_twitter_xml_user($twitter_user, $role='user')
{ {
common_element_start($role); $this->elementStart($role);
foreach($twitter_user as $element => $value) { foreach($twitter_user as $element => $value) {
if ($element == 'status') { if ($element == 'status') {
$this->show_twitter_xml_status($twitter_user['status']); $this->show_twitter_xml_status($twitter_user['status']);
} else { } else {
common_element($element, null, $value); $this->element($element, null, $value);
} }
} }
common_element_end($role); $this->elementEnd($role);
} }
function show_twitter_rss_item($entry) function show_twitter_rss_item($entry)
{ {
common_element_start('item'); $this->elementStart('item');
common_element('title', null, $entry['title']); $this->element('title', null, $entry['title']);
common_element('description', null, $entry['description']); $this->element('description', null, $entry['description']);
common_element('pubDate', null, $entry['pubDate']); $this->element('pubDate', null, $entry['pubDate']);
common_element('guid', null, $entry['guid']); $this->element('guid', null, $entry['guid']);
common_element('link', null, $entry['link']); $this->element('link', null, $entry['link']);
common_element_end('item'); $this->elementEnd('item');
} }
function show_twitter_atom_entry($entry) function show_twitter_atom_entry($entry)
{ {
common_element_start('entry'); $this->elementStart('entry');
common_element('title', null, $entry['title']); $this->element('title', null, $entry['title']);
common_element('content', array('type' => 'html'), $entry['content']); $this->element('content', array('type' => 'html'), $entry['content']);
common_element('id', null, $entry['id']); $this->element('id', null, $entry['id']);
common_element('published', null, $entry['published']); $this->element('published', null, $entry['published']);
common_element('updated', null, $entry['updated']); $this->element('updated', null, $entry['updated']);
common_element('link', array('href' => $entry['link'], 'rel' => 'alternate', 'type' => 'text/html'), null); $this->element('link', array('href' => $entry['link'], 'rel' => 'alternate', 'type' => 'text/html'), null);
common_element_end('entry'); $this->elementEnd('entry');
} }
function show_json_objects($objects) function show_json_objects($objects)
@ -249,7 +249,7 @@ class TwitterapiAction extends Action
function show_twitter_xml_dmsg($twitter_dm) function show_twitter_xml_dmsg($twitter_dm)
{ {
common_element_start('direct_message'); $this->elementStart('direct_message');
foreach($twitter_dm as $element => $value) { foreach($twitter_dm as $element => $value) {
switch ($element) { switch ($element) {
case 'sender': case 'sender':
@ -257,20 +257,20 @@ class TwitterapiAction extends Action
$this->show_twitter_xml_user($value, $element); $this->show_twitter_xml_user($value, $element);
break; break;
case 'text': case 'text':
common_element($element, null, common_xml_safe_str($value)); $this->element($element, null, common_xml_safe_str($value));
break; break;
default: default:
common_element($element, null, $value); $this->element($element, null, $value);
} }
} }
common_element_end('direct_message'); $this->elementEnd('direct_message');
} }
function show_xml_timeline($notice) function show_xml_timeline($notice)
{ {
$this->init_document('xml'); $this->init_document('xml');
common_element_start('statuses', array('type' => 'array')); $this->elementStart('statuses', array('type' => 'array'));
if (is_array($notice)) { if (is_array($notice)) {
foreach ($notice as $n) { foreach ($notice as $n) {
@ -284,7 +284,7 @@ class TwitterapiAction extends Action
} }
} }
common_element_end('statuses'); $this->elementEnd('statuses');
$this->end_document('xml'); $this->end_document('xml');
} }
@ -293,19 +293,19 @@ class TwitterapiAction extends Action
$this->init_document('rss'); $this->init_document('rss');
common_element_start('channel'); $this->elementStart('channel');
common_element('title', null, $title); $this->element('title', null, $title);
common_element('link', null, $link); $this->element('link', null, $link);
if (!is_null($suplink)) { if (!is_null($suplink)) {
# For FriendFeed's SUP protocol # For FriendFeed's SUP protocol
common_element('link', array('xmlns' => 'http://www.w3.org/2005/Atom', $this->element('link', array('xmlns' => 'http://www.w3.org/2005/Atom',
'rel' => 'http://api.friendfeed.com/2008/03#sup', 'rel' => 'http://api.friendfeed.com/2008/03#sup',
'href' => $suplink, 'href' => $suplink,
'type' => 'application/json')); 'type' => 'application/json'));
} }
common_element('description', null, $subtitle); $this->element('description', null, $subtitle);
common_element('language', null, 'en-us'); $this->element('language', null, 'en-us');
common_element('ttl', null, '40'); $this->element('ttl', null, '40');
if (is_array($notice)) { if (is_array($notice)) {
foreach ($notice as $n) { foreach ($notice as $n) {
@ -319,7 +319,7 @@ class TwitterapiAction extends Action
} }
} }
common_element_end('channel'); $this->elementEnd('channel');
$this->end_twitter_rss(); $this->end_twitter_rss();
} }
@ -328,16 +328,16 @@ class TwitterapiAction extends Action
$this->init_document('atom'); $this->init_document('atom');
common_element('title', null, $title); $this->element('title', null, $title);
common_element('id', null, $id); $this->element('id', null, $id);
common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null); $this->element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null);
if (!is_null($suplink)) { if (!is_null($suplink)) {
# For FriendFeed's SUP protocol # For FriendFeed's SUP protocol
common_element('link', array('rel' => 'http://api.friendfeed.com/2008/03#sup', $this->element('link', array('rel' => 'http://api.friendfeed.com/2008/03#sup',
'href' => $suplink, 'href' => $suplink,
'type' => 'application/json')); 'type' => 'application/json'));
} }
common_element('subtitle', null, $subtitle); $this->element('subtitle', null, $subtitle);
if (is_array($notice)) { if (is_array($notice)) {
foreach ($notice as $n) { foreach ($notice as $n) {
@ -425,7 +425,7 @@ class TwitterapiAction extends Action
switch ($type) { switch ($type) {
case 'xml': case 'xml':
header('Content-Type: application/xml; charset=utf-8'); header('Content-Type: application/xml; charset=utf-8');
common_start_xml(); $this->startXML();
break; break;
case 'json': case 'json':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: application/json; charset=utf-8');
@ -456,7 +456,7 @@ class TwitterapiAction extends Action
{ {
switch ($type) { switch ($type) {
case 'xml': case 'xml':
common_end_xml(); $this->endXML();
break; break;
case 'json': case 'json':
@ -514,10 +514,10 @@ class TwitterapiAction extends Action
if ($content_type == 'xml') { if ($content_type == 'xml') {
$this->init_document('xml'); $this->init_document('xml');
common_element_start('hash'); $this->elementStart('hash');
common_element('error', null, $msg); $this->element('error', null, $msg);
common_element('request', null, $_SERVER['REQUEST_URI']); $this->element('request', null, $_SERVER['REQUEST_URI']);
common_element_end('hash'); $this->elementEnd('hash');
$this->end_document('xml'); $this->end_document('xml');
} else { } else {
$this->init_document('json'); $this->init_document('json');
@ -530,26 +530,26 @@ class TwitterapiAction extends Action
function init_twitter_rss() function init_twitter_rss()
{ {
common_start_xml(); $this->startXML();
common_element_start('rss', array('version' => '2.0')); $this->elementStart('rss', array('version' => '2.0'));
} }
function end_twitter_rss() function end_twitter_rss()
{ {
common_element_end('rss'); $this->elementEnd('rss');
common_end_xml(); $this->endXML();
} }
function init_twitter_atom() function init_twitter_atom()
{ {
common_start_xml(); $this->startXML();
common_element_start('feed', array('xmlns' => 'http://www.w3.org/2005/Atom', 'xml:lang' => 'en-US')); $this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom', 'xml:lang' => 'en-US'));
} }
function end_twitter_atom() function end_twitter_atom()
{ {
common_end_xml(); $this->endXML();
common_element_end('feed'); $this->elementEnd('feed');
} }
function show_profile($profile, $content_type='xml', $notice=null) function show_profile($profile, $content_type='xml', $notice=null)

View File

@ -145,7 +145,8 @@ font-weight:bold;
#newgroup legend, #newgroup legend,
#editgroup legend, #editgroup legend,
#form_tag_user legend, #form_tag_user legend,
#form_remote_subscribe legend { #form_remote_subscribe legend,
#form_openid_login legend {
display:none; display:none;
} }
@ -173,7 +174,8 @@ width:90%;
} }
#form_login p.form_guide, #form_login p.form_guide,
#form_register #settings_rememberme p.form_guide { #form_register #settings_rememberme p.form_guide,
#form_openid_login #settings_rememberme p.form_guide {
margin-left:0; margin-left:0;
} }