From edbc0c665cc65875b4d14b79939233b1c9c06bb6 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 23 Dec 2008 14:19:07 -0500 Subject: replace all tabs with four spaces The PEAR coding standards decree: no tabs, but indent by four spaces. I've done a global search-and-replace on all tabs, replacing them by four spaces. This is a huge change, but it will go a long way to getting us towards phpcs-compliance. And that means better code readability, and that means more participation. darcs-hash:20081223191907-84dde-21e8efe210e6d5d54e935a22d0cee5c7bbfc007d.gz --- actions/showfavorites.php | 102 +++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'actions/showfavorites.php') diff --git a/actions/showfavorites.php b/actions/showfavorites.php index 4de4b1271..2fd1e586d 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -23,75 +23,75 @@ require_once(INSTALLDIR.'/actions/showstream.php'); class ShowfavoritesAction extends StreamAction { - function handle($args) { + function handle($args) { - parent::handle($args); + parent::handle($args); - $nickname = common_canonical_nickname($this->arg('nickname')); - $user = User::staticGet('nickname', $nickname); + $nickname = common_canonical_nickname($this->arg('nickname')); + $user = User::staticGet('nickname', $nickname); - if (!$user) { - $this->client_error(_('No such user.')); - return; - } + if (!$user) { + $this->client_error(_('No such user.')); + return; + } - $profile = $user->getProfile(); + $profile = $user->getProfile(); - if (!$profile) { - common_server_error(_('User has no profile.')); - return; - } + if (!$profile) { + common_server_error(_('User has no profile.')); + return; + } - # Looks like we're good; show the header + # Looks like we're good; show the header - common_show_header(sprintf(_("%s favorite notices"), $profile->nickname), - array($this, 'show_header'), $user, - array($this, 'show_top')); + common_show_header(sprintf(_("%s favorite notices"), $profile->nickname), + array($this, 'show_header'), $user, + array($this, 'show_top')); - $this->show_notices($user); + $this->show_notices($user); - common_show_footer(); - } + common_show_footer(); + } - function show_header($user) { - common_element('link', array('rel' => 'alternate', - 'href' => common_local_url('favoritesrss', array('nickname' => - $user->nickname)), - 'type' => 'application/rss+xml', - 'title' => sprintf(_('Feed for favorites of %s'), $user->nickname))); - } + function show_header($user) { + common_element('link', array('rel' => 'alternate', + 'href' => common_local_url('favoritesrss', array('nickname' => + $user->nickname)), + 'type' => 'application/rss+xml', + 'title' => sprintf(_('Feed for favorites of %s'), $user->nickname))); + } - function show_top($user) { - $cur = common_current_user(); + function show_top($user) { + $cur = common_current_user(); - if ($cur && $cur->id == $user->id) { - common_notice_form('all'); - } + if ($cur && $cur->id == $user->id) { + common_notice_form('all'); + } - $this->show_feeds_list(array(0=>array('href'=>common_local_url('favoritesrss', array('nickname' => $user->nickname)), - 'type' => 'rss', - 'version' => 'RSS 1.0', - 'item' => 'Favorites'))); - $this->views_menu(); - } + $this->show_feeds_list(array(0=>array('href'=>common_local_url('favoritesrss', array('nickname' => $user->nickname)), + 'type' => 'rss', + 'version' => 'RSS 1.0', + 'item' => 'Favorites'))); + $this->views_menu(); + } - function show_notices($user) { + function show_notices($user) { - $page = $this->trimmed('page'); - if (!$page) { - $page = 1; - } + $page = $this->trimmed('page'); + if (!$page) { + $page = 1; + } - $notice = $user->favoriteNotices(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); + $notice = $user->favoriteNotices(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); - if (!$notice) { - $this->server_error(_('Could not retrieve favorite notices.')); - return; - } + if (!$notice) { + $this->server_error(_('Could not retrieve favorite notices.')); + return; + } $cnt = $this->show_notice_list($notice); - common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, - $page, 'showfavorites', array('nickname' => $user->nickname)); - } + common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, + $page, 'showfavorites', array('nickname' => $user->nickname)); + } } -- cgit v1.2.3-54-g00ecf From 04ef1ba8eee7a9e2a565d7b4b747ef607665d562 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 23 Dec 2008 14:33:23 -0500 Subject: change function headers to K&R style Another huge change, for PEAR code standards compliance. Function headers have to be in K&R style (opening brace on its own line), instead of having the opening brace on the same line as the function and parameters. So, a little perl magic found all the function definitions and move the opening brace to the next line (properly indented... usually). darcs-hash:20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz --- _darcs/inventory | 11 + ...dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz | Bin 0 -> 13382 bytes _darcs/pristine/actions/accesstoken.php | 3 +- _darcs/pristine/actions/all.php | 12 +- _darcs/pristine/actions/allrss.php | 12 +- _darcs/pristine/actions/api.php | 15 +- _darcs/pristine/actions/avatarbynickname.php | 3 +- _darcs/pristine/actions/block.php | 12 +- _darcs/pristine/actions/confirmaddress.php | 3 +- _darcs/pristine/actions/deletenotice.php | 15 +- _darcs/pristine/actions/deleteprofile.php | 33 +- _darcs/pristine/actions/disfavor.php | 3 +- _darcs/pristine/actions/doc.php | 3 +- _darcs/pristine/actions/emailsettings.php | 33 +- _darcs/pristine/actions/facebookhome.php | 12 +- _darcs/pristine/actions/facebookinvite.php | 6 +- _darcs/pristine/actions/facebookremove.php | 3 +- _darcs/pristine/actions/facebooksettings.php | 6 +- _darcs/pristine/actions/favor.php | 6 +- _darcs/pristine/actions/favorited.php | 15 +- _darcs/pristine/actions/favoritesrss.php | 12 +- _darcs/pristine/actions/featured.php | 15 +- _darcs/pristine/actions/finishaddopenid.php | 9 +- _darcs/pristine/actions/finishimmediate.php | 6 +- _darcs/pristine/actions/finishopenidlogin.php | 51 +- _darcs/pristine/actions/finishremotesubscribe.php | 9 +- _darcs/pristine/actions/foaf.php | 12 +- _darcs/pristine/actions/imsettings.php | 27 +- _darcs/pristine/actions/invite.php | 18 +- _darcs/pristine/actions/login.php | 18 +- _darcs/pristine/actions/logout.php | 6 +- _darcs/pristine/actions/microsummary.php | 3 +- _darcs/pristine/actions/newmessage.php | 15 +- _darcs/pristine/actions/newnotice.php | 18 +- _darcs/pristine/actions/noticesearch.php | 18 +- _darcs/pristine/actions/noticesearchrss.php | 12 +- _darcs/pristine/actions/nudge.php | 6 +- _darcs/pristine/actions/openidlogin.php | 12 +- _darcs/pristine/actions/openidsettings.php | 12 +- _darcs/pristine/actions/opensearch.php | 3 +- _darcs/pristine/actions/othersettings.php | 18 +- _darcs/pristine/actions/peoplesearch.php | 15 +- _darcs/pristine/actions/peopletag.php | 15 +- _darcs/pristine/actions/postnotice.php | 6 +- _darcs/pristine/actions/profilesettings.php | 30 +- _darcs/pristine/actions/public.php | 15 +- _darcs/pristine/actions/publicrss.php | 12 +- _darcs/pristine/actions/publicxrds.php | 9 +- _darcs/pristine/actions/recoverpassword.php | 33 +- _darcs/pristine/actions/register.php | 21 +- _darcs/pristine/actions/remotesubscribe.php | 36 +- _darcs/pristine/actions/replies.php | 15 +- _darcs/pristine/actions/repliesrss.php | 12 +- _darcs/pristine/actions/requesttoken.php | 6 +- _darcs/pristine/actions/showfavorites.php | 12 +- _darcs/pristine/actions/showmessage.php | 21 +- _darcs/pristine/actions/shownotice.php | 21 +- _darcs/pristine/actions/showstream.php | 42 +- _darcs/pristine/actions/smssettings.php | 33 +- _darcs/pristine/actions/subedit.php | 6 +- _darcs/pristine/actions/subscribe.php | 3 +- _darcs/pristine/actions/subscribers.php | 21 +- _darcs/pristine/actions/subscriptions.php | 21 +- _darcs/pristine/actions/sup.php | 12 +- _darcs/pristine/actions/tag.php | 18 +- _darcs/pristine/actions/tagother.php | 12 +- _darcs/pristine/actions/tagrss.php | 9 +- _darcs/pristine/actions/twitapiaccount.php | 15 +- _darcs/pristine/actions/twitapiblocks.php | 6 +- _darcs/pristine/actions/twitapidirect_messages.php | 30 +- _darcs/pristine/actions/twitapifavorites.php | 15 +- _darcs/pristine/actions/twitapifriendships.php | 9 +- _darcs/pristine/actions/twitapihelp.php | 6 +- _darcs/pristine/actions/twitapinotifications.php | 6 +- _darcs/pristine/actions/twitapistatuses.php | 39 +- _darcs/pristine/actions/twitapiusers.php | 3 +- _darcs/pristine/actions/twittersettings.php | 30 +- _darcs/pristine/actions/unblock.php | 9 +- _darcs/pristine/actions/unsubscribe.php | 3 +- _darcs/pristine/actions/updateprofile.php | 6 +- _darcs/pristine/actions/userauthorization.php | 63 +- _darcs/pristine/actions/userbyid.php | 6 +- _darcs/pristine/actions/userrss.php | 15 +- _darcs/pristine/actions/xrds.php | 12 +- _darcs/pristine/classes/Avatar.php | 15 +- _darcs/pristine/classes/Channel.php | 78 +- _darcs/pristine/classes/Command.php | 75 +- _darcs/pristine/classes/CommandInterpreter.php | 3 +- _darcs/pristine/classes/Confirm_address.php | 6 +- _darcs/pristine/classes/Consumer.php | 3 +- _darcs/pristine/classes/Fave.php | 6 +- _darcs/pristine/classes/Foreign_link.php | 9 +- _darcs/pristine/classes/Foreign_service.php | 3 +- _darcs/pristine/classes/Foreign_subscription.php | 3 +- _darcs/pristine/classes/Foreign_user.php | 6 +- _darcs/pristine/classes/Invitation.php | 3 +- _darcs/pristine/classes/Memcached_DataObject.php | 30 +- _darcs/pristine/classes/Message.php | 9 +- _darcs/pristine/classes/Nonce.php | 3 +- _darcs/pristine/classes/Notice.php | 42 +- _darcs/pristine/classes/NoticeWrapper.php | 6 +- _darcs/pristine/classes/Notice_inbox.php | 3 +- _darcs/pristine/classes/Notice_source.php | 3 +- _darcs/pristine/classes/Notice_tag.php | 6 +- _darcs/pristine/classes/Profile.php | 24 +- _darcs/pristine/classes/Profile_block.php | 6 +- _darcs/pristine/classes/Profile_tag.php | 3 +- _darcs/pristine/classes/Queue_item.php | 6 +- _darcs/pristine/classes/Remember_me.php | 6 +- _darcs/pristine/classes/Remote_profile.php | 3 +- _darcs/pristine/classes/Reply.php | 3 +- _darcs/pristine/classes/Sms_carrier.php | 6 +- _darcs/pristine/classes/Subscription.php | 6 +- _darcs/pristine/classes/Token.php | 3 +- _darcs/pristine/classes/User.php | 66 +- _darcs/pristine/classes/User_openid.php | 3 +- _darcs/pristine/lib/Shorturl_api.php | 15 +- _darcs/pristine/lib/common.php | 3 +- _darcs/pristine/lib/deleteaction.php | 12 +- _darcs/pristine/lib/facebookaction.php | 30 +- _darcs/pristine/lib/oauthstore.php | 21 +- _darcs/pristine/lib/omb.php | 42 +- _darcs/pristine/lib/openid.php | 33 +- _darcs/pristine/lib/personal.php | 18 +- _darcs/pristine/lib/profilelist.php | 15 +- _darcs/pristine/lib/queuehandler.php | 39 +- _darcs/pristine/lib/rssaction.php | 39 +- _darcs/pristine/lib/search_engines.php | 33 +- _darcs/pristine/lib/searchaction.php | 21 +- _darcs/pristine/lib/settingsaction.php | 21 +- _darcs/pristine/lib/stream.php | 6 +- _darcs/pristine/lib/subs.php | 18 +- _darcs/pristine/lib/theme.php | 6 +- _darcs/pristine/lib/twitter.php | 21 +- _darcs/pristine/lib/twitterapi.php | 105 +- _darcs/pristine/lib/util.php | 372 +- _darcs/pristine/lib/xmppqueuehandler.php | 18 +- _darcs/pristine/scripts/enjitqueuehandler.php | 9 +- _darcs/pristine/scripts/jabberqueuehandler.php | 6 +- _darcs/pristine/scripts/maildaemon.php | 36 +- _darcs/pristine/scripts/ombqueuehandler.php | 15 +- _darcs/pristine/scripts/publicqueuehandler.php | 6 +- _darcs/pristine/scripts/sitemap.php | 39 +- _darcs/pristine/scripts/smsqueuehandler.php | 12 +- _darcs/pristine/scripts/xmppconfirmhandler.php | 12 +- _darcs/pristine/scripts/xmppdaemon.php | 54 +- _darcs/tentative_pristine | 4908 +++++++++++++++----- actions/accesstoken.php | 3 +- actions/all.php | 12 +- actions/allrss.php | 12 +- actions/api.php | 15 +- actions/avatarbynickname.php | 3 +- actions/block.php | 12 +- actions/confirmaddress.php | 3 +- actions/deletenotice.php | 15 +- actions/deleteprofile.php | 33 +- actions/disfavor.php | 3 +- actions/doc.php | 3 +- actions/emailsettings.php | 33 +- actions/facebookhome.php | 12 +- actions/facebookinvite.php | 6 +- actions/facebookremove.php | 3 +- actions/facebooksettings.php | 6 +- actions/favor.php | 6 +- actions/favorited.php | 15 +- actions/favoritesrss.php | 12 +- actions/featured.php | 15 +- actions/finishaddopenid.php | 9 +- actions/finishimmediate.php | 6 +- actions/finishopenidlogin.php | 51 +- actions/finishremotesubscribe.php | 9 +- actions/foaf.php | 12 +- actions/imsettings.php | 27 +- actions/invite.php | 18 +- actions/login.php | 18 +- actions/logout.php | 6 +- actions/microsummary.php | 3 +- actions/newmessage.php | 15 +- actions/newnotice.php | 18 +- actions/noticesearch.php | 18 +- actions/noticesearchrss.php | 12 +- actions/nudge.php | 6 +- actions/openidlogin.php | 12 +- actions/openidsettings.php | 12 +- actions/opensearch.php | 3 +- actions/othersettings.php | 18 +- actions/peoplesearch.php | 15 +- actions/peopletag.php | 15 +- actions/postnotice.php | 6 +- actions/profilesettings.php | 30 +- actions/public.php | 15 +- actions/publicrss.php | 12 +- actions/publicxrds.php | 9 +- actions/recoverpassword.php | 33 +- actions/register.php | 21 +- actions/remotesubscribe.php | 36 +- actions/replies.php | 15 +- actions/repliesrss.php | 12 +- actions/requesttoken.php | 6 +- actions/showfavorites.php | 12 +- actions/showmessage.php | 21 +- actions/shownotice.php | 21 +- actions/showstream.php | 42 +- actions/smssettings.php | 33 +- actions/subedit.php | 6 +- actions/subscribe.php | 3 +- actions/subscribers.php | 21 +- actions/subscriptions.php | 21 +- actions/sup.php | 12 +- actions/tag.php | 18 +- actions/tagother.php | 12 +- actions/tagrss.php | 9 +- actions/twitapiaccount.php | 15 +- actions/twitapiblocks.php | 6 +- actions/twitapidirect_messages.php | 30 +- actions/twitapifavorites.php | 15 +- actions/twitapifriendships.php | 9 +- actions/twitapihelp.php | 6 +- actions/twitapinotifications.php | 6 +- actions/twitapistatuses.php | 39 +- actions/twitapiusers.php | 3 +- actions/twittersettings.php | 30 +- actions/unblock.php | 9 +- actions/unsubscribe.php | 3 +- actions/updateprofile.php | 6 +- actions/userauthorization.php | 63 +- actions/userbyid.php | 6 +- actions/userrss.php | 15 +- actions/xrds.php | 12 +- classes/Avatar.php | 15 +- classes/Channel.php | 78 +- classes/Command.php | 75 +- classes/CommandInterpreter.php | 3 +- classes/Confirm_address.php | 6 +- classes/Consumer.php | 3 +- classes/Fave.php | 6 +- classes/Foreign_link.php | 9 +- classes/Foreign_service.php | 3 +- classes/Foreign_subscription.php | 3 +- classes/Foreign_user.php | 6 +- classes/Invitation.php | 3 +- classes/Memcached_DataObject.php | 30 +- classes/Message.php | 9 +- classes/Nonce.php | 3 +- classes/Notice.php | 42 +- classes/NoticeWrapper.php | 6 +- classes/Notice_inbox.php | 3 +- classes/Notice_source.php | 3 +- classes/Notice_tag.php | 6 +- classes/Profile.php | 24 +- classes/Profile_block.php | 6 +- classes/Profile_tag.php | 3 +- classes/Queue_item.php | 6 +- classes/Remember_me.php | 6 +- classes/Remote_profile.php | 3 +- classes/Reply.php | 3 +- classes/Sms_carrier.php | 6 +- classes/Subscription.php | 6 +- classes/Token.php | 3 +- classes/User.php | 66 +- classes/User_openid.php | 3 +- lib/Shorturl_api.php | 15 +- lib/common.php | 3 +- lib/deleteaction.php | 12 +- lib/facebookaction.php | 30 +- lib/oauthstore.php | 21 +- lib/omb.php | 42 +- lib/openid.php | 33 +- lib/personal.php | 18 +- lib/profilelist.php | 15 +- lib/queuehandler.php | 39 +- lib/rssaction.php | 39 +- lib/search_engines.php | 33 +- lib/searchaction.php | 21 +- lib/settingsaction.php | 21 +- lib/stream.php | 6 +- lib/subs.php | 18 +- lib/theme.php | 6 +- lib/twitter.php | 21 +- lib/twitterapi.php | 105 +- lib/util.php | 372 +- lib/xmppqueuehandler.php | 18 +- scripts/enjitqueuehandler.php | 9 +- scripts/jabberqueuehandler.php | 6 +- scripts/maildaemon.php | 36 +- scripts/ombqueuehandler.php | 15 +- scripts/publicqueuehandler.php | 6 +- scripts/sitemap.php | 39 +- scripts/smsqueuehandler.php | 12 +- scripts/xmppconfirmhandler.php | 12 +- scripts/xmppdaemon.php | 54 +- 291 files changed, 7292 insertions(+), 3123 deletions(-) create mode 100644 _darcs/patches/20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz (limited to 'actions/showfavorites.php') diff --git a/_darcs/inventory b/_darcs/inventory index 3137b8080..844cdd799 100644 --- a/_darcs/inventory +++ b/_darcs/inventory @@ -67,4 +67,15 @@ Evan Prodromou **20081223192129 keyword 'NULL' with its lowercase version. This is another PEAR code standards change. +] +[change function headers to K&R style +Evan Prodromou **20081223193323 + + Another huge change, for PEAR code standards compliance. Function + headers have to be in K&R style (opening brace on its own line), + instead of having the opening brace on the same line as the function + and parameters. So, a little perl magic found all the function + definitions and move the opening brace to the next line (properly + indented... usually). + ] \ No newline at end of file diff --git a/_darcs/patches/20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz b/_darcs/patches/20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz new file mode 100644 index 000000000..5319bc087 Binary files /dev/null and b/_darcs/patches/20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz differ diff --git a/_darcs/pristine/actions/accesstoken.php b/_darcs/pristine/actions/accesstoken.php index a468c33a6..738ec071f 100644 --- a/_darcs/pristine/actions/accesstoken.php +++ b/_darcs/pristine/actions/accesstoken.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); class AccesstokenAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); try { common_debug('getting request from env variables', __FILE__); diff --git a/_darcs/pristine/actions/all.php b/_darcs/pristine/actions/all.php index 066ee77bf..028a3679a 100644 --- a/_darcs/pristine/actions/all.php +++ b/_darcs/pristine/actions/all.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/actions/showstream.php'); class AllAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -53,7 +54,8 @@ class AllAction extends StreamAction { common_show_footer(); } - function show_header($user) { + function show_header($user) + { common_element('link', array('rel' => 'alternate', 'href' => common_local_url('allrss', array('nickname' => $user->nickname)), @@ -61,7 +63,8 @@ class AllAction extends StreamAction { 'title' => sprintf(_('Feed for friends of %s'), $user->nickname))); } - function show_top($user) { + function show_top($user) + { $cur = common_current_user(); if ($cur && $cur->id == $user->id) { @@ -76,7 +79,8 @@ class AllAction extends StreamAction { 'item' => 'allrss'))); } - function show_notices($user) { + function show_notices($user) + { $page = $this->trimmed('page'); if (!$page) { diff --git a/_darcs/pristine/actions/allrss.php b/_darcs/pristine/actions/allrss.php index 851cd0ad5..9c20cd416 100644 --- a/_darcs/pristine/actions/allrss.php +++ b/_darcs/pristine/actions/allrss.php @@ -27,7 +27,8 @@ class AllrssAction extends Rss10Action { var $user = null; - function init() { + function init() + { $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); @@ -39,7 +40,8 @@ class AllrssAction extends Rss10Action { } } - function get_notices($limit=0) { + function get_notices($limit=0) + { $user = $this->user; @@ -52,7 +54,8 @@ class AllrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { $user = $this->user; $c = array('url' => common_local_url('allrss', array('nickname' => @@ -65,7 +68,8 @@ class AllrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { $user = $this->user; $profile = $user->getProfile(); if (!$profile) { diff --git a/_darcs/pristine/actions/api.php b/_darcs/pristine/actions/api.php index e7646a7bb..8ccd86f0b 100644 --- a/_darcs/pristine/actions/api.php +++ b/_darcs/pristine/actions/api.php @@ -27,7 +27,8 @@ class ApiAction extends Action { var $api_method; var $api_action; - function handle($args) { + function handle($args) + { parent::handle($args); $this->api_action = $this->arg('apiaction'); @@ -79,7 +80,8 @@ class ApiAction extends Action { } } - function process_command() { + function process_command() + { $action = "twitapi$this->api_action"; $actionfile = INSTALLDIR."/actions/$action.php"; @@ -108,7 +110,8 @@ class ApiAction extends Action { } # Whitelist of API methods that don't need authentication - function requires_auth() { + function requires_auth() + { static $noauth = array( 'statuses/public_timeline', 'statuses/show', 'users/show', @@ -144,7 +147,8 @@ class ApiAction extends Action { } } - function show_basic_auth_error() { + function show_basic_auth_error() + { header('HTTP/1.1 401 Unauthorized'); $msg = 'Could not authenticate you.'; @@ -166,7 +170,8 @@ class ApiAction extends Action { } } - function is_readonly() { + function is_readonly() + { # NOTE: before handle(), can't use $this->arg $apiaction = $_REQUEST['apiaction']; $method = $_REQUEST['method']; diff --git a/_darcs/pristine/actions/avatarbynickname.php b/_darcs/pristine/actions/avatarbynickname.php index 2ca861a66..4aeb4112a 100644 --- a/_darcs/pristine/actions/avatarbynickname.php +++ b/_darcs/pristine/actions/avatarbynickname.php @@ -20,7 +20,8 @@ if (!defined('LACONICA')) { exit(1); } class AvatarbynicknameAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); $nickname = $this->trimmed('nickname'); if (!$nickname) { diff --git a/_darcs/pristine/actions/block.php b/_darcs/pristine/actions/block.php index cfcd29848..702adcffa 100644 --- a/_darcs/pristine/actions/block.php +++ b/_darcs/pristine/actions/block.php @@ -23,7 +23,8 @@ class BlockAction extends Action { var $profile = null; - function prepare($args) { + function prepare($args) + { parent::prepare($args); @@ -56,7 +57,8 @@ class BlockAction extends Action { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($this->arg('block')) { @@ -71,7 +73,8 @@ class BlockAction extends Action { } } - function are_you_sure_form() { + function are_you_sure_form() + { $id = $this->profile->id; @@ -109,7 +112,8 @@ class BlockAction extends Action { common_show_footer(); } - function block_profile() { + function block_profile() + { $cur = common_current_user(); diff --git a/_darcs/pristine/actions/confirmaddress.php b/_darcs/pristine/actions/confirmaddress.php index 562b70fe9..d926864a6 100644 --- a/_darcs/pristine/actions/confirmaddress.php +++ b/_darcs/pristine/actions/confirmaddress.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class ConfirmaddressAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_set_returnto($this->self_url()); diff --git a/_darcs/pristine/actions/deletenotice.php b/_darcs/pristine/actions/deletenotice.php index 0777918d2..4f00db617 100644 --- a/_darcs/pristine/actions/deletenotice.php +++ b/_darcs/pristine/actions/deletenotice.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/deleteaction.php'); class DeletenoticeAction extends DeleteAction { - function handle($args) { + function handle($args) + { parent::handle($args); # XXX: Ajax! @@ -33,15 +34,18 @@ class DeletenoticeAction extends DeleteAction { } } - function get_instructions() { + function get_instructions() + { return _('You are about to permanently delete a notice. Once this is done, it cannot be undone.'); } - function get_title() { + function get_title() + { return _('Delete notice'); } - function show_form($error=null) { + function show_form($error=null) + { $user = common_current_user(); common_show_header($this->get_title(), array($this, 'show_header'), $error, @@ -67,7 +71,8 @@ class DeletenoticeAction extends DeleteAction { common_show_footer(); } - function delete_notice() { + function delete_notice() + { # CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { diff --git a/_darcs/pristine/actions/deleteprofile.php b/_darcs/pristine/actions/deleteprofile.php index 503b3666d..b1c346cb2 100644 --- a/_darcs/pristine/actions/deleteprofile.php +++ b/_darcs/pristine/actions/deleteprofile.php @@ -20,7 +20,8 @@ if (!defined('LACONICA')) { exit(1); } class DeleteprofileAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); $this->server_error(_('Code not yet ready.')); return; @@ -32,18 +33,21 @@ class DeleteprofileAction extends Action { } } - function get_instructions() { + function get_instructions() + { return _('Export and delete your user information.'); } - function form_header($title, $msg=null, $success=false) { + function form_header($title, $msg=null, $success=false) + { common_show_header($title, null, array($msg, $success), array($this, 'show_top')); } - function show_feeds_list($feeds) { + function show_feeds_list($feeds) + { common_element_start('div', array('class' => 'feedsdel')); common_element('p', null, 'Feeds:'); common_element_start('ul', array('class' => 'xoxo')); @@ -56,7 +60,8 @@ class DeleteprofileAction extends Action { } //TODO move to common.php (and retrace its origin) - function common_feed_item($feed) { + function common_feed_item($feed) + { $user = common_current_user(); $nickname = $user->nickname; @@ -84,14 +89,16 @@ class DeleteprofileAction extends Action { common_element_end('li'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $this->form_header(_('Delete my account'), $msg, $success); common_element('h2', null, _('Delete my account confirmation')); $this->show_confirm_delete_form(); common_show_footer(); } - function show_confirm_delete_form() { + function show_confirm_delete_form() + { $user = common_current_user(); $notices = DB_DataObject::factory('notice'); $notices->profile_id = $user->id; @@ -120,7 +127,8 @@ class DeleteprofileAction extends Action { common_element_end('form'); } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -134,7 +142,8 @@ class DeleteprofileAction extends Action { $this->show_form(); } - function delete_account() { + function delete_account() + { $user = common_current_user(); assert(!is_null($user)); # should already be checked @@ -219,7 +228,8 @@ class DeleteprofileAction extends Action { common_redirect(common_local_url('public')); } - function show_top($arr) { + function show_top($arr) + { $msg = $arr[0]; $success = $arr[1]; if ($msg) { @@ -234,7 +244,8 @@ class DeleteprofileAction extends Action { $this->settings_menu(); } - function settings_menu() { + function settings_menu() + { # action => array('prompt', 'title') $menu = array('profilesettings' => diff --git a/_darcs/pristine/actions/disfavor.php b/_darcs/pristine/actions/disfavor.php index e47e68a8c..f0b528453 100644 --- a/_darcs/pristine/actions/disfavor.php +++ b/_darcs/pristine/actions/disfavor.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class DisfavorAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); diff --git a/_darcs/pristine/actions/doc.php b/_darcs/pristine/actions/doc.php index 0cf665d68..441ac19a7 100644 --- a/_darcs/pristine/actions/doc.php +++ b/_darcs/pristine/actions/doc.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class DocAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); $title = $this->trimmed('title'); $filename = INSTALLDIR.'/doc/'.$title; diff --git a/_darcs/pristine/actions/emailsettings.php b/_darcs/pristine/actions/emailsettings.php index 06b3ef29f..3dcf7716f 100644 --- a/_darcs/pristine/actions/emailsettings.php +++ b/_darcs/pristine/actions/emailsettings.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); class EmailsettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('Manage how you get email from %%site.name%%.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); $this->form_header(_('Email Settings'), $msg, $success); common_element_start('form', array('method' => 'post', @@ -110,7 +112,8 @@ class EmailsettingsAction extends SettingsAction { common_show_footer(); } - function get_confirmation() { + function get_confirmation() + { $user = common_current_user(); $confirm = new Confirm_address(); $confirm->user_id = $user->id; @@ -122,7 +125,8 @@ class EmailsettingsAction extends SettingsAction { } } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); @@ -148,7 +152,8 @@ class EmailsettingsAction extends SettingsAction { } } - function save_preferences() { + function save_preferences() + { $emailnotifysub = $this->boolean('emailnotifysub'); $emailnotifyfav = $this->boolean('emailnotifyfav'); @@ -185,7 +190,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form(_('Preferences saved.'), true); } - function add_address() { + function add_address() + { $user = common_current_user(); @@ -236,7 +242,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form($msg, TRUE); } - function cancel_confirmation() { + function cancel_confirmation() + { $email = $this->arg('email'); $confirm = $this->get_confirmation(); if (!$confirm) { @@ -259,7 +266,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form(_('Confirmation cancelled.'), TRUE); } - function remove_address() { + function remove_address() + { $user = common_current_user(); $email = $this->arg('email'); @@ -285,7 +293,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form(_('The address was removed.'), TRUE); } - function remove_incoming() { + function remove_incoming() + { $user = common_current_user(); if (!$user->incomingemail) { @@ -304,7 +313,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form(_('Incoming email address removed.'), TRUE); } - function new_incoming() { + function new_incoming() + { $user = common_current_user(); $orig = clone($user); @@ -318,7 +328,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form(_('New incoming email address added.'), TRUE); } - function email_exists($email) { + function email_exists($email) + { $user = common_current_user(); $other = User::staticGet('email', $email); if (!$other) { diff --git a/_darcs/pristine/actions/facebookhome.php b/_darcs/pristine/actions/facebookhome.php index c964f451a..006f35eca 100644 --- a/_darcs/pristine/actions/facebookhome.php +++ b/_darcs/pristine/actions/facebookhome.php @@ -23,13 +23,15 @@ require_once(INSTALLDIR.'/lib/facebookaction.php'); class FacebookhomeAction extends FacebookAction { - function handle($args) { + function handle($args) + { parent::handle($args); $this->login(); } - function login() { + function login() + { $user = null; @@ -89,7 +91,8 @@ class FacebookhomeAction extends FacebookAction { } - function show_home($facebook, $fbuid, $user) { + function show_home($facebook, $fbuid, $user) + { $this->show_header('Home'); @@ -99,7 +102,8 @@ class FacebookhomeAction extends FacebookAction { $this->show_footer(); } - function show_notices($user) { + function show_notices($user) + { $page = $this->trimmed('page'); if (!$page) { diff --git a/_darcs/pristine/actions/facebookinvite.php b/_darcs/pristine/actions/facebookinvite.php index 3a85a7c5c..fc226e65a 100644 --- a/_darcs/pristine/actions/facebookinvite.php +++ b/_darcs/pristine/actions/facebookinvite.php @@ -23,13 +23,15 @@ require_once(INSTALLDIR.'/lib/facebookaction.php'); class FacebookinviteAction extends FacebookAction { - function handle($args) { + function handle($args) + { parent::handle($args); $this->display(); } - function display() { + function display() + { $facebook = $this->get_facebook(); diff --git a/_darcs/pristine/actions/facebookremove.php b/_darcs/pristine/actions/facebookremove.php index 1215f6622..79dc32e49 100644 --- a/_darcs/pristine/actions/facebookremove.php +++ b/_darcs/pristine/actions/facebookremove.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/facebookaction.php'); class FacebookremoveAction extends FacebookAction { - function handle($args) { + function handle($args) + { parent::handle($args); $secret = common_config('facebook', 'secret'); diff --git a/_darcs/pristine/actions/facebooksettings.php b/_darcs/pristine/actions/facebooksettings.php index a5ad9d07a..03ad57813 100644 --- a/_darcs/pristine/actions/facebooksettings.php +++ b/_darcs/pristine/actions/facebooksettings.php @@ -23,13 +23,15 @@ require_once(INSTALLDIR.'/lib/facebookaction.php'); class FacebooksettingsAction extends FacebookAction { - function handle($args) { + function handle($args) + { parent::handle($args); $this->display(); } - function display() { + function display() + { $facebook = $this->get_facebook(); diff --git a/_darcs/pristine/actions/favor.php b/_darcs/pristine/actions/favor.php index c0b0324b5..3ec4af0b5 100644 --- a/_darcs/pristine/actions/favor.php +++ b/_darcs/pristine/actions/favor.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/mail.php'); class FavorAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { @@ -80,7 +81,8 @@ class FavorAction extends Action { } } - function notify($fave, $notice, $user) { + function notify($fave, $notice, $user) + { $other = User::staticGet('id', $notice->profile_id); if ($other && $other->id != $user->id) { if ($other->email && $other->emailnotifyfav) { diff --git a/_darcs/pristine/actions/favorited.php b/_darcs/pristine/actions/favorited.php index e69630d50..d479e1b3e 100644 --- a/_darcs/pristine/actions/favorited.php +++ b/_darcs/pristine/actions/favorited.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/stream.php'); class FavoritedAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -37,7 +38,8 @@ class FavoritedAction extends StreamAction { common_show_footer(); } - function show_top() { + function show_top() + { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); common_element_start('div', 'instructions'); @@ -46,15 +48,18 @@ class FavoritedAction extends StreamAction { $this->public_views_menu(); } - function show_header() { + function show_header() + { return; } - function get_instructions() { + function get_instructions() + { return _('Showing recently popular notices'); } - function show_notices($page) { + function show_notices($page) + { $qry = 'SELECT notice.*, sum(exp(-(now() - fave.modified) / %s)) as weight ' . 'FROM notice JOIN fave ON notice.id = fave.notice_id ' . diff --git a/_darcs/pristine/actions/favoritesrss.php b/_darcs/pristine/actions/favoritesrss.php index 7071812d7..aa8a3c6f4 100644 --- a/_darcs/pristine/actions/favoritesrss.php +++ b/_darcs/pristine/actions/favoritesrss.php @@ -27,7 +27,8 @@ class FavoritesrssAction extends Rss10Action { var $user = null; - function init() { + function init() + { $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); @@ -39,7 +40,8 @@ class FavoritesrssAction extends Rss10Action { } } - function get_notices($limit=0) { + function get_notices($limit=0) + { $user = $this->user; @@ -54,7 +56,8 @@ class FavoritesrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { $user = $this->user; $c = array('url' => common_local_url('favoritesrss', array('nickname' => @@ -67,7 +70,8 @@ class FavoritesrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { return null; } } \ No newline at end of file diff --git a/_darcs/pristine/actions/featured.php b/_darcs/pristine/actions/featured.php index f478a4017..1763adeab 100644 --- a/_darcs/pristine/actions/featured.php +++ b/_darcs/pristine/actions/featured.php @@ -24,7 +24,8 @@ require_once(INSTALLDIR.'/lib/profilelist.php'); class FeaturedAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -38,7 +39,8 @@ class FeaturedAction extends StreamAction { common_show_footer(); } - function show_top() { + function show_top() + { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); common_element_start('div', 'instructions'); @@ -47,14 +49,17 @@ class FeaturedAction extends StreamAction { $this->public_views_menu(); } - function show_header() { + function show_header() + { } - function get_instructions() { + function get_instructions() + { return _('Featured users'); } - function show_notices($page) { + function show_notices($page) + { // XXX: Note I'm doing it this two-stage way because a raw query // with a JOIN was *not* working. --Zach diff --git a/_darcs/pristine/actions/finishaddopenid.php b/_darcs/pristine/actions/finishaddopenid.php index 7607688de..d8409b6e9 100644 --- a/_darcs/pristine/actions/finishaddopenid.php +++ b/_darcs/pristine/actions/finishaddopenid.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); class FinishaddopenidAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_user_error(_('Not logged in.')); @@ -32,7 +33,8 @@ class FinishaddopenidAction extends Action { } } - function try_login() { + function try_login() + { $consumer =& oid_consumer(); @@ -95,7 +97,8 @@ class FinishaddopenidAction extends Action { } } - function message($msg) { + function message($msg) + { common_show_header(_('OpenID Login')); common_element('p', null, $msg); common_show_footer(); diff --git a/_darcs/pristine/actions/finishimmediate.php b/_darcs/pristine/actions/finishimmediate.php index ea711f5c5..c4a1c1af9 100644 --- a/_darcs/pristine/actions/finishimmediate.php +++ b/_darcs/pristine/actions/finishimmediate.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); class FinishimmediateAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); $consumer = oid_consumer(); @@ -53,7 +54,8 @@ class FinishimmediateAction extends Action { return; } - function go_backto() { + function go_backto() + { common_ensure_session(); $backto = $_SESSION['openid_immediate_backto']; if (!$backto) { diff --git a/_darcs/pristine/actions/finishopenidlogin.php b/_darcs/pristine/actions/finishopenidlogin.php index ae5b136a2..eb52d73b1 100644 --- a/_darcs/pristine/actions/finishopenidlogin.php +++ b/_darcs/pristine/actions/finishopenidlogin.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); class FinishopenidloginAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (common_logged_in()) { common_user_error(_('Already logged in.')); @@ -52,7 +53,8 @@ class FinishopenidloginAction extends Action { } } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('div', array('class' => 'error'), $error); } else { @@ -62,7 +64,8 @@ class FinishopenidloginAction extends Action { } } - function show_form($error=null, $username=null) { + function show_form($error=null, $username=null) + { common_show_header(_('OpenID Account Setup'), null, $error, array($this, 'show_top')); @@ -99,7 +102,8 @@ class FinishopenidloginAction extends Action { common_show_footer(); } - function try_login() { + function try_login() + { $consumer = oid_consumer(); @@ -146,26 +150,30 @@ class FinishopenidloginAction extends Action { } } - function message($msg) { + function message($msg) + { common_show_header(_('OpenID Login')); common_element('p', null, $msg); common_show_footer(); } - function save_values($display, $canonical, $sreg) { + function save_values($display, $canonical, $sreg) + { common_ensure_session(); $_SESSION['openid_display'] = $display; $_SESSION['openid_canonical'] = $canonical; $_SESSION['openid_sreg'] = $sreg; } - function get_saved_values() { + function get_saved_values() + { return array($_SESSION['openid_display'], $_SESSION['openid_canonical'], $_SESSION['openid_sreg']); } - function create_new_user() { + function create_new_user() + { # FIXME: save invite code before redirect, and check here @@ -247,7 +255,8 @@ class FinishopenidloginAction extends Action { common_redirect(common_local_url('showstream', array('nickname' => $user->nickname))); } - function connect_user() { + function connect_user() + { $nickname = $this->trimmed('nickname'); $password = $this->trimmed('password'); @@ -286,7 +295,8 @@ class FinishopenidloginAction extends Action { $this->go_home($user->nickname); } - function go_home($nickname) { + function go_home($nickname) + { $url = common_get_returnto(); if ($url) { # We don't have to return to it again @@ -299,7 +309,8 @@ class FinishopenidloginAction extends Action { common_redirect($url); } - function best_new_nickname($display, $sreg) { + function best_new_nickname($display, $sreg) + { # Try the passed-in nickname @@ -332,7 +343,8 @@ class FinishopenidloginAction extends Action { return null; } - function is_new_nickname($str) { + function is_new_nickname($str) + { if (!Validate::string($str, array('min_length' => 1, 'max_length' => 64, 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { @@ -347,7 +359,8 @@ class FinishopenidloginAction extends Action { return true; } - function openid_to_nickname($openid) { + function openid_to_nickname($openid) + { if (Auth_Yadis_identifierScheme($openid) == 'XRI') { return $this->xri_to_nickname($openid); } else { @@ -360,7 +373,8 @@ class FinishopenidloginAction extends Action { # 2. One element in path, like http://profile.typekey.com/EvanProdromou/ # or http://getopenid.com/evanprodromou - function url_to_nickname($openid) { + function url_to_nickname($openid) + { static $bad = array('query', 'user', 'password', 'port', 'fragment'); $parts = parse_url($openid); @@ -406,7 +420,8 @@ class FinishopenidloginAction extends Action { return null; } - function xri_to_nickname($xri) { + function xri_to_nickname($xri) + { $base = $this->xri_base($xri); if (!$base) { @@ -419,7 +434,8 @@ class FinishopenidloginAction extends Action { } } - function xri_base($xri) { + function xri_base($xri) + { if (substr($xri, 0, 6) == 'xri://') { return substr($xri, 6); } else { @@ -429,7 +445,8 @@ class FinishopenidloginAction extends Action { # Given a string, try to make it work as a nickname - function nicknamize($str) { + function nicknamize($str) + { $str = preg_replace('/\W/', '', $str); return strtolower($str); } diff --git a/_darcs/pristine/actions/finishremotesubscribe.php b/_darcs/pristine/actions/finishremotesubscribe.php index edd4ae541..38a56c962 100644 --- a/_darcs/pristine/actions/finishremotesubscribe.php +++ b/_darcs/pristine/actions/finishremotesubscribe.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/omb.php'); class FinishremotesubscribeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -231,13 +232,15 @@ class FinishremotesubscribeAction extends Action { $user->nickname))); } - function add_avatar($profile, $url) { + function add_avatar($profile, $url) + { $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar'); copy($url, $temp_filename); return $profile->setOriginal($temp_filename); } - function access_token($omb) { + function access_token($omb) + { common_debug('starting request for access token', __FILE__); diff --git a/_darcs/pristine/actions/foaf.php b/_darcs/pristine/actions/foaf.php index 218e20f5f..893e2a861 100644 --- a/_darcs/pristine/actions/foaf.php +++ b/_darcs/pristine/actions/foaf.php @@ -25,11 +25,13 @@ define('BOTH', 0); class FoafAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); $nickname = $this->trimmed('nickname'); @@ -179,14 +181,16 @@ class FoafAction extends Action { common_element_end('rdf:RDF'); } - function show_ppd($foaf_url, $person_uri) { + function show_ppd($foaf_url, $person_uri) + { common_element_start('PersonalProfileDocument', array('rdf:about' => $foaf_url)); common_element('maker', array('rdf:resource' => $person_uri)); common_element('primaryTopic', array('rdf:resource' => $person_uri)); common_element_end('PersonalProfileDocument'); } - function show_microblogging_account($profile, $service=null) { + function show_microblogging_account($profile, $service=null) + { # Their account common_element_start('holdsAccount'); common_element_start('OnlineAccount'); diff --git a/_darcs/pristine/actions/imsettings.php b/_darcs/pristine/actions/imsettings.php index 8f546f8e7..cccd5db49 100644 --- a/_darcs/pristine/actions/imsettings.php +++ b/_darcs/pristine/actions/imsettings.php @@ -24,11 +24,13 @@ require_once(INSTALLDIR.'/lib/jabber.php'); class ImsettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('You can send and receive notices through Jabber/GTalk [instant messages](%%doc.im%%). Configure your address and settings below.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); $this->form_header(_('IM Settings'), $msg, $success); common_element_start('form', array('method' => 'post', @@ -85,7 +87,8 @@ class ImsettingsAction extends SettingsAction { common_show_footer(); } - function get_confirmation() { + function get_confirmation() + { $user = common_current_user(); $confirm = new Confirm_address(); $confirm->user_id = $user->id; @@ -97,7 +100,8 @@ class ImsettingsAction extends SettingsAction { } } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); @@ -119,7 +123,8 @@ class ImsettingsAction extends SettingsAction { } } - function save_preferences() { + function save_preferences() + { $jabbernotify = $this->boolean('jabbernotify'); $updatefrompresence = $this->boolean('updatefrompresence'); @@ -152,7 +157,8 @@ class ImsettingsAction extends SettingsAction { $this->show_form(_('Preferences saved.'), true); } - function add_address() { + function add_address() + { $user = common_current_user(); @@ -207,7 +213,8 @@ class ImsettingsAction extends SettingsAction { $this->show_form($msg, TRUE); } - function cancel_confirmation() { + function cancel_confirmation() + { $jabber = $this->arg('jabber'); $confirm = $this->get_confirmation(); if (!$confirm) { @@ -230,7 +237,8 @@ class ImsettingsAction extends SettingsAction { $this->show_form(_('Confirmation cancelled.'), TRUE); } - function remove_address() { + function remove_address() + { $user = common_current_user(); $jabber = $this->arg('jabber'); @@ -258,7 +266,8 @@ class ImsettingsAction extends SettingsAction { $this->show_form(_('The address was removed.'), TRUE); } - function jabber_exists($jabber) { + function jabber_exists($jabber) + { $user = common_current_user(); $other = User::staticGet('jabber', $jabber); if (!$other) { diff --git a/_darcs/pristine/actions/invite.php b/_darcs/pristine/actions/invite.php index feef94d0f..b0fc79958 100644 --- a/_darcs/pristine/actions/invite.php +++ b/_darcs/pristine/actions/invite.php @@ -21,11 +21,13 @@ if (!defined('LACONICA')) { exit(1); } class InviteAction extends Action { - function is_readonly() { + function is_readonly() + { return false; } - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { $this->client_error(sprintf(_('You must be logged in to invite other users to use %s'), @@ -38,7 +40,8 @@ class InviteAction extends Action { } } - function send_invitations() { + function send_invitations() + { # CSRF protection $token = $this->trimmed('token'); @@ -112,7 +115,8 @@ class InviteAction extends Action { common_show_footer(); } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('p', 'error', $error); } else { @@ -123,7 +127,8 @@ class InviteAction extends Action { } } - function show_form($error=null) { + function show_form($error=null) + { global $config; @@ -149,7 +154,8 @@ class InviteAction extends Action { common_show_footer(); } - function send_invitation($email, $user, $personal) { + function send_invitation($email, $user, $personal) + { $profile = $user->getProfile(); $bestname = $profile->getBestName(); diff --git a/_darcs/pristine/actions/login.php b/_darcs/pristine/actions/login.php index f3509519e..6ad07b610 100644 --- a/_darcs/pristine/actions/login.php +++ b/_darcs/pristine/actions/login.php @@ -21,11 +21,13 @@ if (!defined('LACONICA')) { exit(1); } class LoginAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); if (common_is_real_login()) { common_user_error(_('Already logged in.')); @@ -36,7 +38,8 @@ class LoginAction extends Action { } } - function check_login() { + function check_login() + { # XXX: login throttle # CSRF protection - token set in common_notice_form() @@ -100,7 +103,8 @@ class LoginAction extends Action { common_redirect($url); } - function show_form($error=null) { + function show_form($error=null) + { common_show_header(_('Login'), null, $error, array($this, 'show_top')); common_element_start('form', array('method' => 'post', 'id' => 'login', @@ -120,7 +124,8 @@ class LoginAction extends Action { common_show_footer(); } - function get_instructions() { + function get_instructions() + { if (common_logged_in() && !common_is_real_login() && common_get_returnto()) @@ -138,7 +143,8 @@ class LoginAction extends Action { } } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('p', 'error', $error); } else { diff --git a/_darcs/pristine/actions/logout.php b/_darcs/pristine/actions/logout.php index 4c59e47ad..effb5abbe 100644 --- a/_darcs/pristine/actions/logout.php +++ b/_darcs/pristine/actions/logout.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/openid.php'); class LogoutAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_user_error(_('Not logged in.')); diff --git a/_darcs/pristine/actions/microsummary.php b/_darcs/pristine/actions/microsummary.php index ced4b0d1e..a19a26dcf 100644 --- a/_darcs/pristine/actions/microsummary.php +++ b/_darcs/pristine/actions/microsummary.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class MicrosummaryAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); diff --git a/_darcs/pristine/actions/newmessage.php b/_darcs/pristine/actions/newmessage.php index eb582c2a5..0a537ad2d 100644 --- a/_darcs/pristine/actions/newmessage.php +++ b/_darcs/pristine/actions/newmessage.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class NewmessageAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { @@ -33,7 +34,8 @@ class NewmessageAction extends Action { } } - function save_new_message() { + function save_new_message() + { $user = common_current_user(); assert($user); # XXX: maybe an error instead... @@ -89,7 +91,8 @@ class NewmessageAction extends Action { common_redirect($url, 303); } - function show_top($params) { + function show_top($params) + { list($content, $user, $to) = $params; @@ -98,7 +101,8 @@ class NewmessageAction extends Action { common_message_form($content, $user, $to); } - function show_form($msg=null) { + function show_form($msg=null) + { $content = $this->trimmed('content'); $user = common_current_user(); @@ -128,7 +132,8 @@ class NewmessageAction extends Action { common_show_footer(); } - function notify($from, $to, $message) { + function notify($from, $to, $message) + { mail_notify_message($message, $from, $to); # XXX: Jabber, SMS notifications... probably queued } diff --git a/_darcs/pristine/actions/newnotice.php b/_darcs/pristine/actions/newnotice.php index 98556c36b..1f6117c1e 100644 --- a/_darcs/pristine/actions/newnotice.php +++ b/_darcs/pristine/actions/newnotice.php @@ -23,7 +23,8 @@ require_once INSTALLDIR . '/lib/noticelist.php'; class NewnoticeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { @@ -43,7 +44,8 @@ class NewnoticeAction extends Action { } } - function save_new_notice() { + function save_new_notice() + { $user = common_current_user(); assert($user); # XXX: maybe an error instead... @@ -110,7 +112,8 @@ class NewnoticeAction extends Action { } } - function ajax_error_msg($msg) { + function ajax_error_msg($msg) + { common_start_html('text/xml;charset=utf-8', true); common_element_start('head'); common_element('title', null, _('Ajax Error')); @@ -121,11 +124,13 @@ class NewnoticeAction extends Action { common_element_end('html'); } - function show_top($content=null) { + function show_top($content=null) + { common_notice_form(null, $content); } - function show_form($msg=null) { + function show_form($msg=null) + { if ($msg && $this->boolean('ajax')) { $this->ajax_error_msg($msg); return; @@ -146,7 +151,8 @@ class NewnoticeAction extends Action { common_show_footer(); } - function show_notice($notice) { + function show_notice($notice) + { $nli = new NoticeListItem($notice); $nli->show(); } diff --git a/_darcs/pristine/actions/noticesearch.php b/_darcs/pristine/actions/noticesearch.php index 53d78e199..782c8fe98 100644 --- a/_darcs/pristine/actions/noticesearch.php +++ b/_darcs/pristine/actions/noticesearch.php @@ -25,15 +25,18 @@ require_once(INSTALLDIR.'/lib/searchaction.php'); class NoticesearchAction extends SearchAction { - function get_instructions() { + function get_instructions() + { return _('Search for notices on %%site.name%% by their contents. Separate search terms by spaces; they must be 3 characters or more.'); } - function get_title() { + function get_title() + { return _('Text search'); } - function show_results($q, $page) { + function show_results($q, $page) + { $notice = new Notice(); @@ -72,7 +75,8 @@ class NoticesearchAction extends SearchAction { $page, 'noticesearch', array('q' => $q)); } - function show_header($arr) { + function show_header($arr) + { if ($arr) { $q = $arr[0]; } @@ -87,7 +91,8 @@ class NoticesearchAction extends SearchAction { # XXX: refactor and combine with StreamAction::show_notice() - function show_notice($notice, $terms) { + function show_notice($notice, $terms) + { $profile = $notice->getProfile(); if (!$profile) { common_log_db_error($notice, 'SELECT', __FILE__); @@ -149,7 +154,8 @@ class NoticesearchAction extends SearchAction { common_element_end('li'); } - function highlight($text, $terms) { + function highlight($text, $terms) + { /* Highligh serach terms */ $pattern = '/('.implode('|',array_map('htmlspecialchars', $terms)).')/i'; $result = preg_replace($pattern, '\\1', $text); diff --git a/_darcs/pristine/actions/noticesearchrss.php b/_darcs/pristine/actions/noticesearchrss.php index d61234df8..c41d34873 100644 --- a/_darcs/pristine/actions/noticesearchrss.php +++ b/_darcs/pristine/actions/noticesearchrss.php @@ -25,11 +25,13 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); class NoticesearchrssAction extends Rss10Action { - function init() { + function init() + { return true; } - function get_notices($limit=0) { + function get_notices($limit=0) + { $q = $this->trimmed('q'); $notices = array(); @@ -54,7 +56,8 @@ class NoticesearchrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { global $config; $q = $this->trimmed('q'); $c = array('url' => common_local_url('noticesearchrss', array('q' => $q)), @@ -64,7 +67,8 @@ class NoticesearchrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { return null; } } diff --git a/_darcs/pristine/actions/nudge.php b/_darcs/pristine/actions/nudge.php index 6f3b4c95c..e0268e9d0 100644 --- a/_darcs/pristine/actions/nudge.php +++ b/_darcs/pristine/actions/nudge.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/mail.php'); class NudgeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { @@ -71,7 +72,8 @@ class NudgeAction extends Action { } } - function notify($user, $other) { + function notify($user, $other) + { if ($other->id != $user->id) { if ($other->email && $other->emailnotifynudge) { mail_notify_nudge($user, $other); diff --git a/_darcs/pristine/actions/openidlogin.php b/_darcs/pristine/actions/openidlogin.php index 1bf37f28f..b8681215e 100644 --- a/_darcs/pristine/actions/openidlogin.php +++ b/_darcs/pristine/actions/openidlogin.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); class OpenidloginAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (common_logged_in()) { common_user_error(_('Already logged in.')); @@ -56,11 +57,13 @@ class OpenidloginAction extends Action { } } - function get_instructions() { + function get_instructions() + { return _('Login with an [OpenID](%%doc.openid%%) account.'); } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('div', array('class' => 'error'), $error); } else { @@ -72,7 +75,8 @@ class OpenidloginAction extends Action { } } - function show_form($error=null, $openid_url) { + function show_form($error=null, $openid_url) + { common_show_header(_('OpenID Login'), null, $error, array($this, 'show_top')); $formaction = common_local_url('openidlogin'); common_element_start('form', array('method' => 'post', diff --git a/_darcs/pristine/actions/openidsettings.php b/_darcs/pristine/actions/openidsettings.php index 9c0eda6f0..ce4143d41 100644 --- a/_darcs/pristine/actions/openidsettings.php +++ b/_darcs/pristine/actions/openidsettings.php @@ -24,13 +24,15 @@ require_once(INSTALLDIR.'/lib/openid.php'); class OpenidsettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('[OpenID](%%doc.openid%%) lets you log into many sites ' . ' with the same user account. '. ' Manage your associated OpenIDs from here.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); @@ -116,7 +118,8 @@ class OpenidsettingsAction extends SettingsAction { common_show_footer(); } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -136,7 +139,8 @@ class OpenidsettingsAction extends SettingsAction { } } - function remove_openid() { + function remove_openid() + { $openid_url = $this->trimmed('openid_url'); $oid = User_openid::staticGet('canonical', $openid_url); diff --git a/_darcs/pristine/actions/opensearch.php b/_darcs/pristine/actions/opensearch.php index dcde160a4..f9c6f4c57 100644 --- a/_darcs/pristine/actions/opensearch.php +++ b/_darcs/pristine/actions/opensearch.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class OpensearchAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); diff --git a/_darcs/pristine/actions/othersettings.php b/_darcs/pristine/actions/othersettings.php index 1da6577cb..0c1418387 100644 --- a/_darcs/pristine/actions/othersettings.php +++ b/_darcs/pristine/actions/othersettings.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); class OthersettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('Manage various other options.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); $this->form_header(_('Other Settings'), $msg, $success); @@ -63,7 +65,8 @@ class OthersettingsAction extends SettingsAction { common_show_footer(); } - function show_feeds_list($feeds) { + function show_feeds_list($feeds) + { common_element_start('div', array('class' => 'feedsdel')); common_element('p', null, 'Feeds:'); common_element_start('ul', array('class' => 'xoxo')); @@ -76,7 +79,8 @@ class OthersettingsAction extends SettingsAction { } //TODO move to common.php (and retrace its origin) - function common_feed_item($feed) { + function common_feed_item($feed) + { $user = common_current_user(); $nickname = $user->nickname; @@ -131,7 +135,8 @@ class OthersettingsAction extends SettingsAction { // common_element_end('form'); // } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); @@ -147,7 +152,8 @@ class OthersettingsAction extends SettingsAction { } } - function save_preferences() { + function save_preferences() + { $urlshorteningservice = $this->trimmed('urlshorteningservice'); diff --git a/_darcs/pristine/actions/peoplesearch.php b/_darcs/pristine/actions/peoplesearch.php index a52ac317f..6d3f6a73f 100644 --- a/_darcs/pristine/actions/peoplesearch.php +++ b/_darcs/pristine/actions/peoplesearch.php @@ -24,16 +24,19 @@ require_once(INSTALLDIR.'/lib/profilelist.php'); class PeoplesearchAction extends SearchAction { - function get_instructions() { + function get_instructions() + { return _('Search for people on %%site.name%% by their name, location, or interests. ' . 'Separate the terms by spaces; they must be 3 characters or more.'); } - function get_title() { + function get_title() + { return _('People search'); } - function show_results($q, $page) { + function show_results($q, $page) + { $profile = new Profile(); @@ -71,14 +74,16 @@ class PeopleSearchResults extends ProfileList { var $terms = null; var $pattern = null; - function __construct($profile, $terms) { + function __construct($profile, $terms) + { parent::__construct($profile); $this->terms = array_map('preg_quote', array_map('htmlspecialchars', $terms)); $this->pattern = '/('.implode('|',$terms).')/i'; } - function highlight($text) { + function highlight($text) + { return preg_replace($this->pattern, '\\1', htmlspecialchars($text)); } } diff --git a/_darcs/pristine/actions/peopletag.php b/_darcs/pristine/actions/peopletag.php index 0327ecbc2..c7e463026 100644 --- a/_darcs/pristine/actions/peopletag.php +++ b/_darcs/pristine/actions/peopletag.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/profilelist.php'); class PeopletagAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -50,7 +51,8 @@ class PeopletagAction extends Action { common_show_footer(); } - function show_people($tag, $page) { + function show_people($tag, $page) + { $profile = new Profile(); @@ -83,7 +85,8 @@ class PeopletagAction extends Action { array('tag' => $tag)); } - function show_top($tag) { + function show_top($tag) + { $instr = sprintf(_('These are users who have tagged themselves "%s" ' . 'to show a common interest, characteristic, hobby or job.'), $tag); common_element_start('div', 'instructions'); @@ -93,11 +96,13 @@ class PeopletagAction extends Action { common_element_end('div'); } - function get_title() { + function get_title() + { return null; } - function show_header($arr) { + function show_header($arr) + { return; } } diff --git a/_darcs/pristine/actions/postnotice.php b/_darcs/pristine/actions/postnotice.php index 66e4dc806..8b0781dfd 100644 --- a/_darcs/pristine/actions/postnotice.php +++ b/_darcs/pristine/actions/postnotice.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); class PostnoticeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); try { common_remove_magic_from_request(); @@ -39,7 +40,8 @@ class PostnoticeAction extends Action { } } - function save_notice(&$req, &$consumer, &$token) { + function save_notice(&$req, &$consumer, &$token) + { $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { common_user_error(_('Unsupported OMB version'), 400); diff --git a/_darcs/pristine/actions/profilesettings.php b/_darcs/pristine/actions/profilesettings.php index 0fa1288dc..7f7ee17a5 100644 --- a/_darcs/pristine/actions/profilesettings.php +++ b/_darcs/pristine/actions/profilesettings.php @@ -23,12 +23,14 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); class ProfilesettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('You can update your personal profile info here '. 'so people know more about you.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $this->form_header(_('Profile settings'), $msg, $success); $this->show_settings_form(); common_element('h2', null, _('Avatar')); @@ -40,7 +42,8 @@ class ProfilesettingsAction extends SettingsAction { common_show_footer(); } - function handle_post() { + function handle_post() + { # CSRF protection @@ -60,7 +63,8 @@ class ProfilesettingsAction extends SettingsAction { } - function show_settings_form() { + function show_settings_form() + { $user = common_current_user(); $profile = $user->getProfile(); @@ -110,7 +114,8 @@ class ProfilesettingsAction extends SettingsAction { } - function show_avatar_form() { + function show_avatar_form() + { $user = common_current_user(); $profile = $user->getProfile(); @@ -168,7 +173,8 @@ class ProfilesettingsAction extends SettingsAction { } - function show_password_form() { + function show_password_form() + { $user = common_current_user(); common_element_start('form', array('method' => 'POST', @@ -190,7 +196,8 @@ class ProfilesettingsAction extends SettingsAction { common_element_end('form'); } - function save_profile() { + function save_profile() + { $nickname = $this->trimmed('nickname'); $fullname = $this->trimmed('fullname'); $homepage = $this->trimmed('homepage'); @@ -337,7 +344,8 @@ class ProfilesettingsAction extends SettingsAction { } - function upload_avatar() { + function upload_avatar() + { switch ($_FILES['avatarfile']['error']) { case UPLOAD_ERR_OK: # success, jump out break; @@ -384,7 +392,8 @@ class ProfilesettingsAction extends SettingsAction { @unlink($_FILES['avatarfile']['tmp_name']); } - function nickname_exists($nickname) { + function nickname_exists($nickname) + { $user = common_current_user(); $other = User::staticGet('nickname', $nickname); if (!$other) { @@ -394,7 +403,8 @@ class ProfilesettingsAction extends SettingsAction { } } - function change_password() { + function change_password() + { $user = common_current_user(); assert(!is_null($user)); # should already be checked diff --git a/_darcs/pristine/actions/public.php b/_darcs/pristine/actions/public.php index 60238e54d..62be3da99 100644 --- a/_darcs/pristine/actions/public.php +++ b/_darcs/pristine/actions/public.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/stream.php'); class PublicAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -41,7 +42,8 @@ class PublicAction extends StreamAction { common_show_footer(); } - function show_top() { + function show_top() + { if (common_logged_in()) { common_notice_form('public'); } else { @@ -64,13 +66,15 @@ class PublicAction extends StreamAction { 'item' => 'publicatom'))); } - function get_instructions() { + function get_instructions() + { return _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ([Read more](%%doc.help%%))'); } - function show_header() { + function show_header() + { common_element('link', array('rel' => 'alternate', 'href' => common_local_url('publicrss'), 'type' => 'application/rss+xml', @@ -80,7 +84,8 @@ class PublicAction extends StreamAction { 'content' => common_local_url('publicxrds'))); } - function show_notices($page) { + function show_notices($page) + { $cnt = 0; $notice = Notice::publicStream(($page-1)*NOTICES_PER_PAGE, diff --git a/_darcs/pristine/actions/publicrss.php b/_darcs/pristine/actions/publicrss.php index 764f0fae2..8e554122e 100644 --- a/_darcs/pristine/actions/publicrss.php +++ b/_darcs/pristine/actions/publicrss.php @@ -25,11 +25,13 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); class PublicrssAction extends Rss10Action { - function init() { + function init() + { return true; } - function get_notices($limit=0) { + function get_notices($limit=0) + { $notices = array(); @@ -42,7 +44,8 @@ class PublicrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { global $config; $c = array('url' => common_local_url('publicrss'), 'title' => sprintf(_('%s Public Stream'), $config['site']['name']), @@ -51,7 +54,8 @@ class PublicrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { return null; } } \ No newline at end of file diff --git a/_darcs/pristine/actions/publicxrds.php b/_darcs/pristine/actions/publicxrds.php index 5e3349185..63c80d81e 100644 --- a/_darcs/pristine/actions/publicxrds.php +++ b/_darcs/pristine/actions/publicxrds.php @@ -25,11 +25,13 @@ require_once(INSTALLDIR.'/lib/openid.php'); class PublicxrdsAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); @@ -55,7 +57,8 @@ class PublicxrdsAction extends Action { common_end_xml(); } - function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { + function show_service($type, $uri, $params=null, $sigs=null, $localId=null) + { common_element_start('Service'); if ($uri) { common_element('URI', null, $uri); diff --git a/_darcs/pristine/actions/recoverpassword.php b/_darcs/pristine/actions/recoverpassword.php index 068d582fa..a482d4711 100644 --- a/_darcs/pristine/actions/recoverpassword.php +++ b/_darcs/pristine/actions/recoverpassword.php @@ -25,7 +25,8 @@ define(MAX_RECOVERY_TIME, 24 * 60 * 60); class RecoverpasswordAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (common_logged_in()) { $this->client_error(_('You are already logged in!')); @@ -47,7 +48,8 @@ class RecoverpasswordAction extends Action { } } - function check_code() { + function check_code() + { $code = $this->trimmed('code'); $confirm = Confirm_address::staticGet('code', $code); @@ -113,12 +115,14 @@ class RecoverpasswordAction extends Action { $this->show_password_form(); } - function set_temp_user(&$user) { + function set_temp_user(&$user) + { common_ensure_session(); $_SESSION['tempuser'] = $user->id; } - function get_temp_user() { + function get_temp_user() + { common_ensure_session(); $user_id = $_SESSION['tempuser']; if ($user_id) { @@ -127,12 +131,14 @@ class RecoverpasswordAction extends Action { return $user; } - function clear_temp_user() { + function clear_temp_user() + { common_ensure_session(); unset($_SESSION['tempuser']); } - function show_top($msg=null) { + function show_top($msg=null) + { if ($msg) { common_element('div', 'error', $msg); } else { @@ -146,7 +152,8 @@ class RecoverpasswordAction extends Action { } } - function show_password_top($msg=null) { + function show_password_top($msg=null) + { if ($msg) { common_element('div', 'error', $msg); } else { @@ -156,7 +163,8 @@ class RecoverpasswordAction extends Action { } } - function show_form($msg=null) { + function show_form($msg=null) + { common_show_header(_('Recover password'), null, $msg, array($this, 'show_top')); @@ -173,7 +181,8 @@ class RecoverpasswordAction extends Action { common_show_footer(); } - function show_password_form($msg=null) { + function show_password_form($msg=null) + { common_show_header(_('Reset password'), null, $msg, array($this, 'show_password_top')); @@ -191,7 +200,8 @@ class RecoverpasswordAction extends Action { common_show_footer(); } - function recover_password() { + function recover_password() + { $nore = $this->trimmed('nicknameoremail'); if (!$nore) { $this->show_form(_('Enter a nickname or email address.')); @@ -274,7 +284,8 @@ class RecoverpasswordAction extends Action { common_show_footer(); } - function reset_password() { + function reset_password() + { # CSRF protection $token = $this->trimmed('token'); diff --git a/_darcs/pristine/actions/register.php b/_darcs/pristine/actions/register.php index f3eaf6122..444e67e35 100644 --- a/_darcs/pristine/actions/register.php +++ b/_darcs/pristine/actions/register.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class RegisterAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (common_config('site', 'closed')) { @@ -35,7 +36,8 @@ class RegisterAction extends Action { } } - function try_register() { + function try_register() + { $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -133,14 +135,16 @@ class RegisterAction extends Action { # checks if *CANONICAL* nickname exists - function nickname_exists($nickname) { + function nickname_exists($nickname) + { $user = User::staticGet('nickname', $nickname); return ($user !== false); } # checks if *CANONICAL* email exists - function email_exists($email) { + function email_exists($email) + { $email = common_canonical_email($email); if (!$email || strlen($email) == 0) { return false; @@ -149,7 +153,8 @@ class RegisterAction extends Action { return ($user !== false); } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('p', 'error', $error); } else { @@ -164,7 +169,8 @@ class RegisterAction extends Action { } } - function show_form($error=null) { + function show_form($error=null) + { global $config; $code = $this->trimmed('code'); @@ -236,7 +242,8 @@ class RegisterAction extends Action { common_show_footer(); } - function show_success() { + function show_success() + { $nickname = $this->arg('nickname'); common_show_header(_('Registration successful')); common_element_start('div', 'success'); diff --git a/_darcs/pristine/actions/remotesubscribe.php b/_darcs/pristine/actions/remotesubscribe.php index be2cb1025..02c026849 100644 --- a/_darcs/pristine/actions/remotesubscribe.php +++ b/_darcs/pristine/actions/remotesubscribe.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/omb.php'); class RemotesubscribeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -47,7 +48,8 @@ class RemotesubscribeAction extends Action { } } - function get_instructions() { + function get_instructions() + { return _('To subscribe, you can [login](%%action.login%%),' . ' or [register](%%action.register%%) a new ' . ' account. If you already have an account ' . @@ -55,7 +57,8 @@ class RemotesubscribeAction extends Action { ' enter your profile URL below.'); } - function show_top($err=null) { + function show_top($err=null) + { if ($err) { common_element('div', 'error', $err); } else { @@ -67,7 +70,8 @@ class RemotesubscribeAction extends Action { } } - function show_form($err=null) { + function show_form($err=null) + { $nickname = $this->trimmed('nickname'); $profile = $this->trimmed('profile_url'); common_show_header(_('Remote subscribe'), null, $err, @@ -86,7 +90,8 @@ class RemotesubscribeAction extends Action { common_show_footer(); } - function remote_subscription() { + function remote_subscription() + { $user = $this->get_user(); if (!$user) { @@ -152,7 +157,8 @@ class RemotesubscribeAction extends Action { $this->request_authorization($user, $omb, $token, $secret); } - function get_user() { + function get_user() + { $user = null; $nickname = $this->trimmed('nickname'); if ($nickname) { @@ -161,7 +167,8 @@ class RemotesubscribeAction extends Action { return $user; } - function getOmb($xrds) { + function getOmb($xrds) + { static $omb_endpoints = array(OMB_ENDPOINT_UPDATEPROFILE, OMB_ENDPOINT_POSTNOTICE); static $oauth_endpoints = array(OAUTH_ENDPOINT_REQUEST, OAUTH_ENDPOINT_AUTHORIZE, @@ -221,7 +228,8 @@ class RemotesubscribeAction extends Action { return $omb; } - function getXRD($main_service, $main_xrds) { + function getXRD($main_service, $main_xrds) + { $uri = omb_service_uri($main_service); if (strpos($uri, "#") !== 0) { # FIXME: more rigorous handling of external service definitions @@ -242,7 +250,8 @@ class RemotesubscribeAction extends Action { return null; } - function addServices($xrd, $types, &$omb) { + function addServices($xrd, $types, &$omb) + { foreach ($types as $type) { $matches = omb_get_services($xrd, $type); if ($matches) { @@ -255,7 +264,8 @@ class RemotesubscribeAction extends Action { return true; } - function request_token($omb) { + function request_token($omb) + { $con = omb_oauth_consumer(); $url = omb_service_uri($omb[OAUTH_ENDPOINT_REQUEST]); @@ -299,7 +309,8 @@ class RemotesubscribeAction extends Action { return array($return['oauth_token'], $return['oauth_token_secret']); } - function request_authorization($user, $omb, $token, $secret) { + function request_authorization($user, $omb, $token, $secret) + { global $config; # for license URL $con = omb_oauth_consumer(); @@ -380,7 +391,8 @@ class RemotesubscribeAction extends Action { return; } - function make_nonce() { + function make_nonce() + { return common_good_rand(16); } } diff --git a/_darcs/pristine/actions/replies.php b/_darcs/pristine/actions/replies.php index be80fae79..da2f27f31 100644 --- a/_darcs/pristine/actions/replies.php +++ b/_darcs/pristine/actions/replies.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/actions/showstream.php'); class RepliesAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -53,11 +54,13 @@ class RepliesAction extends StreamAction { common_show_footer(); } - function no_such_user() { + function no_such_user() + { common_user_error(_('No such user.')); } - function show_header($user) { + function show_header($user) + { common_element('link', array('rel' => 'alternate', 'href' => common_local_url('repliesrss', array('nickname' => $user->nickname)), @@ -65,7 +68,8 @@ class RepliesAction extends StreamAction { 'title' => sprintf(_('Feed for replies to %s'), $user->nickname))); } - function show_top($user) { + function show_top($user) + { $cur = common_current_user(); if ($cur && $cur->id == $user->id) { @@ -80,7 +84,8 @@ class RepliesAction extends StreamAction { 'item' => 'repliesrss'))); } - function show_replies($user) { + function show_replies($user) + { $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; diff --git a/_darcs/pristine/actions/repliesrss.php b/_darcs/pristine/actions/repliesrss.php index 9652ae9ea..19ab0866a 100644 --- a/_darcs/pristine/actions/repliesrss.php +++ b/_darcs/pristine/actions/repliesrss.php @@ -27,7 +27,8 @@ class RepliesrssAction extends Rss10Action { var $user = null; - function init() { + function init() + { $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); @@ -39,7 +40,8 @@ class RepliesrssAction extends Rss10Action { } } - function get_notices($limit=0) { + function get_notices($limit=0) + { $user = $this->user; @@ -54,7 +56,8 @@ class RepliesrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { $user = $this->user; $c = array('url' => common_local_url('repliesrss', array('nickname' => @@ -67,7 +70,8 @@ class RepliesrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { $user = $this->user; $profile = $user->getProfile(); if (!$profile) { diff --git a/_darcs/pristine/actions/requesttoken.php b/_darcs/pristine/actions/requesttoken.php index 4950d93c0..091846756 100644 --- a/_darcs/pristine/actions/requesttoken.php +++ b/_darcs/pristine/actions/requesttoken.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/omb.php'); class RequesttokenAction extends Action { - function is_readonly() { + function is_readonly() + { return false; } - function handle($args) { + function handle($args) + { parent::handle($args); try { common_remove_magic_from_request(); diff --git a/_darcs/pristine/actions/showfavorites.php b/_darcs/pristine/actions/showfavorites.php index 2fd1e586d..8131cac67 100644 --- a/_darcs/pristine/actions/showfavorites.php +++ b/_darcs/pristine/actions/showfavorites.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/actions/showstream.php'); class ShowfavoritesAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -53,7 +54,8 @@ class ShowfavoritesAction extends StreamAction { common_show_footer(); } - function show_header($user) { + function show_header($user) + { common_element('link', array('rel' => 'alternate', 'href' => common_local_url('favoritesrss', array('nickname' => $user->nickname)), @@ -61,7 +63,8 @@ class ShowfavoritesAction extends StreamAction { 'title' => sprintf(_('Feed for favorites of %s'), $user->nickname))); } - function show_top($user) { + function show_top($user) + { $cur = common_current_user(); if ($cur && $cur->id == $user->id) { @@ -75,7 +78,8 @@ class ShowfavoritesAction extends StreamAction { $this->views_menu(); } - function show_notices($user) { + function show_notices($user) + { $page = $this->trimmed('page'); if (!$page) { diff --git a/_darcs/pristine/actions/showmessage.php b/_darcs/pristine/actions/showmessage.php index a5e03c72d..b706fe2fa 100644 --- a/_darcs/pristine/actions/showmessage.php +++ b/_darcs/pristine/actions/showmessage.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/mailbox.php'); class ShowmessageAction extends MailboxAction { - function handle($args) { + function handle($args) + { Action::handle($args); @@ -44,13 +45,15 @@ class ShowmessageAction extends MailboxAction { } } - function get_message() { + function get_message() + { $id = $this->trimmed('message'); $message = Message::staticGet('id', $id); return $message; } - function get_title($user, $page) { + function get_title($user, $page) + { $message = $this->get_message(); if (!$message) { return null; @@ -70,14 +73,16 @@ class ShowmessageAction extends MailboxAction { return $title; } - function get_messages($user, $page) { + function get_messages($user, $page) + { $message = new Message(); $message->id = $this->trimmed('message'); $message->find(); return $message; } - function get_message_profile($message) { + function get_message_profile($message) + { $user = common_current_user(); if ($user->id == $message->from_profile) { return $message->getTo(); @@ -89,11 +94,13 @@ class ShowmessageAction extends MailboxAction { } } - function get_instructions() { + function get_instructions() + { return ''; } - function views_menu() { + function views_menu() + { return; } } diff --git a/_darcs/pristine/actions/shownotice.php b/_darcs/pristine/actions/shownotice.php index 04af61a6f..abdaa72ca 100644 --- a/_darcs/pristine/actions/shownotice.php +++ b/_darcs/pristine/actions/shownotice.php @@ -27,7 +27,8 @@ class ShownoticeAction extends StreamAction { var $profile = null; var $avatar = null; - function prepare($args) { + function prepare($args) + { parent::prepare($args); @@ -51,13 +52,15 @@ class ShownoticeAction extends StreamAction { return true; } - function last_modified() { + function last_modified() + { return max(strtotime($this->notice->created), strtotime($this->profile->modified), ($this->avatar) ? strtotime($this->avatar->modified) : 0); } - function etag() { + function etag() + { return 'W/"' . implode(':', array($this->arg('action'), common_language(), $this->notice->id, @@ -66,7 +69,8 @@ class ShownoticeAction extends StreamAction { ($this->avatar) ? strtotime($this->avatar->modified) : 0)) . '"'; } - function handle($args) { + function handle($args) + { parent::handle($args); @@ -84,7 +88,8 @@ class ShownoticeAction extends StreamAction { common_show_footer(); } - function show_header() { + function show_header() + { $user = User::staticGet($this->profile->id); @@ -103,14 +108,16 @@ class ShownoticeAction extends StreamAction { } } - function show_top() { + function show_top() + { $cur = common_current_user(); if ($cur && $cur->id == $this->profile->id) { common_notice_form(); } } - function no_such_notice() { + function no_such_notice() + { common_user_error(_('No such notice.')); } } diff --git a/_darcs/pristine/actions/showstream.php b/_darcs/pristine/actions/showstream.php index 485c2e3d1..c31bce87a 100644 --- a/_darcs/pristine/actions/showstream.php +++ b/_darcs/pristine/actions/showstream.php @@ -26,7 +26,8 @@ define('SUBSCRIPTIONS', 80); class ShowstreamAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -76,7 +77,8 @@ class ShowstreamAction extends StreamAction { common_show_footer(); } - function show_top($user) { + function show_top($user) + { $cur = common_current_user(); if ($cur && $cur->id == $user->id) { @@ -100,7 +102,8 @@ class ShowstreamAction extends StreamAction { 'item' => 'foaf'))); } - function show_header($user) { + function show_header($user) + { # Feeds common_element('link', array('rel' => 'alternate', 'href' => common_local_url('api', @@ -153,11 +156,13 @@ class ShowstreamAction extends StreamAction { array('nickname' => $profile->nickname)))); } - function no_such_user() { + function no_such_user() + { $this->client_error(_('No such user.'), 404); } - function show_profile($profile) { + function show_profile($profile) + { common_element_start('div', array('id' => 'profile', 'class' => 'vcard')); @@ -172,7 +177,8 @@ class ShowstreamAction extends StreamAction { common_element_end('div'); } - function show_personal($profile) { + function show_personal($profile) + { $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); common_element_start('div', array('id' => 'profile_avatar')); @@ -246,7 +252,8 @@ class ShowstreamAction extends StreamAction { common_element_end('div'); } - function show_remote_subscribe_link($profile) { + function show_remote_subscribe_link($profile) + { $url = common_local_url('remotesubscribe', array('nickname' => $profile->nickname)); common_element('a', array('href' => $url, @@ -254,7 +261,8 @@ class ShowstreamAction extends StreamAction { _('Subscribe')); } - function show_unsubscribe_form($profile) { + function show_unsubscribe_form($profile) + { common_element_start('form', array('id' => 'unsubscribe', 'method' => 'post', 'action' => common_local_url('unsubscribe'))); common_hidden('token', common_session_token()); @@ -268,7 +276,8 @@ class ShowstreamAction extends StreamAction { common_element_end('form'); } - function show_subscriptions($profile) { + function show_subscriptions($profile) + { global $config; $subs = DB_DataObject::factory('subscription'); @@ -340,7 +349,8 @@ class ShowstreamAction extends StreamAction { common_element_end('div'); } - function show_statistics($profile) { + function show_statistics($profile) + { // XXX: WORM cache this $subs = DB_DataObject::factory('subscription'); @@ -400,7 +410,8 @@ class ShowstreamAction extends StreamAction { common_element_end('div'); } - function show_notices($user) { + function show_notices($user) + { $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -413,7 +424,8 @@ class ShowstreamAction extends StreamAction { 'showstream', array('nickname' => $user->nickname)); } - function show_last_notice($profile) { + function show_last_notice($profile) + { common_element('h2', null, _('Currently')); @@ -438,13 +450,15 @@ class ShowstreamAction extends StreamAction { # We don't show the author for a profile, since we already know who it is! class ProfileNoticeList extends NoticeList { - function newListItem($notice) { + function newListItem($notice) + { return new ProfileNoticeListItem($notice); } } class ProfileNoticeListItem extends NoticeListItem { - function showAuthor() { + function showAuthor() + { return; } } diff --git a/_darcs/pristine/actions/smssettings.php b/_darcs/pristine/actions/smssettings.php index 71ab39514..470a042ed 100644 --- a/_darcs/pristine/actions/smssettings.php +++ b/_darcs/pristine/actions/smssettings.php @@ -24,11 +24,13 @@ require_once(INSTALLDIR.'/actions/emailsettings.php'); class SmssettingsAction extends EmailsettingsAction { - function get_instructions() { + function get_instructions() + { return _('You can receive SMS messages through email from %%site.name%%.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); $this->form_header(_('SMS Settings'), $msg, $success); common_element_start('form', array('method' => 'post', @@ -103,7 +105,8 @@ class SmssettingsAction extends EmailsettingsAction { common_show_footer(); } - function get_confirmation() { + function get_confirmation() + { $user = common_current_user(); $confirm = new Confirm_address(); $confirm->user_id = $user->id; @@ -115,7 +118,8 @@ class SmssettingsAction extends EmailsettingsAction { } } - function handle_post() { + function handle_post() + { # CSRF protection @@ -144,7 +148,8 @@ class SmssettingsAction extends EmailsettingsAction { } } - function save_preferences() { + function save_preferences() + { $smsnotify = $this->boolean('smsnotify'); @@ -171,7 +176,8 @@ class SmssettingsAction extends EmailsettingsAction { $this->show_form(_('Preferences saved.'), true); } - function add_address() { + function add_address() + { $user = common_current_user(); @@ -226,7 +232,8 @@ class SmssettingsAction extends EmailsettingsAction { $this->show_form($msg, TRUE); } - function cancel_confirmation() { + function cancel_confirmation() + { $sms = $this->trimmed('sms'); $carrier = $this->trimmed('carrier'); @@ -253,7 +260,8 @@ class SmssettingsAction extends EmailsettingsAction { $this->show_form(_('Confirmation cancelled.'), TRUE); } - function remove_address() { + function remove_address() + { $user = common_current_user(); $sms = $this->arg('sms'); @@ -282,7 +290,8 @@ class SmssettingsAction extends EmailsettingsAction { $this->show_form(_('The address was removed.'), TRUE); } - function sms_exists($sms) { + function sms_exists($sms) + { $user = common_current_user(); $other = User::staticGet('sms', $sms); if (!$other) { @@ -292,7 +301,8 @@ class SmssettingsAction extends EmailsettingsAction { } } - function carrier_select() { + function carrier_select() + { $carrier = new Sms_carrier(); $cnt = $carrier->find(); @@ -316,7 +326,8 @@ class SmssettingsAction extends EmailsettingsAction { common_config('site', 'email'))); } - function confirm_code() { + function confirm_code() + { $code = $this->trimmed('code'); diff --git a/_darcs/pristine/actions/subedit.php b/_darcs/pristine/actions/subedit.php index db935eb28..874102857 100644 --- a/_darcs/pristine/actions/subedit.php +++ b/_darcs/pristine/actions/subedit.php @@ -23,7 +23,8 @@ class SubeditAction extends Action { var $profile = null; - function prepare($args) { + function prepare($args) + { parent::prepare($args); @@ -56,7 +57,8 @@ class SubeditAction extends Action { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $cur = common_current_user(); diff --git a/_darcs/pristine/actions/subscribe.php b/_darcs/pristine/actions/subscribe.php index c94c4d7eb..93884f081 100644 --- a/_darcs/pristine/actions/subscribe.php +++ b/_darcs/pristine/actions/subscribe.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class SubscribeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { diff --git a/_darcs/pristine/actions/subscribers.php b/_darcs/pristine/actions/subscribers.php index b9ca92af3..8c7805f51 100644 --- a/_darcs/pristine/actions/subscribers.php +++ b/_darcs/pristine/actions/subscribers.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/gallery.php'); class SubscribersAction extends GalleryAction { - function gallery_type() { + function gallery_type() + { return _('Subscribers'); } - function get_instructions(&$profile) { + function get_instructions(&$profile) + { $user =& common_current_user(); if ($user && ($user->id == $profile->id)) { return _('These are the people who listen to your notices.'); @@ -36,25 +38,30 @@ class SubscribersAction extends GalleryAction { } } - function fields() { + function fields() + { return array('subscriber', 'subscribed'); } - function div_class() { + function div_class() + { return 'subscribers'; } - function get_other(&$subs) { + function get_other(&$subs) + { return $subs->subscriber; } - function profile_list_class() { + function profile_list_class() + { return 'SubscribersList'; } } class SubscribersList extends ProfileList { - function show_owner_controls($profile) { + function show_owner_controls($profile) + { common_block_form($profile, array('action' => 'subscribers', 'nickname' => $this->owner->nickname)); } diff --git a/_darcs/pristine/actions/subscriptions.php b/_darcs/pristine/actions/subscriptions.php index c24f23a07..ad4a3f9e5 100644 --- a/_darcs/pristine/actions/subscriptions.php +++ b/_darcs/pristine/actions/subscriptions.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/gallery.php'); class SubscriptionsAction extends GalleryAction { - function gallery_type() { + function gallery_type() + { return _('Subscriptions'); } - function get_instructions(&$profile) { + function get_instructions(&$profile) + { $user =& common_current_user(); if ($user && ($user->id == $profile->id)) { return _('These are the people whose notices you listen to.'); @@ -36,26 +38,31 @@ class SubscriptionsAction extends GalleryAction { } } - function fields() { + function fields() + { return array('subscribed', 'subscriber'); } - function div_class() { + function div_class() + { return 'subscriptions'; } - function get_other(&$subs) { + function get_other(&$subs) + { return $subs->subscribed; } - function profile_list_class() { + function profile_list_class() + { return 'SubscriptionsList'; } } class SubscriptionsList extends ProfileList { - function show_owner_controls($profile) { + function show_owner_controls($profile) + { $sub = Subscription::pkeyGet(array('subscriber' => $this->owner->id, 'subscribed' => $profile->id)); diff --git a/_darcs/pristine/actions/sup.php b/_darcs/pristine/actions/sup.php index 3c9cbea2c..2a139b322 100644 --- a/_darcs/pristine/actions/sup.php +++ b/_darcs/pristine/actions/sup.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class SupAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -42,7 +43,8 @@ class SupAction extends Action { 'updates' => $updates)); } - function available_periods() { + function available_periods() + { static $periods = array(86400, 43200, 21600, 7200, 3600, 1800, 600, 300, 120, 60, 30, 15); @@ -55,7 +57,8 @@ class SupAction extends Action { return $available; } - function get_updates($seconds) { + function get_updates($seconds) + { $notice = new Notice(); # XXX: cache this. Depends on how big this protocol becomes; @@ -75,7 +78,8 @@ class SupAction extends Action { return $updates; } - function is_readonly() { + function is_readonly() + { return true; } } diff --git a/_darcs/pristine/actions/tag.php b/_darcs/pristine/actions/tag.php index 1325b85a5..d7b35d613 100644 --- a/_darcs/pristine/actions/tag.php +++ b/_darcs/pristine/actions/tag.php @@ -24,7 +24,8 @@ define('TAGS_PER_PAGE', 100); class TagAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -46,7 +47,8 @@ class TagAction extends StreamAction { common_show_footer(); } - function show_header($tag = false) { + function show_header($tag = false) + { if ($tag) { common_element('link', array('rel' => 'alternate', 'href' => common_local_url('tagrss', array('tag' => $tag)), @@ -55,11 +57,13 @@ class TagAction extends StreamAction { } } - function get_instructions() { + function get_instructions() + { return _('Showing most popular tags from the last week'); } - function show_top($tag = false) { + function show_top($tag = false) + { if (!$tag) { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); @@ -124,7 +128,8 @@ class TagAction extends StreamAction { } } - function show_tag($tag, $weight, $relative) { + function show_tag($tag, $weight, $relative) + { # XXX: these should probably tune to the size of the site if ($relative > 0.1) { @@ -149,7 +154,8 @@ class TagAction extends StreamAction { common_text(' '); } - function show_notices($tag) { + function show_notices($tag) + { $cnt = 0; diff --git a/_darcs/pristine/actions/tagother.php b/_darcs/pristine/actions/tagother.php index 4691fef07..ed17ac531 100644 --- a/_darcs/pristine/actions/tagother.php +++ b/_darcs/pristine/actions/tagother.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); class TagotherAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -49,7 +50,8 @@ class TagotherAction extends Action { } } - function show_form($profile, $error=null) { + function show_form($profile, $error=null) + { $user = common_current_user(); @@ -103,7 +105,8 @@ class TagotherAction extends Action { } - function save_tags() { + function save_tags() + { $id = $this->trimmed('id'); $tagstring = $this->trimmed('tags'); @@ -178,7 +181,8 @@ class TagotherAction extends Action { } } - function show_top($arr = null) { + function show_top($arr = null) + { list($profile, $error) = $arr; if ($error) { common_element('p', 'error', $error); diff --git a/_darcs/pristine/actions/tagrss.php b/_darcs/pristine/actions/tagrss.php index 6199a285d..bb4edf473 100644 --- a/_darcs/pristine/actions/tagrss.php +++ b/_darcs/pristine/actions/tagrss.php @@ -25,7 +25,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); class TagrssAction extends Rss10Action { - function init() { + function init() + { $tag = $this->trimmed('tag'); $this->tag = Notice_tag::staticGet('tag', $tag); @@ -37,7 +38,8 @@ class TagrssAction extends Rss10Action { } } - function get_notices($limit=0) { + function get_notices($limit=0) + { $tag = $this->tag; if (is_null($tag)) { @@ -53,7 +55,8 @@ class TagrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { $tag = $this->tag->tag; $c = array('url' => common_local_url('tagrss', array('tag' => $tagname)), diff --git a/_darcs/pristine/actions/twitapiaccount.php b/_darcs/pristine/actions/twitapiaccount.php index b1caa3481..d5e9143c2 100644 --- a/_darcs/pristine/actions/twitapiaccount.php +++ b/_darcs/pristine/actions/twitapiaccount.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapiaccountAction extends TwitterapiAction { - function verify_credentials($args, $apidata) { + function verify_credentials($args, $apidata) + { parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { @@ -34,12 +35,14 @@ class TwitapiaccountAction extends TwitterapiAction { $this->show_extended_profile($apidata['user'], $apidata); } - function end_session($args, $apidata) { + function end_session($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } - function update_location($args, $apidata) { + function update_location($args, $apidata) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { @@ -84,12 +87,14 @@ class TwitapiaccountAction extends TwitterapiAction { } - function update_delivery_device($args, $apidata) { + function update_delivery_device($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } - function rate_limit_status($args, $apidata) { + function rate_limit_status($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } diff --git a/_darcs/pristine/actions/twitapiblocks.php b/_darcs/pristine/actions/twitapiblocks.php index 16b2e76bc..2170141f1 100644 --- a/_darcs/pristine/actions/twitapiblocks.php +++ b/_darcs/pristine/actions/twitapiblocks.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapiblocksAction extends TwitterapiAction { - function create($args, $apidata) { + function create($args, $apidata) + { parent::handle($args); @@ -46,7 +47,8 @@ class TwitapiblocksAction extends TwitterapiAction { } } - function destroy($args, $apidata) { + function destroy($args, $apidata) + { parent::handle($args); $blockee = $this->get_user($apidata['api_arg'], $apidata); diff --git a/_darcs/pristine/actions/twitapidirect_messages.php b/_darcs/pristine/actions/twitapidirect_messages.php index 7adb4eadd..e9f7aa0bf 100644 --- a/_darcs/pristine/actions/twitapidirect_messages.php +++ b/_darcs/pristine/actions/twitapidirect_messages.php @@ -23,17 +23,20 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class Twitapidirect_messagesAction extends TwitterapiAction { - function direct_messages($args, $apidata) { + function direct_messages($args, $apidata) + { parent::handle($args); return $this->show_messages($args, $apidata, 'received'); } - function sent($args, $apidata) { + function sent($args, $apidata) + { parent::handle($args); return $this->show_messages($args, $apidata, 'sent'); } - function show_messages($args, $apidata, $type) { + function show_messages($args, $apidata, $type) + { $user = $apidata['user']; @@ -110,7 +113,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } // had to change this from "new" to "create" to avoid PHP reserved word - function create($args, $apidata) { + function create($args, $apidata) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { @@ -173,12 +177,14 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } - function destroy($args, $apidata) { + function destroy($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } - function show_xml_dmsgs($message) { + function show_xml_dmsgs($message) + { $this->init_document('xml'); common_element_start('direct-messages', array('type' => 'array')); @@ -200,7 +206,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } - function show_json_dmsgs($message) { + function show_json_dmsgs($message) + { $this->init_document('json'); @@ -223,7 +230,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } - function show_rss_dmsgs($message, $title, $link, $subtitle) { + function show_rss_dmsgs($message, $title, $link, $subtitle) + { $this->init_document('rss'); @@ -252,7 +260,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } - function show_atom_dmsgs($message, $title, $link, $subtitle) { + function show_atom_dmsgs($message, $title, $link, $subtitle) + { $this->init_document('atom'); @@ -279,7 +288,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } // swiped from MessageAction. Should it be place in util.php? - function notify($from, $to, $message) { + function notify($from, $to, $message) + { mail_notify_message($message, $from, $to); # XXX: Jabber, SMS notifications... probably queued } diff --git a/_darcs/pristine/actions/twitapifavorites.php b/_darcs/pristine/actions/twitapifavorites.php index ad8c5f18b..e7a43f770 100644 --- a/_darcs/pristine/actions/twitapifavorites.php +++ b/_darcs/pristine/actions/twitapifavorites.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapifavoritesAction extends TwitterapiAction { - function favorites($args, $apidata) { + function favorites($args, $apidata) + { parent::handle($args); $this->auth_user = $apidata['user']; @@ -85,7 +86,8 @@ class TwitapifavoritesAction extends TwitterapiAction { } - function create($args, $apidata) { + function create($args, $apidata) + { parent::handle($args); // Check for RESTfulness @@ -134,14 +136,16 @@ class TwitapifavoritesAction extends TwitterapiAction { } - function destroy($args, $apidata) { + function destroy($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } // XXX: these two funcs swiped from faves. Maybe put in util.php, or some common base class? - function notify($fave, $notice, $user) { + function notify($fave, $notice, $user) + { $other = User::staticGet('id', $notice->profile_id); if ($other && $other->id != $user->id) { if ($other->email && $other->emailnotifyfav) { @@ -152,7 +156,8 @@ class TwitapifavoritesAction extends TwitterapiAction { } } - function notify_mail($other, $user, $notice) { + function notify_mail($other, $user, $notice) + { $profile = $user->getProfile(); $bestname = $profile->getBestName(); $subject = sprintf(_('%s added your notice as a favorite'), $bestname); diff --git a/_darcs/pristine/actions/twitapifriendships.php b/_darcs/pristine/actions/twitapifriendships.php index a52f0fe4d..a59cb543c 100644 --- a/_darcs/pristine/actions/twitapifriendships.php +++ b/_darcs/pristine/actions/twitapifriendships.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapifriendshipsAction extends TwitterapiAction { - function create($args, $apidata) { + function create($args, $apidata) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { @@ -75,7 +76,8 @@ class TwitapifriendshipsAction extends TwitterapiAction { } - function destroy($args, $apidata) { + function destroy($args, $apidata) + { parent::handle($args); if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { @@ -110,7 +112,8 @@ class TwitapifriendshipsAction extends TwitterapiAction { } - function exists($args, $apidata) { + function exists($args, $apidata) + { parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { diff --git a/_darcs/pristine/actions/twitapihelp.php b/_darcs/pristine/actions/twitapihelp.php index f0e9adfdb..27262f089 100644 --- a/_darcs/pristine/actions/twitapihelp.php +++ b/_darcs/pristine/actions/twitapihelp.php @@ -27,7 +27,8 @@ class TwitapihelpAction extends TwitterapiAction { * URL:http://identi.ca/api/help/test.format * Formats: xml, json */ - function test($args, $apidata) { + function test($args, $apidata) + { parent::handle($args); if ($apidata['content-type'] == 'xml') { @@ -44,7 +45,8 @@ class TwitapihelpAction extends TwitterapiAction { } - function downtime_schedule($args, $apidata) { + function downtime_schedule($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } diff --git a/_darcs/pristine/actions/twitapinotifications.php b/_darcs/pristine/actions/twitapinotifications.php index 26f66d7e5..e24d3829c 100644 --- a/_darcs/pristine/actions/twitapinotifications.php +++ b/_darcs/pristine/actions/twitapinotifications.php @@ -24,12 +24,14 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); # This naming convention looks real sick class TwitapinotificationsAction extends TwitterapiAction { - function follow($args, $apidata) { + function follow($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } - function leave($args, $apidata) { + function leave($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } diff --git a/_darcs/pristine/actions/twitapistatuses.php b/_darcs/pristine/actions/twitapistatuses.php index ffa94b309..f280184c0 100644 --- a/_darcs/pristine/actions/twitapistatuses.php +++ b/_darcs/pristine/actions/twitapistatuses.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapistatusesAction extends TwitterapiAction { - function public_timeline($args, $apidata) { + function public_timeline($args, $apidata) + { parent::handle($args); $sitename = common_config('site', 'name'); @@ -84,7 +85,8 @@ class TwitapistatusesAction extends TwitterapiAction { } - function friends_timeline($args, $apidata) { + function friends_timeline($args, $apidata) + { parent::handle($args); $since = $this->arg('since'); @@ -146,7 +148,8 @@ class TwitapistatusesAction extends TwitterapiAction { } - function user_timeline($args, $apidata) { + function user_timeline($args, $apidata) + { parent::handle($args); $this->auth_user = $apidata['user']; @@ -226,7 +229,8 @@ class TwitapistatusesAction extends TwitterapiAction { } - function update($args, $apidata) { + function update($args, $apidata) + { parent::handle($args); @@ -321,7 +325,8 @@ class TwitapistatusesAction extends TwitterapiAction { $this->show($args, $apidata); } - function replies($args, $apidata) { + function replies($args, $apidata) + { parent::handle($args); @@ -388,7 +393,8 @@ class TwitapistatusesAction extends TwitterapiAction { } - function show($args, $apidata) { + function show($args, $apidata) + { parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { @@ -413,7 +419,8 @@ class TwitapistatusesAction extends TwitterapiAction { } - function destroy($args, $apidata) { + function destroy($args, $apidata) + { parent::handle($args); @@ -457,18 +464,21 @@ class TwitapistatusesAction extends TwitterapiAction { } - function friends($args, $apidata) { + function friends($args, $apidata) + { parent::handle($args); return $this->subscriptions($apidata, 'subscribed', 'subscriber'); } - function followers($args, $apidata) { + function followers($args, $apidata) + { parent::handle($args); return $this->subscriptions($apidata, 'subscriber', 'subscribed'); } - function subscriptions($apidata, $other_attr, $user_attr) { + function subscriptions($apidata, $other_attr, $user_attr) + { # XXX: lite @@ -523,7 +533,8 @@ class TwitapistatusesAction extends TwitterapiAction { $this->end_document($type); } - function show_profiles($profiles, $type) { + function show_profiles($profiles, $type) + { switch ($type) { case 'xml': common_element_start('users', array('type' => 'array')); @@ -544,12 +555,14 @@ class TwitapistatusesAction extends TwitterapiAction { } } - function featured($args, $apidata) { + function featured($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } - function supported($cmd) { + function supported($cmd) + { $cmdlist = array('MessageCommand', 'SubCommand', 'UnsubCommand', 'FavCommand', 'OnCommand', 'OffCommand'); diff --git a/_darcs/pristine/actions/twitapiusers.php b/_darcs/pristine/actions/twitapiusers.php index 43f6969f4..4644e6be6 100644 --- a/_darcs/pristine/actions/twitapiusers.php +++ b/_darcs/pristine/actions/twitapiusers.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapiusersAction extends TwitterapiAction { - function show($args, $apidata) { + function show($args, $apidata) + { parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { diff --git a/_darcs/pristine/actions/twittersettings.php b/_darcs/pristine/actions/twittersettings.php index 8cbd39fbd..437bdd363 100644 --- a/_darcs/pristine/actions/twittersettings.php +++ b/_darcs/pristine/actions/twittersettings.php @@ -25,12 +25,14 @@ define('SUBSCRIPTIONS', 80); class TwittersettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('Add your Twitter account to automatically send your notices to Twitter, ' . 'and subscribe to Twitter friends already here.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); $profile = $user->getProfile(); $fuser = null; @@ -91,7 +93,8 @@ class TwittersettingsAction extends SettingsAction { common_show_footer(); } - function subscribed_twitter_users() { + function subscribed_twitter_users() + { $current_user = common_current_user(); @@ -119,7 +122,8 @@ class TwittersettingsAction extends SettingsAction { return $users; } - function show_twitter_subscriptions() { + function show_twitter_subscriptions() + { $friends = $this->subscribed_twitter_users(); $friends_count = count($friends); @@ -180,7 +184,8 @@ class TwittersettingsAction extends SettingsAction { } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); @@ -200,7 +205,8 @@ class TwittersettingsAction extends SettingsAction { } } - function add_twitter_acct() { + function add_twitter_acct() + { $screen_name = $this->trimmed('twitter_username'); $password = $this->trimmed('twitter_password'); @@ -261,7 +267,8 @@ class TwittersettingsAction extends SettingsAction { $this->show_form(_('Twitter settings saved.'), true); } - function remove_twitter_acct() { + function remove_twitter_acct() + { $user = common_current_user(); $flink = Foreign_link::getByUserID($user->id, 1); @@ -284,7 +291,8 @@ class TwittersettingsAction extends SettingsAction { $this->show_form(_('Twitter account removed.'), TRUE); } - function save_preferences() { + function save_preferences() + { $noticesync = $this->boolean('noticesync'); $friendsync = $this->boolean('friendsync'); @@ -330,7 +338,8 @@ class TwittersettingsAction extends SettingsAction { $this->show_form(_('Twitter preferences saved.')); } - function verify_credentials($screen_name, $password) { + function verify_credentials($screen_name, $password) + { $uri = 'http://twitter.com/account/verify_credentials.json'; $data = get_twitter_data($uri, $screen_name, $password); @@ -353,7 +362,8 @@ class TwittersettingsAction extends SettingsAction { return false; } - function set_flags(&$flink, $noticesync, $replysync, $friendsync) { + function set_flags(&$flink, $noticesync, $replysync, $friendsync) + { if ($noticesync) { $flink->noticesync |= FOREIGN_NOTICE_SEND; } else { diff --git a/_darcs/pristine/actions/unblock.php b/_darcs/pristine/actions/unblock.php index 51ec0ae57..66ce0c879 100644 --- a/_darcs/pristine/actions/unblock.php +++ b/_darcs/pristine/actions/unblock.php @@ -23,7 +23,8 @@ class UnblockAction extends Action { var $profile = null; - function prepare($args) { + function prepare($args) + { parent::prepare($args); @@ -56,14 +57,16 @@ class UnblockAction extends Action { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->unblock_profile(); } } - function unblock_profile() { + function unblock_profile() + { $cur = common_current_user(); diff --git a/_darcs/pristine/actions/unsubscribe.php b/_darcs/pristine/actions/unsubscribe.php index 38fcc21de..e4e04aaa0 100644 --- a/_darcs/pristine/actions/unsubscribe.php +++ b/_darcs/pristine/actions/unsubscribe.php @@ -19,7 +19,8 @@ class UnsubscribeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_user_error(_('Not logged in.')); diff --git a/_darcs/pristine/actions/updateprofile.php b/_darcs/pristine/actions/updateprofile.php index 4b4bb53a1..2cfff1b51 100644 --- a/_darcs/pristine/actions/updateprofile.php +++ b/_darcs/pristine/actions/updateprofile.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/omb.php'); class UpdateprofileAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); try { common_remove_magic_from_request(); @@ -40,7 +41,8 @@ class UpdateprofileAction extends Action { } } - function update_profile($req, $consumer, $token) { + function update_profile($req, $consumer, $token) + { $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { $this->client_error(_('Unsupported OMB version'), 400); diff --git a/_darcs/pristine/actions/userauthorization.php b/_darcs/pristine/actions/userauthorization.php index 58ec36fc8..ecaa33167 100644 --- a/_darcs/pristine/actions/userauthorization.php +++ b/_darcs/pristine/actions/userauthorization.php @@ -24,7 +24,8 @@ define('TIMESTAMP_THRESHOLD', 300); class UserauthorizationAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] == 'POST') { @@ -69,7 +70,8 @@ class UserauthorizationAction extends Action { } } - function show_form($req) { + function show_form($req) + { $nickname = $req->get_parameter('omb_listenee_nickname'); $profile = $req->get_parameter('omb_listenee_profile'); @@ -129,7 +131,8 @@ class UserauthorizationAction extends Action { common_show_footer(); } - function send_authorization() { + function send_authorization() + { $req = $this->get_stored_request(); if (!$req) { @@ -197,7 +200,8 @@ class UserauthorizationAction extends Action { } } - function authorize_token(&$req) { + function authorize_token(&$req) + { $consumer_key = $req->get_parameter('oauth_consumer_key'); $token_field = $req->get_parameter('oauth_token'); common_debug('consumer key = "'.$consumer_key.'"', __FILE__); @@ -222,7 +226,8 @@ class UserauthorizationAction extends Action { # XXX: refactor with similar code in finishremotesubscribe.php - function save_remote_profile(&$req) { + function save_remote_profile(&$req) + { # FIXME: we should really do this when the consumer comes # back for an access token. If they never do, we've got stuff in a # weird state. @@ -312,13 +317,15 @@ class UserauthorizationAction extends Action { return TRUE; } - function add_avatar($profile, $url) { + function add_avatar($profile, $url) + { $temp_filename = tempnam(sys_get_temp_dir(), 'listenee_avatar'); copy($url, $temp_filename); return $profile->setOriginal($temp_filename); } - function show_accept_message($tok) { + function show_accept_message($tok) + { common_show_header(_('Subscription authorized')); common_element('p', null, _('The subscription has been authorized, but no '. @@ -328,7 +335,8 @@ class UserauthorizationAction extends Action { common_show_footer(); } - function show_reject_message($tok) { + function show_reject_message($tok) + { common_show_header(_('Subscription rejected')); common_element('p', null, _('The subscription has been rejected, but no '. @@ -337,23 +345,27 @@ class UserauthorizationAction extends Action { common_show_footer(); } - function store_request($req) { + function store_request($req) + { common_ensure_session(); $_SESSION['userauthorizationrequest'] = $req; } - function clear_request() { + function clear_request() + { common_ensure_session(); unset($_SESSION['userauthorizationrequest']); } - function get_stored_request() { + function get_stored_request() + { common_ensure_session(); $req = $_SESSION['userauthorizationrequest']; return $req; } - function get_new_request() { + function get_new_request() + { common_remove_magic_from_request(); $req = OAuthRequest::from_request(); return $req; @@ -361,7 +373,8 @@ class UserauthorizationAction extends Action { # Throws an OAuthException if anything goes wrong - function validate_request(&$req) { + function validate_request(&$req) + { # OAuth stuff -- have to copy from OAuth.php since they're # all private methods, and there's no user-authentication method common_debug('checking version', __FILE__); @@ -384,7 +397,8 @@ class UserauthorizationAction extends Action { return true; } - function validate_omb(&$req) { + function validate_omb(&$req) + { foreach (array('omb_version', 'omb_listener', 'omb_listenee', 'omb_listenee_profile', 'omb_listenee_nickname', 'omb_listenee_license') as $param) @@ -498,7 +512,8 @@ class UserauthorizationAction extends Action { # Snagged from OAuthServer - function check_version(&$req) { + function check_version(&$req) + { $version = $req->get_parameter("oauth_version"); if (!$version) { $version = 1.0; @@ -511,7 +526,8 @@ class UserauthorizationAction extends Action { # Snagged from OAuthServer - function get_consumer($datastore, $req) { + function get_consumer($datastore, $req) + { $consumer_key = @$req->get_parameter("oauth_consumer_key"); if (!$consumer_key) { throw new OAuthException("Invalid consumer key"); @@ -526,7 +542,8 @@ class UserauthorizationAction extends Action { # Mostly cadged from OAuthServer - function get_token($datastore, &$req, $consumer) {/*{{{*/ + function get_token($datastore, &$req, $consumer) + {/*{{{*/ $token_field = @$req->get_parameter('oauth_token'); $token = $datastore->lookup_token($consumer, 'request', $token_field); if (!$token) { @@ -535,7 +552,8 @@ class UserauthorizationAction extends Action { return $token; } - function check_timestamp(&$req) { + function check_timestamp(&$req) + { $timestamp = @$req->get_parameter('oauth_timestamp'); $now = time(); if ($now - $timestamp > TIMESTAMP_THRESHOLD) { @@ -544,7 +562,8 @@ class UserauthorizationAction extends Action { } # NOTE: don't call twice on the same request; will fail! - function check_nonce(&$datastore, &$req, $consumer, $token) { + function check_nonce(&$datastore, &$req, $consumer, $token) + { $timestamp = @$req->get_parameter('oauth_timestamp'); $nonce = @$req->get_parameter('oauth_nonce'); $found = $datastore->lookup_nonce($consumer, $token, $nonce, $timestamp); @@ -554,7 +573,8 @@ class UserauthorizationAction extends Action { return true; } - function check_signature(&$req, $consumer, $token) { + function check_signature(&$req, $consumer, $token) + { $signature_method = $this->get_signature_method($req); $signature = $req->get_parameter('oauth_signature'); $valid_sig = $signature_method->check_signature($req, @@ -566,7 +586,8 @@ class UserauthorizationAction extends Action { } } - function get_signature_method(&$req) { + function get_signature_method(&$req) + { $signature_method = @$req->get_parameter("oauth_signature_method"); if (!$signature_method) { $signature_method = "PLAINTEXT"; diff --git a/_darcs/pristine/actions/userbyid.php b/_darcs/pristine/actions/userbyid.php index 3fa92e9ce..d7b4088bd 100644 --- a/_darcs/pristine/actions/userbyid.php +++ b/_darcs/pristine/actions/userbyid.php @@ -21,11 +21,13 @@ if (!defined('LACONICA')) { exit(1); } class UserbyidAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); $id = $this->trimmed('id'); if (!$id) { diff --git a/_darcs/pristine/actions/userrss.php b/_darcs/pristine/actions/userrss.php index 6089718ae..c758a44e2 100644 --- a/_darcs/pristine/actions/userrss.php +++ b/_darcs/pristine/actions/userrss.php @@ -27,7 +27,8 @@ class UserrssAction extends Rss10Action { var $user = null; - function init() { + function init() + { $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); @@ -39,7 +40,8 @@ class UserrssAction extends Rss10Action { } } - function get_notices($limit=0) { + function get_notices($limit=0) + { $user = $this->user; @@ -56,7 +58,8 @@ class UserrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { $user = $this->user; $profile = $user->getProfile(); $c = array('url' => common_local_url('userrss', @@ -68,7 +71,8 @@ class UserrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { $user = $this->user; $profile = $user->getProfile(); if (!$profile) { @@ -82,7 +86,8 @@ class UserrssAction extends Rss10Action { # override parent to add X-SUP-ID URL - function init_rss($limit=0) { + function init_rss($limit=0) + { $url = common_local_url('sup', null, $this->user->id); header('X-SUP-ID: '.$url); parent::init_rss($limit); diff --git a/_darcs/pristine/actions/xrds.php b/_darcs/pristine/actions/xrds.php index 54baf64be..1d4961d46 100644 --- a/_darcs/pristine/actions/xrds.php +++ b/_darcs/pristine/actions/xrds.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/omb.php'); class XrdsAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); $nickname = $this->trimmed('nickname'); $user = User::staticGet('nickname', $nickname); @@ -38,7 +40,8 @@ class XrdsAction extends Action { $this->show_xrds($user); } - function show_xrds($user) { + function show_xrds($user) + { header('Content-Type: application/xrds+xml'); @@ -108,7 +111,8 @@ class XrdsAction extends Action { common_end_xml(); } - function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { + function show_service($type, $uri, $params=null, $sigs=null, $localId=null) + { common_element_start('Service'); if ($uri) { common_element('URI', null, $uri); diff --git a/_darcs/pristine/classes/Avatar.php b/_darcs/pristine/classes/Avatar.php index bde983d79..3c754ec2d 100644 --- a/_darcs/pristine/classes/Avatar.php +++ b/_darcs/pristine/classes/Avatar.php @@ -21,14 +21,16 @@ class Avatar extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Avatar',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Avatar',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE # We clean up the file, too - function delete() { + function delete() + { $filename = $this->filename; if (parent::delete()) { @unlink(common_avatar_path($filename)); @@ -38,7 +40,8 @@ class Avatar extends Memcached_DataObject # Create and save scaled version of this avatar # XXX: maybe break into different methods - function scale($size) { + function scale($size) + { $image_s = imagecreatetruecolor($size, $size); $image_a = $this->to_image(); @@ -76,7 +79,8 @@ class Avatar extends Memcached_DataObject } } - function to_image() { + function to_image() + { $filepath = common_avatar_path($this->filename); if ($this->mediatype == 'image/gif') { return imagecreatefromgif($filepath); @@ -89,7 +93,8 @@ class Avatar extends Memcached_DataObject } } - function &pkeyGet($kv) { + function &pkeyGet($kv) + { return Memcached_DataObject::pkeyGet('Avatar', $kv); } } diff --git a/_darcs/pristine/classes/Channel.php b/_darcs/pristine/classes/Channel.php index ea3530406..02ece9c0f 100644 --- a/_darcs/pristine/classes/Channel.php +++ b/_darcs/pristine/classes/Channel.php @@ -21,23 +21,28 @@ if (!defined('LACONICA')) { exit(1); } class Channel { - function on($user) { + function on($user) + { return false; } - function off($user) { + function off($user) + { return false; } - function output($user, $text) { + function output($user, $text) + { return false; } - function error($user, $text) { + function error($user, $text) + { return false; } - function source() { + function source() + { return null; } } @@ -46,33 +51,40 @@ class XMPPChannel extends Channel { var $conn = null; - function source() { + function source() + { return 'xmpp'; } - function __construct($conn) { + function __construct($conn) + { $this->conn = $conn; } - function on($user) { + function on($user) + { return $this->set_notify($user, 1); } - function off($user) { + function off($user) + { return $this->set_notify($user, 0); } - function output($user, $text) { + function output($user, $text) + { $text = '['.common_config('site', 'name') . '] ' . $text; jabber_send_message($user->jabber, $text); } - function error($user, $text) { + function error($user, $text) + { $text = '['.common_config('site', 'name') . '] ' . $text; jabber_send_message($user->jabber, $text); } - function set_notify(&$user, $notify) { + function set_notify(&$user, $notify) + { $orig = clone($user); $user->jabbernotify = $notify; $result = $user->update($orig); @@ -94,19 +106,23 @@ class XMPPChannel extends Channel { class WebChannel extends Channel { - function source() { + function source() + { return 'web'; } - function on($user) { + function on($user) + { return false; } - function off($user) { + function off($user) + { return false; } - function output($user, $text) { + function output($user, $text) + { # XXX: buffer all output and send it at the end # XXX: even better, redirect to appropriate page # depending on what command was run @@ -115,7 +131,8 @@ class WebChannel extends Channel { common_show_footer(); } - function error($user, $text) { + function error($user, $text) + { common_user_error($text); } } @@ -123,7 +140,8 @@ class WebChannel extends Channel { class AjaxWebChannel extends WebChannel { - function output($user, $text) { + function output($user, $text) + { common_start_html('text/xml;charset=utf-8', true); common_element_start('head'); common_element('title', null, _('Command results')); @@ -134,7 +152,8 @@ class AjaxWebChannel extends WebChannel { common_element_end('html'); } - function error($user, $text) { + function error($user, $text) + { common_start_html('text/xml;charset=utf-8', true); common_element_start('head'); common_element('title', null, _('Ajax Error')); @@ -151,23 +170,28 @@ class MailChannel extends Channel { var $addr = null; - function source() { + function source() + { return 'mail'; } - function __construct($addr=null) { + function __construct($addr=null) + { $this->addr = $addr; } - function on($user) { + function on($user) + { return $this->set_notify($user, 1); } - function off($user) { + function off($user) + { return $this->set_notify($user, 0); } - function output($user, $text) { + function output($user, $text) + { $headers['From'] = $user->incomingemail; $headers['To'] = $this->addr; @@ -177,7 +201,8 @@ class MailChannel extends Channel { return mail_send(array($this->addr), $headers, $text); } - function error($user, $text) { + function error($user, $text) + { $headers['From'] = $user->incomingemail; $headers['To'] = $this->addr; @@ -187,7 +212,8 @@ class MailChannel extends Channel { return mail_send(array($this->addr), $headers, $text); } - function set_notify($user, $value) { + function set_notify($user, $value) + { $orig = clone($user); $user->smsnotify = $value; $result = $user->update($orig); diff --git a/_darcs/pristine/classes/Command.php b/_darcs/pristine/classes/Command.php index b146005a7..407a6ecba 100644 --- a/_darcs/pristine/classes/Command.php +++ b/_darcs/pristine/classes/Command.php @@ -25,17 +25,20 @@ class Command { var $user = null; - function __construct($user=null) { + function __construct($user=null) + { $this->user = $user; } - function execute($channel) { + function execute($channel) + { return false; } } class UnimplementedCommand extends Command { - function execute($channel) { + function execute($channel) + { $channel->error($this->user, _("Sorry, this command is not yet implemented.")); } } @@ -48,7 +51,8 @@ class TrackOffCommand extends UnimplementedCommand { class TrackCommand extends UnimplementedCommand { var $word = null; - function __construct($user, $word) { + function __construct($user, $word) + { parent::__construct($user); $this->word = $word; } @@ -56,7 +60,8 @@ class TrackCommand extends UnimplementedCommand { class UntrackCommand extends UnimplementedCommand { var $word = null; - function __construct($user, $word) { + function __construct($user, $word) + { parent::__construct($user); $this->word = $word; } @@ -64,7 +69,8 @@ class UntrackCommand extends UnimplementedCommand { class NudgeCommand extends UnimplementedCommand { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } @@ -72,14 +78,16 @@ class NudgeCommand extends UnimplementedCommand { class InviteCommand extends UnimplementedCommand { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } } class StatsCommand extends Command { - function execute($channel) { + function execute($channel) + { $subs = new Subscription(); $subs->subscriber = $this->user->id; @@ -106,12 +114,14 @@ class FavCommand extends Command { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { $recipient = common_relative_profile($this->user, common_canonical_nickname($this->other)); @@ -149,12 +159,14 @@ class FavCommand extends Command { class WhoisCommand extends Command { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { $recipient = common_relative_profile($this->user, common_canonical_nickname($this->other)); @@ -184,13 +196,15 @@ class WhoisCommand extends Command { class MessageCommand extends Command { var $other = null; var $text = null; - function __construct($user, $other, $text) { + function __construct($user, $other, $text) + { parent::__construct($user); $this->other = $other; $this->text = $text; } - function execute($channel) { + function execute($channel) + { $other = User::staticGet('nickname', common_canonical_nickname($this->other)); $len = mb_strlen($this->text); if ($len == 0) { @@ -227,12 +241,14 @@ class GetCommand extends Command { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { $target_nickname = common_canonical_nickname($this->other); $target = @@ -257,12 +273,14 @@ class SubCommand extends Command { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { if (!$this->other) { $channel->error($this->user, _('Specify the name of the user to subscribe to')); @@ -283,12 +301,14 @@ class UnsubCommand extends Command { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { if(!$this->other) { $channel->error($this->user, _('Specify the name of the user to unsubscribe from')); return; @@ -306,11 +326,13 @@ class UnsubCommand extends Command { class OffCommand extends Command { var $other = null; - function __construct($user, $other=null) { + function __construct($user, $other=null) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { if ($other) { $channel->error($this->user, _("Command not yet implemented.")); } else { @@ -325,12 +347,14 @@ class OffCommand extends Command { class OnCommand extends Command { var $other = null; - function __construct($user, $other=null) { + function __construct($user, $other=null) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { if ($other) { $channel->error($this->user, _("Command not yet implemented.")); } else { @@ -344,7 +368,8 @@ class OnCommand extends Command { } class HelpCommand extends Command { - function execute($channel) { + function execute($channel) + { $channel->output($this->user, _("Commands:\n". "on - turn on notifications\n". diff --git a/_darcs/pristine/classes/CommandInterpreter.php b/_darcs/pristine/classes/CommandInterpreter.php index db02ce541..ff078bb05 100644 --- a/_darcs/pristine/classes/CommandInterpreter.php +++ b/_darcs/pristine/classes/CommandInterpreter.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/classes/Command.php'); class CommandInterpreter { - function handle_command($user, $text) { + function handle_command($user, $text) + { # XXX: localise $text = preg_replace('/\s+/', ' ', trim($text)); diff --git a/_darcs/pristine/classes/Confirm_address.php b/_darcs/pristine/classes/Confirm_address.php index 71f2d0c72..ed3875d22 100644 --- a/_darcs/pristine/classes/Confirm_address.php +++ b/_darcs/pristine/classes/Confirm_address.php @@ -20,10 +20,12 @@ class Confirm_address extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function sequenceKey() { return array(false, false); } + function sequenceKey() + { return array(false, false); } } diff --git a/_darcs/pristine/classes/Consumer.php b/_darcs/pristine/classes/Consumer.php index c598312aa..d5b7b7e33 100644 --- a/_darcs/pristine/classes/Consumer.php +++ b/_darcs/pristine/classes/Consumer.php @@ -16,7 +16,8 @@ class Consumer extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Consumer',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Consumer',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/Fave.php b/_darcs/pristine/classes/Fave.php index 5d938d149..24df5938c 100644 --- a/_darcs/pristine/classes/Fave.php +++ b/_darcs/pristine/classes/Fave.php @@ -15,7 +15,8 @@ class Fave extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Fave',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Fave',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE @@ -31,7 +32,8 @@ class Fave extends Memcached_DataObject return $fave; } - function &pkeyGet($kv) { + function &pkeyGet($kv) + { return Memcached_DataObject::pkeyGet('Fave', $kv); } } diff --git a/_darcs/pristine/classes/Foreign_link.php b/_darcs/pristine/classes/Foreign_link.php index 41a95e641..79a4d262d 100644 --- a/_darcs/pristine/classes/Foreign_link.php +++ b/_darcs/pristine/classes/Foreign_link.php @@ -21,7 +21,8 @@ class Foreign_link extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE @@ -55,7 +56,8 @@ class Foreign_link extends Memcached_DataObject } # Convenience methods - function getForeignUser() { + function getForeignUser() + { $fuser = new Foreign_user(); $fuser->service = $this->service; $fuser->id = $this->foreign_id; @@ -69,7 +71,8 @@ class Foreign_link extends Memcached_DataObject return null; } - function getUser() { + function getUser() + { return User::staticGet($this->user_id); } diff --git a/_darcs/pristine/classes/Foreign_service.php b/_darcs/pristine/classes/Foreign_service.php index 128411b71..ef614dbd6 100644 --- a/_darcs/pristine/classes/Foreign_service.php +++ b/_darcs/pristine/classes/Foreign_service.php @@ -17,7 +17,8 @@ class Foreign_service extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/Foreign_subscription.php b/_darcs/pristine/classes/Foreign_subscription.php index d8e8569fb..d50860621 100644 --- a/_darcs/pristine/classes/Foreign_subscription.php +++ b/_darcs/pristine/classes/Foreign_subscription.php @@ -16,7 +16,8 @@ class Foreign_subscription extends Memcached_DataObject public $created; // datetime() not_null /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/Foreign_user.php b/_darcs/pristine/classes/Foreign_user.php index f8a980884..61727abe5 100644 --- a/_darcs/pristine/classes/Foreign_user.php +++ b/_darcs/pristine/classes/Foreign_user.php @@ -18,7 +18,8 @@ class Foreign_user extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE @@ -39,7 +40,8 @@ class Foreign_user extends Memcached_DataObject return null; } - function updateKeys(&$orig) { + function updateKeys(&$orig) + { $parts = array(); foreach (array('id', 'service', 'uri', 'nickname') as $k) { if (strcmp($this->$k, $orig->$k) != 0) { diff --git a/_darcs/pristine/classes/Invitation.php b/_darcs/pristine/classes/Invitation.php index ff6456445..8a36fd8df 100644 --- a/_darcs/pristine/classes/Invitation.php +++ b/_darcs/pristine/classes/Invitation.php @@ -17,7 +17,8 @@ class Invitation extends Memcached_DataObject public $created; // datetime() not_null /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Invitation',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Invitation',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/Memcached_DataObject.php b/_darcs/pristine/classes/Memcached_DataObject.php index 1d12730c9..b9f599dbc 100644 --- a/_darcs/pristine/classes/Memcached_DataObject.php +++ b/_darcs/pristine/classes/Memcached_DataObject.php @@ -23,7 +23,8 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; class Memcached_DataObject extends DB_DataObject { - function &staticGet($cls, $k, $v=null) { + function &staticGet($cls, $k, $v=null) + { if (is_null($v)) { $v = $k; # XXX: HACK! @@ -44,7 +45,8 @@ class Memcached_DataObject extends DB_DataObject } } - function &pkeyGet($cls, $kv) { + function &pkeyGet($cls, $kv) + { $i = Memcached_DataObject::multicache($cls, $kv); if ($i) { return $i; @@ -62,12 +64,14 @@ class Memcached_DataObject extends DB_DataObject } } - function insert() { + function insert() + { $result = parent::insert(); return $result; } - function update($orig=null) { + function update($orig=null) + { if (is_object($orig) && $orig instanceof Memcached_DataObject) { $orig->decache(); # might be different keys } @@ -78,7 +82,8 @@ class Memcached_DataObject extends DB_DataObject return $result; } - function delete() { + function delete() + { $this->decache(); # while we still have the values! return parent::delete(); } @@ -100,7 +105,8 @@ class Memcached_DataObject extends DB_DataObject } } - function keyTypes() { + function keyTypes() + { global $_DB_DATAOBJECT; if (!isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"])) { $this->databaseStructure(); @@ -109,7 +115,8 @@ class Memcached_DataObject extends DB_DataObject return $_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"]; } - function encache() { + function encache() + { $c = $this->memcache(); if (!$c) { return false; @@ -133,7 +140,8 @@ class Memcached_DataObject extends DB_DataObject } } - function decache() { + function decache() + { $c = $this->memcache(); if (!$c) { return false; @@ -158,7 +166,8 @@ class Memcached_DataObject extends DB_DataObject } } - function multicache($cls, $kv) { + function multicache($cls, $kv) + { ksort($kv); $c = Memcached_DataObject::memcache(); if (!$c) { @@ -170,7 +179,8 @@ class Memcached_DataObject extends DB_DataObject } } - function getSearchEngine($table) { + function getSearchEngine($table) + { require_once INSTALLDIR.'/lib/search_engines.php'; static $search_engine; if (!isset($search_engine)) { diff --git a/_darcs/pristine/classes/Message.php b/_darcs/pristine/classes/Message.php index e04fbb3c0..4806057b4 100644 --- a/_darcs/pristine/classes/Message.php +++ b/_darcs/pristine/classes/Message.php @@ -22,16 +22,19 @@ class Message extends Memcached_DataObject public $source; // varchar(32) /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Message',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Message',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function getFrom() { + function getFrom() + { return Profile::staticGet('id', $this->from_profile); } - function getTo() { + function getTo() + { return Profile::staticGet('id', $this->to_profile); } diff --git a/_darcs/pristine/classes/Nonce.php b/_darcs/pristine/classes/Nonce.php index 54d20de9c..2c0edfa14 100644 --- a/_darcs/pristine/classes/Nonce.php +++ b/_darcs/pristine/classes/Nonce.php @@ -18,7 +18,8 @@ class Nonce extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Nonce',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Nonce',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/Notice.php b/_darcs/pristine/classes/Notice.php index e6152812c..d3aa4e828 100644 --- a/_darcs/pristine/classes/Notice.php +++ b/_darcs/pristine/classes/Notice.php @@ -48,23 +48,27 @@ class Notice extends Memcached_DataObject public $source; // varchar(32) /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Notice',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function getProfile() { + function getProfile() + { return Profile::staticGet('id', $this->profile_id); } - function delete() { + function delete() + { $this->blowCaches(true); $this->blowFavesCache(true); $this->blowInboxes(); return parent::delete(); } - function saveTags() { + function saveTags() + { /* extract all #hastags */ $count = preg_match_all('/(?:^|\s)#([A-Za-z0-9_\-\.]{1,64})/', strtolower($this->content), $match); if (!$count) { @@ -184,7 +188,8 @@ class Notice extends Memcached_DataObject return true; } - function blowCaches($blowLast=false) { + function blowCaches($blowLast=false) + { $this->blowSubsCache($blowLast); $this->blowNoticeCache($blowLast); $this->blowRepliesCache($blowLast); @@ -192,7 +197,8 @@ class Notice extends Memcached_DataObject $this->blowTagCache($blowLast); } - function blowTagCache($blowLast=false) { + function blowTagCache($blowLast=false) + { $cache = common_memcache(); if ($cache) { $tag = new Notice_tag(); @@ -210,7 +216,8 @@ class Notice extends Memcached_DataObject } } - function blowSubsCache($blowLast=false) { + function blowSubsCache($blowLast=false) + { $cache = common_memcache(); if ($cache) { $user = new User(); @@ -230,7 +237,8 @@ class Notice extends Memcached_DataObject } } - function blowNoticeCache($blowLast=false) { + function blowNoticeCache($blowLast=false) + { if ($this->is_local) { $cache = common_memcache(); if ($cache) { @@ -242,7 +250,8 @@ class Notice extends Memcached_DataObject } } - function blowRepliesCache($blowLast=false) { + function blowRepliesCache($blowLast=false) + { $cache = common_memcache(); if ($cache) { $reply = new Reply(); @@ -260,7 +269,8 @@ class Notice extends Memcached_DataObject } } - function blowPublicCache($blowLast=false) { + function blowPublicCache($blowLast=false) + { if ($this->is_local == 1) { $cache = common_memcache(); if ($cache) { @@ -272,7 +282,8 @@ class Notice extends Memcached_DataObject } } - function blowFavesCache($blowLast=false) { + function blowFavesCache($blowLast=false) + { $cache = common_memcache(); if ($cache) { $fave = new Fave(); @@ -477,7 +488,8 @@ class Notice extends Memcached_DataObject return $wrapper; } - function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) { + function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) + { $parts = array(); @@ -499,7 +511,8 @@ class Notice extends Memcached_DataObject $offset, $limit, $since_id, $before_id, null, $since); } - function addToInboxes() { + function addToInboxes() + { $enabled = common_config('inboxes', 'enabled'); if ($enabled === true || $enabled === 'transitional') { @@ -522,7 +535,8 @@ class Notice extends Memcached_DataObject # Delete from inboxes if we're deleted. - function blowInboxes() { + function blowInboxes() + { $enabled = common_config('inboxes', 'enabled'); diff --git a/_darcs/pristine/classes/NoticeWrapper.php b/_darcs/pristine/classes/NoticeWrapper.php index 19ae37c1b..e1b27c2f7 100644 --- a/_darcs/pristine/classes/NoticeWrapper.php +++ b/_darcs/pristine/classes/NoticeWrapper.php @@ -38,11 +38,13 @@ class NoticeWrapper extends Notice { var $notices = null; var $i = -1; - function __construct($arr) { + function __construct($arr) + { $this->notices = $arr; } - function fetch() { + function fetch() + { static $fields = array('id', 'profile_id', 'uri', 'content', 'rendered', 'url', 'created', 'modified', 'reply_to', 'is_local', 'source'); $this->i++; diff --git a/_darcs/pristine/classes/Notice_inbox.php b/_darcs/pristine/classes/Notice_inbox.php index 922ba2660..81ddb4538 100644 --- a/_darcs/pristine/classes/Notice_inbox.php +++ b/_darcs/pristine/classes/Notice_inbox.php @@ -33,7 +33,8 @@ class Notice_inbox extends Memcached_DataObject public $source; // tinyint(1) default_1 /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/Notice_source.php b/_darcs/pristine/classes/Notice_source.php index a12397b0b..e7568bbca 100644 --- a/_darcs/pristine/classes/Notice_source.php +++ b/_darcs/pristine/classes/Notice_source.php @@ -17,7 +17,8 @@ class Notice_source extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_source',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Notice_source',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/Notice_tag.php b/_darcs/pristine/classes/Notice_tag.php index 8c3911f76..94f9296d6 100644 --- a/_darcs/pristine/classes/Notice_tag.php +++ b/_darcs/pristine/classes/Notice_tag.php @@ -30,7 +30,8 @@ class Notice_tag extends Memcached_DataObject public $created; // datetime() not_null /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE @@ -46,7 +47,8 @@ class Notice_tag extends Memcached_DataObject $offset, $limit); } - function blowCache() { + function blowCache() + { $cache = common_memcache(); if ($cache) { $cache->delete(common_cache_key('notice_tag:notice_stream:' . $this->tag)); diff --git a/_darcs/pristine/classes/Profile.php b/_darcs/pristine/classes/Profile.php index b95cbf993..fb6ff90f1 100644 --- a/_darcs/pristine/classes/Profile.php +++ b/_darcs/pristine/classes/Profile.php @@ -41,12 +41,14 @@ class Profile extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Profile',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function getAvatar($width, $height=null) { + function getAvatar($width, $height=null) + { if (is_null($height)) { $height = $width; } @@ -55,7 +57,8 @@ class Profile extends Memcached_DataObject 'height' => $height)); } - function getOriginalAvatar() { + function getOriginalAvatar() + { $avatar = DB_DataObject::factory('avatar'); $avatar->profile_id = $this->id; $avatar->original = true; @@ -66,7 +69,8 @@ class Profile extends Memcached_DataObject } } - function setOriginal($source) { + function setOriginal($source) + { $info = @getimagesize($source); @@ -117,7 +121,8 @@ class Profile extends Memcached_DataObject return $avatar; } - function delete_avatars() { + function delete_avatars() + { $avatar = new Avatar(); $avatar->profile_id = $this->id; $avatar->find(); @@ -127,12 +132,14 @@ class Profile extends Memcached_DataObject return true; } - function getBestName() { + function getBestName() + { return ($this->fullname) ? $this->fullname : $this->nickname; } # Get latest notice on or before date; default now - function getCurrentNotice($dt=null) { + function getCurrentNotice($dt=null) + { $notice = new Notice(); $notice->profile_id = $this->id; if ($dt) { @@ -146,7 +153,8 @@ class Profile extends Memcached_DataObject return null; } - function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) { + function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) + { $qry = 'SELECT * ' . 'FROM notice ' . diff --git a/_darcs/pristine/classes/Profile_block.php b/_darcs/pristine/classes/Profile_block.php index 41d6701eb..551e690e2 100644 --- a/_darcs/pristine/classes/Profile_block.php +++ b/_darcs/pristine/classes/Profile_block.php @@ -36,12 +36,14 @@ class Profile_block extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_block',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Profile_block',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function get($blocker, $blocked) { + function get($blocker, $blocked) + { return Memcached_DataObject::pkeyGet('Profile_block', array('blocker' => $blocker, 'blocked' => $blocked)); diff --git a/_darcs/pristine/classes/Profile_tag.php b/_darcs/pristine/classes/Profile_tag.php index 5c508c84f..cb60cbaec 100644 --- a/_darcs/pristine/classes/Profile_tag.php +++ b/_darcs/pristine/classes/Profile_tag.php @@ -16,7 +16,8 @@ class Profile_tag extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/Queue_item.php b/_darcs/pristine/classes/Queue_item.php index f2fc0be03..1b34d8ab4 100644 --- a/_darcs/pristine/classes/Queue_item.php +++ b/_darcs/pristine/classes/Queue_item.php @@ -16,12 +16,14 @@ class Queue_item extends Memcached_DataObject public $claimed; // datetime() /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Queue_item',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Queue_item',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function sequenceKey() { return array(false, false); } + function sequenceKey() + { return array(false, false); } static function top($transport) { diff --git a/_darcs/pristine/classes/Remember_me.php b/_darcs/pristine/classes/Remember_me.php index 9d3f9378f..8dc29bfa3 100644 --- a/_darcs/pristine/classes/Remember_me.php +++ b/_darcs/pristine/classes/Remember_me.php @@ -15,10 +15,12 @@ class Remember_me extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remember_me',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Remember_me',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function sequenceKey() { return array(false, false); } + function sequenceKey() + { return array(false, false); } } diff --git a/_darcs/pristine/classes/Remote_profile.php b/_darcs/pristine/classes/Remote_profile.php index 66b0f3a5c..5aa6d913e 100644 --- a/_darcs/pristine/classes/Remote_profile.php +++ b/_darcs/pristine/classes/Remote_profile.php @@ -38,7 +38,8 @@ class Remote_profile extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/Reply.php b/_darcs/pristine/classes/Reply.php index 10d6ced5b..af86aaf87 100644 --- a/_darcs/pristine/classes/Reply.php +++ b/_darcs/pristine/classes/Reply.php @@ -16,7 +16,8 @@ class Reply extends Memcached_DataObject public $replied_id; // int(4) /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Reply',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Reply',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/Sms_carrier.php b/_darcs/pristine/classes/Sms_carrier.php index b4a9d8655..ffa12de29 100644 --- a/_darcs/pristine/classes/Sms_carrier.php +++ b/_darcs/pristine/classes/Sms_carrier.php @@ -17,12 +17,14 @@ class Sms_carrier extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function toEmailAddress($sms) { + function toEmailAddress($sms) + { return sprintf($this->email_pattern, $sms); } } diff --git a/_darcs/pristine/classes/Subscription.php b/_darcs/pristine/classes/Subscription.php index d70f99550..3fe0d167f 100644 --- a/_darcs/pristine/classes/Subscription.php +++ b/_darcs/pristine/classes/Subscription.php @@ -40,12 +40,14 @@ class Subscription extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Subscription',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Subscription',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function &pkeyGet($kv) { + function &pkeyGet($kv) + { return Memcached_DataObject::pkeyGet('Subscription', $kv); } } diff --git a/_darcs/pristine/classes/Token.php b/_darcs/pristine/classes/Token.php index 3c88444c8..1fabd72f1 100644 --- a/_darcs/pristine/classes/Token.php +++ b/_darcs/pristine/classes/Token.php @@ -19,7 +19,8 @@ class Token extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Token',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Token',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/classes/User.php b/_darcs/pristine/classes/User.php index 29e6a86e9..90d0ccfe0 100644 --- a/_darcs/pristine/classes/User.php +++ b/_darcs/pristine/classes/User.php @@ -62,16 +62,19 @@ class User extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('User',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function getProfile() { + function getProfile() + { return Profile::staticGet('id', $this->id); } - function isSubscribed($other) { + function isSubscribed($other) + { assert(!is_null($other)); # XXX: cache results of this query $sub = Subscription::pkeyGet(array('subscriber' => $this->id, @@ -81,7 +84,8 @@ class User extends Memcached_DataObject # 'update' won't write key columns, so we have to do it ourselves. - function updateKeys(&$orig) { + function updateKeys(&$orig) + { $parts = array(); foreach (array('nickname', 'email', 'jabber', 'incomingemail', 'sms', 'carrier', 'smsemail', 'language', 'timezone') as $k) { if (strcmp($this->$k, $orig->$k) != 0) { @@ -108,7 +112,8 @@ class User extends Memcached_DataObject return $result; } - function allowed_nickname($nickname) { + function allowed_nickname($nickname) + { # XXX: should already be validated for size, content, etc. static $blacklist = array('rss', 'xrds', 'doc', 'main', 'settings', 'notice', 'user', @@ -118,7 +123,8 @@ class User extends Memcached_DataObject return !in_array($nickname, $merged); } - function getCurrentNotice($dt=null) { + function getCurrentNotice($dt=null) + { $profile = $this->getProfile(); if (!$profile) { return null; @@ -126,11 +132,13 @@ class User extends Memcached_DataObject return $profile->getCurrentNotice($dt); } - function getCarrier() { + function getCarrier() + { return Sms_carrier::staticGet('id', $this->carrier); } - function subscribeTo($other) { + function subscribeTo($other) + { $sub = new Subscription(); $sub->subscriber = $this->id; $sub->subscribed = $other->id; @@ -144,7 +152,8 @@ class User extends Memcached_DataObject return true; } - function hasBlocked($other) { + function hasBlocked($other) + { $block = Profile_block::get($this->id, $other->id); @@ -271,7 +280,8 @@ class User extends Memcached_DataObject # Things we do when the email changes - function emailChanged() { + function emailChanged() + { $invites = new Invitation(); $invites->address = $this->email; @@ -285,7 +295,8 @@ class User extends Memcached_DataObject } } - function hasFave($notice) { + function hasFave($notice) + { $cache = common_memcache(); # XXX: Kind of a hack. @@ -317,12 +328,14 @@ class User extends Memcached_DataObject 'notice_id' => $notice->id)); return ((is_null($fave)) ? false : true); } - function mutuallySubscribed($other) { + function mutuallySubscribed($other) + { return $this->isSubscribed($other) && $other->isSubscribed($this); } - function mutuallySubscribedUsers() { + function mutuallySubscribedUsers() + { # 3-way join; probably should get cached $qry = 'SELECT user.* ' . @@ -336,7 +349,8 @@ class User extends Memcached_DataObject return $user; } - function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { + function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) + { $qry = 'SELECT notice.* ' . 'FROM notice JOIN reply ON notice.id = reply.notice_id ' . @@ -346,7 +360,8 @@ class User extends Memcached_DataObject $offset, $limit, $since_id, $before_id, null, $since); } - function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { + function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) + { $profile = $this->getProfile(); if (!$profile) { return null; @@ -355,7 +370,8 @@ class User extends Memcached_DataObject } } - function favoriteNotices($offset=0, $limit=NOTICES_PER_PAGE) { + function favoriteNotices($offset=0, $limit=NOTICES_PER_PAGE) + { $qry = 'SELECT notice.* ' . 'FROM notice JOIN fave ON notice.id = fave.notice_id ' . @@ -365,7 +381,8 @@ class User extends Memcached_DataObject $offset, $limit); } - function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { + function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) + { $enabled = common_config('inboxes', 'enabled'); # Complicated code, depending on whether we support inboxes yet @@ -394,7 +411,8 @@ class User extends Memcached_DataObject $order, $since); } - function blowFavesCache() { + function blowFavesCache() + { $cache = common_memcache(); if ($cache) { # Faves don't happen chronologically, so we need to blow @@ -404,15 +422,18 @@ class User extends Memcached_DataObject } } - function getSelfTags() { + function getSelfTags() + { return Profile_tag::getTags($this->id, $this->id); } - function setSelfTags($newtags) { + function setSelfTags($newtags) + { return Profile_tag::setTags($this->id, $this->id, $newtags); } - function block($other) { + function block($other) + { # Add a new block record @@ -450,7 +471,8 @@ class User extends Memcached_DataObject return true; } - function unblock($other) { + function unblock($other) + { # Get the block record diff --git a/_darcs/pristine/classes/User_openid.php b/_darcs/pristine/classes/User_openid.php index 7dc476dc4..f4fda1c72 100644 --- a/_darcs/pristine/classes/User_openid.php +++ b/_darcs/pristine/classes/User_openid.php @@ -17,7 +17,8 @@ class User_openid extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User_openid',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('User_openid',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/_darcs/pristine/lib/Shorturl_api.php b/_darcs/pristine/lib/Shorturl_api.php index 7beae0ec6..f3f4f08df 100644 --- a/_darcs/pristine/lib/Shorturl_api.php +++ b/_darcs/pristine/lib/Shorturl_api.php @@ -22,11 +22,13 @@ if (!defined('LACONICA')) { exit(1); } class ShortUrlApi { protected $service_url; - function __construct($service_url) { + function __construct($service_url) + { $this->service_url = $service_url; } - function shorten($url) { + function shorten($url) + { if ($this->is_long($url)) return $this->shorten_imp($url); return $url; } @@ -68,7 +70,8 @@ class ShortUrlApi { } class LilUrl extends ShortUrlApi { - function __construct() { + function __construct() + { parent::__construct('http://ur1.ca/'); } @@ -86,7 +89,8 @@ class LilUrl extends ShortUrlApi { class PtitUrl extends ShortUrlApi { - function __construct() { + function __construct() + { parent::__construct('http://ptiturl.com/?creer=oui&action=Reduire&url='); } @@ -103,7 +107,8 @@ class PtitUrl extends ShortUrlApi { } class TightUrl extends ShortUrlApi { - function __construct() { + function __construct() + { parent::__construct('http://2tu.us/?save=y&url='); } diff --git a/_darcs/pristine/lib/common.php b/_darcs/pristine/lib/common.php index 3e162f781..74c992f1c 100644 --- a/_darcs/pristine/lib/common.php +++ b/_darcs/pristine/lib/common.php @@ -163,7 +163,8 @@ require_once(INSTALLDIR.'/lib/subs.php'); require_once(INSTALLDIR.'/lib/Shorturl_api.php'); require_once(INSTALLDIR.'/lib/twitter.php'); -function __autoload($class) { +function __autoload($class) +{ if ($class == 'OAuthRequest') { require_once('OAuth.php'); } else if (file_exists(INSTALLDIR.'/classes/' . $class . '.php')) { diff --git a/_darcs/pristine/lib/deleteaction.php b/_darcs/pristine/lib/deleteaction.php index a7de6b8fb..a6e365121 100644 --- a/_darcs/pristine/lib/deleteaction.php +++ b/_darcs/pristine/lib/deleteaction.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class DeleteAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); $user = common_current_user(); $notice_id = $this->trimmed('notice'); @@ -43,7 +44,8 @@ class DeleteAction extends Action { } } - function show_top($arr=null) { + function show_top($arr=null) + { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); common_element_start('div', 'instructions'); @@ -51,11 +53,13 @@ class DeleteAction extends Action { common_element_end('div'); } - function get_title() { + function get_title() + { return null; } - function show_header() { + function show_header() + { return; } } diff --git a/_darcs/pristine/lib/facebookaction.php b/_darcs/pristine/lib/facebookaction.php index 731460f12..43464b19b 100644 --- a/_darcs/pristine/lib/facebookaction.php +++ b/_darcs/pristine/lib/facebookaction.php @@ -23,17 +23,20 @@ require_once(INSTALLDIR.'/extlib/facebook/facebook.php'); class FacebookAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); } - function get_facebook() { + function get_facebook() + { $apikey = common_config('facebook', 'apikey'); $secret = common_config('facebook', 'secret'); return new Facebook($apikey, $secret); } - function update_profile_box($facebook, $fbuid, $user) { + function update_profile_box($facebook, $fbuid, $user) + { $notice = $user->getCurrentNotice(); @@ -86,7 +89,8 @@ class FacebookAction extends Action { # Display methods - function show_header($selected ='Home') { + function show_header($selected ='Home') + { # Add a timestamp to the CSS file so Facebook cache wont ignore our changes $ts = filemtime(theme_file('facebookapp.css')); @@ -108,12 +112,14 @@ class FacebookAction extends Action { } - function show_footer() { + function show_footer() + { $footer = ''; echo $footer; } - function show_login_form() { + function show_login_form() + { $loginform = '

To add the Identi.ca application, you need to log into your Identi.ca account.

' @@ -148,7 +154,8 @@ class FacebookAction extends Action { echo $loginform; } - function render_notice($notice) { + function render_notice($notice) + { global $config; @@ -207,7 +214,8 @@ class FacebookAction extends Action { return $html; } - function source_link($source) { + function source_link($source) + { $source_name = _($source); $html = ''; @@ -235,7 +243,8 @@ class FacebookAction extends Action { return $html; } - function pagination($have_before, $have_after, $page, $fbaction, $args=null) { + function pagination($have_before, $have_after, $page, $fbaction, $args=null) + { $html = ''; @@ -266,7 +275,8 @@ class FacebookAction extends Action { } } - function pagination_url($fbaction, $args=null) { + function pagination_url($fbaction, $args=null) + { global $config; $extra = ''; diff --git a/_darcs/pristine/lib/oauthstore.php b/_darcs/pristine/lib/oauthstore.php index 421b618b7..7ec3ca655 100644 --- a/_darcs/pristine/lib/oauthstore.php +++ b/_darcs/pristine/lib/oauthstore.php @@ -25,7 +25,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { # We keep a record of who's contacted us - function lookup_consumer($consumer_key) { + function lookup_consumer($consumer_key) + { $con = Consumer::staticGet('consumer_key', $consumer_key); if (!$con) { $con = new Consumer(); @@ -39,7 +40,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { return new OAuthConsumer($con->consumer_key, ''); } - function lookup_token($consumer, $token_type, $token_key) { + function lookup_token($consumer, $token_type, $token_key) + { $t = new Token(); $t->consumer_key = $consumer->key; $t->tok = $token_key; @@ -51,7 +53,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { } } - function lookup_nonce($consumer, $token, $nonce, $timestamp) { + function lookup_nonce($consumer, $token, $nonce, $timestamp) + { $n = new Nonce(); $n->consumer_key = $consumer->key; $n->tok = $token->key; @@ -66,7 +69,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { } } - function new_request_token($consumer) { + function new_request_token($consumer) + { $t = new Token(); $t->consumer_key = $consumer->key; $t->tok = common_good_rand(16); @@ -83,11 +87,13 @@ class LaconicaOAuthDataStore extends OAuthDataStore { # defined in OAuthDataStore, but not implemented anywhere - function fetch_request_token($consumer) { + function fetch_request_token($consumer) + { return $this->new_request_token($consumer); } - function new_access_token($token, $consumer) { + function new_access_token($token, $consumer) + { common_debug('new_access_token("'.$token->key.'","'.$consumer->key.'")', __FILE__); $rt = new Token(); $rt->consumer_key = $consumer->key; @@ -138,7 +144,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { # defined in OAuthDataStore, but not implemented anywhere - function fetch_access_token($consumer) { + function fetch_access_token($consumer) + { return $this->new_access_token($consumer); } } diff --git a/_darcs/pristine/lib/omb.php b/_darcs/pristine/lib/omb.php index 8199b0679..c07bedab5 100644 --- a/_darcs/pristine/lib/omb.php +++ b/_darcs/pristine/lib/omb.php @@ -43,7 +43,8 @@ define('OAUTH_AUTH_HEADER', OAUTH_NAMESPACE.'parameters/auth-header'); define('OAUTH_POST_BODY', OAUTH_NAMESPACE.'parameters/post-body'); define('OAUTH_HMAC_SHA1', OAUTH_NAMESPACE.'signature/HMAC-SHA1'); -function omb_oauth_consumer() { +function omb_oauth_consumer() +{ static $con = null; if (!$con) { $con = new OAuthConsumer(common_root_url(), ''); @@ -51,7 +52,8 @@ function omb_oauth_consumer() { return $con; } -function omb_oauth_server() { +function omb_oauth_server() +{ static $server = null; if (!$server) { $server = new OAuthServer(omb_oauth_datastore()); @@ -60,7 +62,8 @@ function omb_oauth_server() { return $server; } -function omb_oauth_datastore() { +function omb_oauth_datastore() +{ static $store = null; if (!$store) { $store = new LaconicaOAuthDataStore(); @@ -68,7 +71,8 @@ function omb_oauth_datastore() { return $store; } -function omb_hmac_sha1() { +function omb_hmac_sha1() +{ static $hmac_method = null; if (!$hmac_method) { $hmac_method = new OAuthSignatureMethod_HMAC_SHA1(); @@ -76,20 +80,24 @@ function omb_hmac_sha1() { return $hmac_method; } -function omb_get_services($xrd, $type) { +function omb_get_services($xrd, $type) +{ return $xrd->services(array(omb_service_filter($type))); } -function omb_service_filter($type) { +function omb_service_filter($type) +{ return create_function('$s', 'return omb_match_service($s, \''.$type.'\');'); } -function omb_match_service($service, $type) { +function omb_match_service($service, $type) +{ return in_array($type, $service->getTypes()); } -function omb_service_uri($service) { +function omb_service_uri($service) +{ if (!$service) { return null; } @@ -100,7 +108,8 @@ function omb_service_uri($service) { return $uris[0]; } -function omb_local_id($service) { +function omb_local_id($service) +{ if (!$service) { return null; } @@ -112,7 +121,8 @@ function omb_local_id($service) { return $service->parser->content($el); } -function omb_broadcast_remote_subscribers($notice) { +function omb_broadcast_remote_subscribers($notice) +{ # First, get remote users subscribed to this profile $rp = new Remote_profile(); @@ -142,11 +152,13 @@ function omb_broadcast_remote_subscribers($notice) { return true; } -function omb_post_notice($notice, $remote_profile, $subscription) { +function omb_post_notice($notice, $remote_profile, $subscription) +{ return omb_post_notice_keys($notice, $remote_profile->postnoticeurl, $subscription->token, $subscription->secret); } -function omb_post_notice_keys($notice, $postnoticeurl, $tk, $secret) { +function omb_post_notice_keys($notice, $postnoticeurl, $tk, $secret) +{ common_debug('Posting notice ' . $notice->id . ' to ' . $postnoticeurl, __FILE__); @@ -216,7 +228,8 @@ function omb_post_notice_keys($notice, $postnoticeurl, $tk, $secret) { } } -function omb_broadcast_profile($profile) { +function omb_broadcast_profile($profile) +{ # First, get remote users subscribed to this profile # XXX: use a join here rather than looping through results $sub = new Subscription(); @@ -236,7 +249,8 @@ function omb_broadcast_profile($profile) { } } -function omb_update_profile($profile, $remote_profile, $subscription) { +function omb_update_profile($profile, $remote_profile, $subscription) +{ global $config; # for license URL $user = User::staticGet($profile->id); $con = omb_oauth_consumer(); diff --git a/_darcs/pristine/lib/openid.php b/_darcs/pristine/lib/openid.php index 3ca359fa1..1e7f318fb 100644 --- a/_darcs/pristine/lib/openid.php +++ b/_darcs/pristine/lib/openid.php @@ -31,7 +31,8 @@ require_once('Auth/OpenID/MySQLStore.php'); define('OPENID_COOKIE_EXPIRY', round(365.25 * 24 * 60 * 60)); define('OPENID_COOKIE_KEY', 'lastusedopenid'); -function oid_store() { +function oid_store() +{ static $store = null; if (!$store) { # Can't be called statically @@ -42,23 +43,27 @@ function oid_store() { return $store; } -function oid_consumer() { +function oid_consumer() +{ $store = oid_store(); $consumer = new Auth_OpenID_Consumer($store); return $consumer; } -function oid_clear_last() { +function oid_clear_last() +{ oid_set_last(''); } -function oid_set_last($openid_url) { +function oid_set_last($openid_url) +{ common_set_cookie(OPENID_COOKIE_KEY, $openid_url, time() + OPENID_COOKIE_EXPIRY); } -function oid_get_last() { +function oid_get_last() +{ $openid_url = $_COOKIE[OPENID_COOKIE_KEY]; if ($openid_url && strlen($openid_url) > 0) { return $openid_url; @@ -67,7 +72,8 @@ function oid_get_last() { } } -function oid_link_user($id, $canonical, $display) { +function oid_link_user($id, $canonical, $display) +{ $oid = new User_openid(); $oid->user_id = $id; @@ -84,7 +90,8 @@ function oid_link_user($id, $canonical, $display) { return true; } -function oid_get_user($openid_url) { +function oid_get_user($openid_url) +{ $user = null; $oid = User_openid::staticGet('canonical', $openid_url); if ($oid) { @@ -93,7 +100,8 @@ function oid_get_user($openid_url) { return $user; } -function oid_check_immediate($openid_url, $backto=null) { +function oid_check_immediate($openid_url, $backto=null) +{ if (!$backto) { $action = $_REQUEST['action']; $args = common_copy_args($_GET); @@ -113,7 +121,8 @@ function oid_check_immediate($openid_url, $backto=null) { true); } -function oid_authenticate($openid_url, $returnto, $immediate=false) { +function oid_authenticate($openid_url, $returnto, $immediate=false) +{ $consumer = oid_consumer(); @@ -190,7 +199,8 @@ function oid_authenticate($openid_url, $returnto, $immediate=false) { # Half-assed attempt at a module-private function -function _oid_print_instructions() { +function _oid_print_instructions() +{ common_element('div', 'instructions', _('This form should automatically submit itself. '. 'If not, click the submit button to go to your '. @@ -199,7 +209,8 @@ function _oid_print_instructions() { # update a user from sreg parameters -function oid_update_user(&$user, &$sreg) { +function oid_update_user(&$user, &$sreg) +{ $profile = $user->getProfile(); diff --git a/_darcs/pristine/lib/personal.php b/_darcs/pristine/lib/personal.php index 7ff9305f1..34ebe6894 100644 --- a/_darcs/pristine/lib/personal.php +++ b/_darcs/pristine/lib/personal.php @@ -21,16 +21,19 @@ if (!defined('LACONICA')) { exit(1); } class PersonalAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); common_set_returnto($this->self_url()); } - function views_menu() { + function views_menu() + { $user = null; $action = $this->trimmed('action'); @@ -85,7 +88,8 @@ class PersonalAction extends Action { common_element_end('ul'); } - function show_feeds_list($feeds) { + function show_feeds_list($feeds) + { common_element_start('div', array('class' => 'feeds')); common_element('p', null, 'Feeds:'); common_element_start('ul', array('class' => 'xoxo')); @@ -97,7 +101,8 @@ class PersonalAction extends Action { common_element_end('div'); } - function common_feed_item($feed) { + function common_feed_item($feed) + { $nickname = $this->trimmed('nickname'); switch($feed['item']) { @@ -181,7 +186,8 @@ class PersonalAction extends Action { } - function source_link($source) { + function source_link($source) + { $source_name = _($source); switch ($source) { case 'web': diff --git a/_darcs/pristine/lib/profilelist.php b/_darcs/pristine/lib/profilelist.php index 9929c8647..60737c3d4 100644 --- a/_darcs/pristine/lib/profilelist.php +++ b/_darcs/pristine/lib/profilelist.php @@ -28,13 +28,15 @@ class ProfileList { var $owner = null; var $action = null; - function __construct($profile, $owner=null, $action=null) { + function __construct($profile, $owner=null, $action=null) + { $this->profile = $profile; $this->owner = $owner; $this->action = $action; } - function show_list() { + function show_list() + { common_element_start('ul', array('id' => 'profiles', 'class' => 'profile_list')); @@ -53,7 +55,8 @@ class ProfileList { return $cnt; } - function show() { + function show() + { common_element_start('li', array('class' => 'profile_single', 'id' => 'profile-' . $this->profile->id)); @@ -159,11 +162,13 @@ class ProfileList { /* Override this in subclasses. */ - function show_owner_controls($profile) { + function show_owner_controls($profile) + { return; } - function highlight($text) { + function highlight($text) + { return htmlspecialchars($text); } } \ No newline at end of file diff --git a/_darcs/pristine/lib/queuehandler.php b/_darcs/pristine/lib/queuehandler.php index ecf58f69f..48487f8e9 100644 --- a/_darcs/pristine/lib/queuehandler.php +++ b/_darcs/pristine/lib/queuehandler.php @@ -29,43 +29,53 @@ class QueueHandler extends Daemon { var $_id = 'generic'; - function QueueHandler($id=null) { + function QueueHandler($id=null) + { if ($id) { $this->set_id($id); } } - function class_name() { + function class_name() + { return ucfirst($this->transport()) . 'Handler'; } - function name() { + function name() + { return strtolower($this->class_name().'.'.$this->get_id()); } - function get_id() { + function get_id() + { return $this->_id; } - function set_id($id) { + function set_id($id) + { $this->_id = $id; } - function transport() { + function transport() + { return null; } - function start() { + function start() + { } - function finish() { + function finish() + { } - function handle_notice($notice) { + function handle_notice($notice) + { return true; } - function run() { + function run() + { if (!$this->start()) { return false; } @@ -110,13 +120,15 @@ class QueueHandler extends Daemon { return true; } - function idle($timeout=0) { + function idle($timeout=0) + { if ($timeout>0) { sleep($timeout); } } - function clear_old_claims() { + function clear_old_claims() + { $qi = new Queue_item(); $qi->transport = $this->transport(); $qi->whereAdd('now() - claimed > '.CLAIM_TIMEOUT); @@ -125,7 +137,8 @@ class QueueHandler extends Daemon { unset($qi); } - function log($level, $msg) { + function log($level, $msg) + { common_log($level, $this->class_name() . ' ('. $this->get_id() .'): '.$msg); } } diff --git a/_darcs/pristine/lib/rssaction.php b/_darcs/pristine/lib/rssaction.php index a21ce3a97..e02e1febb 100644 --- a/_darcs/pristine/lib/rssaction.php +++ b/_darcs/pristine/lib/rssaction.php @@ -26,11 +26,13 @@ class Rss10Action extends Action { # This will contain the details of each feed item's author and be used to generate SIOC data. var $creators = array(); - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); $limit = (int) $this->trimmed('limit'); if ($limit == 0) { @@ -39,26 +41,31 @@ class Rss10Action extends Action { $this->show_rss($limit); } - function init() { + function init() + { return true; } - function get_notices() { + function get_notices() + { return array(); } - function get_channel() { + function get_channel() + { return array('url' => '', 'title' => '', 'link' => '', 'description' => ''); } - function get_image() { + function get_image() + { return null; } - function show_rss($limit=0) { + function show_rss($limit=0) + { if (!$this->init()) { return; @@ -78,7 +85,8 @@ class Rss10Action extends Action { $this->end_rss(); } - function show_channel($notices) { + function show_channel($notices) + { $channel = $this->get_channel(); $image = $this->get_image(); @@ -106,7 +114,8 @@ class Rss10Action extends Action { common_element_end('channel'); } - function show_image() { + function show_image() + { $image = $this->get_image(); if ($image) { $channel = $this->get_channel(); @@ -118,7 +127,8 @@ class Rss10Action extends Action { } } - function show_item($notice) { + function show_item($notice) + { $profile = Profile::staticGet($notice->profile_id); $nurl = common_local_url('shownotice', array('notice' => $notice->id)); $creator_uri = common_profile_uri($profile); @@ -136,7 +146,8 @@ class Rss10Action extends Action { $this->creators[$creator_uri] = $profile; } - function show_creators() { + function show_creators() + { foreach ($this->creators as $uri => $profile) { $id = $profile->id; $nickname = $profile->nickname; @@ -152,7 +163,8 @@ class Rss10Action extends Action { } } - function init_rss() { + function init_rss() + { $channel = $this->get_channel(); header('Content-Type: application/rdf+xml'); @@ -183,7 +195,8 @@ class Rss10Action extends Action { common_element_end('sioc:Site'); } - function end_rss() { + function end_rss() + { common_element_end('rdf:RDF'); } } diff --git a/_darcs/pristine/lib/search_engines.php b/_darcs/pristine/lib/search_engines.php index d53d7d8d8..e96570d63 100644 --- a/_darcs/pristine/lib/search_engines.php +++ b/_darcs/pristine/lib/search_engines.php @@ -23,19 +23,23 @@ class SearchEngine { protected $target; protected $table; - function __construct($target, $table) { + function __construct($target, $table) + { $this->target = $target; $this->table = $table; } - function query($q) { + function query($q) + { } - function limit($offset, $count, $rss = false) { + function limit($offset, $count, $rss = false) + { return $this->target->limit($offset, $count); } - function set_sort_mode($mode) { + function set_sort_mode($mode) + { if ('chron' === $mode) return $this->target->orderBy('created desc'); } @@ -45,7 +49,8 @@ class SphinxSearch extends SearchEngine { private $sphinx; private $connected; - function __construct($target, $table) { + function __construct($target, $table) + { $fp = @fsockopen(common_config('sphinx', 'server'), common_config('sphinx', 'port')); if (!$fp) { $this->connected = false; @@ -58,11 +63,13 @@ class SphinxSearch extends SearchEngine { $this->connected = true; } - function is_connected() { + function is_connected() + { return $this->connected; } - function limit($offset, $count, $rss = false) { + function limit($offset, $count, $rss = false) + { //FIXME without LARGEST_POSSIBLE, the most recent results aren't returned // this probably has a large impact on performance $LARGEST_POSSIBLE = 1e6; @@ -78,7 +85,8 @@ class SphinxSearch extends SearchEngine { return $this->target->limit(0, $count); } - function query($q) { + function query($q) + { $result = $this->sphinx->query($q, $this->table); if (!isset($result['matches'])) return false; $id_set = join(', ', array_keys($result['matches'])); @@ -86,7 +94,8 @@ class SphinxSearch extends SearchEngine { return true; } - function set_sort_mode($mode) { + function set_sort_mode($mode) + { if ('chron' === $mode) { $this->sphinx->SetSortMode(SPH_SORT_ATTR_DESC, 'created_ts'); return $this->target->orderBy('created desc'); @@ -95,7 +104,8 @@ class SphinxSearch extends SearchEngine { } class MySQLSearch extends SearchEngine { - function query($q) { + function query($q) + { if ('identica_people' === $this->table) return $this->target->whereAdd('MATCH(nickname, fullname, location, bio, homepage) ' . 'against (\''.addslashes($q).'\')'); @@ -106,7 +116,8 @@ class MySQLSearch extends SearchEngine { } class PGSearch extends SearchEngine { - function query($q) { + function query($q) + { if ('identica_people' === $this->table) return $this->target->whereAdd('textsearch @@ plainto_tsquery(\''.addslashes($q).'\')'); if ('identica_notices' === $this->table) diff --git a/_darcs/pristine/lib/searchaction.php b/_darcs/pristine/lib/searchaction.php index 3eec91832..12a44a861 100644 --- a/_darcs/pristine/lib/searchaction.php +++ b/_darcs/pristine/lib/searchaction.php @@ -21,16 +21,19 @@ if (!defined('LACONICA')) { exit(1); } class SearchAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); $this->show_form(); } - function show_top($arr=null) { + function show_top($arr=null) + { if ($arr) { $error = $arr[1]; } @@ -46,15 +49,18 @@ class SearchAction extends Action { $this->search_menu(); } - function get_title() { + function get_title() + { return null; } - function show_header($arr) { + function show_header($arr) + { return; } - function show_form($error=null) { + function show_form($error=null) + { global $config; $q = $this->trimmed('q'); @@ -91,7 +97,8 @@ class SearchAction extends Action { common_show_footer(); } - function search_menu() { + function search_menu() + { # action => array('prompt', 'title', $args) $action = $this->trimmed('action'); $menu = diff --git a/_darcs/pristine/lib/settingsaction.php b/_darcs/pristine/lib/settingsaction.php index 208d2a1b6..5979c11f0 100644 --- a/_darcs/pristine/lib/settingsaction.php +++ b/_darcs/pristine/lib/settingsaction.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class SettingsAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_user_error(_('Not logged in.')); @@ -40,29 +41,34 @@ class SettingsAction extends Action { } # override! - function handle_post() { + function handle_post() + { return false; } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { return false; } - function message($msg, $success) { + function message($msg, $success) + { if ($msg) { common_element('div', ($success) ? 'success' : 'error', $msg); } } - function form_header($title, $msg=null, $success=false) { + function form_header($title, $msg=null, $success=false) + { common_show_header($title, null, array($msg, $success), array($this, 'show_top')); } - function show_top($arr) { + function show_top($arr) + { $msg = $arr[0]; $success = $arr[1]; if ($msg) { @@ -77,7 +83,8 @@ class SettingsAction extends Action { $this->settings_menu(); } - function settings_menu() { + function settings_menu() + { # action => array('prompt', 'title') $menu = array('profilesettings' => diff --git a/_darcs/pristine/lib/stream.php b/_darcs/pristine/lib/stream.php index 2d45df2d3..45fbb9bd9 100644 --- a/_darcs/pristine/lib/stream.php +++ b/_darcs/pristine/lib/stream.php @@ -24,7 +24,8 @@ require_once(INSTALLDIR.'/lib/noticelist.php'); class StreamAction extends PersonalAction { - function public_views_menu() { + function public_views_menu() + { $action = $this->trimmed('action'); @@ -48,7 +49,8 @@ class StreamAction extends PersonalAction { } - function show_notice_list($notice) { + function show_notice_list($notice) + { $nl = new NoticeList($notice); return $nl->show(); } diff --git a/_darcs/pristine/lib/subs.php b/_darcs/pristine/lib/subs.php index 55e74e0b2..6fa1dcad3 100644 --- a/_darcs/pristine/lib/subs.php +++ b/_darcs/pristine/lib/subs.php @@ -25,7 +25,8 @@ require_once('XMPPHP/XMPP.php'); Returns true or an error message. */ -function subs_subscribe_user($user, $other_nickname) { +function subs_subscribe_user($user, $other_nickname) +{ $other = User::staticGet('nickname', $other_nickname); @@ -41,7 +42,8 @@ function subs_subscribe_user($user, $other_nickname) { * Because the other way is quite a bit more complicated. */ -function subs_subscribe_to($user, $other) { +function subs_subscribe_to($user, $other) +{ if ($user->isSubscribed($other)) { return _('Already subscribed!.'); @@ -82,14 +84,16 @@ function subs_subscribe_to($user, $other) { return true; } -function subs_notify($listenee, $listener) { +function subs_notify($listenee, $listener) +{ # XXX: add other notifications (Jabber, SMS) here # XXX: queue this and handle it offline # XXX: Whatever happens, do it in Twitter-like API, too subs_notify_email($listenee, $listener); } -function subs_notify_email($listenee, $listener) { +function subs_notify_email($listenee, $listener) +{ mail_subscribe_notify($listenee, $listener); } @@ -97,7 +101,8 @@ function subs_notify_email($listenee, $listener) { Returns true or an error message. */ -function subs_unsubscribe_user($user, $other_nickname) { +function subs_unsubscribe_user($user, $other_nickname) +{ $other = User::staticGet('nickname', $other_nickname); @@ -111,7 +116,8 @@ function subs_unsubscribe_user($user, $other_nickname) { /* Unsubscribe user $user from profile $other * NB: other can be a remote user. */ -function subs_unsubscribe_to($user, $other) { +function subs_unsubscribe_to($user, $other) +{ if (!$user->isSubscribed($other)) return _('Not subscribed!.'); diff --git a/_darcs/pristine/lib/theme.php b/_darcs/pristine/lib/theme.php index 346cff434..6f365bd99 100644 --- a/_darcs/pristine/lib/theme.php +++ b/_darcs/pristine/lib/theme.php @@ -19,12 +19,14 @@ if (!defined('LACONICA')) { exit(1); } -function theme_file($relative) { +function theme_file($relative) +{ $theme = common_config('site', 'theme'); return INSTALLDIR.'/theme/'.$theme.'/'.$relative; } -function theme_path($relative) { +function theme_path($relative) +{ $theme = common_config('site', 'theme'); $server = common_config('theme', 'server'); if ($server) { diff --git a/_darcs/pristine/lib/twitter.php b/_darcs/pristine/lib/twitter.php index 1212875ea..07871fb20 100644 --- a/_darcs/pristine/lib/twitter.php +++ b/_darcs/pristine/lib/twitter.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -function get_twitter_data($uri, $screen_name, $password) { +function get_twitter_data($uri, $screen_name, $password) +{ $options = array( CURLOPT_USERPWD => sprintf("%s:%s", $screen_name, $password), @@ -48,7 +49,8 @@ function get_twitter_data($uri, $screen_name, $password) { return $data; } -function twitter_user_info($screen_name, $password) { +function twitter_user_info($screen_name, $password) +{ $uri = "http://twitter.com/users/show/$screen_name.json"; $data = get_twitter_data($uri, $screen_name, $password); @@ -66,7 +68,8 @@ function twitter_user_info($screen_name, $password) { return $twit_user; } -function update_twitter_user($fuser, $twitter_id, $screen_name) { +function update_twitter_user($fuser, $twitter_id, $screen_name) +{ $original = clone($fuser); $fuser->nickname = $screen_name; @@ -81,7 +84,8 @@ function update_twitter_user($fuser, $twitter_id, $screen_name) { return true; } -function add_twitter_user($twitter_id, $screen_name) { +function add_twitter_user($twitter_id, $screen_name) +{ // Otherwise, create a new Twitter user $fuser = DB_DataObject::factory('foreign_user'); @@ -105,7 +109,8 @@ function add_twitter_user($twitter_id, $screen_name) { } // Creates or Updates a Twitter user -function save_twitter_user($twitter_id, $screen_name) { +function save_twitter_user($twitter_id, $screen_name) +{ // Check to see whether the Twitter user is already in the system, // and update its screen name and uri if so. @@ -129,7 +134,8 @@ function save_twitter_user($twitter_id, $screen_name) { return true; } -function retreive_twitter_friends($twitter_id, $screen_name, $password) { +function retreive_twitter_friends($twitter_id, $screen_name, $password) +{ $uri = "http://twitter.com/statuses/friends/$twitter_id.json?page="; $twitter_user = twitter_user_info($screen_name, $password); @@ -163,7 +169,8 @@ function retreive_twitter_friends($twitter_id, $screen_name, $password) { return $friends; } -function save_twitter_friends($user, $twitter_id, $screen_name, $password) { +function save_twitter_friends($user, $twitter_id, $screen_name, $password) +{ $friends = retreive_twitter_friends($twitter_id, $screen_name, $password); diff --git a/_darcs/pristine/lib/twitterapi.php b/_darcs/pristine/lib/twitterapi.php index ed86c77c4..3cddfa9c9 100644 --- a/_darcs/pristine/lib/twitterapi.php +++ b/_darcs/pristine/lib/twitterapi.php @@ -23,11 +23,13 @@ class TwitterapiAction extends Action { var $auth_user; - function handle($args) { + function handle($args) + { parent::handle($args); } - function twitter_user_array($profile, $get_notice=false) { + function twitter_user_array($profile, $get_notice=false) + { $twitter_user = array(); @@ -55,7 +57,8 @@ class TwitterapiAction extends Action { return $twitter_user; } - function twitter_status_array($notice, $include_user=true) { + function twitter_status_array($notice, $include_user=true) + { $profile = $notice->getProfile(); @@ -83,7 +86,8 @@ class TwitterapiAction extends Action { return $twitter_status; } - function twitter_rss_entry_array($notice) { + function twitter_rss_entry_array($notice) + { $profile = $notice->getProfile(); @@ -107,7 +111,8 @@ class TwitterapiAction extends Action { return $entry; } - function twitter_rss_dmsg_array($message) { + function twitter_rss_dmsg_array($message) + { $server = common_config('site', 'server'); $entry = array(); @@ -129,7 +134,8 @@ class TwitterapiAction extends Action { return $entry; } - function twitter_dmsg_array($message) { + function twitter_dmsg_array($message) + { $twitter_dm = array(); @@ -149,7 +155,8 @@ class TwitterapiAction extends Action { return $twitter_dm; } - function show_twitter_xml_status($twitter_status) { + function show_twitter_xml_status($twitter_status) + { common_element_start('status'); foreach($twitter_status as $element => $value) { switch ($element) { @@ -166,7 +173,8 @@ class TwitterapiAction extends Action { common_element_end('status'); } - function show_twitter_xml_user($twitter_user, $role='user') { + function show_twitter_xml_user($twitter_user, $role='user') + { common_element_start($role); foreach($twitter_user as $element => $value) { if ($element == 'status') { @@ -178,7 +186,8 @@ class TwitterapiAction extends Action { common_element_end($role); } - function show_twitter_rss_item($entry) { + function show_twitter_rss_item($entry) + { common_element_start('item'); common_element('title', null, $entry['title']); common_element('description', null, $entry['description']); @@ -188,7 +197,8 @@ class TwitterapiAction extends Action { common_element_end('item'); } - function show_twitter_atom_entry($entry) { + function show_twitter_atom_entry($entry) + { common_element_start('entry'); common_element('title', null, $entry['title']); common_element('content', array('type' => 'html'), $entry['content']); @@ -199,39 +209,45 @@ class TwitterapiAction extends Action { common_element_end('entry'); } - function show_json_objects($objects) { + function show_json_objects($objects) + { print(json_encode($objects)); } - function show_single_xml_status($notice) { + function show_single_xml_status($notice) + { $this->init_document('xml'); $twitter_status = $this->twitter_status_array($notice); $this->show_twitter_xml_status($twitter_status); $this->end_document('xml'); } - function show_single_json_status($notice) { + function show_single_json_status($notice) + { $this->init_document('json'); $status = $this->twitter_status_array($notice); $this->show_json_objects($status); $this->end_document('json'); } - function show_single_xml_dmsg($message) { + function show_single_xml_dmsg($message) + { $this->init_document('xml'); $dmsg = $this->twitter_dmsg_array($message); $this->show_twitter_xml_dmsg($dmsg); $this->end_document('xml'); } - function show_single_json_dmsg($message) { + function show_single_json_dmsg($message) + { $this->init_document('json'); $dmsg = $this->twitter_dmsg_array($message); $this->show_json_objects($dmsg); $this->end_document('json'); } - function show_twitter_xml_dmsg($twitter_dm) { + function show_twitter_xml_dmsg($twitter_dm) + { common_element_start('direct_message'); foreach($twitter_dm as $element => $value) { switch ($element) { @@ -249,7 +265,8 @@ class TwitterapiAction extends Action { common_element_end('direct_message'); } - function show_xml_timeline($notice) { + function show_xml_timeline($notice) + { $this->init_document('xml'); common_element_start('statuses', array('type' => 'array')); @@ -270,7 +287,8 @@ class TwitterapiAction extends Action { $this->end_document('xml'); } - function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=null) { + function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=null) + { $this->init_document('rss'); @@ -304,7 +322,8 @@ class TwitterapiAction extends Action { $this->end_twitter_rss(); } - function show_atom_timeline($notice, $title, $id, $link, $subtitle=null, $suplink=null) { + function show_atom_timeline($notice, $title, $id, $link, $subtitle=null, $suplink=null) + { $this->init_document('atom'); @@ -335,7 +354,8 @@ class TwitterapiAction extends Action { } - function show_json_timeline($notice) { + function show_json_timeline($notice) + { $this->init_document('json'); @@ -360,12 +380,14 @@ class TwitterapiAction extends Action { // Anyone know what date format this is? // Twitter's dates look like this: "Mon Jul 14 23:52:38 +0000 2008" -- Zach - function date_twitter($dt) { + function date_twitter($dt) + { $t = strtotime($dt); return date("D M d G:i:s O Y", $t); } - function replier_by_reply($reply_id) { + function replier_by_reply($reply_id) + { $notice = Notice::staticGet($reply_id); if ($notice) { $profile = $notice->getProfile(); @@ -381,7 +403,8 @@ class TwitterapiAction extends Action { } // XXX: Candidate for a general utility method somewhere? - function count_subscriptions($profile) { + function count_subscriptions($profile) + { $count = 0; $sub = new Subscription(); @@ -396,7 +419,8 @@ class TwitterapiAction extends Action { } } - function init_document($type='xml') { + function init_document($type='xml') + { switch ($type) { case 'xml': header('Content-Type: application/xml; charset=utf-8'); @@ -427,7 +451,8 @@ class TwitterapiAction extends Action { return; } - function end_document($type='xml') { + function end_document($type='xml') + { switch ($type) { case 'xml': common_end_xml(); @@ -453,7 +478,8 @@ class TwitterapiAction extends Action { return; } - function client_error($msg, $code = 400, $content_type = 'json') { + function client_error($msg, $code = 400, $content_type = 'json') + { static $status = array(400 => 'Bad Request', 401 => 'Unauthorized', @@ -501,27 +527,32 @@ class TwitterapiAction extends Action { } - function init_twitter_rss() { + function init_twitter_rss() + { common_start_xml(); common_element_start('rss', array('version' => '2.0')); } - function end_twitter_rss() { + function end_twitter_rss() + { common_element_end('rss'); common_end_xml(); } - function init_twitter_atom() { + function init_twitter_atom() + { common_start_xml(); common_element_start('feed', array('xmlns' => 'http://www.w3.org/2005/Atom', 'xml:lang' => 'en-US')); } - function end_twitter_atom() { + function end_twitter_atom() + { common_end_xml(); common_element_end('feed'); } - function show_profile($profile, $content_type='xml', $notice=null) { + function show_profile($profile, $content_type='xml', $notice=null) + { $profile_array = $this->twitter_user_array($profile, true); switch ($content_type) { case 'xml': @@ -537,7 +568,8 @@ class TwitterapiAction extends Action { return; } - function get_user($id, $apidata=null) { + function get_user($id, $apidata=null) + { if (!$id) { return $apidata['user']; } else if (is_numeric($id)) { @@ -548,7 +580,8 @@ class TwitterapiAction extends Action { } } - function get_profile($id) { + function get_profile($id) + { if (is_numeric($id)) { return Profile::staticGet($id); } else { @@ -561,7 +594,8 @@ class TwitterapiAction extends Action { } } - function source_link($source) { + function source_link($source) + { $source_name = _($source); switch ($source) { case 'web': @@ -580,7 +614,8 @@ class TwitterapiAction extends Action { return $source_name; } - function show_extended_profile($user, $apidata) { + function show_extended_profile($user, $apidata) + { $this->auth_user = $apidata['user']; diff --git a/_darcs/pristine/lib/util.php b/_darcs/pristine/lib/util.php index f0387ebe5..ed73b19e6 100644 --- a/_darcs/pristine/lib/util.php +++ b/_darcs/pristine/lib/util.php @@ -21,7 +21,8 @@ // Show a server error -function common_server_error($msg, $code=500) { +function common_server_error($msg, $code=500) +{ static $status = array(500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', @@ -44,7 +45,8 @@ function common_server_error($msg, $code=500) { } // Show a user error -function common_user_error($msg, $code=400) { +function common_user_error($msg, $code=400) +{ static $status = array(400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', @@ -80,7 +82,8 @@ function common_user_error($msg, $code=400) { $xw = null; // Start an HTML element -function common_element_start($tag, $attrs=null) { +function common_element_start($tag, $attrs=null) +{ global $xw; $xw->startElement($tag); if (is_array($attrs)) { @@ -92,7 +95,8 @@ function common_element_start($tag, $attrs=null) { } } -function common_element_end($tag) { +function common_element_end($tag) +{ static $empty_tag = array('base', 'meta', 'link', 'hr', 'br', 'param', 'img', 'area', 'input', 'col'); @@ -105,7 +109,8 @@ function common_element_end($tag) { } } -function common_element($tag, $attrs=null, $content=null) { +function common_element($tag, $attrs=null, $content=null) +{ common_element_start($tag, $attrs); global $xw; if (!is_null($content)) { @@ -114,7 +119,8 @@ function common_element($tag, $attrs=null, $content=null) { common_element_end($tag); } -function common_start_xml($doc=null, $public=null, $system=null, $indent=true) { +function common_start_xml($doc=null, $public=null, $system=null, $indent=true) +{ global $xw; $xw = new XMLWriter(); $xw->openURI('php://output'); @@ -125,13 +131,15 @@ function common_start_xml($doc=null, $public=null, $system=null, $indent=true) { } } -function common_end_xml() { +function common_end_xml() +{ global $xw; $xw->endDocument(); $xw->flush(); } -function common_init_locale($language=null) { +function common_init_locale($language=null) +{ if(!$language) { $language = common_language(); } @@ -144,7 +152,8 @@ function common_init_locale($language=null) { $language); } -function common_init_language() { +function common_init_language() +{ mb_internal_encoding('UTF-8'); $language = common_language(); // So we don't have to make people install the gettext locales @@ -160,7 +169,8 @@ function common_init_language() { define('PAGE_TYPE_PREFS', 'text/html,application/xhtml+xml,application/xml;q=0.3,text/xml;q=0.2'); -function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) { +function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) +{ global $config, $xw; global $action; /* XXX: kind of cheating here. */ @@ -243,7 +253,8 @@ function common_show_header($pagetitle, $callable=null, $data=null, $headercall= common_element_start('div', array('id' => 'content')); } -function common_start_html($type=null, $indent=true) { +function common_start_html($type=null, $indent=true) +{ if (!$type) { $httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : null; @@ -274,7 +285,8 @@ function common_start_html($type=null, $indent=true) { 'lang' => $language)); } -function common_show_footer() { +function common_show_footer() +{ global $xw, $config; common_element_end('div'); // content div common_foot_menu(); @@ -307,17 +319,20 @@ function common_show_footer() { common_end_xml(); } -function common_text($txt) { +function common_text($txt) +{ global $xw; $xw->text($txt); } -function common_raw($xml) { +function common_raw($xml) +{ global $xw; $xw->writeRaw($xml); } -function common_nav_menu() { +function common_nav_menu() +{ $user = common_current_user(); common_element_start('ul', array('id' => 'nav')); if ($user) { @@ -344,7 +359,8 @@ function common_nav_menu() { common_element_end('ul'); } -function common_foot_menu() { +function common_foot_menu() +{ common_element_start('ul', array('id' => 'nav_sub')); common_menu_item(common_local_url('doc', array('title' => 'help')), _('Help')); @@ -361,7 +377,8 @@ function common_foot_menu() { common_element_end('ul'); } -function common_menu_item($url, $text, $title=null, $is_selected=false) { +function common_menu_item($url, $text, $title=null, $is_selected=false) +{ $lattrs = array(); if ($is_selected) { $lattrs['class'] = 'current'; @@ -375,7 +392,8 @@ function common_menu_item($url, $text, $title=null, $is_selected=false) { common_element_end('li'); } -function common_input($id, $label, $value=null,$instructions=null) { +function common_input($id, $label, $value=null,$instructions=null) +{ common_element_start('p'); common_element('label', array('for' => $id), $label); $attrs = array('name' => $id, @@ -418,7 +436,8 @@ function common_checkbox($id, $label, $checked=false, $instructions=null, $value common_element_end('p'); } -function common_dropdown($id, $label, $content, $instructions=null, $blank_select=FALSE, $selected=null) { +function common_dropdown($id, $label, $content, $instructions=null, $blank_select=FALSE, $selected=null) +{ common_element_start('p'); common_element('label', array('for' => $id), $label); common_element_start('select', array('id' => $id, 'name' => $id)); @@ -438,14 +457,16 @@ function common_dropdown($id, $label, $content, $instructions=null, $blank_selec } common_element_end('p'); } -function common_hidden($id, $value) { +function common_hidden($id, $value) +{ common_element('input', array('name' => $id, 'type' => 'hidden', 'id' => $id, 'value' => $value)); } -function common_password($id, $label, $instructions=null) { +function common_password($id, $label, $instructions=null) +{ common_element_start('p'); common_element('label', array('for' => $id), $label); $attrs = array('name' => $id, @@ -459,7 +480,8 @@ function common_password($id, $label, $instructions=null) { common_element_end('p'); } -function common_submit($id, $label, $cls='submit') { +function common_submit($id, $label, $cls='submit') +{ global $xw; common_element_start('p'); common_element('input', array('type' => 'submit', @@ -470,7 +492,8 @@ function common_submit($id, $label, $cls='submit') { common_element_end('p'); } -function common_textarea($id, $label, $content=null, $instructions=null) { +function common_textarea($id, $label, $content=null, $instructions=null) +{ common_element_start('p'); common_element('label', array('for' => $id), $label); common_element('textarea', array('rows' => 3, @@ -484,7 +507,8 @@ function common_textarea($id, $label, $content=null, $instructions=null) { common_element_end('p'); } -function common_timezone() { +function common_timezone() +{ if (common_logged_in()) { $user = common_current_user(); if ($user->timezone) { @@ -496,7 +520,8 @@ function common_timezone() { return $config['site']['timezone']; } -function common_language() { +function common_language() +{ // If there is a user logged in and they've set a language preference // then return that one... @@ -521,12 +546,14 @@ function common_language() { } // salted, hashed passwords are stored in the DB -function common_munge_password($password, $id) { +function common_munge_password($password, $id) +{ return md5($password . $id); } // check if a username exists and has matching password -function common_check_user($nickname, $password) { +function common_check_user($nickname, $password) +{ // NEVER allow blank passwords, even if they match the DB if (mb_strlen($password) == 0) { return false; @@ -545,15 +572,18 @@ function common_check_user($nickname, $password) { } // is the current user logged in? -function common_logged_in() { +function common_logged_in() +{ return (!is_null(common_current_user())); } -function common_have_session() { +function common_have_session() +{ return (0 != strcmp(session_id(), '')); } -function common_ensure_session() { +function common_ensure_session() +{ if (!common_have_session()) { @session_start(); } @@ -568,7 +598,8 @@ function common_ensure_session() { $_cur = false; -function common_set_user($user) { +function common_set_user($user) +{ global $_cur; @@ -592,7 +623,8 @@ function common_set_user($user) { return false; } -function common_set_cookie($key, $value, $expiration=0) { +function common_set_cookie($key, $value, $expiration=0) +{ $path = common_config('site', 'path'); $server = common_config('site', 'server'); @@ -611,7 +643,8 @@ function common_set_cookie($key, $value, $expiration=0) { define('REMEMBERME', 'rememberme'); define('REMEMBERME_EXPIRY', 30 * 24 * 60 * 60); // 30 days -function common_rememberme($user=null) { +function common_rememberme($user=null) +{ if (!$user) { $user = common_current_user(); if (!$user) { @@ -650,7 +683,8 @@ function common_rememberme($user=null) { return true; } -function common_remembered_user() { +function common_remembered_user() +{ $user = null; @@ -715,12 +749,14 @@ function common_remembered_user() { // must be called with a valid user! -function common_forgetme() { +function common_forgetme() +{ common_set_cookie(REMEMBERME, '', 0); } // who is the current user? -function common_current_user() { +function common_current_user() +{ global $_cur; if ($_cur === false) { @@ -752,23 +788,27 @@ function common_current_user() { // cookie-stealing. So, we don't let them do certain things. New reg, // OpenID, and password logins _are_ real. -function common_real_login($real=true) { +function common_real_login($real=true) +{ common_ensure_session(); $_SESSION['real_login'] = $real; } -function common_is_real_login() { +function common_is_real_login() +{ return common_logged_in() && $_SESSION['real_login']; } // get canonical version of nickname for comparison -function common_canonical_nickname($nickname) { +function common_canonical_nickname($nickname) +{ // XXX: UTF-8 canonicalization (like combining chars) return strtolower($nickname); } // get canonical version of email for comparison -function common_canonical_email($email) { +function common_canonical_email($email) +{ // XXX: canonicalize UTF-8 // XXX: lcase the domain part return $email; @@ -776,7 +816,8 @@ function common_canonical_email($email) { define('URL_REGEX', '^|[ \t\r\n])((ftp|http|https|gopher|mailto|news|nntp|telnet|wais|file|prospero|aim|webcal):(([A-Za-z0-9$_.+!*(),;/?:@&~=-])|%[A-Fa-f0-9]{2}){2,}(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*(),;/?:@&~=%-]*))?([A-Za-z0-9$_+!*();/?:~-]))'); -function common_render_content($text, $notice) { +function common_render_content($text, $notice) +{ $r = common_render_text($text); $id = $notice->profile_id; $r = preg_replace('/(^|\s+)@([A-Za-z0-9]{1,64})/e', "'\\1@'.common_at_link($id, '\\2')", $r); @@ -785,7 +826,8 @@ function common_render_content($text, $notice) { return $r; } -function common_render_text($text) { +function common_render_text($text) +{ $r = htmlspecialchars($text); $r = preg_replace('/[\x{0}-\x{8}\x{b}-\x{c}\x{e}-\x{19}]/', '', $r); @@ -795,7 +837,8 @@ function common_render_text($text) { return $r; } -function common_render_uri_thingy($matches) { +function common_render_uri_thingy($matches) +{ $uri = $matches[0]; $trailer = ''; @@ -829,20 +872,23 @@ function common_render_uri_thingy($matches) { return '' . $uri . '' . $trailer; } -function common_longurl($short_url) { +function common_longurl($short_url) +{ $long_url = common_shorten_link($short_url, true); if ($long_url === $short_url) return false; return $long_url; } -function common_longurl2($uri) { +function common_longurl2($uri) +{ $uri_e = urlencode($uri); $longurl = unserialize(file_get_contents("http://api.longurl.org/v1/expand?format=php&url=$uri_e")); if (empty($longurl['long_url']) || $uri === $longurl['long_url']) return false; return stripslashes($longurl['long_url']); } -function common_shorten_links($text) { +function common_shorten_links($text) +{ if (mb_strlen($text) <= 140) return $text; static $cache = array(); if (isset($cache[$text])) return $cache[$text]; @@ -850,7 +896,8 @@ function common_shorten_links($text) { return $cache[$text] = preg_replace('@https?://[^)\]>\s]+@e', "common_shorten_link('\\0')", $text); } -function common_shorten_link($url, $reverse = false) { +function common_shorten_link($url, $reverse = false) +{ static $url_cache = array(); if ($reverse) return isset($url_cache[$url]) ? $url_cache[$url] : $url; @@ -911,28 +958,33 @@ function common_shorten_link($url, $reverse = false) { return $url; } -function common_xml_safe_str($str) { +function common_xml_safe_str($str) +{ $xmlStr = htmlentities(iconv('UTF-8', 'UTF-8//IGNORE', $str), ENT_NOQUOTES, 'UTF-8'); // Replace control, formatting, and surrogate characters with '*', ala Twitter return preg_replace('/[\p{Cc}\p{Cf}\p{Cs}]/u', '*', $str); } -function common_tag_link($tag) { +function common_tag_link($tag) +{ $canonical = common_canonical_tag($tag); $url = common_local_url('tag', array('tag' => $canonical)); return ''; } -function common_canonical_tag($tag) { +function common_canonical_tag($tag) +{ return strtolower(str_replace(array('-', '_', '.'), '', $tag)); } -function common_valid_profile_tag($str) { +function common_valid_profile_tag($str) +{ return preg_match('/^[A-Za-z0-9_\-\.]{1,64}$/', $str); } -function common_at_link($sender_id, $nickname) { +function common_at_link($sender_id, $nickname) +{ $sender = Profile::staticGet($sender_id); $recipient = common_relative_profile($sender, common_canonical_nickname($nickname)); if ($recipient) { @@ -942,7 +994,8 @@ function common_at_link($sender_id, $nickname) { } } -function common_at_hash_link($sender_id, $tag) { +function common_at_hash_link($sender_id, $tag) +{ $user = User::staticGet($sender_id); if (!$user) { return $tag; @@ -958,7 +1011,8 @@ function common_at_hash_link($sender_id, $tag) { } } -function common_relative_profile($sender, $nickname, $dt=null) { +function common_relative_profile($sender, $nickname, $dt=null) +{ // Try to find profiles this profile is subscribed to that have this nickname $recipient = new Profile(); // XXX: use a join instead of a subquery @@ -995,7 +1049,8 @@ function common_relative_profile($sender, $nickname, $dt=null) { // where should the avatar go for this user? -function common_avatar_filename($id, $extension, $size=null, $extra=null) { +function common_avatar_filename($id, $extension, $size=null, $extra=null) +{ global $config; if ($size) { @@ -1005,16 +1060,19 @@ function common_avatar_filename($id, $extension, $size=null, $extra=null) { } } -function common_avatar_path($filename) { +function common_avatar_path($filename) +{ global $config; return INSTALLDIR . '/avatar/' . $filename; } -function common_avatar_url($filename) { +function common_avatar_url($filename) +{ return common_path('avatar/'.$filename); } -function common_avatar_display_url($avatar) { +function common_avatar_display_url($avatar) +{ $server = common_config('avatar', 'server'); if ($server) { return 'http://'.$server.'/'.$avatar->filename; @@ -1023,14 +1081,16 @@ function common_avatar_display_url($avatar) { } } -function common_default_avatar($size) { +function common_default_avatar($size) +{ static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile', AVATAR_STREAM_SIZE => 'stream', AVATAR_MINI_SIZE => 'mini'); return theme_path('default-avatar-'.$sizenames[$size].'.png'); } -function common_local_url($action, $args=null, $fragment=null) { +function common_local_url($action, $args=null, $fragment=null) +{ $url = null; if (common_config('site','fancy')) { $url = common_fancy_url($action, $args); @@ -1043,7 +1103,8 @@ function common_local_url($action, $args=null, $fragment=null) { return $url; } -function common_fancy_url($action, $args=null) { +function common_fancy_url($action, $args=null) +{ switch (strtolower($action)) { case 'public': if ($args && isset($args['page'])) { @@ -1256,7 +1317,8 @@ function common_fancy_url($action, $args=null) { } } -function common_simple_url($action, $args=null) { +function common_simple_url($action, $args=null) +{ global $config; /* XXX: pretty URLs */ $extra = ''; @@ -1268,13 +1330,15 @@ function common_simple_url($action, $args=null) { return common_path("index.php?action=${action}${extra}"); } -function common_path($relative) { +function common_path($relative) +{ global $config; $pathpart = ($config['site']['path']) ? $config['site']['path']."/" : ''; return "http://".$config['site']['server'].'/'.$pathpart.$relative; } -function common_date_string($dt) { +function common_date_string($dt) +{ // XXX: do some sexy date formatting // return date(DATE_RFC822, $dt); $t = strtotime($dt); @@ -1308,7 +1372,8 @@ function common_date_string($dt) { } } -function common_exact_date($dt) { +function common_exact_date($dt) +{ static $_utc; static $_siteTz; @@ -1323,32 +1388,37 @@ function common_exact_date($dt) { return $d->format(DATE_RFC850); } -function common_date_w3dtf($dt) { +function common_date_w3dtf($dt) +{ $dateStr = date('d F Y H:i:s', strtotime($dt)); $d = new DateTime($dateStr, new DateTimeZone('UTC')); $d->setTimezone(new DateTimeZone(common_timezone())); return $d->format(DATE_W3C); } -function common_date_rfc2822($dt) { +function common_date_rfc2822($dt) +{ $dateStr = date('d F Y H:i:s', strtotime($dt)); $d = new DateTime($dateStr, new DateTimeZone('UTC')); $d->setTimezone(new DateTimeZone(common_timezone())); return $d->format('r'); } -function common_date_iso8601($dt) { +function common_date_iso8601($dt) +{ $dateStr = date('d F Y H:i:s', strtotime($dt)); $d = new DateTime($dateStr, new DateTimeZone('UTC')); $d->setTimezone(new DateTimeZone(common_timezone())); return $d->format('c'); } -function common_sql_now() { +function common_sql_now() +{ return strftime('%Y-%m-%d %H:%M:%S', time()); } -function common_redirect($url, $code=307) { +function common_redirect($url, $code=307) +{ static $status = array(301 => "Moved Permanently", 302 => "Found", 303 => "See Other", @@ -1364,7 +1434,8 @@ function common_redirect($url, $code=307) { exit; } -function common_save_replies($notice) { +function common_save_replies($notice) +{ // Alternative reply format $tname = false; if (preg_match('/^T ([A-Z0-9]{1,64}) /', $notice->content, $match)) { @@ -1447,7 +1518,8 @@ function common_save_replies($notice) { } } -function common_broadcast_notice($notice, $remote=false) { +function common_broadcast_notice($notice, $remote=false) +{ // Check to see if notice should go to Twitter $flink = Foreign_link::getByUserID($notice->profile_id, 1); // 1 == Twitter @@ -1474,7 +1546,8 @@ function common_broadcast_notice($notice, $remote=false) { } } -function common_twitter_broadcast($notice, $flink) { +function common_twitter_broadcast($notice, $flink) +{ global $config; $success = true; $fuser = $flink->getForeignUser(); @@ -1534,7 +1607,8 @@ function common_twitter_broadcast($notice, $flink) { // Stick the notice on the queue -function common_enqueue_notice($notice) { +function common_enqueue_notice($notice) +{ foreach (array('jabber', 'omb', 'sms', 'public') as $transport) { $qi = new Queue_item(); $qi->notice_id = $notice->id; @@ -1551,7 +1625,8 @@ function common_enqueue_notice($notice) { return $result; } -function common_dequeue_notice($notice) { +function common_dequeue_notice($notice) +{ $qi = Queue_item::staticGet($notice->id); if ($qi) { $result = $qi->delete(); @@ -1567,7 +1642,8 @@ function common_dequeue_notice($notice) { } } -function common_real_broadcast($notice, $remote=false) { +function common_real_broadcast($notice, $remote=false) +{ $success = true; if (!$remote) { // Make sure we have the OMB stuff @@ -1601,7 +1677,8 @@ function common_real_broadcast($notice, $remote=false) { return $success; } -function common_broadcast_profile($profile) { +function common_broadcast_profile($profile) +{ // XXX: optionally use a queue system like http://code.google.com/p/microapps/wiki/NQDQ require_once(INSTALLDIR.'/lib/omb.php'); omb_broadcast_profile($profile); @@ -1609,13 +1686,15 @@ function common_broadcast_profile($profile) { return true; } -function common_profile_url($nickname) { +function common_profile_url($nickname) +{ return common_local_url('showstream', array('nickname' => $nickname)); } // Don't call if nobody's logged in -function common_notice_form($action=null, $content=null) { +function common_notice_form($action=null, $content=null) +{ $user = common_current_user(); assert(!is_null($user)); common_element_start('form', array('id' => 'status_form', @@ -1647,14 +1726,16 @@ function common_notice_form($action=null, $content=null) { // Should make up a reasonable root URL -function common_root_url() { +function common_root_url() +{ return common_path(''); } // returns $bytes bytes of random data as a hexadecimal string // "good" here is a goal and not a guarantee -function common_good_rand($bytes) { +function common_good_rand($bytes) +{ // XXX: use random.org...? if (file_exists('/dev/urandom')) { return common_urandom($bytes); @@ -1663,7 +1744,8 @@ function common_good_rand($bytes) { } } -function common_urandom($bytes) { +function common_urandom($bytes) +{ $h = fopen('/dev/urandom', 'rb'); // should not block $src = fread($h, $bytes); @@ -1675,7 +1757,8 @@ function common_urandom($bytes) { return $enc; } -function common_mtrand($bytes) { +function common_mtrand($bytes) +{ $enc = ''; for ($i = 0; $i < $bytes; $i++) { $enc .= sprintf("%02x", mt_rand(0, 255)); @@ -1683,21 +1766,25 @@ function common_mtrand($bytes) { return $enc; } -function common_set_returnto($url) { +function common_set_returnto($url) +{ common_ensure_session(); $_SESSION['returnto'] = $url; } -function common_get_returnto() { +function common_get_returnto() +{ common_ensure_session(); return $_SESSION['returnto']; } -function common_timestamp() { +function common_timestamp() +{ return date('YmdHis'); } -function common_ensure_syslog() { +function common_ensure_syslog() +{ static $initialized = false; if (!$initialized) { global $config; @@ -1706,7 +1793,8 @@ function common_ensure_syslog() { } } -function common_log($priority, $msg, $filename=null) { +function common_log($priority, $msg, $filename=null) +{ $logfile = common_config('site', 'logfile'); if ($logfile) { $log = fopen($logfile, "a"); @@ -1723,7 +1811,8 @@ function common_log($priority, $msg, $filename=null) { } } -function common_debug($msg, $filename=null) { +function common_debug($msg, $filename=null) +{ if ($filename) { common_log(LOG_DEBUG, basename($filename).' - '.$msg); } else { @@ -1731,13 +1820,15 @@ function common_debug($msg, $filename=null) { } } -function common_log_db_error(&$object, $verb, $filename=null) { +function common_log_db_error(&$object, $verb, $filename=null) +{ $objstr = common_log_objstring($object); $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError'); common_log(LOG_ERR, $last_error->message . '(' . $verb . ' on ' . $objstr . ')', $filename); } -function common_log_objstring(&$object) { +function common_log_objstring(&$object) +{ if (is_null($object)) { return "null"; } @@ -1750,11 +1841,13 @@ function common_log_objstring(&$object) { return $objstring; } -function common_valid_http_url($url) { +function common_valid_http_url($url) +{ return Validate::uri($url, array('allowed_schemes' => array('http', 'https'))); } -function common_valid_tag($tag) { +function common_valid_tag($tag) +{ if (preg_match('/^tag:(.*?),(\d{4}(-\d{2}(-\d{2})?)?):(.*)$/', $tag, $matches)) { return (Validate::email($matches[1]) || preg_match('/^([\w-\.]+)$/', $matches[1])); @@ -1764,7 +1857,8 @@ function common_valid_tag($tag) { // Does a little before-after block for next/prev page -function common_pagination($have_before, $have_after, $page, $action, $args=null) { +function common_pagination($have_before, $have_after, $page, $action, $args=null) +{ if ($have_before || $have_after) { common_element_start('div', array('id' => 'pagination')); @@ -1799,7 +1893,8 @@ function common_pagination($have_before, $have_after, $page, $action, $args=null /* Following functions are copied from MediaWiki GlobalFunctions.php * and written by Evan Prodromou. */ -function common_accept_to_prefs($accept, $def = '*/*') { +function common_accept_to_prefs($accept, $def = '*/*') +{ // No arg means accept anything (per HTTP spec) if(!$accept) { return array($def => 1); @@ -1823,7 +1918,8 @@ function common_accept_to_prefs($accept, $def = '*/*') { return $prefs; } -function common_mime_type_match($type, $avail) { +function common_mime_type_match($type, $avail) +{ if(array_key_exists($type, $avail)) { return $type; } else { @@ -1838,7 +1934,8 @@ function common_mime_type_match($type, $avail) { } } -function common_negotiate_type($cprefs, $sprefs) { +function common_negotiate_type($cprefs, $sprefs) +{ $combine = array(); foreach(array_keys($sprefs) as $type) { @@ -1874,12 +1971,14 @@ function common_negotiate_type($cprefs, $sprefs) { return $besttype; } -function common_config($main, $sub) { +function common_config($main, $sub) +{ global $config; return isset($config[$main][$sub]) ? $config[$main][$sub] : false; } -function common_copy_args($from) { +function common_copy_args($from) +{ $to = array(); $strip = get_magic_quotes_gpc(); foreach ($from as $k => $v) { @@ -1890,25 +1989,29 @@ function common_copy_args($from) { // Neutralise the evil effects of magic_quotes_gpc in the current request. // This is used before handing a request off to OAuthRequest::from_request. -function common_remove_magic_from_request() { +function common_remove_magic_from_request() +{ if(get_magic_quotes_gpc()) { $_POST=array_map('stripslashes',$_POST); $_GET=array_map('stripslashes',$_GET); } } -function common_user_uri(&$user) { +function common_user_uri(&$user) +{ return common_local_url('userbyid', array('id' => $user->id)); } -function common_notice_uri(&$notice) { +function common_notice_uri(&$notice) +{ return common_local_url('shownotice', array('notice' => $notice->id)); } // 36 alphanums - lookalikes (0, O, 1, I) = 32 chars = 5 bits -function common_confirmation_code($bits) { +function common_confirmation_code($bits) +{ // 36 alphanums - lookalikes (0, O, 1, I) = 32 chars = 5 bits static $codechars = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ'; $chars = ceil($bits/5); @@ -1925,14 +2028,16 @@ function common_confirmation_code($bits) { // convert markup to HTML -function common_markup_to_html($c) { +function common_markup_to_html($c) +{ $c = preg_replace('/%%action.(\w+)%%/e', "common_local_url('\\1')", $c); $c = preg_replace('/%%doc.(\w+)%%/e', "common_local_url('doc', array('title'=>'\\1'))", $c); $c = preg_replace('/%%(\w+).(\w+)%%/e', 'common_config(\'\\1\', \'\\2\')', $c); return Markdown($c); } -function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) { +function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) +{ $avatar = $profile->getAvatar($size); if ($avatar) { return common_avatar_display_url($avatar); @@ -1941,7 +2046,8 @@ function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) { } } -function common_profile_uri($profile) { +function common_profile_uri($profile) +{ if (!$profile) { return null; } @@ -1958,13 +2064,15 @@ function common_profile_uri($profile) { return null; } -function common_canonical_sms($sms) { +function common_canonical_sms($sms) +{ // strip non-digits preg_replace('/\D/', '', $sms); return $sms; } -function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext) { +function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext) +{ switch ($errno) { case E_USER_ERROR: common_log(LOG_ERR, "[$errno] $errstr ($errfile:$errline)"); @@ -1985,7 +2093,8 @@ function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext) return true; } -function common_session_token() { +function common_session_token() +{ common_ensure_session(); if (!array_key_exists('token', $_SESSION)) { $_SESSION['token'] = common_good_rand(64); @@ -1993,7 +2102,8 @@ function common_session_token() { return $_SESSION['token']; } -function common_disfavor_form($notice) { +function common_disfavor_form($notice) +{ common_element_start('form', array('id' => 'disfavor-' . $notice->id, 'method' => 'post', 'class' => 'disfavor', @@ -2020,7 +2130,8 @@ function common_disfavor_form($notice) { common_element_end('form'); } -function common_favor_form($notice) { +function common_favor_form($notice) +{ common_element_start('form', array('id' => 'favor-' . $notice->id, 'method' => 'post', 'class' => 'favor', @@ -2047,7 +2158,8 @@ function common_favor_form($notice) { common_element_end('form'); } -function common_nudge_form($profile) { +function common_nudge_form($profile) +{ common_element_start('form', array('id' => 'nudge', 'method' => 'post', 'action' => common_local_url('nudge', array('nickname' => $profile->nickname)))); common_hidden('token', common_session_token()); @@ -2056,11 +2168,13 @@ function common_nudge_form($profile) { 'value' => _('Send a nudge'))); common_element_end('form'); } -function common_nudge_response() { +function common_nudge_response() +{ common_element('p', array('id' => 'nudge_response'), _('Nudge sent!')); } -function common_subscribe_form($profile) { +function common_subscribe_form($profile) +{ common_element_start('form', array('id' => 'subscribe-' . $profile->id, 'method' => 'post', 'class' => 'subscribe', @@ -2076,7 +2190,8 @@ function common_subscribe_form($profile) { common_element_end('form'); } -function common_unsubscribe_form($profile) { +function common_unsubscribe_form($profile) +{ common_element_start('form', array('id' => 'unsubscribe-' . $profile->id, 'method' => 'post', 'class' => 'unsubscribe', @@ -2093,7 +2208,8 @@ function common_unsubscribe_form($profile) { } // XXX: Refactor this code -function common_profile_new_message_nudge ($cur, $profile) { +function common_profile_new_message_nudge ($cur, $profile) +{ $user = User::staticGet('id', $profile->id); if ($cur && $cur->id != $user->id && $cur->mutuallySubscribed($user)) { @@ -2110,17 +2226,20 @@ function common_profile_new_message_nudge ($cur, $profile) { } } -function common_cache_key($extra) { +function common_cache_key($extra) +{ return 'laconica:' . common_keyize(common_config('site', 'name')) . ':' . $extra; } -function common_keyize($str) { +function common_keyize($str) +{ $str = strtolower($str); $str = preg_replace('/\s/', '_', $str); return $str; } -function common_message_form($content, $user, $to) { +function common_message_form($content, $user, $to) +{ common_element_start('form', array('id' => 'message_form', 'method' => 'post', @@ -2160,7 +2279,8 @@ function common_message_form($content, $user, $to) { common_element_end('form'); } -function common_memcache() { +function common_memcache() +{ static $cache = null; if (!common_config('memcached', 'enabled')) { return null; @@ -2180,22 +2300,26 @@ function common_memcache() { } } -function common_compatible_license($from, $to) { +function common_compatible_license($from, $to) +{ // XXX: better compatibility check needed here! return ($from == $to); } /* These are almost identical, so we use a helper function */ -function common_block_form($profile, $args=null) { +function common_block_form($profile, $args=null) +{ common_blocking_form('block', _('Block'), $profile, $args); } -function common_unblock_form($profile, $args=null) { +function common_unblock_form($profile, $args=null) +{ common_blocking_form('unblock', _('Unblock'), $profile, $args); } -function common_blocking_form($type, $label, $profile, $args=null) { +function common_blocking_form($type, $label, $profile, $args=null) +{ common_element_start('form', array('id' => $type . '-' . $profile->id, 'method' => 'post', 'class' => $type, diff --git a/_darcs/pristine/lib/xmppqueuehandler.php b/_darcs/pristine/lib/xmppqueuehandler.php index 10c754a5b..0a73403f9 100644 --- a/_darcs/pristine/lib/xmppqueuehandler.php +++ b/_darcs/pristine/lib/xmppqueuehandler.php @@ -30,7 +30,8 @@ require_once(INSTALLDIR.'/lib/queuehandler.php'); class XmppQueueHandler extends QueueHandler { - function start() { + function start() + { # Low priority; we don't want to receive messages $this->log(LOG_INFO, "INITIALIZE"); $this->conn = jabber_connect($this->_id); @@ -43,12 +44,14 @@ class XmppQueueHandler extends QueueHandler { return !is_null($this->conn); } - function handle_reconnect(&$pl) { + function handle_reconnect(&$pl) + { $this->conn->processUntil('session_start'); $this->conn->presence(null, 'available', null, 'available', -1); } - function idle($timeout=0) { + function idle($timeout=0) + { # Process the queue for as long as needed try { if ($this->conn) { @@ -60,7 +63,8 @@ class XmppQueueHandler extends QueueHandler { } } - function forward_message(&$pl) { + function forward_message(&$pl) + { if ($pl['type'] != 'chat') { $this->log(LOG_DEBUG, 'Ignoring message of type ' . $pl['type'] . ' from ' . $pl['from']); return; @@ -74,14 +78,16 @@ class XmppQueueHandler extends QueueHandler { $this->conn->message($this->listener(), $pl['body'], 'chat', null, $this->ofrom($pl['from'])); } - function ofrom($from) { + function ofrom($from) + { $address = "\n"; $address .= "
\n"; $address .= "\n"; return $address; } - function listener() { + function listener() + { if (common_config('xmpp', 'listener')) { return common_config('xmpp', 'listener'); } else { diff --git a/_darcs/pristine/scripts/enjitqueuehandler.php b/_darcs/pristine/scripts/enjitqueuehandler.php index 1c033603f..55d73e08c 100644 --- a/_darcs/pristine/scripts/enjitqueuehandler.php +++ b/_darcs/pristine/scripts/enjitqueuehandler.php @@ -35,17 +35,20 @@ set_error_handler('common_error_handler'); class EnjitQueueHandler extends QueueHandler { - function transport() { + function transport() + { return 'enjit'; } - function start() { + function start() + { $this->log(LOG_INFO, "Starting EnjitQueueHandler"); $this->log(LOG_INFO, "Broadcasting to ".common_config('enjit', 'apiurl')); return true; } - function handle_notice($notice) { + function handle_notice($notice) + { $profile = Profile::staticGet($notice->profile_id); diff --git a/_darcs/pristine/scripts/jabberqueuehandler.php b/_darcs/pristine/scripts/jabberqueuehandler.php index 271aab22b..ea26aaf79 100644 --- a/_darcs/pristine/scripts/jabberqueuehandler.php +++ b/_darcs/pristine/scripts/jabberqueuehandler.php @@ -37,11 +37,13 @@ class JabberQueueHandler extends XmppQueueHandler { var $conn = null; - function transport() { + function transport() + { return 'jabber'; } - function handle_notice($notice) { + function handle_notice($notice) + { try { return jabber_broadcast_notice($notice); } catch (XMPPHP_Exception $e) { diff --git a/_darcs/pristine/scripts/maildaemon.php b/_darcs/pristine/scripts/maildaemon.php index 886e72ba7..6100cd21b 100644 --- a/_darcs/pristine/scripts/maildaemon.php +++ b/_darcs/pristine/scripts/maildaemon.php @@ -36,10 +36,12 @@ require_once('Mail/mimeDecode.php'); class MailerDaemon { - function __construct() { + function __construct() + { } - function handle_message($fname='php://stdin') { + function handle_message($fname='php://stdin') + { list($from, $to, $msg) = $this->parse_message($fname); if (!$from || !$to || !$msg) { $this->error(null, _('Could not parse message.')); @@ -66,12 +68,14 @@ class MailerDaemon { $this->add_notice($user, $msg); } - function error($from, $msg) { + function error($from, $msg) + { file_put_contents("php://stderr", $msg . "\n"); exit(1); } - function user_from($from_hdr) { + function user_from($from_hdr) + { $froms = mailparse_rfc822_parse_addresses($from_hdr); if (!$froms) { return null; @@ -85,7 +89,8 @@ class MailerDaemon { return $user; } - function user_match_to($user, $to_hdr) { + function user_match_to($user, $to_hdr) + { $incoming = $user->incomingemail; $tos = mailparse_rfc822_parse_addresses($to_hdr); foreach ($tos as $to) { @@ -96,7 +101,8 @@ class MailerDaemon { return false; } - function handle_command($user, $from, $msg) { + function handle_command($user, $from, $msg) + { $inter = new CommandInterpreter(); $cmd = $inter->handle_command($user, $msg); if ($cmd) { @@ -106,7 +112,8 @@ class MailerDaemon { return false; } - function respond($from, $to, $response) { + function respond($from, $to, $response) + { $headers['From'] = $to; $headers['To'] = $from; @@ -115,11 +122,13 @@ class MailerDaemon { return mail_send(array($from), $headers, $response); } - function log($level, $msg) { + function log($level, $msg) + { common_log($level, 'MailDaemon: '.$msg); } - function add_notice($user, $msg) { + function add_notice($user, $msg) + { // should test // $msg_shortened = common_shorten_links($msg); // if (mb_strlen($msg_shortened) > 140) ERROR and STOP @@ -133,7 +142,8 @@ class MailerDaemon { 'Added notice ' . $notice->id . ' from user ' . $user->nickname); } - function parse_message($fname) { + function parse_message($fname) + { $contents = file_get_contents($fname); $parsed = Mail_mimeDecode::decode(array('input' => $contents, 'include_bodies' => true, @@ -166,11 +176,13 @@ class MailerDaemon { return array($from, $to, $msg); } - function unsupported_type($type) { + function unsupported_type($type) + { $this->error(null, "Unsupported message type: " . $type); } - function cleanup_msg($msg) { + function cleanup_msg($msg) + { $lines = explode("\n", $msg); $output = ''; diff --git a/_darcs/pristine/scripts/ombqueuehandler.php b/_darcs/pristine/scripts/ombqueuehandler.php index 43c0980b6..299381ace 100644 --- a/_darcs/pristine/scripts/ombqueuehandler.php +++ b/_darcs/pristine/scripts/ombqueuehandler.php @@ -35,16 +35,19 @@ set_error_handler('common_error_handler'); class OmbQueueHandler extends QueueHandler { - function transport() { + function transport() + { return 'omb'; } - function start() { + function start() + { $this->log(LOG_INFO, "INITIALIZE"); return true; } - function handle_notice($notice) { + function handle_notice($notice) + { if ($this->is_remote($notice)) { $this->log(LOG_DEBUG, 'Ignoring remote notice ' . $notice->id); return true; @@ -53,10 +56,12 @@ class OmbQueueHandler extends QueueHandler { } } - function finish() { + function finish() + { } - function is_remote($notice) { + function is_remote($notice) + { $user = User::staticGet($notice->profile_id); return is_null($user); } diff --git a/_darcs/pristine/scripts/publicqueuehandler.php b/_darcs/pristine/scripts/publicqueuehandler.php index 2168aade2..b3542e5c5 100644 --- a/_darcs/pristine/scripts/publicqueuehandler.php +++ b/_darcs/pristine/scripts/publicqueuehandler.php @@ -35,11 +35,13 @@ set_error_handler('common_error_handler'); class PublicQueueHandler extends XmppQueueHandler { - function transport() { + function transport() + { return 'public'; } - function handle_notice($notice) { + function handle_notice($notice) + { try { return jabber_public_notice($notice); } catch (XMPPHP_Exception $e) { diff --git a/_darcs/pristine/scripts/sitemap.php b/_darcs/pristine/scripts/sitemap.php index b49bfe2a5..504783e88 100644 --- a/_darcs/pristine/scripts/sitemap.php +++ b/_darcs/pristine/scripts/sitemap.php @@ -18,7 +18,8 @@ index_map(); # ------------------------------------------------------------------------------ # Generate index sitemap of all other sitemaps. -function index_map() { +function index_map() +{ global $output_paths; $output_dir = $output_paths['output_dir']; $output_url = $output_paths['output_url']; @@ -40,7 +41,8 @@ function index_map() { } # Generate sitemap of standard site elements. -function standard_map() { +function standard_map() +{ global $output_paths; $standard_map_urls .= url( @@ -77,7 +79,8 @@ function standard_map() { } # Generate sitemaps of all notices. -function notices_map() { +function notices_map() +{ global $output_paths; $notices = DB_DataObject::factory('notice'); @@ -115,7 +118,8 @@ function notices_map() { } # Generate sitemaps of all users. -function user_map() { +function user_map() +{ global $output_paths; $users = DB_DataObject::factory('user'); @@ -208,7 +212,8 @@ function user_map() { # ------------------------------------------------------------------------------ # Generate a element. -function url($url_args) { +function url($url_args) +{ $url = preg_replace('/&/', '&', $url_args['url']); # escape ampersands for XML $lastmod = $url_args['lastmod']; $changefreq = $url_args['changefreq']; @@ -238,7 +243,8 @@ function url($url_args) { return $url_out; } -function sitemap($sitemap_args) { +function sitemap($sitemap_args) +{ $url = preg_replace('/&/', '&', $sitemap_args['url']); # escape ampersands for XML $lastmod = $sitemap_args['lastmod']; @@ -259,7 +265,8 @@ function sitemap($sitemap_args) { } # Generate a element. -function urlset($urlset_text) { +function urlset($urlset_text) +{ $urlset = '' . "\n" . '' . "\n" . $urlset_text . @@ -269,7 +276,8 @@ function urlset($urlset_text) { } # Generate a element. -function sitemapindex($sitemapindex_text) { +function sitemapindex($sitemapindex_text) +{ $sitemapindex = '' . "\n" . '' . "\n" . $sitemapindex_text . @@ -279,7 +287,8 @@ function sitemapindex($sitemapindex_text) { } # Generate a sitemap from an array containing elements and write it to a file. -function array_to_map($url_list, $filename_prefix) { +function array_to_map($url_list, $filename_prefix) +{ global $output_paths; if ($url_list) { @@ -297,7 +306,8 @@ function array_to_map($url_list, $filename_prefix) { # ------------------------------------------------------------------------------ # Parse command line arguments. -function parse_args() { +function parse_args() +{ $args = getopt('f:d:u:'); if (is_null($args[f]) && is_null($args[d]) && is_null($args[u])) { @@ -338,7 +348,8 @@ function parse_args() { } # Ensure paths end with a "/". -function trailing_slash($path) { +function trailing_slash($path) +{ if (preg_match('/\/$/', $path) == 0) { $path .= '/'; } @@ -347,7 +358,8 @@ function trailing_slash($path) { } # Write data to disk. -function write_file($path, $data) { +function write_file($path, $data) +{ if (is_null($path)) { error('No path specified for writing to.'); } elseif (is_null($data)) { @@ -364,7 +376,8 @@ function write_file($path, $data) { } # Display an error message and exit. -function error ($error_msg) { +function error ($error_msg) +{ if (is_null($error_msg)) { $error_msg = 'error() was called without any explanation!'; } diff --git a/_darcs/pristine/scripts/smsqueuehandler.php b/_darcs/pristine/scripts/smsqueuehandler.php index f8b2e9d53..c962ad095 100644 --- a/_darcs/pristine/scripts/smsqueuehandler.php +++ b/_darcs/pristine/scripts/smsqueuehandler.php @@ -35,20 +35,24 @@ set_error_handler('common_error_handler'); class SmsQueueHandler extends QueueHandler { - function transport() { + function transport() + { return 'sms'; } - function start() { + function start() + { $this->log(LOG_INFO, "INITIALIZE"); return true; } - function handle_notice($notice) { + function handle_notice($notice) + { return mail_broadcast_notice_sms($notice); } - function finish() { + function finish() + { } } diff --git a/_darcs/pristine/scripts/xmppconfirmhandler.php b/_darcs/pristine/scripts/xmppconfirmhandler.php index 9e177b3fa..b059149bc 100644 --- a/_darcs/pristine/scripts/xmppconfirmhandler.php +++ b/_darcs/pristine/scripts/xmppconfirmhandler.php @@ -39,11 +39,13 @@ class XmppConfirmHandler extends XmppQueueHandler { var $_id = 'confirm'; - function class_name() { + function class_name() + { return 'XmppConfirmHandler'; } - function run() { + function run() + { if (!$this->start()) { return false; } @@ -99,7 +101,8 @@ class XmppConfirmHandler extends XmppQueueHandler { return true; } - function next_confirm() { + function next_confirm() + { $confirm = new Confirm_address(); $confirm->whereAdd('claimed IS null'); $confirm->whereAdd('sent IS null'); @@ -125,7 +128,8 @@ class XmppConfirmHandler extends XmppQueueHandler { return null; } - function clear_old_confirm_claims() { + function clear_old_confirm_claims() + { $confirm = new Confirm(); $confirm->claimed = null; $confirm->whereAdd('now() - claimed > '.CLAIM_TIMEOUT); diff --git a/_darcs/pristine/scripts/xmppdaemon.php b/_darcs/pristine/scripts/xmppdaemon.php index ead842928..28ac64725 100644 --- a/_darcs/pristine/scripts/xmppdaemon.php +++ b/_darcs/pristine/scripts/xmppdaemon.php @@ -39,7 +39,8 @@ set_error_handler('common_error_handler'); class XMPPDaemon extends Daemon { - function XMPPDaemon($resource=null) { + function XMPPDaemon($resource=null) + { static $attrs = array('server', 'port', 'user', 'password', 'host'); foreach ($attrs as $attr) @@ -56,7 +57,8 @@ class XMPPDaemon extends Daemon { $this->log(LOG_INFO, "INITIALIZE XMPPDaemon {$this->user}@{$this->server}/{$this->resource}"); } - function connect() { + function connect() + { $connect_to = ($this->host) ? $this->host : $this->server; @@ -75,11 +77,13 @@ class XMPPDaemon extends Daemon { return !$this->conn->isDisconnected(); } - function name() { + function name() + { return strtolower('xmppdaemon.'.$this->resource); } - function run() { + function run() + { if ($this->connect()) { $this->conn->addEventHandler('message', 'handle_message', $this); @@ -90,17 +94,20 @@ class XMPPDaemon extends Daemon { } } - function handle_reconnect(&$pl) { + function handle_reconnect(&$pl) + { $this->conn->processUntil('session_start'); $this->conn->presence('Send me a message to post a notice', 'available', null, 'available', 100); } - function get_user($from) { + function get_user($from) + { $user = User::staticGet('jabber', jabber_normalize_jid($from)); return $user; } - function handle_message(&$pl) { + function handle_message(&$pl) + { if ($pl['type'] != 'chat') { return; } @@ -156,11 +163,13 @@ class XMPPDaemon extends Daemon { unset($user); } - function is_self($from) { + function is_self($from) + { return preg_match('/^'.strtolower(jabber_daemon_address()).'/', strtolower($from)); } - function get_ofrom($pl) { + function get_ofrom($pl) + { $xml = $pl['xml']; $addresses = $xml->sub('addresses'); if (!$addresses) { @@ -194,7 +203,8 @@ class XMPPDaemon extends Daemon { return $jid; } - function is_autoreply($txt) { + function is_autoreply($txt) + { if (preg_match('/[\[\(]?[Aa]uto[-\s]?[Rr]e(ply|sponse)[\]\)]/', $txt)) { return true; } else { @@ -202,7 +212,8 @@ class XMPPDaemon extends Daemon { } } - function is_otr($txt) { + function is_otr($txt) + { if (preg_match('/^\?OTR/', $txt)) { return true; } else { @@ -210,7 +221,8 @@ class XMPPDaemon extends Daemon { } } - function is_direct($txt) { + function is_direct($txt) + { if (strtolower(substr($txt, 0, 2))=='d ') { return true; } else { @@ -218,12 +230,14 @@ class XMPPDaemon extends Daemon { } } - function from_site($address, $msg) { + function from_site($address, $msg) + { $text = '['.common_config('site', 'name') . '] ' . $msg; jabber_send_message($address, $text); } - function handle_command($user, $body) { + function handle_command($user, $body) + { $inter = new CommandInterpreter(); $cmd = $inter->handle_command($user, $body); if ($cmd) { @@ -235,7 +249,8 @@ class XMPPDaemon extends Daemon { } } - function add_notice(&$user, &$pl) { + function add_notice(&$user, &$pl) + { $body = trim($pl['body']); $content_shortened = common_shorten_link($body); if (mb_strlen($content_shortened) > 140) { @@ -257,7 +272,8 @@ class XMPPDaemon extends Daemon { unset($notice); } - function handle_presence(&$pl) { + function handle_presence(&$pl) + { $from = jabber_normalize_jid($pl['from']); switch ($pl['type']) { case 'subscribe': @@ -291,11 +307,13 @@ class XMPPDaemon extends Daemon { } } - function log($level, $msg) { + function log($level, $msg) + { common_log($level, 'XMPPDaemon('.$this->resource.'): '.$msg); } - function subscribed($to) { + function subscribed($to) + { jabber_special_presence('subscribed', $to); } } diff --git a/_darcs/tentative_pristine b/_darcs/tentative_pristine index 62c02a301..4a4beb36c 100644 --- a/_darcs/tentative_pristine +++ b/_darcs/tentative_pristine @@ -1,1338 +1,3664 @@ -hunk ./actions/allrss.php 28 -- var $user = NULL; -+ var $user = null; -hunk ./actions/allrss.php 72 -- return NULL; -+ return null; -hunk ./actions/allrss.php 75 -- return ($avatar) ? $avatar->url : NULL; -+ return ($avatar) ? $avatar->url : null; -hunk ./actions/api.php 155 -- common_element('error', NULL, $msg); -- common_element('request', NULL, $_SERVER['REQUEST_URI']); -+ common_element('error', null, $msg); -+ common_element('request', null, $_SERVER['REQUEST_URI']); -hunk ./actions/block.php 24 -- var $profile = NULL; -+ var $profile = null; -hunk ./actions/block.php 80 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/confirmaddress.php 91 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/deletenotice.php 44 -- function show_form($error=NULL) { -+ function show_form($error=null) { -hunk ./actions/deletenotice.php 94 -- common_set_returnto(NULL); -+ common_set_returnto(null); -hunk ./actions/deleteprofile.php 39 -- function form_header($title, $msg=NULL, $success=false) { -+ function form_header($title, $msg=null, $success=false) { +hunk ./actions/accesstoken.php 25 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/all.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/all.php 57 +- function show_header($user) { ++ function show_header($user) ++ { +hunk ./actions/all.php 66 +- function show_top($user) { ++ function show_top($user) ++ { +hunk ./actions/all.php 82 +- function show_notices($user) { ++ function show_notices($user) ++ { +hunk ./actions/allrss.php 30 +- function init() { ++ function init() ++ { +hunk ./actions/allrss.php 43 +- function get_notices($limit=0) { ++ function get_notices($limit=0) ++ { +hunk ./actions/allrss.php 57 +- function get_channel() { ++ function get_channel() ++ { +hunk ./actions/allrss.php 71 +- function get_image() { ++ function get_image() ++ { +hunk ./actions/api.php 30 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/api.php 83 +- function process_command() { ++ function process_command() ++ { +hunk ./actions/api.php 113 +- function requires_auth() { ++ function requires_auth() ++ { +hunk ./actions/api.php 150 +- function show_basic_auth_error() { ++ function show_basic_auth_error() ++ { +hunk ./actions/api.php 173 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./actions/avatarbynickname.php 23 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/block.php 26 +- function prepare($args) { ++ function prepare($args) ++ { +hunk ./actions/block.php 60 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/block.php 76 +- function are_you_sure_form() { ++ function are_you_sure_form() ++ { +hunk ./actions/block.php 115 +- function block_profile() { ++ function block_profile() ++ { +hunk ./actions/confirmaddress.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/deletenotice.php 25 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/deletenotice.php 37 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/deletenotice.php 42 +- function get_title() { ++ function get_title() ++ { +hunk ./actions/deletenotice.php 47 +- function show_form($error=null) { ++ function show_form($error=null) ++ { +hunk ./actions/deletenotice.php 74 +- function delete_notice() { ++ function delete_notice() ++ { +hunk ./actions/deleteprofile.php 23 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/deleteprofile.php 36 +- function get_instructions() { ++ function get_instructions() ++ { hunk ./actions/deleteprofile.php 41 -- NULL, -+ null, -hunk ./actions/deleteprofile.php 87 -- function show_form($msg=NULL, $success=false) { -+ function show_form($msg=null, $success=false) { -hunk ./actions/deleteprofile.php 89 -- common_element('h2', NULL, _('Delete my account confirmation')); -+ common_element('h2', null, _('Delete my account confirmation')); -hunk ./actions/deleteprofile.php 216 -- common_set_user(NULL); -+ common_set_user(null); -hunk ./actions/emailsettings.php 30 -- function show_form($msg=NULL, $success=false) { -+ function show_form($msg=null, $success=false) { -hunk ./actions/emailsettings.php 39 -- common_element('h2', NULL, _('Address')); -+ common_element('h2', null, _('Address')); -hunk ./actions/emailsettings.php 61 -- ($this->arg('email')) ? $this->arg('email') : NULL, -+ ($this->arg('email')) ? $this->arg('email') : null, -hunk ./actions/emailsettings.php 68 -- common_element('h2', NULL, _('Incoming email')); -+ common_element('h2', null, _('Incoming email')); -hunk ./actions/emailsettings.php 86 -- common_element('h2', NULL, _('Preferences')); -+ common_element('h2', null, _('Preferences')); -hunk ./actions/emailsettings.php 121 -- return NULL; -+ return null; -hunk ./actions/emailsettings.php 276 -- $user->email = NULL; -+ $user->email = null; -hunk ./actions/emailsettings.php 297 -- $user->incomingemail = NULL; -+ $user->incomingemail = null; -hunk ./actions/favorited.php 32 -- array($this, 'show_header'), NULL, -+ array($this, 'show_header'), null, -hunk ./actions/favoritesrss.php 28 -- var $user = NULL; -+ var $user = null; -hunk ./actions/favoritesrss.php 71 -- return NULL; -+ return null; -hunk ./actions/featured.php 33 -- array($this, 'show_header'), NULL, -+ array($this, 'show_header'), null, +- function form_header($title, $msg=null, $success=false) { ++ function form_header($title, $msg=null, $success=false) ++ { +hunk ./actions/deleteprofile.php 49 +- function show_feeds_list($feeds) { ++ function show_feeds_list($feeds) ++ { +hunk ./actions/deleteprofile.php 63 +- function common_feed_item($feed) { ++ function common_feed_item($feed) ++ { +hunk ./actions/deleteprofile.php 92 +- function show_form($msg=null, $success=false) { ++ function show_form($msg=null, $success=false) ++ { +hunk ./actions/deleteprofile.php 100 +- function show_confirm_delete_form() { ++ function show_confirm_delete_form() ++ { +hunk ./actions/deleteprofile.php 130 +- function handle_post() { ++ function handle_post() ++ { +hunk ./actions/deleteprofile.php 145 +- function delete_account() { ++ function delete_account() ++ { +hunk ./actions/deleteprofile.php 231 +- function show_top($arr) { ++ function show_top($arr) ++ { +hunk ./actions/deleteprofile.php 247 +- function settings_menu() { ++ function settings_menu() ++ { +hunk ./actions/disfavor.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/doc.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/emailsettings.php 26 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/emailsettings.php 31 +- function show_form($msg=null, $success=false) { ++ function show_form($msg=null, $success=false) ++ { +hunk ./actions/emailsettings.php 115 +- function get_confirmation() { ++ function get_confirmation() ++ { +hunk ./actions/emailsettings.php 128 +- function handle_post() { ++ function handle_post() ++ { +hunk ./actions/emailsettings.php 155 +- function save_preferences() { ++ function save_preferences() ++ { +hunk ./actions/emailsettings.php 193 +- function add_address() { ++ function add_address() ++ { +hunk ./actions/emailsettings.php 245 +- function cancel_confirmation() { ++ function cancel_confirmation() ++ { +hunk ./actions/emailsettings.php 269 +- function remove_address() { ++ function remove_address() ++ { +hunk ./actions/emailsettings.php 296 +- function remove_incoming() { ++ function remove_incoming() ++ { +hunk ./actions/emailsettings.php 316 +- function new_incoming() { ++ function new_incoming() ++ { +hunk ./actions/emailsettings.php 331 +- function email_exists($email) { ++ function email_exists($email) ++ { +hunk ./actions/facebookhome.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/facebookhome.php 33 +- function login() { ++ function login() ++ { +hunk ./actions/facebookhome.php 94 +- function show_home($facebook, $fbuid, $user) { ++ function show_home($facebook, $fbuid, $user) ++ { +hunk ./actions/facebookhome.php 105 +- function show_notices($user) { ++ function show_notices($user) ++ { +hunk ./actions/facebookinvite.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/facebookinvite.php 33 +- function display() { ++ function display() ++ { +hunk ./actions/facebookremove.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/facebooksettings.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/facebooksettings.php 33 +- function display() { ++ function display() ++ { +hunk ./actions/favor.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/favor.php 84 +- function notify($fave, $notice, $user) { ++ function notify($fave, $notice, $user) ++ { +hunk ./actions/favorited.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/favorited.php 41 +- function show_top() { ++ function show_top() ++ { +hunk ./actions/favorited.php 51 +- function show_header() { ++ function show_header() ++ { +hunk ./actions/favorited.php 56 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/favorited.php 61 +- function show_notices($page) { ++ function show_notices($page) ++ { +hunk ./actions/favoritesrss.php 30 +- function init() { ++ function init() ++ { +hunk ./actions/favoritesrss.php 43 +- function get_notices($limit=0) { ++ function get_notices($limit=0) ++ { +hunk ./actions/favoritesrss.php 59 +- function get_channel() { ++ function get_channel() ++ { +hunk ./actions/favoritesrss.php 73 +- function get_image() { ++ function get_image() ++ { +hunk ./actions/featured.php 27 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/featured.php 42 +- function show_top() { ++ function show_top() ++ { +hunk ./actions/featured.php 52 +- function show_header() { ++ function show_header() ++ { +hunk ./actions/featured.php 56 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/featured.php 61 +- function show_notices($page) { ++ function show_notices($page) ++ { +hunk ./actions/finishaddopenid.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/finishaddopenid.php 36 +- function try_login() { ++ function try_login() ++ { hunk ./actions/finishaddopenid.php 100 -- common_element('p', NULL, $msg); -+ common_element('p', null, $msg); -hunk ./actions/finishopenidlogin.php 55 -- function show_top($error=NULL) { -+ function show_top($error=null) { -hunk ./actions/finishopenidlogin.php 65 -- function show_form($error=NULL, $username=NULL) { -- common_show_header(_('OpenID Account Setup'), NULL, $error, -+ function show_form($error=null, $username=null) { -+ common_show_header(_('OpenID Account Setup'), null, $error, -hunk ./actions/finishopenidlogin.php 73 -- common_element('h2', NULL, -+ common_element('h2', null, -hunk ./actions/finishopenidlogin.php 75 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/finishopenidlogin.php 91 -- common_element('h2', NULL, -+ common_element('h2', null, -hunk ./actions/finishopenidlogin.php 93 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/finishopenidlogin.php 144 -- $this->show_form(NULL, $this->best_new_nickname($display, $sreg)); -+ $this->show_form(null, $this->best_new_nickname($display, $sreg)); -hunk ./actions/finishopenidlogin.php 151 -- common_element('p', NULL, $msg); -+ common_element('p', null, $msg); -hunk ./actions/finishopenidlogin.php 293 -- common_set_returnto(NULL); -+ common_set_returnto(null); -hunk ./actions/finishopenidlogin.php 332 -- return NULL; -+ return null; -hunk ./actions/finishopenidlogin.php 372 -- return NULL; -+ return null; -hunk ./actions/finishopenidlogin.php 406 -- return NULL; -+ return null; -hunk ./actions/finishopenidlogin.php 413 -- return NULL; -+ return null; -hunk ./actions/finishremotesubscribe.php 281 -- return NULL; -+ return null; -hunk ./actions/foaf.php 69 -- common_element('mbox_sha1sum', NULL, sha1('mailto:' . $user->email)); -+ common_element('mbox_sha1sum', null, sha1('mailto:' . $user->email)); -hunk ./actions/foaf.php 71 -- common_element('name', NULL, $profile->fullname); -+ common_element('name', null, $profile->fullname); -hunk ./actions/foaf.php 77 -- common_element('rdfs:comment', NULL, $profile->bio); -+ common_element('rdfs:comment', null, $profile->bio); -hunk ./actions/foaf.php 83 -- common_element('name', NULL, $profile->location); -+ common_element('name', null, $profile->location); -hunk ./actions/foaf.php 159 -- $foaf_url = NULL; -+ $foaf_url = null; -hunk ./actions/foaf.php 169 -- common_root_url() : NULL); -+ common_root_url() : null); -hunk ./actions/foaf.php 189 -- function show_microblogging_account($profile, $service=NULL) { -+ function show_microblogging_account($profile, $service=null) { -hunk ./actions/foaf.php 197 -- common_element('accountName', NULL, $profile->nickname); -+ common_element('accountName', null, $profile->nickname); -hunk ./actions/imsettings.php 31 -- function show_form($msg=NULL, $success=false) { -+ function show_form($msg=null, $success=false) { -hunk ./actions/imsettings.php 40 -- common_element('h2', NULL, _('Address')); -+ common_element('h2', null, _('Address')); -hunk ./actions/imsettings.php 62 -- ($this->arg('jabber')) ? $this->arg('jabber') : NULL, -+ ($this->arg('jabber')) ? $this->arg('jabber') : null, -hunk ./actions/imsettings.php 68 -- common_element('h2', NULL, _('Preferences')); -+ common_element('h2', null, _('Preferences')); -hunk ./actions/imsettings.php 96 -- return NULL; -+ return null; -hunk ./actions/imsettings.php 247 -- $user->jabber = NULL; -+ $user->jabber = null; -hunk ./actions/invite.php 88 -- common_element('p', NULL, _('You are already subscribed to these users:')); -+ common_element('p', null, _('You are already subscribed to these users:')); -hunk ./actions/invite.php 91 -- common_element('li', NULL, sprintf(_('%s (%s)'), $other->nickname, $other->email)); -+ common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); -hunk ./actions/invite.php 96 -- common_element('p', NULL, _('These people are already users and you were automatically subscribed to them:')); -+ common_element('p', null, _('These people are already users and you were automatically subscribed to them:')); -hunk ./actions/invite.php 99 -- common_element('li', NULL, sprintf(_('%s (%s)'), $other->nickname, $other->email)); -+ common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); -hunk ./actions/invite.php 104 -- common_element('p', NULL, _('Invitation(s) sent to the following people:')); -+ common_element('p', null, _('Invitation(s) sent to the following people:')); -hunk ./actions/invite.php 107 -- common_element('li', NULL, $other); -+ common_element('li', null, $other); -hunk ./actions/invite.php 110 -- common_element('p', NULL, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!')); -+ common_element('p', null, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!')); -hunk ./actions/invite.php 115 -- function show_top($error=NULL) { -+ function show_top($error=null) { -hunk ./actions/invite.php 120 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/invite.php 126 -- function show_form($error=NULL) { -+ function show_form($error=null) { +- function message($msg) { ++ function message($msg) ++ { +hunk ./actions/finishimmediate.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/finishimmediate.php 57 +- function go_backto() { ++ function go_backto() ++ { +hunk ./actions/finishopenidlogin.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/finishopenidlogin.php 56 +- function show_top($error=null) { ++ function show_top($error=null) ++ { +hunk ./actions/finishopenidlogin.php 67 +- function show_form($error=null, $username=null) { ++ function show_form($error=null, $username=null) ++ { +hunk ./actions/finishopenidlogin.php 105 +- function try_login() { ++ function try_login() ++ { +hunk ./actions/finishopenidlogin.php 153 +- function message($msg) { ++ function message($msg) ++ { +hunk ./actions/finishopenidlogin.php 160 +- function save_values($display, $canonical, $sreg) { ++ function save_values($display, $canonical, $sreg) ++ { +hunk ./actions/finishopenidlogin.php 168 +- function get_saved_values() { ++ function get_saved_values() ++ { +hunk ./actions/finishopenidlogin.php 175 +- function create_new_user() { ++ function create_new_user() ++ { +hunk ./actions/finishopenidlogin.php 258 +- function connect_user() { ++ function connect_user() ++ { +hunk ./actions/finishopenidlogin.php 298 +- function go_home($nickname) { ++ function go_home($nickname) ++ { +hunk ./actions/finishopenidlogin.php 312 +- function best_new_nickname($display, $sreg) { ++ function best_new_nickname($display, $sreg) ++ { +hunk ./actions/finishopenidlogin.php 346 +- function is_new_nickname($str) { ++ function is_new_nickname($str) ++ { +hunk ./actions/finishopenidlogin.php 362 +- function openid_to_nickname($openid) { ++ function openid_to_nickname($openid) ++ { +hunk ./actions/finishopenidlogin.php 376 +- function url_to_nickname($openid) { ++ function url_to_nickname($openid) ++ { +hunk ./actions/finishopenidlogin.php 423 +- function xri_to_nickname($xri) { ++ function xri_to_nickname($xri) ++ { +hunk ./actions/finishopenidlogin.php 437 +- function xri_base($xri) { ++ function xri_base($xri) ++ { +hunk ./actions/finishopenidlogin.php 448 +- function nicknamize($str) { ++ function nicknamize($str) ++ { +hunk ./actions/finishremotesubscribe.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/finishremotesubscribe.php 235 +- function add_avatar($profile, $url) { ++ function add_avatar($profile, $url) ++ { +hunk ./actions/finishremotesubscribe.php 242 +- function access_token($omb) { ++ function access_token($omb) ++ { +hunk ./actions/foaf.php 28 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./actions/foaf.php 33 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/foaf.php 184 +- function show_ppd($foaf_url, $person_uri) { ++ function show_ppd($foaf_url, $person_uri) ++ { +hunk ./actions/foaf.php 192 +- function show_microblogging_account($profile, $service=null) { ++ function show_microblogging_account($profile, $service=null) ++ { +hunk ./actions/imsettings.php 27 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/imsettings.php 32 +- function show_form($msg=null, $success=false) { ++ function show_form($msg=null, $success=false) ++ { +hunk ./actions/imsettings.php 90 +- function get_confirmation() { ++ function get_confirmation() ++ { +hunk ./actions/imsettings.php 103 +- function handle_post() { ++ function handle_post() ++ { +hunk ./actions/imsettings.php 126 +- function save_preferences() { ++ function save_preferences() ++ { +hunk ./actions/imsettings.php 160 +- function add_address() { ++ function add_address() ++ { +hunk ./actions/imsettings.php 216 +- function cancel_confirmation() { ++ function cancel_confirmation() ++ { +hunk ./actions/imsettings.php 240 +- function remove_address() { ++ function remove_address() ++ { +hunk ./actions/imsettings.php 269 +- function jabber_exists($jabber) { ++ function jabber_exists($jabber) ++ { +hunk ./actions/invite.php 24 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./actions/invite.php 29 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/invite.php 43 +- function send_invitations() { ++ function send_invitations() ++ { +hunk ./actions/invite.php 118 +- function show_top($error=null) { ++ function show_top($error=null) ++ { hunk ./actions/invite.php 130 -- common_show_header(_('Invite new users'), NULL, $error, array($this, 'show_top')); -+ common_show_header(_('Invite new users'), null, $error, array($this, 'show_top')); -hunk ./actions/login.php 66 -- common_set_returnto(NULL); -+ common_set_returnto(null); -hunk ./actions/login.php 94 -- common_set_returnto(NULL); -+ common_set_returnto(null); -hunk ./actions/login.php 103 -- function show_form($error=NULL) { -- common_show_header(_('Login'), NULL, $error, array($this, 'show_top')); -+ function show_form($error=null) { -+ common_show_header(_('Login'), null, $error, array($this, 'show_top')); -hunk ./actions/login.php 141 -- function show_top($error=NULL) { -+ function show_top($error=null) { -hunk ./actions/logout.php 35 -- common_set_user(NULL); -+ common_set_user(null); -hunk ./actions/newmessage.php 101 -- function show_form($msg=NULL) { -+ function show_form($msg=null) { -hunk ./actions/newmessage.php 120 -- common_show_header(_('New message'), NULL, -+ common_show_header(_('New message'), null, -hunk ./actions/newnotice.php 81 -- $notice = Notice::saveNew($user->id, $content, 'web', 1, ($replyto == 'false') ? NULL : $replyto); -+ $notice = Notice::saveNew($user->id, $content, 'web', 1, ($replyto == 'false') ? null : $replyto); -hunk ./actions/newnotice.php 124 -- function show_top($content=NULL) { -- common_notice_form(NULL, $content); -+ function show_top($content=null) { -+ common_notice_form(null, $content); -hunk ./actions/newnotice.php 128 -- function show_form($msg=NULL) { -+ function show_form($msg=null) { -hunk ./actions/newnotice.php 141 -- common_show_header(_('New notice'), NULL, $content, -+ common_show_header(_('New notice'), null, $content, -hunk ./actions/noticesearchrss.php 68 -- return NULL; -+ return null; -hunk ./actions/openidlogin.php 55 -- $this->show_form(NULL, $openid_url); -+ $this->show_form(null, $openid_url); -hunk ./actions/openidlogin.php 63 -- function show_top($error=NULL) { -+ function show_top($error=null) { -hunk ./actions/openidlogin.php 75 -- function show_form($error=NULL, $openid_url) { -- common_show_header(_('OpenID Login'), NULL, $error, array($this, 'show_top')); -+ function show_form($error=null, $openid_url) { -+ common_show_header(_('OpenID Login'), null, $error, array($this, 'show_top')); -hunk ./actions/openidsettings.php 33 -- function show_form($msg=NULL, $success=false) { -+ function show_form($msg=null, $success=false) { -hunk ./actions/openidsettings.php 44 -- common_element('h2', NULL, _('Add OpenID')); -- common_element('p', NULL, -+ common_element('h2', null, _('Add OpenID')); -+ common_element('p', null, -hunk ./actions/openidsettings.php 69 -- common_element('h2', NULL, _('Remove OpenID')); -+ common_element('h2', null, _('Remove OpenID')); -hunk ./actions/openidsettings.php 73 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/openidsettings.php 86 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/opensearch.php 45 -- common_element('ShortName', NULL, $short_name); -- common_element('Contact', NULL, common_config('site', 'email')); -+ common_element('ShortName', null, $short_name); -+ common_element('Contact', null, common_config('site', 'email')); -hunk ./actions/opensearch.php 51 -- common_element('AdultContent', NULL, 'false'); -- common_element('Language', NULL, common_language()); -- common_element('OutputEncoding', NULL, 'UTF-8'); -- common_element('InputEncoding', NULL, 'UTF-8'); -+ common_element('AdultContent', null, 'false'); -+ common_element('Language', null, common_language()); -+ common_element('OutputEncoding', null, 'UTF-8'); -+ common_element('InputEncoding', null, 'UTF-8'); -hunk ./actions/othersettings.php 30 -- function show_form($msg=NULL, $success=false) { -+ function show_form($msg=null, $success=false) { -hunk ./actions/othersettings.php 35 -- common_element('h2', NULL, _('URL Auto-shortening')); -+ common_element('h2', null, _('URL Auto-shortening')); -hunk ./actions/othersettings.php 60 --// common_element('h2', NULL, _('Delete my account')); -+// common_element('h2', null, _('Delete my account')); -hunk ./actions/peoplesearch.php 71 -- var $terms = NULL; -- var $pattern = NULL; -+ var $terms = null; -+ var $pattern = null; -hunk ./actions/peopletag.php 46 -- NULL, $tag, array($this, 'show_top')); -+ null, $tag, array($this, 'show_top')); -hunk ./actions/peopletag.php 97 -- return NULL; -+ return null; -hunk ./actions/profilesettings.php 31 -- function show_form($msg=NULL, $success=false) { -+ function show_form($msg=null, $success=false) { -hunk ./actions/profilesettings.php 34 -- common_element('h2', NULL, _('Avatar')); -+ common_element('h2', null, _('Avatar')); -hunk ./actions/profilesettings.php 36 -- common_element('h2', NULL, _('Change password')); -+ common_element('h2', null, _('Change password')); -hunk ./actions/profilesettings.php 38 --// common_element('h2', NULL, _('Delete my account')); -+// common_element('h2', null, _('Delete my account')); -hunk ./actions/public.php 34 -- array($this, 'show_header'), NULL, -+ array($this, 'show_header'), null, -hunk ./actions/publicrss.php 55 -- return NULL; -+ return null; -hunk ./actions/publicxrds.php 45 -- common_element('Type', NULL, 'xri://$xrds*simple'); -+ common_element('Type', null, 'xri://$xrds*simple'); -hunk ./actions/publicxrds.php 58 -- function show_service($type, $uri, $params=NULL, $sigs=NULL, $localId=NULL) { -+ function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { -hunk ./actions/publicxrds.php 61 -- common_element('URI', NULL, $uri); -+ common_element('URI', null, $uri); -hunk ./actions/publicxrds.php 63 -- common_element('Type', NULL, $type); -+ common_element('Type', null, $type); -hunk ./actions/publicxrds.php 66 -- common_element('Type', NULL, $param); -+ common_element('Type', null, $param); -hunk ./actions/publicxrds.php 71 -- common_element('Type', NULL, $sig); -+ common_element('Type', null, $sig); -hunk ./actions/publicxrds.php 75 -- common_element('LocalID', NULL, $localId); -+ common_element('LocalID', null, $localId); -hunk ./actions/recoverpassword.php 135 -- function show_top($msg=NULL) { -+ function show_top($msg=null) { +- function show_form($error=null) { ++ function show_form($error=null) ++ { +hunk ./actions/invite.php 157 +- function send_invitation($email, $user, $personal) { ++ function send_invitation($email, $user, $personal) ++ { +hunk ./actions/login.php 24 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./actions/login.php 29 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/login.php 41 +- function check_login() { ++ function check_login() ++ { +hunk ./actions/login.php 106 +- function show_form($error=null) { ++ function show_form($error=null) ++ { +hunk ./actions/login.php 127 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/login.php 146 +- function show_top($error=null) { ++ function show_top($error=null) ++ { +hunk ./actions/logout.php 26 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./actions/logout.php 31 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/microsummary.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/newmessage.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/newmessage.php 37 +- function save_new_message() { ++ function save_new_message() ++ { +hunk ./actions/newmessage.php 94 +- function show_top($params) { ++ function show_top($params) ++ { +hunk ./actions/newmessage.php 104 +- function show_form($msg=null) { ++ function show_form($msg=null) ++ { +hunk ./actions/newmessage.php 135 +- function notify($from, $to, $message) { ++ function notify($from, $to, $message) ++ { +hunk ./actions/newnotice.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/newnotice.php 47 +- function save_new_notice() { ++ function save_new_notice() ++ { +hunk ./actions/newnotice.php 115 +- function ajax_error_msg($msg) { ++ function ajax_error_msg($msg) ++ { +hunk ./actions/newnotice.php 127 +- function show_top($content=null) { ++ function show_top($content=null) ++ { +hunk ./actions/newnotice.php 132 +- function show_form($msg=null) { ++ function show_form($msg=null) ++ { +hunk ./actions/newnotice.php 154 +- function show_notice($notice) { ++ function show_notice($notice) ++ { +hunk ./actions/noticesearch.php 28 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/noticesearch.php 33 +- function get_title() { ++ function get_title() ++ { +hunk ./actions/noticesearch.php 38 +- function show_results($q, $page) { ++ function show_results($q, $page) ++ { +hunk ./actions/noticesearch.php 78 +- function show_header($arr) { ++ function show_header($arr) ++ { +hunk ./actions/noticesearch.php 94 +- function show_notice($notice, $terms) { ++ function show_notice($notice, $terms) ++ { +hunk ./actions/noticesearch.php 157 +- function highlight($text, $terms) { ++ function highlight($text, $terms) ++ { +hunk ./actions/noticesearchrss.php 28 +- function init() { ++ function init() ++ { +hunk ./actions/noticesearchrss.php 33 +- function get_notices($limit=0) { ++ function get_notices($limit=0) ++ { +hunk ./actions/noticesearchrss.php 59 +- function get_channel() { ++ function get_channel() ++ { +hunk ./actions/noticesearchrss.php 70 +- function get_image() { ++ function get_image() ++ { +hunk ./actions/nudge.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/nudge.php 75 +- function notify($user, $other) { ++ function notify($user, $other) ++ { +hunk ./actions/openidlogin.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/openidlogin.php 60 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/openidlogin.php 65 +- function show_top($error=null) { ++ function show_top($error=null) ++ { +hunk ./actions/openidlogin.php 78 +- function show_form($error=null, $openid_url) { ++ function show_form($error=null, $openid_url) ++ { +hunk ./actions/openidsettings.php 27 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/openidsettings.php 34 +- function show_form($msg=null, $success=false) { ++ function show_form($msg=null, $success=false) ++ { +hunk ./actions/openidsettings.php 121 +- function handle_post() { ++ function handle_post() ++ { +hunk ./actions/openidsettings.php 142 +- function remove_openid() { ++ function remove_openid() ++ { +hunk ./actions/opensearch.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/othersettings.php 26 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/othersettings.php 31 +- function show_form($msg=null, $success=false) { ++ function show_form($msg=null, $success=false) ++ { +hunk ./actions/othersettings.php 68 +- function show_feeds_list($feeds) { ++ function show_feeds_list($feeds) ++ { +hunk ./actions/othersettings.php 82 +- function common_feed_item($feed) { ++ function common_feed_item($feed) ++ { +hunk ./actions/othersettings.php 138 +- function handle_post() { ++ function handle_post() ++ { +hunk ./actions/othersettings.php 155 +- function save_preferences() { ++ function save_preferences() ++ { +hunk ./actions/peoplesearch.php 27 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/peoplesearch.php 33 +- function get_title() { ++ function get_title() ++ { +hunk ./actions/peoplesearch.php 38 +- function show_results($q, $page) { ++ function show_results($q, $page) ++ { +hunk ./actions/peoplesearch.php 77 +- function __construct($profile, $terms) { ++ function __construct($profile, $terms) ++ { +hunk ./actions/peoplesearch.php 85 +- function highlight($text) { ++ function highlight($text) ++ { +hunk ./actions/peopletag.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/peopletag.php 54 +- function show_people($tag, $page) { ++ function show_people($tag, $page) ++ { +hunk ./actions/peopletag.php 88 +- function show_top($tag) { ++ function show_top($tag) ++ { +hunk ./actions/peopletag.php 99 +- function get_title() { ++ function get_title() ++ { +hunk ./actions/peopletag.php 104 +- function show_header($arr) { ++ function show_header($arr) ++ { +hunk ./actions/postnotice.php 25 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/postnotice.php 43 +- function save_notice(&$req, &$consumer, &$token) { ++ function save_notice(&$req, &$consumer, &$token) ++ { +hunk ./actions/profilesettings.php 26 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/profilesettings.php 32 +- function show_form($msg=null, $success=false) { ++ function show_form($msg=null, $success=false) ++ { +hunk ./actions/profilesettings.php 45 +- function handle_post() { ++ function handle_post() ++ { +hunk ./actions/profilesettings.php 66 +- function show_settings_form() { ++ function show_settings_form() ++ { +hunk ./actions/profilesettings.php 117 +- function show_avatar_form() { ++ function show_avatar_form() ++ { +hunk ./actions/profilesettings.php 176 +- function show_password_form() { ++ function show_password_form() ++ { +hunk ./actions/profilesettings.php 199 +- function save_profile() { ++ function save_profile() ++ { +hunk ./actions/profilesettings.php 347 +- function upload_avatar() { ++ function upload_avatar() ++ { +hunk ./actions/profilesettings.php 395 +- function nickname_exists($nickname) { ++ function nickname_exists($nickname) ++ { +hunk ./actions/profilesettings.php 406 +- function change_password() { ++ function change_password() ++ { +hunk ./actions/public.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/public.php 45 +- function show_top() { ++ function show_top() ++ { +hunk ./actions/public.php 69 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/public.php 76 +- function show_header() { ++ function show_header() ++ { +hunk ./actions/public.php 87 +- function show_notices($page) { ++ function show_notices($page) ++ { +hunk ./actions/publicrss.php 28 +- function init() { ++ function init() ++ { +hunk ./actions/publicrss.php 33 +- function get_notices($limit=0) { ++ function get_notices($limit=0) ++ { +hunk ./actions/publicrss.php 47 +- function get_channel() { ++ function get_channel() ++ { +hunk ./actions/publicrss.php 57 +- function get_image() { ++ function get_image() ++ { +hunk ./actions/publicxrds.php 28 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./actions/publicxrds.php 33 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/publicxrds.php 60 +- function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { ++ function show_service($type, $uri, $params=null, $sigs=null, $localId=null) ++ { +hunk ./actions/recoverpassword.php 28 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/recoverpassword.php 51 +- function check_code() { ++ function check_code() ++ { +hunk ./actions/recoverpassword.php 118 +- function set_temp_user(&$user) { ++ function set_temp_user(&$user) ++ { +hunk ./actions/recoverpassword.php 124 +- function get_temp_user() { ++ function get_temp_user() ++ { +hunk ./actions/recoverpassword.php 134 +- function clear_temp_user() { ++ function clear_temp_user() ++ { hunk ./actions/recoverpassword.php 140 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/recoverpassword.php 149 -- function show_password_top($msg=NULL) { -+ function show_password_top($msg=null) { -hunk ./actions/recoverpassword.php 159 -- function show_form($msg=NULL) { -+ function show_form($msg=null) { -hunk ./actions/recoverpassword.php 161 -- common_show_header(_('Recover password'), NULL, -+ common_show_header(_('Recover password'), null, -hunk ./actions/recoverpassword.php 176 -- function show_password_form($msg=NULL) { -+ function show_password_form($msg=null) { -hunk ./actions/recoverpassword.php 178 -- common_show_header(_('Reset password'), NULL, -+ common_show_header(_('Reset password'), null, -hunk ./actions/recoverpassword.php 227 -- $confirm_email = NULL; -+ $confirm_email = null; -hunk ./actions/recoverpassword.php 270 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/recoverpassword.php 327 -- common_element('p', NULL, _('New password successfully saved. ' . -+ common_element('p', null, _('New password successfully saved. ' . -hunk ./actions/register.php 152 -- function show_top($error=NULL) { -+ function show_top($error=null) { -hunk ./actions/register.php 167 -- function show_form($error=NULL) { -+ function show_form($error=null) { -hunk ./actions/register.php 181 -- common_show_header(_('Register'), NULL, $error, array($this, 'show_top')); -+ common_show_header(_('Register'), null, $error, array($this, 'show_top')); -hunk ./actions/remotesubscribe.php 58 -- function show_top($err=NULL) { -+ function show_top($err=null) { -hunk ./actions/remotesubscribe.php 70 -- function show_form($err=NULL) { -+ function show_form($err=null) { +- function show_top($msg=null) { ++ function show_top($msg=null) ++ { +hunk ./actions/recoverpassword.php 155 +- function show_password_top($msg=null) { ++ function show_password_top($msg=null) ++ { +hunk ./actions/recoverpassword.php 166 +- function show_form($msg=null) { ++ function show_form($msg=null) ++ { +hunk ./actions/recoverpassword.php 184 +- function show_password_form($msg=null) { ++ function show_password_form($msg=null) ++ { +hunk ./actions/recoverpassword.php 203 +- function recover_password() { ++ function recover_password() ++ { +hunk ./actions/recoverpassword.php 287 +- function reset_password() { ++ function reset_password() ++ { +hunk ./actions/register.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/register.php 39 +- function try_register() { ++ function try_register() ++ { +hunk ./actions/register.php 138 +- function nickname_exists($nickname) { ++ function nickname_exists($nickname) ++ { +hunk ./actions/register.php 146 +- function email_exists($email) { ++ function email_exists($email) ++ { +hunk ./actions/register.php 156 +- function show_top($error=null) { ++ function show_top($error=null) ++ { +hunk ./actions/register.php 172 +- function show_form($error=null) { ++ function show_form($error=null) ++ { +hunk ./actions/register.php 245 +- function show_success() { ++ function show_success() ++ { +hunk ./actions/remotesubscribe.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/remotesubscribe.php 51 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/remotesubscribe.php 60 +- function show_top($err=null) { ++ function show_top($err=null) ++ { hunk ./actions/remotesubscribe.php 73 -- common_show_header(_('Remote subscribe'), NULL, $err, -+ common_show_header(_('Remote subscribe'), null, $err, -hunk ./actions/remotesubscribe.php 156 -- $user = NULL; -+ $user = null; -hunk ./actions/remotesubscribe.php 176 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 184 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 188 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 194 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 202 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 206 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 213 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 218 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 228 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 242 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 270 -- $req = OAuthRequest::from_consumer_and_token($con, NULL, "POST", $url, $params); -+ $req = OAuthRequest::from_consumer_and_token($con, null, "POST", $url, $params); -hunk ./actions/remotesubscribe.php 275 -- return NULL; -+ return null; -hunk ./actions/remotesubscribe.php 283 -- $req->sign_request(omb_hmac_sha1(), $con, NULL); -+ $req->sign_request(omb_hmac_sha1(), $con, null); -hunk ./actions/remotesubscribe.php 294 -- return NULL; -+ return null; -hunk ./actions/repliesrss.php 28 -- var $user = NULL; -+ var $user = null; -hunk ./actions/repliesrss.php 74 -- return NULL; -+ return null; -hunk ./actions/repliesrss.php 77 -- return ($avatar) ? $avatar->url : NULL; -+ return ($avatar) ? $avatar->url : null; -hunk ./actions/showmessage.php 56 -- return NULL; -+ return null; -hunk ./actions/showmessage.php 88 -- return NULL; -+ return null; -hunk ./actions/shownotice.php 26 -- var $notice = NULL; -- var $profile = NULL; -- var $avatar = NULL; -+ var $notice = null; -+ var $profile = null; -+ var $avatar = null; -hunk ./actions/shownotice.php 76 -- array($this, 'show_header'), NULL, -+ array($this, 'show_header'), null, -hunk ./actions/showstream.php 288 -- common_element('h2', NULL, _('Subscriptions')); -+ common_element('h2', null, _('Subscriptions')); -hunk ./actions/showstream.php 418 -- common_element('h2', NULL, _('Currently')); -+ common_element('h2', null, _('Currently')); -hunk ./actions/smssettings.php 31 -- function show_form($msg=NULL, $success=false) { -+ function show_form($msg=null, $success=false) { -hunk ./actions/smssettings.php 39 -- common_element('h2', NULL, _('Address')); -+ common_element('h2', null, _('Address')); -hunk ./actions/smssettings.php 63 -- common_input('code', _('Confirmation code'), NULL, -+ common_input('code', _('Confirmation code'), null, -hunk ./actions/smssettings.php 68 -- ($this->arg('sms')) ? $this->arg('sms') : NULL, -+ ($this->arg('sms')) ? $this->arg('sms') : null, -hunk ./actions/smssettings.php 76 -- common_element('h2', NULL, _('Incoming email')); -+ common_element('h2', null, _('Incoming email')); -hunk ./actions/smssettings.php 94 -- common_element('h2', NULL, _('Preferences')); -+ common_element('h2', null, _('Preferences')); -hunk ./actions/smssettings.php 114 -- return NULL; -+ return null; -hunk ./actions/smssettings.php 271 -- $user->sms = NULL; -- $user->carrier = NULL; -- $user->smsemail = NULL; -+ $user->sms = null; -+ $user->carrier = null; -+ $user->smsemail = null; -hunk ./actions/subedit.php 24 -- var $profile = NULL; -+ var $profile = null; -hunk ./actions/tagother.php 52 -- function show_form($profile, $error=NULL) { -+ function show_form($profile, $error=null) { -hunk ./actions/tagother.php 57 -- NULL, array($profile, $error), array($this, 'show_top')); -+ null, array($profile, $error), array($this, 'show_top')); -hunk ./actions/tagother.php 181 -- function show_top($arr = NULL) { -+ function show_top($arr = null) { -hunk ./actions/tagother.php 187 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/tagrss.php 44 -- return NULL; -+ return null; -hunk ./actions/twitapidirect_messages.php 231 -- common_element('title', NULL, $title); -+ common_element('title', null, $title); +- function show_form($err=null) { ++ function show_form($err=null) ++ { +hunk ./actions/remotesubscribe.php 93 +- function remote_subscription() { ++ function remote_subscription() ++ { +hunk ./actions/remotesubscribe.php 160 +- function get_user() { ++ function get_user() ++ { +hunk ./actions/remotesubscribe.php 170 +- function getOmb($xrds) { ++ function getOmb($xrds) ++ { +hunk ./actions/remotesubscribe.php 231 +- function getXRD($main_service, $main_xrds) { ++ function getXRD($main_service, $main_xrds) ++ { +hunk ./actions/remotesubscribe.php 253 +- function addServices($xrd, $types, &$omb) { ++ function addServices($xrd, $types, &$omb) ++ { +hunk ./actions/remotesubscribe.php 267 +- function request_token($omb) { ++ function request_token($omb) ++ { +hunk ./actions/remotesubscribe.php 312 +- function request_authorization($user, $omb, $token, $secret) { ++ function request_authorization($user, $omb, $token, $secret) ++ { +hunk ./actions/remotesubscribe.php 394 +- function make_nonce() { ++ function make_nonce() ++ { +hunk ./actions/replies.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/replies.php 57 +- function no_such_user() { ++ function no_such_user() ++ { +hunk ./actions/replies.php 62 +- function show_header($user) { ++ function show_header($user) ++ { +hunk ./actions/replies.php 71 +- function show_top($user) { ++ function show_top($user) ++ { +hunk ./actions/replies.php 87 +- function show_replies($user) { ++ function show_replies($user) ++ { +hunk ./actions/repliesrss.php 30 +- function init() { ++ function init() ++ { +hunk ./actions/repliesrss.php 43 +- function get_notices($limit=0) { ++ function get_notices($limit=0) ++ { +hunk ./actions/repliesrss.php 59 +- function get_channel() { ++ function get_channel() ++ { +hunk ./actions/repliesrss.php 73 +- function get_image() { ++ function get_image() ++ { +hunk ./actions/requesttoken.php 26 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./actions/requesttoken.php 31 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/showfavorites.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/showfavorites.php 57 +- function show_header($user) { ++ function show_header($user) ++ { +hunk ./actions/showfavorites.php 66 +- function show_top($user) { ++ function show_top($user) ++ { +hunk ./actions/showfavorites.php 81 +- function show_notices($user) { ++ function show_notices($user) ++ { +hunk ./actions/showmessage.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/showmessage.php 48 +- function get_message() { ++ function get_message() ++ { +hunk ./actions/showmessage.php 55 +- function get_title($user, $page) { ++ function get_title($user, $page) ++ { +hunk ./actions/showmessage.php 76 +- function get_messages($user, $page) { ++ function get_messages($user, $page) ++ { +hunk ./actions/showmessage.php 84 +- function get_message_profile($message) { ++ function get_message_profile($message) ++ { +hunk ./actions/showmessage.php 97 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/showmessage.php 102 +- function views_menu() { ++ function views_menu() ++ { +hunk ./actions/shownotice.php 30 +- function prepare($args) { ++ function prepare($args) ++ { +hunk ./actions/shownotice.php 55 +- function last_modified() { ++ function last_modified() ++ { +hunk ./actions/shownotice.php 62 +- function etag() { ++ function etag() ++ { +hunk ./actions/shownotice.php 72 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/shownotice.php 91 +- function show_header() { ++ function show_header() ++ { +hunk ./actions/shownotice.php 111 +- function show_top() { ++ function show_top() ++ { +hunk ./actions/shownotice.php 119 +- function no_such_notice() { ++ function no_such_notice() ++ { +hunk ./actions/showstream.php 29 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/showstream.php 80 +- function show_top($user) { ++ function show_top($user) ++ { +hunk ./actions/showstream.php 105 +- function show_header($user) { ++ function show_header($user) ++ { +hunk ./actions/showstream.php 159 +- function no_such_user() { ++ function no_such_user() ++ { +hunk ./actions/showstream.php 164 +- function show_profile($profile) { ++ function show_profile($profile) ++ { +hunk ./actions/showstream.php 180 +- function show_personal($profile) { ++ function show_personal($profile) ++ { +hunk ./actions/showstream.php 255 +- function show_remote_subscribe_link($profile) { ++ function show_remote_subscribe_link($profile) ++ { +hunk ./actions/showstream.php 264 +- function show_unsubscribe_form($profile) { ++ function show_unsubscribe_form($profile) ++ { +hunk ./actions/showstream.php 279 +- function show_subscriptions($profile) { ++ function show_subscriptions($profile) ++ { +hunk ./actions/showstream.php 352 +- function show_statistics($profile) { ++ function show_statistics($profile) ++ { +hunk ./actions/showstream.php 413 +- function show_notices($user) { ++ function show_notices($user) ++ { +hunk ./actions/showstream.php 427 +- function show_last_notice($profile) { ++ function show_last_notice($profile) ++ { +hunk ./actions/showstream.php 453 +- function newListItem($notice) { ++ function newListItem($notice) ++ { +hunk ./actions/showstream.php 460 +- function showAuthor() { ++ function showAuthor() ++ { +hunk ./actions/smssettings.php 27 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/smssettings.php 32 +- function show_form($msg=null, $success=false) { ++ function show_form($msg=null, $success=false) ++ { +hunk ./actions/smssettings.php 108 +- function get_confirmation() { ++ function get_confirmation() ++ { +hunk ./actions/smssettings.php 121 +- function handle_post() { ++ function handle_post() ++ { +hunk ./actions/smssettings.php 151 +- function save_preferences() { ++ function save_preferences() ++ { +hunk ./actions/smssettings.php 179 +- function add_address() { ++ function add_address() ++ { +hunk ./actions/smssettings.php 235 +- function cancel_confirmation() { ++ function cancel_confirmation() ++ { +hunk ./actions/smssettings.php 263 +- function remove_address() { ++ function remove_address() ++ { +hunk ./actions/smssettings.php 293 +- function sms_exists($sms) { ++ function sms_exists($sms) ++ { +hunk ./actions/smssettings.php 304 +- function carrier_select() { ++ function carrier_select() ++ { +hunk ./actions/smssettings.php 329 +- function confirm_code() { ++ function confirm_code() ++ { +hunk ./actions/subedit.php 26 +- function prepare($args) { ++ function prepare($args) ++ { +hunk ./actions/subedit.php 60 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/subscribe.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/subscribers.php 26 +- function gallery_type() { ++ function gallery_type() ++ { +hunk ./actions/subscribers.php 31 +- function get_instructions(&$profile) { ++ function get_instructions(&$profile) ++ { +hunk ./actions/subscribers.php 41 +- function fields() { ++ function fields() ++ { +hunk ./actions/subscribers.php 46 +- function div_class() { ++ function div_class() ++ { +hunk ./actions/subscribers.php 51 +- function get_other(&$subs) { ++ function get_other(&$subs) ++ { +hunk ./actions/subscribers.php 56 +- function profile_list_class() { ++ function profile_list_class() ++ { +hunk ./actions/subscribers.php 63 +- function show_owner_controls($profile) { ++ function show_owner_controls($profile) ++ { +hunk ./actions/subscriptions.php 26 +- function gallery_type() { ++ function gallery_type() ++ { +hunk ./actions/subscriptions.php 31 +- function get_instructions(&$profile) { ++ function get_instructions(&$profile) ++ { +hunk ./actions/subscriptions.php 41 +- function fields() { ++ function fields() ++ { +hunk ./actions/subscriptions.php 46 +- function div_class() { ++ function div_class() ++ { +hunk ./actions/subscriptions.php 51 +- function get_other(&$subs) { ++ function get_other(&$subs) ++ { +hunk ./actions/subscriptions.php 56 +- function profile_list_class() { ++ function profile_list_class() ++ { +hunk ./actions/subscriptions.php 64 +- function show_owner_controls($profile) { ++ function show_owner_controls($profile) ++ { +hunk ./actions/sup.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/sup.php 46 +- function available_periods() { ++ function available_periods() ++ { +hunk ./actions/sup.php 60 +- function get_updates($seconds) { ++ function get_updates($seconds) ++ { +hunk ./actions/sup.php 81 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./actions/tag.php 27 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/tag.php 50 +- function show_header($tag = false) { ++ function show_header($tag = false) ++ { +hunk ./actions/tag.php 60 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/tag.php 65 +- function show_top($tag = false) { ++ function show_top($tag = false) ++ { +hunk ./actions/tag.php 131 +- function show_tag($tag, $weight, $relative) { ++ function show_tag($tag, $weight, $relative) ++ { +hunk ./actions/tag.php 157 +- function show_notices($tag) { ++ function show_notices($tag) ++ { +hunk ./actions/tagother.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/tagother.php 53 +- function show_form($profile, $error=null) { ++ function show_form($profile, $error=null) ++ { +hunk ./actions/tagother.php 108 +- function save_tags() { ++ function save_tags() ++ { +hunk ./actions/tagother.php 184 +- function show_top($arr = null) { ++ function show_top($arr = null) ++ { +hunk ./actions/tagrss.php 28 +- function init() { ++ function init() ++ { +hunk ./actions/tagrss.php 41 +- function get_notices($limit=0) { ++ function get_notices($limit=0) ++ { +hunk ./actions/tagrss.php 58 +- function get_channel() { ++ function get_channel() ++ { +hunk ./actions/twitapiaccount.php 26 +- function verify_credentials($args, $apidata) { ++ function verify_credentials($args, $apidata) ++ { +hunk ./actions/twitapiaccount.php 38 +- function end_session($args, $apidata) { ++ function end_session($args, $apidata) ++ { +hunk ./actions/twitapiaccount.php 44 +- function update_location($args, $apidata) { ++ function update_location($args, $apidata) ++ { +hunk ./actions/twitapiaccount.php 90 +- function update_delivery_device($args, $apidata) { ++ function update_delivery_device($args, $apidata) ++ { +hunk ./actions/twitapiaccount.php 96 +- function rate_limit_status($args, $apidata) { ++ function rate_limit_status($args, $apidata) ++ { +hunk ./actions/twitapiblocks.php 26 +- function create($args, $apidata) { ++ function create($args, $apidata) ++ { +hunk ./actions/twitapiblocks.php 50 +- function destroy($args, $apidata) { ++ function destroy($args, $apidata) ++ { +hunk ./actions/twitapidirect_messages.php 26 +- function direct_messages($args, $apidata) { ++ function direct_messages($args, $apidata) ++ { +hunk ./actions/twitapidirect_messages.php 32 +- function sent($args, $apidata) { ++ function sent($args, $apidata) ++ { +hunk ./actions/twitapidirect_messages.php 38 +- function show_messages($args, $apidata, $type) { ++ function show_messages($args, $apidata, $type) ++ { +hunk ./actions/twitapidirect_messages.php 116 +- function create($args, $apidata) { ++ function create($args, $apidata) ++ { +hunk ./actions/twitapidirect_messages.php 180 +- function destroy($args, $apidata) { ++ function destroy($args, $apidata) ++ { +hunk ./actions/twitapidirect_messages.php 186 +- function show_xml_dmsgs($message) { ++ function show_xml_dmsgs($message) ++ { +hunk ./actions/twitapidirect_messages.php 209 +- function show_json_dmsgs($message) { ++ function show_json_dmsgs($message) ++ { hunk ./actions/twitapidirect_messages.php 233 -- common_element('link', NULL, $link); -- common_element('description', NULL, $subtitle); -- common_element('language', NULL, 'en-us'); -- common_element('ttl', NULL, '40'); -+ common_element('link', null, $link); -+ common_element('description', null, $subtitle); -+ common_element('language', null, 'en-us'); -+ common_element('ttl', null, '40'); -hunk ./actions/twitapidirect_messages.php 259 -- common_element('title', NULL, $title); -+ common_element('title', null, $title); -hunk ./actions/twitapidirect_messages.php 261 -- common_element('id', NULL, "tag:$siteserver,2008:DirectMessage"); -- common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), NULL); -- common_element('updated', NULL, common_date_iso8601(strftime('%c'))); -- common_element('subtitle', NULL, $subtitle); -+ common_element('id', null, "tag:$siteserver,2008:DirectMessage"); -+ common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null); -+ common_element('updated', null, common_date_iso8601(strftime('%c'))); -+ common_element('subtitle', null, $subtitle); -hunk ./actions/twitapifriendships.php 141 -- common_element('friends', NULL, $result); -+ common_element('friends', null, $result); -hunk ./actions/twitapihelp.php 35 -- common_element('ok', NULL, 'true'); -+ common_element('ok', null, 'true'); -hunk ./actions/twitapistatuses.php 115 -- $user = $this->get_user(NULL, $apidata); -+ $user = $this->get_user(null, $apidata); -hunk ./actions/twitapistatuses.php 203 -- $suplink = common_local_url('sup', NULL, $user->id); -+ $suplink = common_local_url('sup', null, $user->id); -hunk ./actions/twitapistatuses.php 294 -- $reply_to = NULL; -+ $reply_to = null; -hunk ./actions/twittersettings.php 33 -- function show_form($msg=NULL, $success=false) { -+ function show_form($msg=null, $success=false) { -hunk ./actions/twittersettings.php 36 -- $fuser = NULL; -+ $fuser = null; -hunk ./actions/twittersettings.php 50 -- common_element('h2', NULL, _('Twitter Account')); -+ common_element('h2', null, _('Twitter Account')); -hunk ./actions/twittersettings.php 70 -- common_element('h2', NULL, _('Preferences')); -+ common_element('h2', null, _('Preferences')); -hunk ./actions/twittersettings.php 129 -- common_element('h3', NULL, _('Twitter Friends')); -+ common_element('h3', null, _('Twitter Friends')); -hunk ./actions/unblock.php 24 -- var $profile = NULL; -+ var $profile = null; -hunk ./actions/userauthorization.php 84 -- common_element('p', NULL, _('Please check these details to make sure '. -+ common_element('p', null, _('Please check these details to make sure '. -hunk ./actions/userauthorization.php 323 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/userauthorization.php 333 -- common_element('p', NULL, -+ common_element('p', null, -hunk ./actions/userbyid.php 41 -- $httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : NULL; -+ $httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : null; -hunk ./actions/userrss.php 28 -- var $user = NULL; -+ var $user = null; -hunk ./actions/userrss.php 47 -- return NULL; -+ return null; -hunk ./actions/userrss.php 77 -- return NULL; -+ return null; -hunk ./actions/userrss.php 80 -- return ($avatar) ? $avatar->url : NULL; -+ return ($avatar) ? $avatar->url : null; -hunk ./actions/userrss.php 86 -- $url = common_local_url('sup', NULL, $this->user->id); -+ $url = common_local_url('sup', null, $this->user->id); -hunk ./actions/xrds.php 53 -- common_element('Type', NULL, 'xri://$xrds*simple'); -+ common_element('Type', null, 'xri://$xrds*simple'); -hunk ./actions/xrds.php 72 -- NULL, -+ null, -hunk ./actions/xrds.php 85 -- common_element('Type', NULL, 'xri://$xrds*simple'); -+ common_element('Type', null, 'xri://$xrds*simple'); -hunk ./actions/xrds.php 98 -- common_element('Type', NULL, 'xri://$xrds*simple'); -+ common_element('Type', null, 'xri://$xrds*simple'); -hunk ./actions/xrds.php 111 -- function show_service($type, $uri, $params=NULL, $sigs=NULL, $localId=NULL) { -+ function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { +- function show_rss_dmsgs($message, $title, $link, $subtitle) { ++ function show_rss_dmsgs($message, $title, $link, $subtitle) ++ { +hunk ./actions/twitapidirect_messages.php 263 +- function show_atom_dmsgs($message, $title, $link, $subtitle) { ++ function show_atom_dmsgs($message, $title, $link, $subtitle) ++ { +hunk ./actions/twitapidirect_messages.php 291 +- function notify($from, $to, $message) { ++ function notify($from, $to, $message) ++ { +hunk ./actions/twitapifavorites.php 26 +- function favorites($args, $apidata) { ++ function favorites($args, $apidata) ++ { +hunk ./actions/twitapifavorites.php 89 +- function create($args, $apidata) { ++ function create($args, $apidata) ++ { +hunk ./actions/twitapifavorites.php 139 +- function destroy($args, $apidata) { ++ function destroy($args, $apidata) ++ { +hunk ./actions/twitapifavorites.php 147 +- function notify($fave, $notice, $user) { ++ function notify($fave, $notice, $user) ++ { +hunk ./actions/twitapifavorites.php 159 +- function notify_mail($other, $user, $notice) { ++ function notify_mail($other, $user, $notice) ++ { +hunk ./actions/twitapifriendships.php 26 +- function create($args, $apidata) { ++ function create($args, $apidata) ++ { +hunk ./actions/twitapifriendships.php 79 +- function destroy($args, $apidata) { ++ function destroy($args, $apidata) ++ { +hunk ./actions/twitapifriendships.php 115 +- function exists($args, $apidata) { ++ function exists($args, $apidata) ++ { +hunk ./actions/twitapihelp.php 30 +- function test($args, $apidata) { ++ function test($args, $apidata) ++ { +hunk ./actions/twitapihelp.php 48 +- function downtime_schedule($args, $apidata) { ++ function downtime_schedule($args, $apidata) ++ { +hunk ./actions/twitapinotifications.php 27 +- function follow($args, $apidata) { ++ function follow($args, $apidata) ++ { +hunk ./actions/twitapinotifications.php 33 +- function leave($args, $apidata) { ++ function leave($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 26 +- function public_timeline($args, $apidata) { ++ function public_timeline($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 88 +- function friends_timeline($args, $apidata) { ++ function friends_timeline($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 151 +- function user_timeline($args, $apidata) { ++ function user_timeline($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 232 +- function update($args, $apidata) { ++ function update($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 328 +- function replies($args, $apidata) { ++ function replies($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 396 +- function show($args, $apidata) { ++ function show($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 422 +- function destroy($args, $apidata) { ++ function destroy($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 467 +- function friends($args, $apidata) { ++ function friends($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 473 +- function followers($args, $apidata) { ++ function followers($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 480 +- function subscriptions($apidata, $other_attr, $user_attr) { ++ function subscriptions($apidata, $other_attr, $user_attr) ++ { +hunk ./actions/twitapistatuses.php 536 +- function show_profiles($profiles, $type) { ++ function show_profiles($profiles, $type) ++ { +hunk ./actions/twitapistatuses.php 558 +- function featured($args, $apidata) { ++ function featured($args, $apidata) ++ { +hunk ./actions/twitapistatuses.php 564 +- function supported($cmd) { ++ function supported($cmd) ++ { +hunk ./actions/twitapiusers.php 26 +- function show($args, $apidata) { ++ function show($args, $apidata) ++ { +hunk ./actions/twittersettings.php 28 +- function get_instructions() { ++ function get_instructions() ++ { +hunk ./actions/twittersettings.php 34 +- function show_form($msg=null, $success=false) { ++ function show_form($msg=null, $success=false) ++ { +hunk ./actions/twittersettings.php 96 +- function subscribed_twitter_users() { ++ function subscribed_twitter_users() ++ { +hunk ./actions/twittersettings.php 125 +- function show_twitter_subscriptions() { ++ function show_twitter_subscriptions() ++ { +hunk ./actions/twittersettings.php 187 +- function handle_post() { ++ function handle_post() ++ { +hunk ./actions/twittersettings.php 208 +- function add_twitter_acct() { ++ function add_twitter_acct() ++ { +hunk ./actions/twittersettings.php 270 +- function remove_twitter_acct() { ++ function remove_twitter_acct() ++ { +hunk ./actions/twittersettings.php 294 +- function save_preferences() { ++ function save_preferences() ++ { +hunk ./actions/twittersettings.php 341 +- function verify_credentials($screen_name, $password) { ++ function verify_credentials($screen_name, $password) ++ { +hunk ./actions/twittersettings.php 365 +- function set_flags(&$flink, $noticesync, $replysync, $friendsync) { ++ function set_flags(&$flink, $noticesync, $replysync, $friendsync) ++ { +hunk ./actions/unblock.php 26 +- function prepare($args) { ++ function prepare($args) ++ { +hunk ./actions/unblock.php 60 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/unblock.php 68 +- function unblock_profile() { ++ function unblock_profile() ++ { +hunk ./actions/unsubscribe.php 22 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/updateprofile.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/updateprofile.php 44 +- function update_profile($req, $consumer, $token) { ++ function update_profile($req, $consumer, $token) ++ { +hunk ./actions/userauthorization.php 27 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/userauthorization.php 73 +- function show_form($req) { ++ function show_form($req) ++ { +hunk ./actions/userauthorization.php 134 +- function send_authorization() { ++ function send_authorization() ++ { +hunk ./actions/userauthorization.php 203 +- function authorize_token(&$req) { ++ function authorize_token(&$req) ++ { +hunk ./actions/userauthorization.php 229 +- function save_remote_profile(&$req) { ++ function save_remote_profile(&$req) ++ { +hunk ./actions/userauthorization.php 320 +- function add_avatar($profile, $url) { ++ function add_avatar($profile, $url) ++ { +hunk ./actions/userauthorization.php 327 +- function show_accept_message($tok) { ++ function show_accept_message($tok) ++ { +hunk ./actions/userauthorization.php 338 +- function show_reject_message($tok) { ++ function show_reject_message($tok) ++ { +hunk ./actions/userauthorization.php 348 +- function store_request($req) { ++ function store_request($req) ++ { +hunk ./actions/userauthorization.php 354 +- function clear_request() { ++ function clear_request() ++ { +hunk ./actions/userauthorization.php 360 +- function get_stored_request() { ++ function get_stored_request() ++ { +hunk ./actions/userauthorization.php 367 +- function get_new_request() { ++ function get_new_request() ++ { +hunk ./actions/userauthorization.php 376 +- function validate_request(&$req) { ++ function validate_request(&$req) ++ { +hunk ./actions/userauthorization.php 400 +- function validate_omb(&$req) { ++ function validate_omb(&$req) ++ { +hunk ./actions/userauthorization.php 515 +- function check_version(&$req) { ++ function check_version(&$req) ++ { +hunk ./actions/userauthorization.php 529 +- function get_consumer($datastore, $req) { ++ function get_consumer($datastore, $req) ++ { +hunk ./actions/userauthorization.php 545 +- function get_token($datastore, &$req, $consumer) {/*{{{*/ ++ function get_token($datastore, &$req, $consumer) ++ {/*{{{*/ +hunk ./actions/userauthorization.php 555 +- function check_timestamp(&$req) { ++ function check_timestamp(&$req) ++ { +hunk ./actions/userauthorization.php 565 +- function check_nonce(&$datastore, &$req, $consumer, $token) { ++ function check_nonce(&$datastore, &$req, $consumer, $token) ++ { +hunk ./actions/userauthorization.php 576 +- function check_signature(&$req, $consumer, $token) { ++ function check_signature(&$req, $consumer, $token) ++ { +hunk ./actions/userauthorization.php 589 +- function get_signature_method(&$req) { ++ function get_signature_method(&$req) ++ { +hunk ./actions/userbyid.php 24 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./actions/userbyid.php 29 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/userrss.php 30 +- function init() { ++ function init() ++ { +hunk ./actions/userrss.php 43 +- function get_notices($limit=0) { ++ function get_notices($limit=0) ++ { +hunk ./actions/userrss.php 61 +- function get_channel() { ++ function get_channel() ++ { +hunk ./actions/userrss.php 74 +- function get_image() { ++ function get_image() ++ { +hunk ./actions/userrss.php 89 +- function init_rss($limit=0) { ++ function init_rss($limit=0) ++ { +hunk ./actions/xrds.php 26 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./actions/xrds.php 31 +- function handle($args) { ++ function handle($args) ++ { +hunk ./actions/xrds.php 43 +- function show_xrds($user) { ++ function show_xrds($user) ++ { hunk ./actions/xrds.php 114 -- common_element('URI', NULL, $uri); -+ common_element('URI', null, $uri); -hunk ./actions/xrds.php 116 -- common_element('Type', NULL, $type); -+ common_element('Type', null, $type); -hunk ./actions/xrds.php 119 -- common_element('Type', NULL, $param); -+ common_element('Type', null, $param); -hunk ./actions/xrds.php 124 -- common_element('Type', NULL, $sig); -+ common_element('Type', null, $sig); -hunk ./actions/xrds.php 128 -- common_element('LocalID', NULL, $localId); -+ common_element('LocalID', null, $localId); +- function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { ++ function show_service($type, $uri, $params=null, $sigs=null, $localId=null) ++ { hunk ./classes/Avatar.php 24 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Avatar',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Avatar',$k,$v); } -hunk ./classes/Avatar.php 75 -- return NULL; -+ return null; -hunk ./classes/Avatar.php 88 -- return NULL; -+ return null; -hunk ./classes/Channel.php 41 -- return NULL; -+ return null; -hunk ./classes/Channel.php 47 -- var $conn = NULL; -+ var $conn = null; +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Avatar',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Avatar',$k,$v); } +hunk ./classes/Avatar.php 32 +- function delete() { ++ function delete() ++ { +hunk ./classes/Avatar.php 43 +- function scale($size) { ++ function scale($size) ++ { +hunk ./classes/Avatar.php 82 +- function to_image() { ++ function to_image() ++ { +hunk ./classes/Avatar.php 96 +- function &pkeyGet($kv) { ++ function &pkeyGet($kv) ++ { +hunk ./classes/Channel.php 24 +- function on($user) { ++ function on($user) ++ { +hunk ./classes/Channel.php 29 +- function off($user) { ++ function off($user) ++ { +hunk ./classes/Channel.php 34 +- function output($user, $text) { ++ function output($user, $text) ++ { +hunk ./classes/Channel.php 39 +- function error($user, $text) { ++ function error($user, $text) ++ { +hunk ./classes/Channel.php 44 +- function source() { ++ function source() ++ { +hunk ./classes/Channel.php 54 +- function source() { ++ function source() ++ { +hunk ./classes/Channel.php 59 +- function __construct($conn) { ++ function __construct($conn) ++ { +hunk ./classes/Channel.php 64 +- function on($user) { ++ function on($user) ++ { +hunk ./classes/Channel.php 69 +- function off($user) { ++ function off($user) ++ { +hunk ./classes/Channel.php 74 +- function output($user, $text) { ++ function output($user, $text) ++ { +hunk ./classes/Channel.php 80 +- function error($user, $text) { ++ function error($user, $text) ++ { +hunk ./classes/Channel.php 86 +- function set_notify(&$user, $notify) { ++ function set_notify(&$user, $notify) ++ { +hunk ./classes/Channel.php 109 +- function source() { ++ function source() ++ { hunk ./classes/Channel.php 114 -- common_element('p', NULL, $text); -+ common_element('p', null, $text); -hunk ./classes/Channel.php 152 -- var $addr = NULL; -+ var $addr = null; -hunk ./classes/Channel.php 158 -- function __construct($addr=NULL) { -+ function __construct($addr=null) { -hunk ./classes/Command.php 26 -- var $user = NULL; -+ var $user = null; +- function on($user) { ++ function on($user) ++ { +hunk ./classes/Channel.php 119 +- function off($user) { ++ function off($user) ++ { +hunk ./classes/Channel.php 124 +- function output($user, $text) { ++ function output($user, $text) ++ { +hunk ./classes/Channel.php 134 +- function error($user, $text) { ++ function error($user, $text) ++ { +hunk ./classes/Channel.php 143 +- function output($user, $text) { ++ function output($user, $text) ++ { +hunk ./classes/Channel.php 155 +- function error($user, $text) { ++ function error($user, $text) ++ { +hunk ./classes/Channel.php 173 +- function source() { ++ function source() ++ { +hunk ./classes/Channel.php 178 +- function __construct($addr=null) { ++ function __construct($addr=null) ++ { +hunk ./classes/Channel.php 183 +- function on($user) { ++ function on($user) ++ { +hunk ./classes/Channel.php 188 +- function off($user) { ++ function off($user) ++ { +hunk ./classes/Channel.php 193 +- function output($user, $text) { ++ function output($user, $text) ++ { +hunk ./classes/Channel.php 204 +- function error($user, $text) { ++ function error($user, $text) ++ { +hunk ./classes/Channel.php 215 +- function set_notify($user, $value) { ++ function set_notify($user, $value) ++ { hunk ./classes/Command.php 28 -- function __construct($user=NULL) { -+ function __construct($user=null) { -hunk ./classes/Command.php 50 -- var $word = NULL; -+ var $word = null; -hunk ./classes/Command.php 58 -- var $word = NULL; -+ var $word = null; -hunk ./classes/Command.php 66 -- var $other = NULL; -+ var $other = null; -hunk ./classes/Command.php 74 -- var $other = NULL; -+ var $other = null; -hunk ./classes/Command.php 107 -- var $other = NULL; -+ var $other = null; -hunk ./classes/Command.php 151 -- var $other = NULL; -+ var $other = null; -hunk ./classes/Command.php 185 -- var $other = NULL; -- var $text = NULL; -+ var $other = null; -+ var $text = null; -hunk ./classes/Command.php 228 -- var $other = NULL; -+ var $other = null; -hunk ./classes/Command.php 258 -- var $other = NULL; -+ var $other = null; -hunk ./classes/Command.php 284 -- var $other = NULL; -+ var $other = null; -hunk ./classes/Command.php 308 -- var $other = NULL; -- function __construct($user, $other=NULL) { -+ var $other = null; -+ function __construct($user, $other=null) { -hunk ./classes/Command.php 327 -- var $other = NULL; -- function __construct($user, $other=NULL) { -+ var $other = null; -+ function __construct($user, $other=null) { -hunk ./classes/CommandInterpreter.php 40 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 47 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 58 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 68 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 75 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 79 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 86 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 90 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 97 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 101 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 107 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 111 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 117 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 121 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 127 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 131 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 137 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 141 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 147 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 152 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 156 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 162 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 166 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 174 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 178 -- return NULL; -+ return null; -hunk ./classes/CommandInterpreter.php 187 -- return NULL; -+ return null; +- function __construct($user=null) { ++ function __construct($user=null) ++ { +hunk ./classes/Command.php 33 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 40 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 54 +- function __construct($user, $word) { ++ function __construct($user, $word) ++ { +hunk ./classes/Command.php 63 +- function __construct($user, $word) { ++ function __construct($user, $word) ++ { +hunk ./classes/Command.php 72 +- function __construct($user, $other) { ++ function __construct($user, $other) ++ { +hunk ./classes/Command.php 81 +- function __construct($user, $other) { ++ function __construct($user, $other) ++ { +hunk ./classes/Command.php 89 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 117 +- function __construct($user, $other) { ++ function __construct($user, $other) ++ { +hunk ./classes/Command.php 123 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 162 +- function __construct($user, $other) { ++ function __construct($user, $other) ++ { +hunk ./classes/Command.php 168 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 199 +- function __construct($user, $other, $text) { ++ function __construct($user, $other, $text) ++ { +hunk ./classes/Command.php 206 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 244 +- function __construct($user, $other) { ++ function __construct($user, $other) ++ { +hunk ./classes/Command.php 250 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 276 +- function __construct($user, $other) { ++ function __construct($user, $other) ++ { +hunk ./classes/Command.php 282 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 304 +- function __construct($user, $other) { ++ function __construct($user, $other) ++ { +hunk ./classes/Command.php 310 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 329 +- function __construct($user, $other=null) { ++ function __construct($user, $other=null) ++ { +hunk ./classes/Command.php 334 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 350 +- function __construct($user, $other=null) { ++ function __construct($user, $other=null) ++ { +hunk ./classes/Command.php 356 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/Command.php 371 +- function execute($channel) { ++ function execute($channel) ++ { +hunk ./classes/CommandInterpreter.php 26 +- function handle_command($user, $text) { ++ function handle_command($user, $text) ++ { hunk ./classes/Confirm_address.php 23 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); } +hunk ./classes/Confirm_address.php 29 +- function sequenceKey() { return array(false, false); } ++ function sequenceKey() ++ { return array(false, false); } hunk ./classes/Consumer.php 19 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Consumer',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Consumer',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Consumer',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Consumer',$k,$v); } hunk ./classes/Fave.php 18 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Fave',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Fave',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Fave',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Fave',$k,$v); } +hunk ./classes/Fave.php 35 +- function &pkeyGet($kv) { ++ function &pkeyGet($kv) ++ { hunk ./classes/Foreign_link.php 24 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); } -hunk ./classes/Foreign_link.php 41 -- return NULL; -+ return null; -hunk ./classes/Foreign_link.php 54 -- return NULL; -+ return null; -hunk ./classes/Foreign_link.php 69 -- return NULL; -+ return null; +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); } +hunk ./classes/Foreign_link.php 59 +- function getForeignUser() { ++ function getForeignUser() ++ { +hunk ./classes/Foreign_link.php 74 +- function getUser() { ++ function getUser() ++ { hunk ./classes/Foreign_service.php 20 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); } hunk ./classes/Foreign_subscription.php 19 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); } hunk ./classes/Foreign_user.php 21 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); } -hunk ./classes/Foreign_user.php 39 -- return NULL; -+ return null; +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); } +hunk ./classes/Foreign_user.php 43 +- function updateKeys(&$orig) { ++ function updateKeys(&$orig) ++ { hunk ./classes/Invitation.php 20 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Invitation',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Invitation',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Invitation',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Invitation',$k,$v); } hunk ./classes/Memcached_DataObject.php 26 -- function &staticGet($cls, $k, $v=NULL) { -+ function &staticGet($cls, $k, $v=null) { -hunk ./classes/Memcached_DataObject.php 59 -- $i = NULL; -+ $i = null; -hunk ./classes/Memcached_DataObject.php 70 -- function update($orig=NULL) { -+ function update($orig=null) { +- function &staticGet($cls, $k, $v=null) { ++ function &staticGet($cls, $k, $v=null) ++ { +hunk ./classes/Memcached_DataObject.php 48 +- function &pkeyGet($cls, $kv) { ++ function &pkeyGet($cls, $kv) ++ { +hunk ./classes/Memcached_DataObject.php 67 +- function insert() { ++ function insert() ++ { +hunk ./classes/Memcached_DataObject.php 73 +- function update($orig=null) { ++ function update($orig=null) ++ { +hunk ./classes/Memcached_DataObject.php 85 +- function delete() { ++ function delete() ++ { +hunk ./classes/Memcached_DataObject.php 108 +- function keyTypes() { ++ function keyTypes() ++ { +hunk ./classes/Memcached_DataObject.php 118 +- function encache() { ++ function encache() ++ { +hunk ./classes/Memcached_DataObject.php 143 +- function decache() { ++ function decache() ++ { +hunk ./classes/Memcached_DataObject.php 169 +- function multicache($cls, $kv) { ++ function multicache($cls, $kv) ++ { +hunk ./classes/Memcached_DataObject.php 182 +- function getSearchEngine($table) { ++ function getSearchEngine($table) ++ { hunk ./classes/Message.php 25 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Message',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Message',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Message',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Message',$k,$v); } +hunk ./classes/Message.php 31 +- function getFrom() { ++ function getFrom() ++ { +hunk ./classes/Message.php 36 +- function getTo() { ++ function getTo() ++ { hunk ./classes/Nonce.php 21 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Nonce',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Nonce',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Nonce',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Nonce',$k,$v); } hunk ./classes/Notice.php 51 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice',$k,$v); } -hunk ./classes/Notice.php 94 -- static function saveNew($profile_id, $content, $source=NULL, $is_local=1, $reply_to=NULL, $uri=NULL) { -+ static function saveNew($profile_id, $content, $source=null, $is_local=1, $reply_to=null, $uri=null) { -hunk ./classes/Notice.php 296 -- static function getStream($qry, $cachekey, $offset=0, $limit=20, $since_id=0, $before_id=0, $order=NULL, $since=NULL) { -+ static function getStream($qry, $cachekey, $offset=0, $limit=20, $since_id=0, $before_id=0, $order=null, $since=null) { -hunk ./classes/Notice.php 386 -- return Notice::getStreamDirect($qry, $offset, $limit, NULL, NULL, $order, NULL); -+ return Notice::getStreamDirect($qry, $offset, $limit, null, null, $order, null); -hunk ./classes/Notice.php 394 -- return Notice::getStreamDirect($qry, $offset, $limit, NULL, NULL, $order, NULL); -+ return Notice::getStreamDirect($qry, $offset, $limit, null, null, $order, null); -hunk ./classes/Notice.php 426 -- $last_id, NULL, $order, NULL); -+ $last_id, null, $order, null); -hunk ./classes/Notice.php 450 -- $notice = Notice::getStreamDirect($qry, 0, NOTICE_CACHE_WINDOW, NULL, NULL, $order, NULL); -+ $notice = Notice::getStreamDirect($qry, 0, NOTICE_CACHE_WINDOW, null, null, $order, null); -hunk ./classes/Notice.php 480 -- function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=NULL) { -+ function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) { -hunk ./classes/Notice.php 499 -- $offset, $limit, $since_id, $before_id, NULL, $since); -+ $offset, $limit, $since_id, $before_id, null, $since); -hunk ./classes/NoticeWrapper.php 38 -- var $notices = NULL; -+ var $notices = null; +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Notice',$k,$v); } +hunk ./classes/Notice.php 57 +- function getProfile() { ++ function getProfile() ++ { +hunk ./classes/Notice.php 62 +- function delete() { ++ function delete() ++ { +hunk ./classes/Notice.php 70 +- function saveTags() { ++ function saveTags() ++ { +hunk ./classes/Notice.php 191 +- function blowCaches($blowLast=false) { ++ function blowCaches($blowLast=false) ++ { +hunk ./classes/Notice.php 200 +- function blowTagCache($blowLast=false) { ++ function blowTagCache($blowLast=false) ++ { +hunk ./classes/Notice.php 219 +- function blowSubsCache($blowLast=false) { ++ function blowSubsCache($blowLast=false) ++ { +hunk ./classes/Notice.php 240 +- function blowNoticeCache($blowLast=false) { ++ function blowNoticeCache($blowLast=false) ++ { +hunk ./classes/Notice.php 253 +- function blowRepliesCache($blowLast=false) { ++ function blowRepliesCache($blowLast=false) ++ { +hunk ./classes/Notice.php 272 +- function blowPublicCache($blowLast=false) { ++ function blowPublicCache($blowLast=false) ++ { +hunk ./classes/Notice.php 285 +- function blowFavesCache($blowLast=false) { ++ function blowFavesCache($blowLast=false) ++ { +hunk ./classes/Notice.php 491 +- function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) { ++ function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) ++ { +hunk ./classes/Notice.php 514 +- function addToInboxes() { ++ function addToInboxes() ++ { +hunk ./classes/Notice.php 538 +- function blowInboxes() { ++ function blowInboxes() ++ { +hunk ./classes/NoticeWrapper.php 41 +- function __construct($arr) { ++ function __construct($arr) ++ { +hunk ./classes/NoticeWrapper.php 46 +- function fetch() { ++ function fetch() ++ { hunk ./classes/Notice_inbox.php 36 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); } hunk ./classes/Notice_source.php 20 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice_source',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_source',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_source',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Notice_source',$k,$v); } hunk ./classes/Notice_tag.php 33 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); } +hunk ./classes/Notice_tag.php 50 +- function blowCache() { ++ function blowCache() ++ { hunk ./classes/Profile.php 44 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Profile',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile',$k,$v); } -hunk ./classes/Profile.php 49 -- function getAvatar($width, $height=NULL) { -+ function getAvatar($width, $height=null) { -hunk ./classes/Profile.php 65 -- return NULL; -+ return null; -hunk ./classes/Profile.php 74 -- return NULL; -+ return null; -hunk ./classes/Profile.php 79 -- NULL, common_timestamp()); -+ null, common_timestamp()); -hunk ./classes/Profile.php 99 -- return NULL; -+ return null; -hunk ./classes/Profile.php 104 -- return NULL; -+ return null; -hunk ./classes/Profile.php 112 -- return NULL; -+ return null; +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Profile',$k,$v); } +hunk ./classes/Profile.php 50 +- function getAvatar($width, $height=null) { ++ function getAvatar($width, $height=null) ++ { +hunk ./classes/Profile.php 60 +- function getOriginalAvatar() { ++ function getOriginalAvatar() ++ { +hunk ./classes/Profile.php 72 +- function setOriginal($source) { ++ function setOriginal($source) ++ { +hunk ./classes/Profile.php 124 +- function delete_avatars() { ++ function delete_avatars() ++ { hunk ./classes/Profile.php 135 -- function getCurrentNotice($dt=NULL) { -+ function getCurrentNotice($dt=null) { -hunk ./classes/Profile.php 146 -- return NULL; -+ return null; +- function getBestName() { ++ function getBestName() ++ { +hunk ./classes/Profile.php 141 +- function getCurrentNotice($dt=null) { ++ function getCurrentNotice($dt=null) ++ { +hunk ./classes/Profile.php 156 +- function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) { ++ function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) ++ { hunk ./classes/Profile_block.php 39 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Profile_block',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_block',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_block',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Profile_block',$k,$v); } +hunk ./classes/Profile_block.php 45 +- function get($blocker, $blocked) { ++ function get($blocker, $blocked) ++ { hunk ./classes/Profile_tag.php 19 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); } hunk ./classes/Queue_item.php 19 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Queue_item',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Queue_item',$k,$v); } -hunk ./classes/Queue_item.php 31 -- $qi->whereAdd('claimed is NULL'); -+ $qi->whereAdd('claimed is null'); -hunk ./classes/Queue_item.php 39 -- # can we force it to only update if claimed is still NULL -+ # can we force it to only update if claimed is still null -hunk ./classes/Queue_item.php 52 -- $qi = NULL; -- return NULL; -+ $qi = null; -+ return null; +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Queue_item',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Queue_item',$k,$v); } +hunk ./classes/Queue_item.php 25 +- function sequenceKey() { return array(false, false); } ++ function sequenceKey() ++ { return array(false, false); } hunk ./classes/Remember_me.php 18 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Remember_me',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remember_me',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remember_me',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Remember_me',$k,$v); } +hunk ./classes/Remember_me.php 24 +- function sequenceKey() { return array(false, false); } ++ function sequenceKey() ++ { return array(false, false); } hunk ./classes/Remote_profile.php 41 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); } hunk ./classes/Reply.php 19 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Reply',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Reply',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Reply',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Reply',$k,$v); } hunk ./classes/Sms_carrier.php 20 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); } +hunk ./classes/Sms_carrier.php 26 +- function toEmailAddress($sms) { ++ function toEmailAddress($sms) ++ { hunk ./classes/Subscription.php 43 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Subscription',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Subscription',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Subscription',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Subscription',$k,$v); } +hunk ./classes/Subscription.php 49 +- function &pkeyGet($kv) { ++ function &pkeyGet($kv) ++ { hunk ./classes/Token.php 22 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Token',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Token',$k,$v); } +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Token',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('Token',$k,$v); } hunk ./classes/User.php 65 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('User',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User',$k,$v); } -hunk ./classes/User.php 121 -- function getCurrentNotice($dt=NULL) { -+ function getCurrentNotice($dt=null) { -hunk ./classes/User.php 124 -- return NULL; -+ return null; -hunk ./classes/User.php 339 -- function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=NULL) { -+ function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { -hunk ./classes/User.php 346 -- $offset, $limit, $since_id, $before_id, NULL, $since); -+ $offset, $limit, $since_id, $before_id, null, $since); -hunk ./classes/User.php 349 -- function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=NULL) { -+ function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('User',$k,$v); } +hunk ./classes/User.php 71 +- function getProfile() { ++ function getProfile() ++ { +hunk ./classes/User.php 76 +- function isSubscribed($other) { ++ function isSubscribed($other) ++ { +hunk ./classes/User.php 87 +- function updateKeys(&$orig) { ++ function updateKeys(&$orig) ++ { +hunk ./classes/User.php 115 +- function allowed_nickname($nickname) { ++ function allowed_nickname($nickname) ++ { +hunk ./classes/User.php 126 +- function getCurrentNotice($dt=null) { ++ function getCurrentNotice($dt=null) ++ { +hunk ./classes/User.php 135 +- function getCarrier() { ++ function getCarrier() ++ { +hunk ./classes/User.php 140 +- function subscribeTo($other) { ++ function subscribeTo($other) ++ { +hunk ./classes/User.php 155 +- function hasBlocked($other) { ++ function hasBlocked($other) ++ { +hunk ./classes/User.php 283 +- function emailChanged() { ++ function emailChanged() ++ { +hunk ./classes/User.php 298 +- function hasFave($notice) { ++ function hasFave($notice) ++ { +hunk ./classes/User.php 331 +- function mutuallySubscribed($other) { ++ function mutuallySubscribed($other) ++ { +hunk ./classes/User.php 337 +- function mutuallySubscribedUsers() { ++ function mutuallySubscribedUsers() ++ { hunk ./classes/User.php 352 -- return NULL; -+ return null; -hunk ./classes/User.php 368 -- function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=NULL) { -+ function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { -hunk ./classes/User.php 380 -- $order = NULL; -+ $order = null; +- function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { ++ function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) ++ { +hunk ./classes/User.php 363 +- function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { ++ function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) ++ { +hunk ./classes/User.php 373 +- function favoriteNotices($offset=0, $limit=NOTICES_PER_PAGE) { ++ function favoriteNotices($offset=0, $limit=NOTICES_PER_PAGE) ++ { +hunk ./classes/User.php 384 +- function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { ++ function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) ++ { +hunk ./classes/User.php 414 +- function blowFavesCache() { ++ function blowFavesCache() ++ { +hunk ./classes/User.php 425 +- function getSelfTags() { ++ function getSelfTags() ++ { +hunk ./classes/User.php 430 +- function setSelfTags($newtags) { ++ function setSelfTags($newtags) ++ { +hunk ./classes/User.php 435 +- function block($other) { ++ function block($other) ++ { +hunk ./classes/User.php 474 +- function unblock($other) { ++ function unblock($other) ++ { hunk ./classes/User_openid.php 20 -- function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('User_openid',$k,$v); } -+ function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User_openid',$k,$v); } -hunk ./lib/common.php 61 -- 'logfile' => NULL, -+ 'logfile' => null, -hunk ./lib/common.php 67 -- array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : NULL, -- 'broughtby' => NULL, -+ array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : null, -+ 'broughtby' => null, -hunk ./lib/common.php 70 -- 'broughtbyurl' => NULL, -+ 'broughtbyurl' => null, -hunk ./lib/common.php 85 -- 'params' => NULL), -+ 'params' => null), -hunk ./lib/common.php 92 -- array('server' => NULL), -+ array('server' => null), -hunk ./lib/common.php 97 -- array('server' => NULL), -+ array('server' => null), -hunk ./lib/common.php 110 -- 'host' => NULL, # only set if != server -+ 'host' => null, # only set if != server -hunk ./lib/common.php 143 -- 'mirror' => NULL, -+ 'mirror' => null, -hunk ./lib/deleteaction.php 46 -- function show_top($arr=NULL) { -+ function show_top($arr=null) { -hunk ./lib/deleteaction.php 55 -- return NULL; -+ return null; -hunk ./lib/facebookaction.php 84 -- $facebook->api_client->profile_setFBML(NULL, $fbuid, $fbml, NULL, NULL, $fbml_main); -+ $facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main); -hunk ./lib/facebookaction.php 238 -- function pagination($have_before, $have_after, $page, $fbaction, $args=NULL) { -+ function pagination($have_before, $have_after, $page, $fbaction, $args=null) { -hunk ./lib/facebookaction.php 269 -- function pagination_url($fbaction, $args=NULL) { -+ function pagination_url($fbaction, $args=null) { -hunk ./lib/oauthstore.php 36 -- return NULL; -+ return null; -hunk ./lib/oauthstore.php 50 -- return NULL; -+ return null; -hunk ./lib/oauthstore.php 78 -- return NULL; -+ return null; -hunk ./lib/oauthstore.php 107 -- return NULL; -+ return null; -hunk ./lib/oauthstore.php 114 -- return NULL; -+ return null; -hunk ./lib/oauthstore.php 121 -- return NULL; -+ return null; -hunk ./lib/oauthstore.php 128 -- return NULL; -+ return null; -hunk ./lib/oauthstore.php 135 -- return NULL; -+ return null; -hunk ./lib/omb.php 47 -- static $con = NULL; -+ static $con = null; -hunk ./lib/omb.php 64 -- static $store = NULL; -+ static $store = null; -hunk ./lib/omb.php 72 -- static $hmac_method = NULL; -+ static $hmac_method = null; +- function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User_openid',$k,$v); } ++ function staticGet($k,$v=null) ++ { return Memcached_DataObject::staticGet('User_openid',$k,$v); } +hunk ./lib/Shorturl_api.php 25 +- function __construct($service_url) { ++ function __construct($service_url) ++ { +hunk ./lib/Shorturl_api.php 30 +- function shorten($url) { ++ function shorten($url) ++ { +hunk ./lib/Shorturl_api.php 73 +- function __construct() { ++ function __construct() ++ { +hunk ./lib/Shorturl_api.php 92 +- function __construct() { ++ function __construct() ++ { +hunk ./lib/Shorturl_api.php 110 +- function __construct() { ++ function __construct() ++ { +hunk ./lib/common.php 166 +-function __autoload($class) { ++function __autoload($class) ++{ +hunk ./lib/deleteaction.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./lib/deleteaction.php 47 +- function show_top($arr=null) { ++ function show_top($arr=null) ++ { +hunk ./lib/deleteaction.php 56 +- function get_title() { ++ function get_title() ++ { +hunk ./lib/deleteaction.php 61 +- function show_header() { ++ function show_header() ++ { +hunk ./lib/facebookaction.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./lib/facebookaction.php 31 +- function get_facebook() { ++ function get_facebook() ++ { +hunk ./lib/facebookaction.php 38 +- function update_profile_box($facebook, $fbuid, $user) { ++ function update_profile_box($facebook, $fbuid, $user) ++ { +hunk ./lib/facebookaction.php 92 +- function show_header($selected ='Home') { ++ function show_header($selected ='Home') ++ { +hunk ./lib/facebookaction.php 115 +- function show_footer() { ++ function show_footer() ++ { +hunk ./lib/facebookaction.php 121 +- function show_login_form() { ++ function show_login_form() ++ { +hunk ./lib/facebookaction.php 157 +- function render_notice($notice) { ++ function render_notice($notice) ++ { +hunk ./lib/facebookaction.php 217 +- function source_link($source) { ++ function source_link($source) ++ { +hunk ./lib/facebookaction.php 246 +- function pagination($have_before, $have_after, $page, $fbaction, $args=null) { ++ function pagination($have_before, $have_after, $page, $fbaction, $args=null) ++ { +hunk ./lib/facebookaction.php 278 +- function pagination_url($fbaction, $args=null) { ++ function pagination_url($fbaction, $args=null) ++ { +hunk ./lib/oauthstore.php 28 +- function lookup_consumer($consumer_key) { ++ function lookup_consumer($consumer_key) ++ { +hunk ./lib/oauthstore.php 43 +- function lookup_token($consumer, $token_type, $token_key) { ++ function lookup_token($consumer, $token_type, $token_key) ++ { +hunk ./lib/oauthstore.php 56 +- function lookup_nonce($consumer, $token, $nonce, $timestamp) { ++ function lookup_nonce($consumer, $token, $nonce, $timestamp) ++ { +hunk ./lib/oauthstore.php 72 +- function new_request_token($consumer) { ++ function new_request_token($consumer) ++ { +hunk ./lib/oauthstore.php 90 +- function fetch_request_token($consumer) { ++ function fetch_request_token($consumer) ++ { +hunk ./lib/oauthstore.php 95 +- function new_access_token($token, $consumer) { ++ function new_access_token($token, $consumer) ++ { +hunk ./lib/oauthstore.php 147 +- function fetch_access_token($consumer) { ++ function fetch_access_token($consumer) ++ { +hunk ./lib/omb.php 46 +-function omb_oauth_consumer() { ++function omb_oauth_consumer() ++{ +hunk ./lib/omb.php 55 +-function omb_oauth_server() { ++function omb_oauth_server() ++{ +hunk ./lib/omb.php 65 +-function omb_oauth_datastore() { ++function omb_oauth_datastore() ++{ +hunk ./lib/omb.php 74 +-function omb_hmac_sha1() { ++function omb_hmac_sha1() ++{ +hunk ./lib/omb.php 83 +-function omb_get_services($xrd, $type) { ++function omb_get_services($xrd, $type) ++{ +hunk ./lib/omb.php 88 +-function omb_service_filter($type) { ++function omb_service_filter($type) ++{ hunk ./lib/omb.php 94 -- return NULL; -+ return null; -hunk ./lib/omb.php 98 -- return NULL; -+ return null; -hunk ./lib/omb.php 105 -- return NULL; -+ return null; -hunk ./lib/omb.php 109 -- return NULL; -+ return null; -hunk ./lib/openid.php 35 -- static $store = NULL; -+ static $store = null; -hunk ./lib/openid.php 66 -- return NULL; -+ return null; -hunk ./lib/openid.php 88 -- $user = NULL; -+ $user = null; -hunk ./lib/openid.php 96 --function oid_check_immediate($openid_url, $backto=NULL) { -+function oid_check_immediate($openid_url, $backto=null) { -hunk ./lib/openid.php 180 -- common_show_header(_('OpenID Auto-Submit'), NULL, NULL, '_oid_print_instructions'); -+ common_show_header(_('OpenID Auto-Submit'), null, null, '_oid_print_instructions'); -hunk ./lib/openid.php 182 -- common_element('script', NULL, -+ common_element('script', null, +-function omb_match_service($service, $type) { ++function omb_match_service($service, $type) ++{ +hunk ./lib/omb.php 99 +-function omb_service_uri($service) { ++function omb_service_uri($service) ++{ +hunk ./lib/omb.php 111 +-function omb_local_id($service) { ++function omb_local_id($service) ++{ +hunk ./lib/omb.php 124 +-function omb_broadcast_remote_subscribers($notice) { ++function omb_broadcast_remote_subscribers($notice) ++{ +hunk ./lib/omb.php 155 +-function omb_post_notice($notice, $remote_profile, $subscription) { ++function omb_post_notice($notice, $remote_profile, $subscription) ++{ +hunk ./lib/omb.php 160 +-function omb_post_notice_keys($notice, $postnoticeurl, $tk, $secret) { ++function omb_post_notice_keys($notice, $postnoticeurl, $tk, $secret) ++{ +hunk ./lib/omb.php 231 +-function omb_broadcast_profile($profile) { ++function omb_broadcast_profile($profile) ++{ +hunk ./lib/omb.php 252 +-function omb_update_profile($profile, $remote_profile, $subscription) { ++function omb_update_profile($profile, $remote_profile, $subscription) ++{ +hunk ./lib/openid.php 34 +-function oid_store() { ++function oid_store() ++{ +hunk ./lib/openid.php 46 +-function oid_consumer() { ++function oid_consumer() ++{ +hunk ./lib/openid.php 53 +-function oid_clear_last() { ++function oid_clear_last() ++{ +hunk ./lib/openid.php 58 +-function oid_set_last($openid_url) { ++function oid_set_last($openid_url) ++{ +hunk ./lib/openid.php 65 +-function oid_get_last() { ++function oid_get_last() ++{ +hunk ./lib/openid.php 75 +-function oid_link_user($id, $canonical, $display) { ++function oid_link_user($id, $canonical, $display) ++{ +hunk ./lib/openid.php 93 +-function oid_get_user($openid_url) { ++function oid_get_user($openid_url) ++{ +hunk ./lib/openid.php 103 +-function oid_check_immediate($openid_url, $backto=null) { ++function oid_check_immediate($openid_url, $backto=null) ++{ +hunk ./lib/openid.php 124 +-function oid_authenticate($openid_url, $returnto, $immediate=false) { ++function oid_authenticate($openid_url, $returnto, $immediate=false) ++{ +hunk ./lib/openid.php 202 +-function _oid_print_instructions() { ++function _oid_print_instructions() ++{ +hunk ./lib/openid.php 212 +-function oid_update_user(&$user, &$sreg) { ++function oid_update_user(&$user, &$sreg) ++{ +hunk ./lib/personal.php 24 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./lib/personal.php 29 +- function handle($args) { ++ function handle($args) ++ { hunk ./lib/personal.php 35 -- $user = NULL; -+ $user = null; -hunk ./lib/profilelist.php 27 -- var $profile = NULL; -- var $owner = NULL; -- var $action = NULL; -+ var $profile = null; -+ var $owner = null; -+ var $action = null; +- function views_menu() { ++ function views_menu() ++ { +hunk ./lib/personal.php 91 +- function show_feeds_list($feeds) { ++ function show_feeds_list($feeds) ++ { +hunk ./lib/personal.php 104 +- function common_feed_item($feed) { ++ function common_feed_item($feed) ++ { +hunk ./lib/personal.php 189 +- function source_link($source) { ++ function source_link($source) ++ { hunk ./lib/profilelist.php 31 -- function __construct($profile, $owner=NULL, $action=NULL) { -+ function __construct($profile, $owner=null, $action=null) { +- function __construct($profile, $owner=null, $action=null) { ++ function __construct($profile, $owner=null, $action=null) ++ { +hunk ./lib/profilelist.php 38 +- function show_list() { ++ function show_list() ++ { +hunk ./lib/profilelist.php 58 +- function show() { ++ function show() ++ { +hunk ./lib/profilelist.php 165 +- function show_owner_controls($profile) { ++ function show_owner_controls($profile) ++ { +hunk ./lib/profilelist.php 170 +- function highlight($text) { ++ function highlight($text) ++ { hunk ./lib/queuehandler.php 32 -- function QueueHandler($id=NULL) { -+ function QueueHandler($id=null) { -hunk ./lib/queuehandler.php 55 -- return NULL; -+ return null; -hunk ./lib/queuehandler.php 86 -- $qi->claimed = NULL; -+ $qi->claimed = null; -hunk ./lib/queuehandler.php 94 -- $notice = NULL; -+ $notice = null; -hunk ./lib/rssaction.php 58 -- return NULL; -+ return null; -hunk ./lib/rssaction.php 87 -- common_element('title', NULL, $channel['title']); -- common_element('link', NULL, $channel['link']); -- common_element('description', NULL, $channel['description']); -+ common_element('title', null, $channel['title']); -+ common_element('link', null, $channel['link']); -+ common_element('description', null, $channel['description']); -hunk ./lib/rssaction.php 114 -- common_element('title', NULL, $channel['title']); -- common_element('link', NULL, $channel['link']); -- common_element('url', NULL, $image); -+ common_element('title', null, $channel['title']); -+ common_element('link', null, $channel['link']); -+ common_element('url', null, $image); -hunk ./lib/rssaction.php 127 -- common_element('title', NULL, $title); -- common_element('link', NULL, $nurl); -- common_element('description', NULL, $profile->nickname."'s status on ".common_exact_date($notice->created)); -- common_element('dc:date', NULL, common_date_w3dtf($notice->created)); -- common_element('dc:creator', NULL, ($profile->fullname) ? $profile->fullname : $profile->nickname); -+ common_element('title', null, $title); -+ common_element('link', null, $nurl); -+ common_element('description', null, $profile->nickname."'s status on ".common_exact_date($notice->created)); -+ common_element('dc:date', null, common_date_w3dtf($notice->created)); -+ common_element('dc:creator', null, ($profile->fullname) ? $profile->fullname : $profile->nickname); -hunk ./lib/rssaction.php 144 -- common_element('foaf:nick', NULL, $nickname); -+ common_element('foaf:nick', null, $nickname); -hunk ./lib/rssaction.php 146 -- common_element('foaf:name', NULL, $profile->fullname); -+ common_element('foaf:name', null, $profile->fullname); -hunk ./lib/rssaction.php 148 -- common_element('sioc:id', NULL, $id); -+ common_element('sioc:id', null, $id); -hunk ./lib/rssaction.php 178 -- common_element('sioc:name', NULL, common_config('site', 'name')); -+ common_element('sioc:name', null, common_config('site', 'name')); -hunk ./lib/searchaction.php 33 -- function show_top($arr=NULL) { -+ function show_top($arr=null) { -hunk ./lib/searchaction.php 50 -- return NULL; -+ return null; +- function QueueHandler($id=null) { ++ function QueueHandler($id=null) ++ { +hunk ./lib/queuehandler.php 39 +- function class_name() { ++ function class_name() ++ { +hunk ./lib/queuehandler.php 44 +- function name() { ++ function name() ++ { +hunk ./lib/queuehandler.php 49 +- function get_id() { ++ function get_id() ++ { +hunk ./lib/queuehandler.php 54 +- function set_id($id) { ++ function set_id($id) ++ { +hunk ./lib/queuehandler.php 59 +- function transport() { ++ function transport() ++ { +hunk ./lib/queuehandler.php 64 +- function start() { ++ function start() ++ { +hunk ./lib/queuehandler.php 68 +- function finish() { ++ function finish() ++ { +hunk ./lib/queuehandler.php 72 +- function handle_notice($notice) { ++ function handle_notice($notice) ++ { +hunk ./lib/queuehandler.php 77 +- function run() { ++ function run() ++ { +hunk ./lib/queuehandler.php 123 +- function idle($timeout=0) { ++ function idle($timeout=0) ++ { +hunk ./lib/queuehandler.php 130 +- function clear_old_claims() { ++ function clear_old_claims() ++ { +hunk ./lib/queuehandler.php 140 +- function log($level, $msg) { ++ function log($level, $msg) ++ { +hunk ./lib/rssaction.php 29 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./lib/rssaction.php 34 +- function handle($args) { ++ function handle($args) ++ { +hunk ./lib/rssaction.php 44 +- function init() { ++ function init() ++ { +hunk ./lib/rssaction.php 49 +- function get_notices() { ++ function get_notices() ++ { +hunk ./lib/rssaction.php 54 +- function get_channel() { ++ function get_channel() ++ { +hunk ./lib/rssaction.php 62 +- function get_image() { ++ function get_image() ++ { +hunk ./lib/rssaction.php 67 +- function show_rss($limit=0) { ++ function show_rss($limit=0) ++ { +hunk ./lib/rssaction.php 88 +- function show_channel($notices) { ++ function show_channel($notices) ++ { +hunk ./lib/rssaction.php 117 +- function show_image() { ++ function show_image() ++ { +hunk ./lib/rssaction.php 130 +- function show_item($notice) { ++ function show_item($notice) ++ { +hunk ./lib/rssaction.php 149 +- function show_creators() { ++ function show_creators() ++ { +hunk ./lib/rssaction.php 166 +- function init_rss() { ++ function init_rss() ++ { +hunk ./lib/rssaction.php 198 +- function end_rss() { ++ function end_rss() ++ { +hunk ./lib/search_engines.php 26 +- function __construct($target, $table) { ++ function __construct($target, $table) ++ { +hunk ./lib/search_engines.php 32 +- function query($q) { ++ function query($q) ++ { +hunk ./lib/search_engines.php 36 +- function limit($offset, $count, $rss = false) { ++ function limit($offset, $count, $rss = false) ++ { +hunk ./lib/search_engines.php 41 +- function set_sort_mode($mode) { ++ function set_sort_mode($mode) ++ { +hunk ./lib/search_engines.php 52 +- function __construct($target, $table) { ++ function __construct($target, $table) ++ { +hunk ./lib/search_engines.php 66 +- function is_connected() { ++ function is_connected() ++ { +hunk ./lib/search_engines.php 71 +- function limit($offset, $count, $rss = false) { ++ function limit($offset, $count, $rss = false) ++ { +hunk ./lib/search_engines.php 88 +- function query($q) { ++ function query($q) ++ { +hunk ./lib/search_engines.php 97 +- function set_sort_mode($mode) { ++ function set_sort_mode($mode) ++ { +hunk ./lib/search_engines.php 107 +- function query($q) { ++ function query($q) ++ { +hunk ./lib/search_engines.php 119 +- function query($q) { ++ function query($q) ++ { +hunk ./lib/searchaction.php 24 +- function is_readonly() { ++ function is_readonly() ++ { +hunk ./lib/searchaction.php 29 +- function handle($args) { ++ function handle($args) ++ { +hunk ./lib/searchaction.php 35 +- function show_top($arr=null) { ++ function show_top($arr=null) ++ { +hunk ./lib/searchaction.php 52 +- function get_title() { ++ function get_title() ++ { hunk ./lib/searchaction.php 57 -- function show_form($error=NULL) { -+ function show_form($error=null) { -hunk ./lib/searchaction.php 102 -- ($action != 'peoplesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : NULL), -+ ($action != 'peoplesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : null), -hunk ./lib/searchaction.php 106 -- ($action != 'noticesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : NULL) -+ ($action != 'noticesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : null) -hunk ./lib/settingsaction.php 47 -- function show_form($msg=NULL, $success=false) { -+ function show_form($msg=null, $success=false) { -hunk ./lib/settingsaction.php 58 -- function form_header($title, $msg=NULL, $success=false) { -+ function form_header($title, $msg=null, $success=false) { -hunk ./lib/settingsaction.php 60 -- NULL, -+ null, -hunk ./lib/twitter.php 151 -- return NULL; -+ return null; -hunk ./lib/twitter.php 157 -- return NULL; -+ return null; -hunk ./lib/twitterapi.php 37 -- $twitter_user['description'] = ($profile->bio) ? $profile->bio : NULL; -- $twitter_user['location'] = ($profile->location) ? $profile->location : NULL; -+ $twitter_user['description'] = ($profile->bio) ? $profile->bio : null; -+ $twitter_user['location'] = ($profile->location) ? $profile->location : null; -hunk ./lib/twitterapi.php 45 -- $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : NULL; -+ $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null; -hunk ./lib/twitterapi.php 66 -- $twitter_status['in_reply_to_status_id'] = ($notice->reply_to) ? intval($notice->reply_to) : NULL; -+ $twitter_status['in_reply_to_status_id'] = ($notice->reply_to) ? intval($notice->reply_to) : null; -hunk ./lib/twitterapi.php 69 -- $twitter_status['in_reply_to_user_id'] = ($notice->reply_to) ? $this->replier_by_reply(intval($notice->reply_to)) : NULL; -+ $twitter_status['in_reply_to_user_id'] = ($notice->reply_to) ? $this->replier_by_reply(intval($notice->reply_to)) : null; -hunk ./lib/twitterapi.php 160 -- common_element($element, NULL, common_xml_safe_str($value)); -+ common_element($element, null, common_xml_safe_str($value)); -hunk ./lib/twitterapi.php 163 -- common_element($element, NULL, $value); -+ common_element($element, null, $value); -hunk ./lib/twitterapi.php 175 -- common_element($element, NULL, $value); -+ common_element($element, null, $value); -hunk ./lib/twitterapi.php 183 -- common_element('title', NULL, $entry['title']); -- common_element('description', NULL, $entry['description']); -- common_element('pubDate', NULL, $entry['pubDate']); -- common_element('guid', NULL, $entry['guid']); -- common_element('link', NULL, $entry['link']); -+ common_element('title', null, $entry['title']); -+ common_element('description', null, $entry['description']); -+ common_element('pubDate', null, $entry['pubDate']); -+ common_element('guid', null, $entry['guid']); -+ common_element('link', null, $entry['link']); -hunk ./lib/twitterapi.php 193 -- common_element('title', NULL, $entry['title']); -+ common_element('title', null, $entry['title']); -hunk ./lib/twitterapi.php 195 -- common_element('id', NULL, $entry['id']); -- common_element('published', NULL, $entry['published']); -- common_element('updated', NULL, $entry['updated']); -- common_element('link', array('href' => $entry['link'], 'rel' => 'alternate', 'type' => 'text/html'), NULL); -+ common_element('id', null, $entry['id']); -+ common_element('published', null, $entry['published']); -+ common_element('updated', null, $entry['updated']); -+ common_element('link', array('href' => $entry['link'], 'rel' => 'alternate', 'type' => 'text/html'), null); -hunk ./lib/twitterapi.php 243 -- common_element($element, NULL, common_xml_safe_str($value)); -+ common_element($element, null, common_xml_safe_str($value)); -hunk ./lib/twitterapi.php 246 -- common_element($element, NULL, $value); -+ common_element($element, null, $value); -hunk ./lib/twitterapi.php 273 -- function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=NULL) { -+ function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=null) { -hunk ./lib/twitterapi.php 278 -- common_element('title', NULL, $title); -- common_element('link', NULL, $link); -+ common_element('title', null, $title); -+ common_element('link', null, $link); -hunk ./lib/twitterapi.php 287 -- common_element('description', NULL, $subtitle); -- common_element('language', NULL, 'en-us'); -- common_element('ttl', NULL, '40'); -+ common_element('description', null, $subtitle); -+ common_element('language', null, 'en-us'); -+ common_element('ttl', null, '40'); -hunk ./lib/twitterapi.php 307 -- function show_atom_timeline($notice, $title, $id, $link, $subtitle=NULL, $suplink=NULL) { -+ function show_atom_timeline($notice, $title, $id, $link, $subtitle=null, $suplink=null) { -hunk ./lib/twitterapi.php 311 -- common_element('title', NULL, $title); -- common_element('id', NULL, $id); -- common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), NULL); -+ common_element('title', null, $title); -+ common_element('id', null, $id); -+ common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null); -hunk ./lib/twitterapi.php 320 -- common_element('subtitle', NULL, $subtitle); -+ common_element('subtitle', null, $subtitle); -hunk ./lib/twitterapi.php 380 -- return NULL; -+ return null; -hunk ./lib/twitterapi.php 491 -- common_element('error', NULL, $msg); -- common_element('request', NULL, $_SERVER['REQUEST_URI']); -+ common_element('error', null, $msg); -+ common_element('request', null, $_SERVER['REQUEST_URI']); -hunk ./lib/twitterapi.php 524 -- function show_profile($profile, $content_type='xml', $notice=NULL) { -+ function show_profile($profile, $content_type='xml', $notice=null) { -hunk ./lib/twitterapi.php 540 -- function get_user($id, $apidata=NULL) { -+ function get_user($id, $apidata=null) { -hunk ./lib/twitterapi.php 559 -- return NULL; -+ return null; -hunk ./lib/xmppqueuehandler.php 41 -- jabber_send_presence("Send me a message to post a notice", 'available', NULL, 'available', -1); -+ jabber_send_presence("Send me a message to post a notice", 'available', null, 'available', -1); -hunk ./lib/xmppqueuehandler.php 48 -- $this->conn->presence(NULL, 'available', NULL, 'available', -1); -+ $this->conn->presence(null, 'available', null, 'available', -1); -hunk ./lib/xmppqueuehandler.php 74 -- $this->conn->message($this->listener(), $pl['body'], 'chat', NULL, $this->ofrom($pl['from'])); -+ $this->conn->message($this->listener(), $pl['body'], 'chat', null, $this->ofrom($pl['from'])); -hunk ./scripts/enjitqueuehandler.php 120 --$id = ($argc > 1) ? $argv[1] : NULL; -+$id = ($argc > 1) ? $argv[1] : null; -hunk ./scripts/fixup_inboxes.php 37 --$start_at = ($argc > 1) ? $argv[1] : NULL; -+$start_at = ($argc > 1) ? $argv[1] : null; -hunk ./scripts/fixup_notices_rendered.php 34 --$start_at = ($argc > 1) ? $argv[1] : NULL; -+$start_at = ($argc > 1) ? $argv[1] : null; -hunk ./scripts/jabberqueuehandler.php 38 -- var $conn = NULL; -+ var $conn = null; -hunk ./scripts/maildaemon.php 45 -- $this->error(NULL, _('Could not parse message.')); -+ $this->error(null, _('Could not parse message.')); +- function show_header($arr) { ++ function show_header($arr) ++ { +hunk ./lib/searchaction.php 62 +- function show_form($error=null) { ++ function show_form($error=null) ++ { +hunk ./lib/searchaction.php 100 +- function search_menu() { ++ function search_menu() ++ { +hunk ./lib/settingsaction.php 24 +- function handle($args) { ++ function handle($args) ++ { +hunk ./lib/settingsaction.php 44 +- function handle_post() { ++ function handle_post() ++ { +hunk ./lib/settingsaction.php 49 +- function show_form($msg=null, $success=false) { ++ function show_form($msg=null, $success=false) ++ { +hunk ./lib/settingsaction.php 54 +- function message($msg, $success) { ++ function message($msg, $success) ++ { +hunk ./lib/settingsaction.php 62 +- function form_header($title, $msg=null, $success=false) { ++ function form_header($title, $msg=null, $success=false) ++ { +hunk ./lib/settingsaction.php 70 +- function show_top($arr) { ++ function show_top($arr) ++ { +hunk ./lib/settingsaction.php 86 +- function settings_menu() { ++ function settings_menu() ++ { +hunk ./lib/stream.php 27 +- function public_views_menu() { ++ function public_views_menu() ++ { +hunk ./lib/stream.php 52 +- function show_notice_list($notice) { ++ function show_notice_list($notice) ++ { +hunk ./lib/subs.php 28 +-function subs_subscribe_user($user, $other_nickname) { ++function subs_subscribe_user($user, $other_nickname) ++{ +hunk ./lib/subs.php 45 +-function subs_subscribe_to($user, $other) { ++function subs_subscribe_to($user, $other) ++{ +hunk ./lib/subs.php 87 +-function subs_notify($listenee, $listener) { ++function subs_notify($listenee, $listener) ++{ +hunk ./lib/subs.php 95 +-function subs_notify_email($listenee, $listener) { ++function subs_notify_email($listenee, $listener) ++{ +hunk ./lib/subs.php 104 +-function subs_unsubscribe_user($user, $other_nickname) { ++function subs_unsubscribe_user($user, $other_nickname) ++{ +hunk ./lib/subs.php 119 +-function subs_unsubscribe_to($user, $other) { ++function subs_unsubscribe_to($user, $other) ++{ +hunk ./lib/theme.php 22 +-function theme_file($relative) { ++function theme_file($relative) ++{ +hunk ./lib/theme.php 28 +-function theme_path($relative) { ++function theme_path($relative) ++{ +hunk ./lib/twitter.php 22 +-function get_twitter_data($uri, $screen_name, $password) { ++function get_twitter_data($uri, $screen_name, $password) ++{ +hunk ./lib/twitter.php 52 +-function twitter_user_info($screen_name, $password) { ++function twitter_user_info($screen_name, $password) ++{ +hunk ./lib/twitter.php 71 +-function update_twitter_user($fuser, $twitter_id, $screen_name) { ++function update_twitter_user($fuser, $twitter_id, $screen_name) ++{ +hunk ./lib/twitter.php 87 +-function add_twitter_user($twitter_id, $screen_name) { ++function add_twitter_user($twitter_id, $screen_name) ++{ +hunk ./lib/twitter.php 112 +-function save_twitter_user($twitter_id, $screen_name) { ++function save_twitter_user($twitter_id, $screen_name) ++{ +hunk ./lib/twitter.php 137 +-function retreive_twitter_friends($twitter_id, $screen_name, $password) { ++function retreive_twitter_friends($twitter_id, $screen_name, $password) ++{ +hunk ./lib/twitter.php 172 +-function save_twitter_friends($user, $twitter_id, $screen_name, $password) { ++function save_twitter_friends($user, $twitter_id, $screen_name, $password) ++{ +hunk ./lib/twitterapi.php 26 +- function handle($args) { ++ function handle($args) ++ { +hunk ./lib/twitterapi.php 31 +- function twitter_user_array($profile, $get_notice=false) { ++ function twitter_user_array($profile, $get_notice=false) ++ { +hunk ./lib/twitterapi.php 60 +- function twitter_status_array($notice, $include_user=true) { ++ function twitter_status_array($notice, $include_user=true) ++ { +hunk ./lib/twitterapi.php 89 +- function twitter_rss_entry_array($notice) { ++ function twitter_rss_entry_array($notice) ++ { +hunk ./lib/twitterapi.php 114 +- function twitter_rss_dmsg_array($message) { ++ function twitter_rss_dmsg_array($message) ++ { +hunk ./lib/twitterapi.php 137 +- function twitter_dmsg_array($message) { ++ function twitter_dmsg_array($message) ++ { +hunk ./lib/twitterapi.php 158 +- function show_twitter_xml_status($twitter_status) { ++ function show_twitter_xml_status($twitter_status) ++ { +hunk ./lib/twitterapi.php 176 +- function show_twitter_xml_user($twitter_user, $role='user') { ++ function show_twitter_xml_user($twitter_user, $role='user') ++ { +hunk ./lib/twitterapi.php 189 +- function show_twitter_rss_item($entry) { ++ function show_twitter_rss_item($entry) ++ { +hunk ./lib/twitterapi.php 200 +- function show_twitter_atom_entry($entry) { ++ function show_twitter_atom_entry($entry) ++ { +hunk ./lib/twitterapi.php 212 +- function show_json_objects($objects) { ++ function show_json_objects($objects) ++ { +hunk ./lib/twitterapi.php 217 +- function show_single_xml_status($notice) { ++ function show_single_xml_status($notice) ++ { +hunk ./lib/twitterapi.php 225 +- function show_single_json_status($notice) { ++ function show_single_json_status($notice) ++ { +hunk ./lib/twitterapi.php 233 +- function show_single_xml_dmsg($message) { ++ function show_single_xml_dmsg($message) ++ { +hunk ./lib/twitterapi.php 241 +- function show_single_json_dmsg($message) { ++ function show_single_json_dmsg($message) ++ { +hunk ./lib/twitterapi.php 249 +- function show_twitter_xml_dmsg($twitter_dm) { ++ function show_twitter_xml_dmsg($twitter_dm) ++ { +hunk ./lib/twitterapi.php 268 +- function show_xml_timeline($notice) { ++ function show_xml_timeline($notice) ++ { +hunk ./lib/twitterapi.php 290 +- function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=null) { ++ function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=null) ++ { +hunk ./lib/twitterapi.php 325 +- function show_atom_timeline($notice, $title, $id, $link, $subtitle=null, $suplink=null) { ++ function show_atom_timeline($notice, $title, $id, $link, $subtitle=null, $suplink=null) ++ { +hunk ./lib/twitterapi.php 357 +- function show_json_timeline($notice) { ++ function show_json_timeline($notice) ++ { +hunk ./lib/twitterapi.php 383 +- function date_twitter($dt) { ++ function date_twitter($dt) ++ { +hunk ./lib/twitterapi.php 389 +- function replier_by_reply($reply_id) { ++ function replier_by_reply($reply_id) ++ { +hunk ./lib/twitterapi.php 406 +- function count_subscriptions($profile) { ++ function count_subscriptions($profile) ++ { +hunk ./lib/twitterapi.php 422 +- function init_document($type='xml') { ++ function init_document($type='xml') ++ { +hunk ./lib/twitterapi.php 454 +- function end_document($type='xml') { ++ function end_document($type='xml') ++ { +hunk ./lib/twitterapi.php 481 +- function client_error($msg, $code = 400, $content_type = 'json') { ++ function client_error($msg, $code = 400, $content_type = 'json') ++ { +hunk ./lib/twitterapi.php 530 +- function init_twitter_rss() { ++ function init_twitter_rss() ++ { +hunk ./lib/twitterapi.php 536 +- function end_twitter_rss() { ++ function end_twitter_rss() ++ { +hunk ./lib/twitterapi.php 542 +- function init_twitter_atom() { ++ function init_twitter_atom() ++ { +hunk ./lib/twitterapi.php 548 +- function end_twitter_atom() { ++ function end_twitter_atom() ++ { +hunk ./lib/twitterapi.php 554 +- function show_profile($profile, $content_type='xml', $notice=null) { ++ function show_profile($profile, $content_type='xml', $notice=null) ++ { +hunk ./lib/twitterapi.php 571 +- function get_user($id, $apidata=null) { ++ function get_user($id, $apidata=null) ++ { +hunk ./lib/twitterapi.php 583 +- function get_profile($id) { ++ function get_profile($id) ++ { +hunk ./lib/twitterapi.php 597 +- function source_link($source) { ++ function source_link($source) ++ { +hunk ./lib/twitterapi.php 617 +- function show_extended_profile($user, $apidata) { ++ function show_extended_profile($user, $apidata) ++ { +hunk ./lib/util.php 24 +-function common_server_error($msg, $code=500) { ++function common_server_error($msg, $code=500) ++{ +hunk ./lib/util.php 48 +-function common_user_error($msg, $code=400) { ++function common_user_error($msg, $code=400) ++{ +hunk ./lib/util.php 85 +-function common_element_start($tag, $attrs=null) { ++function common_element_start($tag, $attrs=null) ++{ +hunk ./lib/util.php 98 +-function common_element_end($tag) { ++function common_element_end($tag) ++{ +hunk ./lib/util.php 112 +-function common_element($tag, $attrs=null, $content=null) { ++function common_element($tag, $attrs=null, $content=null) ++{ +hunk ./lib/util.php 122 +-function common_start_xml($doc=null, $public=null, $system=null, $indent=true) { ++function common_start_xml($doc=null, $public=null, $system=null, $indent=true) ++{ +hunk ./lib/util.php 134 +-function common_end_xml() { ++function common_end_xml() ++{ +hunk ./lib/util.php 141 +-function common_init_locale($language=null) { ++function common_init_locale($language=null) ++{ +hunk ./lib/util.php 155 +-function common_init_language() { ++function common_init_language() ++{ +hunk ./lib/util.php 172 +-function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) { ++function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) ++{ +hunk ./lib/util.php 256 +-function common_start_html($type=null, $indent=true) { ++function common_start_html($type=null, $indent=true) ++{ +hunk ./lib/util.php 288 +-function common_show_footer() { ++function common_show_footer() ++{ +hunk ./lib/util.php 322 +-function common_text($txt) { ++function common_text($txt) ++{ +hunk ./lib/util.php 328 +-function common_raw($xml) { ++function common_raw($xml) ++{ +hunk ./lib/util.php 334 +-function common_nav_menu() { ++function common_nav_menu() ++{ +hunk ./lib/util.php 362 +-function common_foot_menu() { ++function common_foot_menu() ++{ +hunk ./lib/util.php 380 +-function common_menu_item($url, $text, $title=null, $is_selected=false) { ++function common_menu_item($url, $text, $title=null, $is_selected=false) ++{ +hunk ./lib/util.php 395 +-function common_input($id, $label, $value=null,$instructions=null) { ++function common_input($id, $label, $value=null,$instructions=null) ++{ +hunk ./lib/util.php 439 +-function common_dropdown($id, $label, $content, $instructions=null, $blank_select=FALSE, $selected=null) { ++function common_dropdown($id, $label, $content, $instructions=null, $blank_select=FALSE, $selected=null) ++{ +hunk ./lib/util.php 460 +-function common_hidden($id, $value) { ++function common_hidden($id, $value) ++{ +hunk ./lib/util.php 468 +-function common_password($id, $label, $instructions=null) { ++function common_password($id, $label, $instructions=null) ++{ +hunk ./lib/util.php 483 +-function common_submit($id, $label, $cls='submit') { ++function common_submit($id, $label, $cls='submit') ++{ +hunk ./lib/util.php 495 +-function common_textarea($id, $label, $content=null, $instructions=null) { ++function common_textarea($id, $label, $content=null, $instructions=null) ++{ +hunk ./lib/util.php 510 +-function common_timezone() { ++function common_timezone() ++{ +hunk ./lib/util.php 523 +-function common_language() { ++function common_language() ++{ +hunk ./lib/util.php 549 +-function common_munge_password($password, $id) { ++function common_munge_password($password, $id) ++{ +hunk ./lib/util.php 555 +-function common_check_user($nickname, $password) { ++function common_check_user($nickname, $password) ++{ +hunk ./lib/util.php 575 +-function common_logged_in() { ++function common_logged_in() ++{ +hunk ./lib/util.php 580 +-function common_have_session() { ++function common_have_session() ++{ +hunk ./lib/util.php 585 +-function common_ensure_session() { ++function common_ensure_session() ++{ +hunk ./lib/util.php 601 +-function common_set_user($user) { ++function common_set_user($user) ++{ +hunk ./lib/util.php 626 +-function common_set_cookie($key, $value, $expiration=0) { ++function common_set_cookie($key, $value, $expiration=0) ++{ +hunk ./lib/util.php 646 +-function common_rememberme($user=null) { ++function common_rememberme($user=null) ++{ +hunk ./lib/util.php 686 +-function common_remembered_user() { ++function common_remembered_user() ++{ +hunk ./lib/util.php 752 +-function common_forgetme() { ++function common_forgetme() ++{ +hunk ./lib/util.php 758 +-function common_current_user() { ++function common_current_user() ++{ +hunk ./lib/util.php 791 +-function common_real_login($real=true) { ++function common_real_login($real=true) ++{ +hunk ./lib/util.php 797 +-function common_is_real_login() { ++function common_is_real_login() ++{ +hunk ./lib/util.php 803 +-function common_canonical_nickname($nickname) { ++function common_canonical_nickname($nickname) ++{ +hunk ./lib/util.php 810 +-function common_canonical_email($email) { ++function common_canonical_email($email) ++{ +hunk ./lib/util.php 819 +-function common_render_content($text, $notice) { ++function common_render_content($text, $notice) ++{ +hunk ./lib/util.php 829 +-function common_render_text($text) { ++function common_render_text($text) ++{ +hunk ./lib/util.php 840 +-function common_render_uri_thingy($matches) { ++function common_render_uri_thingy($matches) ++{ +hunk ./lib/util.php 875 +-function common_longurl($short_url) { ++function common_longurl($short_url) ++{ +hunk ./lib/util.php 882 +-function common_longurl2($uri) { ++function common_longurl2($uri) ++{ +hunk ./lib/util.php 890 +-function common_shorten_links($text) { ++function common_shorten_links($text) ++{ +hunk ./lib/util.php 899 +-function common_shorten_link($url, $reverse = false) { ++function common_shorten_link($url, $reverse = false) ++{ +hunk ./lib/util.php 961 +-function common_xml_safe_str($str) { ++function common_xml_safe_str($str) ++{ +hunk ./lib/util.php 969 +-function common_tag_link($tag) { ++function common_tag_link($tag) ++{ +hunk ./lib/util.php 976 +-function common_canonical_tag($tag) { ++function common_canonical_tag($tag) ++{ +hunk ./lib/util.php 981 +-function common_valid_profile_tag($str) { ++function common_valid_profile_tag($str) ++{ +hunk ./lib/util.php 986 +-function common_at_link($sender_id, $nickname) { ++function common_at_link($sender_id, $nickname) ++{ +hunk ./lib/util.php 997 +-function common_at_hash_link($sender_id, $tag) { ++function common_at_hash_link($sender_id, $tag) ++{ +hunk ./lib/util.php 1014 +-function common_relative_profile($sender, $nickname, $dt=null) { ++function common_relative_profile($sender, $nickname, $dt=null) ++{ +hunk ./lib/util.php 1052 +-function common_avatar_filename($id, $extension, $size=null, $extra=null) { ++function common_avatar_filename($id, $extension, $size=null, $extra=null) ++{ +hunk ./lib/util.php 1063 +-function common_avatar_path($filename) { ++function common_avatar_path($filename) ++{ +hunk ./lib/util.php 1069 +-function common_avatar_url($filename) { ++function common_avatar_url($filename) ++{ +hunk ./lib/util.php 1074 +-function common_avatar_display_url($avatar) { ++function common_avatar_display_url($avatar) ++{ +hunk ./lib/util.php 1084 +-function common_default_avatar($size) { ++function common_default_avatar($size) ++{ +hunk ./lib/util.php 1092 +-function common_local_url($action, $args=null, $fragment=null) { ++function common_local_url($action, $args=null, $fragment=null) ++{ +hunk ./lib/util.php 1106 +-function common_fancy_url($action, $args=null) { ++function common_fancy_url($action, $args=null) ++{ +hunk ./lib/util.php 1320 +-function common_simple_url($action, $args=null) { ++function common_simple_url($action, $args=null) ++{ +hunk ./lib/util.php 1333 +-function common_path($relative) { ++function common_path($relative) ++{ +hunk ./lib/util.php 1340 +-function common_date_string($dt) { ++function common_date_string($dt) ++{ +hunk ./lib/util.php 1375 +-function common_exact_date($dt) { ++function common_exact_date($dt) ++{ +hunk ./lib/util.php 1391 +-function common_date_w3dtf($dt) { ++function common_date_w3dtf($dt) ++{ +hunk ./lib/util.php 1399 +-function common_date_rfc2822($dt) { ++function common_date_rfc2822($dt) ++{ +hunk ./lib/util.php 1407 +-function common_date_iso8601($dt) { ++function common_date_iso8601($dt) ++{ +hunk ./lib/util.php 1415 +-function common_sql_now() { ++function common_sql_now() ++{ +hunk ./lib/util.php 1420 +-function common_redirect($url, $code=307) { ++function common_redirect($url, $code=307) ++{ +hunk ./lib/util.php 1437 +-function common_save_replies($notice) { ++function common_save_replies($notice) ++{ +hunk ./lib/util.php 1521 +-function common_broadcast_notice($notice, $remote=false) { ++function common_broadcast_notice($notice, $remote=false) ++{ +hunk ./lib/util.php 1549 +-function common_twitter_broadcast($notice, $flink) { ++function common_twitter_broadcast($notice, $flink) ++{ +hunk ./lib/util.php 1610 +-function common_enqueue_notice($notice) { ++function common_enqueue_notice($notice) ++{ +hunk ./lib/util.php 1628 +-function common_dequeue_notice($notice) { ++function common_dequeue_notice($notice) ++{ +hunk ./lib/util.php 1645 +-function common_real_broadcast($notice, $remote=false) { ++function common_real_broadcast($notice, $remote=false) ++{ +hunk ./lib/util.php 1680 +-function common_broadcast_profile($profile) { ++function common_broadcast_profile($profile) ++{ +hunk ./lib/util.php 1689 +-function common_profile_url($nickname) { ++function common_profile_url($nickname) ++{ +hunk ./lib/util.php 1696 +-function common_notice_form($action=null, $content=null) { ++function common_notice_form($action=null, $content=null) ++{ +hunk ./lib/util.php 1729 +-function common_root_url() { ++function common_root_url() ++{ +hunk ./lib/util.php 1737 +-function common_good_rand($bytes) { ++function common_good_rand($bytes) ++{ +hunk ./lib/util.php 1747 +-function common_urandom($bytes) { ++function common_urandom($bytes) ++{ +hunk ./lib/util.php 1760 +-function common_mtrand($bytes) { ++function common_mtrand($bytes) ++{ +hunk ./lib/util.php 1769 +-function common_set_returnto($url) { ++function common_set_returnto($url) ++{ +hunk ./lib/util.php 1775 +-function common_get_returnto() { ++function common_get_returnto() ++{ +hunk ./lib/util.php 1781 +-function common_timestamp() { ++function common_timestamp() ++{ +hunk ./lib/util.php 1786 +-function common_ensure_syslog() { ++function common_ensure_syslog() ++{ +hunk ./lib/util.php 1796 +-function common_log($priority, $msg, $filename=null) { ++function common_log($priority, $msg, $filename=null) ++{ +hunk ./lib/util.php 1814 +-function common_debug($msg, $filename=null) { ++function common_debug($msg, $filename=null) ++{ +hunk ./lib/util.php 1823 +-function common_log_db_error(&$object, $verb, $filename=null) { ++function common_log_db_error(&$object, $verb, $filename=null) ++{ +hunk ./lib/util.php 1830 +-function common_log_objstring(&$object) { ++function common_log_objstring(&$object) ++{ +hunk ./lib/util.php 1844 +-function common_valid_http_url($url) { ++function common_valid_http_url($url) ++{ +hunk ./lib/util.php 1849 +-function common_valid_tag($tag) { ++function common_valid_tag($tag) ++{ +hunk ./lib/util.php 1860 +-function common_pagination($have_before, $have_after, $page, $action, $args=null) { ++function common_pagination($have_before, $have_after, $page, $action, $args=null) ++{ +hunk ./lib/util.php 1896 +-function common_accept_to_prefs($accept, $def = '*/*') { ++function common_accept_to_prefs($accept, $def = '*/*') ++{ +hunk ./lib/util.php 1921 +-function common_mime_type_match($type, $avail) { ++function common_mime_type_match($type, $avail) ++{ +hunk ./lib/util.php 1937 +-function common_negotiate_type($cprefs, $sprefs) { ++function common_negotiate_type($cprefs, $sprefs) ++{ +hunk ./lib/util.php 1974 +-function common_config($main, $sub) { ++function common_config($main, $sub) ++{ +hunk ./lib/util.php 1980 +-function common_copy_args($from) { ++function common_copy_args($from) ++{ +hunk ./lib/util.php 1992 +-function common_remove_magic_from_request() { ++function common_remove_magic_from_request() ++{ +hunk ./lib/util.php 2000 +-function common_user_uri(&$user) { ++function common_user_uri(&$user) ++{ +hunk ./lib/util.php 2005 +-function common_notice_uri(&$notice) { ++function common_notice_uri(&$notice) ++{ +hunk ./lib/util.php 2013 +-function common_confirmation_code($bits) { ++function common_confirmation_code($bits) ++{ +hunk ./lib/util.php 2031 +-function common_markup_to_html($c) { ++function common_markup_to_html($c) ++{ +hunk ./lib/util.php 2039 +-function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) { ++function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) ++{ +hunk ./lib/util.php 2049 +-function common_profile_uri($profile) { ++function common_profile_uri($profile) ++{ +hunk ./lib/util.php 2067 +-function common_canonical_sms($sms) { ++function common_canonical_sms($sms) ++{ +hunk ./lib/util.php 2074 +-function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext) { ++function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext) ++{ +hunk ./lib/util.php 2096 +-function common_session_token() { ++function common_session_token() ++{ +hunk ./lib/util.php 2105 +-function common_disfavor_form($notice) { ++function common_disfavor_form($notice) ++{ +hunk ./lib/util.php 2133 +-function common_favor_form($notice) { ++function common_favor_form($notice) ++{ +hunk ./lib/util.php 2161 +-function common_nudge_form($profile) { ++function common_nudge_form($profile) ++{ +hunk ./lib/util.php 2171 +-function common_nudge_response() { ++function common_nudge_response() ++{ +hunk ./lib/util.php 2176 +-function common_subscribe_form($profile) { ++function common_subscribe_form($profile) ++{ +hunk ./lib/util.php 2193 +-function common_unsubscribe_form($profile) { ++function common_unsubscribe_form($profile) ++{ +hunk ./lib/util.php 2211 +-function common_profile_new_message_nudge ($cur, $profile) { ++function common_profile_new_message_nudge ($cur, $profile) ++{ +hunk ./lib/util.php 2229 +-function common_cache_key($extra) { ++function common_cache_key($extra) ++{ +hunk ./lib/util.php 2234 +-function common_keyize($str) { ++function common_keyize($str) ++{ +hunk ./lib/util.php 2241 +-function common_message_form($content, $user, $to) { ++function common_message_form($content, $user, $to) ++{ +hunk ./lib/util.php 2282 +-function common_memcache() { ++function common_memcache() ++{ +hunk ./lib/util.php 2303 +-function common_compatible_license($from, $to) { ++function common_compatible_license($from, $to) ++{ +hunk ./lib/util.php 2311 +-function common_block_form($profile, $args=null) { ++function common_block_form($profile, $args=null) ++{ +hunk ./lib/util.php 2316 +-function common_unblock_form($profile, $args=null) { ++function common_unblock_form($profile, $args=null) ++{ +hunk ./lib/util.php 2321 +-function common_blocking_form($type, $label, $profile, $args=null) { ++function common_blocking_form($type, $label, $profile, $args=null) ++{ +hunk ./lib/xmppqueuehandler.php 33 +- function start() { ++ function start() ++ { +hunk ./lib/xmppqueuehandler.php 47 +- function handle_reconnect(&$pl) { ++ function handle_reconnect(&$pl) ++ { +hunk ./lib/xmppqueuehandler.php 53 +- function idle($timeout=0) { ++ function idle($timeout=0) ++ { +hunk ./lib/xmppqueuehandler.php 66 +- function forward_message(&$pl) { ++ function forward_message(&$pl) ++ { +hunk ./lib/xmppqueuehandler.php 81 +- function ofrom($from) { ++ function ofrom($from) ++ { +hunk ./lib/xmppqueuehandler.php 89 +- function listener() { ++ function listener() ++ { +hunk ./scripts/enjitqueuehandler.php 38 +- function transport() { ++ function transport() ++ { +hunk ./scripts/enjitqueuehandler.php 43 +- function start() { ++ function start() ++ { +hunk ./scripts/enjitqueuehandler.php 50 +- function handle_notice($notice) { ++ function handle_notice($notice) ++ { +hunk ./scripts/jabberqueuehandler.php 40 +- function transport() { ++ function transport() ++ { +hunk ./scripts/jabberqueuehandler.php 45 +- function handle_notice($notice) { ++ function handle_notice($notice) ++ { +hunk ./scripts/maildaemon.php 39 +- function __construct() { ++ function __construct() ++ { +hunk ./scripts/maildaemon.php 43 +- function handle_message($fname='php://stdin') { ++ function handle_message($fname='php://stdin') ++ { +hunk ./scripts/maildaemon.php 71 +- function error($from, $msg) { ++ function error($from, $msg) ++ { hunk ./scripts/maildaemon.php 77 -- return NULL; -+ return null; -hunk ./scripts/maildaemon.php 143 -- return NULL; -+ return null; -hunk ./scripts/maildaemon.php 170 -- $this->error(NULL, "Unsupported message type: " . $type); -+ $this->error(null, "Unsupported message type: " . $type); -hunk ./scripts/ombqueuehandler.php 70 --$id = ($argc > 1) ? $argv[1] : NULL; -+$id = ($argc > 1) ? $argv[1] : null; -hunk ./scripts/smsqueuehandler.php 60 --$id = ($argc > 1) ? $argv[1] : NULL; -+$id = ($argc > 1) ? $argv[1] : null; +- function user_from($from_hdr) { ++ function user_from($from_hdr) ++ { +hunk ./scripts/maildaemon.php 92 +- function user_match_to($user, $to_hdr) { ++ function user_match_to($user, $to_hdr) ++ { +hunk ./scripts/maildaemon.php 104 +- function handle_command($user, $from, $msg) { ++ function handle_command($user, $from, $msg) ++ { +hunk ./scripts/maildaemon.php 115 +- function respond($from, $to, $response) { ++ function respond($from, $to, $response) ++ { +hunk ./scripts/maildaemon.php 125 +- function log($level, $msg) { ++ function log($level, $msg) ++ { +hunk ./scripts/maildaemon.php 130 +- function add_notice($user, $msg) { ++ function add_notice($user, $msg) ++ { +hunk ./scripts/maildaemon.php 145 +- function parse_message($fname) { ++ function parse_message($fname) ++ { +hunk ./scripts/maildaemon.php 179 +- function unsupported_type($type) { ++ function unsupported_type($type) ++ { +hunk ./scripts/maildaemon.php 184 +- function cleanup_msg($msg) { ++ function cleanup_msg($msg) ++ { +hunk ./scripts/ombqueuehandler.php 38 +- function transport() { ++ function transport() ++ { +hunk ./scripts/ombqueuehandler.php 43 +- function start() { ++ function start() ++ { +hunk ./scripts/ombqueuehandler.php 49 +- function handle_notice($notice) { ++ function handle_notice($notice) ++ { +hunk ./scripts/ombqueuehandler.php 59 +- function finish() { ++ function finish() ++ { +hunk ./scripts/ombqueuehandler.php 63 +- function is_remote($notice) { ++ function is_remote($notice) ++ { +hunk ./scripts/publicqueuehandler.php 38 +- function transport() { ++ function transport() ++ { +hunk ./scripts/publicqueuehandler.php 43 +- function handle_notice($notice) { ++ function handle_notice($notice) ++ { +hunk ./scripts/sitemap.php 21 +-function index_map() { ++function index_map() ++{ +hunk ./scripts/sitemap.php 44 +-function standard_map() { ++function standard_map() ++{ +hunk ./scripts/sitemap.php 82 +-function notices_map() { ++function notices_map() ++{ +hunk ./scripts/sitemap.php 121 +-function user_map() { ++function user_map() ++{ +hunk ./scripts/sitemap.php 215 +-function url($url_args) { ++function url($url_args) ++{ +hunk ./scripts/sitemap.php 246 +-function sitemap($sitemap_args) { ++function sitemap($sitemap_args) ++{ +hunk ./scripts/sitemap.php 268 +-function urlset($urlset_text) { ++function urlset($urlset_text) ++{ +hunk ./scripts/sitemap.php 279 +-function sitemapindex($sitemapindex_text) { ++function sitemapindex($sitemapindex_text) ++{ +hunk ./scripts/sitemap.php 290 +-function array_to_map($url_list, $filename_prefix) { ++function array_to_map($url_list, $filename_prefix) ++{ +hunk ./scripts/sitemap.php 309 +-function parse_args() { ++function parse_args() ++{ +hunk ./scripts/sitemap.php 351 +-function trailing_slash($path) { ++function trailing_slash($path) ++{ +hunk ./scripts/sitemap.php 361 +-function write_file($path, $data) { ++function write_file($path, $data) ++{ +hunk ./scripts/sitemap.php 379 +-function error ($error_msg) { ++function error ($error_msg) ++{ +hunk ./scripts/smsqueuehandler.php 38 +- function transport() { ++ function transport() ++ { +hunk ./scripts/smsqueuehandler.php 43 +- function start() { ++ function start() ++ { +hunk ./scripts/smsqueuehandler.php 49 +- function handle_notice($notice) { ++ function handle_notice($notice) ++ { +hunk ./scripts/smsqueuehandler.php 54 +- function finish() { ++ function finish() ++ { +hunk ./scripts/xmppconfirmhandler.php 42 +- function class_name() { ++ function class_name() ++ { +hunk ./scripts/xmppconfirmhandler.php 47 +- function run() { ++ function run() ++ { hunk ./scripts/xmppconfirmhandler.php 104 -- $confirm->whereAdd('claimed IS NULL'); -- $confirm->whereAdd('sent IS NULL'); -+ $confirm->whereAdd('claimed IS null'); -+ $confirm->whereAdd('sent IS null'); -hunk ./scripts/xmppconfirmhandler.php 125 -- return NULL; -+ return null; -hunk ./scripts/xmppconfirmhandler.php 130 -- $confirm->claimed = NULL; -+ $confirm->claimed = null; +- function next_confirm() { ++ function next_confirm() ++ { +hunk ./scripts/xmppconfirmhandler.php 131 +- function clear_old_confirm_claims() { ++ function clear_old_confirm_claims() ++ { hunk ./scripts/xmppdaemon.php 42 -- function XMPPDaemon($resource=NULL) { -+ function XMPPDaemon($resource=null) { -hunk ./scripts/xmppdaemon.php 74 -- NULL, 'available', 100); -+ null, 'available', 100); -hunk ./scripts/xmppdaemon.php 95 -- $this->conn->presence('Send me a message to post a notice', 'available', NULL, 'available', 100); -+ $this->conn->presence('Send me a message to post a notice', 'available', null, 'available', 100); -hunk ./scripts/xmppdaemon.php 168 -- return NULL; -+ return null; -hunk ./scripts/xmppdaemon.php 173 -- return NULL; -+ return null; -hunk ./scripts/xmppdaemon.php 177 -- return NULL; -+ return null; -hunk ./scripts/xmppdaemon.php 182 -- return NULL; -+ return null; -hunk ./scripts/xmppdaemon.php 186 -- return NULL; -+ return null; -hunk ./scripts/xmppdaemon.php 191 -- return NULL; -+ return null; +- function XMPPDaemon($resource=null) { ++ function XMPPDaemon($resource=null) ++ { +hunk ./scripts/xmppdaemon.php 60 +- function connect() { ++ function connect() ++ { +hunk ./scripts/xmppdaemon.php 80 +- function name() { ++ function name() ++ { +hunk ./scripts/xmppdaemon.php 85 +- function run() { ++ function run() ++ { +hunk ./scripts/xmppdaemon.php 97 +- function handle_reconnect(&$pl) { ++ function handle_reconnect(&$pl) ++ { +hunk ./scripts/xmppdaemon.php 103 +- function get_user($from) { ++ function get_user($from) ++ { +hunk ./scripts/xmppdaemon.php 109 +- function handle_message(&$pl) { ++ function handle_message(&$pl) ++ { +hunk ./scripts/xmppdaemon.php 166 +- function is_self($from) { ++ function is_self($from) ++ { +hunk ./scripts/xmppdaemon.php 171 +- function get_ofrom($pl) { ++ function get_ofrom($pl) ++ { +hunk ./scripts/xmppdaemon.php 206 +- function is_autoreply($txt) { ++ function is_autoreply($txt) ++ { +hunk ./scripts/xmppdaemon.php 215 +- function is_otr($txt) { ++ function is_otr($txt) ++ { +hunk ./scripts/xmppdaemon.php 224 +- function is_direct($txt) { ++ function is_direct($txt) ++ { +hunk ./scripts/xmppdaemon.php 233 +- function from_site($address, $msg) { ++ function from_site($address, $msg) ++ { +hunk ./scripts/xmppdaemon.php 239 +- function handle_command($user, $body) { ++ function handle_command($user, $body) ++ { +hunk ./scripts/xmppdaemon.php 252 +- function add_notice(&$user, &$pl) { ++ function add_notice(&$user, &$pl) ++ { +hunk ./scripts/xmppdaemon.php 275 +- function handle_presence(&$pl) { ++ function handle_presence(&$pl) ++ { +hunk ./scripts/xmppdaemon.php 310 +- function log($level, $msg) { ++ function log($level, $msg) ++ { +hunk ./scripts/xmppdaemon.php 315 +- function subscribed($to) { ++ function subscribed($to) ++ { diff --git a/actions/accesstoken.php b/actions/accesstoken.php index a468c33a6..738ec071f 100644 --- a/actions/accesstoken.php +++ b/actions/accesstoken.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); class AccesstokenAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); try { common_debug('getting request from env variables', __FILE__); diff --git a/actions/all.php b/actions/all.php index 066ee77bf..028a3679a 100644 --- a/actions/all.php +++ b/actions/all.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/actions/showstream.php'); class AllAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -53,7 +54,8 @@ class AllAction extends StreamAction { common_show_footer(); } - function show_header($user) { + function show_header($user) + { common_element('link', array('rel' => 'alternate', 'href' => common_local_url('allrss', array('nickname' => $user->nickname)), @@ -61,7 +63,8 @@ class AllAction extends StreamAction { 'title' => sprintf(_('Feed for friends of %s'), $user->nickname))); } - function show_top($user) { + function show_top($user) + { $cur = common_current_user(); if ($cur && $cur->id == $user->id) { @@ -76,7 +79,8 @@ class AllAction extends StreamAction { 'item' => 'allrss'))); } - function show_notices($user) { + function show_notices($user) + { $page = $this->trimmed('page'); if (!$page) { diff --git a/actions/allrss.php b/actions/allrss.php index 851cd0ad5..9c20cd416 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -27,7 +27,8 @@ class AllrssAction extends Rss10Action { var $user = null; - function init() { + function init() + { $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); @@ -39,7 +40,8 @@ class AllrssAction extends Rss10Action { } } - function get_notices($limit=0) { + function get_notices($limit=0) + { $user = $this->user; @@ -52,7 +54,8 @@ class AllrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { $user = $this->user; $c = array('url' => common_local_url('allrss', array('nickname' => @@ -65,7 +68,8 @@ class AllrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { $user = $this->user; $profile = $user->getProfile(); if (!$profile) { diff --git a/actions/api.php b/actions/api.php index e7646a7bb..8ccd86f0b 100644 --- a/actions/api.php +++ b/actions/api.php @@ -27,7 +27,8 @@ class ApiAction extends Action { var $api_method; var $api_action; - function handle($args) { + function handle($args) + { parent::handle($args); $this->api_action = $this->arg('apiaction'); @@ -79,7 +80,8 @@ class ApiAction extends Action { } } - function process_command() { + function process_command() + { $action = "twitapi$this->api_action"; $actionfile = INSTALLDIR."/actions/$action.php"; @@ -108,7 +110,8 @@ class ApiAction extends Action { } # Whitelist of API methods that don't need authentication - function requires_auth() { + function requires_auth() + { static $noauth = array( 'statuses/public_timeline', 'statuses/show', 'users/show', @@ -144,7 +147,8 @@ class ApiAction extends Action { } } - function show_basic_auth_error() { + function show_basic_auth_error() + { header('HTTP/1.1 401 Unauthorized'); $msg = 'Could not authenticate you.'; @@ -166,7 +170,8 @@ class ApiAction extends Action { } } - function is_readonly() { + function is_readonly() + { # NOTE: before handle(), can't use $this->arg $apiaction = $_REQUEST['apiaction']; $method = $_REQUEST['method']; diff --git a/actions/avatarbynickname.php b/actions/avatarbynickname.php index 2ca861a66..4aeb4112a 100644 --- a/actions/avatarbynickname.php +++ b/actions/avatarbynickname.php @@ -20,7 +20,8 @@ if (!defined('LACONICA')) { exit(1); } class AvatarbynicknameAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); $nickname = $this->trimmed('nickname'); if (!$nickname) { diff --git a/actions/block.php b/actions/block.php index cfcd29848..702adcffa 100644 --- a/actions/block.php +++ b/actions/block.php @@ -23,7 +23,8 @@ class BlockAction extends Action { var $profile = null; - function prepare($args) { + function prepare($args) + { parent::prepare($args); @@ -56,7 +57,8 @@ class BlockAction extends Action { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($this->arg('block')) { @@ -71,7 +73,8 @@ class BlockAction extends Action { } } - function are_you_sure_form() { + function are_you_sure_form() + { $id = $this->profile->id; @@ -109,7 +112,8 @@ class BlockAction extends Action { common_show_footer(); } - function block_profile() { + function block_profile() + { $cur = common_current_user(); diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index 562b70fe9..d926864a6 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class ConfirmaddressAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_set_returnto($this->self_url()); diff --git a/actions/deletenotice.php b/actions/deletenotice.php index 0777918d2..4f00db617 100644 --- a/actions/deletenotice.php +++ b/actions/deletenotice.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/deleteaction.php'); class DeletenoticeAction extends DeleteAction { - function handle($args) { + function handle($args) + { parent::handle($args); # XXX: Ajax! @@ -33,15 +34,18 @@ class DeletenoticeAction extends DeleteAction { } } - function get_instructions() { + function get_instructions() + { return _('You are about to permanently delete a notice. Once this is done, it cannot be undone.'); } - function get_title() { + function get_title() + { return _('Delete notice'); } - function show_form($error=null) { + function show_form($error=null) + { $user = common_current_user(); common_show_header($this->get_title(), array($this, 'show_header'), $error, @@ -67,7 +71,8 @@ class DeletenoticeAction extends DeleteAction { common_show_footer(); } - function delete_notice() { + function delete_notice() + { # CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { diff --git a/actions/deleteprofile.php b/actions/deleteprofile.php index 503b3666d..b1c346cb2 100644 --- a/actions/deleteprofile.php +++ b/actions/deleteprofile.php @@ -20,7 +20,8 @@ if (!defined('LACONICA')) { exit(1); } class DeleteprofileAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); $this->server_error(_('Code not yet ready.')); return; @@ -32,18 +33,21 @@ class DeleteprofileAction extends Action { } } - function get_instructions() { + function get_instructions() + { return _('Export and delete your user information.'); } - function form_header($title, $msg=null, $success=false) { + function form_header($title, $msg=null, $success=false) + { common_show_header($title, null, array($msg, $success), array($this, 'show_top')); } - function show_feeds_list($feeds) { + function show_feeds_list($feeds) + { common_element_start('div', array('class' => 'feedsdel')); common_element('p', null, 'Feeds:'); common_element_start('ul', array('class' => 'xoxo')); @@ -56,7 +60,8 @@ class DeleteprofileAction extends Action { } //TODO move to common.php (and retrace its origin) - function common_feed_item($feed) { + function common_feed_item($feed) + { $user = common_current_user(); $nickname = $user->nickname; @@ -84,14 +89,16 @@ class DeleteprofileAction extends Action { common_element_end('li'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $this->form_header(_('Delete my account'), $msg, $success); common_element('h2', null, _('Delete my account confirmation')); $this->show_confirm_delete_form(); common_show_footer(); } - function show_confirm_delete_form() { + function show_confirm_delete_form() + { $user = common_current_user(); $notices = DB_DataObject::factory('notice'); $notices->profile_id = $user->id; @@ -120,7 +127,8 @@ class DeleteprofileAction extends Action { common_element_end('form'); } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -134,7 +142,8 @@ class DeleteprofileAction extends Action { $this->show_form(); } - function delete_account() { + function delete_account() + { $user = common_current_user(); assert(!is_null($user)); # should already be checked @@ -219,7 +228,8 @@ class DeleteprofileAction extends Action { common_redirect(common_local_url('public')); } - function show_top($arr) { + function show_top($arr) + { $msg = $arr[0]; $success = $arr[1]; if ($msg) { @@ -234,7 +244,8 @@ class DeleteprofileAction extends Action { $this->settings_menu(); } - function settings_menu() { + function settings_menu() + { # action => array('prompt', 'title') $menu = array('profilesettings' => diff --git a/actions/disfavor.php b/actions/disfavor.php index e47e68a8c..f0b528453 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class DisfavorAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); diff --git a/actions/doc.php b/actions/doc.php index 0cf665d68..441ac19a7 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class DocAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); $title = $this->trimmed('title'); $filename = INSTALLDIR.'/doc/'.$title; diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 06b3ef29f..3dcf7716f 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); class EmailsettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('Manage how you get email from %%site.name%%.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); $this->form_header(_('Email Settings'), $msg, $success); common_element_start('form', array('method' => 'post', @@ -110,7 +112,8 @@ class EmailsettingsAction extends SettingsAction { common_show_footer(); } - function get_confirmation() { + function get_confirmation() + { $user = common_current_user(); $confirm = new Confirm_address(); $confirm->user_id = $user->id; @@ -122,7 +125,8 @@ class EmailsettingsAction extends SettingsAction { } } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); @@ -148,7 +152,8 @@ class EmailsettingsAction extends SettingsAction { } } - function save_preferences() { + function save_preferences() + { $emailnotifysub = $this->boolean('emailnotifysub'); $emailnotifyfav = $this->boolean('emailnotifyfav'); @@ -185,7 +190,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form(_('Preferences saved.'), true); } - function add_address() { + function add_address() + { $user = common_current_user(); @@ -236,7 +242,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form($msg, TRUE); } - function cancel_confirmation() { + function cancel_confirmation() + { $email = $this->arg('email'); $confirm = $this->get_confirmation(); if (!$confirm) { @@ -259,7 +266,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form(_('Confirmation cancelled.'), TRUE); } - function remove_address() { + function remove_address() + { $user = common_current_user(); $email = $this->arg('email'); @@ -285,7 +293,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form(_('The address was removed.'), TRUE); } - function remove_incoming() { + function remove_incoming() + { $user = common_current_user(); if (!$user->incomingemail) { @@ -304,7 +313,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form(_('Incoming email address removed.'), TRUE); } - function new_incoming() { + function new_incoming() + { $user = common_current_user(); $orig = clone($user); @@ -318,7 +328,8 @@ class EmailsettingsAction extends SettingsAction { $this->show_form(_('New incoming email address added.'), TRUE); } - function email_exists($email) { + function email_exists($email) + { $user = common_current_user(); $other = User::staticGet('email', $email); if (!$other) { diff --git a/actions/facebookhome.php b/actions/facebookhome.php index c964f451a..006f35eca 100644 --- a/actions/facebookhome.php +++ b/actions/facebookhome.php @@ -23,13 +23,15 @@ require_once(INSTALLDIR.'/lib/facebookaction.php'); class FacebookhomeAction extends FacebookAction { - function handle($args) { + function handle($args) + { parent::handle($args); $this->login(); } - function login() { + function login() + { $user = null; @@ -89,7 +91,8 @@ class FacebookhomeAction extends FacebookAction { } - function show_home($facebook, $fbuid, $user) { + function show_home($facebook, $fbuid, $user) + { $this->show_header('Home'); @@ -99,7 +102,8 @@ class FacebookhomeAction extends FacebookAction { $this->show_footer(); } - function show_notices($user) { + function show_notices($user) + { $page = $this->trimmed('page'); if (!$page) { diff --git a/actions/facebookinvite.php b/actions/facebookinvite.php index 3a85a7c5c..fc226e65a 100644 --- a/actions/facebookinvite.php +++ b/actions/facebookinvite.php @@ -23,13 +23,15 @@ require_once(INSTALLDIR.'/lib/facebookaction.php'); class FacebookinviteAction extends FacebookAction { - function handle($args) { + function handle($args) + { parent::handle($args); $this->display(); } - function display() { + function display() + { $facebook = $this->get_facebook(); diff --git a/actions/facebookremove.php b/actions/facebookremove.php index 1215f6622..79dc32e49 100644 --- a/actions/facebookremove.php +++ b/actions/facebookremove.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/facebookaction.php'); class FacebookremoveAction extends FacebookAction { - function handle($args) { + function handle($args) + { parent::handle($args); $secret = common_config('facebook', 'secret'); diff --git a/actions/facebooksettings.php b/actions/facebooksettings.php index a5ad9d07a..03ad57813 100644 --- a/actions/facebooksettings.php +++ b/actions/facebooksettings.php @@ -23,13 +23,15 @@ require_once(INSTALLDIR.'/lib/facebookaction.php'); class FacebooksettingsAction extends FacebookAction { - function handle($args) { + function handle($args) + { parent::handle($args); $this->display(); } - function display() { + function display() + { $facebook = $this->get_facebook(); diff --git a/actions/favor.php b/actions/favor.php index c0b0324b5..3ec4af0b5 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/mail.php'); class FavorAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { @@ -80,7 +81,8 @@ class FavorAction extends Action { } } - function notify($fave, $notice, $user) { + function notify($fave, $notice, $user) + { $other = User::staticGet('id', $notice->profile_id); if ($other && $other->id != $user->id) { if ($other->email && $other->emailnotifyfav) { diff --git a/actions/favorited.php b/actions/favorited.php index e69630d50..d479e1b3e 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/stream.php'); class FavoritedAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -37,7 +38,8 @@ class FavoritedAction extends StreamAction { common_show_footer(); } - function show_top() { + function show_top() + { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); common_element_start('div', 'instructions'); @@ -46,15 +48,18 @@ class FavoritedAction extends StreamAction { $this->public_views_menu(); } - function show_header() { + function show_header() + { return; } - function get_instructions() { + function get_instructions() + { return _('Showing recently popular notices'); } - function show_notices($page) { + function show_notices($page) + { $qry = 'SELECT notice.*, sum(exp(-(now() - fave.modified) / %s)) as weight ' . 'FROM notice JOIN fave ON notice.id = fave.notice_id ' . diff --git a/actions/favoritesrss.php b/actions/favoritesrss.php index 7071812d7..aa8a3c6f4 100644 --- a/actions/favoritesrss.php +++ b/actions/favoritesrss.php @@ -27,7 +27,8 @@ class FavoritesrssAction extends Rss10Action { var $user = null; - function init() { + function init() + { $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); @@ -39,7 +40,8 @@ class FavoritesrssAction extends Rss10Action { } } - function get_notices($limit=0) { + function get_notices($limit=0) + { $user = $this->user; @@ -54,7 +56,8 @@ class FavoritesrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { $user = $this->user; $c = array('url' => common_local_url('favoritesrss', array('nickname' => @@ -67,7 +70,8 @@ class FavoritesrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { return null; } } \ No newline at end of file diff --git a/actions/featured.php b/actions/featured.php index f478a4017..1763adeab 100644 --- a/actions/featured.php +++ b/actions/featured.php @@ -24,7 +24,8 @@ require_once(INSTALLDIR.'/lib/profilelist.php'); class FeaturedAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -38,7 +39,8 @@ class FeaturedAction extends StreamAction { common_show_footer(); } - function show_top() { + function show_top() + { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); common_element_start('div', 'instructions'); @@ -47,14 +49,17 @@ class FeaturedAction extends StreamAction { $this->public_views_menu(); } - function show_header() { + function show_header() + { } - function get_instructions() { + function get_instructions() + { return _('Featured users'); } - function show_notices($page) { + function show_notices($page) + { // XXX: Note I'm doing it this two-stage way because a raw query // with a JOIN was *not* working. --Zach diff --git a/actions/finishaddopenid.php b/actions/finishaddopenid.php index 7607688de..d8409b6e9 100644 --- a/actions/finishaddopenid.php +++ b/actions/finishaddopenid.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); class FinishaddopenidAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_user_error(_('Not logged in.')); @@ -32,7 +33,8 @@ class FinishaddopenidAction extends Action { } } - function try_login() { + function try_login() + { $consumer =& oid_consumer(); @@ -95,7 +97,8 @@ class FinishaddopenidAction extends Action { } } - function message($msg) { + function message($msg) + { common_show_header(_('OpenID Login')); common_element('p', null, $msg); common_show_footer(); diff --git a/actions/finishimmediate.php b/actions/finishimmediate.php index ea711f5c5..c4a1c1af9 100644 --- a/actions/finishimmediate.php +++ b/actions/finishimmediate.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); class FinishimmediateAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); $consumer = oid_consumer(); @@ -53,7 +54,8 @@ class FinishimmediateAction extends Action { return; } - function go_backto() { + function go_backto() + { common_ensure_session(); $backto = $_SESSION['openid_immediate_backto']; if (!$backto) { diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index ae5b136a2..eb52d73b1 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); class FinishopenidloginAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (common_logged_in()) { common_user_error(_('Already logged in.')); @@ -52,7 +53,8 @@ class FinishopenidloginAction extends Action { } } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('div', array('class' => 'error'), $error); } else { @@ -62,7 +64,8 @@ class FinishopenidloginAction extends Action { } } - function show_form($error=null, $username=null) { + function show_form($error=null, $username=null) + { common_show_header(_('OpenID Account Setup'), null, $error, array($this, 'show_top')); @@ -99,7 +102,8 @@ class FinishopenidloginAction extends Action { common_show_footer(); } - function try_login() { + function try_login() + { $consumer = oid_consumer(); @@ -146,26 +150,30 @@ class FinishopenidloginAction extends Action { } } - function message($msg) { + function message($msg) + { common_show_header(_('OpenID Login')); common_element('p', null, $msg); common_show_footer(); } - function save_values($display, $canonical, $sreg) { + function save_values($display, $canonical, $sreg) + { common_ensure_session(); $_SESSION['openid_display'] = $display; $_SESSION['openid_canonical'] = $canonical; $_SESSION['openid_sreg'] = $sreg; } - function get_saved_values() { + function get_saved_values() + { return array($_SESSION['openid_display'], $_SESSION['openid_canonical'], $_SESSION['openid_sreg']); } - function create_new_user() { + function create_new_user() + { # FIXME: save invite code before redirect, and check here @@ -247,7 +255,8 @@ class FinishopenidloginAction extends Action { common_redirect(common_local_url('showstream', array('nickname' => $user->nickname))); } - function connect_user() { + function connect_user() + { $nickname = $this->trimmed('nickname'); $password = $this->trimmed('password'); @@ -286,7 +295,8 @@ class FinishopenidloginAction extends Action { $this->go_home($user->nickname); } - function go_home($nickname) { + function go_home($nickname) + { $url = common_get_returnto(); if ($url) { # We don't have to return to it again @@ -299,7 +309,8 @@ class FinishopenidloginAction extends Action { common_redirect($url); } - function best_new_nickname($display, $sreg) { + function best_new_nickname($display, $sreg) + { # Try the passed-in nickname @@ -332,7 +343,8 @@ class FinishopenidloginAction extends Action { return null; } - function is_new_nickname($str) { + function is_new_nickname($str) + { if (!Validate::string($str, array('min_length' => 1, 'max_length' => 64, 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { @@ -347,7 +359,8 @@ class FinishopenidloginAction extends Action { return true; } - function openid_to_nickname($openid) { + function openid_to_nickname($openid) + { if (Auth_Yadis_identifierScheme($openid) == 'XRI') { return $this->xri_to_nickname($openid); } else { @@ -360,7 +373,8 @@ class FinishopenidloginAction extends Action { # 2. One element in path, like http://profile.typekey.com/EvanProdromou/ # or http://getopenid.com/evanprodromou - function url_to_nickname($openid) { + function url_to_nickname($openid) + { static $bad = array('query', 'user', 'password', 'port', 'fragment'); $parts = parse_url($openid); @@ -406,7 +420,8 @@ class FinishopenidloginAction extends Action { return null; } - function xri_to_nickname($xri) { + function xri_to_nickname($xri) + { $base = $this->xri_base($xri); if (!$base) { @@ -419,7 +434,8 @@ class FinishopenidloginAction extends Action { } } - function xri_base($xri) { + function xri_base($xri) + { if (substr($xri, 0, 6) == 'xri://') { return substr($xri, 6); } else { @@ -429,7 +445,8 @@ class FinishopenidloginAction extends Action { # Given a string, try to make it work as a nickname - function nicknamize($str) { + function nicknamize($str) + { $str = preg_replace('/\W/', '', $str); return strtolower($str); } diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php index edd4ae541..38a56c962 100644 --- a/actions/finishremotesubscribe.php +++ b/actions/finishremotesubscribe.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/omb.php'); class FinishremotesubscribeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -231,13 +232,15 @@ class FinishremotesubscribeAction extends Action { $user->nickname))); } - function add_avatar($profile, $url) { + function add_avatar($profile, $url) + { $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar'); copy($url, $temp_filename); return $profile->setOriginal($temp_filename); } - function access_token($omb) { + function access_token($omb) + { common_debug('starting request for access token', __FILE__); diff --git a/actions/foaf.php b/actions/foaf.php index 218e20f5f..893e2a861 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -25,11 +25,13 @@ define('BOTH', 0); class FoafAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); $nickname = $this->trimmed('nickname'); @@ -179,14 +181,16 @@ class FoafAction extends Action { common_element_end('rdf:RDF'); } - function show_ppd($foaf_url, $person_uri) { + function show_ppd($foaf_url, $person_uri) + { common_element_start('PersonalProfileDocument', array('rdf:about' => $foaf_url)); common_element('maker', array('rdf:resource' => $person_uri)); common_element('primaryTopic', array('rdf:resource' => $person_uri)); common_element_end('PersonalProfileDocument'); } - function show_microblogging_account($profile, $service=null) { + function show_microblogging_account($profile, $service=null) + { # Their account common_element_start('holdsAccount'); common_element_start('OnlineAccount'); diff --git a/actions/imsettings.php b/actions/imsettings.php index 8f546f8e7..cccd5db49 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -24,11 +24,13 @@ require_once(INSTALLDIR.'/lib/jabber.php'); class ImsettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('You can send and receive notices through Jabber/GTalk [instant messages](%%doc.im%%). Configure your address and settings below.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); $this->form_header(_('IM Settings'), $msg, $success); common_element_start('form', array('method' => 'post', @@ -85,7 +87,8 @@ class ImsettingsAction extends SettingsAction { common_show_footer(); } - function get_confirmation() { + function get_confirmation() + { $user = common_current_user(); $confirm = new Confirm_address(); $confirm->user_id = $user->id; @@ -97,7 +100,8 @@ class ImsettingsAction extends SettingsAction { } } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); @@ -119,7 +123,8 @@ class ImsettingsAction extends SettingsAction { } } - function save_preferences() { + function save_preferences() + { $jabbernotify = $this->boolean('jabbernotify'); $updatefrompresence = $this->boolean('updatefrompresence'); @@ -152,7 +157,8 @@ class ImsettingsAction extends SettingsAction { $this->show_form(_('Preferences saved.'), true); } - function add_address() { + function add_address() + { $user = common_current_user(); @@ -207,7 +213,8 @@ class ImsettingsAction extends SettingsAction { $this->show_form($msg, TRUE); } - function cancel_confirmation() { + function cancel_confirmation() + { $jabber = $this->arg('jabber'); $confirm = $this->get_confirmation(); if (!$confirm) { @@ -230,7 +237,8 @@ class ImsettingsAction extends SettingsAction { $this->show_form(_('Confirmation cancelled.'), TRUE); } - function remove_address() { + function remove_address() + { $user = common_current_user(); $jabber = $this->arg('jabber'); @@ -258,7 +266,8 @@ class ImsettingsAction extends SettingsAction { $this->show_form(_('The address was removed.'), TRUE); } - function jabber_exists($jabber) { + function jabber_exists($jabber) + { $user = common_current_user(); $other = User::staticGet('jabber', $jabber); if (!$other) { diff --git a/actions/invite.php b/actions/invite.php index feef94d0f..b0fc79958 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -21,11 +21,13 @@ if (!defined('LACONICA')) { exit(1); } class InviteAction extends Action { - function is_readonly() { + function is_readonly() + { return false; } - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { $this->client_error(sprintf(_('You must be logged in to invite other users to use %s'), @@ -38,7 +40,8 @@ class InviteAction extends Action { } } - function send_invitations() { + function send_invitations() + { # CSRF protection $token = $this->trimmed('token'); @@ -112,7 +115,8 @@ class InviteAction extends Action { common_show_footer(); } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('p', 'error', $error); } else { @@ -123,7 +127,8 @@ class InviteAction extends Action { } } - function show_form($error=null) { + function show_form($error=null) + { global $config; @@ -149,7 +154,8 @@ class InviteAction extends Action { common_show_footer(); } - function send_invitation($email, $user, $personal) { + function send_invitation($email, $user, $personal) + { $profile = $user->getProfile(); $bestname = $profile->getBestName(); diff --git a/actions/login.php b/actions/login.php index f3509519e..6ad07b610 100644 --- a/actions/login.php +++ b/actions/login.php @@ -21,11 +21,13 @@ if (!defined('LACONICA')) { exit(1); } class LoginAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); if (common_is_real_login()) { common_user_error(_('Already logged in.')); @@ -36,7 +38,8 @@ class LoginAction extends Action { } } - function check_login() { + function check_login() + { # XXX: login throttle # CSRF protection - token set in common_notice_form() @@ -100,7 +103,8 @@ class LoginAction extends Action { common_redirect($url); } - function show_form($error=null) { + function show_form($error=null) + { common_show_header(_('Login'), null, $error, array($this, 'show_top')); common_element_start('form', array('method' => 'post', 'id' => 'login', @@ -120,7 +124,8 @@ class LoginAction extends Action { common_show_footer(); } - function get_instructions() { + function get_instructions() + { if (common_logged_in() && !common_is_real_login() && common_get_returnto()) @@ -138,7 +143,8 @@ class LoginAction extends Action { } } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('p', 'error', $error); } else { diff --git a/actions/logout.php b/actions/logout.php index 4c59e47ad..effb5abbe 100644 --- a/actions/logout.php +++ b/actions/logout.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/openid.php'); class LogoutAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_user_error(_('Not logged in.')); diff --git a/actions/microsummary.php b/actions/microsummary.php index ced4b0d1e..a19a26dcf 100644 --- a/actions/microsummary.php +++ b/actions/microsummary.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class MicrosummaryAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); diff --git a/actions/newmessage.php b/actions/newmessage.php index eb582c2a5..0a537ad2d 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class NewmessageAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { @@ -33,7 +34,8 @@ class NewmessageAction extends Action { } } - function save_new_message() { + function save_new_message() + { $user = common_current_user(); assert($user); # XXX: maybe an error instead... @@ -89,7 +91,8 @@ class NewmessageAction extends Action { common_redirect($url, 303); } - function show_top($params) { + function show_top($params) + { list($content, $user, $to) = $params; @@ -98,7 +101,8 @@ class NewmessageAction extends Action { common_message_form($content, $user, $to); } - function show_form($msg=null) { + function show_form($msg=null) + { $content = $this->trimmed('content'); $user = common_current_user(); @@ -128,7 +132,8 @@ class NewmessageAction extends Action { common_show_footer(); } - function notify($from, $to, $message) { + function notify($from, $to, $message) + { mail_notify_message($message, $from, $to); # XXX: Jabber, SMS notifications... probably queued } diff --git a/actions/newnotice.php b/actions/newnotice.php index 98556c36b..1f6117c1e 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -23,7 +23,8 @@ require_once INSTALLDIR . '/lib/noticelist.php'; class NewnoticeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { @@ -43,7 +44,8 @@ class NewnoticeAction extends Action { } } - function save_new_notice() { + function save_new_notice() + { $user = common_current_user(); assert($user); # XXX: maybe an error instead... @@ -110,7 +112,8 @@ class NewnoticeAction extends Action { } } - function ajax_error_msg($msg) { + function ajax_error_msg($msg) + { common_start_html('text/xml;charset=utf-8', true); common_element_start('head'); common_element('title', null, _('Ajax Error')); @@ -121,11 +124,13 @@ class NewnoticeAction extends Action { common_element_end('html'); } - function show_top($content=null) { + function show_top($content=null) + { common_notice_form(null, $content); } - function show_form($msg=null) { + function show_form($msg=null) + { if ($msg && $this->boolean('ajax')) { $this->ajax_error_msg($msg); return; @@ -146,7 +151,8 @@ class NewnoticeAction extends Action { common_show_footer(); } - function show_notice($notice) { + function show_notice($notice) + { $nli = new NoticeListItem($notice); $nli->show(); } diff --git a/actions/noticesearch.php b/actions/noticesearch.php index 53d78e199..782c8fe98 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -25,15 +25,18 @@ require_once(INSTALLDIR.'/lib/searchaction.php'); class NoticesearchAction extends SearchAction { - function get_instructions() { + function get_instructions() + { return _('Search for notices on %%site.name%% by their contents. Separate search terms by spaces; they must be 3 characters or more.'); } - function get_title() { + function get_title() + { return _('Text search'); } - function show_results($q, $page) { + function show_results($q, $page) + { $notice = new Notice(); @@ -72,7 +75,8 @@ class NoticesearchAction extends SearchAction { $page, 'noticesearch', array('q' => $q)); } - function show_header($arr) { + function show_header($arr) + { if ($arr) { $q = $arr[0]; } @@ -87,7 +91,8 @@ class NoticesearchAction extends SearchAction { # XXX: refactor and combine with StreamAction::show_notice() - function show_notice($notice, $terms) { + function show_notice($notice, $terms) + { $profile = $notice->getProfile(); if (!$profile) { common_log_db_error($notice, 'SELECT', __FILE__); @@ -149,7 +154,8 @@ class NoticesearchAction extends SearchAction { common_element_end('li'); } - function highlight($text, $terms) { + function highlight($text, $terms) + { /* Highligh serach terms */ $pattern = '/('.implode('|',array_map('htmlspecialchars', $terms)).')/i'; $result = preg_replace($pattern, '\\1', $text); diff --git a/actions/noticesearchrss.php b/actions/noticesearchrss.php index d61234df8..c41d34873 100644 --- a/actions/noticesearchrss.php +++ b/actions/noticesearchrss.php @@ -25,11 +25,13 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); class NoticesearchrssAction extends Rss10Action { - function init() { + function init() + { return true; } - function get_notices($limit=0) { + function get_notices($limit=0) + { $q = $this->trimmed('q'); $notices = array(); @@ -54,7 +56,8 @@ class NoticesearchrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { global $config; $q = $this->trimmed('q'); $c = array('url' => common_local_url('noticesearchrss', array('q' => $q)), @@ -64,7 +67,8 @@ class NoticesearchrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { return null; } } diff --git a/actions/nudge.php b/actions/nudge.php index 6f3b4c95c..e0268e9d0 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/mail.php'); class NudgeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { @@ -71,7 +72,8 @@ class NudgeAction extends Action { } } - function notify($user, $other) { + function notify($user, $other) + { if ($other->id != $user->id) { if ($other->email && $other->emailnotifynudge) { mail_notify_nudge($user, $other); diff --git a/actions/openidlogin.php b/actions/openidlogin.php index 1bf37f28f..b8681215e 100644 --- a/actions/openidlogin.php +++ b/actions/openidlogin.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); class OpenidloginAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (common_logged_in()) { common_user_error(_('Already logged in.')); @@ -56,11 +57,13 @@ class OpenidloginAction extends Action { } } - function get_instructions() { + function get_instructions() + { return _('Login with an [OpenID](%%doc.openid%%) account.'); } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('div', array('class' => 'error'), $error); } else { @@ -72,7 +75,8 @@ class OpenidloginAction extends Action { } } - function show_form($error=null, $openid_url) { + function show_form($error=null, $openid_url) + { common_show_header(_('OpenID Login'), null, $error, array($this, 'show_top')); $formaction = common_local_url('openidlogin'); common_element_start('form', array('method' => 'post', diff --git a/actions/openidsettings.php b/actions/openidsettings.php index 9c0eda6f0..ce4143d41 100644 --- a/actions/openidsettings.php +++ b/actions/openidsettings.php @@ -24,13 +24,15 @@ require_once(INSTALLDIR.'/lib/openid.php'); class OpenidsettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('[OpenID](%%doc.openid%%) lets you log into many sites ' . ' with the same user account. '. ' Manage your associated OpenIDs from here.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); @@ -116,7 +118,8 @@ class OpenidsettingsAction extends SettingsAction { common_show_footer(); } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -136,7 +139,8 @@ class OpenidsettingsAction extends SettingsAction { } } - function remove_openid() { + function remove_openid() + { $openid_url = $this->trimmed('openid_url'); $oid = User_openid::staticGet('canonical', $openid_url); diff --git a/actions/opensearch.php b/actions/opensearch.php index dcde160a4..f9c6f4c57 100644 --- a/actions/opensearch.php +++ b/actions/opensearch.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class OpensearchAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); diff --git a/actions/othersettings.php b/actions/othersettings.php index 1da6577cb..0c1418387 100644 --- a/actions/othersettings.php +++ b/actions/othersettings.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); class OthersettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('Manage various other options.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); $this->form_header(_('Other Settings'), $msg, $success); @@ -63,7 +65,8 @@ class OthersettingsAction extends SettingsAction { common_show_footer(); } - function show_feeds_list($feeds) { + function show_feeds_list($feeds) + { common_element_start('div', array('class' => 'feedsdel')); common_element('p', null, 'Feeds:'); common_element_start('ul', array('class' => 'xoxo')); @@ -76,7 +79,8 @@ class OthersettingsAction extends SettingsAction { } //TODO move to common.php (and retrace its origin) - function common_feed_item($feed) { + function common_feed_item($feed) + { $user = common_current_user(); $nickname = $user->nickname; @@ -131,7 +135,8 @@ class OthersettingsAction extends SettingsAction { // common_element_end('form'); // } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); @@ -147,7 +152,8 @@ class OthersettingsAction extends SettingsAction { } } - function save_preferences() { + function save_preferences() + { $urlshorteningservice = $this->trimmed('urlshorteningservice'); diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index a52ac317f..6d3f6a73f 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -24,16 +24,19 @@ require_once(INSTALLDIR.'/lib/profilelist.php'); class PeoplesearchAction extends SearchAction { - function get_instructions() { + function get_instructions() + { return _('Search for people on %%site.name%% by their name, location, or interests. ' . 'Separate the terms by spaces; they must be 3 characters or more.'); } - function get_title() { + function get_title() + { return _('People search'); } - function show_results($q, $page) { + function show_results($q, $page) + { $profile = new Profile(); @@ -71,14 +74,16 @@ class PeopleSearchResults extends ProfileList { var $terms = null; var $pattern = null; - function __construct($profile, $terms) { + function __construct($profile, $terms) + { parent::__construct($profile); $this->terms = array_map('preg_quote', array_map('htmlspecialchars', $terms)); $this->pattern = '/('.implode('|',$terms).')/i'; } - function highlight($text) { + function highlight($text) + { return preg_replace($this->pattern, '\\1', htmlspecialchars($text)); } } diff --git a/actions/peopletag.php b/actions/peopletag.php index 0327ecbc2..c7e463026 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/profilelist.php'); class PeopletagAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -50,7 +51,8 @@ class PeopletagAction extends Action { common_show_footer(); } - function show_people($tag, $page) { + function show_people($tag, $page) + { $profile = new Profile(); @@ -83,7 +85,8 @@ class PeopletagAction extends Action { array('tag' => $tag)); } - function show_top($tag) { + function show_top($tag) + { $instr = sprintf(_('These are users who have tagged themselves "%s" ' . 'to show a common interest, characteristic, hobby or job.'), $tag); common_element_start('div', 'instructions'); @@ -93,11 +96,13 @@ class PeopletagAction extends Action { common_element_end('div'); } - function get_title() { + function get_title() + { return null; } - function show_header($arr) { + function show_header($arr) + { return; } } diff --git a/actions/postnotice.php b/actions/postnotice.php index 66e4dc806..8b0781dfd 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); class PostnoticeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); try { common_remove_magic_from_request(); @@ -39,7 +40,8 @@ class PostnoticeAction extends Action { } } - function save_notice(&$req, &$consumer, &$token) { + function save_notice(&$req, &$consumer, &$token) + { $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { common_user_error(_('Unsupported OMB version'), 400); diff --git a/actions/profilesettings.php b/actions/profilesettings.php index 0fa1288dc..7f7ee17a5 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -23,12 +23,14 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); class ProfilesettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('You can update your personal profile info here '. 'so people know more about you.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $this->form_header(_('Profile settings'), $msg, $success); $this->show_settings_form(); common_element('h2', null, _('Avatar')); @@ -40,7 +42,8 @@ class ProfilesettingsAction extends SettingsAction { common_show_footer(); } - function handle_post() { + function handle_post() + { # CSRF protection @@ -60,7 +63,8 @@ class ProfilesettingsAction extends SettingsAction { } - function show_settings_form() { + function show_settings_form() + { $user = common_current_user(); $profile = $user->getProfile(); @@ -110,7 +114,8 @@ class ProfilesettingsAction extends SettingsAction { } - function show_avatar_form() { + function show_avatar_form() + { $user = common_current_user(); $profile = $user->getProfile(); @@ -168,7 +173,8 @@ class ProfilesettingsAction extends SettingsAction { } - function show_password_form() { + function show_password_form() + { $user = common_current_user(); common_element_start('form', array('method' => 'POST', @@ -190,7 +196,8 @@ class ProfilesettingsAction extends SettingsAction { common_element_end('form'); } - function save_profile() { + function save_profile() + { $nickname = $this->trimmed('nickname'); $fullname = $this->trimmed('fullname'); $homepage = $this->trimmed('homepage'); @@ -337,7 +344,8 @@ class ProfilesettingsAction extends SettingsAction { } - function upload_avatar() { + function upload_avatar() + { switch ($_FILES['avatarfile']['error']) { case UPLOAD_ERR_OK: # success, jump out break; @@ -384,7 +392,8 @@ class ProfilesettingsAction extends SettingsAction { @unlink($_FILES['avatarfile']['tmp_name']); } - function nickname_exists($nickname) { + function nickname_exists($nickname) + { $user = common_current_user(); $other = User::staticGet('nickname', $nickname); if (!$other) { @@ -394,7 +403,8 @@ class ProfilesettingsAction extends SettingsAction { } } - function change_password() { + function change_password() + { $user = common_current_user(); assert(!is_null($user)); # should already be checked diff --git a/actions/public.php b/actions/public.php index 60238e54d..62be3da99 100644 --- a/actions/public.php +++ b/actions/public.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/stream.php'); class PublicAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -41,7 +42,8 @@ class PublicAction extends StreamAction { common_show_footer(); } - function show_top() { + function show_top() + { if (common_logged_in()) { common_notice_form('public'); } else { @@ -64,13 +66,15 @@ class PublicAction extends StreamAction { 'item' => 'publicatom'))); } - function get_instructions() { + function get_instructions() + { return _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ([Read more](%%doc.help%%))'); } - function show_header() { + function show_header() + { common_element('link', array('rel' => 'alternate', 'href' => common_local_url('publicrss'), 'type' => 'application/rss+xml', @@ -80,7 +84,8 @@ class PublicAction extends StreamAction { 'content' => common_local_url('publicxrds'))); } - function show_notices($page) { + function show_notices($page) + { $cnt = 0; $notice = Notice::publicStream(($page-1)*NOTICES_PER_PAGE, diff --git a/actions/publicrss.php b/actions/publicrss.php index 764f0fae2..8e554122e 100644 --- a/actions/publicrss.php +++ b/actions/publicrss.php @@ -25,11 +25,13 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); class PublicrssAction extends Rss10Action { - function init() { + function init() + { return true; } - function get_notices($limit=0) { + function get_notices($limit=0) + { $notices = array(); @@ -42,7 +44,8 @@ class PublicrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { global $config; $c = array('url' => common_local_url('publicrss'), 'title' => sprintf(_('%s Public Stream'), $config['site']['name']), @@ -51,7 +54,8 @@ class PublicrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { return null; } } \ No newline at end of file diff --git a/actions/publicxrds.php b/actions/publicxrds.php index 5e3349185..63c80d81e 100644 --- a/actions/publicxrds.php +++ b/actions/publicxrds.php @@ -25,11 +25,13 @@ require_once(INSTALLDIR.'/lib/openid.php'); class PublicxrdsAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); @@ -55,7 +57,8 @@ class PublicxrdsAction extends Action { common_end_xml(); } - function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { + function show_service($type, $uri, $params=null, $sigs=null, $localId=null) + { common_element_start('Service'); if ($uri) { common_element('URI', null, $uri); diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php index 068d582fa..a482d4711 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -25,7 +25,8 @@ define(MAX_RECOVERY_TIME, 24 * 60 * 60); class RecoverpasswordAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (common_logged_in()) { $this->client_error(_('You are already logged in!')); @@ -47,7 +48,8 @@ class RecoverpasswordAction extends Action { } } - function check_code() { + function check_code() + { $code = $this->trimmed('code'); $confirm = Confirm_address::staticGet('code', $code); @@ -113,12 +115,14 @@ class RecoverpasswordAction extends Action { $this->show_password_form(); } - function set_temp_user(&$user) { + function set_temp_user(&$user) + { common_ensure_session(); $_SESSION['tempuser'] = $user->id; } - function get_temp_user() { + function get_temp_user() + { common_ensure_session(); $user_id = $_SESSION['tempuser']; if ($user_id) { @@ -127,12 +131,14 @@ class RecoverpasswordAction extends Action { return $user; } - function clear_temp_user() { + function clear_temp_user() + { common_ensure_session(); unset($_SESSION['tempuser']); } - function show_top($msg=null) { + function show_top($msg=null) + { if ($msg) { common_element('div', 'error', $msg); } else { @@ -146,7 +152,8 @@ class RecoverpasswordAction extends Action { } } - function show_password_top($msg=null) { + function show_password_top($msg=null) + { if ($msg) { common_element('div', 'error', $msg); } else { @@ -156,7 +163,8 @@ class RecoverpasswordAction extends Action { } } - function show_form($msg=null) { + function show_form($msg=null) + { common_show_header(_('Recover password'), null, $msg, array($this, 'show_top')); @@ -173,7 +181,8 @@ class RecoverpasswordAction extends Action { common_show_footer(); } - function show_password_form($msg=null) { + function show_password_form($msg=null) + { common_show_header(_('Reset password'), null, $msg, array($this, 'show_password_top')); @@ -191,7 +200,8 @@ class RecoverpasswordAction extends Action { common_show_footer(); } - function recover_password() { + function recover_password() + { $nore = $this->trimmed('nicknameoremail'); if (!$nore) { $this->show_form(_('Enter a nickname or email address.')); @@ -274,7 +284,8 @@ class RecoverpasswordAction extends Action { common_show_footer(); } - function reset_password() { + function reset_password() + { # CSRF protection $token = $this->trimmed('token'); diff --git a/actions/register.php b/actions/register.php index f3eaf6122..444e67e35 100644 --- a/actions/register.php +++ b/actions/register.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class RegisterAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (common_config('site', 'closed')) { @@ -35,7 +36,8 @@ class RegisterAction extends Action { } } - function try_register() { + function try_register() + { $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -133,14 +135,16 @@ class RegisterAction extends Action { # checks if *CANONICAL* nickname exists - function nickname_exists($nickname) { + function nickname_exists($nickname) + { $user = User::staticGet('nickname', $nickname); return ($user !== false); } # checks if *CANONICAL* email exists - function email_exists($email) { + function email_exists($email) + { $email = common_canonical_email($email); if (!$email || strlen($email) == 0) { return false; @@ -149,7 +153,8 @@ class RegisterAction extends Action { return ($user !== false); } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('p', 'error', $error); } else { @@ -164,7 +169,8 @@ class RegisterAction extends Action { } } - function show_form($error=null) { + function show_form($error=null) + { global $config; $code = $this->trimmed('code'); @@ -236,7 +242,8 @@ class RegisterAction extends Action { common_show_footer(); } - function show_success() { + function show_success() + { $nickname = $this->arg('nickname'); common_show_header(_('Registration successful')); common_element_start('div', 'success'); diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index be2cb1025..02c026849 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/omb.php'); class RemotesubscribeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -47,7 +48,8 @@ class RemotesubscribeAction extends Action { } } - function get_instructions() { + function get_instructions() + { return _('To subscribe, you can [login](%%action.login%%),' . ' or [register](%%action.register%%) a new ' . ' account. If you already have an account ' . @@ -55,7 +57,8 @@ class RemotesubscribeAction extends Action { ' enter your profile URL below.'); } - function show_top($err=null) { + function show_top($err=null) + { if ($err) { common_element('div', 'error', $err); } else { @@ -67,7 +70,8 @@ class RemotesubscribeAction extends Action { } } - function show_form($err=null) { + function show_form($err=null) + { $nickname = $this->trimmed('nickname'); $profile = $this->trimmed('profile_url'); common_show_header(_('Remote subscribe'), null, $err, @@ -86,7 +90,8 @@ class RemotesubscribeAction extends Action { common_show_footer(); } - function remote_subscription() { + function remote_subscription() + { $user = $this->get_user(); if (!$user) { @@ -152,7 +157,8 @@ class RemotesubscribeAction extends Action { $this->request_authorization($user, $omb, $token, $secret); } - function get_user() { + function get_user() + { $user = null; $nickname = $this->trimmed('nickname'); if ($nickname) { @@ -161,7 +167,8 @@ class RemotesubscribeAction extends Action { return $user; } - function getOmb($xrds) { + function getOmb($xrds) + { static $omb_endpoints = array(OMB_ENDPOINT_UPDATEPROFILE, OMB_ENDPOINT_POSTNOTICE); static $oauth_endpoints = array(OAUTH_ENDPOINT_REQUEST, OAUTH_ENDPOINT_AUTHORIZE, @@ -221,7 +228,8 @@ class RemotesubscribeAction extends Action { return $omb; } - function getXRD($main_service, $main_xrds) { + function getXRD($main_service, $main_xrds) + { $uri = omb_service_uri($main_service); if (strpos($uri, "#") !== 0) { # FIXME: more rigorous handling of external service definitions @@ -242,7 +250,8 @@ class RemotesubscribeAction extends Action { return null; } - function addServices($xrd, $types, &$omb) { + function addServices($xrd, $types, &$omb) + { foreach ($types as $type) { $matches = omb_get_services($xrd, $type); if ($matches) { @@ -255,7 +264,8 @@ class RemotesubscribeAction extends Action { return true; } - function request_token($omb) { + function request_token($omb) + { $con = omb_oauth_consumer(); $url = omb_service_uri($omb[OAUTH_ENDPOINT_REQUEST]); @@ -299,7 +309,8 @@ class RemotesubscribeAction extends Action { return array($return['oauth_token'], $return['oauth_token_secret']); } - function request_authorization($user, $omb, $token, $secret) { + function request_authorization($user, $omb, $token, $secret) + { global $config; # for license URL $con = omb_oauth_consumer(); @@ -380,7 +391,8 @@ class RemotesubscribeAction extends Action { return; } - function make_nonce() { + function make_nonce() + { return common_good_rand(16); } } diff --git a/actions/replies.php b/actions/replies.php index be80fae79..da2f27f31 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/actions/showstream.php'); class RepliesAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -53,11 +54,13 @@ class RepliesAction extends StreamAction { common_show_footer(); } - function no_such_user() { + function no_such_user() + { common_user_error(_('No such user.')); } - function show_header($user) { + function show_header($user) + { common_element('link', array('rel' => 'alternate', 'href' => common_local_url('repliesrss', array('nickname' => $user->nickname)), @@ -65,7 +68,8 @@ class RepliesAction extends StreamAction { 'title' => sprintf(_('Feed for replies to %s'), $user->nickname))); } - function show_top($user) { + function show_top($user) + { $cur = common_current_user(); if ($cur && $cur->id == $user->id) { @@ -80,7 +84,8 @@ class RepliesAction extends StreamAction { 'item' => 'repliesrss'))); } - function show_replies($user) { + function show_replies($user) + { $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; diff --git a/actions/repliesrss.php b/actions/repliesrss.php index 9652ae9ea..19ab0866a 100644 --- a/actions/repliesrss.php +++ b/actions/repliesrss.php @@ -27,7 +27,8 @@ class RepliesrssAction extends Rss10Action { var $user = null; - function init() { + function init() + { $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); @@ -39,7 +40,8 @@ class RepliesrssAction extends Rss10Action { } } - function get_notices($limit=0) { + function get_notices($limit=0) + { $user = $this->user; @@ -54,7 +56,8 @@ class RepliesrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { $user = $this->user; $c = array('url' => common_local_url('repliesrss', array('nickname' => @@ -67,7 +70,8 @@ class RepliesrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { $user = $this->user; $profile = $user->getProfile(); if (!$profile) { diff --git a/actions/requesttoken.php b/actions/requesttoken.php index 4950d93c0..091846756 100644 --- a/actions/requesttoken.php +++ b/actions/requesttoken.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/omb.php'); class RequesttokenAction extends Action { - function is_readonly() { + function is_readonly() + { return false; } - function handle($args) { + function handle($args) + { parent::handle($args); try { common_remove_magic_from_request(); diff --git a/actions/showfavorites.php b/actions/showfavorites.php index 2fd1e586d..8131cac67 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/actions/showstream.php'); class ShowfavoritesAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -53,7 +54,8 @@ class ShowfavoritesAction extends StreamAction { common_show_footer(); } - function show_header($user) { + function show_header($user) + { common_element('link', array('rel' => 'alternate', 'href' => common_local_url('favoritesrss', array('nickname' => $user->nickname)), @@ -61,7 +63,8 @@ class ShowfavoritesAction extends StreamAction { 'title' => sprintf(_('Feed for favorites of %s'), $user->nickname))); } - function show_top($user) { + function show_top($user) + { $cur = common_current_user(); if ($cur && $cur->id == $user->id) { @@ -75,7 +78,8 @@ class ShowfavoritesAction extends StreamAction { $this->views_menu(); } - function show_notices($user) { + function show_notices($user) + { $page = $this->trimmed('page'); if (!$page) { diff --git a/actions/showmessage.php b/actions/showmessage.php index a5e03c72d..b706fe2fa 100644 --- a/actions/showmessage.php +++ b/actions/showmessage.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/mailbox.php'); class ShowmessageAction extends MailboxAction { - function handle($args) { + function handle($args) + { Action::handle($args); @@ -44,13 +45,15 @@ class ShowmessageAction extends MailboxAction { } } - function get_message() { + function get_message() + { $id = $this->trimmed('message'); $message = Message::staticGet('id', $id); return $message; } - function get_title($user, $page) { + function get_title($user, $page) + { $message = $this->get_message(); if (!$message) { return null; @@ -70,14 +73,16 @@ class ShowmessageAction extends MailboxAction { return $title; } - function get_messages($user, $page) { + function get_messages($user, $page) + { $message = new Message(); $message->id = $this->trimmed('message'); $message->find(); return $message; } - function get_message_profile($message) { + function get_message_profile($message) + { $user = common_current_user(); if ($user->id == $message->from_profile) { return $message->getTo(); @@ -89,11 +94,13 @@ class ShowmessageAction extends MailboxAction { } } - function get_instructions() { + function get_instructions() + { return ''; } - function views_menu() { + function views_menu() + { return; } } diff --git a/actions/shownotice.php b/actions/shownotice.php index 04af61a6f..abdaa72ca 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -27,7 +27,8 @@ class ShownoticeAction extends StreamAction { var $profile = null; var $avatar = null; - function prepare($args) { + function prepare($args) + { parent::prepare($args); @@ -51,13 +52,15 @@ class ShownoticeAction extends StreamAction { return true; } - function last_modified() { + function last_modified() + { return max(strtotime($this->notice->created), strtotime($this->profile->modified), ($this->avatar) ? strtotime($this->avatar->modified) : 0); } - function etag() { + function etag() + { return 'W/"' . implode(':', array($this->arg('action'), common_language(), $this->notice->id, @@ -66,7 +69,8 @@ class ShownoticeAction extends StreamAction { ($this->avatar) ? strtotime($this->avatar->modified) : 0)) . '"'; } - function handle($args) { + function handle($args) + { parent::handle($args); @@ -84,7 +88,8 @@ class ShownoticeAction extends StreamAction { common_show_footer(); } - function show_header() { + function show_header() + { $user = User::staticGet($this->profile->id); @@ -103,14 +108,16 @@ class ShownoticeAction extends StreamAction { } } - function show_top() { + function show_top() + { $cur = common_current_user(); if ($cur && $cur->id == $this->profile->id) { common_notice_form(); } } - function no_such_notice() { + function no_such_notice() + { common_user_error(_('No such notice.')); } } diff --git a/actions/showstream.php b/actions/showstream.php index 485c2e3d1..c31bce87a 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -26,7 +26,8 @@ define('SUBSCRIPTIONS', 80); class ShowstreamAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -76,7 +77,8 @@ class ShowstreamAction extends StreamAction { common_show_footer(); } - function show_top($user) { + function show_top($user) + { $cur = common_current_user(); if ($cur && $cur->id == $user->id) { @@ -100,7 +102,8 @@ class ShowstreamAction extends StreamAction { 'item' => 'foaf'))); } - function show_header($user) { + function show_header($user) + { # Feeds common_element('link', array('rel' => 'alternate', 'href' => common_local_url('api', @@ -153,11 +156,13 @@ class ShowstreamAction extends StreamAction { array('nickname' => $profile->nickname)))); } - function no_such_user() { + function no_such_user() + { $this->client_error(_('No such user.'), 404); } - function show_profile($profile) { + function show_profile($profile) + { common_element_start('div', array('id' => 'profile', 'class' => 'vcard')); @@ -172,7 +177,8 @@ class ShowstreamAction extends StreamAction { common_element_end('div'); } - function show_personal($profile) { + function show_personal($profile) + { $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); common_element_start('div', array('id' => 'profile_avatar')); @@ -246,7 +252,8 @@ class ShowstreamAction extends StreamAction { common_element_end('div'); } - function show_remote_subscribe_link($profile) { + function show_remote_subscribe_link($profile) + { $url = common_local_url('remotesubscribe', array('nickname' => $profile->nickname)); common_element('a', array('href' => $url, @@ -254,7 +261,8 @@ class ShowstreamAction extends StreamAction { _('Subscribe')); } - function show_unsubscribe_form($profile) { + function show_unsubscribe_form($profile) + { common_element_start('form', array('id' => 'unsubscribe', 'method' => 'post', 'action' => common_local_url('unsubscribe'))); common_hidden('token', common_session_token()); @@ -268,7 +276,8 @@ class ShowstreamAction extends StreamAction { common_element_end('form'); } - function show_subscriptions($profile) { + function show_subscriptions($profile) + { global $config; $subs = DB_DataObject::factory('subscription'); @@ -340,7 +349,8 @@ class ShowstreamAction extends StreamAction { common_element_end('div'); } - function show_statistics($profile) { + function show_statistics($profile) + { // XXX: WORM cache this $subs = DB_DataObject::factory('subscription'); @@ -400,7 +410,8 @@ class ShowstreamAction extends StreamAction { common_element_end('div'); } - function show_notices($user) { + function show_notices($user) + { $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -413,7 +424,8 @@ class ShowstreamAction extends StreamAction { 'showstream', array('nickname' => $user->nickname)); } - function show_last_notice($profile) { + function show_last_notice($profile) + { common_element('h2', null, _('Currently')); @@ -438,13 +450,15 @@ class ShowstreamAction extends StreamAction { # We don't show the author for a profile, since we already know who it is! class ProfileNoticeList extends NoticeList { - function newListItem($notice) { + function newListItem($notice) + { return new ProfileNoticeListItem($notice); } } class ProfileNoticeListItem extends NoticeListItem { - function showAuthor() { + function showAuthor() + { return; } } diff --git a/actions/smssettings.php b/actions/smssettings.php index 71ab39514..470a042ed 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -24,11 +24,13 @@ require_once(INSTALLDIR.'/actions/emailsettings.php'); class SmssettingsAction extends EmailsettingsAction { - function get_instructions() { + function get_instructions() + { return _('You can receive SMS messages through email from %%site.name%%.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); $this->form_header(_('SMS Settings'), $msg, $success); common_element_start('form', array('method' => 'post', @@ -103,7 +105,8 @@ class SmssettingsAction extends EmailsettingsAction { common_show_footer(); } - function get_confirmation() { + function get_confirmation() + { $user = common_current_user(); $confirm = new Confirm_address(); $confirm->user_id = $user->id; @@ -115,7 +118,8 @@ class SmssettingsAction extends EmailsettingsAction { } } - function handle_post() { + function handle_post() + { # CSRF protection @@ -144,7 +148,8 @@ class SmssettingsAction extends EmailsettingsAction { } } - function save_preferences() { + function save_preferences() + { $smsnotify = $this->boolean('smsnotify'); @@ -171,7 +176,8 @@ class SmssettingsAction extends EmailsettingsAction { $this->show_form(_('Preferences saved.'), true); } - function add_address() { + function add_address() + { $user = common_current_user(); @@ -226,7 +232,8 @@ class SmssettingsAction extends EmailsettingsAction { $this->show_form($msg, TRUE); } - function cancel_confirmation() { + function cancel_confirmation() + { $sms = $this->trimmed('sms'); $carrier = $this->trimmed('carrier'); @@ -253,7 +260,8 @@ class SmssettingsAction extends EmailsettingsAction { $this->show_form(_('Confirmation cancelled.'), TRUE); } - function remove_address() { + function remove_address() + { $user = common_current_user(); $sms = $this->arg('sms'); @@ -282,7 +290,8 @@ class SmssettingsAction extends EmailsettingsAction { $this->show_form(_('The address was removed.'), TRUE); } - function sms_exists($sms) { + function sms_exists($sms) + { $user = common_current_user(); $other = User::staticGet('sms', $sms); if (!$other) { @@ -292,7 +301,8 @@ class SmssettingsAction extends EmailsettingsAction { } } - function carrier_select() { + function carrier_select() + { $carrier = new Sms_carrier(); $cnt = $carrier->find(); @@ -316,7 +326,8 @@ class SmssettingsAction extends EmailsettingsAction { common_config('site', 'email'))); } - function confirm_code() { + function confirm_code() + { $code = $this->trimmed('code'); diff --git a/actions/subedit.php b/actions/subedit.php index db935eb28..874102857 100644 --- a/actions/subedit.php +++ b/actions/subedit.php @@ -23,7 +23,8 @@ class SubeditAction extends Action { var $profile = null; - function prepare($args) { + function prepare($args) + { parent::prepare($args); @@ -56,7 +57,8 @@ class SubeditAction extends Action { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $cur = common_current_user(); diff --git a/actions/subscribe.php b/actions/subscribe.php index c94c4d7eb..93884f081 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class SubscribeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { diff --git a/actions/subscribers.php b/actions/subscribers.php index b9ca92af3..8c7805f51 100644 --- a/actions/subscribers.php +++ b/actions/subscribers.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/gallery.php'); class SubscribersAction extends GalleryAction { - function gallery_type() { + function gallery_type() + { return _('Subscribers'); } - function get_instructions(&$profile) { + function get_instructions(&$profile) + { $user =& common_current_user(); if ($user && ($user->id == $profile->id)) { return _('These are the people who listen to your notices.'); @@ -36,25 +38,30 @@ class SubscribersAction extends GalleryAction { } } - function fields() { + function fields() + { return array('subscriber', 'subscribed'); } - function div_class() { + function div_class() + { return 'subscribers'; } - function get_other(&$subs) { + function get_other(&$subs) + { return $subs->subscriber; } - function profile_list_class() { + function profile_list_class() + { return 'SubscribersList'; } } class SubscribersList extends ProfileList { - function show_owner_controls($profile) { + function show_owner_controls($profile) + { common_block_form($profile, array('action' => 'subscribers', 'nickname' => $this->owner->nickname)); } diff --git a/actions/subscriptions.php b/actions/subscriptions.php index c24f23a07..ad4a3f9e5 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/gallery.php'); class SubscriptionsAction extends GalleryAction { - function gallery_type() { + function gallery_type() + { return _('Subscriptions'); } - function get_instructions(&$profile) { + function get_instructions(&$profile) + { $user =& common_current_user(); if ($user && ($user->id == $profile->id)) { return _('These are the people whose notices you listen to.'); @@ -36,26 +38,31 @@ class SubscriptionsAction extends GalleryAction { } } - function fields() { + function fields() + { return array('subscribed', 'subscriber'); } - function div_class() { + function div_class() + { return 'subscriptions'; } - function get_other(&$subs) { + function get_other(&$subs) + { return $subs->subscribed; } - function profile_list_class() { + function profile_list_class() + { return 'SubscriptionsList'; } } class SubscriptionsList extends ProfileList { - function show_owner_controls($profile) { + function show_owner_controls($profile) + { $sub = Subscription::pkeyGet(array('subscriber' => $this->owner->id, 'subscribed' => $profile->id)); diff --git a/actions/sup.php b/actions/sup.php index 3c9cbea2c..2a139b322 100644 --- a/actions/sup.php +++ b/actions/sup.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class SupAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -42,7 +43,8 @@ class SupAction extends Action { 'updates' => $updates)); } - function available_periods() { + function available_periods() + { static $periods = array(86400, 43200, 21600, 7200, 3600, 1800, 600, 300, 120, 60, 30, 15); @@ -55,7 +57,8 @@ class SupAction extends Action { return $available; } - function get_updates($seconds) { + function get_updates($seconds) + { $notice = new Notice(); # XXX: cache this. Depends on how big this protocol becomes; @@ -75,7 +78,8 @@ class SupAction extends Action { return $updates; } - function is_readonly() { + function is_readonly() + { return true; } } diff --git a/actions/tag.php b/actions/tag.php index 1325b85a5..d7b35d613 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -24,7 +24,8 @@ define('TAGS_PER_PAGE', 100); class TagAction extends StreamAction { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -46,7 +47,8 @@ class TagAction extends StreamAction { common_show_footer(); } - function show_header($tag = false) { + function show_header($tag = false) + { if ($tag) { common_element('link', array('rel' => 'alternate', 'href' => common_local_url('tagrss', array('tag' => $tag)), @@ -55,11 +57,13 @@ class TagAction extends StreamAction { } } - function get_instructions() { + function get_instructions() + { return _('Showing most popular tags from the last week'); } - function show_top($tag = false) { + function show_top($tag = false) + { if (!$tag) { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); @@ -124,7 +128,8 @@ class TagAction extends StreamAction { } } - function show_tag($tag, $weight, $relative) { + function show_tag($tag, $weight, $relative) + { # XXX: these should probably tune to the size of the site if ($relative > 0.1) { @@ -149,7 +154,8 @@ class TagAction extends StreamAction { common_text(' '); } - function show_notices($tag) { + function show_notices($tag) + { $cnt = 0; diff --git a/actions/tagother.php b/actions/tagother.php index 4691fef07..ed17ac531 100644 --- a/actions/tagother.php +++ b/actions/tagother.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); class TagotherAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); @@ -49,7 +50,8 @@ class TagotherAction extends Action { } } - function show_form($profile, $error=null) { + function show_form($profile, $error=null) + { $user = common_current_user(); @@ -103,7 +105,8 @@ class TagotherAction extends Action { } - function save_tags() { + function save_tags() + { $id = $this->trimmed('id'); $tagstring = $this->trimmed('tags'); @@ -178,7 +181,8 @@ class TagotherAction extends Action { } } - function show_top($arr = null) { + function show_top($arr = null) + { list($profile, $error) = $arr; if ($error) { common_element('p', 'error', $error); diff --git a/actions/tagrss.php b/actions/tagrss.php index 6199a285d..bb4edf473 100644 --- a/actions/tagrss.php +++ b/actions/tagrss.php @@ -25,7 +25,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); class TagrssAction extends Rss10Action { - function init() { + function init() + { $tag = $this->trimmed('tag'); $this->tag = Notice_tag::staticGet('tag', $tag); @@ -37,7 +38,8 @@ class TagrssAction extends Rss10Action { } } - function get_notices($limit=0) { + function get_notices($limit=0) + { $tag = $this->tag; if (is_null($tag)) { @@ -53,7 +55,8 @@ class TagrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { $tag = $this->tag->tag; $c = array('url' => common_local_url('tagrss', array('tag' => $tagname)), diff --git a/actions/twitapiaccount.php b/actions/twitapiaccount.php index b1caa3481..d5e9143c2 100644 --- a/actions/twitapiaccount.php +++ b/actions/twitapiaccount.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapiaccountAction extends TwitterapiAction { - function verify_credentials($args, $apidata) { + function verify_credentials($args, $apidata) + { parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { @@ -34,12 +35,14 @@ class TwitapiaccountAction extends TwitterapiAction { $this->show_extended_profile($apidata['user'], $apidata); } - function end_session($args, $apidata) { + function end_session($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } - function update_location($args, $apidata) { + function update_location($args, $apidata) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { @@ -84,12 +87,14 @@ class TwitapiaccountAction extends TwitterapiAction { } - function update_delivery_device($args, $apidata) { + function update_delivery_device($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } - function rate_limit_status($args, $apidata) { + function rate_limit_status($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } diff --git a/actions/twitapiblocks.php b/actions/twitapiblocks.php index 16b2e76bc..2170141f1 100644 --- a/actions/twitapiblocks.php +++ b/actions/twitapiblocks.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapiblocksAction extends TwitterapiAction { - function create($args, $apidata) { + function create($args, $apidata) + { parent::handle($args); @@ -46,7 +47,8 @@ class TwitapiblocksAction extends TwitterapiAction { } } - function destroy($args, $apidata) { + function destroy($args, $apidata) + { parent::handle($args); $blockee = $this->get_user($apidata['api_arg'], $apidata); diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index 7adb4eadd..e9f7aa0bf 100644 --- a/actions/twitapidirect_messages.php +++ b/actions/twitapidirect_messages.php @@ -23,17 +23,20 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class Twitapidirect_messagesAction extends TwitterapiAction { - function direct_messages($args, $apidata) { + function direct_messages($args, $apidata) + { parent::handle($args); return $this->show_messages($args, $apidata, 'received'); } - function sent($args, $apidata) { + function sent($args, $apidata) + { parent::handle($args); return $this->show_messages($args, $apidata, 'sent'); } - function show_messages($args, $apidata, $type) { + function show_messages($args, $apidata, $type) + { $user = $apidata['user']; @@ -110,7 +113,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } // had to change this from "new" to "create" to avoid PHP reserved word - function create($args, $apidata) { + function create($args, $apidata) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { @@ -173,12 +177,14 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } - function destroy($args, $apidata) { + function destroy($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } - function show_xml_dmsgs($message) { + function show_xml_dmsgs($message) + { $this->init_document('xml'); common_element_start('direct-messages', array('type' => 'array')); @@ -200,7 +206,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } - function show_json_dmsgs($message) { + function show_json_dmsgs($message) + { $this->init_document('json'); @@ -223,7 +230,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } - function show_rss_dmsgs($message, $title, $link, $subtitle) { + function show_rss_dmsgs($message, $title, $link, $subtitle) + { $this->init_document('rss'); @@ -252,7 +260,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } - function show_atom_dmsgs($message, $title, $link, $subtitle) { + function show_atom_dmsgs($message, $title, $link, $subtitle) + { $this->init_document('atom'); @@ -279,7 +288,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { } // swiped from MessageAction. Should it be place in util.php? - function notify($from, $to, $message) { + function notify($from, $to, $message) + { mail_notify_message($message, $from, $to); # XXX: Jabber, SMS notifications... probably queued } diff --git a/actions/twitapifavorites.php b/actions/twitapifavorites.php index ad8c5f18b..e7a43f770 100644 --- a/actions/twitapifavorites.php +++ b/actions/twitapifavorites.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapifavoritesAction extends TwitterapiAction { - function favorites($args, $apidata) { + function favorites($args, $apidata) + { parent::handle($args); $this->auth_user = $apidata['user']; @@ -85,7 +86,8 @@ class TwitapifavoritesAction extends TwitterapiAction { } - function create($args, $apidata) { + function create($args, $apidata) + { parent::handle($args); // Check for RESTfulness @@ -134,14 +136,16 @@ class TwitapifavoritesAction extends TwitterapiAction { } - function destroy($args, $apidata) { + function destroy($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } // XXX: these two funcs swiped from faves. Maybe put in util.php, or some common base class? - function notify($fave, $notice, $user) { + function notify($fave, $notice, $user) + { $other = User::staticGet('id', $notice->profile_id); if ($other && $other->id != $user->id) { if ($other->email && $other->emailnotifyfav) { @@ -152,7 +156,8 @@ class TwitapifavoritesAction extends TwitterapiAction { } } - function notify_mail($other, $user, $notice) { + function notify_mail($other, $user, $notice) + { $profile = $user->getProfile(); $bestname = $profile->getBestName(); $subject = sprintf(_('%s added your notice as a favorite'), $bestname); diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index a52f0fe4d..a59cb543c 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapifriendshipsAction extends TwitterapiAction { - function create($args, $apidata) { + function create($args, $apidata) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { @@ -75,7 +76,8 @@ class TwitapifriendshipsAction extends TwitterapiAction { } - function destroy($args, $apidata) { + function destroy($args, $apidata) + { parent::handle($args); if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { @@ -110,7 +112,8 @@ class TwitapifriendshipsAction extends TwitterapiAction { } - function exists($args, $apidata) { + function exists($args, $apidata) + { parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { diff --git a/actions/twitapihelp.php b/actions/twitapihelp.php index f0e9adfdb..27262f089 100644 --- a/actions/twitapihelp.php +++ b/actions/twitapihelp.php @@ -27,7 +27,8 @@ class TwitapihelpAction extends TwitterapiAction { * URL:http://identi.ca/api/help/test.format * Formats: xml, json */ - function test($args, $apidata) { + function test($args, $apidata) + { parent::handle($args); if ($apidata['content-type'] == 'xml') { @@ -44,7 +45,8 @@ class TwitapihelpAction extends TwitterapiAction { } - function downtime_schedule($args, $apidata) { + function downtime_schedule($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } diff --git a/actions/twitapinotifications.php b/actions/twitapinotifications.php index 26f66d7e5..e24d3829c 100644 --- a/actions/twitapinotifications.php +++ b/actions/twitapinotifications.php @@ -24,12 +24,14 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); # This naming convention looks real sick class TwitapinotificationsAction extends TwitterapiAction { - function follow($args, $apidata) { + function follow($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } - function leave($args, $apidata) { + function leave($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index ffa94b309..f280184c0 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapistatusesAction extends TwitterapiAction { - function public_timeline($args, $apidata) { + function public_timeline($args, $apidata) + { parent::handle($args); $sitename = common_config('site', 'name'); @@ -84,7 +85,8 @@ class TwitapistatusesAction extends TwitterapiAction { } - function friends_timeline($args, $apidata) { + function friends_timeline($args, $apidata) + { parent::handle($args); $since = $this->arg('since'); @@ -146,7 +148,8 @@ class TwitapistatusesAction extends TwitterapiAction { } - function user_timeline($args, $apidata) { + function user_timeline($args, $apidata) + { parent::handle($args); $this->auth_user = $apidata['user']; @@ -226,7 +229,8 @@ class TwitapistatusesAction extends TwitterapiAction { } - function update($args, $apidata) { + function update($args, $apidata) + { parent::handle($args); @@ -321,7 +325,8 @@ class TwitapistatusesAction extends TwitterapiAction { $this->show($args, $apidata); } - function replies($args, $apidata) { + function replies($args, $apidata) + { parent::handle($args); @@ -388,7 +393,8 @@ class TwitapistatusesAction extends TwitterapiAction { } - function show($args, $apidata) { + function show($args, $apidata) + { parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { @@ -413,7 +419,8 @@ class TwitapistatusesAction extends TwitterapiAction { } - function destroy($args, $apidata) { + function destroy($args, $apidata) + { parent::handle($args); @@ -457,18 +464,21 @@ class TwitapistatusesAction extends TwitterapiAction { } - function friends($args, $apidata) { + function friends($args, $apidata) + { parent::handle($args); return $this->subscriptions($apidata, 'subscribed', 'subscriber'); } - function followers($args, $apidata) { + function followers($args, $apidata) + { parent::handle($args); return $this->subscriptions($apidata, 'subscriber', 'subscribed'); } - function subscriptions($apidata, $other_attr, $user_attr) { + function subscriptions($apidata, $other_attr, $user_attr) + { # XXX: lite @@ -523,7 +533,8 @@ class TwitapistatusesAction extends TwitterapiAction { $this->end_document($type); } - function show_profiles($profiles, $type) { + function show_profiles($profiles, $type) + { switch ($type) { case 'xml': common_element_start('users', array('type' => 'array')); @@ -544,12 +555,14 @@ class TwitapistatusesAction extends TwitterapiAction { } } - function featured($args, $apidata) { + function featured($args, $apidata) + { parent::handle($args); common_server_error(_('API method under construction.'), $code=501); } - function supported($cmd) { + function supported($cmd) + { $cmdlist = array('MessageCommand', 'SubCommand', 'UnsubCommand', 'FavCommand', 'OnCommand', 'OffCommand'); diff --git a/actions/twitapiusers.php b/actions/twitapiusers.php index 43f6969f4..4644e6be6 100644 --- a/actions/twitapiusers.php +++ b/actions/twitapiusers.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapiusersAction extends TwitterapiAction { - function show($args, $apidata) { + function show($args, $apidata) + { parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { diff --git a/actions/twittersettings.php b/actions/twittersettings.php index 8cbd39fbd..437bdd363 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -25,12 +25,14 @@ define('SUBSCRIPTIONS', 80); class TwittersettingsAction extends SettingsAction { - function get_instructions() { + function get_instructions() + { return _('Add your Twitter account to automatically send your notices to Twitter, ' . 'and subscribe to Twitter friends already here.'); } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { $user = common_current_user(); $profile = $user->getProfile(); $fuser = null; @@ -91,7 +93,8 @@ class TwittersettingsAction extends SettingsAction { common_show_footer(); } - function subscribed_twitter_users() { + function subscribed_twitter_users() + { $current_user = common_current_user(); @@ -119,7 +122,8 @@ class TwittersettingsAction extends SettingsAction { return $users; } - function show_twitter_subscriptions() { + function show_twitter_subscriptions() + { $friends = $this->subscribed_twitter_users(); $friends_count = count($friends); @@ -180,7 +184,8 @@ class TwittersettingsAction extends SettingsAction { } - function handle_post() { + function handle_post() + { # CSRF protection $token = $this->trimmed('token'); @@ -200,7 +205,8 @@ class TwittersettingsAction extends SettingsAction { } } - function add_twitter_acct() { + function add_twitter_acct() + { $screen_name = $this->trimmed('twitter_username'); $password = $this->trimmed('twitter_password'); @@ -261,7 +267,8 @@ class TwittersettingsAction extends SettingsAction { $this->show_form(_('Twitter settings saved.'), true); } - function remove_twitter_acct() { + function remove_twitter_acct() + { $user = common_current_user(); $flink = Foreign_link::getByUserID($user->id, 1); @@ -284,7 +291,8 @@ class TwittersettingsAction extends SettingsAction { $this->show_form(_('Twitter account removed.'), TRUE); } - function save_preferences() { + function save_preferences() + { $noticesync = $this->boolean('noticesync'); $friendsync = $this->boolean('friendsync'); @@ -330,7 +338,8 @@ class TwittersettingsAction extends SettingsAction { $this->show_form(_('Twitter preferences saved.')); } - function verify_credentials($screen_name, $password) { + function verify_credentials($screen_name, $password) + { $uri = 'http://twitter.com/account/verify_credentials.json'; $data = get_twitter_data($uri, $screen_name, $password); @@ -353,7 +362,8 @@ class TwittersettingsAction extends SettingsAction { return false; } - function set_flags(&$flink, $noticesync, $replysync, $friendsync) { + function set_flags(&$flink, $noticesync, $replysync, $friendsync) + { if ($noticesync) { $flink->noticesync |= FOREIGN_NOTICE_SEND; } else { diff --git a/actions/unblock.php b/actions/unblock.php index 51ec0ae57..66ce0c879 100644 --- a/actions/unblock.php +++ b/actions/unblock.php @@ -23,7 +23,8 @@ class UnblockAction extends Action { var $profile = null; - function prepare($args) { + function prepare($args) + { parent::prepare($args); @@ -56,14 +57,16 @@ class UnblockAction extends Action { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->unblock_profile(); } } - function unblock_profile() { + function unblock_profile() + { $cur = common_current_user(); diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 38fcc21de..e4e04aaa0 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -19,7 +19,8 @@ class UnsubscribeAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_user_error(_('Not logged in.')); diff --git a/actions/updateprofile.php b/actions/updateprofile.php index 4b4bb53a1..2cfff1b51 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/omb.php'); class UpdateprofileAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); try { common_remove_magic_from_request(); @@ -40,7 +41,8 @@ class UpdateprofileAction extends Action { } } - function update_profile($req, $consumer, $token) { + function update_profile($req, $consumer, $token) + { $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { $this->client_error(_('Unsupported OMB version'), 400); diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 58ec36fc8..ecaa33167 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -24,7 +24,8 @@ define('TIMESTAMP_THRESHOLD', 300); class UserauthorizationAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if ($_SERVER['REQUEST_METHOD'] == 'POST') { @@ -69,7 +70,8 @@ class UserauthorizationAction extends Action { } } - function show_form($req) { + function show_form($req) + { $nickname = $req->get_parameter('omb_listenee_nickname'); $profile = $req->get_parameter('omb_listenee_profile'); @@ -129,7 +131,8 @@ class UserauthorizationAction extends Action { common_show_footer(); } - function send_authorization() { + function send_authorization() + { $req = $this->get_stored_request(); if (!$req) { @@ -197,7 +200,8 @@ class UserauthorizationAction extends Action { } } - function authorize_token(&$req) { + function authorize_token(&$req) + { $consumer_key = $req->get_parameter('oauth_consumer_key'); $token_field = $req->get_parameter('oauth_token'); common_debug('consumer key = "'.$consumer_key.'"', __FILE__); @@ -222,7 +226,8 @@ class UserauthorizationAction extends Action { # XXX: refactor with similar code in finishremotesubscribe.php - function save_remote_profile(&$req) { + function save_remote_profile(&$req) + { # FIXME: we should really do this when the consumer comes # back for an access token. If they never do, we've got stuff in a # weird state. @@ -312,13 +317,15 @@ class UserauthorizationAction extends Action { return TRUE; } - function add_avatar($profile, $url) { + function add_avatar($profile, $url) + { $temp_filename = tempnam(sys_get_temp_dir(), 'listenee_avatar'); copy($url, $temp_filename); return $profile->setOriginal($temp_filename); } - function show_accept_message($tok) { + function show_accept_message($tok) + { common_show_header(_('Subscription authorized')); common_element('p', null, _('The subscription has been authorized, but no '. @@ -328,7 +335,8 @@ class UserauthorizationAction extends Action { common_show_footer(); } - function show_reject_message($tok) { + function show_reject_message($tok) + { common_show_header(_('Subscription rejected')); common_element('p', null, _('The subscription has been rejected, but no '. @@ -337,23 +345,27 @@ class UserauthorizationAction extends Action { common_show_footer(); } - function store_request($req) { + function store_request($req) + { common_ensure_session(); $_SESSION['userauthorizationrequest'] = $req; } - function clear_request() { + function clear_request() + { common_ensure_session(); unset($_SESSION['userauthorizationrequest']); } - function get_stored_request() { + function get_stored_request() + { common_ensure_session(); $req = $_SESSION['userauthorizationrequest']; return $req; } - function get_new_request() { + function get_new_request() + { common_remove_magic_from_request(); $req = OAuthRequest::from_request(); return $req; @@ -361,7 +373,8 @@ class UserauthorizationAction extends Action { # Throws an OAuthException if anything goes wrong - function validate_request(&$req) { + function validate_request(&$req) + { # OAuth stuff -- have to copy from OAuth.php since they're # all private methods, and there's no user-authentication method common_debug('checking version', __FILE__); @@ -384,7 +397,8 @@ class UserauthorizationAction extends Action { return true; } - function validate_omb(&$req) { + function validate_omb(&$req) + { foreach (array('omb_version', 'omb_listener', 'omb_listenee', 'omb_listenee_profile', 'omb_listenee_nickname', 'omb_listenee_license') as $param) @@ -498,7 +512,8 @@ class UserauthorizationAction extends Action { # Snagged from OAuthServer - function check_version(&$req) { + function check_version(&$req) + { $version = $req->get_parameter("oauth_version"); if (!$version) { $version = 1.0; @@ -511,7 +526,8 @@ class UserauthorizationAction extends Action { # Snagged from OAuthServer - function get_consumer($datastore, $req) { + function get_consumer($datastore, $req) + { $consumer_key = @$req->get_parameter("oauth_consumer_key"); if (!$consumer_key) { throw new OAuthException("Invalid consumer key"); @@ -526,7 +542,8 @@ class UserauthorizationAction extends Action { # Mostly cadged from OAuthServer - function get_token($datastore, &$req, $consumer) {/*{{{*/ + function get_token($datastore, &$req, $consumer) + {/*{{{*/ $token_field = @$req->get_parameter('oauth_token'); $token = $datastore->lookup_token($consumer, 'request', $token_field); if (!$token) { @@ -535,7 +552,8 @@ class UserauthorizationAction extends Action { return $token; } - function check_timestamp(&$req) { + function check_timestamp(&$req) + { $timestamp = @$req->get_parameter('oauth_timestamp'); $now = time(); if ($now - $timestamp > TIMESTAMP_THRESHOLD) { @@ -544,7 +562,8 @@ class UserauthorizationAction extends Action { } # NOTE: don't call twice on the same request; will fail! - function check_nonce(&$datastore, &$req, $consumer, $token) { + function check_nonce(&$datastore, &$req, $consumer, $token) + { $timestamp = @$req->get_parameter('oauth_timestamp'); $nonce = @$req->get_parameter('oauth_nonce'); $found = $datastore->lookup_nonce($consumer, $token, $nonce, $timestamp); @@ -554,7 +573,8 @@ class UserauthorizationAction extends Action { return true; } - function check_signature(&$req, $consumer, $token) { + function check_signature(&$req, $consumer, $token) + { $signature_method = $this->get_signature_method($req); $signature = $req->get_parameter('oauth_signature'); $valid_sig = $signature_method->check_signature($req, @@ -566,7 +586,8 @@ class UserauthorizationAction extends Action { } } - function get_signature_method(&$req) { + function get_signature_method(&$req) + { $signature_method = @$req->get_parameter("oauth_signature_method"); if (!$signature_method) { $signature_method = "PLAINTEXT"; diff --git a/actions/userbyid.php b/actions/userbyid.php index 3fa92e9ce..d7b4088bd 100644 --- a/actions/userbyid.php +++ b/actions/userbyid.php @@ -21,11 +21,13 @@ if (!defined('LACONICA')) { exit(1); } class UserbyidAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); $id = $this->trimmed('id'); if (!$id) { diff --git a/actions/userrss.php b/actions/userrss.php index 6089718ae..c758a44e2 100644 --- a/actions/userrss.php +++ b/actions/userrss.php @@ -27,7 +27,8 @@ class UserrssAction extends Rss10Action { var $user = null; - function init() { + function init() + { $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); @@ -39,7 +40,8 @@ class UserrssAction extends Rss10Action { } } - function get_notices($limit=0) { + function get_notices($limit=0) + { $user = $this->user; @@ -56,7 +58,8 @@ class UserrssAction extends Rss10Action { return $notices; } - function get_channel() { + function get_channel() + { $user = $this->user; $profile = $user->getProfile(); $c = array('url' => common_local_url('userrss', @@ -68,7 +71,8 @@ class UserrssAction extends Rss10Action { return $c; } - function get_image() { + function get_image() + { $user = $this->user; $profile = $user->getProfile(); if (!$profile) { @@ -82,7 +86,8 @@ class UserrssAction extends Rss10Action { # override parent to add X-SUP-ID URL - function init_rss($limit=0) { + function init_rss($limit=0) + { $url = common_local_url('sup', null, $this->user->id); header('X-SUP-ID: '.$url); parent::init_rss($limit); diff --git a/actions/xrds.php b/actions/xrds.php index 54baf64be..1d4961d46 100644 --- a/actions/xrds.php +++ b/actions/xrds.php @@ -23,11 +23,13 @@ require_once(INSTALLDIR.'/lib/omb.php'); class XrdsAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); $nickname = $this->trimmed('nickname'); $user = User::staticGet('nickname', $nickname); @@ -38,7 +40,8 @@ class XrdsAction extends Action { $this->show_xrds($user); } - function show_xrds($user) { + function show_xrds($user) + { header('Content-Type: application/xrds+xml'); @@ -108,7 +111,8 @@ class XrdsAction extends Action { common_end_xml(); } - function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { + function show_service($type, $uri, $params=null, $sigs=null, $localId=null) + { common_element_start('Service'); if ($uri) { common_element('URI', null, $uri); diff --git a/classes/Avatar.php b/classes/Avatar.php index bde983d79..3c754ec2d 100644 --- a/classes/Avatar.php +++ b/classes/Avatar.php @@ -21,14 +21,16 @@ class Avatar extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Avatar',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Avatar',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE # We clean up the file, too - function delete() { + function delete() + { $filename = $this->filename; if (parent::delete()) { @unlink(common_avatar_path($filename)); @@ -38,7 +40,8 @@ class Avatar extends Memcached_DataObject # Create and save scaled version of this avatar # XXX: maybe break into different methods - function scale($size) { + function scale($size) + { $image_s = imagecreatetruecolor($size, $size); $image_a = $this->to_image(); @@ -76,7 +79,8 @@ class Avatar extends Memcached_DataObject } } - function to_image() { + function to_image() + { $filepath = common_avatar_path($this->filename); if ($this->mediatype == 'image/gif') { return imagecreatefromgif($filepath); @@ -89,7 +93,8 @@ class Avatar extends Memcached_DataObject } } - function &pkeyGet($kv) { + function &pkeyGet($kv) + { return Memcached_DataObject::pkeyGet('Avatar', $kv); } } diff --git a/classes/Channel.php b/classes/Channel.php index ea3530406..02ece9c0f 100644 --- a/classes/Channel.php +++ b/classes/Channel.php @@ -21,23 +21,28 @@ if (!defined('LACONICA')) { exit(1); } class Channel { - function on($user) { + function on($user) + { return false; } - function off($user) { + function off($user) + { return false; } - function output($user, $text) { + function output($user, $text) + { return false; } - function error($user, $text) { + function error($user, $text) + { return false; } - function source() { + function source() + { return null; } } @@ -46,33 +51,40 @@ class XMPPChannel extends Channel { var $conn = null; - function source() { + function source() + { return 'xmpp'; } - function __construct($conn) { + function __construct($conn) + { $this->conn = $conn; } - function on($user) { + function on($user) + { return $this->set_notify($user, 1); } - function off($user) { + function off($user) + { return $this->set_notify($user, 0); } - function output($user, $text) { + function output($user, $text) + { $text = '['.common_config('site', 'name') . '] ' . $text; jabber_send_message($user->jabber, $text); } - function error($user, $text) { + function error($user, $text) + { $text = '['.common_config('site', 'name') . '] ' . $text; jabber_send_message($user->jabber, $text); } - function set_notify(&$user, $notify) { + function set_notify(&$user, $notify) + { $orig = clone($user); $user->jabbernotify = $notify; $result = $user->update($orig); @@ -94,19 +106,23 @@ class XMPPChannel extends Channel { class WebChannel extends Channel { - function source() { + function source() + { return 'web'; } - function on($user) { + function on($user) + { return false; } - function off($user) { + function off($user) + { return false; } - function output($user, $text) { + function output($user, $text) + { # XXX: buffer all output and send it at the end # XXX: even better, redirect to appropriate page # depending on what command was run @@ -115,7 +131,8 @@ class WebChannel extends Channel { common_show_footer(); } - function error($user, $text) { + function error($user, $text) + { common_user_error($text); } } @@ -123,7 +140,8 @@ class WebChannel extends Channel { class AjaxWebChannel extends WebChannel { - function output($user, $text) { + function output($user, $text) + { common_start_html('text/xml;charset=utf-8', true); common_element_start('head'); common_element('title', null, _('Command results')); @@ -134,7 +152,8 @@ class AjaxWebChannel extends WebChannel { common_element_end('html'); } - function error($user, $text) { + function error($user, $text) + { common_start_html('text/xml;charset=utf-8', true); common_element_start('head'); common_element('title', null, _('Ajax Error')); @@ -151,23 +170,28 @@ class MailChannel extends Channel { var $addr = null; - function source() { + function source() + { return 'mail'; } - function __construct($addr=null) { + function __construct($addr=null) + { $this->addr = $addr; } - function on($user) { + function on($user) + { return $this->set_notify($user, 1); } - function off($user) { + function off($user) + { return $this->set_notify($user, 0); } - function output($user, $text) { + function output($user, $text) + { $headers['From'] = $user->incomingemail; $headers['To'] = $this->addr; @@ -177,7 +201,8 @@ class MailChannel extends Channel { return mail_send(array($this->addr), $headers, $text); } - function error($user, $text) { + function error($user, $text) + { $headers['From'] = $user->incomingemail; $headers['To'] = $this->addr; @@ -187,7 +212,8 @@ class MailChannel extends Channel { return mail_send(array($this->addr), $headers, $text); } - function set_notify($user, $value) { + function set_notify($user, $value) + { $orig = clone($user); $user->smsnotify = $value; $result = $user->update($orig); diff --git a/classes/Command.php b/classes/Command.php index b146005a7..407a6ecba 100644 --- a/classes/Command.php +++ b/classes/Command.php @@ -25,17 +25,20 @@ class Command { var $user = null; - function __construct($user=null) { + function __construct($user=null) + { $this->user = $user; } - function execute($channel) { + function execute($channel) + { return false; } } class UnimplementedCommand extends Command { - function execute($channel) { + function execute($channel) + { $channel->error($this->user, _("Sorry, this command is not yet implemented.")); } } @@ -48,7 +51,8 @@ class TrackOffCommand extends UnimplementedCommand { class TrackCommand extends UnimplementedCommand { var $word = null; - function __construct($user, $word) { + function __construct($user, $word) + { parent::__construct($user); $this->word = $word; } @@ -56,7 +60,8 @@ class TrackCommand extends UnimplementedCommand { class UntrackCommand extends UnimplementedCommand { var $word = null; - function __construct($user, $word) { + function __construct($user, $word) + { parent::__construct($user); $this->word = $word; } @@ -64,7 +69,8 @@ class UntrackCommand extends UnimplementedCommand { class NudgeCommand extends UnimplementedCommand { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } @@ -72,14 +78,16 @@ class NudgeCommand extends UnimplementedCommand { class InviteCommand extends UnimplementedCommand { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } } class StatsCommand extends Command { - function execute($channel) { + function execute($channel) + { $subs = new Subscription(); $subs->subscriber = $this->user->id; @@ -106,12 +114,14 @@ class FavCommand extends Command { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { $recipient = common_relative_profile($this->user, common_canonical_nickname($this->other)); @@ -149,12 +159,14 @@ class FavCommand extends Command { class WhoisCommand extends Command { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { $recipient = common_relative_profile($this->user, common_canonical_nickname($this->other)); @@ -184,13 +196,15 @@ class WhoisCommand extends Command { class MessageCommand extends Command { var $other = null; var $text = null; - function __construct($user, $other, $text) { + function __construct($user, $other, $text) + { parent::__construct($user); $this->other = $other; $this->text = $text; } - function execute($channel) { + function execute($channel) + { $other = User::staticGet('nickname', common_canonical_nickname($this->other)); $len = mb_strlen($this->text); if ($len == 0) { @@ -227,12 +241,14 @@ class GetCommand extends Command { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { $target_nickname = common_canonical_nickname($this->other); $target = @@ -257,12 +273,14 @@ class SubCommand extends Command { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { if (!$this->other) { $channel->error($this->user, _('Specify the name of the user to subscribe to')); @@ -283,12 +301,14 @@ class UnsubCommand extends Command { var $other = null; - function __construct($user, $other) { + function __construct($user, $other) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { if(!$this->other) { $channel->error($this->user, _('Specify the name of the user to unsubscribe from')); return; @@ -306,11 +326,13 @@ class UnsubCommand extends Command { class OffCommand extends Command { var $other = null; - function __construct($user, $other=null) { + function __construct($user, $other=null) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { if ($other) { $channel->error($this->user, _("Command not yet implemented.")); } else { @@ -325,12 +347,14 @@ class OffCommand extends Command { class OnCommand extends Command { var $other = null; - function __construct($user, $other=null) { + function __construct($user, $other=null) + { parent::__construct($user); $this->other = $other; } - function execute($channel) { + function execute($channel) + { if ($other) { $channel->error($this->user, _("Command not yet implemented.")); } else { @@ -344,7 +368,8 @@ class OnCommand extends Command { } class HelpCommand extends Command { - function execute($channel) { + function execute($channel) + { $channel->output($this->user, _("Commands:\n". "on - turn on notifications\n". diff --git a/classes/CommandInterpreter.php b/classes/CommandInterpreter.php index db02ce541..ff078bb05 100644 --- a/classes/CommandInterpreter.php +++ b/classes/CommandInterpreter.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/classes/Command.php'); class CommandInterpreter { - function handle_command($user, $text) { + function handle_command($user, $text) + { # XXX: localise $text = preg_replace('/\s+/', ' ', trim($text)); diff --git a/classes/Confirm_address.php b/classes/Confirm_address.php index 71f2d0c72..ed3875d22 100644 --- a/classes/Confirm_address.php +++ b/classes/Confirm_address.php @@ -20,10 +20,12 @@ class Confirm_address extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function sequenceKey() { return array(false, false); } + function sequenceKey() + { return array(false, false); } } diff --git a/classes/Consumer.php b/classes/Consumer.php index c598312aa..d5b7b7e33 100644 --- a/classes/Consumer.php +++ b/classes/Consumer.php @@ -16,7 +16,8 @@ class Consumer extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Consumer',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Consumer',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/Fave.php b/classes/Fave.php index 5d938d149..24df5938c 100644 --- a/classes/Fave.php +++ b/classes/Fave.php @@ -15,7 +15,8 @@ class Fave extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Fave',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Fave',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE @@ -31,7 +32,8 @@ class Fave extends Memcached_DataObject return $fave; } - function &pkeyGet($kv) { + function &pkeyGet($kv) + { return Memcached_DataObject::pkeyGet('Fave', $kv); } } diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php index 41a95e641..79a4d262d 100644 --- a/classes/Foreign_link.php +++ b/classes/Foreign_link.php @@ -21,7 +21,8 @@ class Foreign_link extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE @@ -55,7 +56,8 @@ class Foreign_link extends Memcached_DataObject } # Convenience methods - function getForeignUser() { + function getForeignUser() + { $fuser = new Foreign_user(); $fuser->service = $this->service; $fuser->id = $this->foreign_id; @@ -69,7 +71,8 @@ class Foreign_link extends Memcached_DataObject return null; } - function getUser() { + function getUser() + { return User::staticGet($this->user_id); } diff --git a/classes/Foreign_service.php b/classes/Foreign_service.php index 128411b71..ef614dbd6 100644 --- a/classes/Foreign_service.php +++ b/classes/Foreign_service.php @@ -17,7 +17,8 @@ class Foreign_service extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/Foreign_subscription.php b/classes/Foreign_subscription.php index d8e8569fb..d50860621 100644 --- a/classes/Foreign_subscription.php +++ b/classes/Foreign_subscription.php @@ -16,7 +16,8 @@ class Foreign_subscription extends Memcached_DataObject public $created; // datetime() not_null /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/Foreign_user.php b/classes/Foreign_user.php index f8a980884..61727abe5 100644 --- a/classes/Foreign_user.php +++ b/classes/Foreign_user.php @@ -18,7 +18,8 @@ class Foreign_user extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE @@ -39,7 +40,8 @@ class Foreign_user extends Memcached_DataObject return null; } - function updateKeys(&$orig) { + function updateKeys(&$orig) + { $parts = array(); foreach (array('id', 'service', 'uri', 'nickname') as $k) { if (strcmp($this->$k, $orig->$k) != 0) { diff --git a/classes/Invitation.php b/classes/Invitation.php index ff6456445..8a36fd8df 100644 --- a/classes/Invitation.php +++ b/classes/Invitation.php @@ -17,7 +17,8 @@ class Invitation extends Memcached_DataObject public $created; // datetime() not_null /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Invitation',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Invitation',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 1d12730c9..b9f599dbc 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -23,7 +23,8 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; class Memcached_DataObject extends DB_DataObject { - function &staticGet($cls, $k, $v=null) { + function &staticGet($cls, $k, $v=null) + { if (is_null($v)) { $v = $k; # XXX: HACK! @@ -44,7 +45,8 @@ class Memcached_DataObject extends DB_DataObject } } - function &pkeyGet($cls, $kv) { + function &pkeyGet($cls, $kv) + { $i = Memcached_DataObject::multicache($cls, $kv); if ($i) { return $i; @@ -62,12 +64,14 @@ class Memcached_DataObject extends DB_DataObject } } - function insert() { + function insert() + { $result = parent::insert(); return $result; } - function update($orig=null) { + function update($orig=null) + { if (is_object($orig) && $orig instanceof Memcached_DataObject) { $orig->decache(); # might be different keys } @@ -78,7 +82,8 @@ class Memcached_DataObject extends DB_DataObject return $result; } - function delete() { + function delete() + { $this->decache(); # while we still have the values! return parent::delete(); } @@ -100,7 +105,8 @@ class Memcached_DataObject extends DB_DataObject } } - function keyTypes() { + function keyTypes() + { global $_DB_DATAOBJECT; if (!isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"])) { $this->databaseStructure(); @@ -109,7 +115,8 @@ class Memcached_DataObject extends DB_DataObject return $_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"]; } - function encache() { + function encache() + { $c = $this->memcache(); if (!$c) { return false; @@ -133,7 +140,8 @@ class Memcached_DataObject extends DB_DataObject } } - function decache() { + function decache() + { $c = $this->memcache(); if (!$c) { return false; @@ -158,7 +166,8 @@ class Memcached_DataObject extends DB_DataObject } } - function multicache($cls, $kv) { + function multicache($cls, $kv) + { ksort($kv); $c = Memcached_DataObject::memcache(); if (!$c) { @@ -170,7 +179,8 @@ class Memcached_DataObject extends DB_DataObject } } - function getSearchEngine($table) { + function getSearchEngine($table) + { require_once INSTALLDIR.'/lib/search_engines.php'; static $search_engine; if (!isset($search_engine)) { diff --git a/classes/Message.php b/classes/Message.php index e04fbb3c0..4806057b4 100644 --- a/classes/Message.php +++ b/classes/Message.php @@ -22,16 +22,19 @@ class Message extends Memcached_DataObject public $source; // varchar(32) /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Message',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Message',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function getFrom() { + function getFrom() + { return Profile::staticGet('id', $this->from_profile); } - function getTo() { + function getTo() + { return Profile::staticGet('id', $this->to_profile); } diff --git a/classes/Nonce.php b/classes/Nonce.php index 54d20de9c..2c0edfa14 100644 --- a/classes/Nonce.php +++ b/classes/Nonce.php @@ -18,7 +18,8 @@ class Nonce extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Nonce',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Nonce',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/Notice.php b/classes/Notice.php index e6152812c..d3aa4e828 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -48,23 +48,27 @@ class Notice extends Memcached_DataObject public $source; // varchar(32) /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Notice',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function getProfile() { + function getProfile() + { return Profile::staticGet('id', $this->profile_id); } - function delete() { + function delete() + { $this->blowCaches(true); $this->blowFavesCache(true); $this->blowInboxes(); return parent::delete(); } - function saveTags() { + function saveTags() + { /* extract all #hastags */ $count = preg_match_all('/(?:^|\s)#([A-Za-z0-9_\-\.]{1,64})/', strtolower($this->content), $match); if (!$count) { @@ -184,7 +188,8 @@ class Notice extends Memcached_DataObject return true; } - function blowCaches($blowLast=false) { + function blowCaches($blowLast=false) + { $this->blowSubsCache($blowLast); $this->blowNoticeCache($blowLast); $this->blowRepliesCache($blowLast); @@ -192,7 +197,8 @@ class Notice extends Memcached_DataObject $this->blowTagCache($blowLast); } - function blowTagCache($blowLast=false) { + function blowTagCache($blowLast=false) + { $cache = common_memcache(); if ($cache) { $tag = new Notice_tag(); @@ -210,7 +216,8 @@ class Notice extends Memcached_DataObject } } - function blowSubsCache($blowLast=false) { + function blowSubsCache($blowLast=false) + { $cache = common_memcache(); if ($cache) { $user = new User(); @@ -230,7 +237,8 @@ class Notice extends Memcached_DataObject } } - function blowNoticeCache($blowLast=false) { + function blowNoticeCache($blowLast=false) + { if ($this->is_local) { $cache = common_memcache(); if ($cache) { @@ -242,7 +250,8 @@ class Notice extends Memcached_DataObject } } - function blowRepliesCache($blowLast=false) { + function blowRepliesCache($blowLast=false) + { $cache = common_memcache(); if ($cache) { $reply = new Reply(); @@ -260,7 +269,8 @@ class Notice extends Memcached_DataObject } } - function blowPublicCache($blowLast=false) { + function blowPublicCache($blowLast=false) + { if ($this->is_local == 1) { $cache = common_memcache(); if ($cache) { @@ -272,7 +282,8 @@ class Notice extends Memcached_DataObject } } - function blowFavesCache($blowLast=false) { + function blowFavesCache($blowLast=false) + { $cache = common_memcache(); if ($cache) { $fave = new Fave(); @@ -477,7 +488,8 @@ class Notice extends Memcached_DataObject return $wrapper; } - function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) { + function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) + { $parts = array(); @@ -499,7 +511,8 @@ class Notice extends Memcached_DataObject $offset, $limit, $since_id, $before_id, null, $since); } - function addToInboxes() { + function addToInboxes() + { $enabled = common_config('inboxes', 'enabled'); if ($enabled === true || $enabled === 'transitional') { @@ -522,7 +535,8 @@ class Notice extends Memcached_DataObject # Delete from inboxes if we're deleted. - function blowInboxes() { + function blowInboxes() + { $enabled = common_config('inboxes', 'enabled'); diff --git a/classes/NoticeWrapper.php b/classes/NoticeWrapper.php index 19ae37c1b..e1b27c2f7 100644 --- a/classes/NoticeWrapper.php +++ b/classes/NoticeWrapper.php @@ -38,11 +38,13 @@ class NoticeWrapper extends Notice { var $notices = null; var $i = -1; - function __construct($arr) { + function __construct($arr) + { $this->notices = $arr; } - function fetch() { + function fetch() + { static $fields = array('id', 'profile_id', 'uri', 'content', 'rendered', 'url', 'created', 'modified', 'reply_to', 'is_local', 'source'); $this->i++; diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php index 922ba2660..81ddb4538 100644 --- a/classes/Notice_inbox.php +++ b/classes/Notice_inbox.php @@ -33,7 +33,8 @@ class Notice_inbox extends Memcached_DataObject public $source; // tinyint(1) default_1 /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/Notice_source.php b/classes/Notice_source.php index a12397b0b..e7568bbca 100644 --- a/classes/Notice_source.php +++ b/classes/Notice_source.php @@ -17,7 +17,8 @@ class Notice_source extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_source',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Notice_source',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php index 8c3911f76..94f9296d6 100644 --- a/classes/Notice_tag.php +++ b/classes/Notice_tag.php @@ -30,7 +30,8 @@ class Notice_tag extends Memcached_DataObject public $created; // datetime() not_null /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE @@ -46,7 +47,8 @@ class Notice_tag extends Memcached_DataObject $offset, $limit); } - function blowCache() { + function blowCache() + { $cache = common_memcache(); if ($cache) { $cache->delete(common_cache_key('notice_tag:notice_stream:' . $this->tag)); diff --git a/classes/Profile.php b/classes/Profile.php index b95cbf993..fb6ff90f1 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -41,12 +41,14 @@ class Profile extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Profile',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function getAvatar($width, $height=null) { + function getAvatar($width, $height=null) + { if (is_null($height)) { $height = $width; } @@ -55,7 +57,8 @@ class Profile extends Memcached_DataObject 'height' => $height)); } - function getOriginalAvatar() { + function getOriginalAvatar() + { $avatar = DB_DataObject::factory('avatar'); $avatar->profile_id = $this->id; $avatar->original = true; @@ -66,7 +69,8 @@ class Profile extends Memcached_DataObject } } - function setOriginal($source) { + function setOriginal($source) + { $info = @getimagesize($source); @@ -117,7 +121,8 @@ class Profile extends Memcached_DataObject return $avatar; } - function delete_avatars() { + function delete_avatars() + { $avatar = new Avatar(); $avatar->profile_id = $this->id; $avatar->find(); @@ -127,12 +132,14 @@ class Profile extends Memcached_DataObject return true; } - function getBestName() { + function getBestName() + { return ($this->fullname) ? $this->fullname : $this->nickname; } # Get latest notice on or before date; default now - function getCurrentNotice($dt=null) { + function getCurrentNotice($dt=null) + { $notice = new Notice(); $notice->profile_id = $this->id; if ($dt) { @@ -146,7 +153,8 @@ class Profile extends Memcached_DataObject return null; } - function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) { + function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) + { $qry = 'SELECT * ' . 'FROM notice ' . diff --git a/classes/Profile_block.php b/classes/Profile_block.php index 41d6701eb..551e690e2 100644 --- a/classes/Profile_block.php +++ b/classes/Profile_block.php @@ -36,12 +36,14 @@ class Profile_block extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_block',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Profile_block',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function get($blocker, $blocked) { + function get($blocker, $blocked) + { return Memcached_DataObject::pkeyGet('Profile_block', array('blocker' => $blocker, 'blocked' => $blocked)); diff --git a/classes/Profile_tag.php b/classes/Profile_tag.php index 5c508c84f..cb60cbaec 100644 --- a/classes/Profile_tag.php +++ b/classes/Profile_tag.php @@ -16,7 +16,8 @@ class Profile_tag extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/Queue_item.php b/classes/Queue_item.php index f2fc0be03..1b34d8ab4 100644 --- a/classes/Queue_item.php +++ b/classes/Queue_item.php @@ -16,12 +16,14 @@ class Queue_item extends Memcached_DataObject public $claimed; // datetime() /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Queue_item',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Queue_item',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function sequenceKey() { return array(false, false); } + function sequenceKey() + { return array(false, false); } static function top($transport) { diff --git a/classes/Remember_me.php b/classes/Remember_me.php index 9d3f9378f..8dc29bfa3 100644 --- a/classes/Remember_me.php +++ b/classes/Remember_me.php @@ -15,10 +15,12 @@ class Remember_me extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remember_me',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Remember_me',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function sequenceKey() { return array(false, false); } + function sequenceKey() + { return array(false, false); } } diff --git a/classes/Remote_profile.php b/classes/Remote_profile.php index 66b0f3a5c..5aa6d913e 100644 --- a/classes/Remote_profile.php +++ b/classes/Remote_profile.php @@ -38,7 +38,8 @@ class Remote_profile extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/Reply.php b/classes/Reply.php index 10d6ced5b..af86aaf87 100644 --- a/classes/Reply.php +++ b/classes/Reply.php @@ -16,7 +16,8 @@ class Reply extends Memcached_DataObject public $replied_id; // int(4) /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Reply',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Reply',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/Sms_carrier.php b/classes/Sms_carrier.php index b4a9d8655..ffa12de29 100644 --- a/classes/Sms_carrier.php +++ b/classes/Sms_carrier.php @@ -17,12 +17,14 @@ class Sms_carrier extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function toEmailAddress($sms) { + function toEmailAddress($sms) + { return sprintf($this->email_pattern, $sms); } } diff --git a/classes/Subscription.php b/classes/Subscription.php index d70f99550..3fe0d167f 100644 --- a/classes/Subscription.php +++ b/classes/Subscription.php @@ -40,12 +40,14 @@ class Subscription extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Subscription',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Subscription',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function &pkeyGet($kv) { + function &pkeyGet($kv) + { return Memcached_DataObject::pkeyGet('Subscription', $kv); } } diff --git a/classes/Token.php b/classes/Token.php index 3c88444c8..1fabd72f1 100644 --- a/classes/Token.php +++ b/classes/Token.php @@ -19,7 +19,8 @@ class Token extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Token',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('Token',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/User.php b/classes/User.php index 29e6a86e9..90d0ccfe0 100644 --- a/classes/User.php +++ b/classes/User.php @@ -62,16 +62,19 @@ class User extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('User',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function getProfile() { + function getProfile() + { return Profile::staticGet('id', $this->id); } - function isSubscribed($other) { + function isSubscribed($other) + { assert(!is_null($other)); # XXX: cache results of this query $sub = Subscription::pkeyGet(array('subscriber' => $this->id, @@ -81,7 +84,8 @@ class User extends Memcached_DataObject # 'update' won't write key columns, so we have to do it ourselves. - function updateKeys(&$orig) { + function updateKeys(&$orig) + { $parts = array(); foreach (array('nickname', 'email', 'jabber', 'incomingemail', 'sms', 'carrier', 'smsemail', 'language', 'timezone') as $k) { if (strcmp($this->$k, $orig->$k) != 0) { @@ -108,7 +112,8 @@ class User extends Memcached_DataObject return $result; } - function allowed_nickname($nickname) { + function allowed_nickname($nickname) + { # XXX: should already be validated for size, content, etc. static $blacklist = array('rss', 'xrds', 'doc', 'main', 'settings', 'notice', 'user', @@ -118,7 +123,8 @@ class User extends Memcached_DataObject return !in_array($nickname, $merged); } - function getCurrentNotice($dt=null) { + function getCurrentNotice($dt=null) + { $profile = $this->getProfile(); if (!$profile) { return null; @@ -126,11 +132,13 @@ class User extends Memcached_DataObject return $profile->getCurrentNotice($dt); } - function getCarrier() { + function getCarrier() + { return Sms_carrier::staticGet('id', $this->carrier); } - function subscribeTo($other) { + function subscribeTo($other) + { $sub = new Subscription(); $sub->subscriber = $this->id; $sub->subscribed = $other->id; @@ -144,7 +152,8 @@ class User extends Memcached_DataObject return true; } - function hasBlocked($other) { + function hasBlocked($other) + { $block = Profile_block::get($this->id, $other->id); @@ -271,7 +280,8 @@ class User extends Memcached_DataObject # Things we do when the email changes - function emailChanged() { + function emailChanged() + { $invites = new Invitation(); $invites->address = $this->email; @@ -285,7 +295,8 @@ class User extends Memcached_DataObject } } - function hasFave($notice) { + function hasFave($notice) + { $cache = common_memcache(); # XXX: Kind of a hack. @@ -317,12 +328,14 @@ class User extends Memcached_DataObject 'notice_id' => $notice->id)); return ((is_null($fave)) ? false : true); } - function mutuallySubscribed($other) { + function mutuallySubscribed($other) + { return $this->isSubscribed($other) && $other->isSubscribed($this); } - function mutuallySubscribedUsers() { + function mutuallySubscribedUsers() + { # 3-way join; probably should get cached $qry = 'SELECT user.* ' . @@ -336,7 +349,8 @@ class User extends Memcached_DataObject return $user; } - function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { + function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) + { $qry = 'SELECT notice.* ' . 'FROM notice JOIN reply ON notice.id = reply.notice_id ' . @@ -346,7 +360,8 @@ class User extends Memcached_DataObject $offset, $limit, $since_id, $before_id, null, $since); } - function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { + function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) + { $profile = $this->getProfile(); if (!$profile) { return null; @@ -355,7 +370,8 @@ class User extends Memcached_DataObject } } - function favoriteNotices($offset=0, $limit=NOTICES_PER_PAGE) { + function favoriteNotices($offset=0, $limit=NOTICES_PER_PAGE) + { $qry = 'SELECT notice.* ' . 'FROM notice JOIN fave ON notice.id = fave.notice_id ' . @@ -365,7 +381,8 @@ class User extends Memcached_DataObject $offset, $limit); } - function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { + function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) + { $enabled = common_config('inboxes', 'enabled'); # Complicated code, depending on whether we support inboxes yet @@ -394,7 +411,8 @@ class User extends Memcached_DataObject $order, $since); } - function blowFavesCache() { + function blowFavesCache() + { $cache = common_memcache(); if ($cache) { # Faves don't happen chronologically, so we need to blow @@ -404,15 +422,18 @@ class User extends Memcached_DataObject } } - function getSelfTags() { + function getSelfTags() + { return Profile_tag::getTags($this->id, $this->id); } - function setSelfTags($newtags) { + function setSelfTags($newtags) + { return Profile_tag::setTags($this->id, $this->id, $newtags); } - function block($other) { + function block($other) + { # Add a new block record @@ -450,7 +471,8 @@ class User extends Memcached_DataObject return true; } - function unblock($other) { + function unblock($other) + { # Get the block record diff --git a/classes/User_openid.php b/classes/User_openid.php index 7dc476dc4..f4fda1c72 100644 --- a/classes/User_openid.php +++ b/classes/User_openid.php @@ -17,7 +17,8 @@ class User_openid extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User_openid',$k,$v); } + function staticGet($k,$v=null) + { return Memcached_DataObject::staticGet('User_openid',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/lib/Shorturl_api.php b/lib/Shorturl_api.php index 7beae0ec6..f3f4f08df 100644 --- a/lib/Shorturl_api.php +++ b/lib/Shorturl_api.php @@ -22,11 +22,13 @@ if (!defined('LACONICA')) { exit(1); } class ShortUrlApi { protected $service_url; - function __construct($service_url) { + function __construct($service_url) + { $this->service_url = $service_url; } - function shorten($url) { + function shorten($url) + { if ($this->is_long($url)) return $this->shorten_imp($url); return $url; } @@ -68,7 +70,8 @@ class ShortUrlApi { } class LilUrl extends ShortUrlApi { - function __construct() { + function __construct() + { parent::__construct('http://ur1.ca/'); } @@ -86,7 +89,8 @@ class LilUrl extends ShortUrlApi { class PtitUrl extends ShortUrlApi { - function __construct() { + function __construct() + { parent::__construct('http://ptiturl.com/?creer=oui&action=Reduire&url='); } @@ -103,7 +107,8 @@ class PtitUrl extends ShortUrlApi { } class TightUrl extends ShortUrlApi { - function __construct() { + function __construct() + { parent::__construct('http://2tu.us/?save=y&url='); } diff --git a/lib/common.php b/lib/common.php index 3e162f781..74c992f1c 100644 --- a/lib/common.php +++ b/lib/common.php @@ -163,7 +163,8 @@ require_once(INSTALLDIR.'/lib/subs.php'); require_once(INSTALLDIR.'/lib/Shorturl_api.php'); require_once(INSTALLDIR.'/lib/twitter.php'); -function __autoload($class) { +function __autoload($class) +{ if ($class == 'OAuthRequest') { require_once('OAuth.php'); } else if (file_exists(INSTALLDIR.'/classes/' . $class . '.php')) { diff --git a/lib/deleteaction.php b/lib/deleteaction.php index a7de6b8fb..a6e365121 100644 --- a/lib/deleteaction.php +++ b/lib/deleteaction.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class DeleteAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); $user = common_current_user(); $notice_id = $this->trimmed('notice'); @@ -43,7 +44,8 @@ class DeleteAction extends Action { } } - function show_top($arr=null) { + function show_top($arr=null) + { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); common_element_start('div', 'instructions'); @@ -51,11 +53,13 @@ class DeleteAction extends Action { common_element_end('div'); } - function get_title() { + function get_title() + { return null; } - function show_header() { + function show_header() + { return; } } diff --git a/lib/facebookaction.php b/lib/facebookaction.php index 731460f12..43464b19b 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -23,17 +23,20 @@ require_once(INSTALLDIR.'/extlib/facebook/facebook.php'); class FacebookAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); } - function get_facebook() { + function get_facebook() + { $apikey = common_config('facebook', 'apikey'); $secret = common_config('facebook', 'secret'); return new Facebook($apikey, $secret); } - function update_profile_box($facebook, $fbuid, $user) { + function update_profile_box($facebook, $fbuid, $user) + { $notice = $user->getCurrentNotice(); @@ -86,7 +89,8 @@ class FacebookAction extends Action { # Display methods - function show_header($selected ='Home') { + function show_header($selected ='Home') + { # Add a timestamp to the CSS file so Facebook cache wont ignore our changes $ts = filemtime(theme_file('facebookapp.css')); @@ -108,12 +112,14 @@ class FacebookAction extends Action { } - function show_footer() { + function show_footer() + { $footer = ''; echo $footer; } - function show_login_form() { + function show_login_form() + { $loginform = '

To add the Identi.ca application, you need to log into your Identi.ca account.

' @@ -148,7 +154,8 @@ class FacebookAction extends Action { echo $loginform; } - function render_notice($notice) { + function render_notice($notice) + { global $config; @@ -207,7 +214,8 @@ class FacebookAction extends Action { return $html; } - function source_link($source) { + function source_link($source) + { $source_name = _($source); $html = ''; @@ -235,7 +243,8 @@ class FacebookAction extends Action { return $html; } - function pagination($have_before, $have_after, $page, $fbaction, $args=null) { + function pagination($have_before, $have_after, $page, $fbaction, $args=null) + { $html = ''; @@ -266,7 +275,8 @@ class FacebookAction extends Action { } } - function pagination_url($fbaction, $args=null) { + function pagination_url($fbaction, $args=null) + { global $config; $extra = ''; diff --git a/lib/oauthstore.php b/lib/oauthstore.php index 421b618b7..7ec3ca655 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -25,7 +25,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { # We keep a record of who's contacted us - function lookup_consumer($consumer_key) { + function lookup_consumer($consumer_key) + { $con = Consumer::staticGet('consumer_key', $consumer_key); if (!$con) { $con = new Consumer(); @@ -39,7 +40,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { return new OAuthConsumer($con->consumer_key, ''); } - function lookup_token($consumer, $token_type, $token_key) { + function lookup_token($consumer, $token_type, $token_key) + { $t = new Token(); $t->consumer_key = $consumer->key; $t->tok = $token_key; @@ -51,7 +53,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { } } - function lookup_nonce($consumer, $token, $nonce, $timestamp) { + function lookup_nonce($consumer, $token, $nonce, $timestamp) + { $n = new Nonce(); $n->consumer_key = $consumer->key; $n->tok = $token->key; @@ -66,7 +69,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { } } - function new_request_token($consumer) { + function new_request_token($consumer) + { $t = new Token(); $t->consumer_key = $consumer->key; $t->tok = common_good_rand(16); @@ -83,11 +87,13 @@ class LaconicaOAuthDataStore extends OAuthDataStore { # defined in OAuthDataStore, but not implemented anywhere - function fetch_request_token($consumer) { + function fetch_request_token($consumer) + { return $this->new_request_token($consumer); } - function new_access_token($token, $consumer) { + function new_access_token($token, $consumer) + { common_debug('new_access_token("'.$token->key.'","'.$consumer->key.'")', __FILE__); $rt = new Token(); $rt->consumer_key = $consumer->key; @@ -138,7 +144,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { # defined in OAuthDataStore, but not implemented anywhere - function fetch_access_token($consumer) { + function fetch_access_token($consumer) + { return $this->new_access_token($consumer); } } diff --git a/lib/omb.php b/lib/omb.php index 8199b0679..c07bedab5 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -43,7 +43,8 @@ define('OAUTH_AUTH_HEADER', OAUTH_NAMESPACE.'parameters/auth-header'); define('OAUTH_POST_BODY', OAUTH_NAMESPACE.'parameters/post-body'); define('OAUTH_HMAC_SHA1', OAUTH_NAMESPACE.'signature/HMAC-SHA1'); -function omb_oauth_consumer() { +function omb_oauth_consumer() +{ static $con = null; if (!$con) { $con = new OAuthConsumer(common_root_url(), ''); @@ -51,7 +52,8 @@ function omb_oauth_consumer() { return $con; } -function omb_oauth_server() { +function omb_oauth_server() +{ static $server = null; if (!$server) { $server = new OAuthServer(omb_oauth_datastore()); @@ -60,7 +62,8 @@ function omb_oauth_server() { return $server; } -function omb_oauth_datastore() { +function omb_oauth_datastore() +{ static $store = null; if (!$store) { $store = new LaconicaOAuthDataStore(); @@ -68,7 +71,8 @@ function omb_oauth_datastore() { return $store; } -function omb_hmac_sha1() { +function omb_hmac_sha1() +{ static $hmac_method = null; if (!$hmac_method) { $hmac_method = new OAuthSignatureMethod_HMAC_SHA1(); @@ -76,20 +80,24 @@ function omb_hmac_sha1() { return $hmac_method; } -function omb_get_services($xrd, $type) { +function omb_get_services($xrd, $type) +{ return $xrd->services(array(omb_service_filter($type))); } -function omb_service_filter($type) { +function omb_service_filter($type) +{ return create_function('$s', 'return omb_match_service($s, \''.$type.'\');'); } -function omb_match_service($service, $type) { +function omb_match_service($service, $type) +{ return in_array($type, $service->getTypes()); } -function omb_service_uri($service) { +function omb_service_uri($service) +{ if (!$service) { return null; } @@ -100,7 +108,8 @@ function omb_service_uri($service) { return $uris[0]; } -function omb_local_id($service) { +function omb_local_id($service) +{ if (!$service) { return null; } @@ -112,7 +121,8 @@ function omb_local_id($service) { return $service->parser->content($el); } -function omb_broadcast_remote_subscribers($notice) { +function omb_broadcast_remote_subscribers($notice) +{ # First, get remote users subscribed to this profile $rp = new Remote_profile(); @@ -142,11 +152,13 @@ function omb_broadcast_remote_subscribers($notice) { return true; } -function omb_post_notice($notice, $remote_profile, $subscription) { +function omb_post_notice($notice, $remote_profile, $subscription) +{ return omb_post_notice_keys($notice, $remote_profile->postnoticeurl, $subscription->token, $subscription->secret); } -function omb_post_notice_keys($notice, $postnoticeurl, $tk, $secret) { +function omb_post_notice_keys($notice, $postnoticeurl, $tk, $secret) +{ common_debug('Posting notice ' . $notice->id . ' to ' . $postnoticeurl, __FILE__); @@ -216,7 +228,8 @@ function omb_post_notice_keys($notice, $postnoticeurl, $tk, $secret) { } } -function omb_broadcast_profile($profile) { +function omb_broadcast_profile($profile) +{ # First, get remote users subscribed to this profile # XXX: use a join here rather than looping through results $sub = new Subscription(); @@ -236,7 +249,8 @@ function omb_broadcast_profile($profile) { } } -function omb_update_profile($profile, $remote_profile, $subscription) { +function omb_update_profile($profile, $remote_profile, $subscription) +{ global $config; # for license URL $user = User::staticGet($profile->id); $con = omb_oauth_consumer(); diff --git a/lib/openid.php b/lib/openid.php index 3ca359fa1..1e7f318fb 100644 --- a/lib/openid.php +++ b/lib/openid.php @@ -31,7 +31,8 @@ require_once('Auth/OpenID/MySQLStore.php'); define('OPENID_COOKIE_EXPIRY', round(365.25 * 24 * 60 * 60)); define('OPENID_COOKIE_KEY', 'lastusedopenid'); -function oid_store() { +function oid_store() +{ static $store = null; if (!$store) { # Can't be called statically @@ -42,23 +43,27 @@ function oid_store() { return $store; } -function oid_consumer() { +function oid_consumer() +{ $store = oid_store(); $consumer = new Auth_OpenID_Consumer($store); return $consumer; } -function oid_clear_last() { +function oid_clear_last() +{ oid_set_last(''); } -function oid_set_last($openid_url) { +function oid_set_last($openid_url) +{ common_set_cookie(OPENID_COOKIE_KEY, $openid_url, time() + OPENID_COOKIE_EXPIRY); } -function oid_get_last() { +function oid_get_last() +{ $openid_url = $_COOKIE[OPENID_COOKIE_KEY]; if ($openid_url && strlen($openid_url) > 0) { return $openid_url; @@ -67,7 +72,8 @@ function oid_get_last() { } } -function oid_link_user($id, $canonical, $display) { +function oid_link_user($id, $canonical, $display) +{ $oid = new User_openid(); $oid->user_id = $id; @@ -84,7 +90,8 @@ function oid_link_user($id, $canonical, $display) { return true; } -function oid_get_user($openid_url) { +function oid_get_user($openid_url) +{ $user = null; $oid = User_openid::staticGet('canonical', $openid_url); if ($oid) { @@ -93,7 +100,8 @@ function oid_get_user($openid_url) { return $user; } -function oid_check_immediate($openid_url, $backto=null) { +function oid_check_immediate($openid_url, $backto=null) +{ if (!$backto) { $action = $_REQUEST['action']; $args = common_copy_args($_GET); @@ -113,7 +121,8 @@ function oid_check_immediate($openid_url, $backto=null) { true); } -function oid_authenticate($openid_url, $returnto, $immediate=false) { +function oid_authenticate($openid_url, $returnto, $immediate=false) +{ $consumer = oid_consumer(); @@ -190,7 +199,8 @@ function oid_authenticate($openid_url, $returnto, $immediate=false) { # Half-assed attempt at a module-private function -function _oid_print_instructions() { +function _oid_print_instructions() +{ common_element('div', 'instructions', _('This form should automatically submit itself. '. 'If not, click the submit button to go to your '. @@ -199,7 +209,8 @@ function _oid_print_instructions() { # update a user from sreg parameters -function oid_update_user(&$user, &$sreg) { +function oid_update_user(&$user, &$sreg) +{ $profile = $user->getProfile(); diff --git a/lib/personal.php b/lib/personal.php index 7ff9305f1..34ebe6894 100644 --- a/lib/personal.php +++ b/lib/personal.php @@ -21,16 +21,19 @@ if (!defined('LACONICA')) { exit(1); } class PersonalAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); common_set_returnto($this->self_url()); } - function views_menu() { + function views_menu() + { $user = null; $action = $this->trimmed('action'); @@ -85,7 +88,8 @@ class PersonalAction extends Action { common_element_end('ul'); } - function show_feeds_list($feeds) { + function show_feeds_list($feeds) + { common_element_start('div', array('class' => 'feeds')); common_element('p', null, 'Feeds:'); common_element_start('ul', array('class' => 'xoxo')); @@ -97,7 +101,8 @@ class PersonalAction extends Action { common_element_end('div'); } - function common_feed_item($feed) { + function common_feed_item($feed) + { $nickname = $this->trimmed('nickname'); switch($feed['item']) { @@ -181,7 +186,8 @@ class PersonalAction extends Action { } - function source_link($source) { + function source_link($source) + { $source_name = _($source); switch ($source) { case 'web': diff --git a/lib/profilelist.php b/lib/profilelist.php index 9929c8647..60737c3d4 100644 --- a/lib/profilelist.php +++ b/lib/profilelist.php @@ -28,13 +28,15 @@ class ProfileList { var $owner = null; var $action = null; - function __construct($profile, $owner=null, $action=null) { + function __construct($profile, $owner=null, $action=null) + { $this->profile = $profile; $this->owner = $owner; $this->action = $action; } - function show_list() { + function show_list() + { common_element_start('ul', array('id' => 'profiles', 'class' => 'profile_list')); @@ -53,7 +55,8 @@ class ProfileList { return $cnt; } - function show() { + function show() + { common_element_start('li', array('class' => 'profile_single', 'id' => 'profile-' . $this->profile->id)); @@ -159,11 +162,13 @@ class ProfileList { /* Override this in subclasses. */ - function show_owner_controls($profile) { + function show_owner_controls($profile) + { return; } - function highlight($text) { + function highlight($text) + { return htmlspecialchars($text); } } \ No newline at end of file diff --git a/lib/queuehandler.php b/lib/queuehandler.php index ecf58f69f..48487f8e9 100644 --- a/lib/queuehandler.php +++ b/lib/queuehandler.php @@ -29,43 +29,53 @@ class QueueHandler extends Daemon { var $_id = 'generic'; - function QueueHandler($id=null) { + function QueueHandler($id=null) + { if ($id) { $this->set_id($id); } } - function class_name() { + function class_name() + { return ucfirst($this->transport()) . 'Handler'; } - function name() { + function name() + { return strtolower($this->class_name().'.'.$this->get_id()); } - function get_id() { + function get_id() + { return $this->_id; } - function set_id($id) { + function set_id($id) + { $this->_id = $id; } - function transport() { + function transport() + { return null; } - function start() { + function start() + { } - function finish() { + function finish() + { } - function handle_notice($notice) { + function handle_notice($notice) + { return true; } - function run() { + function run() + { if (!$this->start()) { return false; } @@ -110,13 +120,15 @@ class QueueHandler extends Daemon { return true; } - function idle($timeout=0) { + function idle($timeout=0) + { if ($timeout>0) { sleep($timeout); } } - function clear_old_claims() { + function clear_old_claims() + { $qi = new Queue_item(); $qi->transport = $this->transport(); $qi->whereAdd('now() - claimed > '.CLAIM_TIMEOUT); @@ -125,7 +137,8 @@ class QueueHandler extends Daemon { unset($qi); } - function log($level, $msg) { + function log($level, $msg) + { common_log($level, $this->class_name() . ' ('. $this->get_id() .'): '.$msg); } } diff --git a/lib/rssaction.php b/lib/rssaction.php index a21ce3a97..e02e1febb 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -26,11 +26,13 @@ class Rss10Action extends Action { # This will contain the details of each feed item's author and be used to generate SIOC data. var $creators = array(); - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); $limit = (int) $this->trimmed('limit'); if ($limit == 0) { @@ -39,26 +41,31 @@ class Rss10Action extends Action { $this->show_rss($limit); } - function init() { + function init() + { return true; } - function get_notices() { + function get_notices() + { return array(); } - function get_channel() { + function get_channel() + { return array('url' => '', 'title' => '', 'link' => '', 'description' => ''); } - function get_image() { + function get_image() + { return null; } - function show_rss($limit=0) { + function show_rss($limit=0) + { if (!$this->init()) { return; @@ -78,7 +85,8 @@ class Rss10Action extends Action { $this->end_rss(); } - function show_channel($notices) { + function show_channel($notices) + { $channel = $this->get_channel(); $image = $this->get_image(); @@ -106,7 +114,8 @@ class Rss10Action extends Action { common_element_end('channel'); } - function show_image() { + function show_image() + { $image = $this->get_image(); if ($image) { $channel = $this->get_channel(); @@ -118,7 +127,8 @@ class Rss10Action extends Action { } } - function show_item($notice) { + function show_item($notice) + { $profile = Profile::staticGet($notice->profile_id); $nurl = common_local_url('shownotice', array('notice' => $notice->id)); $creator_uri = common_profile_uri($profile); @@ -136,7 +146,8 @@ class Rss10Action extends Action { $this->creators[$creator_uri] = $profile; } - function show_creators() { + function show_creators() + { foreach ($this->creators as $uri => $profile) { $id = $profile->id; $nickname = $profile->nickname; @@ -152,7 +163,8 @@ class Rss10Action extends Action { } } - function init_rss() { + function init_rss() + { $channel = $this->get_channel(); header('Content-Type: application/rdf+xml'); @@ -183,7 +195,8 @@ class Rss10Action extends Action { common_element_end('sioc:Site'); } - function end_rss() { + function end_rss() + { common_element_end('rdf:RDF'); } } diff --git a/lib/search_engines.php b/lib/search_engines.php index d53d7d8d8..e96570d63 100644 --- a/lib/search_engines.php +++ b/lib/search_engines.php @@ -23,19 +23,23 @@ class SearchEngine { protected $target; protected $table; - function __construct($target, $table) { + function __construct($target, $table) + { $this->target = $target; $this->table = $table; } - function query($q) { + function query($q) + { } - function limit($offset, $count, $rss = false) { + function limit($offset, $count, $rss = false) + { return $this->target->limit($offset, $count); } - function set_sort_mode($mode) { + function set_sort_mode($mode) + { if ('chron' === $mode) return $this->target->orderBy('created desc'); } @@ -45,7 +49,8 @@ class SphinxSearch extends SearchEngine { private $sphinx; private $connected; - function __construct($target, $table) { + function __construct($target, $table) + { $fp = @fsockopen(common_config('sphinx', 'server'), common_config('sphinx', 'port')); if (!$fp) { $this->connected = false; @@ -58,11 +63,13 @@ class SphinxSearch extends SearchEngine { $this->connected = true; } - function is_connected() { + function is_connected() + { return $this->connected; } - function limit($offset, $count, $rss = false) { + function limit($offset, $count, $rss = false) + { //FIXME without LARGEST_POSSIBLE, the most recent results aren't returned // this probably has a large impact on performance $LARGEST_POSSIBLE = 1e6; @@ -78,7 +85,8 @@ class SphinxSearch extends SearchEngine { return $this->target->limit(0, $count); } - function query($q) { + function query($q) + { $result = $this->sphinx->query($q, $this->table); if (!isset($result['matches'])) return false; $id_set = join(', ', array_keys($result['matches'])); @@ -86,7 +94,8 @@ class SphinxSearch extends SearchEngine { return true; } - function set_sort_mode($mode) { + function set_sort_mode($mode) + { if ('chron' === $mode) { $this->sphinx->SetSortMode(SPH_SORT_ATTR_DESC, 'created_ts'); return $this->target->orderBy('created desc'); @@ -95,7 +104,8 @@ class SphinxSearch extends SearchEngine { } class MySQLSearch extends SearchEngine { - function query($q) { + function query($q) + { if ('identica_people' === $this->table) return $this->target->whereAdd('MATCH(nickname, fullname, location, bio, homepage) ' . 'against (\''.addslashes($q).'\')'); @@ -106,7 +116,8 @@ class MySQLSearch extends SearchEngine { } class PGSearch extends SearchEngine { - function query($q) { + function query($q) + { if ('identica_people' === $this->table) return $this->target->whereAdd('textsearch @@ plainto_tsquery(\''.addslashes($q).'\')'); if ('identica_notices' === $this->table) diff --git a/lib/searchaction.php b/lib/searchaction.php index 3eec91832..12a44a861 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -21,16 +21,19 @@ if (!defined('LACONICA')) { exit(1); } class SearchAction extends Action { - function is_readonly() { + function is_readonly() + { return true; } - function handle($args) { + function handle($args) + { parent::handle($args); $this->show_form(); } - function show_top($arr=null) { + function show_top($arr=null) + { if ($arr) { $error = $arr[1]; } @@ -46,15 +49,18 @@ class SearchAction extends Action { $this->search_menu(); } - function get_title() { + function get_title() + { return null; } - function show_header($arr) { + function show_header($arr) + { return; } - function show_form($error=null) { + function show_form($error=null) + { global $config; $q = $this->trimmed('q'); @@ -91,7 +97,8 @@ class SearchAction extends Action { common_show_footer(); } - function search_menu() { + function search_menu() + { # action => array('prompt', 'title', $args) $action = $this->trimmed('action'); $menu = diff --git a/lib/settingsaction.php b/lib/settingsaction.php index 208d2a1b6..5979c11f0 100644 --- a/lib/settingsaction.php +++ b/lib/settingsaction.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } class SettingsAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_user_error(_('Not logged in.')); @@ -40,29 +41,34 @@ class SettingsAction extends Action { } # override! - function handle_post() { + function handle_post() + { return false; } - function show_form($msg=null, $success=false) { + function show_form($msg=null, $success=false) + { return false; } - function message($msg, $success) { + function message($msg, $success) + { if ($msg) { common_element('div', ($success) ? 'success' : 'error', $msg); } } - function form_header($title, $msg=null, $success=false) { + function form_header($title, $msg=null, $success=false) + { common_show_header($title, null, array($msg, $success), array($this, 'show_top')); } - function show_top($arr) { + function show_top($arr) + { $msg = $arr[0]; $success = $arr[1]; if ($msg) { @@ -77,7 +83,8 @@ class SettingsAction extends Action { $this->settings_menu(); } - function settings_menu() { + function settings_menu() + { # action => array('prompt', 'title') $menu = array('profilesettings' => diff --git a/lib/stream.php b/lib/stream.php index 2d45df2d3..45fbb9bd9 100644 --- a/lib/stream.php +++ b/lib/stream.php @@ -24,7 +24,8 @@ require_once(INSTALLDIR.'/lib/noticelist.php'); class StreamAction extends PersonalAction { - function public_views_menu() { + function public_views_menu() + { $action = $this->trimmed('action'); @@ -48,7 +49,8 @@ class StreamAction extends PersonalAction { } - function show_notice_list($notice) { + function show_notice_list($notice) + { $nl = new NoticeList($notice); return $nl->show(); } diff --git a/lib/subs.php b/lib/subs.php index 55e74e0b2..6fa1dcad3 100644 --- a/lib/subs.php +++ b/lib/subs.php @@ -25,7 +25,8 @@ require_once('XMPPHP/XMPP.php'); Returns true or an error message. */ -function subs_subscribe_user($user, $other_nickname) { +function subs_subscribe_user($user, $other_nickname) +{ $other = User::staticGet('nickname', $other_nickname); @@ -41,7 +42,8 @@ function subs_subscribe_user($user, $other_nickname) { * Because the other way is quite a bit more complicated. */ -function subs_subscribe_to($user, $other) { +function subs_subscribe_to($user, $other) +{ if ($user->isSubscribed($other)) { return _('Already subscribed!.'); @@ -82,14 +84,16 @@ function subs_subscribe_to($user, $other) { return true; } -function subs_notify($listenee, $listener) { +function subs_notify($listenee, $listener) +{ # XXX: add other notifications (Jabber, SMS) here # XXX: queue this and handle it offline # XXX: Whatever happens, do it in Twitter-like API, too subs_notify_email($listenee, $listener); } -function subs_notify_email($listenee, $listener) { +function subs_notify_email($listenee, $listener) +{ mail_subscribe_notify($listenee, $listener); } @@ -97,7 +101,8 @@ function subs_notify_email($listenee, $listener) { Returns true or an error message. */ -function subs_unsubscribe_user($user, $other_nickname) { +function subs_unsubscribe_user($user, $other_nickname) +{ $other = User::staticGet('nickname', $other_nickname); @@ -111,7 +116,8 @@ function subs_unsubscribe_user($user, $other_nickname) { /* Unsubscribe user $user from profile $other * NB: other can be a remote user. */ -function subs_unsubscribe_to($user, $other) { +function subs_unsubscribe_to($user, $other) +{ if (!$user->isSubscribed($other)) return _('Not subscribed!.'); diff --git a/lib/theme.php b/lib/theme.php index 346cff434..6f365bd99 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -19,12 +19,14 @@ if (!defined('LACONICA')) { exit(1); } -function theme_file($relative) { +function theme_file($relative) +{ $theme = common_config('site', 'theme'); return INSTALLDIR.'/theme/'.$theme.'/'.$relative; } -function theme_path($relative) { +function theme_path($relative) +{ $theme = common_config('site', 'theme'); $server = common_config('theme', 'server'); if ($server) { diff --git a/lib/twitter.php b/lib/twitter.php index 1212875ea..07871fb20 100644 --- a/lib/twitter.php +++ b/lib/twitter.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -function get_twitter_data($uri, $screen_name, $password) { +function get_twitter_data($uri, $screen_name, $password) +{ $options = array( CURLOPT_USERPWD => sprintf("%s:%s", $screen_name, $password), @@ -48,7 +49,8 @@ function get_twitter_data($uri, $screen_name, $password) { return $data; } -function twitter_user_info($screen_name, $password) { +function twitter_user_info($screen_name, $password) +{ $uri = "http://twitter.com/users/show/$screen_name.json"; $data = get_twitter_data($uri, $screen_name, $password); @@ -66,7 +68,8 @@ function twitter_user_info($screen_name, $password) { return $twit_user; } -function update_twitter_user($fuser, $twitter_id, $screen_name) { +function update_twitter_user($fuser, $twitter_id, $screen_name) +{ $original = clone($fuser); $fuser->nickname = $screen_name; @@ -81,7 +84,8 @@ function update_twitter_user($fuser, $twitter_id, $screen_name) { return true; } -function add_twitter_user($twitter_id, $screen_name) { +function add_twitter_user($twitter_id, $screen_name) +{ // Otherwise, create a new Twitter user $fuser = DB_DataObject::factory('foreign_user'); @@ -105,7 +109,8 @@ function add_twitter_user($twitter_id, $screen_name) { } // Creates or Updates a Twitter user -function save_twitter_user($twitter_id, $screen_name) { +function save_twitter_user($twitter_id, $screen_name) +{ // Check to see whether the Twitter user is already in the system, // and update its screen name and uri if so. @@ -129,7 +134,8 @@ function save_twitter_user($twitter_id, $screen_name) { return true; } -function retreive_twitter_friends($twitter_id, $screen_name, $password) { +function retreive_twitter_friends($twitter_id, $screen_name, $password) +{ $uri = "http://twitter.com/statuses/friends/$twitter_id.json?page="; $twitter_user = twitter_user_info($screen_name, $password); @@ -163,7 +169,8 @@ function retreive_twitter_friends($twitter_id, $screen_name, $password) { return $friends; } -function save_twitter_friends($user, $twitter_id, $screen_name, $password) { +function save_twitter_friends($user, $twitter_id, $screen_name, $password) +{ $friends = retreive_twitter_friends($twitter_id, $screen_name, $password); diff --git a/lib/twitterapi.php b/lib/twitterapi.php index ed86c77c4..3cddfa9c9 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -23,11 +23,13 @@ class TwitterapiAction extends Action { var $auth_user; - function handle($args) { + function handle($args) + { parent::handle($args); } - function twitter_user_array($profile, $get_notice=false) { + function twitter_user_array($profile, $get_notice=false) + { $twitter_user = array(); @@ -55,7 +57,8 @@ class TwitterapiAction extends Action { return $twitter_user; } - function twitter_status_array($notice, $include_user=true) { + function twitter_status_array($notice, $include_user=true) + { $profile = $notice->getProfile(); @@ -83,7 +86,8 @@ class TwitterapiAction extends Action { return $twitter_status; } - function twitter_rss_entry_array($notice) { + function twitter_rss_entry_array($notice) + { $profile = $notice->getProfile(); @@ -107,7 +111,8 @@ class TwitterapiAction extends Action { return $entry; } - function twitter_rss_dmsg_array($message) { + function twitter_rss_dmsg_array($message) + { $server = common_config('site', 'server'); $entry = array(); @@ -129,7 +134,8 @@ class TwitterapiAction extends Action { return $entry; } - function twitter_dmsg_array($message) { + function twitter_dmsg_array($message) + { $twitter_dm = array(); @@ -149,7 +155,8 @@ class TwitterapiAction extends Action { return $twitter_dm; } - function show_twitter_xml_status($twitter_status) { + function show_twitter_xml_status($twitter_status) + { common_element_start('status'); foreach($twitter_status as $element => $value) { switch ($element) { @@ -166,7 +173,8 @@ class TwitterapiAction extends Action { common_element_end('status'); } - function show_twitter_xml_user($twitter_user, $role='user') { + function show_twitter_xml_user($twitter_user, $role='user') + { common_element_start($role); foreach($twitter_user as $element => $value) { if ($element == 'status') { @@ -178,7 +186,8 @@ class TwitterapiAction extends Action { common_element_end($role); } - function show_twitter_rss_item($entry) { + function show_twitter_rss_item($entry) + { common_element_start('item'); common_element('title', null, $entry['title']); common_element('description', null, $entry['description']); @@ -188,7 +197,8 @@ class TwitterapiAction extends Action { common_element_end('item'); } - function show_twitter_atom_entry($entry) { + function show_twitter_atom_entry($entry) + { common_element_start('entry'); common_element('title', null, $entry['title']); common_element('content', array('type' => 'html'), $entry['content']); @@ -199,39 +209,45 @@ class TwitterapiAction extends Action { common_element_end('entry'); } - function show_json_objects($objects) { + function show_json_objects($objects) + { print(json_encode($objects)); } - function show_single_xml_status($notice) { + function show_single_xml_status($notice) + { $this->init_document('xml'); $twitter_status = $this->twitter_status_array($notice); $this->show_twitter_xml_status($twitter_status); $this->end_document('xml'); } - function show_single_json_status($notice) { + function show_single_json_status($notice) + { $this->init_document('json'); $status = $this->twitter_status_array($notice); $this->show_json_objects($status); $this->end_document('json'); } - function show_single_xml_dmsg($message) { + function show_single_xml_dmsg($message) + { $this->init_document('xml'); $dmsg = $this->twitter_dmsg_array($message); $this->show_twitter_xml_dmsg($dmsg); $this->end_document('xml'); } - function show_single_json_dmsg($message) { + function show_single_json_dmsg($message) + { $this->init_document('json'); $dmsg = $this->twitter_dmsg_array($message); $this->show_json_objects($dmsg); $this->end_document('json'); } - function show_twitter_xml_dmsg($twitter_dm) { + function show_twitter_xml_dmsg($twitter_dm) + { common_element_start('direct_message'); foreach($twitter_dm as $element => $value) { switch ($element) { @@ -249,7 +265,8 @@ class TwitterapiAction extends Action { common_element_end('direct_message'); } - function show_xml_timeline($notice) { + function show_xml_timeline($notice) + { $this->init_document('xml'); common_element_start('statuses', array('type' => 'array')); @@ -270,7 +287,8 @@ class TwitterapiAction extends Action { $this->end_document('xml'); } - function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=null) { + function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=null) + { $this->init_document('rss'); @@ -304,7 +322,8 @@ class TwitterapiAction extends Action { $this->end_twitter_rss(); } - function show_atom_timeline($notice, $title, $id, $link, $subtitle=null, $suplink=null) { + function show_atom_timeline($notice, $title, $id, $link, $subtitle=null, $suplink=null) + { $this->init_document('atom'); @@ -335,7 +354,8 @@ class TwitterapiAction extends Action { } - function show_json_timeline($notice) { + function show_json_timeline($notice) + { $this->init_document('json'); @@ -360,12 +380,14 @@ class TwitterapiAction extends Action { // Anyone know what date format this is? // Twitter's dates look like this: "Mon Jul 14 23:52:38 +0000 2008" -- Zach - function date_twitter($dt) { + function date_twitter($dt) + { $t = strtotime($dt); return date("D M d G:i:s O Y", $t); } - function replier_by_reply($reply_id) { + function replier_by_reply($reply_id) + { $notice = Notice::staticGet($reply_id); if ($notice) { $profile = $notice->getProfile(); @@ -381,7 +403,8 @@ class TwitterapiAction extends Action { } // XXX: Candidate for a general utility method somewhere? - function count_subscriptions($profile) { + function count_subscriptions($profile) + { $count = 0; $sub = new Subscription(); @@ -396,7 +419,8 @@ class TwitterapiAction extends Action { } } - function init_document($type='xml') { + function init_document($type='xml') + { switch ($type) { case 'xml': header('Content-Type: application/xml; charset=utf-8'); @@ -427,7 +451,8 @@ class TwitterapiAction extends Action { return; } - function end_document($type='xml') { + function end_document($type='xml') + { switch ($type) { case 'xml': common_end_xml(); @@ -453,7 +478,8 @@ class TwitterapiAction extends Action { return; } - function client_error($msg, $code = 400, $content_type = 'json') { + function client_error($msg, $code = 400, $content_type = 'json') + { static $status = array(400 => 'Bad Request', 401 => 'Unauthorized', @@ -501,27 +527,32 @@ class TwitterapiAction extends Action { } - function init_twitter_rss() { + function init_twitter_rss() + { common_start_xml(); common_element_start('rss', array('version' => '2.0')); } - function end_twitter_rss() { + function end_twitter_rss() + { common_element_end('rss'); common_end_xml(); } - function init_twitter_atom() { + function init_twitter_atom() + { common_start_xml(); common_element_start('feed', array('xmlns' => 'http://www.w3.org/2005/Atom', 'xml:lang' => 'en-US')); } - function end_twitter_atom() { + function end_twitter_atom() + { common_end_xml(); common_element_end('feed'); } - function show_profile($profile, $content_type='xml', $notice=null) { + function show_profile($profile, $content_type='xml', $notice=null) + { $profile_array = $this->twitter_user_array($profile, true); switch ($content_type) { case 'xml': @@ -537,7 +568,8 @@ class TwitterapiAction extends Action { return; } - function get_user($id, $apidata=null) { + function get_user($id, $apidata=null) + { if (!$id) { return $apidata['user']; } else if (is_numeric($id)) { @@ -548,7 +580,8 @@ class TwitterapiAction extends Action { } } - function get_profile($id) { + function get_profile($id) + { if (is_numeric($id)) { return Profile::staticGet($id); } else { @@ -561,7 +594,8 @@ class TwitterapiAction extends Action { } } - function source_link($source) { + function source_link($source) + { $source_name = _($source); switch ($source) { case 'web': @@ -580,7 +614,8 @@ class TwitterapiAction extends Action { return $source_name; } - function show_extended_profile($user, $apidata) { + function show_extended_profile($user, $apidata) + { $this->auth_user = $apidata['user']; diff --git a/lib/util.php b/lib/util.php index f0387ebe5..ed73b19e6 100644 --- a/lib/util.php +++ b/lib/util.php @@ -21,7 +21,8 @@ // Show a server error -function common_server_error($msg, $code=500) { +function common_server_error($msg, $code=500) +{ static $status = array(500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', @@ -44,7 +45,8 @@ function common_server_error($msg, $code=500) { } // Show a user error -function common_user_error($msg, $code=400) { +function common_user_error($msg, $code=400) +{ static $status = array(400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', @@ -80,7 +82,8 @@ function common_user_error($msg, $code=400) { $xw = null; // Start an HTML element -function common_element_start($tag, $attrs=null) { +function common_element_start($tag, $attrs=null) +{ global $xw; $xw->startElement($tag); if (is_array($attrs)) { @@ -92,7 +95,8 @@ function common_element_start($tag, $attrs=null) { } } -function common_element_end($tag) { +function common_element_end($tag) +{ static $empty_tag = array('base', 'meta', 'link', 'hr', 'br', 'param', 'img', 'area', 'input', 'col'); @@ -105,7 +109,8 @@ function common_element_end($tag) { } } -function common_element($tag, $attrs=null, $content=null) { +function common_element($tag, $attrs=null, $content=null) +{ common_element_start($tag, $attrs); global $xw; if (!is_null($content)) { @@ -114,7 +119,8 @@ function common_element($tag, $attrs=null, $content=null) { common_element_end($tag); } -function common_start_xml($doc=null, $public=null, $system=null, $indent=true) { +function common_start_xml($doc=null, $public=null, $system=null, $indent=true) +{ global $xw; $xw = new XMLWriter(); $xw->openURI('php://output'); @@ -125,13 +131,15 @@ function common_start_xml($doc=null, $public=null, $system=null, $indent=true) { } } -function common_end_xml() { +function common_end_xml() +{ global $xw; $xw->endDocument(); $xw->flush(); } -function common_init_locale($language=null) { +function common_init_locale($language=null) +{ if(!$language) { $language = common_language(); } @@ -144,7 +152,8 @@ function common_init_locale($language=null) { $language); } -function common_init_language() { +function common_init_language() +{ mb_internal_encoding('UTF-8'); $language = common_language(); // So we don't have to make people install the gettext locales @@ -160,7 +169,8 @@ function common_init_language() { define('PAGE_TYPE_PREFS', 'text/html,application/xhtml+xml,application/xml;q=0.3,text/xml;q=0.2'); -function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) { +function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) +{ global $config, $xw; global $action; /* XXX: kind of cheating here. */ @@ -243,7 +253,8 @@ function common_show_header($pagetitle, $callable=null, $data=null, $headercall= common_element_start('div', array('id' => 'content')); } -function common_start_html($type=null, $indent=true) { +function common_start_html($type=null, $indent=true) +{ if (!$type) { $httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : null; @@ -274,7 +285,8 @@ function common_start_html($type=null, $indent=true) { 'lang' => $language)); } -function common_show_footer() { +function common_show_footer() +{ global $xw, $config; common_element_end('div'); // content div common_foot_menu(); @@ -307,17 +319,20 @@ function common_show_footer() { common_end_xml(); } -function common_text($txt) { +function common_text($txt) +{ global $xw; $xw->text($txt); } -function common_raw($xml) { +function common_raw($xml) +{ global $xw; $xw->writeRaw($xml); } -function common_nav_menu() { +function common_nav_menu() +{ $user = common_current_user(); common_element_start('ul', array('id' => 'nav')); if ($user) { @@ -344,7 +359,8 @@ function common_nav_menu() { common_element_end('ul'); } -function common_foot_menu() { +function common_foot_menu() +{ common_element_start('ul', array('id' => 'nav_sub')); common_menu_item(common_local_url('doc', array('title' => 'help')), _('Help')); @@ -361,7 +377,8 @@ function common_foot_menu() { common_element_end('ul'); } -function common_menu_item($url, $text, $title=null, $is_selected=false) { +function common_menu_item($url, $text, $title=null, $is_selected=false) +{ $lattrs = array(); if ($is_selected) { $lattrs['class'] = 'current'; @@ -375,7 +392,8 @@ function common_menu_item($url, $text, $title=null, $is_selected=false) { common_element_end('li'); } -function common_input($id, $label, $value=null,$instructions=null) { +function common_input($id, $label, $value=null,$instructions=null) +{ common_element_start('p'); common_element('label', array('for' => $id), $label); $attrs = array('name' => $id, @@ -418,7 +436,8 @@ function common_checkbox($id, $label, $checked=false, $instructions=null, $value common_element_end('p'); } -function common_dropdown($id, $label, $content, $instructions=null, $blank_select=FALSE, $selected=null) { +function common_dropdown($id, $label, $content, $instructions=null, $blank_select=FALSE, $selected=null) +{ common_element_start('p'); common_element('label', array('for' => $id), $label); common_element_start('select', array('id' => $id, 'name' => $id)); @@ -438,14 +457,16 @@ function common_dropdown($id, $label, $content, $instructions=null, $blank_selec } common_element_end('p'); } -function common_hidden($id, $value) { +function common_hidden($id, $value) +{ common_element('input', array('name' => $id, 'type' => 'hidden', 'id' => $id, 'value' => $value)); } -function common_password($id, $label, $instructions=null) { +function common_password($id, $label, $instructions=null) +{ common_element_start('p'); common_element('label', array('for' => $id), $label); $attrs = array('name' => $id, @@ -459,7 +480,8 @@ function common_password($id, $label, $instructions=null) { common_element_end('p'); } -function common_submit($id, $label, $cls='submit') { +function common_submit($id, $label, $cls='submit') +{ global $xw; common_element_start('p'); common_element('input', array('type' => 'submit', @@ -470,7 +492,8 @@ function common_submit($id, $label, $cls='submit') { common_element_end('p'); } -function common_textarea($id, $label, $content=null, $instructions=null) { +function common_textarea($id, $label, $content=null, $instructions=null) +{ common_element_start('p'); common_element('label', array('for' => $id), $label); common_element('textarea', array('rows' => 3, @@ -484,7 +507,8 @@ function common_textarea($id, $label, $content=null, $instructions=null) { common_element_end('p'); } -function common_timezone() { +function common_timezone() +{ if (common_logged_in()) { $user = common_current_user(); if ($user->timezone) { @@ -496,7 +520,8 @@ function common_timezone() { return $config['site']['timezone']; } -function common_language() { +function common_language() +{ // If there is a user logged in and they've set a language preference // then return that one... @@ -521,12 +546,14 @@ function common_language() { } // salted, hashed passwords are stored in the DB -function common_munge_password($password, $id) { +function common_munge_password($password, $id) +{ return md5($password . $id); } // check if a username exists and has matching password -function common_check_user($nickname, $password) { +function common_check_user($nickname, $password) +{ // NEVER allow blank passwords, even if they match the DB if (mb_strlen($password) == 0) { return false; @@ -545,15 +572,18 @@ function common_check_user($nickname, $password) { } // is the current user logged in? -function common_logged_in() { +function common_logged_in() +{ return (!is_null(common_current_user())); } -function common_have_session() { +function common_have_session() +{ return (0 != strcmp(session_id(), '')); } -function common_ensure_session() { +function common_ensure_session() +{ if (!common_have_session()) { @session_start(); } @@ -568,7 +598,8 @@ function common_ensure_session() { $_cur = false; -function common_set_user($user) { +function common_set_user($user) +{ global $_cur; @@ -592,7 +623,8 @@ function common_set_user($user) { return false; } -function common_set_cookie($key, $value, $expiration=0) { +function common_set_cookie($key, $value, $expiration=0) +{ $path = common_config('site', 'path'); $server = common_config('site', 'server'); @@ -611,7 +643,8 @@ function common_set_cookie($key, $value, $expiration=0) { define('REMEMBERME', 'rememberme'); define('REMEMBERME_EXPIRY', 30 * 24 * 60 * 60); // 30 days -function common_rememberme($user=null) { +function common_rememberme($user=null) +{ if (!$user) { $user = common_current_user(); if (!$user) { @@ -650,7 +683,8 @@ function common_rememberme($user=null) { return true; } -function common_remembered_user() { +function common_remembered_user() +{ $user = null; @@ -715,12 +749,14 @@ function common_remembered_user() { // must be called with a valid user! -function common_forgetme() { +function common_forgetme() +{ common_set_cookie(REMEMBERME, '', 0); } // who is the current user? -function common_current_user() { +function common_current_user() +{ global $_cur; if ($_cur === false) { @@ -752,23 +788,27 @@ function common_current_user() { // cookie-stealing. So, we don't let them do certain things. New reg, // OpenID, and password logins _are_ real. -function common_real_login($real=true) { +function common_real_login($real=true) +{ common_ensure_session(); $_SESSION['real_login'] = $real; } -function common_is_real_login() { +function common_is_real_login() +{ return common_logged_in() && $_SESSION['real_login']; } // get canonical version of nickname for comparison -function common_canonical_nickname($nickname) { +function common_canonical_nickname($nickname) +{ // XXX: UTF-8 canonicalization (like combining chars) return strtolower($nickname); } // get canonical version of email for comparison -function common_canonical_email($email) { +function common_canonical_email($email) +{ // XXX: canonicalize UTF-8 // XXX: lcase the domain part return $email; @@ -776,7 +816,8 @@ function common_canonical_email($email) { define('URL_REGEX', '^|[ \t\r\n])((ftp|http|https|gopher|mailto|news|nntp|telnet|wais|file|prospero|aim|webcal):(([A-Za-z0-9$_.+!*(),;/?:@&~=-])|%[A-Fa-f0-9]{2}){2,}(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*(),;/?:@&~=%-]*))?([A-Za-z0-9$_+!*();/?:~-]))'); -function common_render_content($text, $notice) { +function common_render_content($text, $notice) +{ $r = common_render_text($text); $id = $notice->profile_id; $r = preg_replace('/(^|\s+)@([A-Za-z0-9]{1,64})/e', "'\\1@'.common_at_link($id, '\\2')", $r); @@ -785,7 +826,8 @@ function common_render_content($text, $notice) { return $r; } -function common_render_text($text) { +function common_render_text($text) +{ $r = htmlspecialchars($text); $r = preg_replace('/[\x{0}-\x{8}\x{b}-\x{c}\x{e}-\x{19}]/', '', $r); @@ -795,7 +837,8 @@ function common_render_text($text) { return $r; } -function common_render_uri_thingy($matches) { +function common_render_uri_thingy($matches) +{ $uri = $matches[0]; $trailer = ''; @@ -829,20 +872,23 @@ function common_render_uri_thingy($matches) { return '' . $uri . '' . $trailer; } -function common_longurl($short_url) { +function common_longurl($short_url) +{ $long_url = common_shorten_link($short_url, true); if ($long_url === $short_url) return false; return $long_url; } -function common_longurl2($uri) { +function common_longurl2($uri) +{ $uri_e = urlencode($uri); $longurl = unserialize(file_get_contents("http://api.longurl.org/v1/expand?format=php&url=$uri_e")); if (empty($longurl['long_url']) || $uri === $longurl['long_url']) return false; return stripslashes($longurl['long_url']); } -function common_shorten_links($text) { +function common_shorten_links($text) +{ if (mb_strlen($text) <= 140) return $text; static $cache = array(); if (isset($cache[$text])) return $cache[$text]; @@ -850,7 +896,8 @@ function common_shorten_links($text) { return $cache[$text] = preg_replace('@https?://[^)\]>\s]+@e', "common_shorten_link('\\0')", $text); } -function common_shorten_link($url, $reverse = false) { +function common_shorten_link($url, $reverse = false) +{ static $url_cache = array(); if ($reverse) return isset($url_cache[$url]) ? $url_cache[$url] : $url; @@ -911,28 +958,33 @@ function common_shorten_link($url, $reverse = false) { return $url; } -function common_xml_safe_str($str) { +function common_xml_safe_str($str) +{ $xmlStr = htmlentities(iconv('UTF-8', 'UTF-8//IGNORE', $str), ENT_NOQUOTES, 'UTF-8'); // Replace control, formatting, and surrogate characters with '*', ala Twitter return preg_replace('/[\p{Cc}\p{Cf}\p{Cs}]/u', '*', $str); } -function common_tag_link($tag) { +function common_tag_link($tag) +{ $canonical = common_canonical_tag($tag); $url = common_local_url('tag', array('tag' => $canonical)); return ''; } -function common_canonical_tag($tag) { +function common_canonical_tag($tag) +{ return strtolower(str_replace(array('-', '_', '.'), '', $tag)); } -function common_valid_profile_tag($str) { +function common_valid_profile_tag($str) +{ return preg_match('/^[A-Za-z0-9_\-\.]{1,64}$/', $str); } -function common_at_link($sender_id, $nickname) { +function common_at_link($sender_id, $nickname) +{ $sender = Profile::staticGet($sender_id); $recipient = common_relative_profile($sender, common_canonical_nickname($nickname)); if ($recipient) { @@ -942,7 +994,8 @@ function common_at_link($sender_id, $nickname) { } } -function common_at_hash_link($sender_id, $tag) { +function common_at_hash_link($sender_id, $tag) +{ $user = User::staticGet($sender_id); if (!$user) { return $tag; @@ -958,7 +1011,8 @@ function common_at_hash_link($sender_id, $tag) { } } -function common_relative_profile($sender, $nickname, $dt=null) { +function common_relative_profile($sender, $nickname, $dt=null) +{ // Try to find profiles this profile is subscribed to that have this nickname $recipient = new Profile(); // XXX: use a join instead of a subquery @@ -995,7 +1049,8 @@ function common_relative_profile($sender, $nickname, $dt=null) { // where should the avatar go for this user? -function common_avatar_filename($id, $extension, $size=null, $extra=null) { +function common_avatar_filename($id, $extension, $size=null, $extra=null) +{ global $config; if ($size) { @@ -1005,16 +1060,19 @@ function common_avatar_filename($id, $extension, $size=null, $extra=null) { } } -function common_avatar_path($filename) { +function common_avatar_path($filename) +{ global $config; return INSTALLDIR . '/avatar/' . $filename; } -function common_avatar_url($filename) { +function common_avatar_url($filename) +{ return common_path('avatar/'.$filename); } -function common_avatar_display_url($avatar) { +function common_avatar_display_url($avatar) +{ $server = common_config('avatar', 'server'); if ($server) { return 'http://'.$server.'/'.$avatar->filename; @@ -1023,14 +1081,16 @@ function common_avatar_display_url($avatar) { } } -function common_default_avatar($size) { +function common_default_avatar($size) +{ static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile', AVATAR_STREAM_SIZE => 'stream', AVATAR_MINI_SIZE => 'mini'); return theme_path('default-avatar-'.$sizenames[$size].'.png'); } -function common_local_url($action, $args=null, $fragment=null) { +function common_local_url($action, $args=null, $fragment=null) +{ $url = null; if (common_config('site','fancy')) { $url = common_fancy_url($action, $args); @@ -1043,7 +1103,8 @@ function common_local_url($action, $args=null, $fragment=null) { return $url; } -function common_fancy_url($action, $args=null) { +function common_fancy_url($action, $args=null) +{ switch (strtolower($action)) { case 'public': if ($args && isset($args['page'])) { @@ -1256,7 +1317,8 @@ function common_fancy_url($action, $args=null) { } } -function common_simple_url($action, $args=null) { +function common_simple_url($action, $args=null) +{ global $config; /* XXX: pretty URLs */ $extra = ''; @@ -1268,13 +1330,15 @@ function common_simple_url($action, $args=null) { return common_path("index.php?action=${action}${extra}"); } -function common_path($relative) { +function common_path($relative) +{ global $config; $pathpart = ($config['site']['path']) ? $config['site']['path']."/" : ''; return "http://".$config['site']['server'].'/'.$pathpart.$relative; } -function common_date_string($dt) { +function common_date_string($dt) +{ // XXX: do some sexy date formatting // return date(DATE_RFC822, $dt); $t = strtotime($dt); @@ -1308,7 +1372,8 @@ function common_date_string($dt) { } } -function common_exact_date($dt) { +function common_exact_date($dt) +{ static $_utc; static $_siteTz; @@ -1323,32 +1388,37 @@ function common_exact_date($dt) { return $d->format(DATE_RFC850); } -function common_date_w3dtf($dt) { +function common_date_w3dtf($dt) +{ $dateStr = date('d F Y H:i:s', strtotime($dt)); $d = new DateTime($dateStr, new DateTimeZone('UTC')); $d->setTimezone(new DateTimeZone(common_timezone())); return $d->format(DATE_W3C); } -function common_date_rfc2822($dt) { +function common_date_rfc2822($dt) +{ $dateStr = date('d F Y H:i:s', strtotime($dt)); $d = new DateTime($dateStr, new DateTimeZone('UTC')); $d->setTimezone(new DateTimeZone(common_timezone())); return $d->format('r'); } -function common_date_iso8601($dt) { +function common_date_iso8601($dt) +{ $dateStr = date('d F Y H:i:s', strtotime($dt)); $d = new DateTime($dateStr, new DateTimeZone('UTC')); $d->setTimezone(new DateTimeZone(common_timezone())); return $d->format('c'); } -function common_sql_now() { +function common_sql_now() +{ return strftime('%Y-%m-%d %H:%M:%S', time()); } -function common_redirect($url, $code=307) { +function common_redirect($url, $code=307) +{ static $status = array(301 => "Moved Permanently", 302 => "Found", 303 => "See Other", @@ -1364,7 +1434,8 @@ function common_redirect($url, $code=307) { exit; } -function common_save_replies($notice) { +function common_save_replies($notice) +{ // Alternative reply format $tname = false; if (preg_match('/^T ([A-Z0-9]{1,64}) /', $notice->content, $match)) { @@ -1447,7 +1518,8 @@ function common_save_replies($notice) { } } -function common_broadcast_notice($notice, $remote=false) { +function common_broadcast_notice($notice, $remote=false) +{ // Check to see if notice should go to Twitter $flink = Foreign_link::getByUserID($notice->profile_id, 1); // 1 == Twitter @@ -1474,7 +1546,8 @@ function common_broadcast_notice($notice, $remote=false) { } } -function common_twitter_broadcast($notice, $flink) { +function common_twitter_broadcast($notice, $flink) +{ global $config; $success = true; $fuser = $flink->getForeignUser(); @@ -1534,7 +1607,8 @@ function common_twitter_broadcast($notice, $flink) { // Stick the notice on the queue -function common_enqueue_notice($notice) { +function common_enqueue_notice($notice) +{ foreach (array('jabber', 'omb', 'sms', 'public') as $transport) { $qi = new Queue_item(); $qi->notice_id = $notice->id; @@ -1551,7 +1625,8 @@ function common_enqueue_notice($notice) { return $result; } -function common_dequeue_notice($notice) { +function common_dequeue_notice($notice) +{ $qi = Queue_item::staticGet($notice->id); if ($qi) { $result = $qi->delete(); @@ -1567,7 +1642,8 @@ function common_dequeue_notice($notice) { } } -function common_real_broadcast($notice, $remote=false) { +function common_real_broadcast($notice, $remote=false) +{ $success = true; if (!$remote) { // Make sure we have the OMB stuff @@ -1601,7 +1677,8 @@ function common_real_broadcast($notice, $remote=false) { return $success; } -function common_broadcast_profile($profile) { +function common_broadcast_profile($profile) +{ // XXX: optionally use a queue system like http://code.google.com/p/microapps/wiki/NQDQ require_once(INSTALLDIR.'/lib/omb.php'); omb_broadcast_profile($profile); @@ -1609,13 +1686,15 @@ function common_broadcast_profile($profile) { return true; } -function common_profile_url($nickname) { +function common_profile_url($nickname) +{ return common_local_url('showstream', array('nickname' => $nickname)); } // Don't call if nobody's logged in -function common_notice_form($action=null, $content=null) { +function common_notice_form($action=null, $content=null) +{ $user = common_current_user(); assert(!is_null($user)); common_element_start('form', array('id' => 'status_form', @@ -1647,14 +1726,16 @@ function common_notice_form($action=null, $content=null) { // Should make up a reasonable root URL -function common_root_url() { +function common_root_url() +{ return common_path(''); } // returns $bytes bytes of random data as a hexadecimal string // "good" here is a goal and not a guarantee -function common_good_rand($bytes) { +function common_good_rand($bytes) +{ // XXX: use random.org...? if (file_exists('/dev/urandom')) { return common_urandom($bytes); @@ -1663,7 +1744,8 @@ function common_good_rand($bytes) { } } -function common_urandom($bytes) { +function common_urandom($bytes) +{ $h = fopen('/dev/urandom', 'rb'); // should not block $src = fread($h, $bytes); @@ -1675,7 +1757,8 @@ function common_urandom($bytes) { return $enc; } -function common_mtrand($bytes) { +function common_mtrand($bytes) +{ $enc = ''; for ($i = 0; $i < $bytes; $i++) { $enc .= sprintf("%02x", mt_rand(0, 255)); @@ -1683,21 +1766,25 @@ function common_mtrand($bytes) { return $enc; } -function common_set_returnto($url) { +function common_set_returnto($url) +{ common_ensure_session(); $_SESSION['returnto'] = $url; } -function common_get_returnto() { +function common_get_returnto() +{ common_ensure_session(); return $_SESSION['returnto']; } -function common_timestamp() { +function common_timestamp() +{ return date('YmdHis'); } -function common_ensure_syslog() { +function common_ensure_syslog() +{ static $initialized = false; if (!$initialized) { global $config; @@ -1706,7 +1793,8 @@ function common_ensure_syslog() { } } -function common_log($priority, $msg, $filename=null) { +function common_log($priority, $msg, $filename=null) +{ $logfile = common_config('site', 'logfile'); if ($logfile) { $log = fopen($logfile, "a"); @@ -1723,7 +1811,8 @@ function common_log($priority, $msg, $filename=null) { } } -function common_debug($msg, $filename=null) { +function common_debug($msg, $filename=null) +{ if ($filename) { common_log(LOG_DEBUG, basename($filename).' - '.$msg); } else { @@ -1731,13 +1820,15 @@ function common_debug($msg, $filename=null) { } } -function common_log_db_error(&$object, $verb, $filename=null) { +function common_log_db_error(&$object, $verb, $filename=null) +{ $objstr = common_log_objstring($object); $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError'); common_log(LOG_ERR, $last_error->message . '(' . $verb . ' on ' . $objstr . ')', $filename); } -function common_log_objstring(&$object) { +function common_log_objstring(&$object) +{ if (is_null($object)) { return "null"; } @@ -1750,11 +1841,13 @@ function common_log_objstring(&$object) { return $objstring; } -function common_valid_http_url($url) { +function common_valid_http_url($url) +{ return Validate::uri($url, array('allowed_schemes' => array('http', 'https'))); } -function common_valid_tag($tag) { +function common_valid_tag($tag) +{ if (preg_match('/^tag:(.*?),(\d{4}(-\d{2}(-\d{2})?)?):(.*)$/', $tag, $matches)) { return (Validate::email($matches[1]) || preg_match('/^([\w-\.]+)$/', $matches[1])); @@ -1764,7 +1857,8 @@ function common_valid_tag($tag) { // Does a little before-after block for next/prev page -function common_pagination($have_before, $have_after, $page, $action, $args=null) { +function common_pagination($have_before, $have_after, $page, $action, $args=null) +{ if ($have_before || $have_after) { common_element_start('div', array('id' => 'pagination')); @@ -1799,7 +1893,8 @@ function common_pagination($have_before, $have_after, $page, $action, $args=null /* Following functions are copied from MediaWiki GlobalFunctions.php * and written by Evan Prodromou. */ -function common_accept_to_prefs($accept, $def = '*/*') { +function common_accept_to_prefs($accept, $def = '*/*') +{ // No arg means accept anything (per HTTP spec) if(!$accept) { return array($def => 1); @@ -1823,7 +1918,8 @@ function common_accept_to_prefs($accept, $def = '*/*') { return $prefs; } -function common_mime_type_match($type, $avail) { +function common_mime_type_match($type, $avail) +{ if(array_key_exists($type, $avail)) { return $type; } else { @@ -1838,7 +1934,8 @@ function common_mime_type_match($type, $avail) { } } -function common_negotiate_type($cprefs, $sprefs) { +function common_negotiate_type($cprefs, $sprefs) +{ $combine = array(); foreach(array_keys($sprefs) as $type) { @@ -1874,12 +1971,14 @@ function common_negotiate_type($cprefs, $sprefs) { return $besttype; } -function common_config($main, $sub) { +function common_config($main, $sub) +{ global $config; return isset($config[$main][$sub]) ? $config[$main][$sub] : false; } -function common_copy_args($from) { +function common_copy_args($from) +{ $to = array(); $strip = get_magic_quotes_gpc(); foreach ($from as $k => $v) { @@ -1890,25 +1989,29 @@ function common_copy_args($from) { // Neutralise the evil effects of magic_quotes_gpc in the current request. // This is used before handing a request off to OAuthRequest::from_request. -function common_remove_magic_from_request() { +function common_remove_magic_from_request() +{ if(get_magic_quotes_gpc()) { $_POST=array_map('stripslashes',$_POST); $_GET=array_map('stripslashes',$_GET); } } -function common_user_uri(&$user) { +function common_user_uri(&$user) +{ return common_local_url('userbyid', array('id' => $user->id)); } -function common_notice_uri(&$notice) { +function common_notice_uri(&$notice) +{ return common_local_url('shownotice', array('notice' => $notice->id)); } // 36 alphanums - lookalikes (0, O, 1, I) = 32 chars = 5 bits -function common_confirmation_code($bits) { +function common_confirmation_code($bits) +{ // 36 alphanums - lookalikes (0, O, 1, I) = 32 chars = 5 bits static $codechars = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ'; $chars = ceil($bits/5); @@ -1925,14 +2028,16 @@ function common_confirmation_code($bits) { // convert markup to HTML -function common_markup_to_html($c) { +function common_markup_to_html($c) +{ $c = preg_replace('/%%action.(\w+)%%/e', "common_local_url('\\1')", $c); $c = preg_replace('/%%doc.(\w+)%%/e', "common_local_url('doc', array('title'=>'\\1'))", $c); $c = preg_replace('/%%(\w+).(\w+)%%/e', 'common_config(\'\\1\', \'\\2\')', $c); return Markdown($c); } -function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) { +function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) +{ $avatar = $profile->getAvatar($size); if ($avatar) { return common_avatar_display_url($avatar); @@ -1941,7 +2046,8 @@ function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) { } } -function common_profile_uri($profile) { +function common_profile_uri($profile) +{ if (!$profile) { return null; } @@ -1958,13 +2064,15 @@ function common_profile_uri($profile) { return null; } -function common_canonical_sms($sms) { +function common_canonical_sms($sms) +{ // strip non-digits preg_replace('/\D/', '', $sms); return $sms; } -function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext) { +function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext) +{ switch ($errno) { case E_USER_ERROR: common_log(LOG_ERR, "[$errno] $errstr ($errfile:$errline)"); @@ -1985,7 +2093,8 @@ function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext) return true; } -function common_session_token() { +function common_session_token() +{ common_ensure_session(); if (!array_key_exists('token', $_SESSION)) { $_SESSION['token'] = common_good_rand(64); @@ -1993,7 +2102,8 @@ function common_session_token() { return $_SESSION['token']; } -function common_disfavor_form($notice) { +function common_disfavor_form($notice) +{ common_element_start('form', array('id' => 'disfavor-' . $notice->id, 'method' => 'post', 'class' => 'disfavor', @@ -2020,7 +2130,8 @@ function common_disfavor_form($notice) { common_element_end('form'); } -function common_favor_form($notice) { +function common_favor_form($notice) +{ common_element_start('form', array('id' => 'favor-' . $notice->id, 'method' => 'post', 'class' => 'favor', @@ -2047,7 +2158,8 @@ function common_favor_form($notice) { common_element_end('form'); } -function common_nudge_form($profile) { +function common_nudge_form($profile) +{ common_element_start('form', array('id' => 'nudge', 'method' => 'post', 'action' => common_local_url('nudge', array('nickname' => $profile->nickname)))); common_hidden('token', common_session_token()); @@ -2056,11 +2168,13 @@ function common_nudge_form($profile) { 'value' => _('Send a nudge'))); common_element_end('form'); } -function common_nudge_response() { +function common_nudge_response() +{ common_element('p', array('id' => 'nudge_response'), _('Nudge sent!')); } -function common_subscribe_form($profile) { +function common_subscribe_form($profile) +{ common_element_start('form', array('id' => 'subscribe-' . $profile->id, 'method' => 'post', 'class' => 'subscribe', @@ -2076,7 +2190,8 @@ function common_subscribe_form($profile) { common_element_end('form'); } -function common_unsubscribe_form($profile) { +function common_unsubscribe_form($profile) +{ common_element_start('form', array('id' => 'unsubscribe-' . $profile->id, 'method' => 'post', 'class' => 'unsubscribe', @@ -2093,7 +2208,8 @@ function common_unsubscribe_form($profile) { } // XXX: Refactor this code -function common_profile_new_message_nudge ($cur, $profile) { +function common_profile_new_message_nudge ($cur, $profile) +{ $user = User::staticGet('id', $profile->id); if ($cur && $cur->id != $user->id && $cur->mutuallySubscribed($user)) { @@ -2110,17 +2226,20 @@ function common_profile_new_message_nudge ($cur, $profile) { } } -function common_cache_key($extra) { +function common_cache_key($extra) +{ return 'laconica:' . common_keyize(common_config('site', 'name')) . ':' . $extra; } -function common_keyize($str) { +function common_keyize($str) +{ $str = strtolower($str); $str = preg_replace('/\s/', '_', $str); return $str; } -function common_message_form($content, $user, $to) { +function common_message_form($content, $user, $to) +{ common_element_start('form', array('id' => 'message_form', 'method' => 'post', @@ -2160,7 +2279,8 @@ function common_message_form($content, $user, $to) { common_element_end('form'); } -function common_memcache() { +function common_memcache() +{ static $cache = null; if (!common_config('memcached', 'enabled')) { return null; @@ -2180,22 +2300,26 @@ function common_memcache() { } } -function common_compatible_license($from, $to) { +function common_compatible_license($from, $to) +{ // XXX: better compatibility check needed here! return ($from == $to); } /* These are almost identical, so we use a helper function */ -function common_block_form($profile, $args=null) { +function common_block_form($profile, $args=null) +{ common_blocking_form('block', _('Block'), $profile, $args); } -function common_unblock_form($profile, $args=null) { +function common_unblock_form($profile, $args=null) +{ common_blocking_form('unblock', _('Unblock'), $profile, $args); } -function common_blocking_form($type, $label, $profile, $args=null) { +function common_blocking_form($type, $label, $profile, $args=null) +{ common_element_start('form', array('id' => $type . '-' . $profile->id, 'method' => 'post', 'class' => $type, diff --git a/lib/xmppqueuehandler.php b/lib/xmppqueuehandler.php index 10c754a5b..0a73403f9 100644 --- a/lib/xmppqueuehandler.php +++ b/lib/xmppqueuehandler.php @@ -30,7 +30,8 @@ require_once(INSTALLDIR.'/lib/queuehandler.php'); class XmppQueueHandler extends QueueHandler { - function start() { + function start() + { # Low priority; we don't want to receive messages $this->log(LOG_INFO, "INITIALIZE"); $this->conn = jabber_connect($this->_id); @@ -43,12 +44,14 @@ class XmppQueueHandler extends QueueHandler { return !is_null($this->conn); } - function handle_reconnect(&$pl) { + function handle_reconnect(&$pl) + { $this->conn->processUntil('session_start'); $this->conn->presence(null, 'available', null, 'available', -1); } - function idle($timeout=0) { + function idle($timeout=0) + { # Process the queue for as long as needed try { if ($this->conn) { @@ -60,7 +63,8 @@ class XmppQueueHandler extends QueueHandler { } } - function forward_message(&$pl) { + function forward_message(&$pl) + { if ($pl['type'] != 'chat') { $this->log(LOG_DEBUG, 'Ignoring message of type ' . $pl['type'] . ' from ' . $pl['from']); return; @@ -74,14 +78,16 @@ class XmppQueueHandler extends QueueHandler { $this->conn->message($this->listener(), $pl['body'], 'chat', null, $this->ofrom($pl['from'])); } - function ofrom($from) { + function ofrom($from) + { $address = "\n"; $address .= "
\n"; $address .= "\n"; return $address; } - function listener() { + function listener() + { if (common_config('xmpp', 'listener')) { return common_config('xmpp', 'listener'); } else { diff --git a/scripts/enjitqueuehandler.php b/scripts/enjitqueuehandler.php index 1c033603f..55d73e08c 100755 --- a/scripts/enjitqueuehandler.php +++ b/scripts/enjitqueuehandler.php @@ -35,17 +35,20 @@ set_error_handler('common_error_handler'); class EnjitQueueHandler extends QueueHandler { - function transport() { + function transport() + { return 'enjit'; } - function start() { + function start() + { $this->log(LOG_INFO, "Starting EnjitQueueHandler"); $this->log(LOG_INFO, "Broadcasting to ".common_config('enjit', 'apiurl')); return true; } - function handle_notice($notice) { + function handle_notice($notice) + { $profile = Profile::staticGet($notice->profile_id); diff --git a/scripts/jabberqueuehandler.php b/scripts/jabberqueuehandler.php index 271aab22b..ea26aaf79 100755 --- a/scripts/jabberqueuehandler.php +++ b/scripts/jabberqueuehandler.php @@ -37,11 +37,13 @@ class JabberQueueHandler extends XmppQueueHandler { var $conn = null; - function transport() { + function transport() + { return 'jabber'; } - function handle_notice($notice) { + function handle_notice($notice) + { try { return jabber_broadcast_notice($notice); } catch (XMPPHP_Exception $e) { diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index 886e72ba7..6100cd21b 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -36,10 +36,12 @@ require_once('Mail/mimeDecode.php'); class MailerDaemon { - function __construct() { + function __construct() + { } - function handle_message($fname='php://stdin') { + function handle_message($fname='php://stdin') + { list($from, $to, $msg) = $this->parse_message($fname); if (!$from || !$to || !$msg) { $this->error(null, _('Could not parse message.')); @@ -66,12 +68,14 @@ class MailerDaemon { $this->add_notice($user, $msg); } - function error($from, $msg) { + function error($from, $msg) + { file_put_contents("php://stderr", $msg . "\n"); exit(1); } - function user_from($from_hdr) { + function user_from($from_hdr) + { $froms = mailparse_rfc822_parse_addresses($from_hdr); if (!$froms) { return null; @@ -85,7 +89,8 @@ class MailerDaemon { return $user; } - function user_match_to($user, $to_hdr) { + function user_match_to($user, $to_hdr) + { $incoming = $user->incomingemail; $tos = mailparse_rfc822_parse_addresses($to_hdr); foreach ($tos as $to) { @@ -96,7 +101,8 @@ class MailerDaemon { return false; } - function handle_command($user, $from, $msg) { + function handle_command($user, $from, $msg) + { $inter = new CommandInterpreter(); $cmd = $inter->handle_command($user, $msg); if ($cmd) { @@ -106,7 +112,8 @@ class MailerDaemon { return false; } - function respond($from, $to, $response) { + function respond($from, $to, $response) + { $headers['From'] = $to; $headers['To'] = $from; @@ -115,11 +122,13 @@ class MailerDaemon { return mail_send(array($from), $headers, $response); } - function log($level, $msg) { + function log($level, $msg) + { common_log($level, 'MailDaemon: '.$msg); } - function add_notice($user, $msg) { + function add_notice($user, $msg) + { // should test // $msg_shortened = common_shorten_links($msg); // if (mb_strlen($msg_shortened) > 140) ERROR and STOP @@ -133,7 +142,8 @@ class MailerDaemon { 'Added notice ' . $notice->id . ' from user ' . $user->nickname); } - function parse_message($fname) { + function parse_message($fname) + { $contents = file_get_contents($fname); $parsed = Mail_mimeDecode::decode(array('input' => $contents, 'include_bodies' => true, @@ -166,11 +176,13 @@ class MailerDaemon { return array($from, $to, $msg); } - function unsupported_type($type) { + function unsupported_type($type) + { $this->error(null, "Unsupported message type: " . $type); } - function cleanup_msg($msg) { + function cleanup_msg($msg) + { $lines = explode("\n", $msg); $output = ''; diff --git a/scripts/ombqueuehandler.php b/scripts/ombqueuehandler.php index 43c0980b6..299381ace 100755 --- a/scripts/ombqueuehandler.php +++ b/scripts/ombqueuehandler.php @@ -35,16 +35,19 @@ set_error_handler('common_error_handler'); class OmbQueueHandler extends QueueHandler { - function transport() { + function transport() + { return 'omb'; } - function start() { + function start() + { $this->log(LOG_INFO, "INITIALIZE"); return true; } - function handle_notice($notice) { + function handle_notice($notice) + { if ($this->is_remote($notice)) { $this->log(LOG_DEBUG, 'Ignoring remote notice ' . $notice->id); return true; @@ -53,10 +56,12 @@ class OmbQueueHandler extends QueueHandler { } } - function finish() { + function finish() + { } - function is_remote($notice) { + function is_remote($notice) + { $user = User::staticGet($notice->profile_id); return is_null($user); } diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php index 2168aade2..b3542e5c5 100755 --- a/scripts/publicqueuehandler.php +++ b/scripts/publicqueuehandler.php @@ -35,11 +35,13 @@ set_error_handler('common_error_handler'); class PublicQueueHandler extends XmppQueueHandler { - function transport() { + function transport() + { return 'public'; } - function handle_notice($notice) { + function handle_notice($notice) + { try { return jabber_public_notice($notice); } catch (XMPPHP_Exception $e) { diff --git a/scripts/sitemap.php b/scripts/sitemap.php index b49bfe2a5..504783e88 100644 --- a/scripts/sitemap.php +++ b/scripts/sitemap.php @@ -18,7 +18,8 @@ index_map(); # ------------------------------------------------------------------------------ # Generate index sitemap of all other sitemaps. -function index_map() { +function index_map() +{ global $output_paths; $output_dir = $output_paths['output_dir']; $output_url = $output_paths['output_url']; @@ -40,7 +41,8 @@ function index_map() { } # Generate sitemap of standard site elements. -function standard_map() { +function standard_map() +{ global $output_paths; $standard_map_urls .= url( @@ -77,7 +79,8 @@ function standard_map() { } # Generate sitemaps of all notices. -function notices_map() { +function notices_map() +{ global $output_paths; $notices = DB_DataObject::factory('notice'); @@ -115,7 +118,8 @@ function notices_map() { } # Generate sitemaps of all users. -function user_map() { +function user_map() +{ global $output_paths; $users = DB_DataObject::factory('user'); @@ -208,7 +212,8 @@ function user_map() { # ------------------------------------------------------------------------------ # Generate a element. -function url($url_args) { +function url($url_args) +{ $url = preg_replace('/&/', '&', $url_args['url']); # escape ampersands for XML $lastmod = $url_args['lastmod']; $changefreq = $url_args['changefreq']; @@ -238,7 +243,8 @@ function url($url_args) { return $url_out; } -function sitemap($sitemap_args) { +function sitemap($sitemap_args) +{ $url = preg_replace('/&/', '&', $sitemap_args['url']); # escape ampersands for XML $lastmod = $sitemap_args['lastmod']; @@ -259,7 +265,8 @@ function sitemap($sitemap_args) { } # Generate a element. -function urlset($urlset_text) { +function urlset($urlset_text) +{ $urlset = '' . "\n" . '' . "\n" . $urlset_text . @@ -269,7 +276,8 @@ function urlset($urlset_text) { } # Generate a element. -function sitemapindex($sitemapindex_text) { +function sitemapindex($sitemapindex_text) +{ $sitemapindex = '' . "\n" . '' . "\n" . $sitemapindex_text . @@ -279,7 +287,8 @@ function sitemapindex($sitemapindex_text) { } # Generate a sitemap from an array containing elements and write it to a file. -function array_to_map($url_list, $filename_prefix) { +function array_to_map($url_list, $filename_prefix) +{ global $output_paths; if ($url_list) { @@ -297,7 +306,8 @@ function array_to_map($url_list, $filename_prefix) { # ------------------------------------------------------------------------------ # Parse command line arguments. -function parse_args() { +function parse_args() +{ $args = getopt('f:d:u:'); if (is_null($args[f]) && is_null($args[d]) && is_null($args[u])) { @@ -338,7 +348,8 @@ function parse_args() { } # Ensure paths end with a "/". -function trailing_slash($path) { +function trailing_slash($path) +{ if (preg_match('/\/$/', $path) == 0) { $path .= '/'; } @@ -347,7 +358,8 @@ function trailing_slash($path) { } # Write data to disk. -function write_file($path, $data) { +function write_file($path, $data) +{ if (is_null($path)) { error('No path specified for writing to.'); } elseif (is_null($data)) { @@ -364,7 +376,8 @@ function write_file($path, $data) { } # Display an error message and exit. -function error ($error_msg) { +function error ($error_msg) +{ if (is_null($error_msg)) { $error_msg = 'error() was called without any explanation!'; } diff --git a/scripts/smsqueuehandler.php b/scripts/smsqueuehandler.php index f8b2e9d53..c962ad095 100755 --- a/scripts/smsqueuehandler.php +++ b/scripts/smsqueuehandler.php @@ -35,20 +35,24 @@ set_error_handler('common_error_handler'); class SmsQueueHandler extends QueueHandler { - function transport() { + function transport() + { return 'sms'; } - function start() { + function start() + { $this->log(LOG_INFO, "INITIALIZE"); return true; } - function handle_notice($notice) { + function handle_notice($notice) + { return mail_broadcast_notice_sms($notice); } - function finish() { + function finish() + { } } diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index 9e177b3fa..b059149bc 100755 --- a/scripts/xmppconfirmhandler.php +++ b/scripts/xmppconfirmhandler.php @@ -39,11 +39,13 @@ class XmppConfirmHandler extends XmppQueueHandler { var $_id = 'confirm'; - function class_name() { + function class_name() + { return 'XmppConfirmHandler'; } - function run() { + function run() + { if (!$this->start()) { return false; } @@ -99,7 +101,8 @@ class XmppConfirmHandler extends XmppQueueHandler { return true; } - function next_confirm() { + function next_confirm() + { $confirm = new Confirm_address(); $confirm->whereAdd('claimed IS null'); $confirm->whereAdd('sent IS null'); @@ -125,7 +128,8 @@ class XmppConfirmHandler extends XmppQueueHandler { return null; } - function clear_old_confirm_claims() { + function clear_old_confirm_claims() + { $confirm = new Confirm(); $confirm->claimed = null; $confirm->whereAdd('now() - claimed > '.CLAIM_TIMEOUT); diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index ead842928..28ac64725 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -39,7 +39,8 @@ set_error_handler('common_error_handler'); class XMPPDaemon extends Daemon { - function XMPPDaemon($resource=null) { + function XMPPDaemon($resource=null) + { static $attrs = array('server', 'port', 'user', 'password', 'host'); foreach ($attrs as $attr) @@ -56,7 +57,8 @@ class XMPPDaemon extends Daemon { $this->log(LOG_INFO, "INITIALIZE XMPPDaemon {$this->user}@{$this->server}/{$this->resource}"); } - function connect() { + function connect() + { $connect_to = ($this->host) ? $this->host : $this->server; @@ -75,11 +77,13 @@ class XMPPDaemon extends Daemon { return !$this->conn->isDisconnected(); } - function name() { + function name() + { return strtolower('xmppdaemon.'.$this->resource); } - function run() { + function run() + { if ($this->connect()) { $this->conn->addEventHandler('message', 'handle_message', $this); @@ -90,17 +94,20 @@ class XMPPDaemon extends Daemon { } } - function handle_reconnect(&$pl) { + function handle_reconnect(&$pl) + { $this->conn->processUntil('session_start'); $this->conn->presence('Send me a message to post a notice', 'available', null, 'available', 100); } - function get_user($from) { + function get_user($from) + { $user = User::staticGet('jabber', jabber_normalize_jid($from)); return $user; } - function handle_message(&$pl) { + function handle_message(&$pl) + { if ($pl['type'] != 'chat') { return; } @@ -156,11 +163,13 @@ class XMPPDaemon extends Daemon { unset($user); } - function is_self($from) { + function is_self($from) + { return preg_match('/^'.strtolower(jabber_daemon_address()).'/', strtolower($from)); } - function get_ofrom($pl) { + function get_ofrom($pl) + { $xml = $pl['xml']; $addresses = $xml->sub('addresses'); if (!$addresses) { @@ -194,7 +203,8 @@ class XMPPDaemon extends Daemon { return $jid; } - function is_autoreply($txt) { + function is_autoreply($txt) + { if (preg_match('/[\[\(]?[Aa]uto[-\s]?[Rr]e(ply|sponse)[\]\)]/', $txt)) { return true; } else { @@ -202,7 +212,8 @@ class XMPPDaemon extends Daemon { } } - function is_otr($txt) { + function is_otr($txt) + { if (preg_match('/^\?OTR/', $txt)) { return true; } else { @@ -210,7 +221,8 @@ class XMPPDaemon extends Daemon { } } - function is_direct($txt) { + function is_direct($txt) + { if (strtolower(substr($txt, 0, 2))=='d ') { return true; } else { @@ -218,12 +230,14 @@ class XMPPDaemon extends Daemon { } } - function from_site($address, $msg) { + function from_site($address, $msg) + { $text = '['.common_config('site', 'name') . '] ' . $msg; jabber_send_message($address, $text); } - function handle_command($user, $body) { + function handle_command($user, $body) + { $inter = new CommandInterpreter(); $cmd = $inter->handle_command($user, $body); if ($cmd) { @@ -235,7 +249,8 @@ class XMPPDaemon extends Daemon { } } - function add_notice(&$user, &$pl) { + function add_notice(&$user, &$pl) + { $body = trim($pl['body']); $content_shortened = common_shorten_link($body); if (mb_strlen($content_shortened) > 140) { @@ -257,7 +272,8 @@ class XMPPDaemon extends Daemon { unset($notice); } - function handle_presence(&$pl) { + function handle_presence(&$pl) + { $from = jabber_normalize_jid($pl['from']); switch ($pl['type']) { case 'subscribe': @@ -291,11 +307,13 @@ class XMPPDaemon extends Daemon { } } - function log($level, $msg) { + function log($level, $msg) + { common_log($level, 'XMPPDaemon('.$this->resource.'): '.$msg); } - function subscribed($to) { + function subscribed($to) + { jabber_special_presence('subscribed', $to); } } -- cgit v1.2.3-54-g00ecf From b264c03d32d04d7a33d28a5830848660f4484943 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 23 Dec 2008 14:49:23 -0500 Subject: move opening brace of class declaration to next line Another gigantor PEAR coding standards patch. Here, I've moved the opening curly bracket on a class statement to the following line. darcs-hash:20081223194923-84dde-77a93de314caadbcb5b70bf346a4648be77a864e.gz --- _darcs/inventory | 7 + ...dde-77a93de314caadbcb5b70bf346a4648be77a864e.gz | Bin 0 -> 2725 bytes _darcs/pristine/actions/accesstoken.php | 3 +- _darcs/pristine/actions/all.php | 3 +- _darcs/pristine/actions/allrss.php | 3 +- _darcs/pristine/actions/api.php | 3 +- _darcs/pristine/actions/avatarbynickname.php | 3 +- _darcs/pristine/actions/block.php | 3 +- _darcs/pristine/actions/confirmaddress.php | 3 +- _darcs/pristine/actions/deletenotice.php | 3 +- _darcs/pristine/actions/deleteprofile.php | 3 +- _darcs/pristine/actions/disfavor.php | 3 +- _darcs/pristine/actions/doc.php | 3 +- _darcs/pristine/actions/emailsettings.php | 3 +- _darcs/pristine/actions/facebookhome.php | 3 +- _darcs/pristine/actions/facebookinvite.php | 3 +- _darcs/pristine/actions/facebookremove.php | 3 +- _darcs/pristine/actions/facebooksettings.php | 3 +- _darcs/pristine/actions/favor.php | 3 +- _darcs/pristine/actions/favorited.php | 3 +- _darcs/pristine/actions/favoritesrss.php | 3 +- _darcs/pristine/actions/featured.php | 3 +- _darcs/pristine/actions/finishaddopenid.php | 3 +- _darcs/pristine/actions/finishimmediate.php | 3 +- _darcs/pristine/actions/finishopenidlogin.php | 3 +- _darcs/pristine/actions/finishremotesubscribe.php | 3 +- _darcs/pristine/actions/foaf.php | 3 +- _darcs/pristine/actions/imsettings.php | 3 +- _darcs/pristine/actions/invite.php | 3 +- _darcs/pristine/actions/login.php | 3 +- _darcs/pristine/actions/logout.php | 3 +- _darcs/pristine/actions/microsummary.php | 3 +- _darcs/pristine/actions/newmessage.php | 3 +- _darcs/pristine/actions/newnotice.php | 3 +- _darcs/pristine/actions/noticesearch.php | 3 +- _darcs/pristine/actions/noticesearchrss.php | 3 +- _darcs/pristine/actions/nudge.php | 3 +- _darcs/pristine/actions/openidlogin.php | 3 +- _darcs/pristine/actions/openidsettings.php | 3 +- _darcs/pristine/actions/opensearch.php | 3 +- _darcs/pristine/actions/othersettings.php | 3 +- _darcs/pristine/actions/peoplesearch.php | 6 +- _darcs/pristine/actions/peopletag.php | 3 +- _darcs/pristine/actions/postnotice.php | 3 +- _darcs/pristine/actions/profilesettings.php | 3 +- _darcs/pristine/actions/public.php | 3 +- _darcs/pristine/actions/publicrss.php | 3 +- _darcs/pristine/actions/publicxrds.php | 3 +- _darcs/pristine/actions/recoverpassword.php | 3 +- _darcs/pristine/actions/register.php | 3 +- _darcs/pristine/actions/remotesubscribe.php | 3 +- _darcs/pristine/actions/replies.php | 3 +- _darcs/pristine/actions/repliesrss.php | 3 +- _darcs/pristine/actions/requesttoken.php | 3 +- _darcs/pristine/actions/showfavorites.php | 3 +- _darcs/pristine/actions/showmessage.php | 3 +- _darcs/pristine/actions/shownotice.php | 3 +- _darcs/pristine/actions/showstream.php | 9 +- _darcs/pristine/actions/smssettings.php | 3 +- _darcs/pristine/actions/subedit.php | 3 +- _darcs/pristine/actions/subscribe.php | 3 +- _darcs/pristine/actions/subscribers.php | 6 +- _darcs/pristine/actions/subscriptions.php | 6 +- _darcs/pristine/actions/sup.php | 3 +- _darcs/pristine/actions/tag.php | 3 +- _darcs/pristine/actions/tagother.php | 3 +- _darcs/pristine/actions/tagrss.php | 3 +- _darcs/pristine/actions/twitapiaccount.php | 3 +- _darcs/pristine/actions/twitapiblocks.php | 3 +- _darcs/pristine/actions/twitapidirect_messages.php | 3 +- _darcs/pristine/actions/twitapifavorites.php | 3 +- _darcs/pristine/actions/twitapifriendships.php | 3 +- _darcs/pristine/actions/twitapihelp.php | 3 +- _darcs/pristine/actions/twitapinotifications.php | 3 +- _darcs/pristine/actions/twitapistatuses.php | 3 +- _darcs/pristine/actions/twitapiusers.php | 3 +- _darcs/pristine/actions/twittersettings.php | 3 +- _darcs/pristine/actions/unblock.php | 3 +- _darcs/pristine/actions/unsubscribe.php | 3 +- _darcs/pristine/actions/updateprofile.php | 3 +- _darcs/pristine/actions/userauthorization.php | 3 +- _darcs/pristine/actions/userbyid.php | 3 +- _darcs/pristine/actions/userrss.php | 3 +- _darcs/pristine/actions/xrds.php | 3 +- _darcs/pristine/classes/Channel.php | 15 +- _darcs/pristine/classes/Command.php | 54 +- _darcs/pristine/classes/CommandInterpreter.php | 3 +- _darcs/pristine/classes/NoticeWrapper.php | 3 +- _darcs/pristine/lib/Shorturl_api.php | 12 +- _darcs/pristine/lib/deleteaction.php | 3 +- _darcs/pristine/lib/facebookaction.php | 3 +- _darcs/pristine/lib/oauthstore.php | 27 +- _darcs/pristine/lib/personal.php | 3 +- _darcs/pristine/lib/profilelist.php | 3 +- _darcs/pristine/lib/queuehandler.php | 3 +- _darcs/pristine/lib/rssaction.php | 3 +- _darcs/pristine/lib/search_engines.php | 12 +- _darcs/pristine/lib/searchaction.php | 3 +- _darcs/pristine/lib/settingsaction.php | 3 +- _darcs/pristine/lib/stream.php | 3 +- _darcs/pristine/lib/twitterapi.php | 3 +- _darcs/pristine/lib/xmppqueuehandler.php | 3 +- _darcs/pristine/scripts/enjitqueuehandler.php | 3 +- _darcs/pristine/scripts/jabberqueuehandler.php | 3 +- _darcs/pristine/scripts/maildaemon.php | 3 +- _darcs/pristine/scripts/ombqueuehandler.php | 3 +- _darcs/pristine/scripts/publicqueuehandler.php | 3 +- _darcs/pristine/scripts/smsqueuehandler.php | 3 +- _darcs/pristine/scripts/xmppconfirmhandler.php | 3 +- _darcs/pristine/scripts/xmppdaemon.php | 3 +- _darcs/tentative_pristine | 816 +++++++++++++++------ actions/accesstoken.php | 3 +- actions/all.php | 3 +- actions/allrss.php | 3 +- actions/api.php | 3 +- actions/avatarbynickname.php | 3 +- actions/block.php | 3 +- actions/confirmaddress.php | 3 +- actions/deletenotice.php | 3 +- actions/deleteprofile.php | 3 +- actions/disfavor.php | 3 +- actions/doc.php | 3 +- actions/emailsettings.php | 3 +- actions/facebookhome.php | 3 +- actions/facebookinvite.php | 3 +- actions/facebookremove.php | 3 +- actions/facebooksettings.php | 3 +- actions/favor.php | 3 +- actions/favorited.php | 3 +- actions/favoritesrss.php | 3 +- actions/featured.php | 3 +- actions/finishaddopenid.php | 3 +- actions/finishimmediate.php | 3 +- actions/finishopenidlogin.php | 3 +- actions/finishremotesubscribe.php | 3 +- actions/foaf.php | 3 +- actions/imsettings.php | 3 +- actions/invite.php | 3 +- actions/login.php | 3 +- actions/logout.php | 3 +- actions/microsummary.php | 3 +- actions/newmessage.php | 3 +- actions/newnotice.php | 3 +- actions/noticesearch.php | 3 +- actions/noticesearchrss.php | 3 +- actions/nudge.php | 3 +- actions/openidlogin.php | 3 +- actions/openidsettings.php | 3 +- actions/opensearch.php | 3 +- actions/othersettings.php | 3 +- actions/peoplesearch.php | 6 +- actions/peopletag.php | 3 +- actions/postnotice.php | 3 +- actions/profilesettings.php | 3 +- actions/public.php | 3 +- actions/publicrss.php | 3 +- actions/publicxrds.php | 3 +- actions/recoverpassword.php | 3 +- actions/register.php | 3 +- actions/remotesubscribe.php | 3 +- actions/replies.php | 3 +- actions/repliesrss.php | 3 +- actions/requesttoken.php | 3 +- actions/showfavorites.php | 3 +- actions/showmessage.php | 3 +- actions/shownotice.php | 3 +- actions/showstream.php | 9 +- actions/smssettings.php | 3 +- actions/subedit.php | 3 +- actions/subscribe.php | 3 +- actions/subscribers.php | 6 +- actions/subscriptions.php | 6 +- actions/sup.php | 3 +- actions/tag.php | 3 +- actions/tagother.php | 3 +- actions/tagrss.php | 3 +- actions/twitapiaccount.php | 3 +- actions/twitapiblocks.php | 3 +- actions/twitapidirect_messages.php | 3 +- actions/twitapifavorites.php | 3 +- actions/twitapifriendships.php | 3 +- actions/twitapihelp.php | 3 +- actions/twitapinotifications.php | 3 +- actions/twitapistatuses.php | 3 +- actions/twitapiusers.php | 3 +- actions/twittersettings.php | 3 +- actions/unblock.php | 3 +- actions/unsubscribe.php | 3 +- actions/updateprofile.php | 3 +- actions/userauthorization.php | 3 +- actions/userbyid.php | 3 +- actions/userrss.php | 3 +- actions/xrds.php | 3 +- classes/Channel.php | 15 +- classes/Command.php | 54 +- classes/CommandInterpreter.php | 3 +- classes/NoticeWrapper.php | 3 +- lib/Shorturl_api.php | 12 +- lib/deleteaction.php | 3 +- lib/facebookaction.php | 3 +- lib/oauthstore.php | 27 +- lib/personal.php | 3 +- lib/profilelist.php | 3 +- lib/queuehandler.php | 3 +- lib/rssaction.php | 3 +- lib/search_engines.php | 12 +- lib/searchaction.php | 3 +- lib/settingsaction.php | 3 +- lib/stream.php | 3 +- lib/twitterapi.php | 3 +- lib/xmppqueuehandler.php | 3 +- scripts/enjitqueuehandler.php | 3 +- scripts/jabberqueuehandler.php | 3 +- scripts/maildaemon.php | 3 +- scripts/ombqueuehandler.php | 3 +- scripts/publicqueuehandler.php | 3 +- scripts/smsqueuehandler.php | 3 +- scripts/xmppconfirmhandler.php | 3 +- scripts/xmppdaemon.php | 3 +- 219 files changed, 1183 insertions(+), 528 deletions(-) create mode 100644 _darcs/patches/20081223194923-84dde-77a93de314caadbcb5b70bf346a4648be77a864e.gz (limited to 'actions/showfavorites.php') diff --git a/_darcs/inventory b/_darcs/inventory index 0c5a7d9b5..347e0fb3f 100644 --- a/_darcs/inventory +++ b/_darcs/inventory @@ -85,4 +85,11 @@ Evan Prodromou **20081223194428 More PEAR coding standards global changes. Here, I've changed all instances of TRUE to true and FALSE to false. +] +[move opening brace of class declaration to next line +Evan Prodromou **20081223194923 + + Another gigantor PEAR coding standards patch. Here, I've moved the + opening curly bracket on a class statement to the following line. + ] \ No newline at end of file diff --git a/_darcs/patches/20081223194923-84dde-77a93de314caadbcb5b70bf346a4648be77a864e.gz b/_darcs/patches/20081223194923-84dde-77a93de314caadbcb5b70bf346a4648be77a864e.gz new file mode 100644 index 000000000..667508279 Binary files /dev/null and b/_darcs/patches/20081223194923-84dde-77a93de314caadbcb5b70bf346a4648be77a864e.gz differ diff --git a/_darcs/pristine/actions/accesstoken.php b/_darcs/pristine/actions/accesstoken.php index cab5425bf..072ce27eb 100644 --- a/_darcs/pristine/actions/accesstoken.php +++ b/_darcs/pristine/actions/accesstoken.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class AccesstokenAction extends Action { +class AccesstokenAction extends Action +{ function handle($args) { parent::handle($args); diff --git a/_darcs/pristine/actions/all.php b/_darcs/pristine/actions/all.php index 028a3679a..526ac5f40 100644 --- a/_darcs/pristine/actions/all.php +++ b/_darcs/pristine/actions/all.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/actions/showstream.php'); -class AllAction extends StreamAction { +class AllAction extends StreamAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/allrss.php b/_darcs/pristine/actions/allrss.php index 9c20cd416..660afb9e2 100644 --- a/_darcs/pristine/actions/allrss.php +++ b/_darcs/pristine/actions/allrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class AllrssAction extends Rss10Action { +class AllrssAction extends Rss10Action +{ var $user = null; diff --git a/_darcs/pristine/actions/api.php b/_darcs/pristine/actions/api.php index 8ccd86f0b..dfdefe3b0 100644 --- a/_darcs/pristine/actions/api.php +++ b/_darcs/pristine/actions/api.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class ApiAction extends Action { +class ApiAction extends Action +{ var $user; var $content_type; diff --git a/_darcs/pristine/actions/avatarbynickname.php b/_darcs/pristine/actions/avatarbynickname.php index 4aeb4112a..666f386f6 100644 --- a/_darcs/pristine/actions/avatarbynickname.php +++ b/_darcs/pristine/actions/avatarbynickname.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class AvatarbynicknameAction extends Action { +class AvatarbynicknameAction extends Action +{ function handle($args) { parent::handle($args); diff --git a/_darcs/pristine/actions/block.php b/_darcs/pristine/actions/block.php index 702adcffa..c1ff7c044 100644 --- a/_darcs/pristine/actions/block.php +++ b/_darcs/pristine/actions/block.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class BlockAction extends Action { +class BlockAction extends Action +{ var $profile = null; diff --git a/_darcs/pristine/actions/confirmaddress.php b/_darcs/pristine/actions/confirmaddress.php index d926864a6..1d5c53ff2 100644 --- a/_darcs/pristine/actions/confirmaddress.php +++ b/_darcs/pristine/actions/confirmaddress.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class ConfirmaddressAction extends Action { +class ConfirmaddressAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/deletenotice.php b/_darcs/pristine/actions/deletenotice.php index 4f00db617..e9b4b3254 100644 --- a/_darcs/pristine/actions/deletenotice.php +++ b/_darcs/pristine/actions/deletenotice.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/deleteaction.php'); -class DeletenoticeAction extends DeleteAction { +class DeletenoticeAction extends DeleteAction +{ function handle($args) { parent::handle($args); diff --git a/_darcs/pristine/actions/deleteprofile.php b/_darcs/pristine/actions/deleteprofile.php index b1c346cb2..e12fe131a 100644 --- a/_darcs/pristine/actions/deleteprofile.php +++ b/_darcs/pristine/actions/deleteprofile.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class DeleteprofileAction extends Action { +class DeleteprofileAction extends Action +{ function handle($args) { parent::handle($args); diff --git a/_darcs/pristine/actions/disfavor.php b/_darcs/pristine/actions/disfavor.php index f0b528453..74aae86cc 100644 --- a/_darcs/pristine/actions/disfavor.php +++ b/_darcs/pristine/actions/disfavor.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class DisfavorAction extends Action { +class DisfavorAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/doc.php b/_darcs/pristine/actions/doc.php index 441ac19a7..856025e66 100644 --- a/_darcs/pristine/actions/doc.php +++ b/_darcs/pristine/actions/doc.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class DocAction extends Action { +class DocAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/emailsettings.php b/_darcs/pristine/actions/emailsettings.php index 7f08efd29..3fa8ce296 100644 --- a/_darcs/pristine/actions/emailsettings.php +++ b/_darcs/pristine/actions/emailsettings.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); -class EmailsettingsAction extends SettingsAction { +class EmailsettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/_darcs/pristine/actions/facebookhome.php b/_darcs/pristine/actions/facebookhome.php index 006f35eca..dcdb102e6 100644 --- a/_darcs/pristine/actions/facebookhome.php +++ b/_darcs/pristine/actions/facebookhome.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/facebookaction.php'); -class FacebookhomeAction extends FacebookAction { +class FacebookhomeAction extends FacebookAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/facebookinvite.php b/_darcs/pristine/actions/facebookinvite.php index fc226e65a..48a820e44 100644 --- a/_darcs/pristine/actions/facebookinvite.php +++ b/_darcs/pristine/actions/facebookinvite.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/facebookaction.php'); -class FacebookinviteAction extends FacebookAction { +class FacebookinviteAction extends FacebookAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/facebookremove.php b/_darcs/pristine/actions/facebookremove.php index 79dc32e49..a200fefbf 100644 --- a/_darcs/pristine/actions/facebookremove.php +++ b/_darcs/pristine/actions/facebookremove.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/facebookaction.php'); -class FacebookremoveAction extends FacebookAction { +class FacebookremoveAction extends FacebookAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/facebooksettings.php b/_darcs/pristine/actions/facebooksettings.php index 03ad57813..38542d4b6 100644 --- a/_darcs/pristine/actions/facebooksettings.php +++ b/_darcs/pristine/actions/facebooksettings.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/facebookaction.php'); -class FacebooksettingsAction extends FacebookAction { +class FacebooksettingsAction extends FacebookAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/favor.php b/_darcs/pristine/actions/favor.php index 3ec4af0b5..8103f8181 100644 --- a/_darcs/pristine/actions/favor.php +++ b/_darcs/pristine/actions/favor.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/mail.php'); -class FavorAction extends Action { +class FavorAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/favorited.php b/_darcs/pristine/actions/favorited.php index d479e1b3e..71a9e026e 100644 --- a/_darcs/pristine/actions/favorited.php +++ b/_darcs/pristine/actions/favorited.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/stream.php'); -class FavoritedAction extends StreamAction { +class FavoritedAction extends StreamAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/favoritesrss.php b/_darcs/pristine/actions/favoritesrss.php index aa8a3c6f4..8c7ce52bf 100644 --- a/_darcs/pristine/actions/favoritesrss.php +++ b/_darcs/pristine/actions/favoritesrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class FavoritesrssAction extends Rss10Action { +class FavoritesrssAction extends Rss10Action +{ var $user = null; diff --git a/_darcs/pristine/actions/featured.php b/_darcs/pristine/actions/featured.php index 1763adeab..2bf8b0b81 100644 --- a/_darcs/pristine/actions/featured.php +++ b/_darcs/pristine/actions/featured.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/stream.php'); require_once(INSTALLDIR.'/lib/profilelist.php'); -class FeaturedAction extends StreamAction { +class FeaturedAction extends StreamAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/finishaddopenid.php b/_darcs/pristine/actions/finishaddopenid.php index d8409b6e9..0ce1680aa 100644 --- a/_darcs/pristine/actions/finishaddopenid.php +++ b/_darcs/pristine/actions/finishaddopenid.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); -class FinishaddopenidAction extends Action { +class FinishaddopenidAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/finishimmediate.php b/_darcs/pristine/actions/finishimmediate.php index c4a1c1af9..0964c39f4 100644 --- a/_darcs/pristine/actions/finishimmediate.php +++ b/_darcs/pristine/actions/finishimmediate.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); -class FinishimmediateAction extends Action { +class FinishimmediateAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/finishopenidlogin.php b/_darcs/pristine/actions/finishopenidlogin.php index eb52d73b1..bdb8516a3 100644 --- a/_darcs/pristine/actions/finishopenidlogin.php +++ b/_darcs/pristine/actions/finishopenidlogin.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); -class FinishopenidloginAction extends Action { +class FinishopenidloginAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/finishremotesubscribe.php b/_darcs/pristine/actions/finishremotesubscribe.php index 5aace4fa9..cee3a1818 100644 --- a/_darcs/pristine/actions/finishremotesubscribe.php +++ b/_darcs/pristine/actions/finishremotesubscribe.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class FinishremotesubscribeAction extends Action { +class FinishremotesubscribeAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/foaf.php b/_darcs/pristine/actions/foaf.php index 27548bfff..30e98960c 100644 --- a/_darcs/pristine/actions/foaf.php +++ b/_darcs/pristine/actions/foaf.php @@ -23,7 +23,8 @@ define('LISTENER', 1); define('LISTENEE', -1); define('BOTH', 0); -class FoafAction extends Action { +class FoafAction extends Action +{ function is_readonly() { diff --git a/_darcs/pristine/actions/imsettings.php b/_darcs/pristine/actions/imsettings.php index 56fb14758..8ecf200ec 100644 --- a/_darcs/pristine/actions/imsettings.php +++ b/_darcs/pristine/actions/imsettings.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); require_once(INSTALLDIR.'/lib/jabber.php'); -class ImsettingsAction extends SettingsAction { +class ImsettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/_darcs/pristine/actions/invite.php b/_darcs/pristine/actions/invite.php index b0fc79958..80e022a3d 100644 --- a/_darcs/pristine/actions/invite.php +++ b/_darcs/pristine/actions/invite.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class InviteAction extends Action { +class InviteAction extends Action +{ function is_readonly() { diff --git a/_darcs/pristine/actions/login.php b/_darcs/pristine/actions/login.php index 6ad07b610..8600d44fd 100644 --- a/_darcs/pristine/actions/login.php +++ b/_darcs/pristine/actions/login.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class LoginAction extends Action { +class LoginAction extends Action +{ function is_readonly() { diff --git a/_darcs/pristine/actions/logout.php b/_darcs/pristine/actions/logout.php index effb5abbe..201378730 100644 --- a/_darcs/pristine/actions/logout.php +++ b/_darcs/pristine/actions/logout.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); -class LogoutAction extends Action { +class LogoutAction extends Action +{ function is_readonly() { diff --git a/_darcs/pristine/actions/microsummary.php b/_darcs/pristine/actions/microsummary.php index a19a26dcf..13ddc4e3e 100644 --- a/_darcs/pristine/actions/microsummary.php +++ b/_darcs/pristine/actions/microsummary.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class MicrosummaryAction extends Action { +class MicrosummaryAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/newmessage.php b/_darcs/pristine/actions/newmessage.php index 0a537ad2d..27fa9d518 100644 --- a/_darcs/pristine/actions/newmessage.php +++ b/_darcs/pristine/actions/newmessage.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class NewmessageAction extends Action { +class NewmessageAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/newnotice.php b/_darcs/pristine/actions/newnotice.php index 1f6117c1e..c412e893d 100644 --- a/_darcs/pristine/actions/newnotice.php +++ b/_darcs/pristine/actions/newnotice.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once INSTALLDIR . '/lib/noticelist.php'; -class NewnoticeAction extends Action { +class NewnoticeAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/noticesearch.php b/_darcs/pristine/actions/noticesearch.php index 782c8fe98..b36fc8ad2 100644 --- a/_darcs/pristine/actions/noticesearch.php +++ b/_darcs/pristine/actions/noticesearch.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/searchaction.php'); # XXX common parent for people and content search? -class NoticesearchAction extends SearchAction { +class NoticesearchAction extends SearchAction +{ function get_instructions() { diff --git a/_darcs/pristine/actions/noticesearchrss.php b/_darcs/pristine/actions/noticesearchrss.php index c41d34873..20fe0ff2a 100644 --- a/_darcs/pristine/actions/noticesearchrss.php +++ b/_darcs/pristine/actions/noticesearchrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class NoticesearchrssAction extends Rss10Action { +class NoticesearchrssAction extends Rss10Action +{ function init() { diff --git a/_darcs/pristine/actions/nudge.php b/_darcs/pristine/actions/nudge.php index e0268e9d0..a6480a582 100644 --- a/_darcs/pristine/actions/nudge.php +++ b/_darcs/pristine/actions/nudge.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/mail.php'); -class NudgeAction extends Action { +class NudgeAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/openidlogin.php b/_darcs/pristine/actions/openidlogin.php index b8681215e..09679e372 100644 --- a/_darcs/pristine/actions/openidlogin.php +++ b/_darcs/pristine/actions/openidlogin.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); -class OpenidloginAction extends Action { +class OpenidloginAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/openidsettings.php b/_darcs/pristine/actions/openidsettings.php index ce4143d41..039236048 100644 --- a/_darcs/pristine/actions/openidsettings.php +++ b/_darcs/pristine/actions/openidsettings.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); require_once(INSTALLDIR.'/lib/openid.php'); -class OpenidsettingsAction extends SettingsAction { +class OpenidsettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/_darcs/pristine/actions/opensearch.php b/_darcs/pristine/actions/opensearch.php index f9c6f4c57..96691fa6f 100644 --- a/_darcs/pristine/actions/opensearch.php +++ b/_darcs/pristine/actions/opensearch.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class OpensearchAction extends Action { +class OpensearchAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/othersettings.php b/_darcs/pristine/actions/othersettings.php index dc1bcd02b..c2f08934c 100644 --- a/_darcs/pristine/actions/othersettings.php +++ b/_darcs/pristine/actions/othersettings.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); -class OthersettingsAction extends SettingsAction { +class OthersettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/_darcs/pristine/actions/peoplesearch.php b/_darcs/pristine/actions/peoplesearch.php index 6d3f6a73f..0d0fae4e5 100644 --- a/_darcs/pristine/actions/peoplesearch.php +++ b/_darcs/pristine/actions/peoplesearch.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/searchaction.php'); require_once(INSTALLDIR.'/lib/profilelist.php'); -class PeoplesearchAction extends SearchAction { +class PeoplesearchAction extends SearchAction +{ function get_instructions() { @@ -69,7 +70,8 @@ class PeoplesearchAction extends SearchAction { } } -class PeopleSearchResults extends ProfileList { +class PeopleSearchResults extends ProfileList +{ var $terms = null; var $pattern = null; diff --git a/_darcs/pristine/actions/peopletag.php b/_darcs/pristine/actions/peopletag.php index c7e463026..13a0b7a41 100644 --- a/_darcs/pristine/actions/peopletag.php +++ b/_darcs/pristine/actions/peopletag.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/profilelist.php'); -class PeopletagAction extends Action { +class PeopletagAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/postnotice.php b/_darcs/pristine/actions/postnotice.php index 8b0781dfd..dec62a678 100644 --- a/_darcs/pristine/actions/postnotice.php +++ b/_darcs/pristine/actions/postnotice.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class PostnoticeAction extends Action { +class PostnoticeAction extends Action +{ function handle($args) { parent::handle($args); diff --git a/_darcs/pristine/actions/profilesettings.php b/_darcs/pristine/actions/profilesettings.php index beb9979d0..6c22a7933 100644 --- a/_darcs/pristine/actions/profilesettings.php +++ b/_darcs/pristine/actions/profilesettings.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); -class ProfilesettingsAction extends SettingsAction { +class ProfilesettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/_darcs/pristine/actions/public.php b/_darcs/pristine/actions/public.php index 62be3da99..039e885e6 100644 --- a/_darcs/pristine/actions/public.php +++ b/_darcs/pristine/actions/public.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/stream.php'); -class PublicAction extends StreamAction { +class PublicAction extends StreamAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/publicrss.php b/_darcs/pristine/actions/publicrss.php index 8e554122e..822bc2db7 100644 --- a/_darcs/pristine/actions/publicrss.php +++ b/_darcs/pristine/actions/publicrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class PublicrssAction extends Rss10Action { +class PublicrssAction extends Rss10Action +{ function init() { diff --git a/_darcs/pristine/actions/publicxrds.php b/_darcs/pristine/actions/publicxrds.php index 63c80d81e..3d731d79f 100644 --- a/_darcs/pristine/actions/publicxrds.php +++ b/_darcs/pristine/actions/publicxrds.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); # XXX: factor out similarities with XrdsAction -class PublicxrdsAction extends Action { +class PublicxrdsAction extends Action +{ function is_readonly() { diff --git a/_darcs/pristine/actions/recoverpassword.php b/_darcs/pristine/actions/recoverpassword.php index a482d4711..bb6ef81d6 100644 --- a/_darcs/pristine/actions/recoverpassword.php +++ b/_darcs/pristine/actions/recoverpassword.php @@ -23,7 +23,8 @@ if (!defined('LACONICA')) { exit(1); } define(MAX_RECOVERY_TIME, 24 * 60 * 60); -class RecoverpasswordAction extends Action { +class RecoverpasswordAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/register.php b/_darcs/pristine/actions/register.php index 444e67e35..ac14879e2 100644 --- a/_darcs/pristine/actions/register.php +++ b/_darcs/pristine/actions/register.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class RegisterAction extends Action { +class RegisterAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/remotesubscribe.php b/_darcs/pristine/actions/remotesubscribe.php index 02c026849..a9494772e 100644 --- a/_darcs/pristine/actions/remotesubscribe.php +++ b/_darcs/pristine/actions/remotesubscribe.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class RemotesubscribeAction extends Action { +class RemotesubscribeAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/replies.php b/_darcs/pristine/actions/replies.php index da2f27f31..eceeb4d65 100644 --- a/_darcs/pristine/actions/replies.php +++ b/_darcs/pristine/actions/replies.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/actions/showstream.php'); -class RepliesAction extends StreamAction { +class RepliesAction extends StreamAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/repliesrss.php b/_darcs/pristine/actions/repliesrss.php index 19ab0866a..5f85f8d2e 100644 --- a/_darcs/pristine/actions/repliesrss.php +++ b/_darcs/pristine/actions/repliesrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class RepliesrssAction extends Rss10Action { +class RepliesrssAction extends Rss10Action +{ var $user = null; diff --git a/_darcs/pristine/actions/requesttoken.php b/_darcs/pristine/actions/requesttoken.php index 091846756..a74548739 100644 --- a/_darcs/pristine/actions/requesttoken.php +++ b/_darcs/pristine/actions/requesttoken.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class RequesttokenAction extends Action { +class RequesttokenAction extends Action +{ function is_readonly() { diff --git a/_darcs/pristine/actions/showfavorites.php b/_darcs/pristine/actions/showfavorites.php index 8131cac67..f4344833d 100644 --- a/_darcs/pristine/actions/showfavorites.php +++ b/_darcs/pristine/actions/showfavorites.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/actions/showstream.php'); -class ShowfavoritesAction extends StreamAction { +class ShowfavoritesAction extends StreamAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/showmessage.php b/_darcs/pristine/actions/showmessage.php index b706fe2fa..25330a568 100644 --- a/_darcs/pristine/actions/showmessage.php +++ b/_darcs/pristine/actions/showmessage.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/mailbox.php'); -class ShowmessageAction extends MailboxAction { +class ShowmessageAction extends MailboxAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/shownotice.php b/_darcs/pristine/actions/shownotice.php index abdaa72ca..2df09cb3f 100644 --- a/_darcs/pristine/actions/shownotice.php +++ b/_darcs/pristine/actions/shownotice.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/stream.php'); -class ShownoticeAction extends StreamAction { +class ShownoticeAction extends StreamAction +{ var $notice = null; var $profile = null; diff --git a/_darcs/pristine/actions/showstream.php b/_darcs/pristine/actions/showstream.php index c31bce87a..e4e5d96d1 100644 --- a/_darcs/pristine/actions/showstream.php +++ b/_darcs/pristine/actions/showstream.php @@ -24,7 +24,8 @@ require_once(INSTALLDIR.'/lib/stream.php'); define('SUBSCRIPTIONS_PER_ROW', 4); define('SUBSCRIPTIONS', 80); -class ShowstreamAction extends StreamAction { +class ShowstreamAction extends StreamAction +{ function handle($args) { @@ -449,14 +450,16 @@ class ShowstreamAction extends StreamAction { # We don't show the author for a profile, since we already know who it is! -class ProfileNoticeList extends NoticeList { +class ProfileNoticeList extends NoticeList +{ function newListItem($notice) { return new ProfileNoticeListItem($notice); } } -class ProfileNoticeListItem extends NoticeListItem { +class ProfileNoticeListItem extends NoticeListItem +{ function showAuthor() { return; diff --git a/_darcs/pristine/actions/smssettings.php b/_darcs/pristine/actions/smssettings.php index 444da2590..fad71135c 100644 --- a/_darcs/pristine/actions/smssettings.php +++ b/_darcs/pristine/actions/smssettings.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); require_once(INSTALLDIR.'/actions/emailsettings.php'); -class SmssettingsAction extends EmailsettingsAction { +class SmssettingsAction extends EmailsettingsAction +{ function get_instructions() { diff --git a/_darcs/pristine/actions/subedit.php b/_darcs/pristine/actions/subedit.php index 874102857..1142b7a03 100644 --- a/_darcs/pristine/actions/subedit.php +++ b/_darcs/pristine/actions/subedit.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SubeditAction extends Action { +class SubeditAction extends Action +{ var $profile = null; diff --git a/_darcs/pristine/actions/subscribe.php b/_darcs/pristine/actions/subscribe.php index 93884f081..f33d1d207 100644 --- a/_darcs/pristine/actions/subscribe.php +++ b/_darcs/pristine/actions/subscribe.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SubscribeAction extends Action { +class SubscribeAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/subscribers.php b/_darcs/pristine/actions/subscribers.php index 8c7805f51..31d0468d9 100644 --- a/_darcs/pristine/actions/subscribers.php +++ b/_darcs/pristine/actions/subscribers.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/gallery.php'); -class SubscribersAction extends GalleryAction { +class SubscribersAction extends GalleryAction +{ function gallery_type() { @@ -59,7 +60,8 @@ class SubscribersAction extends GalleryAction { } } -class SubscribersList extends ProfileList { +class SubscribersList extends ProfileList +{ function show_owner_controls($profile) { common_block_form($profile, array('action' => 'subscribers', diff --git a/_darcs/pristine/actions/subscriptions.php b/_darcs/pristine/actions/subscriptions.php index ad4a3f9e5..afe8fb260 100644 --- a/_darcs/pristine/actions/subscriptions.php +++ b/_darcs/pristine/actions/subscriptions.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/gallery.php'); -class SubscriptionsAction extends GalleryAction { +class SubscriptionsAction extends GalleryAction +{ function gallery_type() { @@ -59,7 +60,8 @@ class SubscriptionsAction extends GalleryAction { } } -class SubscriptionsList extends ProfileList { +class SubscriptionsList extends ProfileList +{ function show_owner_controls($profile) { diff --git a/_darcs/pristine/actions/sup.php b/_darcs/pristine/actions/sup.php index 2a139b322..6a1897585 100644 --- a/_darcs/pristine/actions/sup.php +++ b/_darcs/pristine/actions/sup.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SupAction extends Action { +class SupAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/tag.php b/_darcs/pristine/actions/tag.php index d7b35d613..8a3f90c16 100644 --- a/_darcs/pristine/actions/tag.php +++ b/_darcs/pristine/actions/tag.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/actions/showstream.php'); define('TAGS_PER_PAGE', 100); -class TagAction extends StreamAction { +class TagAction extends StreamAction +{ function handle($args) { diff --git a/_darcs/pristine/actions/tagother.php b/_darcs/pristine/actions/tagother.php index ed17ac531..ff6788cc6 100644 --- a/_darcs/pristine/actions/tagother.php +++ b/_darcs/pristine/actions/tagother.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); -class TagotherAction extends Action { +class TagotherAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/tagrss.php b/_darcs/pristine/actions/tagrss.php index bb4edf473..912d71413 100644 --- a/_darcs/pristine/actions/tagrss.php +++ b/_darcs/pristine/actions/tagrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class TagrssAction extends Rss10Action { +class TagrssAction extends Rss10Action +{ function init() { diff --git a/_darcs/pristine/actions/twitapiaccount.php b/_darcs/pristine/actions/twitapiaccount.php index d5e9143c2..79e1ed990 100644 --- a/_darcs/pristine/actions/twitapiaccount.php +++ b/_darcs/pristine/actions/twitapiaccount.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapiaccountAction extends TwitterapiAction { +class TwitapiaccountAction extends TwitterapiAction +{ function verify_credentials($args, $apidata) { diff --git a/_darcs/pristine/actions/twitapiblocks.php b/_darcs/pristine/actions/twitapiblocks.php index 2170141f1..5d64f2f7d 100644 --- a/_darcs/pristine/actions/twitapiblocks.php +++ b/_darcs/pristine/actions/twitapiblocks.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapiblocksAction extends TwitterapiAction { +class TwitapiblocksAction extends TwitterapiAction +{ function create($args, $apidata) { diff --git a/_darcs/pristine/actions/twitapidirect_messages.php b/_darcs/pristine/actions/twitapidirect_messages.php index e9f7aa0bf..e0731f66f 100644 --- a/_darcs/pristine/actions/twitapidirect_messages.php +++ b/_darcs/pristine/actions/twitapidirect_messages.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class Twitapidirect_messagesAction extends TwitterapiAction { +class Twitapidirect_messagesAction extends TwitterapiAction +{ function direct_messages($args, $apidata) { diff --git a/_darcs/pristine/actions/twitapifavorites.php b/_darcs/pristine/actions/twitapifavorites.php index e7a43f770..55e04732f 100644 --- a/_darcs/pristine/actions/twitapifavorites.php +++ b/_darcs/pristine/actions/twitapifavorites.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapifavoritesAction extends TwitterapiAction { +class TwitapifavoritesAction extends TwitterapiAction +{ function favorites($args, $apidata) { diff --git a/_darcs/pristine/actions/twitapifriendships.php b/_darcs/pristine/actions/twitapifriendships.php index 5eca96298..ba4afe441 100644 --- a/_darcs/pristine/actions/twitapifriendships.php +++ b/_darcs/pristine/actions/twitapifriendships.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapifriendshipsAction extends TwitterapiAction { +class TwitapifriendshipsAction extends TwitterapiAction +{ function create($args, $apidata) { diff --git a/_darcs/pristine/actions/twitapihelp.php b/_darcs/pristine/actions/twitapihelp.php index 27262f089..1b84cb11b 100644 --- a/_darcs/pristine/actions/twitapihelp.php +++ b/_darcs/pristine/actions/twitapihelp.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapihelpAction extends TwitterapiAction { +class TwitapihelpAction extends TwitterapiAction +{ /* Returns the string "ok" in the requested format with a 200 OK HTTP status code. * URL:http://identi.ca/api/help/test.format diff --git a/_darcs/pristine/actions/twitapinotifications.php b/_darcs/pristine/actions/twitapinotifications.php index e24d3829c..a19d652c3 100644 --- a/_darcs/pristine/actions/twitapinotifications.php +++ b/_darcs/pristine/actions/twitapinotifications.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); # This naming convention looks real sick -class TwitapinotificationsAction extends TwitterapiAction { +class TwitapinotificationsAction extends TwitterapiAction +{ function follow($args, $apidata) { diff --git a/_darcs/pristine/actions/twitapistatuses.php b/_darcs/pristine/actions/twitapistatuses.php index f280184c0..e629d5cc4 100644 --- a/_darcs/pristine/actions/twitapistatuses.php +++ b/_darcs/pristine/actions/twitapistatuses.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapistatusesAction extends TwitterapiAction { +class TwitapistatusesAction extends TwitterapiAction +{ function public_timeline($args, $apidata) { diff --git a/_darcs/pristine/actions/twitapiusers.php b/_darcs/pristine/actions/twitapiusers.php index 4644e6be6..409986985 100644 --- a/_darcs/pristine/actions/twitapiusers.php +++ b/_darcs/pristine/actions/twitapiusers.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapiusersAction extends TwitterapiAction { +class TwitapiusersAction extends TwitterapiAction +{ function show($args, $apidata) { diff --git a/_darcs/pristine/actions/twittersettings.php b/_darcs/pristine/actions/twittersettings.php index 1f55b31b6..26dede0ac 100644 --- a/_darcs/pristine/actions/twittersettings.php +++ b/_darcs/pristine/actions/twittersettings.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); define('SUBSCRIPTIONS', 80); -class TwittersettingsAction extends SettingsAction { +class TwittersettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/_darcs/pristine/actions/unblock.php b/_darcs/pristine/actions/unblock.php index 66ce0c879..112304f71 100644 --- a/_darcs/pristine/actions/unblock.php +++ b/_darcs/pristine/actions/unblock.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class UnblockAction extends Action { +class UnblockAction extends Action +{ var $profile = null; diff --git a/_darcs/pristine/actions/unsubscribe.php b/_darcs/pristine/actions/unsubscribe.php index e4e04aaa0..1c2e13635 100644 --- a/_darcs/pristine/actions/unsubscribe.php +++ b/_darcs/pristine/actions/unsubscribe.php @@ -17,7 +17,8 @@ * along with this program. If not, see . */ -class UnsubscribeAction extends Action { +class UnsubscribeAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/updateprofile.php b/_darcs/pristine/actions/updateprofile.php index 2cfff1b51..abb034c81 100644 --- a/_darcs/pristine/actions/updateprofile.php +++ b/_darcs/pristine/actions/updateprofile.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class UpdateprofileAction extends Action { +class UpdateprofileAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/userauthorization.php b/_darcs/pristine/actions/userauthorization.php index c73d515d3..05efbc16c 100644 --- a/_darcs/pristine/actions/userauthorization.php +++ b/_darcs/pristine/actions/userauthorization.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); define('TIMESTAMP_THRESHOLD', 300); -class UserauthorizationAction extends Action { +class UserauthorizationAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/actions/userbyid.php b/_darcs/pristine/actions/userbyid.php index d7b4088bd..d57ed21a5 100644 --- a/_darcs/pristine/actions/userbyid.php +++ b/_darcs/pristine/actions/userbyid.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class UserbyidAction extends Action { +class UserbyidAction extends Action +{ function is_readonly() { diff --git a/_darcs/pristine/actions/userrss.php b/_darcs/pristine/actions/userrss.php index c758a44e2..1e9fe121f 100644 --- a/_darcs/pristine/actions/userrss.php +++ b/_darcs/pristine/actions/userrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class UserrssAction extends Rss10Action { +class UserrssAction extends Rss10Action +{ var $user = null; diff --git a/_darcs/pristine/actions/xrds.php b/_darcs/pristine/actions/xrds.php index 1d4961d46..7edc6aa39 100644 --- a/_darcs/pristine/actions/xrds.php +++ b/_darcs/pristine/actions/xrds.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class XrdsAction extends Action { +class XrdsAction extends Action +{ function is_readonly() { diff --git a/_darcs/pristine/classes/Channel.php b/_darcs/pristine/classes/Channel.php index 02ece9c0f..2e3e4e8d4 100644 --- a/_darcs/pristine/classes/Channel.php +++ b/_darcs/pristine/classes/Channel.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class Channel { +class Channel +{ function on($user) { @@ -47,7 +48,8 @@ class Channel { } } -class XMPPChannel extends Channel { +class XMPPChannel extends Channel +{ var $conn = null; @@ -104,7 +106,8 @@ class XMPPChannel extends Channel { } -class WebChannel extends Channel { +class WebChannel extends Channel +{ function source() { @@ -138,7 +141,8 @@ class WebChannel extends Channel { } -class AjaxWebChannel extends WebChannel { +class AjaxWebChannel extends WebChannel +{ function output($user, $text) { @@ -166,7 +170,8 @@ class AjaxWebChannel extends WebChannel { } -class MailChannel extends Channel { +class MailChannel extends Channel +{ var $addr = null; diff --git a/_darcs/pristine/classes/Command.php b/_darcs/pristine/classes/Command.php index 407a6ecba..eacbdacb3 100644 --- a/_darcs/pristine/classes/Command.php +++ b/_darcs/pristine/classes/Command.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/classes/Channel.php'); -class Command { +class Command +{ var $user = null; @@ -36,20 +37,24 @@ class Command { } } -class UnimplementedCommand extends Command { +class UnimplementedCommand extends Command +{ function execute($channel) { $channel->error($this->user, _("Sorry, this command is not yet implemented.")); } } -class TrackingCommand extends UnimplementedCommand { +class TrackingCommand extends UnimplementedCommand +{ } -class TrackOffCommand extends UnimplementedCommand { +class TrackOffCommand extends UnimplementedCommand +{ } -class TrackCommand extends UnimplementedCommand { +class TrackCommand extends UnimplementedCommand +{ var $word = null; function __construct($user, $word) { @@ -58,7 +63,8 @@ class TrackCommand extends UnimplementedCommand { } } -class UntrackCommand extends UnimplementedCommand { +class UntrackCommand extends UnimplementedCommand +{ var $word = null; function __construct($user, $word) { @@ -67,7 +73,8 @@ class UntrackCommand extends UnimplementedCommand { } } -class NudgeCommand extends UnimplementedCommand { +class NudgeCommand extends UnimplementedCommand +{ var $other = null; function __construct($user, $other) { @@ -76,7 +83,8 @@ class NudgeCommand extends UnimplementedCommand { } } -class InviteCommand extends UnimplementedCommand { +class InviteCommand extends UnimplementedCommand +{ var $other = null; function __construct($user, $other) { @@ -85,7 +93,8 @@ class InviteCommand extends UnimplementedCommand { } } -class StatsCommand extends Command { +class StatsCommand extends Command +{ function execute($channel) { @@ -110,7 +119,8 @@ class StatsCommand extends Command { } } -class FavCommand extends Command { +class FavCommand extends Command +{ var $other = null; @@ -157,7 +167,8 @@ class FavCommand extends Command { } } -class WhoisCommand extends Command { +class WhoisCommand extends Command +{ var $other = null; function __construct($user, $other) { @@ -193,7 +204,8 @@ class WhoisCommand extends Command { } } -class MessageCommand extends Command { +class MessageCommand extends Command +{ var $other = null; var $text = null; function __construct($user, $other, $text) @@ -237,7 +249,8 @@ class MessageCommand extends Command { } } -class GetCommand extends Command { +class GetCommand extends Command +{ var $other = null; @@ -269,7 +282,8 @@ class GetCommand extends Command { } } -class SubCommand extends Command { +class SubCommand extends Command +{ var $other = null; @@ -297,7 +311,8 @@ class SubCommand extends Command { } } -class UnsubCommand extends Command { +class UnsubCommand extends Command +{ var $other = null; @@ -324,7 +339,8 @@ class UnsubCommand extends Command { } } -class OffCommand extends Command { +class OffCommand extends Command +{ var $other = null; function __construct($user, $other=null) { @@ -345,7 +361,8 @@ class OffCommand extends Command { } } -class OnCommand extends Command { +class OnCommand extends Command +{ var $other = null; function __construct($user, $other=null) { @@ -367,7 +384,8 @@ class OnCommand extends Command { } } -class HelpCommand extends Command { +class HelpCommand extends Command +{ function execute($channel) { $channel->output($this->user, diff --git a/_darcs/pristine/classes/CommandInterpreter.php b/_darcs/pristine/classes/CommandInterpreter.php index ff078bb05..f409ed07f 100644 --- a/_darcs/pristine/classes/CommandInterpreter.php +++ b/_darcs/pristine/classes/CommandInterpreter.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/classes/Command.php'); -class CommandInterpreter { +class CommandInterpreter +{ function handle_command($user, $text) { diff --git a/_darcs/pristine/classes/NoticeWrapper.php b/_darcs/pristine/classes/NoticeWrapper.php index e1b27c2f7..233340ccd 100644 --- a/_darcs/pristine/classes/NoticeWrapper.php +++ b/_darcs/pristine/classes/NoticeWrapper.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/classes/Notice.php'); -class NoticeWrapper extends Notice { +class NoticeWrapper extends Notice +{ public $id; // int(4) primary_key not_null public $profile_id; // int(4) not_null diff --git a/_darcs/pristine/lib/Shorturl_api.php b/_darcs/pristine/lib/Shorturl_api.php index f3f4f08df..fe106cb83 100644 --- a/_darcs/pristine/lib/Shorturl_api.php +++ b/_darcs/pristine/lib/Shorturl_api.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class ShortUrlApi { +class ShortUrlApi +{ protected $service_url; function __construct($service_url) @@ -69,7 +70,8 @@ class ShortUrlApi { } } -class LilUrl extends ShortUrlApi { +class LilUrl extends ShortUrlApi +{ function __construct() { parent::__construct('http://ur1.ca/'); @@ -88,7 +90,8 @@ class LilUrl extends ShortUrlApi { } -class PtitUrl extends ShortUrlApi { +class PtitUrl extends ShortUrlApi +{ function __construct() { parent::__construct('http://ptiturl.com/?creer=oui&action=Reduire&url='); @@ -106,7 +109,8 @@ class PtitUrl extends ShortUrlApi { } } -class TightUrl extends ShortUrlApi { +class TightUrl extends ShortUrlApi +{ function __construct() { parent::__construct('http://2tu.us/?save=y&url='); diff --git a/_darcs/pristine/lib/deleteaction.php b/_darcs/pristine/lib/deleteaction.php index a6e365121..9e89c0a54 100644 --- a/_darcs/pristine/lib/deleteaction.php +++ b/_darcs/pristine/lib/deleteaction.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class DeleteAction extends Action { +class DeleteAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/lib/facebookaction.php b/_darcs/pristine/lib/facebookaction.php index 43464b19b..d5b7ed0fb 100644 --- a/_darcs/pristine/lib/facebookaction.php +++ b/_darcs/pristine/lib/facebookaction.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/extlib/facebook/facebook.php'); -class FacebookAction extends Action { +class FacebookAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/lib/oauthstore.php b/_darcs/pristine/lib/oauthstore.php index faae82db1..7ad3be20e 100644 --- a/_darcs/pristine/lib/oauthstore.php +++ b/_darcs/pristine/lib/oauthstore.php @@ -21,9 +21,10 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class LaconicaOAuthDataStore extends OAuthDataStore { +class LaconicaOAuthDataStore extends OAuthDataStore +{ - # We keep a record of who's contacted us + // We keep a record of who's contacted us function lookup_consumer($consumer_key) { @@ -75,8 +76,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { $t->consumer_key = $consumer->key; $t->tok = common_good_rand(16); $t->secret = common_good_rand(16); - $t->type = 0; # request - $t->state = 0; # unauthorized + $t->type = 0; // request + $t->state = 0; // unauthorized $t->created = DB_DataObject_Cast::dateTime(); if (!$t->insert()) { return null; @@ -85,7 +86,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore { } } - # defined in OAuthDataStore, but not implemented anywhere + // defined in OAuthDataStore, but not implemented anywhere function fetch_request_token($consumer) { @@ -98,14 +99,14 @@ class LaconicaOAuthDataStore extends OAuthDataStore { $rt = new Token(); $rt->consumer_key = $consumer->key; $rt->tok = $token->key; - $rt->type = 0; # request - if ($rt->find(true) && $rt->state == 1) { # authorized + $rt->type = 0; // request + if ($rt->find(true) && $rt->state == 1) { // authorized common_debug('request token found.', __FILE__); $at = new Token(); $at->consumer_key = $consumer->key; $at->tok = common_good_rand(16); $at->secret = common_good_rand(16); - $at->type = 1; # access + $at->type = 1; // access $at->created = DB_DataObject_Cast::dateTime(); if (!$at->insert()) { $e = $at->_lastError; @@ -113,15 +114,15 @@ class LaconicaOAuthDataStore extends OAuthDataStore { return null; } else { common_debug('access token "'.$at->tok.'" inserted', __FILE__); - # burn the old one + // burn the old one $orig_rt = clone($rt); - $rt->state = 2; # used + $rt->state = 2; // used if (!$rt->update($orig_rt)) { return null; } common_debug('request token "'.$rt->tok.'" updated', __FILE__); - # Update subscription - # XXX: mixing levels here + // Update subscription + // XXX: mixing levels here $sub = Subscription::staticGet('token', $rt->tok); if (!$sub) { return null; @@ -142,7 +143,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore { } } - # defined in OAuthDataStore, but not implemented anywhere + // defined in OAuthDataStore, but not implemented anywhere function fetch_access_token($consumer) { diff --git a/_darcs/pristine/lib/personal.php b/_darcs/pristine/lib/personal.php index 34ebe6894..02b01fece 100644 --- a/_darcs/pristine/lib/personal.php +++ b/_darcs/pristine/lib/personal.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class PersonalAction extends Action { +class PersonalAction extends Action +{ function is_readonly() { diff --git a/_darcs/pristine/lib/profilelist.php b/_darcs/pristine/lib/profilelist.php index 60737c3d4..bda05daf3 100644 --- a/_darcs/pristine/lib/profilelist.php +++ b/_darcs/pristine/lib/profilelist.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } define('PROFILES_PER_PAGE', 20); -class ProfileList { +class ProfileList +{ var $profile = null; var $owner = null; diff --git a/_darcs/pristine/lib/queuehandler.php b/_darcs/pristine/lib/queuehandler.php index 48487f8e9..9ce9e32b3 100644 --- a/_darcs/pristine/lib/queuehandler.php +++ b/_darcs/pristine/lib/queuehandler.php @@ -25,7 +25,8 @@ require_once(INSTALLDIR.'/lib/daemon.php'); require_once(INSTALLDIR.'/classes/Queue_item.php'); require_once(INSTALLDIR.'/classes/Notice.php'); -class QueueHandler extends Daemon { +class QueueHandler extends Daemon +{ var $_id = 'generic'; diff --git a/_darcs/pristine/lib/rssaction.php b/_darcs/pristine/lib/rssaction.php index e02e1febb..9564cfb46 100644 --- a/_darcs/pristine/lib/rssaction.php +++ b/_darcs/pristine/lib/rssaction.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } define('DEFAULT_RSS_LIMIT', 48); -class Rss10Action extends Action { +class Rss10Action extends Action +{ # This will contain the details of each feed item's author and be used to generate SIOC data. var $creators = array(); diff --git a/_darcs/pristine/lib/search_engines.php b/_darcs/pristine/lib/search_engines.php index e96570d63..559107910 100644 --- a/_darcs/pristine/lib/search_engines.php +++ b/_darcs/pristine/lib/search_engines.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SearchEngine { +class SearchEngine +{ protected $target; protected $table; @@ -45,7 +46,8 @@ class SearchEngine { } } -class SphinxSearch extends SearchEngine { +class SphinxSearch extends SearchEngine +{ private $sphinx; private $connected; @@ -103,7 +105,8 @@ class SphinxSearch extends SearchEngine { } } -class MySQLSearch extends SearchEngine { +class MySQLSearch extends SearchEngine +{ function query($q) { if ('identica_people' === $this->table) @@ -115,7 +118,8 @@ class MySQLSearch extends SearchEngine { } } -class PGSearch extends SearchEngine { +class PGSearch extends SearchEngine +{ function query($q) { if ('identica_people' === $this->table) diff --git a/_darcs/pristine/lib/searchaction.php b/_darcs/pristine/lib/searchaction.php index 12a44a861..bc90fac1a 100644 --- a/_darcs/pristine/lib/searchaction.php +++ b/_darcs/pristine/lib/searchaction.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SearchAction extends Action { +class SearchAction extends Action +{ function is_readonly() { diff --git a/_darcs/pristine/lib/settingsaction.php b/_darcs/pristine/lib/settingsaction.php index 5979c11f0..46f713fa8 100644 --- a/_darcs/pristine/lib/settingsaction.php +++ b/_darcs/pristine/lib/settingsaction.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SettingsAction extends Action { +class SettingsAction extends Action +{ function handle($args) { diff --git a/_darcs/pristine/lib/stream.php b/_darcs/pristine/lib/stream.php index 45fbb9bd9..73758adee 100644 --- a/_darcs/pristine/lib/stream.php +++ b/_darcs/pristine/lib/stream.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/personal.php'); require_once(INSTALLDIR.'/lib/noticelist.php'); -class StreamAction extends PersonalAction { +class StreamAction extends PersonalAction +{ function public_views_menu() { diff --git a/_darcs/pristine/lib/twitterapi.php b/_darcs/pristine/lib/twitterapi.php index 3cddfa9c9..50bcb06fe 100644 --- a/_darcs/pristine/lib/twitterapi.php +++ b/_darcs/pristine/lib/twitterapi.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class TwitterapiAction extends Action { +class TwitterapiAction extends Action +{ var $auth_user; diff --git a/_darcs/pristine/lib/xmppqueuehandler.php b/_darcs/pristine/lib/xmppqueuehandler.php index 0a73403f9..91015fd45 100644 --- a/_darcs/pristine/lib/xmppqueuehandler.php +++ b/_darcs/pristine/lib/xmppqueuehandler.php @@ -28,7 +28,8 @@ require_once(INSTALLDIR.'/lib/queuehandler.php'); * superclass. */ -class XmppQueueHandler extends QueueHandler { +class XmppQueueHandler extends QueueHandler +{ function start() { diff --git a/_darcs/pristine/scripts/enjitqueuehandler.php b/_darcs/pristine/scripts/enjitqueuehandler.php index 55d73e08c..3a4f8315d 100644 --- a/_darcs/pristine/scripts/enjitqueuehandler.php +++ b/_darcs/pristine/scripts/enjitqueuehandler.php @@ -33,7 +33,8 @@ require_once(INSTALLDIR . '/lib/queuehandler.php'); set_error_handler('common_error_handler'); -class EnjitQueueHandler extends QueueHandler { +class EnjitQueueHandler extends QueueHandler +{ function transport() { diff --git a/_darcs/pristine/scripts/jabberqueuehandler.php b/_darcs/pristine/scripts/jabberqueuehandler.php index ea26aaf79..924fc4545 100644 --- a/_darcs/pristine/scripts/jabberqueuehandler.php +++ b/_darcs/pristine/scripts/jabberqueuehandler.php @@ -33,7 +33,8 @@ require_once(INSTALLDIR . '/lib/xmppqueuehandler.php'); set_error_handler('common_error_handler'); -class JabberQueueHandler extends XmppQueueHandler { +class JabberQueueHandler extends XmppQueueHandler +{ var $conn = null; diff --git a/_darcs/pristine/scripts/maildaemon.php b/_darcs/pristine/scripts/maildaemon.php index 6100cd21b..b9facec1a 100644 --- a/_darcs/pristine/scripts/maildaemon.php +++ b/_darcs/pristine/scripts/maildaemon.php @@ -34,7 +34,8 @@ require_once('Mail/mimeDecode.php'); # FIXME: we use both Mail_mimeDecode and mailparse # Need to move everything to mailparse -class MailerDaemon { +class MailerDaemon +{ function __construct() { diff --git a/_darcs/pristine/scripts/ombqueuehandler.php b/_darcs/pristine/scripts/ombqueuehandler.php index 299381ace..cdcea51dc 100644 --- a/_darcs/pristine/scripts/ombqueuehandler.php +++ b/_darcs/pristine/scripts/ombqueuehandler.php @@ -33,7 +33,8 @@ require_once(INSTALLDIR . '/lib/queuehandler.php'); set_error_handler('common_error_handler'); -class OmbQueueHandler extends QueueHandler { +class OmbQueueHandler extends QueueHandler +{ function transport() { diff --git a/_darcs/pristine/scripts/publicqueuehandler.php b/_darcs/pristine/scripts/publicqueuehandler.php index b3542e5c5..5075c12df 100644 --- a/_darcs/pristine/scripts/publicqueuehandler.php +++ b/_darcs/pristine/scripts/publicqueuehandler.php @@ -33,7 +33,8 @@ require_once(INSTALLDIR . '/lib/xmppqueuehandler.php'); set_error_handler('common_error_handler'); -class PublicQueueHandler extends XmppQueueHandler { +class PublicQueueHandler extends XmppQueueHandler +{ function transport() { diff --git a/_darcs/pristine/scripts/smsqueuehandler.php b/_darcs/pristine/scripts/smsqueuehandler.php index c962ad095..38f2f11fe 100644 --- a/_darcs/pristine/scripts/smsqueuehandler.php +++ b/_darcs/pristine/scripts/smsqueuehandler.php @@ -33,7 +33,8 @@ require_once(INSTALLDIR . '/lib/queuehandler.php'); set_error_handler('common_error_handler'); -class SmsQueueHandler extends QueueHandler { +class SmsQueueHandler extends QueueHandler +{ function transport() { diff --git a/_darcs/pristine/scripts/xmppconfirmhandler.php b/_darcs/pristine/scripts/xmppconfirmhandler.php index 1eb932330..2b8b085ce 100644 --- a/_darcs/pristine/scripts/xmppconfirmhandler.php +++ b/_darcs/pristine/scripts/xmppconfirmhandler.php @@ -35,7 +35,8 @@ set_error_handler('common_error_handler'); define('CLAIM_TIMEOUT', 1200); -class XmppConfirmHandler extends XmppQueueHandler { +class XmppConfirmHandler extends XmppQueueHandler +{ var $_id = 'confirm'; diff --git a/_darcs/pristine/scripts/xmppdaemon.php b/_darcs/pristine/scripts/xmppdaemon.php index 28ac64725..01fe8914f 100644 --- a/_darcs/pristine/scripts/xmppdaemon.php +++ b/_darcs/pristine/scripts/xmppdaemon.php @@ -37,7 +37,8 @@ set_error_handler('common_error_handler'); # in jabber.php, which create a new XMPP class. A more elegant (?) solution # might be to use make this a subclass of XMPP. -class XMPPDaemon extends Daemon { +class XMPPDaemon extends Daemon +{ function XMPPDaemon($resource=null) { diff --git a/_darcs/tentative_pristine b/_darcs/tentative_pristine index c8cd44461..573c67a4f 100644 --- a/_darcs/tentative_pristine +++ b/_darcs/tentative_pristine @@ -1,225 +1,593 @@ -hunk ./actions/accesstoken.php 36 -- common_debug('got this token: "'.print_r($token,TRUE).'"', __FILE__); -+ common_debug('got this token: "'.print_r($token,true).'"', __FILE__); -hunk ./actions/emailsettings.php 121 -- if ($confirm->find(TRUE)) { -+ if ($confirm->find(true)) { -hunk ./actions/emailsettings.php 182 -- if ($result === FALSE) { -+ if ($result === false) { -hunk ./actions/emailsettings.php 232 -- if ($result === FALSE) { -+ if ($result === false) { -hunk ./actions/emailsettings.php 242 -- $this->show_form($msg, TRUE); -+ $this->show_form($msg, true); -hunk ./actions/emailsettings.php 266 -- $this->show_form(_('Confirmation cancelled.'), TRUE); -+ $this->show_form(_('Confirmation cancelled.'), true); -hunk ./actions/emailsettings.php 293 -- $this->show_form(_('The address was removed.'), TRUE); -+ $this->show_form(_('The address was removed.'), true); -hunk ./actions/emailsettings.php 313 -- $this->show_form(_('Incoming email address removed.'), TRUE); -+ $this->show_form(_('Incoming email address removed.'), true); -hunk ./actions/emailsettings.php 328 -- $this->show_form(_('New incoming email address added.'), TRUE); -+ $this->show_form(_('New incoming email address added.'), true); -hunk ./actions/finishremotesubscribe.php 281 -- common_debug('got result: "'.print_r($result,TRUE).'"', __FILE__); -+ common_debug('got result: "'.print_r($result,true).'"', __FILE__); -hunk ./actions/foaf.php 125 -- common_debug('Got a bad subscription: '.print_r($sub,TRUE)); -+ common_debug('Got a bad subscription: '.print_r($sub,true)); -hunk ./actions/foaf.php 147 -- common_debug('Got a bad subscription: '.print_r($sub,TRUE)); -+ common_debug('Got a bad subscription: '.print_r($sub,true)); -hunk ./actions/imsettings.php 96 -- if ($confirm->find(TRUE)) { -+ if ($confirm->find(true)) { -hunk ./actions/imsettings.php 149 -- if ($result === FALSE) { -+ if ($result === false) { -hunk ./actions/imsettings.php 199 -- if ($result === FALSE) { -+ if ($result === false) { -hunk ./actions/imsettings.php 213 -- $this->show_form($msg, TRUE); -+ $this->show_form($msg, true); -hunk ./actions/imsettings.php 237 -- $this->show_form(_('Confirmation cancelled.'), TRUE); -+ $this->show_form(_('Confirmation cancelled.'), true); -hunk ./actions/imsettings.php 266 -- $this->show_form(_('The address was removed.'), TRUE); -+ $this->show_form(_('The address was removed.'), true); -hunk ./actions/othersettings.php 56 -- common_dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), FALSE, $user->urlshorteningservice); -+ common_dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), false, $user->urlshorteningservice); -hunk ./actions/othersettings.php 177 -- if ($result === FALSE) { -+ if ($result === false) { -hunk ./actions/profilesettings.php 99 -- common_dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), TRUE, $language); -+ common_dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), true, $language); -hunk ./actions/profilesettings.php 105 -- common_dropdown('timezone', _('Timezone'), $timezones, _('What timezone are you normally in?'), TRUE, $timezone); -+ common_dropdown('timezone', _('Timezone'), $timezones, _('What timezone are you normally in?'), true, $timezone); -hunk ./actions/profilesettings.php 281 -- if ($result === FALSE) { -+ if ($result === false) { -hunk ./actions/profilesettings.php 301 -- if ($result === FALSE) { -+ if ($result === false) { -hunk ./actions/profilesettings.php 343 -- $this->show_form(_('Settings saved.'), TRUE); -+ $this->show_form(_('Settings saved.'), true); -hunk ./actions/profilesettings.php 437 -- if ($val !== TRUE) { -+ if ($val !== true) { -hunk ./actions/smssettings.php 114 -- if ($confirm->find(TRUE)) { -+ if ($confirm->find(true)) { -hunk ./actions/smssettings.php 168 -- if ($result === FALSE) { -+ if ($result === false) { -hunk ./actions/smssettings.php 218 -- if ($result === FALSE) { -+ if ($result === false) { -hunk ./actions/smssettings.php 232 -- $this->show_form($msg, TRUE); -+ $this->show_form($msg, true); -hunk ./actions/smssettings.php 260 -- $this->show_form(_('Confirmation cancelled.'), TRUE); -+ $this->show_form(_('Confirmation cancelled.'), true); -hunk ./actions/smssettings.php 290 -- $this->show_form(_('The address was removed.'), TRUE); -+ $this->show_form(_('The address was removed.'), true); -hunk ./actions/twitapifriendships.php 99 -- if ($sub->find(TRUE)) { -+ if ($sub->find(true)) { -hunk ./actions/twittersettings.php 291 -- $this->show_form(_('Twitter account removed.'), TRUE); -+ $this->show_form(_('Twitter account removed.'), true); -hunk ./actions/twittersettings.php 328 -- if ($result === FALSE) { -+ if ($result === false) { -hunk ./actions/userauthorization.php 214 -- common_debug('request token to look up: "'.print_r($rt,TRUE).'"'); -+ common_debug('request token to look up: "'.print_r($rt,true).'"'); -hunk ./actions/userauthorization.php 224 -- return FALSE; -+ return false; -hunk ./actions/userauthorization.php 280 -- return FALSE; -+ return false; -hunk ./actions/userauthorization.php 287 -- return FALSE; -+ return false; -hunk ./actions/userauthorization.php 292 -- return FALSE; -+ return false; -hunk ./actions/userauthorization.php 298 -- return FALSE; -+ return false; -hunk ./actions/userauthorization.php 314 -- return FALSE; -+ return false; -hunk ./actions/userauthorization.php 317 -- return TRUE; -+ return true; -hunk ./actions/userauthorization.php 443 -- if ($sub->find(TRUE)) { -+ if ($sub->find(true)) { -hunk ./classes/Foreign_link.php 38 -- if ($flink->find(TRUE)) { -+ if ($flink->find(true)) { -hunk ./classes/Foreign_link.php 51 -- if ($flink->find(TRUE)) { -+ if ($flink->find(true)) { -hunk ./classes/Foreign_link.php 67 -- if ($fuser->find(TRUE)) { -+ if ($fuser->find(true)) { -hunk ./classes/Notice.php 324 -- $needAnd = FALSE; -- $needWhere = TRUE; -+ $needAnd = false; -+ $needWhere = true; -hunk ./classes/Notice.php 328 -- $needWhere = FALSE; -- $needAnd = TRUE; -+ $needWhere = false; -+ $needAnd = true; -hunk ./classes/Notice.php 336 -- $needWhere = FALSE; -+ $needWhere = false; -hunk ./classes/Notice.php 348 -- $needWhere = FALSE; -+ $needWhere = false; -hunk ./classes/Notice.php 360 -- $needWhere = FALSE; -+ $needWhere = false; -hunk ./classes/Notice.php 414 -- if ($notices !== FALSE) { -+ if ($notices !== false) { -hunk ./classes/Queue_item.php 37 -- $cnt = $qi->find(TRUE); -+ $cnt = $qi->find(true); -hunk ./classes/User.php 202 -- return FALSE; -+ return false; -hunk ./classes/User.php 236 -- return FALSE; -+ return false; -hunk ./classes/User.php 250 -- return FALSE; -+ return false; -hunk ./classes/User.php 264 -- return FALSE; -+ return false; -hunk ./lib/oauthstore.php 62 -- if ($n->find(TRUE)) { -- return TRUE; -+ if ($n->find(true)) { -+ return true; -hunk ./lib/oauthstore.php 68 -- return FALSE; -+ return false; +hunk ./actions/accesstoken.php 24 +-class AccesstokenAction extends Action { ++class AccesstokenAction extends Action ++{ +hunk ./actions/all.php 24 +-class AllAction extends StreamAction { ++class AllAction extends StreamAction ++{ +hunk ./actions/allrss.php 26 +-class AllrssAction extends Rss10Action { ++class AllrssAction extends Rss10Action ++{ +hunk ./actions/api.php 22 +-class ApiAction extends Action { ++class ApiAction extends Action ++{ +hunk ./actions/avatarbynickname.php 22 +-class AvatarbynicknameAction extends Action { ++class AvatarbynicknameAction extends Action ++{ +hunk ./actions/block.php 22 +-class BlockAction extends Action { ++class BlockAction extends Action ++{ +hunk ./actions/confirmaddress.php 22 +-class ConfirmaddressAction extends Action { ++class ConfirmaddressAction extends Action ++{ +hunk ./actions/deletenotice.php 24 +-class DeletenoticeAction extends DeleteAction { ++class DeletenoticeAction extends DeleteAction ++{ +hunk ./actions/deleteprofile.php 22 +-class DeleteprofileAction extends Action { ++class DeleteprofileAction extends Action ++{ +hunk ./actions/disfavor.php 22 +-class DisfavorAction extends Action { ++class DisfavorAction extends Action ++{ +hunk ./actions/doc.php 22 +-class DocAction extends Action { ++class DocAction extends Action ++{ +hunk ./actions/emailsettings.php 24 +-class EmailsettingsAction extends SettingsAction { ++class EmailsettingsAction extends SettingsAction ++{ +hunk ./actions/facebookhome.php 24 +-class FacebookhomeAction extends FacebookAction { ++class FacebookhomeAction extends FacebookAction ++{ +hunk ./actions/facebookinvite.php 24 +-class FacebookinviteAction extends FacebookAction { ++class FacebookinviteAction extends FacebookAction ++{ +hunk ./actions/facebookremove.php 24 +-class FacebookremoveAction extends FacebookAction { ++class FacebookremoveAction extends FacebookAction ++{ +hunk ./actions/facebooksettings.php 24 +-class FacebooksettingsAction extends FacebookAction { ++class FacebooksettingsAction extends FacebookAction ++{ +hunk ./actions/favor.php 24 +-class FavorAction extends Action { ++class FavorAction extends Action ++{ +hunk ./actions/favorited.php 24 +-class FavoritedAction extends StreamAction { ++class FavoritedAction extends StreamAction ++{ +hunk ./actions/favoritesrss.php 26 +-class FavoritesrssAction extends Rss10Action { ++class FavoritesrssAction extends Rss10Action ++{ +hunk ./actions/featured.php 25 +-class FeaturedAction extends StreamAction { ++class FeaturedAction extends StreamAction ++{ +hunk ./actions/finishaddopenid.php 24 +-class FinishaddopenidAction extends Action { ++class FinishaddopenidAction extends Action ++{ +hunk ./actions/finishimmediate.php 24 +-class FinishimmediateAction extends Action { ++class FinishimmediateAction extends Action ++{ +hunk ./actions/finishopenidlogin.php 24 +-class FinishopenidloginAction extends Action { ++class FinishopenidloginAction extends Action ++{ +hunk ./actions/finishremotesubscribe.php 24 +-class FinishremotesubscribeAction extends Action { ++class FinishremotesubscribeAction extends Action ++{ +hunk ./actions/foaf.php 26 +-class FoafAction extends Action { ++class FoafAction extends Action ++{ +hunk ./actions/imsettings.php 25 +-class ImsettingsAction extends SettingsAction { ++class ImsettingsAction extends SettingsAction ++{ +hunk ./actions/invite.php 22 +-class InviteAction extends Action { ++class InviteAction extends Action ++{ +hunk ./actions/login.php 22 +-class LoginAction extends Action { ++class LoginAction extends Action ++{ +hunk ./actions/logout.php 24 +-class LogoutAction extends Action { ++class LogoutAction extends Action ++{ +hunk ./actions/microsummary.php 22 +-class MicrosummaryAction extends Action { ++class MicrosummaryAction extends Action ++{ +hunk ./actions/newmessage.php 22 +-class NewmessageAction extends Action { ++class NewmessageAction extends Action ++{ +hunk ./actions/newnotice.php 24 +-class NewnoticeAction extends Action { ++class NewnoticeAction extends Action ++{ +hunk ./actions/noticesearch.php 26 +-class NoticesearchAction extends SearchAction { ++class NoticesearchAction extends SearchAction ++{ +hunk ./actions/noticesearchrss.php 26 +-class NoticesearchrssAction extends Rss10Action { ++class NoticesearchrssAction extends Rss10Action ++{ +hunk ./actions/nudge.php 24 +-class NudgeAction extends Action { ++class NudgeAction extends Action ++{ +hunk ./actions/openidlogin.php 24 +-class OpenidloginAction extends Action { ++class OpenidloginAction extends Action ++{ +hunk ./actions/openidsettings.php 25 +-class OpenidsettingsAction extends SettingsAction { ++class OpenidsettingsAction extends SettingsAction ++{ +hunk ./actions/opensearch.php 22 +-class OpensearchAction extends Action { ++class OpensearchAction extends Action ++{ +hunk ./actions/othersettings.php 24 +-class OthersettingsAction extends SettingsAction { ++class OthersettingsAction extends SettingsAction ++{ +hunk ./actions/peoplesearch.php 25 +-class PeoplesearchAction extends SearchAction { ++class PeoplesearchAction extends SearchAction ++{ +hunk ./actions/peoplesearch.php 73 +-class PeopleSearchResults extends ProfileList { ++class PeopleSearchResults extends ProfileList ++{ +hunk ./actions/peopletag.php 24 +-class PeopletagAction extends Action { ++class PeopletagAction extends Action ++{ +hunk ./actions/postnotice.php 24 +-class PostnoticeAction extends Action { ++class PostnoticeAction extends Action ++{ +hunk ./actions/profilesettings.php 24 +-class ProfilesettingsAction extends SettingsAction { ++class ProfilesettingsAction extends SettingsAction ++{ +hunk ./actions/public.php 24 +-class PublicAction extends StreamAction { ++class PublicAction extends StreamAction ++{ +hunk ./actions/publicrss.php 26 +-class PublicrssAction extends Rss10Action { ++class PublicrssAction extends Rss10Action ++{ +hunk ./actions/publicxrds.php 26 +-class PublicxrdsAction extends Action { ++class PublicxrdsAction extends Action ++{ +hunk ./actions/recoverpassword.php 26 +-class RecoverpasswordAction extends Action { ++class RecoverpasswordAction extends Action ++{ +hunk ./actions/register.php 22 +-class RegisterAction extends Action { ++class RegisterAction extends Action ++{ +hunk ./actions/remotesubscribe.php 24 +-class RemotesubscribeAction extends Action { ++class RemotesubscribeAction extends Action ++{ +hunk ./actions/replies.php 24 +-class RepliesAction extends StreamAction { ++class RepliesAction extends StreamAction ++{ +hunk ./actions/repliesrss.php 26 +-class RepliesrssAction extends Rss10Action { ++class RepliesrssAction extends Rss10Action ++{ +hunk ./actions/requesttoken.php 24 +-class RequesttokenAction extends Action { ++class RequesttokenAction extends Action ++{ +hunk ./actions/showfavorites.php 24 +-class ShowfavoritesAction extends StreamAction { ++class ShowfavoritesAction extends StreamAction ++{ +hunk ./actions/showmessage.php 24 +-class ShowmessageAction extends MailboxAction { ++class ShowmessageAction extends MailboxAction ++{ +hunk ./actions/shownotice.php 24 +-class ShownoticeAction extends StreamAction { ++class ShownoticeAction extends StreamAction ++{ +hunk ./actions/showstream.php 27 +-class ShowstreamAction extends StreamAction { ++class ShowstreamAction extends StreamAction ++{ +hunk ./actions/showstream.php 453 +-class ProfileNoticeList extends NoticeList { ++class ProfileNoticeList extends NoticeList ++{ +hunk ./actions/showstream.php 461 +-class ProfileNoticeListItem extends NoticeListItem { ++class ProfileNoticeListItem extends NoticeListItem ++{ +hunk ./actions/smssettings.php 25 +-class SmssettingsAction extends EmailsettingsAction { ++class SmssettingsAction extends EmailsettingsAction ++{ +hunk ./actions/subedit.php 22 +-class SubeditAction extends Action { ++class SubeditAction extends Action ++{ +hunk ./actions/subscribe.php 22 +-class SubscribeAction extends Action { ++class SubscribeAction extends Action ++{ +hunk ./actions/subscribers.php 24 +-class SubscribersAction extends GalleryAction { ++class SubscribersAction extends GalleryAction ++{ +hunk ./actions/subscribers.php 63 +-class SubscribersList extends ProfileList { ++class SubscribersList extends ProfileList ++{ +hunk ./actions/subscriptions.php 24 +-class SubscriptionsAction extends GalleryAction { ++class SubscriptionsAction extends GalleryAction ++{ +hunk ./actions/subscriptions.php 63 +-class SubscriptionsList extends ProfileList { ++class SubscriptionsList extends ProfileList ++{ +hunk ./actions/sup.php 22 +-class SupAction extends Action { ++class SupAction extends Action ++{ +hunk ./actions/tag.php 25 +-class TagAction extends StreamAction { ++class TagAction extends StreamAction ++{ +hunk ./actions/tagother.php 24 +-class TagotherAction extends Action { ++class TagotherAction extends Action ++{ +hunk ./actions/tagrss.php 26 +-class TagrssAction extends Rss10Action { ++class TagrssAction extends Rss10Action ++{ +hunk ./actions/twitapiaccount.php 24 +-class TwitapiaccountAction extends TwitterapiAction { ++class TwitapiaccountAction extends TwitterapiAction ++{ +hunk ./actions/twitapiblocks.php 24 +-class TwitapiblocksAction extends TwitterapiAction { ++class TwitapiblocksAction extends TwitterapiAction ++{ +hunk ./actions/twitapidirect_messages.php 24 +-class Twitapidirect_messagesAction extends TwitterapiAction { ++class Twitapidirect_messagesAction extends TwitterapiAction ++{ +hunk ./actions/twitapifavorites.php 24 +-class TwitapifavoritesAction extends TwitterapiAction { ++class TwitapifavoritesAction extends TwitterapiAction ++{ +hunk ./actions/twitapifriendships.php 24 +-class TwitapifriendshipsAction extends TwitterapiAction { ++class TwitapifriendshipsAction extends TwitterapiAction ++{ +hunk ./actions/twitapihelp.php 24 +-class TwitapihelpAction extends TwitterapiAction { ++class TwitapihelpAction extends TwitterapiAction ++{ +hunk ./actions/twitapinotifications.php 25 +-class TwitapinotificationsAction extends TwitterapiAction { ++class TwitapinotificationsAction extends TwitterapiAction ++{ +hunk ./actions/twitapistatuses.php 24 +-class TwitapistatusesAction extends TwitterapiAction { ++class TwitapistatusesAction extends TwitterapiAction ++{ +hunk ./actions/twitapiusers.php 24 +-class TwitapiusersAction extends TwitterapiAction { ++class TwitapiusersAction extends TwitterapiAction ++{ +hunk ./actions/twittersettings.php 26 +-class TwittersettingsAction extends SettingsAction { ++class TwittersettingsAction extends SettingsAction ++{ +hunk ./actions/unblock.php 22 +-class UnblockAction extends Action { ++class UnblockAction extends Action ++{ +hunk ./actions/unsubscribe.php 20 +-class UnsubscribeAction extends Action { ++class UnsubscribeAction extends Action ++{ +hunk ./actions/updateprofile.php 24 +-class UpdateprofileAction extends Action { ++class UpdateprofileAction extends Action ++{ +hunk ./actions/userauthorization.php 25 +-class UserauthorizationAction extends Action { ++class UserauthorizationAction extends Action ++{ +hunk ./actions/userbyid.php 22 +-class UserbyidAction extends Action { ++class UserbyidAction extends Action ++{ +hunk ./actions/userrss.php 26 +-class UserrssAction extends Rss10Action { ++class UserrssAction extends Rss10Action ++{ +hunk ./actions/xrds.php 24 +-class XrdsAction extends Action { ++class XrdsAction extends Action ++{ +hunk ./classes/Channel.php 22 +-class Channel { ++class Channel ++{ +hunk ./classes/Channel.php 51 +-class XMPPChannel extends Channel { ++class XMPPChannel extends Channel ++{ +hunk ./classes/Channel.php 109 +-class WebChannel extends Channel { ++class WebChannel extends Channel ++{ +hunk ./classes/Channel.php 144 +-class AjaxWebChannel extends WebChannel { ++class AjaxWebChannel extends WebChannel ++{ +hunk ./classes/Channel.php 173 +-class MailChannel extends Channel { ++class MailChannel extends Channel ++{ +hunk ./classes/Command.php 24 +-class Command { ++class Command ++{ +hunk ./classes/Command.php 40 +-class UnimplementedCommand extends Command { ++class UnimplementedCommand extends Command ++{ +hunk ./classes/Command.php 48 +-class TrackingCommand extends UnimplementedCommand { ++class TrackingCommand extends UnimplementedCommand ++{ +hunk ./classes/Command.php 52 +-class TrackOffCommand extends UnimplementedCommand { ++class TrackOffCommand extends UnimplementedCommand ++{ +hunk ./classes/Command.php 56 +-class TrackCommand extends UnimplementedCommand { ++class TrackCommand extends UnimplementedCommand ++{ +hunk ./classes/Command.php 66 +-class UntrackCommand extends UnimplementedCommand { ++class UntrackCommand extends UnimplementedCommand ++{ +hunk ./classes/Command.php 76 +-class NudgeCommand extends UnimplementedCommand { ++class NudgeCommand extends UnimplementedCommand ++{ +hunk ./classes/Command.php 86 +-class InviteCommand extends UnimplementedCommand { ++class InviteCommand extends UnimplementedCommand ++{ +hunk ./classes/Command.php 96 +-class StatsCommand extends Command { ++class StatsCommand extends Command ++{ +hunk ./classes/Command.php 122 +-class FavCommand extends Command { ++class FavCommand extends Command ++{ +hunk ./classes/Command.php 170 +-class WhoisCommand extends Command { ++class WhoisCommand extends Command ++{ +hunk ./classes/Command.php 207 +-class MessageCommand extends Command { ++class MessageCommand extends Command ++{ +hunk ./classes/Command.php 252 +-class GetCommand extends Command { ++class GetCommand extends Command ++{ +hunk ./classes/Command.php 285 +-class SubCommand extends Command { ++class SubCommand extends Command ++{ +hunk ./classes/Command.php 314 +-class UnsubCommand extends Command { ++class UnsubCommand extends Command ++{ +hunk ./classes/Command.php 342 +-class OffCommand extends Command { ++class OffCommand extends Command ++{ +hunk ./classes/Command.php 364 +-class OnCommand extends Command { ++class OnCommand extends Command ++{ +hunk ./classes/Command.php 387 +-class HelpCommand extends Command { ++class HelpCommand extends Command ++{ +hunk ./classes/CommandInterpreter.php 24 +-class CommandInterpreter { ++class CommandInterpreter ++{ +hunk ./classes/NoticeWrapper.php 24 +-class NoticeWrapper extends Notice { ++class NoticeWrapper extends Notice ++{ +hunk ./lib/Shorturl_api.php 22 +-class ShortUrlApi { ++class ShortUrlApi ++{ +hunk ./lib/Shorturl_api.php 73 +-class LilUrl extends ShortUrlApi { ++class LilUrl extends ShortUrlApi ++{ +hunk ./lib/Shorturl_api.php 93 +-class PtitUrl extends ShortUrlApi { ++class PtitUrl extends ShortUrlApi ++{ +hunk ./lib/Shorturl_api.php 112 +-class TightUrl extends ShortUrlApi { ++class TightUrl extends ShortUrlApi ++{ +hunk ./lib/deleteaction.php 22 +-class DeleteAction extends Action { ++class DeleteAction extends Action ++{ +hunk ./lib/facebookaction.php 24 +-class FacebookAction extends Action { ++class FacebookAction extends Action ++{ +hunk ./lib/oauthstore.php 24 +-class LaconicaOAuthDataStore extends OAuthDataStore { ++class LaconicaOAuthDataStore extends OAuthDataStore ++{ +hunk ./lib/oauthstore.php 27 +- # We keep a record of who's contacted us ++ // We keep a record of who's contacted us +hunk ./lib/oauthstore.php 79 +- $t->type = 0; # request +- $t->state = 0; # unauthorized ++ $t->type = 0; // request ++ $t->state = 0; // unauthorized +hunk ./lib/oauthstore.php 89 +- # defined in OAuthDataStore, but not implemented anywhere ++ // defined in OAuthDataStore, but not implemented anywhere hunk ./lib/oauthstore.php 102 -- if ($rt->find(TRUE) && $rt->state == 1) { # authorized -+ if ($rt->find(true) && $rt->state == 1) { # authorized -hunk ./lib/omb.php 142 -- $posted[$rp->postnoticeurl] = TRUE; -+ $posted[$rp->postnoticeurl] = true; -hunk ./lib/omb.php 211 -- common_debug('Got HTTP result "'.print_r($result,TRUE).'"', __FILE__); -+ common_debug('Got HTTP result "'.print_r($result,true).'"', __FILE__); -hunk ./lib/omb.php 244 -- $updated[$rp->updateprofileurl] = TRUE; -+ $updated[$rp->updateprofileurl] = true; -hunk ./lib/omb.php 296 -- common_debug('Got HTTP result "'.print_r($result,TRUE).'"', __FILE__); -+ common_debug('Got HTTP result "'.print_r($result,true).'"', __FILE__); -hunk ./lib/util.php 439 --function common_dropdown($id, $label, $content, $instructions=null, $blank_select=FALSE, $selected=null) -+function common_dropdown($id, $label, $content, $instructions=null, $blank_select=false, $selected=null) -hunk ./lib/util.php 1021 -- if ($recipient->find(TRUE)) { -+ if ($recipient->find(true)) { -hunk ./lib/util.php 1031 -- if ($recipient->find(TRUE)) { -+ if ($recipient->find(true)) { -hunk ./lib/util.php 2261 -- common_dropdown('to', _('To'), $mutual, null, FALSE, $to->id); -+ common_dropdown('to', _('To'), $mutual, null, false, $to->id); -hunk ./scripts/sitemap.php 334 -- if (is_writable($output_dir) === FALSE) { -+ if (is_writable($output_dir) === false) { -hunk ./scripts/sitemap.php 369 -- if (($fh_out = fopen($path,'w')) === FALSE) { -+ if (($fh_out = fopen($path,'w')) === false) { -hunk ./scripts/sitemap.php 373 -- if (fwrite($fh_out, $data) === FALSE) { -+ if (fwrite($fh_out, $data) === false) { -hunk ./scripts/xmppconfirmhandler.php 113 -- if ($confirm->find(TRUE)) { -+ if ($confirm->find(true)) { +- $rt->type = 0; # request +- if ($rt->find(true) && $rt->state == 1) { # authorized ++ $rt->type = 0; // request ++ if ($rt->find(true) && $rt->state == 1) { // authorized +hunk ./lib/oauthstore.php 109 +- $at->type = 1; # access ++ $at->type = 1; // access +hunk ./lib/oauthstore.php 117 +- # burn the old one ++ // burn the old one +hunk ./lib/oauthstore.php 119 +- $rt->state = 2; # used ++ $rt->state = 2; // used +hunk ./lib/oauthstore.php 124 +- # Update subscription +- # XXX: mixing levels here ++ // Update subscription ++ // XXX: mixing levels here +hunk ./lib/oauthstore.php 146 +- # defined in OAuthDataStore, but not implemented anywhere ++ // defined in OAuthDataStore, but not implemented anywhere +hunk ./lib/personal.php 22 +-class PersonalAction extends Action { ++class PersonalAction extends Action ++{ +hunk ./lib/profilelist.php 25 +-class ProfileList { ++class ProfileList ++{ +hunk ./lib/queuehandler.php 28 +-class QueueHandler extends Daemon { ++class QueueHandler extends Daemon ++{ +hunk ./lib/rssaction.php 24 +-class Rss10Action extends Action { ++class Rss10Action extends Action ++{ +hunk ./lib/search_engines.php 22 +-class SearchEngine { ++class SearchEngine ++{ +hunk ./lib/search_engines.php 49 +-class SphinxSearch extends SearchEngine { ++class SphinxSearch extends SearchEngine ++{ +hunk ./lib/search_engines.php 108 +-class MySQLSearch extends SearchEngine { ++class MySQLSearch extends SearchEngine ++{ +hunk ./lib/search_engines.php 121 +-class PGSearch extends SearchEngine { ++class PGSearch extends SearchEngine ++{ +hunk ./lib/searchaction.php 22 +-class SearchAction extends Action { ++class SearchAction extends Action ++{ +hunk ./lib/settingsaction.php 22 +-class SettingsAction extends Action { ++class SettingsAction extends Action ++{ +hunk ./lib/stream.php 25 +-class StreamAction extends PersonalAction { ++class StreamAction extends PersonalAction ++{ +hunk ./lib/twitterapi.php 22 +-class TwitterapiAction extends Action { ++class TwitterapiAction extends Action ++{ +hunk ./lib/xmppqueuehandler.php 31 +-class XmppQueueHandler extends QueueHandler { ++class XmppQueueHandler extends QueueHandler ++{ +hunk ./scripts/enjitqueuehandler.php 36 +-class EnjitQueueHandler extends QueueHandler { ++class EnjitQueueHandler extends QueueHandler ++{ +hunk ./scripts/jabberqueuehandler.php 36 +-class JabberQueueHandler extends XmppQueueHandler { ++class JabberQueueHandler extends XmppQueueHandler ++{ +hunk ./scripts/maildaemon.php 37 +-class MailerDaemon { ++class MailerDaemon ++{ +hunk ./scripts/ombqueuehandler.php 36 +-class OmbQueueHandler extends QueueHandler { ++class OmbQueueHandler extends QueueHandler ++{ +hunk ./scripts/publicqueuehandler.php 36 +-class PublicQueueHandler extends XmppQueueHandler { ++class PublicQueueHandler extends XmppQueueHandler ++{ +hunk ./scripts/smsqueuehandler.php 36 +-class SmsQueueHandler extends QueueHandler { ++class SmsQueueHandler extends QueueHandler ++{ +hunk ./scripts/xmppconfirmhandler.php 38 +-class XmppConfirmHandler extends XmppQueueHandler { ++class XmppConfirmHandler extends XmppQueueHandler ++{ +hunk ./scripts/xmppdaemon.php 40 +-class XMPPDaemon extends Daemon { ++class XMPPDaemon extends Daemon ++{ diff --git a/actions/accesstoken.php b/actions/accesstoken.php index cab5425bf..072ce27eb 100644 --- a/actions/accesstoken.php +++ b/actions/accesstoken.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class AccesstokenAction extends Action { +class AccesstokenAction extends Action +{ function handle($args) { parent::handle($args); diff --git a/actions/all.php b/actions/all.php index 028a3679a..526ac5f40 100644 --- a/actions/all.php +++ b/actions/all.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/actions/showstream.php'); -class AllAction extends StreamAction { +class AllAction extends StreamAction +{ function handle($args) { diff --git a/actions/allrss.php b/actions/allrss.php index 9c20cd416..660afb9e2 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class AllrssAction extends Rss10Action { +class AllrssAction extends Rss10Action +{ var $user = null; diff --git a/actions/api.php b/actions/api.php index 8ccd86f0b..dfdefe3b0 100644 --- a/actions/api.php +++ b/actions/api.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class ApiAction extends Action { +class ApiAction extends Action +{ var $user; var $content_type; diff --git a/actions/avatarbynickname.php b/actions/avatarbynickname.php index 4aeb4112a..666f386f6 100644 --- a/actions/avatarbynickname.php +++ b/actions/avatarbynickname.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class AvatarbynicknameAction extends Action { +class AvatarbynicknameAction extends Action +{ function handle($args) { parent::handle($args); diff --git a/actions/block.php b/actions/block.php index 702adcffa..c1ff7c044 100644 --- a/actions/block.php +++ b/actions/block.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class BlockAction extends Action { +class BlockAction extends Action +{ var $profile = null; diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index d926864a6..1d5c53ff2 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class ConfirmaddressAction extends Action { +class ConfirmaddressAction extends Action +{ function handle($args) { diff --git a/actions/deletenotice.php b/actions/deletenotice.php index 4f00db617..e9b4b3254 100644 --- a/actions/deletenotice.php +++ b/actions/deletenotice.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/deleteaction.php'); -class DeletenoticeAction extends DeleteAction { +class DeletenoticeAction extends DeleteAction +{ function handle($args) { parent::handle($args); diff --git a/actions/deleteprofile.php b/actions/deleteprofile.php index b1c346cb2..e12fe131a 100644 --- a/actions/deleteprofile.php +++ b/actions/deleteprofile.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class DeleteprofileAction extends Action { +class DeleteprofileAction extends Action +{ function handle($args) { parent::handle($args); diff --git a/actions/disfavor.php b/actions/disfavor.php index f0b528453..74aae86cc 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class DisfavorAction extends Action { +class DisfavorAction extends Action +{ function handle($args) { diff --git a/actions/doc.php b/actions/doc.php index 441ac19a7..856025e66 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class DocAction extends Action { +class DocAction extends Action +{ function handle($args) { diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 7f08efd29..3fa8ce296 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); -class EmailsettingsAction extends SettingsAction { +class EmailsettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/actions/facebookhome.php b/actions/facebookhome.php index 006f35eca..dcdb102e6 100644 --- a/actions/facebookhome.php +++ b/actions/facebookhome.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/facebookaction.php'); -class FacebookhomeAction extends FacebookAction { +class FacebookhomeAction extends FacebookAction +{ function handle($args) { diff --git a/actions/facebookinvite.php b/actions/facebookinvite.php index fc226e65a..48a820e44 100644 --- a/actions/facebookinvite.php +++ b/actions/facebookinvite.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/facebookaction.php'); -class FacebookinviteAction extends FacebookAction { +class FacebookinviteAction extends FacebookAction +{ function handle($args) { diff --git a/actions/facebookremove.php b/actions/facebookremove.php index 79dc32e49..a200fefbf 100644 --- a/actions/facebookremove.php +++ b/actions/facebookremove.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/facebookaction.php'); -class FacebookremoveAction extends FacebookAction { +class FacebookremoveAction extends FacebookAction +{ function handle($args) { diff --git a/actions/facebooksettings.php b/actions/facebooksettings.php index 03ad57813..38542d4b6 100644 --- a/actions/facebooksettings.php +++ b/actions/facebooksettings.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/facebookaction.php'); -class FacebooksettingsAction extends FacebookAction { +class FacebooksettingsAction extends FacebookAction +{ function handle($args) { diff --git a/actions/favor.php b/actions/favor.php index 3ec4af0b5..8103f8181 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/mail.php'); -class FavorAction extends Action { +class FavorAction extends Action +{ function handle($args) { diff --git a/actions/favorited.php b/actions/favorited.php index d479e1b3e..71a9e026e 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/stream.php'); -class FavoritedAction extends StreamAction { +class FavoritedAction extends StreamAction +{ function handle($args) { diff --git a/actions/favoritesrss.php b/actions/favoritesrss.php index aa8a3c6f4..8c7ce52bf 100644 --- a/actions/favoritesrss.php +++ b/actions/favoritesrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class FavoritesrssAction extends Rss10Action { +class FavoritesrssAction extends Rss10Action +{ var $user = null; diff --git a/actions/featured.php b/actions/featured.php index 1763adeab..2bf8b0b81 100644 --- a/actions/featured.php +++ b/actions/featured.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/stream.php'); require_once(INSTALLDIR.'/lib/profilelist.php'); -class FeaturedAction extends StreamAction { +class FeaturedAction extends StreamAction +{ function handle($args) { diff --git a/actions/finishaddopenid.php b/actions/finishaddopenid.php index d8409b6e9..0ce1680aa 100644 --- a/actions/finishaddopenid.php +++ b/actions/finishaddopenid.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); -class FinishaddopenidAction extends Action { +class FinishaddopenidAction extends Action +{ function handle($args) { diff --git a/actions/finishimmediate.php b/actions/finishimmediate.php index c4a1c1af9..0964c39f4 100644 --- a/actions/finishimmediate.php +++ b/actions/finishimmediate.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); -class FinishimmediateAction extends Action { +class FinishimmediateAction extends Action +{ function handle($args) { diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index eb52d73b1..bdb8516a3 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); -class FinishopenidloginAction extends Action { +class FinishopenidloginAction extends Action +{ function handle($args) { diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php index 5aace4fa9..cee3a1818 100644 --- a/actions/finishremotesubscribe.php +++ b/actions/finishremotesubscribe.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class FinishremotesubscribeAction extends Action { +class FinishremotesubscribeAction extends Action +{ function handle($args) { diff --git a/actions/foaf.php b/actions/foaf.php index 27548bfff..30e98960c 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -23,7 +23,8 @@ define('LISTENER', 1); define('LISTENEE', -1); define('BOTH', 0); -class FoafAction extends Action { +class FoafAction extends Action +{ function is_readonly() { diff --git a/actions/imsettings.php b/actions/imsettings.php index 56fb14758..8ecf200ec 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); require_once(INSTALLDIR.'/lib/jabber.php'); -class ImsettingsAction extends SettingsAction { +class ImsettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/actions/invite.php b/actions/invite.php index b0fc79958..80e022a3d 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class InviteAction extends Action { +class InviteAction extends Action +{ function is_readonly() { diff --git a/actions/login.php b/actions/login.php index 6ad07b610..8600d44fd 100644 --- a/actions/login.php +++ b/actions/login.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class LoginAction extends Action { +class LoginAction extends Action +{ function is_readonly() { diff --git a/actions/logout.php b/actions/logout.php index effb5abbe..201378730 100644 --- a/actions/logout.php +++ b/actions/logout.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); -class LogoutAction extends Action { +class LogoutAction extends Action +{ function is_readonly() { diff --git a/actions/microsummary.php b/actions/microsummary.php index a19a26dcf..13ddc4e3e 100644 --- a/actions/microsummary.php +++ b/actions/microsummary.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class MicrosummaryAction extends Action { +class MicrosummaryAction extends Action +{ function handle($args) { diff --git a/actions/newmessage.php b/actions/newmessage.php index 0a537ad2d..27fa9d518 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class NewmessageAction extends Action { +class NewmessageAction extends Action +{ function handle($args) { diff --git a/actions/newnotice.php b/actions/newnotice.php index 1f6117c1e..c412e893d 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once INSTALLDIR . '/lib/noticelist.php'; -class NewnoticeAction extends Action { +class NewnoticeAction extends Action +{ function handle($args) { diff --git a/actions/noticesearch.php b/actions/noticesearch.php index 782c8fe98..b36fc8ad2 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/searchaction.php'); # XXX common parent for people and content search? -class NoticesearchAction extends SearchAction { +class NoticesearchAction extends SearchAction +{ function get_instructions() { diff --git a/actions/noticesearchrss.php b/actions/noticesearchrss.php index c41d34873..20fe0ff2a 100644 --- a/actions/noticesearchrss.php +++ b/actions/noticesearchrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class NoticesearchrssAction extends Rss10Action { +class NoticesearchrssAction extends Rss10Action +{ function init() { diff --git a/actions/nudge.php b/actions/nudge.php index e0268e9d0..a6480a582 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/mail.php'); -class NudgeAction extends Action { +class NudgeAction extends Action +{ function handle($args) { diff --git a/actions/openidlogin.php b/actions/openidlogin.php index b8681215e..09679e372 100644 --- a/actions/openidlogin.php +++ b/actions/openidlogin.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); -class OpenidloginAction extends Action { +class OpenidloginAction extends Action +{ function handle($args) { diff --git a/actions/openidsettings.php b/actions/openidsettings.php index ce4143d41..039236048 100644 --- a/actions/openidsettings.php +++ b/actions/openidsettings.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); require_once(INSTALLDIR.'/lib/openid.php'); -class OpenidsettingsAction extends SettingsAction { +class OpenidsettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/actions/opensearch.php b/actions/opensearch.php index f9c6f4c57..96691fa6f 100644 --- a/actions/opensearch.php +++ b/actions/opensearch.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class OpensearchAction extends Action { +class OpensearchAction extends Action +{ function handle($args) { diff --git a/actions/othersettings.php b/actions/othersettings.php index dc1bcd02b..c2f08934c 100644 --- a/actions/othersettings.php +++ b/actions/othersettings.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); -class OthersettingsAction extends SettingsAction { +class OthersettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 6d3f6a73f..0d0fae4e5 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/searchaction.php'); require_once(INSTALLDIR.'/lib/profilelist.php'); -class PeoplesearchAction extends SearchAction { +class PeoplesearchAction extends SearchAction +{ function get_instructions() { @@ -69,7 +70,8 @@ class PeoplesearchAction extends SearchAction { } } -class PeopleSearchResults extends ProfileList { +class PeopleSearchResults extends ProfileList +{ var $terms = null; var $pattern = null; diff --git a/actions/peopletag.php b/actions/peopletag.php index c7e463026..13a0b7a41 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/profilelist.php'); -class PeopletagAction extends Action { +class PeopletagAction extends Action +{ function handle($args) { diff --git a/actions/postnotice.php b/actions/postnotice.php index 8b0781dfd..dec62a678 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class PostnoticeAction extends Action { +class PostnoticeAction extends Action +{ function handle($args) { parent::handle($args); diff --git a/actions/profilesettings.php b/actions/profilesettings.php index beb9979d0..6c22a7933 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); -class ProfilesettingsAction extends SettingsAction { +class ProfilesettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/actions/public.php b/actions/public.php index 62be3da99..039e885e6 100644 --- a/actions/public.php +++ b/actions/public.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/stream.php'); -class PublicAction extends StreamAction { +class PublicAction extends StreamAction +{ function handle($args) { diff --git a/actions/publicrss.php b/actions/publicrss.php index 8e554122e..822bc2db7 100644 --- a/actions/publicrss.php +++ b/actions/publicrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class PublicrssAction extends Rss10Action { +class PublicrssAction extends Rss10Action +{ function init() { diff --git a/actions/publicxrds.php b/actions/publicxrds.php index 63c80d81e..3d731d79f 100644 --- a/actions/publicxrds.php +++ b/actions/publicxrds.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); # XXX: factor out similarities with XrdsAction -class PublicxrdsAction extends Action { +class PublicxrdsAction extends Action +{ function is_readonly() { diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php index a482d4711..bb6ef81d6 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -23,7 +23,8 @@ if (!defined('LACONICA')) { exit(1); } define(MAX_RECOVERY_TIME, 24 * 60 * 60); -class RecoverpasswordAction extends Action { +class RecoverpasswordAction extends Action +{ function handle($args) { diff --git a/actions/register.php b/actions/register.php index 444e67e35..ac14879e2 100644 --- a/actions/register.php +++ b/actions/register.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class RegisterAction extends Action { +class RegisterAction extends Action +{ function handle($args) { diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index 02c026849..a9494772e 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class RemotesubscribeAction extends Action { +class RemotesubscribeAction extends Action +{ function handle($args) { diff --git a/actions/replies.php b/actions/replies.php index da2f27f31..eceeb4d65 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/actions/showstream.php'); -class RepliesAction extends StreamAction { +class RepliesAction extends StreamAction +{ function handle($args) { diff --git a/actions/repliesrss.php b/actions/repliesrss.php index 19ab0866a..5f85f8d2e 100644 --- a/actions/repliesrss.php +++ b/actions/repliesrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class RepliesrssAction extends Rss10Action { +class RepliesrssAction extends Rss10Action +{ var $user = null; diff --git a/actions/requesttoken.php b/actions/requesttoken.php index 091846756..a74548739 100644 --- a/actions/requesttoken.php +++ b/actions/requesttoken.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class RequesttokenAction extends Action { +class RequesttokenAction extends Action +{ function is_readonly() { diff --git a/actions/showfavorites.php b/actions/showfavorites.php index 8131cac67..f4344833d 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/actions/showstream.php'); -class ShowfavoritesAction extends StreamAction { +class ShowfavoritesAction extends StreamAction +{ function handle($args) { diff --git a/actions/showmessage.php b/actions/showmessage.php index b706fe2fa..25330a568 100644 --- a/actions/showmessage.php +++ b/actions/showmessage.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/mailbox.php'); -class ShowmessageAction extends MailboxAction { +class ShowmessageAction extends MailboxAction +{ function handle($args) { diff --git a/actions/shownotice.php b/actions/shownotice.php index abdaa72ca..2df09cb3f 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/stream.php'); -class ShownoticeAction extends StreamAction { +class ShownoticeAction extends StreamAction +{ var $notice = null; var $profile = null; diff --git a/actions/showstream.php b/actions/showstream.php index c31bce87a..e4e5d96d1 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -24,7 +24,8 @@ require_once(INSTALLDIR.'/lib/stream.php'); define('SUBSCRIPTIONS_PER_ROW', 4); define('SUBSCRIPTIONS', 80); -class ShowstreamAction extends StreamAction { +class ShowstreamAction extends StreamAction +{ function handle($args) { @@ -449,14 +450,16 @@ class ShowstreamAction extends StreamAction { # We don't show the author for a profile, since we already know who it is! -class ProfileNoticeList extends NoticeList { +class ProfileNoticeList extends NoticeList +{ function newListItem($notice) { return new ProfileNoticeListItem($notice); } } -class ProfileNoticeListItem extends NoticeListItem { +class ProfileNoticeListItem extends NoticeListItem +{ function showAuthor() { return; diff --git a/actions/smssettings.php b/actions/smssettings.php index 444da2590..fad71135c 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); require_once(INSTALLDIR.'/actions/emailsettings.php'); -class SmssettingsAction extends EmailsettingsAction { +class SmssettingsAction extends EmailsettingsAction +{ function get_instructions() { diff --git a/actions/subedit.php b/actions/subedit.php index 874102857..1142b7a03 100644 --- a/actions/subedit.php +++ b/actions/subedit.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SubeditAction extends Action { +class SubeditAction extends Action +{ var $profile = null; diff --git a/actions/subscribe.php b/actions/subscribe.php index 93884f081..f33d1d207 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SubscribeAction extends Action { +class SubscribeAction extends Action +{ function handle($args) { diff --git a/actions/subscribers.php b/actions/subscribers.php index 8c7805f51..31d0468d9 100644 --- a/actions/subscribers.php +++ b/actions/subscribers.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/gallery.php'); -class SubscribersAction extends GalleryAction { +class SubscribersAction extends GalleryAction +{ function gallery_type() { @@ -59,7 +60,8 @@ class SubscribersAction extends GalleryAction { } } -class SubscribersList extends ProfileList { +class SubscribersList extends ProfileList +{ function show_owner_controls($profile) { common_block_form($profile, array('action' => 'subscribers', diff --git a/actions/subscriptions.php b/actions/subscriptions.php index ad4a3f9e5..afe8fb260 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/gallery.php'); -class SubscriptionsAction extends GalleryAction { +class SubscriptionsAction extends GalleryAction +{ function gallery_type() { @@ -59,7 +60,8 @@ class SubscriptionsAction extends GalleryAction { } } -class SubscriptionsList extends ProfileList { +class SubscriptionsList extends ProfileList +{ function show_owner_controls($profile) { diff --git a/actions/sup.php b/actions/sup.php index 2a139b322..6a1897585 100644 --- a/actions/sup.php +++ b/actions/sup.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SupAction extends Action { +class SupAction extends Action +{ function handle($args) { diff --git a/actions/tag.php b/actions/tag.php index d7b35d613..8a3f90c16 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/actions/showstream.php'); define('TAGS_PER_PAGE', 100); -class TagAction extends StreamAction { +class TagAction extends StreamAction +{ function handle($args) { diff --git a/actions/tagother.php b/actions/tagother.php index ed17ac531..ff6788cc6 100644 --- a/actions/tagother.php +++ b/actions/tagother.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/settingsaction.php'); -class TagotherAction extends Action { +class TagotherAction extends Action +{ function handle($args) { diff --git a/actions/tagrss.php b/actions/tagrss.php index bb4edf473..912d71413 100644 --- a/actions/tagrss.php +++ b/actions/tagrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class TagrssAction extends Rss10Action { +class TagrssAction extends Rss10Action +{ function init() { diff --git a/actions/twitapiaccount.php b/actions/twitapiaccount.php index d5e9143c2..79e1ed990 100644 --- a/actions/twitapiaccount.php +++ b/actions/twitapiaccount.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapiaccountAction extends TwitterapiAction { +class TwitapiaccountAction extends TwitterapiAction +{ function verify_credentials($args, $apidata) { diff --git a/actions/twitapiblocks.php b/actions/twitapiblocks.php index 2170141f1..5d64f2f7d 100644 --- a/actions/twitapiblocks.php +++ b/actions/twitapiblocks.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapiblocksAction extends TwitterapiAction { +class TwitapiblocksAction extends TwitterapiAction +{ function create($args, $apidata) { diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index e9f7aa0bf..e0731f66f 100644 --- a/actions/twitapidirect_messages.php +++ b/actions/twitapidirect_messages.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class Twitapidirect_messagesAction extends TwitterapiAction { +class Twitapidirect_messagesAction extends TwitterapiAction +{ function direct_messages($args, $apidata) { diff --git a/actions/twitapifavorites.php b/actions/twitapifavorites.php index e7a43f770..55e04732f 100644 --- a/actions/twitapifavorites.php +++ b/actions/twitapifavorites.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapifavoritesAction extends TwitterapiAction { +class TwitapifavoritesAction extends TwitterapiAction +{ function favorites($args, $apidata) { diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index 5eca96298..ba4afe441 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapifriendshipsAction extends TwitterapiAction { +class TwitapifriendshipsAction extends TwitterapiAction +{ function create($args, $apidata) { diff --git a/actions/twitapihelp.php b/actions/twitapihelp.php index 27262f089..1b84cb11b 100644 --- a/actions/twitapihelp.php +++ b/actions/twitapihelp.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapihelpAction extends TwitterapiAction { +class TwitapihelpAction extends TwitterapiAction +{ /* Returns the string "ok" in the requested format with a 200 OK HTTP status code. * URL:http://identi.ca/api/help/test.format diff --git a/actions/twitapinotifications.php b/actions/twitapinotifications.php index e24d3829c..a19d652c3 100644 --- a/actions/twitapinotifications.php +++ b/actions/twitapinotifications.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); # This naming convention looks real sick -class TwitapinotificationsAction extends TwitterapiAction { +class TwitapinotificationsAction extends TwitterapiAction +{ function follow($args, $apidata) { diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index f280184c0..e629d5cc4 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapistatusesAction extends TwitterapiAction { +class TwitapistatusesAction extends TwitterapiAction +{ function public_timeline($args, $apidata) { diff --git a/actions/twitapiusers.php b/actions/twitapiusers.php index 4644e6be6..409986985 100644 --- a/actions/twitapiusers.php +++ b/actions/twitapiusers.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/twitterapi.php'); -class TwitapiusersAction extends TwitterapiAction { +class TwitapiusersAction extends TwitterapiAction +{ function show($args, $apidata) { diff --git a/actions/twittersettings.php b/actions/twittersettings.php index 1f55b31b6..26dede0ac 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); define('SUBSCRIPTIONS', 80); -class TwittersettingsAction extends SettingsAction { +class TwittersettingsAction extends SettingsAction +{ function get_instructions() { diff --git a/actions/unblock.php b/actions/unblock.php index 66ce0c879..112304f71 100644 --- a/actions/unblock.php +++ b/actions/unblock.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class UnblockAction extends Action { +class UnblockAction extends Action +{ var $profile = null; diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index e4e04aaa0..1c2e13635 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -17,7 +17,8 @@ * along with this program. If not, see . */ -class UnsubscribeAction extends Action { +class UnsubscribeAction extends Action +{ function handle($args) { diff --git a/actions/updateprofile.php b/actions/updateprofile.php index 2cfff1b51..abb034c81 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class UpdateprofileAction extends Action { +class UpdateprofileAction extends Action +{ function handle($args) { diff --git a/actions/userauthorization.php b/actions/userauthorization.php index c73d515d3..05efbc16c 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); define('TIMESTAMP_THRESHOLD', 300); -class UserauthorizationAction extends Action { +class UserauthorizationAction extends Action +{ function handle($args) { diff --git a/actions/userbyid.php b/actions/userbyid.php index d7b4088bd..d57ed21a5 100644 --- a/actions/userbyid.php +++ b/actions/userbyid.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class UserbyidAction extends Action { +class UserbyidAction extends Action +{ function is_readonly() { diff --git a/actions/userrss.php b/actions/userrss.php index c758a44e2..1e9fe121f 100644 --- a/actions/userrss.php +++ b/actions/userrss.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/rssaction.php'); // Formatting of RSS handled by Rss10Action -class UserrssAction extends Rss10Action { +class UserrssAction extends Rss10Action +{ var $user = null; diff --git a/actions/xrds.php b/actions/xrds.php index 1d4961d46..7edc6aa39 100644 --- a/actions/xrds.php +++ b/actions/xrds.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class XrdsAction extends Action { +class XrdsAction extends Action +{ function is_readonly() { diff --git a/classes/Channel.php b/classes/Channel.php index 02ece9c0f..2e3e4e8d4 100644 --- a/classes/Channel.php +++ b/classes/Channel.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class Channel { +class Channel +{ function on($user) { @@ -47,7 +48,8 @@ class Channel { } } -class XMPPChannel extends Channel { +class XMPPChannel extends Channel +{ var $conn = null; @@ -104,7 +106,8 @@ class XMPPChannel extends Channel { } -class WebChannel extends Channel { +class WebChannel extends Channel +{ function source() { @@ -138,7 +141,8 @@ class WebChannel extends Channel { } -class AjaxWebChannel extends WebChannel { +class AjaxWebChannel extends WebChannel +{ function output($user, $text) { @@ -166,7 +170,8 @@ class AjaxWebChannel extends WebChannel { } -class MailChannel extends Channel { +class MailChannel extends Channel +{ var $addr = null; diff --git a/classes/Command.php b/classes/Command.php index 407a6ecba..eacbdacb3 100644 --- a/classes/Command.php +++ b/classes/Command.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/classes/Channel.php'); -class Command { +class Command +{ var $user = null; @@ -36,20 +37,24 @@ class Command { } } -class UnimplementedCommand extends Command { +class UnimplementedCommand extends Command +{ function execute($channel) { $channel->error($this->user, _("Sorry, this command is not yet implemented.")); } } -class TrackingCommand extends UnimplementedCommand { +class TrackingCommand extends UnimplementedCommand +{ } -class TrackOffCommand extends UnimplementedCommand { +class TrackOffCommand extends UnimplementedCommand +{ } -class TrackCommand extends UnimplementedCommand { +class TrackCommand extends UnimplementedCommand +{ var $word = null; function __construct($user, $word) { @@ -58,7 +63,8 @@ class TrackCommand extends UnimplementedCommand { } } -class UntrackCommand extends UnimplementedCommand { +class UntrackCommand extends UnimplementedCommand +{ var $word = null; function __construct($user, $word) { @@ -67,7 +73,8 @@ class UntrackCommand extends UnimplementedCommand { } } -class NudgeCommand extends UnimplementedCommand { +class NudgeCommand extends UnimplementedCommand +{ var $other = null; function __construct($user, $other) { @@ -76,7 +83,8 @@ class NudgeCommand extends UnimplementedCommand { } } -class InviteCommand extends UnimplementedCommand { +class InviteCommand extends UnimplementedCommand +{ var $other = null; function __construct($user, $other) { @@ -85,7 +93,8 @@ class InviteCommand extends UnimplementedCommand { } } -class StatsCommand extends Command { +class StatsCommand extends Command +{ function execute($channel) { @@ -110,7 +119,8 @@ class StatsCommand extends Command { } } -class FavCommand extends Command { +class FavCommand extends Command +{ var $other = null; @@ -157,7 +167,8 @@ class FavCommand extends Command { } } -class WhoisCommand extends Command { +class WhoisCommand extends Command +{ var $other = null; function __construct($user, $other) { @@ -193,7 +204,8 @@ class WhoisCommand extends Command { } } -class MessageCommand extends Command { +class MessageCommand extends Command +{ var $other = null; var $text = null; function __construct($user, $other, $text) @@ -237,7 +249,8 @@ class MessageCommand extends Command { } } -class GetCommand extends Command { +class GetCommand extends Command +{ var $other = null; @@ -269,7 +282,8 @@ class GetCommand extends Command { } } -class SubCommand extends Command { +class SubCommand extends Command +{ var $other = null; @@ -297,7 +311,8 @@ class SubCommand extends Command { } } -class UnsubCommand extends Command { +class UnsubCommand extends Command +{ var $other = null; @@ -324,7 +339,8 @@ class UnsubCommand extends Command { } } -class OffCommand extends Command { +class OffCommand extends Command +{ var $other = null; function __construct($user, $other=null) { @@ -345,7 +361,8 @@ class OffCommand extends Command { } } -class OnCommand extends Command { +class OnCommand extends Command +{ var $other = null; function __construct($user, $other=null) { @@ -367,7 +384,8 @@ class OnCommand extends Command { } } -class HelpCommand extends Command { +class HelpCommand extends Command +{ function execute($channel) { $channel->output($this->user, diff --git a/classes/CommandInterpreter.php b/classes/CommandInterpreter.php index ff078bb05..f409ed07f 100644 --- a/classes/CommandInterpreter.php +++ b/classes/CommandInterpreter.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/classes/Command.php'); -class CommandInterpreter { +class CommandInterpreter +{ function handle_command($user, $text) { diff --git a/classes/NoticeWrapper.php b/classes/NoticeWrapper.php index e1b27c2f7..233340ccd 100644 --- a/classes/NoticeWrapper.php +++ b/classes/NoticeWrapper.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/classes/Notice.php'); -class NoticeWrapper extends Notice { +class NoticeWrapper extends Notice +{ public $id; // int(4) primary_key not_null public $profile_id; // int(4) not_null diff --git a/lib/Shorturl_api.php b/lib/Shorturl_api.php index f3f4f08df..fe106cb83 100644 --- a/lib/Shorturl_api.php +++ b/lib/Shorturl_api.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class ShortUrlApi { +class ShortUrlApi +{ protected $service_url; function __construct($service_url) @@ -69,7 +70,8 @@ class ShortUrlApi { } } -class LilUrl extends ShortUrlApi { +class LilUrl extends ShortUrlApi +{ function __construct() { parent::__construct('http://ur1.ca/'); @@ -88,7 +90,8 @@ class LilUrl extends ShortUrlApi { } -class PtitUrl extends ShortUrlApi { +class PtitUrl extends ShortUrlApi +{ function __construct() { parent::__construct('http://ptiturl.com/?creer=oui&action=Reduire&url='); @@ -106,7 +109,8 @@ class PtitUrl extends ShortUrlApi { } } -class TightUrl extends ShortUrlApi { +class TightUrl extends ShortUrlApi +{ function __construct() { parent::__construct('http://2tu.us/?save=y&url='); diff --git a/lib/deleteaction.php b/lib/deleteaction.php index a6e365121..9e89c0a54 100644 --- a/lib/deleteaction.php +++ b/lib/deleteaction.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class DeleteAction extends Action { +class DeleteAction extends Action +{ function handle($args) { diff --git a/lib/facebookaction.php b/lib/facebookaction.php index 43464b19b..d5b7ed0fb 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/extlib/facebook/facebook.php'); -class FacebookAction extends Action { +class FacebookAction extends Action +{ function handle($args) { diff --git a/lib/oauthstore.php b/lib/oauthstore.php index faae82db1..7ad3be20e 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -21,9 +21,10 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class LaconicaOAuthDataStore extends OAuthDataStore { +class LaconicaOAuthDataStore extends OAuthDataStore +{ - # We keep a record of who's contacted us + // We keep a record of who's contacted us function lookup_consumer($consumer_key) { @@ -75,8 +76,8 @@ class LaconicaOAuthDataStore extends OAuthDataStore { $t->consumer_key = $consumer->key; $t->tok = common_good_rand(16); $t->secret = common_good_rand(16); - $t->type = 0; # request - $t->state = 0; # unauthorized + $t->type = 0; // request + $t->state = 0; // unauthorized $t->created = DB_DataObject_Cast::dateTime(); if (!$t->insert()) { return null; @@ -85,7 +86,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore { } } - # defined in OAuthDataStore, but not implemented anywhere + // defined in OAuthDataStore, but not implemented anywhere function fetch_request_token($consumer) { @@ -98,14 +99,14 @@ class LaconicaOAuthDataStore extends OAuthDataStore { $rt = new Token(); $rt->consumer_key = $consumer->key; $rt->tok = $token->key; - $rt->type = 0; # request - if ($rt->find(true) && $rt->state == 1) { # authorized + $rt->type = 0; // request + if ($rt->find(true) && $rt->state == 1) { // authorized common_debug('request token found.', __FILE__); $at = new Token(); $at->consumer_key = $consumer->key; $at->tok = common_good_rand(16); $at->secret = common_good_rand(16); - $at->type = 1; # access + $at->type = 1; // access $at->created = DB_DataObject_Cast::dateTime(); if (!$at->insert()) { $e = $at->_lastError; @@ -113,15 +114,15 @@ class LaconicaOAuthDataStore extends OAuthDataStore { return null; } else { common_debug('access token "'.$at->tok.'" inserted', __FILE__); - # burn the old one + // burn the old one $orig_rt = clone($rt); - $rt->state = 2; # used + $rt->state = 2; // used if (!$rt->update($orig_rt)) { return null; } common_debug('request token "'.$rt->tok.'" updated', __FILE__); - # Update subscription - # XXX: mixing levels here + // Update subscription + // XXX: mixing levels here $sub = Subscription::staticGet('token', $rt->tok); if (!$sub) { return null; @@ -142,7 +143,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore { } } - # defined in OAuthDataStore, but not implemented anywhere + // defined in OAuthDataStore, but not implemented anywhere function fetch_access_token($consumer) { diff --git a/lib/personal.php b/lib/personal.php index 34ebe6894..02b01fece 100644 --- a/lib/personal.php +++ b/lib/personal.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class PersonalAction extends Action { +class PersonalAction extends Action +{ function is_readonly() { diff --git a/lib/profilelist.php b/lib/profilelist.php index 60737c3d4..bda05daf3 100644 --- a/lib/profilelist.php +++ b/lib/profilelist.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } define('PROFILES_PER_PAGE', 20); -class ProfileList { +class ProfileList +{ var $profile = null; var $owner = null; diff --git a/lib/queuehandler.php b/lib/queuehandler.php index 48487f8e9..9ce9e32b3 100644 --- a/lib/queuehandler.php +++ b/lib/queuehandler.php @@ -25,7 +25,8 @@ require_once(INSTALLDIR.'/lib/daemon.php'); require_once(INSTALLDIR.'/classes/Queue_item.php'); require_once(INSTALLDIR.'/classes/Notice.php'); -class QueueHandler extends Daemon { +class QueueHandler extends Daemon +{ var $_id = 'generic'; diff --git a/lib/rssaction.php b/lib/rssaction.php index e02e1febb..9564cfb46 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -21,7 +21,8 @@ if (!defined('LACONICA')) { exit(1); } define('DEFAULT_RSS_LIMIT', 48); -class Rss10Action extends Action { +class Rss10Action extends Action +{ # This will contain the details of each feed item's author and be used to generate SIOC data. var $creators = array(); diff --git a/lib/search_engines.php b/lib/search_engines.php index e96570d63..559107910 100644 --- a/lib/search_engines.php +++ b/lib/search_engines.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SearchEngine { +class SearchEngine +{ protected $target; protected $table; @@ -45,7 +46,8 @@ class SearchEngine { } } -class SphinxSearch extends SearchEngine { +class SphinxSearch extends SearchEngine +{ private $sphinx; private $connected; @@ -103,7 +105,8 @@ class SphinxSearch extends SearchEngine { } } -class MySQLSearch extends SearchEngine { +class MySQLSearch extends SearchEngine +{ function query($q) { if ('identica_people' === $this->table) @@ -115,7 +118,8 @@ class MySQLSearch extends SearchEngine { } } -class PGSearch extends SearchEngine { +class PGSearch extends SearchEngine +{ function query($q) { if ('identica_people' === $this->table) diff --git a/lib/searchaction.php b/lib/searchaction.php index 12a44a861..bc90fac1a 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SearchAction extends Action { +class SearchAction extends Action +{ function is_readonly() { diff --git a/lib/settingsaction.php b/lib/settingsaction.php index 5979c11f0..46f713fa8 100644 --- a/lib/settingsaction.php +++ b/lib/settingsaction.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class SettingsAction extends Action { +class SettingsAction extends Action +{ function handle($args) { diff --git a/lib/stream.php b/lib/stream.php index 45fbb9bd9..73758adee 100644 --- a/lib/stream.php +++ b/lib/stream.php @@ -22,7 +22,8 @@ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/personal.php'); require_once(INSTALLDIR.'/lib/noticelist.php'); -class StreamAction extends PersonalAction { +class StreamAction extends PersonalAction +{ function public_views_menu() { diff --git a/lib/twitterapi.php b/lib/twitterapi.php index 3cddfa9c9..50bcb06fe 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -19,7 +19,8 @@ if (!defined('LACONICA')) { exit(1); } -class TwitterapiAction extends Action { +class TwitterapiAction extends Action +{ var $auth_user; diff --git a/lib/xmppqueuehandler.php b/lib/xmppqueuehandler.php index 0a73403f9..91015fd45 100644 --- a/lib/xmppqueuehandler.php +++ b/lib/xmppqueuehandler.php @@ -28,7 +28,8 @@ require_once(INSTALLDIR.'/lib/queuehandler.php'); * superclass. */ -class XmppQueueHandler extends QueueHandler { +class XmppQueueHandler extends QueueHandler +{ function start() { diff --git a/scripts/enjitqueuehandler.php b/scripts/enjitqueuehandler.php index 55d73e08c..3a4f8315d 100755 --- a/scripts/enjitqueuehandler.php +++ b/scripts/enjitqueuehandler.php @@ -33,7 +33,8 @@ require_once(INSTALLDIR . '/lib/queuehandler.php'); set_error_handler('common_error_handler'); -class EnjitQueueHandler extends QueueHandler { +class EnjitQueueHandler extends QueueHandler +{ function transport() { diff --git a/scripts/jabberqueuehandler.php b/scripts/jabberqueuehandler.php index ea26aaf79..924fc4545 100755 --- a/scripts/jabberqueuehandler.php +++ b/scripts/jabberqueuehandler.php @@ -33,7 +33,8 @@ require_once(INSTALLDIR . '/lib/xmppqueuehandler.php'); set_error_handler('common_error_handler'); -class JabberQueueHandler extends XmppQueueHandler { +class JabberQueueHandler extends XmppQueueHandler +{ var $conn = null; diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index 6100cd21b..b9facec1a 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -34,7 +34,8 @@ require_once('Mail/mimeDecode.php'); # FIXME: we use both Mail_mimeDecode and mailparse # Need to move everything to mailparse -class MailerDaemon { +class MailerDaemon +{ function __construct() { diff --git a/scripts/ombqueuehandler.php b/scripts/ombqueuehandler.php index 299381ace..cdcea51dc 100755 --- a/scripts/ombqueuehandler.php +++ b/scripts/ombqueuehandler.php @@ -33,7 +33,8 @@ require_once(INSTALLDIR . '/lib/queuehandler.php'); set_error_handler('common_error_handler'); -class OmbQueueHandler extends QueueHandler { +class OmbQueueHandler extends QueueHandler +{ function transport() { diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php index b3542e5c5..5075c12df 100755 --- a/scripts/publicqueuehandler.php +++ b/scripts/publicqueuehandler.php @@ -33,7 +33,8 @@ require_once(INSTALLDIR . '/lib/xmppqueuehandler.php'); set_error_handler('common_error_handler'); -class PublicQueueHandler extends XmppQueueHandler { +class PublicQueueHandler extends XmppQueueHandler +{ function transport() { diff --git a/scripts/smsqueuehandler.php b/scripts/smsqueuehandler.php index c962ad095..38f2f11fe 100755 --- a/scripts/smsqueuehandler.php +++ b/scripts/smsqueuehandler.php @@ -33,7 +33,8 @@ require_once(INSTALLDIR . '/lib/queuehandler.php'); set_error_handler('common_error_handler'); -class SmsQueueHandler extends QueueHandler { +class SmsQueueHandler extends QueueHandler +{ function transport() { diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index 1eb932330..2b8b085ce 100755 --- a/scripts/xmppconfirmhandler.php +++ b/scripts/xmppconfirmhandler.php @@ -35,7 +35,8 @@ set_error_handler('common_error_handler'); define('CLAIM_TIMEOUT', 1200); -class XmppConfirmHandler extends XmppQueueHandler { +class XmppConfirmHandler extends XmppQueueHandler +{ var $_id = 'confirm'; diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 28ac64725..01fe8914f 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -37,7 +37,8 @@ set_error_handler('common_error_handler'); # in jabber.php, which create a new XMPP class. A more elegant (?) solution # might be to use make this a subclass of XMPP. -class XMPPDaemon extends Daemon { +class XMPPDaemon extends Daemon +{ function XMPPDaemon($resource=null) { -- cgit v1.2.3-54-g00ecf From eaa81d25fa7bd954132ce7f901fae69b0d46ec1a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 22:57:15 +0000 Subject: Convert all actions to use new UI functions I did a massive search-and-replace to get all the action subclasses to use the new output function (common_element() -> $this->element(), etc.) There's still a lot to do, but it's a first step --- actions/all.php | 2 +- actions/api.php | 8 +- actions/block.php | 16 ++-- actions/confirmaddress.php | 2 +- actions/deletenotice.php | 18 ++--- actions/deleteprofile.php | 40 +++++----- actions/disfavor.php | 12 +-- actions/doc.php | 2 +- actions/emailsettings.php | 72 ++++++++--------- actions/facebookhome.php | 2 +- actions/facebookinvite.php | 38 ++++----- actions/facebooksettings.php | 40 +++++----- actions/favor.php | 12 +-- actions/favorited.php | 10 +-- actions/featured.php | 6 +- actions/finishaddopenid.php | 2 +- actions/finishopenidlogin.php | 42 +++++----- actions/foaf.php | 72 ++++++++--------- actions/imsettings.php | 48 ++++++------ actions/invite.php | 46 +++++------ actions/login.php | 54 ++++++++----- actions/newmessage.php | 2 +- actions/newnotice.php | 28 +++---- actions/noticesearch.php | 48 ++++++------ actions/nudge.php | 12 +-- actions/openidlogin.php | 20 ++--- actions/openidsettings.php | 48 ++++++------ actions/opensearch.php | 24 +++--- actions/othersettings.php | 40 +++++----- actions/peoplesearch.php | 2 +- actions/peopletag.php | 10 +-- actions/profilesettings.php | 90 ++++++++++----------- actions/publicxrds.php | 24 +++--- actions/recoverpassword.php | 36 ++++----- actions/register.php | 58 +++++++------- actions/remotesubscribe.php | 20 ++--- actions/replies.php | 2 +- actions/showfavorites.php | 2 +- actions/shownotice.php | 8 +- actions/showstream.php | 156 ++++++++++++++++++------------------- actions/smssettings.php | 86 ++++++++++---------- actions/subscribe.php | 12 +-- actions/subscriptions.php | 14 ++-- actions/tag.php | 16 ++-- actions/tagother.php | 54 ++++++------- actions/twitapidirect_messages.php | 28 +++---- actions/twitapifriendships.php | 2 +- actions/twitapihelp.php | 2 +- actions/twitapilaconica.php | 12 +-- actions/twitapistatuses.php | 4 +- actions/twittersettings.php | 64 +++++++-------- actions/unsubscribe.php | 12 +-- actions/userauthorization.php | 44 +++++------ actions/xrds.php | 36 ++++----- lib/action.php | 23 +++--- 55 files changed, 801 insertions(+), 782 deletions(-) (limited to 'actions/showfavorites.php') diff --git a/actions/all.php b/actions/all.php index 526ac5f40..a8a74fb33 100644 --- a/actions/all.php +++ b/actions/all.php @@ -57,7 +57,7 @@ class AllAction extends StreamAction function show_header($user) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('allrss', array('nickname' => $user->nickname)), 'type' => 'application/rss+xml', diff --git a/actions/api.php b/actions/api.php index 7a0759831..9cbf9a468 100644 --- a/actions/api.php +++ b/actions/api.php @@ -159,10 +159,10 @@ class ApiAction extends Action if ($this->content_type == 'xml') { header('Content-Type: application/xml; charset=utf-8'); common_start_xml(); - common_element_start('hash'); - common_element('error', null, $msg); - common_element('request', null, $_SERVER['REQUEST_URI']); - common_element_end('hash'); + $this->elementStart('hash'); + $this->element('error', null, $msg); + $this->element('request', null, $_SERVER['REQUEST_URI']); + $this->elementEnd('hash'); common_end_xml(); } else if ($this->content_type == 'json') { header('Content-Type: application/json; charset=utf-8'); diff --git a/actions/block.php b/actions/block.php index c1ff7c044..f8f6f24fd 100644 --- a/actions/block.php +++ b/actions/block.php @@ -81,34 +81,34 @@ class BlockAction extends Action common_show_header(_('Block user')); - common_element('p', null, + $this->element('p', null, _('Are you sure you want to block this user? '. 'Afterwards, they will be unsubscribed from you, '. 'unable to subscribe to you in the future, and '. 'you will not be notified of any @-replies from them.')); - common_element_start('form', array('id' => 'block-' . $id, + $this->elementStart('form', array('id' => 'block-' . $id, 'method' => 'post', 'class' => 'block', 'action' => common_local_url('block'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('input', array('id' => 'blockto-' . $id, + $this->element('input', array('id' => 'blockto-' . $id, 'name' => 'blockto', 'type' => 'hidden', 'value' => $id)); foreach ($this->args as $k => $v) { if (substr($k, 0, 9) == 'returnto-') { - common_hidden($k, $v); + $this->hidden($k, $v); } } - common_submit('no', _('No')); - common_submit('yes', _('Yes')); + $this->submit('no', _('No')); + $this->submit('yes', _('Yes')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index 1d5c53ff2..31a157768 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -90,7 +90,7 @@ class ConfirmaddressAction extends Action $cur->query('COMMIT'); common_show_header(_('Confirm Address')); - common_element('p', null, + $this->element('p', null, sprintf(_('The address "%s" has been confirmed for your account.'), $cur->$type)); common_show_footer(); } diff --git a/actions/deletenotice.php b/actions/deletenotice.php index e9b4b3254..bae0eac1b 100644 --- a/actions/deletenotice.php +++ b/actions/deletenotice.php @@ -51,24 +51,24 @@ class DeletenoticeAction extends DeleteAction common_show_header($this->get_title(), array($this, 'show_header'), $error, array($this, 'show_top')); - common_element_start('form', array('id' => 'notice_delete_form', + $this->elementStart('form', array('id' => 'notice_delete_form', 'method' => 'post', 'action' => common_local_url('deletenotice'))); - common_hidden('token', common_session_token()); - common_hidden('notice', $this->trimmed('notice')); - common_element_start('p'); - common_element('span', array('id' => 'confirmation_text'), _('Are you sure you want to delete this notice?')); + $this->hidden('token', common_session_token()); + $this->hidden('notice', $this->trimmed('notice')); + $this->elementStart('p'); + $this->element('span', array('id' => 'confirmation_text'), _('Are you sure you want to delete this notice?')); - common_element('input', array('id' => 'submit_no', + $this->element('input', array('id' => 'submit_no', 'name' => 'submit', 'type' => 'submit', 'value' => _('No'))); - common_element('input', array('id' => 'submit_yes', + $this->element('input', array('id' => 'submit_yes', 'name' => 'submit', 'type' => 'submit', 'value' => _('Yes'))); - common_element_end('p'); - common_element_end('form'); + $this->elementEnd('p'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/deleteprofile.php b/actions/deleteprofile.php index e12fe131a..ef4687d5f 100644 --- a/actions/deleteprofile.php +++ b/actions/deleteprofile.php @@ -49,15 +49,15 @@ class DeleteprofileAction extends Action function show_feeds_list($feeds) { - common_element_start('div', array('class' => 'feedsdel')); - common_element('p', null, 'Feeds:'); - common_element_start('ul', array('class' => 'xoxo')); + $this->elementStart('div', array('class' => 'feedsdel')); + $this->element('p', null, 'Feeds:'); + $this->elementStart('ul', array('class' => 'xoxo')); foreach ($feeds as $key => $value) { $this->common_feed_item($feeds[$key]); } - common_element_end('ul'); - common_element_end('div'); + $this->elementEnd('ul'); + $this->elementEnd('div'); } //TODO move to common.php (and retrace its origin) @@ -81,19 +81,19 @@ class DeleteprofileAction extends Action $feed['textContent'] = "FOAF"; break; } - common_element_start('li'); - common_element('a', array('href' => $feed['href'], + $this->elementStart('li'); + $this->element('a', array('href' => $feed['href'], 'class' => $feed_classname, 'type' => $feed_mimetype, 'title' => $feed_title), $feed['textContent']); - common_element_end('li'); + $this->elementEnd('li'); } function show_form($msg=null, $success=false) { $this->form_header(_('Delete my account'), $msg, $success); - common_element('h2', null, _('Delete my account confirmation')); + $this->element('h2', null, _('Delete my account confirmation')); $this->show_confirm_delete_form(); common_show_footer(); } @@ -105,13 +105,13 @@ class DeleteprofileAction extends Action $notices->profile_id = $user->id; $notice_count = (int) $notices->count(); - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'delete', 'action' => common_local_url('deleteprofile'))); - common_hidden('token', common_session_token()); - common_element('p', null, "Last chance to copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); + $this->hidden('token', common_session_token()); + $this->element('p', null, "Last chance to copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); $this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('limit' => $notice_count, 'nickname' => $user->nickname)), 'type' => 'rss', @@ -122,10 +122,10 @@ class DeleteprofileAction extends Action 'version' => 'FOAF', 'item' => 'foaf'))); - common_checkbox('confirmation', _('Check if you are sure you want to delete your account.')); + $this->checkbox('confirmation', _('Check if you are sure you want to delete your account.')); - common_submit('deleteaccount', _('Delete my account')); - common_element_end('form'); + $this->submit('deleteaccount', _('Delete my account')); + $this->elementEnd('form'); } function handle_post() @@ -238,9 +238,9 @@ class DeleteprofileAction extends Action } else { $inst = $this->get_instructions(); $output = common_markup_to_html($inst); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); } $this->settings_menu(); } @@ -272,7 +272,7 @@ class DeleteprofileAction extends Action _('Other options'))); $action = $this->trimmed('action'); - common_element_start('ul', array('id' => 'nav_views')); + $this->elementStart('ul', array('id' => 'nav_views')); foreach ($menu as $menuaction => $menudesc) { if ($menuaction == 'imsettings' && !common_config('xmpp', 'enabled')) { @@ -283,7 +283,7 @@ class DeleteprofileAction extends Action $menudesc[1], $action == $menuaction); } - common_element_end('ul'); + $this->elementEnd('ul'); } } diff --git a/actions/disfavor.php b/actions/disfavor.php index 74aae86cc..9a27f34b1 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -70,13 +70,13 @@ class DisfavorAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Add to favorites')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Add to favorites')); + $this->elementEnd('head'); + $this->elementStart('body'); common_favor_form($notice); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('showfavorites', array('nickname' => $user->nickname))); diff --git a/actions/doc.php b/actions/doc.php index 856025e66..98da31267 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -34,7 +34,7 @@ class DocAction extends Action $c = file_get_contents($filename); $output = common_markup_to_html($c); common_show_header(_(ucfirst($title))); - common_raw($output); + $this->raw($output); common_show_footer(); } } diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 3fa8ce296..39f186bff 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -33,83 +33,83 @@ class EmailsettingsAction extends SettingsAction { $user = common_current_user(); $this->form_header(_('Email Settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'emailsettings', 'action' => common_local_url('emailsettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('h2', null, _('Address')); + $this->element('h2', null, _('Address')); if ($user->email) { - common_element_start('p'); - common_element('span', 'address confirmed', $user->email); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address confirmed', $user->email); + $this->element('span', 'input_instructions', _('Current confirmed email address.')); - common_hidden('email', $user->email); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('email', $user->email); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { $confirm = $this->get_confirmation(); if ($confirm) { - common_element_start('p'); - common_element('span', 'address unconfirmed', $confirm->address); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address unconfirmed', $confirm->address); + $this->element('span', 'input_instructions', _('Awaiting confirmation on this address. Check your inbox (and spam box!) for a message with further instructions.')); - common_hidden('email', $confirm->address); - common_element_end('p'); - common_submit('cancel', _('Cancel')); + $this->hidden('email', $confirm->address); + $this->elementEnd('p'); + $this->submit('cancel', _('Cancel')); } else { - common_input('email', _('Email Address'), + $this->input('email', _('Email Address'), ($this->arg('email')) ? $this->arg('email') : null, _('Email address, like "UserName@example.org"')); - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } } if ($user->email) { - common_element('h2', null, _('Incoming email')); + $this->element('h2', null, _('Incoming email')); if ($user->incomingemail) { - common_element_start('p'); - common_element('span', 'address', $user->incomingemail); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address', $user->incomingemail); + $this->element('span', 'input_instructions', _('Send email to this address to post new notices.')); - common_element_end('p'); - common_submit('removeincoming', _('Remove')); + $this->elementEnd('p'); + $this->submit('removeincoming', _('Remove')); } - common_element_start('p'); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'input_instructions', _('Make a new email address for posting to; cancels the old one.')); - common_element_end('p'); - common_submit('newincoming', _('New')); + $this->elementEnd('p'); + $this->submit('newincoming', _('New')); } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('emailnotifysub', + $this->checkbox('emailnotifysub', _('Send me notices of new subscriptions through email.'), $user->emailnotifysub); - common_checkbox('emailnotifyfav', + $this->checkbox('emailnotifyfav', _('Send me email when someone adds my notice as a favorite.'), $user->emailnotifyfav); - common_checkbox('emailnotifymsg', + $this->checkbox('emailnotifymsg', _('Send me email when someone sends me a private message.'), $user->emailnotifymsg); - common_checkbox('emailnotifynudge', + $this->checkbox('emailnotifynudge', _('Allow friends to nudge me and send me an email.'), $user->emailnotifynudge); - common_checkbox('emailpost', + $this->checkbox('emailpost', _('I want to post notices by email.'), $user->emailpost); - common_checkbox('emailmicroid', + $this->checkbox('emailmicroid', _('Publish a MicroID for my email address.'), $user->emailmicroid); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/facebookhome.php b/actions/facebookhome.php index f72f08a34..d2ac7617d 100644 --- a/actions/facebookhome.php +++ b/actions/facebookhome.php @@ -105,7 +105,7 @@ class FacebookhomeAction extends FacebookAction $this->show_header('Home'); if ($msg) { - common_element('fb:success', array('message' => $msg)); + $this->element('fb:success', array('message' => $msg)); } echo $this->show_notices($user); diff --git a/actions/facebookinvite.php b/actions/facebookinvite.php index fe0c5e493..103d5a568 100644 --- a/actions/facebookinvite.php +++ b/actions/facebookinvite.php @@ -43,22 +43,22 @@ class FacebookinviteAction extends FacebookAction $this->show_header('Invite'); - common_element('h2', null, _('Thanks for inviting your friends to use Identi.ca!')); - common_element('p', null, _('Invitations have been sent to the following users:')); + $this->element('h2', null, _('Thanks for inviting your friends to use Identi.ca!')); + $this->element('p', null, _('Invitations have been sent to the following users:')); $friend_ids = $_POST['ids']; // Hmm... $this->arg('ids') doesn't seem to work - common_element_start("ul"); + $this->elementStart("ul"); foreach ($friend_ids as $friend) { - common_element_start('li'); - common_element('fb:profile-pic', array('uid' => $friend)); - common_element('fb:name', array('uid' => $friend, + $this->elementStart('li'); + $this->element('fb:profile-pic', array('uid' => $friend)); + $this->element('fb:name', array('uid' => $friend, 'capitalize' => 'true')); - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end("ul"); + $this->elementEnd("ul"); $this->show_footer(); } @@ -77,32 +77,32 @@ class FacebookinviteAction extends FacebookAction $content = _('You have been invited to Identi.ca!') . htmlentities(''); - common_element_start('fb:request-form', array('action' => 'invite.php', + $this->elementStart('fb:request-form', array('action' => 'invite.php', 'method' => 'post', 'invite' => 'true', 'type' => 'Identi.ca', 'content' => $content)); - common_hidden('invite', 'true'); + $this->hidden('invite', 'true'); $actiontext = 'Invite your friends to use Identi.ca.'; - common_element('fb:multi-friend-selector', array('showborder' => 'false', + $this->element('fb:multi-friend-selector', array('showborder' => 'false', 'actiontext' => $actiontext, 'exclude_ids' => implode(',', $exclude_ids), 'bypass' => 'cancel')); - common_element_end('fb:request-form'); + $this->elementEnd('fb:request-form'); - common_element('h2', null, _('Friends already using Identi.ca:')); - common_element_start("ul"); + $this->element('h2', null, _('Friends already using Identi.ca:')); + $this->elementStart("ul"); foreach ($exclude_ids as $friend) { - common_element_start('li'); - common_element('fb:profile-pic', array('uid' => $friend)); - common_element('fb:name', array('uid' => $friend, + $this->elementStart('li'); + $this->element('fb:profile-pic', array('uid' => $friend)); + $this->element('fb:name', array('uid' => $friend, 'capitalize' => 'true')); - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end("ul"); + $this->elementEnd("ul"); $this->show_footer(); diff --git a/actions/facebooksettings.php b/actions/facebooksettings.php index ab04ad82b..8b071353a 100644 --- a/actions/facebooksettings.php +++ b/actions/facebooksettings.php @@ -68,43 +68,43 @@ class FacebooksettingsAction extends FacebookAction $this->show_header('Settings', $msg, $success); - common_element_start('fb:if-section-not-added', array('section' => 'profile')); - common_element('h2', null, _('Add an Identi.ca box to my profile')); - common_element_start('p'); - common_element('fb:add-section-button', array('section' => 'profile')); - common_element_end('p'); - - common_element_end('fb:if-section-not-added'); - common_element_start('p'); - common_element_start('fb:prompt-permission', array('perms' => 'status_update')); - common_element('h2', null, _('Allow Identi.ca to update my Facebook status')); - common_element_end('fb:prompt-permission'); - common_element_end('p'); + $this->elementStart('fb:if-section-not-added', array('section' => 'profile')); + $this->element('h2', null, _('Add an Identi.ca box to my profile')); + $this->elementStart('p'); + $this->element('fb:add-section-button', array('section' => 'profile')); + $this->elementEnd('p'); + + $this->elementEnd('fb:if-section-not-added'); + $this->elementStart('p'); + $this->elementStart('fb:prompt-permission', array('perms' => 'status_update')); + $this->element('h2', null, _('Allow Identi.ca to update my Facebook status')); + $this->elementEnd('fb:prompt-permission'); + $this->elementEnd('p'); if ($facebook->api_client->users_hasAppPermission('status_update')) { - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'facebook_settings')); - common_element('h2', null, _('Sync preferences')); + $this->element('h2', null, _('Sync preferences')); - common_checkbox('noticesync', _('Automatically update my Facebook status with my notices.'), + $this->checkbox('noticesync', _('Automatically update my Facebook status with my notices.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND) : true); - common_checkbox('replysync', _('Send local "@" replies to Facebook.'), + $this->checkbox('replysync', _('Send local "@" replies to Facebook.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true); - // function common_input($id, $label, $value=null,$instructions=null) + // function $this->input($id, $label, $value=null,$instructions=null) $prefix = $facebook->api_client->data_getUserPreference(1); - common_input('prefix', _('Prefix'), + $this->input('prefix', _('Prefix'), ($prefix) ? $prefix : null, _('A string to prefix notices with.')); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); } diff --git a/actions/favor.php b/actions/favor.php index 8103f8181..1dfef9bbb 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -69,13 +69,13 @@ class FavorAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Disfavor favorite')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Disfavor favorite')); + $this->elementEnd('head'); + $this->elementStart('body'); common_disfavor_form($notice); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('showfavorites', array('nickname' => $user->nickname))); diff --git a/actions/favorited.php b/actions/favorited.php index 71a9e026e..936905732 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -43,9 +43,9 @@ class FavoritedAction extends StreamAction { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); $this->public_views_menu(); } @@ -81,7 +81,7 @@ class FavoritedAction extends StreamAction $notice = new Notice; $notice->query(sprintf($qry, common_config('popular', 'dropoff'))); - common_element_start('ul', array('id' => 'notices')); + $this->elementStart('ul', array('id' => 'notices')); $cnt = 0; @@ -96,7 +96,7 @@ class FavoritedAction extends StreamAction $item->show(); } - common_element_end('ul'); + $this->elementEnd('ul'); common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, $page, 'favorited'); diff --git a/actions/featured.php b/actions/featured.php index 2bf8b0b81..035622691 100644 --- a/actions/featured.php +++ b/actions/featured.php @@ -44,9 +44,9 @@ class FeaturedAction extends StreamAction { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); $this->public_views_menu(); } diff --git a/actions/finishaddopenid.php b/actions/finishaddopenid.php index 0ce1680aa..7de631712 100644 --- a/actions/finishaddopenid.php +++ b/actions/finishaddopenid.php @@ -101,7 +101,7 @@ class FinishaddopenidAction extends Action function message($msg) { common_show_header(_('OpenID Login')); - common_element('p', null, $msg); + $this->element('p', null, $msg); common_show_footer(); } } diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index bdb8516a3..112429002 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -57,10 +57,10 @@ class FinishopenidloginAction extends Action function show_top($error=null) { if ($error) { - common_element('div', array('class' => 'error'), $error); + $this->element('div', array('class' => 'error'), $error); } else { global $config; - common_element('div', 'instructions', + $this->element('div', 'instructions', sprintf(_('This is the first time you\'ve logged into %s so we must connect your OpenID to a local account. You can either create a new account, or connect with your existing account, if you have one.'), $config['site']['name'])); } } @@ -70,36 +70,36 @@ class FinishopenidloginAction extends Action common_show_header(_('OpenID Account Setup'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'account_connect', 'action' => common_local_url('finishopenidlogin'))); - common_hidden('token', common_session_token()); - common_element('h2', null, + $this->hidden('token', common_session_token()); + $this->element('h2', null, _('Create new account')); - common_element('p', null, + $this->element('p', null, _('Create a new user with this nickname.')); - common_input('newname', _('New nickname'), + $this->input('newname', _('New nickname'), ($username) ? $username : '', _('1-64 lowercase letters or numbers, no punctuation or spaces')); - common_element_start('p'); - common_element('input', array('type' => 'checkbox', + $this->elementStart('p'); + $this->element('input', array('type' => 'checkbox', 'id' => 'license', 'name' => 'license', 'value' => 'true')); - common_text(_('My text and files are available under ')); - common_element('a', array(href => common_config('license', 'url')), + $this->text(_('My text and files are available under ')); + $this->element('a', array(href => common_config('license', 'url')), common_config('license', 'title')); - common_text(_(' except this private data: password, email address, IM address, phone number.')); - common_element_end('p'); - common_submit('create', _('Create')); - common_element('h2', null, + $this->text(_(' except this private data: password, email address, IM address, phone number.')); + $this->elementEnd('p'); + $this->submit('create', _('Create')); + $this->element('h2', null, _('Connect existing account')); - common_element('p', null, + $this->element('p', null, _('If you already have an account, login with your username and password to connect it to your OpenID.')); - common_input('nickname', _('Existing nickname')); - common_password('password', _('Password')); - common_submit('connect', _('Connect')); - common_element_end('form'); + $this->input('nickname', _('Existing nickname')); + $this->password('password', _('Password')); + $this->submit('connect', _('Connect')); + $this->elementEnd('form'); common_show_footer(); } @@ -154,7 +154,7 @@ class FinishopenidloginAction extends Action function message($msg) { common_show_header(_('OpenID Login')); - common_element('p', null, $msg); + $this->element('p', null, $msg); common_show_footer(); } diff --git a/actions/foaf.php b/actions/foaf.php index 30e98960c..6f73ce505 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -54,7 +54,7 @@ class FoafAction extends Action header('Content-Type: application/rdf+xml'); common_start_xml(); - common_element_start('rdf:RDF', array('xmlns:rdf' => + $this->elementStart('rdf:RDF', array('xmlns:rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'xmlns:rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', @@ -67,25 +67,25 @@ class FoafAction extends Action $this->show_ppd('', $user->uri); # XXX: might not be a person - common_element_start('Person', array('rdf:about' => + $this->elementStart('Person', array('rdf:about' => $user->uri)); - common_element('mbox_sha1sum', null, sha1('mailto:' . $user->email)); + $this->element('mbox_sha1sum', null, sha1('mailto:' . $user->email)); if ($profile->fullname) { - common_element('name', null, $profile->fullname); + $this->element('name', null, $profile->fullname); } if ($profile->homepage) { - common_element('homepage', array('rdf:resource' => $profile->homepage)); + $this->element('homepage', array('rdf:resource' => $profile->homepage)); } if ($profile->bio) { - common_element('rdfs:comment', null, $profile->bio); + $this->element('rdfs:comment', null, $profile->bio); } # XXX: more structured location data if ($profile->location) { - common_element_start('based_near'); - common_element_start('geo:SpatialThing'); - common_element('name', null, $profile->location); - common_element_end('geo:SpatialThing'); - common_element_end('based_near'); + $this->elementStart('based_near'); + $this->elementStart('geo:SpatialThing'); + $this->element('name', null, $profile->location); + $this->elementEnd('geo:SpatialThing'); + $this->elementEnd('based_near'); } $this->show_microblogging_account($profile, common_root_url()); @@ -93,18 +93,18 @@ class FoafAction extends Action $avatar = $profile->getOriginalAvatar(); if ($avatar) { - common_element_start('img'); - common_element_start('Image', array('rdf:about' => $avatar->url)); + $this->elementStart('img'); + $this->elementStart('Image', array('rdf:about' => $avatar->url)); foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) { $scaled = $profile->getAvatar($size); if (!$scaled->original) { # sometimes the original has one of our scaled sizes - common_element_start('thumbnail'); - common_element('Image', array('rdf:about' => $scaled->url)); - common_element_end('thumbnail'); + $this->elementStart('thumbnail'); + $this->element('Image', array('rdf:about' => $scaled->url)); + $this->elementEnd('thumbnail'); } } - common_element_end('Image'); - common_element_end('img'); + $this->elementEnd('Image'); + $this->elementEnd('img'); } # Get people user is subscribed to @@ -126,7 +126,7 @@ class FoafAction extends Action common_debug('Got a bad subscription: '.print_r($sub,true)); continue; } - common_element('knows', array('rdf:resource' => $other->uri)); + $this->element('knows', array('rdf:resource' => $other->uri)); $person[$other->uri] = array(LISTENEE, $other); } } @@ -156,7 +156,7 @@ class FoafAction extends Action } } - common_element_end('Person'); + $this->elementEnd('Person'); foreach ($person as $uri => $p) { $foaf_url = null; @@ -164,44 +164,44 @@ class FoafAction extends Action $foaf_url = common_local_url('foaf', array('nickname' => $p[1]->nickname)); } $profile = Profile::staticGet($p[1]->id); - common_element_start('Person', array('rdf:about' => $uri)); + $this->elementStart('Person', array('rdf:about' => $uri)); if ($p[0] == LISTENER || $p[0] == BOTH) { - common_element('knows', array('rdf:resource' => $user->uri)); + $this->element('knows', array('rdf:resource' => $user->uri)); } $this->show_microblogging_account($profile, ($p[1] instanceof User) ? common_root_url() : null); if ($foaf_url) { - common_element('rdfs:seeAlso', array('rdf:resource' => $foaf_url)); + $this->element('rdfs:seeAlso', array('rdf:resource' => $foaf_url)); } - common_element_end('Person'); + $this->elementEnd('Person'); if ($foaf_url) { $this->show_ppd($foaf_url, $uri); } } - common_element_end('rdf:RDF'); + $this->elementEnd('rdf:RDF'); } function show_ppd($foaf_url, $person_uri) { - common_element_start('PersonalProfileDocument', array('rdf:about' => $foaf_url)); - common_element('maker', array('rdf:resource' => $person_uri)); - common_element('primaryTopic', array('rdf:resource' => $person_uri)); - common_element_end('PersonalProfileDocument'); + $this->elementStart('PersonalProfileDocument', array('rdf:about' => $foaf_url)); + $this->element('maker', array('rdf:resource' => $person_uri)); + $this->element('primaryTopic', array('rdf:resource' => $person_uri)); + $this->elementEnd('PersonalProfileDocument'); } function show_microblogging_account($profile, $service=null) { # Their account - common_element_start('holdsAccount'); - common_element_start('OnlineAccount'); + $this->elementStart('holdsAccount'); + $this->elementStart('OnlineAccount'); if ($service) { - common_element('accountServiceHomepage', array('rdf:resource' => + $this->element('accountServiceHomepage', array('rdf:resource' => $service)); } - common_element('accountName', null, $profile->nickname); - common_element('homepage', array('rdf:resource' => $profile->profileurl)); - common_element_end('OnlineAccount'); - common_element_end('holdsAccount'); + $this->element('accountName', null, $profile->nickname); + $this->element('homepage', array('rdf:resource' => $profile->profileurl)); + $this->elementEnd('OnlineAccount'); + $this->elementEnd('holdsAccount'); } } diff --git a/actions/imsettings.php b/actions/imsettings.php index 8ecf200ec..693f49efa 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -34,57 +34,57 @@ class ImsettingsAction extends SettingsAction { $user = common_current_user(); $this->form_header(_('IM Settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'imsettings', 'action' => common_local_url('imsettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('h2', null, _('Address')); + $this->element('h2', null, _('Address')); if ($user->jabber) { - common_element_start('p'); - common_element('span', 'address confirmed', $user->jabber); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address confirmed', $user->jabber); + $this->element('span', 'input_instructions', _('Current confirmed Jabber/GTalk address.')); - common_hidden('jabber', $user->jabber); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('jabber', $user->jabber); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { $confirm = $this->get_confirmation(); if ($confirm) { - common_element_start('p'); - common_element('span', 'address unconfirmed', $confirm->address); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address unconfirmed', $confirm->address); + $this->element('span', 'input_instructions', sprintf(_('Awaiting confirmation on this address. Check your Jabber/GTalk account for a message with further instructions. (Did you add %s to your buddy list?)'), jabber_daemon_address())); - common_hidden('jabber', $confirm->address); - common_element_end('p'); - common_submit('cancel', _('Cancel')); + $this->hidden('jabber', $confirm->address); + $this->elementEnd('p'); + $this->submit('cancel', _('Cancel')); } else { - common_input('jabber', _('IM Address'), + $this->input('jabber', _('IM Address'), ($this->arg('jabber')) ? $this->arg('jabber') : null, sprintf(_('Jabber or GTalk address, like "UserName@example.org". First, make sure to add %s to your buddy list in your IM client or on GTalk.'), jabber_daemon_address())); - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('jabbernotify', + $this->checkbox('jabbernotify', _('Send me notices through Jabber/GTalk.'), $user->jabbernotify); - common_checkbox('updatefrompresence', + $this->checkbox('updatefrompresence', _('Post a notice when my Jabber/GTalk status changes.'), $user->updatefrompresence); - common_checkbox('jabberreplies', + $this->checkbox('jabberreplies', _('Send me replies through Jabber/GTalk from people I\'m not subscribed to.'), $user->jabberreplies); - common_checkbox('jabbermicroid', + $this->checkbox('jabbermicroid', _('Publish a MicroID for my Jabber/GTalk address.'), $user->jabbermicroid); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/invite.php b/actions/invite.php index 80e022a3d..15233602e 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -89,29 +89,29 @@ class InviteAction extends Action common_show_header(_('Invitation(s) sent')); if ($already) { - common_element('p', null, _('You are already subscribed to these users:')); - common_element_start('ul'); + $this->element('p', null, _('You are already subscribed to these users:')); + $this->elementStart('ul'); foreach ($already as $other) { - common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); + $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); } - common_element_end('ul'); + $this->elementEnd('ul'); } if ($subbed) { - common_element('p', null, _('These people are already users and you were automatically subscribed to them:')); - common_element_start('ul'); + $this->element('p', null, _('These people are already users and you were automatically subscribed to them:')); + $this->elementStart('ul'); foreach ($subbed as $other) { - common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); + $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); } - common_element_end('ul'); + $this->elementEnd('ul'); } if ($sent) { - common_element('p', null, _('Invitation(s) sent to the following people:')); - common_element_start('ul'); + $this->element('p', null, _('Invitation(s) sent to the following people:')); + $this->elementStart('ul'); foreach ($sent as $other) { - common_element('li', null, $other); + $this->element('li', null, $other); } - common_element_end('ul'); - common_element('p', null, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!')); + $this->elementEnd('ul'); + $this->element('p', null, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!')); } common_show_footer(); } @@ -119,12 +119,12 @@ class InviteAction extends Action function show_top($error=null) { if ($error) { - common_element('p', 'error', $error); + $this->element('p', 'error', $error); } else { - common_element_start('div', 'instructions'); - common_element('p', null, + $this->elementStart('div', 'instructions'); + $this->element('p', null, _('Use this form to invite your friends and colleagues to use this service.')); - common_element_end('div'); + $this->elementEnd('div'); } } @@ -135,22 +135,22 @@ class InviteAction extends Action common_show_header(_('Invite new users'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'invite', 'action' => common_local_url('invite'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_textarea('addresses', _('Email addresses'), + $this->textarea('addresses', _('Email addresses'), $this->trimmed('addresses'), _('Addresses of friends to invite (one per line)')); - common_textarea('personal', _('Personal message'), + $this->textarea('personal', _('Personal message'), $this->trimmed('personal'), _('Optionally add a personal message to the invitation.')); - common_submit('send', _('Send')); + $this->submit('send', _('Send')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/login.php b/actions/login.php index 8600d44fd..fd98e656d 100644 --- a/actions/login.php +++ b/actions/login.php @@ -106,22 +106,45 @@ class LoginAction extends Action function show_form($error=null) { - common_show_header(_('Login'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->error = $error; + $this->showPage(); + } + + function title() + { + return _('Login'); + } + + function showPageNotice() + { + if ($this->error) { + $this->element('p', 'error', $this->error); + } else { + $instr = $this->get_instructions(); + $output = common_markup_to_html($instr); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); + } + } + + function showContent() + { + $this->elementStart('form', array('method' => 'post', 'id' => 'login', 'action' => common_local_url('login'))); - common_input('nickname', _('Nickname')); - common_password('password', _('Password')); - common_checkbox('rememberme', _('Remember me'), false, + $this->input('nickname', _('Nickname')); + $this->password('password', _('Password')); + $this->checkbox('rememberme', _('Remember me'), false, _('Automatically login in the future; ' . 'not for shared computers!')); - common_submit('submit', _('Login')); - common_hidden('token', common_session_token()); - common_element_end('form'); - common_element_start('p'); - common_element('a', array('href' => common_local_url('recoverpassword')), + $this->submit('submit', _('Login')); + $this->hidden('token', common_session_token()); + $this->elementEnd('form'); + $this->elementStart('p'); + $this->element('a', array('href' => common_local_url('recoverpassword')), _('Lost or forgotten password?')); - common_element_end('p'); + $this->elementEnd('p'); common_show_footer(); } @@ -146,14 +169,5 @@ class LoginAction extends Action function show_top($error=null) { - if ($error) { - common_element('p', 'error', $error); - } else { - $instr = $this->get_instructions(); - $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); - } } } diff --git a/actions/newmessage.php b/actions/newmessage.php index 27fa9d518..6221b67e9 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -127,7 +127,7 @@ class NewmessageAction extends Action array($this, 'show_top')); if ($msg) { - common_element('p', array('id'=>'error'), $msg); + $this->element('p', array('id'=>'error'), $msg); } common_show_footer(); diff --git a/actions/newnotice.php b/actions/newnotice.php index c412e893d..89792d95a 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -92,13 +92,13 @@ class NewnoticeAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Notice posted')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Notice posted')); + $this->elementEnd('head'); + $this->elementStart('body'); $this->show_notice($notice); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { $returnto = $this->trimmed('returnto'); @@ -116,13 +116,13 @@ class NewnoticeAction extends Action function ajax_error_msg($msg) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Ajax Error')); - common_element_end('head'); - common_element_start('body'); - common_element('p', array('id' => 'error'), $msg); - common_element_end('body'); - common_element_end('html'); + $this->elementStart('head'); + $this->element('title', null, _('Ajax Error')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->element('p', array('id' => 'error'), $msg); + $this->elementEnd('body'); + $this->elementEnd('html'); } function show_top($content=null) @@ -147,7 +147,7 @@ class NewnoticeAction extends Action common_show_header(_('New notice'), null, $content, array($this, 'show_top')); if ($msg) { - common_element('p', array('id' => 'error'), $msg); + $this->element('p', array('id' => 'error'), $msg); } common_show_footer(); } diff --git a/actions/noticesearch.php b/actions/noticesearch.php index b36fc8ad2..d998b9da8 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -58,7 +58,7 @@ class NoticesearchAction extends SearchAction } if ($cnt > 0) { $terms = preg_split('/[\s,]+/', $q); - common_element_start('ul', array('id' => 'notices')); + $this->elementStart('ul', array('id' => 'notices')); for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) { if ($notice->fetch()) { $this->show_notice($notice, $terms); @@ -67,9 +67,9 @@ class NoticesearchAction extends SearchAction break; } } - common_element_end('ul'); + $this->elementEnd('ul'); } else { - common_element('p', 'error', _('No results')); + $this->element('p', 'error', _('No results')); } common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, @@ -82,7 +82,7 @@ class NoticesearchAction extends SearchAction $q = $arr[0]; } if ($q) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('noticesearchrss', array('q' => $q)), 'type' => 'application/rss+xml', @@ -101,58 +101,58 @@ class NoticesearchAction extends SearchAction return; } # XXX: RDFa - common_element_start('li', array('class' => 'notice_single', + $this->elementStart('li', array('class' => 'notice_single', 'id' => 'notice-' . $notice->id)); $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); - common_element_start('a', array('href' => $profile->profileurl)); - common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE), + $this->elementStart('a', array('href' => $profile->profileurl)); + $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE), 'class' => 'avatar stream', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => ($profile->fullname) ? $profile->fullname : $profile->nickname)); - common_element_end('a'); - common_element('a', array('href' => $profile->profileurl, + $this->elementEnd('a'); + $this->element('a', array('href' => $profile->profileurl, 'class' => 'nickname'), $profile->nickname); # FIXME: URL, image, video, audio - common_element_start('p', array('class' => 'content')); + $this->elementStart('p', array('class' => 'content')); if ($notice->rendered) { - common_raw($this->highlight($notice->rendered, $terms)); + $this->raw($this->highlight($notice->rendered, $terms)); } else { # XXX: may be some uncooked notices in the DB, # we cook them right now. This should probably disappear in future # versions (>> 0.4.x) - common_raw($this->highlight(common_render_content($notice->content, $notice), $terms)); + $this->raw($this->highlight(common_render_content($notice->content, $notice), $terms)); } - common_element_end('p'); + $this->elementEnd('p'); $noticeurl = common_local_url('shownotice', array('notice' => $notice->id)); - common_element_start('p', 'time'); - common_element('a', array('class' => 'permalink', + $this->elementStart('p', 'time'); + $this->element('a', array('class' => 'permalink', 'href' => $noticeurl, 'title' => common_exact_date($notice->created)), common_date_string($notice->created)); if ($notice->reply_to) { $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); - common_text(' ('); - common_element('a', array('class' => 'inreplyto', + $this->text(' ('); + $this->element('a', array('class' => 'inreplyto', 'href' => $replyurl), _('in reply to...')); - common_text(')'); + $this->text(')'); } - common_element_start('a', + $this->elementStart('a', array('href' => common_local_url('newnotice', array('replyto' => $profile->nickname)), 'onclick' => 'doreply("'.$profile->nickname.'"); return false', 'title' => _('reply'), 'class' => 'replybutton')); - common_hidden('posttoken', common_session_token()); + $this->hidden('posttoken', common_session_token()); - common_raw('→'); - common_element_end('a'); - common_element_end('p'); - common_element_end('li'); + $this->raw('→'); + $this->elementEnd('a'); + $this->elementEnd('p'); + $this->elementEnd('li'); } function highlight($text, $terms) diff --git a/actions/nudge.php b/actions/nudge.php index a6480a582..de930e462 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -59,13 +59,13 @@ class NudgeAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Nudge sent')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Nudge sent')); + $this->elementEnd('head'); + $this->elementStart('body'); common_nudge_response(); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { // display a confirmation to the user common_redirect(common_local_url('showstream', diff --git a/actions/openidlogin.php b/actions/openidlogin.php index 09679e372..82791af34 100644 --- a/actions/openidlogin.php +++ b/actions/openidlogin.php @@ -66,13 +66,13 @@ class OpenidloginAction extends Action function show_top($error=null) { if ($error) { - common_element('div', array('class' => 'error'), $error); + $this->element('div', array('class' => 'error'), $error); } else { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); } } @@ -80,18 +80,18 @@ class OpenidloginAction extends Action { common_show_header(_('OpenID Login'), null, $error, array($this, 'show_top')); $formaction = common_local_url('openidlogin'); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'openidlogin', 'action' => $formaction)); - common_hidden('token', common_session_token()); - common_input('openid_url', _('OpenID URL'), + $this->hidden('token', common_session_token()); + $this->input('openid_url', _('OpenID URL'), $openid_url, _('Your OpenID URL')); - common_checkbox('rememberme', _('Remember me'), false, + $this->checkbox('rememberme', _('Remember me'), false, _('Automatically login in the future; ' . 'not for shared computers!')); - common_submit('submit', _('Login')); - common_element_end('form'); + $this->submit('submit', _('Login')); + $this->elementEnd('form'); common_show_footer(); } } diff --git a/actions/openidsettings.php b/actions/openidsettings.php index 039236048..9265b5ea6 100644 --- a/actions/openidsettings.php +++ b/actions/openidsettings.php @@ -39,28 +39,28 @@ class OpenidsettingsAction extends SettingsAction $this->form_header(_('OpenID settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'openidadd', 'action' => common_local_url('openidsettings'))); - common_hidden('token', common_session_token()); - common_element('h2', null, _('Add OpenID')); - common_element('p', null, + $this->hidden('token', common_session_token()); + $this->element('h2', null, _('Add OpenID')); + $this->element('p', null, _('If you want to add an OpenID to your account, ' . 'enter it in the box below and click "Add".')); - common_element_start('p'); - common_element('label', array('for' => 'openid_url'), + $this->elementStart('p'); + $this->element('label', array('for' => 'openid_url'), _('OpenID URL')); - common_element('input', array('name' => 'openid_url', + $this->element('input', array('name' => 'openid_url', 'type' => 'text', 'id' => 'openid_url')); - common_element('input', array('type' => 'submit', + $this->element('input', array('type' => 'submit', 'id' => 'add', 'name' => 'add', 'class' => 'submit', 'value' => _('Add'))); - common_element_end('p'); - common_element_end('form'); + $this->elementEnd('p'); + $this->elementEnd('form'); $oid = new User_openid(); $oid->user_id = $user->id; @@ -69,48 +69,48 @@ class OpenidsettingsAction extends SettingsAction if ($cnt > 0) { - common_element('h2', null, _('Remove OpenID')); + $this->element('h2', null, _('Remove OpenID')); if ($cnt == 1 && !$user->password) { - common_element('p', null, + $this->element('p', null, _('Removing your only OpenID would make it impossible to log in! ' . 'If you need to remove it, add another OpenID first.')); if ($oid->fetch()) { - common_element_start('p'); - common_element('a', array('href' => $oid->canonical), + $this->elementStart('p'); + $this->element('a', array('href' => $oid->canonical), $oid->display); - common_element_end('p'); + $this->elementEnd('p'); } } else { - common_element('p', null, + $this->element('p', null, _('You can remove an OpenID from your account '. 'by clicking the button marked "Remove".')); $idx = 0; while ($oid->fetch()) { - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'openiddelete' . $idx, 'action' => common_local_url('openidsettings'))); - common_element_start('p'); - common_hidden('token', common_session_token()); - common_element('a', array('href' => $oid->canonical), + $this->elementStart('p'); + $this->hidden('token', common_session_token()); + $this->element('a', array('href' => $oid->canonical), $oid->display); - common_element('input', array('type' => 'hidden', + $this->element('input', array('type' => 'hidden', 'id' => 'openid_url'.$idx, 'name' => 'openid_url', 'value' => $oid->canonical)); - common_element('input', array('type' => 'submit', + $this->element('input', array('type' => 'submit', 'id' => 'remove'.$idx, 'name' => 'remove', 'class' => 'submit', 'value' => _('Remove'))); - common_element_end('p'); - common_element_end('form'); + $this->elementEnd('p'); + $this->elementEnd('form'); $idx++; } } diff --git a/actions/opensearch.php b/actions/opensearch.php index 96691fa6f..6e6e794e9 100644 --- a/actions/opensearch.php +++ b/actions/opensearch.php @@ -41,21 +41,21 @@ class OpensearchAction extends Action header('Content-Type: text/html'); common_start_xml(); - common_element_start('OpenSearchDescription', array('xmlns' => 'http://a9.com/-/spec/opensearch/1.1/')); + $this->elementStart('OpenSearchDescription', array('xmlns' => 'http://a9.com/-/spec/opensearch/1.1/')); $short_name = common_config('site', 'name').' '.$short_name; - common_element('ShortName', null, $short_name); - common_element('Contact', null, common_config('site', 'email')); - common_element('Url', array('type' => 'text/html', 'method' => 'get', + $this->element('ShortName', null, $short_name); + $this->element('Contact', null, common_config('site', 'email')); + $this->element('Url', array('type' => 'text/html', 'method' => 'get', 'template' => str_replace('---', '{searchTerms}', common_local_url($type, array('q' => '---'))))); - common_element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico')); - common_element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png')); - common_element('AdultContent', null, 'false'); - common_element('Language', null, common_language()); - common_element('OutputEncoding', null, 'UTF-8'); - common_element('InputEncoding', null, 'UTF-8'); - - common_element_end('OpenSearchDescription'); + $this->element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico')); + $this->element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png')); + $this->element('AdultContent', null, 'false'); + $this->element('Language', null, common_language()); + $this->element('OutputEncoding', null, 'UTF-8'); + $this->element('InputEncoding', null, 'UTF-8'); + + $this->elementEnd('OpenSearchDescription'); common_end_xml(); } } diff --git a/actions/othersettings.php b/actions/othersettings.php index c2f08934c..97cbd0094 100644 --- a/actions/othersettings.php +++ b/actions/othersettings.php @@ -35,12 +35,12 @@ class OthersettingsAction extends SettingsAction $this->form_header(_('Other Settings'), $msg, $success); - common_element('h2', null, _('URL Auto-shortening')); - common_element_start('form', array('method' => 'post', + $this->element('h2', null, _('URL Auto-shortening')); + $this->elementStart('form', array('method' => 'post', 'id' => 'othersettings', 'action' => common_local_url('othersettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); $services = array( '' => 'None', @@ -54,13 +54,13 @@ class OthersettingsAction extends SettingsAction 'metamark.net' => 'metamark.net' ); - common_dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), false, $user->urlshorteningservice); + $this->dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), false, $user->urlshorteningservice); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); -// common_element('h2', null, _('Delete my account')); +// $this->element('h2', null, _('Delete my account')); // $this->show_delete_form(); common_show_footer(); @@ -68,15 +68,15 @@ class OthersettingsAction extends SettingsAction function show_feeds_list($feeds) { - common_element_start('div', array('class' => 'feedsdel')); - common_element('p', null, 'Feeds:'); - common_element_start('ul', array('class' => 'xoxo')); + $this->elementStart('div', array('class' => 'feedsdel')); + $this->element('p', null, 'Feeds:'); + $this->elementStart('ul', array('class' => 'xoxo')); foreach ($feeds as $key => $value) { $this->common_feed_item($feeds[$key]); } - common_element_end('ul'); - common_element_end('div'); + $this->elementEnd('ul'); + $this->elementEnd('div'); } //TODO move to common.php (and retrace its origin) @@ -100,13 +100,13 @@ class OthersettingsAction extends SettingsAction $feed['textContent'] = "FOAF"; break; } - common_element_start('li'); - common_element('a', array('href' => $feed['href'], + $this->elementStart('li'); + $this->element('a', array('href' => $feed['href'], 'class' => $feed_classname, 'type' => $feed_mimetype, 'title' => $feed_title), $feed['textContent']); - common_element_end('li'); + $this->elementEnd('li'); } // function show_delete_form() { @@ -115,13 +115,13 @@ class OthersettingsAction extends SettingsAction // $notices->profile_id = $user->id; // $notice_count = (int) $notices->count(); // -// common_element_start('form', array('method' => 'POST', +// $this->elementStart('form', array('method' => 'POST', // 'id' => 'delete', // 'action' => // common_local_url('deleteprofile'))); // -// common_hidden('token', common_session_token()); -// common_element('p', null, "You can copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); +// $this->hidden('token', common_session_token()); +// $this->element('p', null, "You can copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); // // $this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('limit' => $notice_count, 'nickname' => $user->nickname)), // 'type' => 'rss', @@ -132,8 +132,8 @@ class OthersettingsAction extends SettingsAction // 'version' => 'FOAF', // 'item' => 'foaf'))); // -// common_submit('deleteaccount', _('Delete my account')); -// common_element_end('form'); +// $this->submit('deleteaccount', _('Delete my account')); +// $this->elementEnd('form'); // } function handle_post() diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 0d0fae4e5..2b13b0812 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -60,7 +60,7 @@ class PeoplesearchAction extends SearchAction $results = new PeopleSearchResults($profile, $terms); $results->show_list(); } else { - common_element('p', 'error', _('No results')); + $this->element('p', 'error', _('No results')); } $profile->free(); diff --git a/actions/peopletag.php b/actions/peopletag.php index 13a0b7a41..2680638d7 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -90,11 +90,11 @@ class PeopletagAction extends Action { $instr = sprintf(_('These are users who have tagged themselves "%s" ' . 'to show a common interest, characteristic, hobby or job.'), $tag); - common_element_start('div', 'instructions'); - common_element_start('p'); - common_text($instr); - common_element_end('p'); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->elementStart('p'); + $this->text($instr); + $this->elementEnd('p'); + $this->elementEnd('div'); } function get_title() diff --git a/actions/profilesettings.php b/actions/profilesettings.php index d861919b9..ef45fc1d9 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -34,11 +34,11 @@ class ProfilesettingsAction extends SettingsAction { $this->form_header(_('Profile settings'), $msg, $success); $this->show_settings_form(); - common_element('h2', null, _('Avatar')); + $this->element('h2', null, _('Avatar')); $this->show_avatar_form(); - common_element('h2', null, _('Change password')); + $this->element('h2', null, _('Change password')); $this->show_password_form(); -// common_element('h2', null, _('Delete my account')); +// $this->element('h2', null, _('Delete my account')); // $this->show_delete_form(); common_show_footer(); } @@ -74,46 +74,46 @@ class ProfilesettingsAction extends SettingsAction $user = common_current_user(); $profile = $user->getProfile(); - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'profilesettings', 'action' => common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); # too much common patterns here... abstractable? - common_input('nickname', _('Nickname'), + $this->input('nickname', _('Nickname'), ($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname, _('1-64 lowercase letters or numbers, no punctuation or spaces')); - common_input('fullname', _('Full name'), + $this->input('fullname', _('Full name'), ($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname); - common_input('homepage', _('Homepage'), + $this->input('homepage', _('Homepage'), ($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage, _('URL of your homepage, blog, or profile on another site')); - common_textarea('bio', _('Bio'), + $this->textarea('bio', _('Bio'), ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, _('Describe yourself and your interests in 140 chars')); - common_input('location', _('Location'), + $this->input('location', _('Location'), ($this->arg('location')) ? $this->arg('location') : $profile->location, _('Where you are, like "City, State (or Region), Country"')); - common_input('tags', _('Tags'), + $this->input('tags', _('Tags'), ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); $language = common_language(); - common_dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), true, $language); + $this->dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), true, $language); $timezone = common_timezone(); $timezones = array(); foreach(DateTimeZone::listIdentifiers() as $k => $v) { $timezones[$v] = $v; } - common_dropdown('timezone', _('Timezone'), $timezones, _('What timezone are you normally in?'), true, $timezone); + $this->dropdown('timezone', _('Timezone'), $timezones, _('What timezone are you normally in?'), true, $timezone); - common_checkbox('autosubscribe', _('Automatically subscribe to whoever subscribes to me (best for non-humans)'), + $this->checkbox('autosubscribe', _('Automatically subscribe to whoever subscribes to me (best for non-humans)'), ($this->arg('autosubscribe')) ? $this->boolean('autosubscribe') : $user->autosubscribe); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); } @@ -132,62 +132,62 @@ class ProfilesettingsAction extends SettingsAction $original = $profile->getOriginalAvatar(); - common_element_start('form', array('enctype' => 'multipart/form-data', + $this->elementStart('form', array('enctype' => 'multipart/form-data', 'method' => 'POST', 'id' => 'avatar', 'action' => common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); if ($original) { - common_element_start('div', array('id'=>'avatar_original', 'class'=>'avatar_view')); - common_element('h3', null, _("Original:")); - common_element_start('div', array('id'=>'avatar_original_view')); - common_element('img', array('src' => $original->url, + $this->elementStart('div', array('id'=>'avatar_original', 'class'=>'avatar_view')); + $this->element('h3', null, _("Original:")); + $this->elementStart('div', array('id'=>'avatar_original_view')); + $this->element('img', array('src' => $original->url, 'class' => 'avatar original', 'width' => $original->width, 'height' => $original->height, 'alt' => $user->nickname)); - common_element_end('div'); - common_element_end('div'); + $this->elementEnd('div'); + $this->elementEnd('div'); } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); if ($avatar) { - common_element_start('div', array('id'=>'avatar_preview', 'class'=>'avatar_view')); - common_element('h3', null, _("Preview:")); - common_element_start('div', array('id'=>'avatar_preview_view')); - common_element('img', array('src' => $original->url,//$avatar->url, + $this->elementStart('div', array('id'=>'avatar_preview', 'class'=>'avatar_view')); + $this->element('h3', null, _("Preview:")); + $this->elementStart('div', array('id'=>'avatar_preview_view')); + $this->element('img', array('src' => $original->url,//$avatar->url, 'class' => 'avatar profile', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $user->nickname)); - common_element_end('div'); - common_element_end('div'); + $this->elementEnd('div'); + $this->elementEnd('div'); foreach(array('avatar_crop_x', 'avatar_crop_y', 'avatar_crop_w', 'avatar_crop_h') as $crop_info) { - common_element('input', array('name' => $crop_info, + $this->element('input', array('name' => $crop_info, 'type' => 'hidden', 'id' => $crop_info)); } - common_submit('crop', _('Crop')); + $this->submit('crop', _('Crop')); } - common_element('input', array('name' => 'MAX_FILE_SIZE', + $this->element('input', array('name' => 'MAX_FILE_SIZE', 'type' => 'hidden', 'id' => 'MAX_FILE_SIZE', 'value' => MAX_AVATAR_SIZE)); - common_element_start('p'); + $this->elementStart('p'); - common_element('input', array('name' => 'avatarfile', + $this->element('input', array('name' => 'avatarfile', 'type' => 'file', 'id' => 'avatarfile')); - common_element_end('p'); + $this->elementEnd('p'); - common_submit('upload', _('Upload')); - common_element_end('form'); + $this->submit('upload', _('Upload')); + $this->elementEnd('form'); } @@ -195,23 +195,23 @@ class ProfilesettingsAction extends SettingsAction { $user = common_current_user(); - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'password', 'action' => common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); # Users who logged in with OpenID won't have a pwd if ($user->password) { - common_password('oldpassword', _('Old password')); + $this->password('oldpassword', _('Old password')); } - common_password('newpassword', _('New password'), + $this->password('newpassword', _('New password'), _('6 or more characters')); - common_password('confirm', _('Confirm'), + $this->password('confirm', _('Confirm'), _('same as password above')); - common_submit('changepass', _('Change')); - common_element_end('form'); + $this->submit('changepass', _('Change')); + $this->elementEnd('form'); } function save_profile() diff --git a/actions/publicxrds.php b/actions/publicxrds.php index 3d731d79f..f66e34533 100644 --- a/actions/publicxrds.php +++ b/actions/publicxrds.php @@ -39,45 +39,45 @@ class PublicxrdsAction extends Action header('Content-Type: application/xrds+xml'); common_start_xml(); - common_element_start('XRDS', array('xmlns' => 'xri://$xrds')); + $this->elementStart('XRDS', array('xmlns' => 'xri://$xrds')); - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); foreach (array('finishopenidlogin', 'finishaddopenid', 'finishimmediate') as $finish) { $this->show_service(Auth_OpenID_RP_RETURN_TO_URL_TYPE, common_local_url($finish)); } - common_element_end('XRD'); + $this->elementEnd('XRD'); - common_element_end('XRDS'); + $this->elementEnd('XRDS'); common_end_xml(); } function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { - common_element_start('Service'); + $this->elementStart('Service'); if ($uri) { - common_element('URI', null, $uri); + $this->element('URI', null, $uri); } - common_element('Type', null, $type); + $this->element('Type', null, $type); if ($params) { foreach ($params as $param) { - common_element('Type', null, $param); + $this->element('Type', null, $param); } } if ($sigs) { foreach ($sigs as $sig) { - common_element('Type', null, $sig); + $this->element('Type', null, $sig); } } if ($localId) { - common_element('LocalID', null, $localId); + $this->element('LocalID', null, $localId); } - common_element_end('Service'); + $this->elementEnd('Service'); } } \ No newline at end of file diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php index bb6ef81d6..3e6ecfb1f 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -141,24 +141,24 @@ class RecoverpasswordAction extends Action function show_top($msg=null) { if ($msg) { - common_element('div', 'error', $msg); + $this->element('div', 'error', $msg); } else { - common_element_start('div', 'instructions'); - common_element('p', null, + $this->elementStart('div', 'instructions'); + $this->element('p', null, _('If you\'ve forgotten or lost your' . ' password, you can get a new one sent to' . ' the email address you have stored ' . ' in your account.')); - common_element_end('div'); + $this->elementEnd('div'); } } function show_password_top($msg=null) { if ($msg) { - common_element('div', 'error', $msg); + $this->element('div', 'error', $msg); } else { - common_element('div', 'instructions', + $this->element('div', 'instructions', _('You\'ve been identified. Enter a ' . ' new password below. ')); } @@ -170,15 +170,15 @@ class RecoverpasswordAction extends Action common_show_header(_('Recover password'), null, $msg, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'recoverpassword', 'action' => common_local_url('recoverpassword'))); - common_input('nicknameoremail', _('Nickname or email'), + $this->input('nicknameoremail', _('Nickname or email'), $this->trimmed('nicknameoremail'), _('Your nickname on this server, ' . 'or your registered email address.')); - common_submit('recover', _('Recover')); - common_element_end('form'); + $this->submit('recover', _('Recover')); + $this->elementEnd('form'); common_show_footer(); } @@ -188,16 +188,16 @@ class RecoverpasswordAction extends Action common_show_header(_('Reset password'), null, $msg, array($this, 'show_password_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'recoverpassword', 'action' => common_local_url('recoverpassword'))); - common_hidden('token', common_session_token()); - common_password('newpassword', _('New password'), + $this->hidden('token', common_session_token()); + $this->password('newpassword', _('New password'), _('6 or more characters, and don\'t forget it!')); - common_password('confirm', _('Confirm'), + $this->password('confirm', _('Confirm'), _('Same as password above')); - common_submit('reset', _('Reset')); - common_element_end('form'); + $this->submit('reset', _('Reset')); + $this->elementEnd('form'); common_show_footer(); } @@ -278,7 +278,7 @@ class RecoverpasswordAction extends Action mail_to_user($user, _('Password recovery requested'), $body, $confirm->address); common_show_header(_('Password recovery requested')); - common_element('p', null, + $this->element('p', null, _('Instructions for recovering your password ' . 'have been sent to the email address registered to your ' . 'account.')); @@ -336,7 +336,7 @@ class RecoverpasswordAction extends Action common_real_login(true); common_show_header(_('Password saved.')); - common_element('p', null, _('New password successfully saved. ' . + $this->element('p', null, _('New password successfully saved. ' . 'You are now logged in.')); common_show_footer(); } diff --git a/actions/register.php b/actions/register.php index c479816ef..bac179687 100644 --- a/actions/register.php +++ b/actions/register.php @@ -155,16 +155,16 @@ class RegisterAction extends Action function show_top($error=null) { if ($error) { - common_element('p', 'error', $error); + $this->element('p', 'error', $error); } else { $instr = common_markup_to_html(_('With this form you can create a new account. ' . 'You can then post notices and link up to friends and colleagues. '. '(Have an [OpenID](http://openid.net/)? ' . 'Try our [OpenID registration](%%action.openidlogin%%)!)')); - common_element_start('div', 'instructions'); - common_raw($instr); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($instr); + $this->elementEnd('div'); } } @@ -184,45 +184,45 @@ class RegisterAction extends Action } common_show_header(_('Register'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'login', 'action' => common_local_url('register'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); if ($code) { - common_hidden('code', $code); + $this->hidden('code', $code); } - common_input('nickname', _('Nickname'), $this->trimmed('nickname'), + $this->input('nickname', _('Nickname'), $this->trimmed('nickname'), _('1-64 lowercase letters or numbers, no punctuation or spaces. Required.')); - common_password('password', _('Password'), + $this->password('password', _('Password'), _('6 or more characters. Required.')); - common_password('confirm', _('Confirm'), + $this->password('confirm', _('Confirm'), _('Same as password above. Required.')); if ($invite && $invite->address_type == 'email') { - common_input('email', _('Email'), $invite->address, + $this->input('email', _('Email'), $invite->address, _('Used only for updates, announcements, and password recovery')); } else { - common_input('email', _('Email'), $this->trimmed('email'), + $this->input('email', _('Email'), $this->trimmed('email'), _('Used only for updates, announcements, and password recovery')); } - common_input('fullname', _('Full name'), + $this->input('fullname', _('Full name'), $this->trimmed('fullname'), _('Longer name, preferably your "real" name')); - common_input('homepage', _('Homepage'), + $this->input('homepage', _('Homepage'), $this->trimmed('homepage'), _('URL of your homepage, blog, or profile on another site')); - common_textarea('bio', _('Bio'), + $this->textarea('bio', _('Bio'), $this->trimmed('bio'), _('Describe yourself and your interests in 140 chars')); - common_input('location', _('Location'), + $this->input('location', _('Location'), $this->trimmed('location'), _('Where you are, like "City, State (or Region), Country"')); - common_checkbox('rememberme', _('Remember me'), + $this->checkbox('rememberme', _('Remember me'), $this->boolean('rememberme'), _('Automatically login in the future; not for shared computers!')); - common_element_start('p'); + $this->elementStart('p'); $attrs = array('type' => 'checkbox', 'id' => 'license', 'name' => 'license', @@ -230,14 +230,14 @@ class RegisterAction extends Action if ($this->boolean('license')) { $attrs['checked'] = 'checked'; } - common_element('input', $attrs); - common_text(_('My text and files are available under ')); - common_element('a', array('href' => $config['license']['url']), + $this->element('input', $attrs); + $this->text(_('My text and files are available under ')); + $this->element('a', array('href' => $config['license']['url']), $config['license']['title']); - common_text(_(' except this private data: password, email address, IM address, phone number.')); - common_element_end('p'); - common_submit('submit', _('Register')); - common_element_end('form'); + $this->text(_(' except this private data: password, email address, IM address, phone number.')); + $this->elementEnd('p'); + $this->submit('submit', _('Register')); + $this->elementEnd('form'); common_show_footer(); } @@ -245,7 +245,7 @@ class RegisterAction extends Action { $nickname = $this->arg('nickname'); common_show_header(_('Registration successful')); - common_element_start('div', 'success'); + $this->elementStart('div', 'success'); $instr = sprintf(_('Congratulations, %s! And welcome to %%%%site.name%%%%. From here, you may want to...'. "\n\n" . '* Go to [your profile](%s) and post your first message.' . "\n" . '* Add a [Jabber/GTalk address](%%%%action.imsettings%%%%) so you can send notices through instant messages.' . "\n" . @@ -254,14 +254,14 @@ class RegisterAction extends Action '* Read over the [online docs](%%%%doc.help%%%%) for features you may have missed. ' . "\n\n" . 'Thanks for signing up and we hope you enjoy using this service.'), $nickname, common_local_url('showstream', array('nickname' => $nickname))); - common_raw(common_markup_to_html($instr)); + $this->raw(common_markup_to_html($instr)); $have_email = $this->trimmed('email'); if ($have_email) { $emailinstr = _('(You should receive a message by email momentarily, with ' . 'instructions on how to confirm your email address.)'); - common_raw(common_markup_to_html($emailinstr)); + $this->raw(common_markup_to_html($emailinstr)); } - common_element_end('div'); + $this->elementEnd('div'); common_show_footer(); } diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index a9494772e..b9e29d645 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -61,13 +61,13 @@ class RemotesubscribeAction extends Action function show_top($err=null) { if ($err) { - common_element('div', 'error', $err); + $this->element('div', 'error', $err); } else { $instructions = $this->get_instructions(); $output = common_markup_to_html($instructions); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('p'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('p'); } } @@ -79,15 +79,15 @@ class RemotesubscribeAction extends Action array($this, 'show_top')); # id = remotesubscribe conflicts with the # button on profile page - common_element_start('form', array('id' => 'remsub', 'method' => 'post', + $this->elementStart('form', array('id' => 'remsub', 'method' => 'post', 'action' => common_local_url('remotesubscribe'))); - common_hidden('token', common_session_token()); - common_input('nickname', _('User nickname'), $nickname, + $this->hidden('token', common_session_token()); + $this->input('nickname', _('User nickname'), $nickname, _('Nickname of the user you want to follow')); - common_input('profile_url', _('Profile URL'), $profile, + $this->input('profile_url', _('Profile URL'), $profile, _('URL of your profile on another compatible microblogging service')); - common_submit('submit', _('Subscribe')); - common_element_end('form'); + $this->submit('submit', _('Subscribe')); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/replies.php b/actions/replies.php index eceeb4d65..878550888 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -62,7 +62,7 @@ class RepliesAction extends StreamAction function show_header($user) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('repliesrss', array('nickname' => $user->nickname)), 'type' => 'application/rss+xml', diff --git a/actions/showfavorites.php b/actions/showfavorites.php index f4344833d..1dec3ba5b 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -57,7 +57,7 @@ class ShowfavoritesAction extends StreamAction function show_header($user) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('favoritesrss', array('nickname' => $user->nickname)), 'type' => 'application/rss+xml', diff --git a/actions/shownotice.php b/actions/shownotice.php index 2df09cb3f..c519af0ba 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -81,10 +81,10 @@ class ShownoticeAction extends StreamAction array($this, 'show_header'), null, array($this, 'show_top')); - common_element_start('ul', array('id' => 'notices')); + $this->elementStart('ul', array('id' => 'notices')); $nli = new NoticeListItem($this->notice); $nli->show(); - common_element_end('ul'); + $this->elementEnd('ul'); common_show_footer(); } @@ -99,12 +99,12 @@ class ShownoticeAction extends StreamAction } if ($user->emailmicroid && $user->email && $this->notice->uri) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "mailto+http:sha1:" . sha1(sha1('mailto:' . $user->email) . sha1($this->notice->uri)))); } if ($user->jabbermicroid && $user->jabber && $this->notice->uri) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "xmpp+http:sha1:" . sha1(sha1('xmpp:' . $user->jabber) . sha1($this->notice->uri)))); } } diff --git a/actions/showstream.php b/actions/showstream.php index e4e5d96d1..9a59f7ae4 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -106,53 +106,53 @@ class ShowstreamAction extends StreamAction function show_header($user) { # Feeds - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('api', array('apiaction' => 'statuses', 'method' => 'user_timeline.rss', 'argument' => $user->nickname)), 'type' => 'application/rss+xml', 'title' => sprintf(_('Notice feed for %s'), $user->nickname))); - common_element('link', array('rel' => 'alternate feed', + $this->element('link', array('rel' => 'alternate feed', 'href' => common_local_url('api', array('apiaction' => 'statuses', 'method' => 'user_timeline.atom', 'argument' => $user->nickname)), 'type' => 'application/atom+xml', 'title' => sprintf(_('Notice feed for %s'), $user->nickname))); - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('userrss', array('nickname' => $user->nickname)), 'type' => 'application/rdf+xml', 'title' => sprintf(_('Notice feed for %s'), $user->nickname))); # FOAF - common_element('link', array('rel' => 'meta', + $this->element('link', array('rel' => 'meta', 'href' => common_local_url('foaf', array('nickname' => $user->nickname)), 'type' => 'application/rdf+xml', 'title' => 'FOAF')); # for remote subscriptions etc. - common_element('meta', array('http-equiv' => 'X-XRDS-Location', + $this->element('meta', array('http-equiv' => 'X-XRDS-Location', 'content' => common_local_url('xrds', array('nickname' => $user->nickname)))); $profile = $user->getProfile(); if ($profile->bio) { - common_element('meta', array('name' => 'description', + $this->element('meta', array('name' => 'description', 'content' => $profile->bio)); } if ($user->emailmicroid && $user->email && $profile->profileurl) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "mailto+http:sha1:" . sha1(sha1('mailto:' . $user->email) . sha1($profile->profileurl)))); } if ($user->jabbermicroid && $user->jabber && $profile->profileurl) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "xmpp+http:sha1:" . sha1(sha1('xmpp:' . $user->jabber) . sha1($profile->profileurl)))); } # See https://wiki.mozilla.org/Microsummaries - common_element('link', array('rel' => 'microsummary', + $this->element('link', array('rel' => 'microsummary', 'href' => common_local_url('microsummary', array('nickname' => $profile->nickname)))); } @@ -165,7 +165,7 @@ class ShowstreamAction extends StreamAction function show_profile($profile) { - common_element_start('div', array('id' => 'profile', 'class' => 'vcard')); + $this->elementStart('div', array('id' => 'profile', 'class' => 'vcard')); $this->show_personal($profile); @@ -175,23 +175,23 @@ class ShowstreamAction extends StreamAction $this->show_subscriptions($profile); - common_element_end('div'); + $this->elementEnd('div'); } function show_personal($profile) { $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - common_element_start('div', array('id' => 'profile_avatar')); - common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), + $this->elementStart('div', array('id' => 'profile_avatar')); + $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), 'class' => 'avatar profile photo', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $profile->nickname)); - common_element_start('ul', array('id' => 'profile_actions')); + $this->elementStart('ul', array('id' => 'profile_actions')); - common_element_start('li', array('id' => 'profile_subscribe')); + $this->elementStart('li', array('id' => 'profile_subscribe')); $cur = common_current_user(); if ($cur) { if ($cur->id != $profile->id) { @@ -204,14 +204,14 @@ class ShowstreamAction extends StreamAction } else { $this->show_remote_subscribe_link($profile); } - common_element_end('li'); + $this->elementEnd('li'); $user = User::staticGet('id', $profile->id); common_profile_new_message_nudge($cur, $user, $profile); if ($cur && $cur->id != $profile->id) { $blocked = $cur->hasBlocked($profile); - common_element_start('li', array('id' => 'profile_block')); + $this->elementStart('li', array('id' => 'profile_block')); if ($blocked) { common_unblock_form($profile, array('action' => 'showstream', 'nickname' => $profile->nickname)); @@ -219,62 +219,62 @@ class ShowstreamAction extends StreamAction common_block_form($profile, array('action' => 'showstream', 'nickname' => $profile->nickname)); } - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end('ul'); + $this->elementEnd('ul'); - common_element_end('div'); + $this->elementEnd('div'); - common_element_start('div', array('id' => 'profile_information')); + $this->elementStart('div', array('id' => 'profile_information')); if ($profile->fullname) { - common_element('h1', array('class' => 'fn'), $profile->fullname . ' (' . $profile->nickname . ')'); + $this->element('h1', array('class' => 'fn'), $profile->fullname . ' (' . $profile->nickname . ')'); } else { - common_element('h1', array('class' => 'fn nickname'), $profile->nickname); + $this->element('h1', array('class' => 'fn nickname'), $profile->nickname); } if ($profile->location) { - common_element('p', 'location', $profile->location); + $this->element('p', 'location', $profile->location); } if ($profile->bio) { - common_element('p', 'description note', $profile->bio); + $this->element('p', 'description note', $profile->bio); } if ($profile->homepage) { - common_element_start('p', 'website'); - common_element('a', array('href' => $profile->homepage, + $this->elementStart('p', 'website'); + $this->element('a', array('href' => $profile->homepage, 'rel' => 'me', 'class' => 'url'), $profile->homepage); - common_element_end('p'); + $this->elementEnd('p'); } $this->show_statistics($profile); - common_element_end('div'); + $this->elementEnd('div'); } function show_remote_subscribe_link($profile) { $url = common_local_url('remotesubscribe', array('nickname' => $profile->nickname)); - common_element('a', array('href' => $url, + $this->element('a', array('href' => $url, 'id' => 'remotesubscribe'), _('Subscribe')); } function show_unsubscribe_form($profile) { - common_element_start('form', array('id' => 'unsubscribe', 'method' => 'post', + $this->elementStart('form', array('id' => 'unsubscribe', 'method' => 'post', 'action' => common_local_url('unsubscribe'))); - common_hidden('token', common_session_token()); - common_element('input', array('id' => 'unsubscribeto', + $this->hidden('token', common_session_token()); + $this->element('input', array('id' => 'unsubscribeto', 'name' => 'unsubscribeto', 'type' => 'hidden', 'value' => $profile->nickname)); - common_element('input', array('type' => 'submit', + $this->element('input', array('type' => 'submit', 'class' => 'submit', 'value' => _('Unsubscribe'))); - common_element_end('form'); + $this->elementEnd('form'); } function show_subscriptions($profile) @@ -293,13 +293,13 @@ class ShowstreamAction extends StreamAction $subs_count = $subs->find(); - common_element_start('div', array('id' => 'subscriptions')); + $this->elementStart('div', array('id' => 'subscriptions')); - common_element('h2', null, _('Subscriptions')); + $this->element('h2', null, _('Subscriptions')); if ($subs_count > 0) { - common_element_start('ul', array('id' => 'subscriptions_avatars')); + $this->elementStart('ul', array('id' => 'subscriptions_avatars')); for ($i = 0; $i < min($subs_count, SUBSCRIPTIONS); $i++) { @@ -315,39 +315,39 @@ class ShowstreamAction extends StreamAction continue; } - common_element_start('li', 'vcard'); - common_element_start('a', array('title' => ($other->fullname) ? + $this->elementStart('li', 'vcard'); + $this->elementStart('a', array('title' => ($other->fullname) ? $other->fullname : $other->nickname, 'href' => $other->profileurl, 'rel' => 'contact', 'class' => 'subscription fn url')); $avatar = $other->getAvatar(AVATAR_MINI_SIZE); - common_element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), + $this->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar mini photo', 'alt' => ($other->fullname) ? $other->fullname : $other->nickname)); - common_element_end('a'); - common_element_end('li'); + $this->elementEnd('a'); + $this->elementEnd('li'); } - common_element_end('ul'); + $this->elementEnd('ul'); } if ($subs_count > SUBSCRIPTIONS) { - common_element_start('p', array('id' => 'subscriptions_viewall')); + $this->elementStart('p', array('id' => 'subscriptions_viewall')); - common_element('a', array('href' => common_local_url('subscriptions', + $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname)), 'class' => 'moresubscriptions'), _('All subscriptions')); - common_element_end('p'); + $this->elementEnd('p'); } - common_element_end('div'); + $this->elementEnd('div'); } function show_statistics($profile) @@ -366,49 +366,49 @@ class ShowstreamAction extends StreamAction $notices->profile_id = $profile->id; $notice_count = (int) $notices->count(); - common_element_start('div', 'statistics'); - common_element('h2', 'statistics', _('Statistics')); + $this->elementStart('div', 'statistics'); + $this->element('h2', 'statistics', _('Statistics')); # Other stats...? - common_element_start('dl', 'statistics'); - common_element('dt', 'membersince', _('Member since')); - common_element('dd', 'membersince', date('j M Y', + $this->elementStart('dl', 'statistics'); + $this->element('dt', 'membersince', _('Member since')); + $this->element('dd', 'membersince', date('j M Y', strtotime($profile->created))); - common_element_start('dt', 'subscriptions'); - common_element('a', array('href' => common_local_url('subscriptions', + $this->elementStart('dt', 'subscriptions'); + $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname))), _('Subscriptions')); - common_element_end('dt'); - common_element('dd', 'subscriptions', (is_int($subs_count)) ? $subs_count : '0'); - common_element_start('dt', 'subscribers'); - common_element('a', array('href' => common_local_url('subscribers', + $this->elementEnd('dt'); + $this->element('dd', 'subscriptions', (is_int($subs_count)) ? $subs_count : '0'); + $this->elementStart('dt', 'subscribers'); + $this->element('a', array('href' => common_local_url('subscribers', array('nickname' => $profile->nickname))), _('Subscribers')); - common_element_end('dt'); - common_element('dd', 'subscribers', (is_int($subbed_count)) ? $subbed_count : '0'); - common_element('dt', 'notices', _('Notices')); - common_element('dd', 'notices', (is_int($notice_count)) ? $notice_count : '0'); + $this->elementEnd('dt'); + $this->element('dd', 'subscribers', (is_int($subbed_count)) ? $subbed_count : '0'); + $this->element('dt', 'notices', _('Notices')); + $this->element('dd', 'notices', (is_int($notice_count)) ? $notice_count : '0'); # XXX: link these to something - common_element('dt', 'tags', _('Tags')); - common_element_start('dd', 'tags'); + $this->element('dt', 'tags', _('Tags')); + $this->elementStart('dd', 'tags'); $tags = Profile_tag::getTags($profile->id, $profile->id); - common_element_start('ul', 'tags xoxo'); + $this->elementStart('ul', 'tags xoxo'); foreach ($tags as $tag) { - common_element_start('li'); - common_element('a', array('rel' => 'bookmark tag', + $this->elementStart('li'); + $this->element('a', array('rel' => 'bookmark tag', 'href' => common_local_url('peopletag', array('tag' => $tag))), $tag); - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end('ul'); - common_element_end('dd'); + $this->elementEnd('ul'); + $this->elementEnd('dd'); - common_element_end('dl'); + $this->elementEnd('dl'); - common_element_end('div'); + $this->elementEnd('div'); } function show_notices($user) @@ -428,22 +428,22 @@ class ShowstreamAction extends StreamAction function show_last_notice($profile) { - common_element('h2', null, _('Currently')); + $this->element('h2', null, _('Currently')); $notice = $profile->getCurrentNotice(); if ($notice) { # FIXME: URL, image, video, audio - common_element_start('p', array('class' => 'notice_current')); + $this->elementStart('p', array('class' => 'notice_current')); if ($notice->rendered) { - common_raw($notice->rendered); + $this->raw($notice->rendered); } else { # XXX: may be some uncooked notices in the DB, # we cook them right now. This can probably disappear in future # versions (>> 0.4.x) - common_raw(common_render_content($notice->content, $notice)); + $this->raw(common_render_content($notice->content, $notice)); } - common_element_end('p'); + $this->elementEnd('p'); } } } diff --git a/actions/smssettings.php b/actions/smssettings.php index fad71135c..1be45d1ce 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -34,75 +34,75 @@ class SmssettingsAction extends EmailsettingsAction { $user = common_current_user(); $this->form_header(_('SMS Settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'smssettings', 'action' => common_local_url('smssettings'))); - common_hidden('token', common_session_token()); - common_element('h2', null, _('Address')); + $this->hidden('token', common_session_token()); + $this->element('h2', null, _('Address')); if ($user->sms) { - common_element_start('p'); + $this->elementStart('p'); $carrier = $user->getCarrier(); - common_element('span', 'address confirmed', $user->sms . ' (' . $carrier->name . ')'); - common_element('span', 'input_instructions', + $this->element('span', 'address confirmed', $user->sms . ' (' . $carrier->name . ')'); + $this->element('span', 'input_instructions', _('Current confirmed SMS-enabled phone number.')); - common_hidden('sms', $user->sms); - common_hidden('carrier', $user->carrier); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('sms', $user->sms); + $this->hidden('carrier', $user->carrier); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { $confirm = $this->get_confirmation(); if ($confirm) { $carrier = Sms_carrier::staticGet($confirm->address_extra); - common_element_start('p'); - common_element('span', 'address unconfirmed', $confirm->address . ' (' . $carrier->name . ')'); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address unconfirmed', $confirm->address . ' (' . $carrier->name . ')'); + $this->element('span', 'input_instructions', _('Awaiting confirmation on this phone number.')); - common_hidden('sms', $confirm->address); - common_hidden('carrier', $confirm->address_extra); - common_element_end('p'); - common_submit('cancel', _('Cancel')); - common_input('code', _('Confirmation code'), null, + $this->hidden('sms', $confirm->address); + $this->hidden('carrier', $confirm->address_extra); + $this->elementEnd('p'); + $this->submit('cancel', _('Cancel')); + $this->input('code', _('Confirmation code'), null, _('Enter the code you received on your phone.')); - common_submit('confirm', _('Confirm')); + $this->submit('confirm', _('Confirm')); } else { - common_input('sms', _('SMS Phone number'), + $this->input('sms', _('SMS Phone number'), ($this->arg('sms')) ? $this->arg('sms') : null, _('Phone number, no punctuation or spaces, with area code')); $this->carrier_select(); - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } } if ($user->sms) { - common_element('h2', null, _('Incoming email')); + $this->element('h2', null, _('Incoming email')); if ($user->incomingemail) { - common_element_start('p'); - common_element('span', 'address', $user->incomingemail); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address', $user->incomingemail); + $this->element('span', 'input_instructions', _('Send email to this address to post new notices.')); - common_element_end('p'); - common_submit('removeincoming', _('Remove')); + $this->elementEnd('p'); + $this->submit('removeincoming', _('Remove')); } - common_element_start('p'); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'input_instructions', _('Make a new email address for posting to; cancels the old one.')); - common_element_end('p'); - common_submit('newincoming', _('New')); + $this->elementEnd('p'); + $this->submit('newincoming', _('New')); } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('smsnotify', + $this->checkbox('smsnotify', _('Send me notices through SMS; I understand I may incur exorbitant charges from my carrier.'), $user->smsnotify); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } @@ -307,19 +307,19 @@ class SmssettingsAction extends EmailsettingsAction $carrier = new Sms_carrier(); $cnt = $carrier->find(); - common_element_start('p'); - common_element('label', array('for' => 'carrier')); - common_element_start('select', array('name' => 'carrier', + $this->elementStart('p'); + $this->element('label', array('for' => 'carrier')); + $this->elementStart('select', array('name' => 'carrier', 'id' => 'carrier')); - common_element('option', array('value' => 0), + $this->element('option', array('value' => 0), _('Select a carrier')); while ($carrier->fetch()) { - common_element('option', array('value' => $carrier->id), + $this->element('option', array('value' => $carrier->id), $carrier->name); } - common_element_end('select'); - common_element_end('p'); - common_element('span', 'input_instructions', + $this->elementEnd('select'); + $this->elementEnd('p'); + $this->element('span', 'input_instructions', sprintf(_('Mobile carrier for your phone. '. 'If you know a carrier that accepts ' . 'SMS over email but isn\'t listed here, ' . diff --git a/actions/subscribe.php b/actions/subscribe.php index f33d1d207..99f9acc24 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -65,13 +65,13 @@ class SubscribeAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Subscribed')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Subscribed')); + $this->elementEnd('head'); + $this->elementStart('body'); common_unsubscribe_form($other->getProfile()); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('subscriptions', array('nickname' => $user->nickname))); diff --git a/actions/subscriptions.php b/actions/subscriptions.php index afe8fb260..7a87a144f 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -72,16 +72,16 @@ class SubscriptionsList extends ProfileList return; } - common_element_start('form', array('id' => 'subedit-' . $profile->id, + $this->elementStart('form', array('id' => 'subedit-' . $profile->id, 'method' => 'post', 'class' => 'subedit', 'action' => common_local_url('subedit'))); - common_hidden('token', common_session_token()); - common_hidden('profile', $profile->id); - common_checkbox('jabber', _('Jabber'), $sub->jabber); - common_checkbox('sms', _('SMS'), $sub->sms); - common_submit('save', _('Save')); - common_element_end('form'); + $this->hidden('token', common_session_token()); + $this->hidden('profile', $profile->id); + $this->checkbox('jabber', _('Jabber'), $sub->jabber); + $this->checkbox('sms', _('SMS'), $sub->sms); + $this->submit('save', _('Save')); + $this->elementEnd('form'); return; } } diff --git a/actions/tag.php b/actions/tag.php index 8a3f90c16..3096b75b3 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -51,7 +51,7 @@ class TagAction extends StreamAction function show_header($tag = false) { if ($tag) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('tagrss', array('tag' => $tag)), 'type' => 'application/rss+xml', 'title' => sprintf(_('Feed for tag %s'), $tag))); @@ -68,9 +68,9 @@ class TagAction extends StreamAction if (!$tag) { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); $this->public_views_menu(); } else { @@ -110,7 +110,7 @@ class TagAction extends StreamAction $cnt = $tags->find(); if ($cnt > 0) { - common_element_start('p', 'tagcloud'); + $this->elementStart('p', 'tagcloud'); $tw = array(); $sum = 0; @@ -125,7 +125,7 @@ class TagAction extends StreamAction $this->show_tag($tag, $weight, $weight/$sum); } - common_element_end('p'); + $this->elementEnd('p'); } } @@ -149,10 +149,10 @@ class TagAction extends StreamAction $cls = 'smallest'; } - common_element('a', array('class' => "$cls weight-$weight relative-$relative", + $this->element('a', array('class' => "$cls weight-$weight relative-$relative", 'href' => common_local_url('tag', array('tag' => $tag))), $tag); - common_text(' '); + $this->text(' '); } function show_notices($tag) diff --git a/actions/tagother.php b/actions/tagother.php index ff6788cc6..f0105ec8b 100644 --- a/actions/tagother.php +++ b/actions/tagother.php @@ -61,7 +61,7 @@ class TagotherAction extends Action $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), + $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), 'class' => 'avatar stream', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, @@ -69,39 +69,39 @@ class TagotherAction extends Action ($profile->fullname) ? $profile->fullname : $profile->nickname)); - common_element('a', array('href' => $profile->profileurl, + $this->element('a', array('href' => $profile->profileurl, 'class' => 'external profile nickname'), $profile->nickname); if ($profile->fullname) { - common_element_start('div', 'fullname'); + $this->elementStart('div', 'fullname'); if ($profile->homepage) { - common_element('a', array('href' => $profile->homepage), + $this->element('a', array('href' => $profile->homepage), $profile->fullname); } else { - common_text($profile->fullname); + $this->text($profile->fullname); } - common_element_end('div'); + $this->elementEnd('div'); } if ($profile->location) { - common_element('div', 'location', $profile->location); + $this->element('div', 'location', $profile->location); } if ($profile->bio) { - common_element('div', 'bio', $profile->bio); + $this->element('div', 'bio', $profile->bio); } - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'tag_user', 'name' => 'tagother', 'action' => $this->self_url())); - common_hidden('token', common_session_token()); - common_hidden('id', $profile->id); - common_input('tags', _('Tags'), + $this->hidden('token', common_session_token()); + $this->hidden('id', $profile->id); + $this->input('tags', _('Tags'), ($this->arg('tags')) ? $this->arg('tags') : implode(' ', Profile_tag::getTags($user->id, $profile->id)), _('Tags for this user (letters, numbers, -, ., and _), comma- or space- separated')); - common_submit('save', _('Save')); - common_element_end('form'); + $this->submit('save', _('Save')); + $this->elementEnd('form'); common_show_footer(); } @@ -162,20 +162,20 @@ class TagotherAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml'); - common_element_start('head'); - common_element('title', null, _('Tags')); - common_element_end('head'); - common_element_start('body'); - common_element_start('p', 'subtags'); + $this->elementStart('head'); + $this->element('title', null, _('Tags')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->elementStart('p', 'subtags'); foreach ($tags as $tag) { - common_element('a', array('href' => common_local_url($action, + $this->element('a', array('href' => common_local_url($action, array('nickname' => $user->nickname, 'tag' => $tag))), $tag); } - common_element_end('p'); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('p'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url($action, array('nickname' => $user->nickname))); @@ -186,12 +186,12 @@ class TagotherAction extends Action { list($profile, $error) = $arr; if ($error) { - common_element('p', 'error', $error); + $this->element('p', 'error', $error); } else { - common_element_start('div', 'instructions'); - common_element('p', null, + $this->elementStart('div', 'instructions'); + $this->element('p', null, _('Use this form to add tags to your subscribers or subscriptions.')); - common_element_end('div'); + $this->elementEnd('div'); } } } diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index e0731f66f..36d2a7e09 100644 --- a/actions/twitapidirect_messages.php +++ b/actions/twitapidirect_messages.php @@ -188,7 +188,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction { $this->init_document('xml'); - common_element_start('direct-messages', array('type' => 'array')); + $this->elementStart('direct-messages', array('type' => 'array')); if (is_array($messages)) { foreach ($message as $m) { @@ -202,7 +202,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction } } - common_element_end('direct-messages'); + $this->elementEnd('direct-messages'); $this->end_document('xml'); } @@ -236,13 +236,13 @@ class Twitapidirect_messagesAction extends TwitterapiAction $this->init_document('rss'); - common_element_start('channel'); - common_element('title', null, $title); + $this->elementStart('channel'); + $this->element('title', null, $title); - common_element('link', null, $link); - common_element('description', null, $subtitle); - common_element('language', null, 'en-us'); - common_element('ttl', null, '40'); + $this->element('link', null, $link); + $this->element('description', null, $subtitle); + $this->element('language', null, 'en-us'); + $this->element('ttl', null, '40'); if (is_array($message)) { foreach ($message as $m) { @@ -256,7 +256,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction } } - common_element_end('channel'); + $this->elementEnd('channel'); $this->end_twitter_rss(); } @@ -266,12 +266,12 @@ class Twitapidirect_messagesAction extends TwitterapiAction $this->init_document('atom'); - common_element('title', null, $title); + $this->element('title', null, $title); $siteserver = common_config('site', 'server'); - common_element('id', null, "tag:$siteserver,2008:DirectMessage"); - common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null); - common_element('updated', null, common_date_iso8601(strftime('%c'))); - common_element('subtitle', null, $subtitle); + $this->element('id', null, "tag:$siteserver,2008:DirectMessage"); + $this->element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null); + $this->element('updated', null, common_date_iso8601(strftime('%c'))); + $this->element('subtitle', null, $subtitle); if (is_array($message)) { foreach ($message as $m) { diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index ba4afe441..458ff48a5 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -142,7 +142,7 @@ class TwitapifriendshipsAction extends TwitterapiAction switch ($apidata['content-type']) { case 'xml': $this->init_document('xml'); - common_element('friends', null, $result); + $this->element('friends', null, $result); $this->end_document('xml'); break; case 'json': diff --git a/actions/twitapihelp.php b/actions/twitapihelp.php index 1b84cb11b..531c6e9d3 100644 --- a/actions/twitapihelp.php +++ b/actions/twitapihelp.php @@ -34,7 +34,7 @@ class TwitapihelpAction extends TwitterapiAction if ($apidata['content-type'] == 'xml') { $this->init_document('xml'); - common_element('ok', null, 'true'); + $this->element('ok', null, 'true'); $this->end_document('xml'); } elseif ($apidata['content-type'] == 'json') { $this->init_document('json'); diff --git a/actions/twitapilaconica.php b/actions/twitapilaconica.php index 722423fae..34c8f88fc 100644 --- a/actions/twitapilaconica.php +++ b/actions/twitapilaconica.php @@ -70,7 +70,7 @@ class TwitapilaconicaAction extends TwitterapiAction switch ($apidata['content-type']) { case 'xml': $this->init_document('xml'); - common_element('version', null, LACONICA_VERSION); + $this->element('version', null, LACONICA_VERSION); $this->end_document('xml'); break; case 'json': @@ -115,10 +115,10 @@ class TwitapilaconicaAction extends TwitterapiAction switch ($apidata['content-type']) { case 'xml': $this->init_document('xml'); - common_element_start('config'); + $this->elementStart('config'); // XXX: check that all sections and settings are legal XML elements foreach ($keys as $section => $settings) { - common_element_start($section); + $this->elementStart($section); foreach ($settings as $setting) { $value = common_config($section, $setting); if (is_array($value)) { @@ -128,11 +128,11 @@ class TwitapilaconicaAction extends TwitterapiAction } else if ($value === true) { $value = 'true'; } - common_element($setting, null, $value); + $this->element($setting, null, $value); } - common_element_end($section); + $this->elementEnd($section); } - common_element_end('config'); + $this->elementEnd('config'); $this->end_document('xml'); break; case 'json': diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index e629d5cc4..8d175ecab 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -538,11 +538,11 @@ class TwitapistatusesAction extends TwitterapiAction { switch ($type) { case 'xml': - common_element_start('users', array('type' => 'array')); + $this->elementStart('users', array('type' => 'array')); foreach ($profiles as $profile) { $this->show_profile($profile); } - common_element_end('users'); + $this->elementEnd('users'); break; case 'json': $arrays = array(); diff --git a/actions/twittersettings.php b/actions/twittersettings.php index 9e7e4cae8..663688037 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -44,52 +44,52 @@ class TwittersettingsAction extends SettingsAction } $this->form_header(_('Twitter settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'twittersettings', 'action' => common_local_url('twittersettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('h2', null, _('Twitter Account')); + $this->element('h2', null, _('Twitter Account')); if ($fuser) { - common_element_start('p'); + $this->elementStart('p'); - common_element('span', 'twitter_user', $fuser->nickname); - common_element('a', array('href' => $fuser->uri), $fuser->uri); - common_element('span', 'input_instructions', + $this->element('span', 'twitter_user', $fuser->nickname); + $this->element('a', array('href' => $fuser->uri), $fuser->uri); + $this->element('span', 'input_instructions', _('Current verified Twitter account.')); - common_hidden('flink_foreign_id', $flink->foreign_id); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('flink_foreign_id', $flink->foreign_id); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { - common_input('twitter_username', _('Twitter user name'), + $this->input('twitter_username', _('Twitter user name'), ($this->arg('twitter_username')) ? $this->arg('twitter_username') : $profile->nickname, _('No spaces, please.')); // hey, it's what Twitter says - common_password('twitter_password', _('Twitter password')); + $this->password('twitter_password', _('Twitter password')); } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('noticesync', _('Automatically send my notices to Twitter.'), + $this->checkbox('noticesync', _('Automatically send my notices to Twitter.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND) : true); - common_checkbox('replysync', _('Send local "@" replies to Twitter.'), + $this->checkbox('replysync', _('Send local "@" replies to Twitter.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true); - common_checkbox('friendsync', _('Subscribe to my Twitter friends here.'), + $this->checkbox('friendsync', _('Subscribe to my Twitter friends here.'), ($flink) ? ($flink->friendsync & FOREIGN_FRIEND_RECV) : false); if ($flink) { - common_submit('save', _('Save')); + $this->submit('save', _('Save')); } else { - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } $this->show_twitter_subscriptions(); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } @@ -131,9 +131,9 @@ class TwittersettingsAction extends SettingsAction if ($friends_count > 0) { - common_element('h3', null, _('Twitter Friends')); - common_element_start('div', array('id' => 'subscriptions')); - common_element_start('ul', array('id' => 'subscriptions_avatars')); + $this->element('h3', null, _('Twitter Friends')); + $this->elementStart('div', array('id' => 'subscriptions')); + $this->elementStart('ul', array('id' => 'subscriptions_avatars')); for ($i = 0; $i < min($friends_count, SUBSCRIPTIONS); $i++) { @@ -144,28 +144,28 @@ class TwittersettingsAction extends SettingsAction continue; } - common_element_start('li'); - common_element_start('a', array('title' => ($other->fullname) ? + $this->elementStart('li'); + $this->elementStart('a', array('title' => ($other->fullname) ? $other->fullname : $other->nickname, 'href' => $other->profileurl, 'rel' => 'contact', 'class' => 'subscription')); $avatar = $other->getAvatar(AVATAR_MINI_SIZE); - common_element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), + $this->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar mini', 'alt' => ($other->fullname) ? $other->fullname : $other->nickname)); - common_element_end('a'); - common_element_end('li'); + $this->elementEnd('a'); + $this->elementEnd('li'); } - common_element_end('ul'); - common_element_end('div'); + $this->elementEnd('ul'); + $this->elementEnd('div'); } @@ -173,13 +173,13 @@ class TwittersettingsAction extends SettingsAction /* if ($subs_count > SUBSCRIPTIONS) { - common_element_start('p', array('id' => 'subscriptions_viewall')); + $this->elementStart('p', array('id' => 'subscriptions_viewall')); - common_element('a', array('href' => common_local_url('subscriptions', + $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname)), 'class' => 'moresubscriptions'), _('All subscriptions')); - common_element_end('p'); + $this->elementEnd('p'); } */ diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 1c2e13635..455c5e28e 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -67,13 +67,13 @@ class UnsubscribeAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Unsubscribed')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Unsubscribed')); + $this->elementEnd('head'); + $this->elementStart('body'); common_subscribe_form($other); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('subscriptions', array('nickname' => $user->nickname))); diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 05efbc16c..196fae9ad 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -84,51 +84,51 @@ class UserauthorizationAction extends Action $avatar = $req->get_parameter('omb_listenee_avatar'); common_show_header(_('Authorize subscription')); - common_element('p', null, _('Please check these details to make sure '. + $this->element('p', null, _('Please check these details to make sure '. 'that you want to subscribe to this user\'s notices. '. 'If you didn\'t just ask to subscribe to someone\'s notices, '. 'click "Cancel".')); - common_element_start('div', 'profile'); + $this->elementStart('div', 'profile'); if ($avatar) { - common_element('img', array('src' => $avatar, + $this->element('img', array('src' => $avatar, 'class' => 'avatar profile', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $nickname)); } - common_element('a', array('href' => $profile, + $this->element('a', array('href' => $profile, 'class' => 'external profile nickname'), $nickname); if ($fullname) { - common_element_start('div', 'fullname'); + $this->elementStart('div', 'fullname'); if ($homepage) { - common_element('a', array('href' => $homepage), + $this->element('a', array('href' => $homepage), $fullname); } else { - common_text($fullname); + $this->text($fullname); } - common_element_end('div'); + $this->elementEnd('div'); } if ($location) { - common_element('div', 'location', $location); + $this->element('div', 'location', $location); } if ($bio) { - common_element('div', 'bio', $bio); + $this->element('div', 'bio', $bio); } - common_element_start('div', 'license'); - common_element('a', array('href' => $license, + $this->elementStart('div', 'license'); + $this->element('a', array('href' => $license, 'class' => 'license'), $license); - common_element_end('div'); - common_element_end('div'); - common_element_start('form', array('method' => 'post', + $this->elementEnd('div'); + $this->elementEnd('div'); + $this->elementStart('form', array('method' => 'post', 'id' => 'userauthorization', 'name' => 'userauthorization', 'action' => common_local_url('userauthorization'))); - common_hidden('token', common_session_token()); - common_submit('accept', _('Accept')); - common_submit('reject', _('Reject')); - common_element_end('form'); + $this->hidden('token', common_session_token()); + $this->submit('accept', _('Accept')); + $this->submit('reject', _('Reject')); + $this->elementEnd('form'); common_show_footer(); } @@ -328,18 +328,18 @@ class UserauthorizationAction extends Action function show_accept_message($tok) { common_show_header(_('Subscription authorized')); - common_element('p', null, + $this->element('p', null, _('The subscription has been authorized, but no '. 'callback URL was passed. Check with the site\'s instructions for '. 'details on how to authorize the subscription. Your subscription token is:')); - common_element('blockquote', 'token', $tok); + $this->element('blockquote', 'token', $tok); common_show_footer(); } function show_reject_message($tok) { common_show_header(_('Subscription rejected')); - common_element('p', null, + $this->element('p', null, _('The subscription has been rejected, but no '. 'callback URL was passed. Check with the site\'s instructions for '. 'details on how to fully reject the subscription.')); diff --git a/actions/xrds.php b/actions/xrds.php index 7edc6aa39..9c51f1dd2 100644 --- a/actions/xrds.php +++ b/actions/xrds.php @@ -47,14 +47,14 @@ class XrdsAction extends Action header('Content-Type: application/xrds+xml'); common_start_xml(); - common_element_start('XRDS', array('xmlns' => 'xri://$xrds')); + $this->elementStart('XRDS', array('xmlns' => 'xri://$xrds')); - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xml:id' => 'oauth', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); $this->show_service(OAUTH_ENDPOINT_REQUEST, common_local_url('requesttoken'), @@ -77,16 +77,16 @@ class XrdsAction extends Action array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY), array(OAUTH_HMAC_SHA1)); - common_element_end('XRD'); + $this->elementEnd('XRD'); # XXX: decide whether to include user's ID/nickname in postNotice URL - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xml:id' => 'omb', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); $this->show_service(OMB_ENDPOINT_POSTNOTICE, common_local_url('postnotice')); @@ -94,44 +94,44 @@ class XrdsAction extends Action $this->show_service(OMB_ENDPOINT_UPDATEPROFILE, common_local_url('updateprofile')); - common_element_end('XRD'); + $this->elementEnd('XRD'); - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); $this->show_service(OAUTH_DISCOVERY, '#oauth'); $this->show_service(OMB_NAMESPACE, '#omb'); - common_element_end('XRD'); + $this->elementEnd('XRD'); - common_element_end('XRDS'); + $this->elementEnd('XRDS'); common_end_xml(); } function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { - common_element_start('Service'); + $this->elementStart('Service'); if ($uri) { - common_element('URI', null, $uri); + $this->element('URI', null, $uri); } - common_element('Type', null, $type); + $this->element('Type', null, $type); if ($params) { foreach ($params as $param) { - common_element('Type', null, $param); + $this->element('Type', null, $param); } } if ($sigs) { foreach ($sigs as $sig) { - common_element('Type', null, $sig); + $this->element('Type', null, $sig); } } if ($localId) { - common_element('LocalID', null, $localId); + $this->element('LocalID', null, $localId); } - common_element_end('Service'); + $this->elementEnd('Service'); } } \ No newline at end of file diff --git a/lib/action.php b/lib/action.php index d5060758e..d02a1b709 100644 --- a/lib/action.php +++ b/lib/action.php @@ -314,7 +314,7 @@ class Action extends HTMLOutputter // lawsuit { $this->elementStart('div', array('id' => 'content')); $this->showPageTitle(); - $this->showPageNotice(); + $this->showPageNoticeBlock(); $this->elementStart('div', array('id' => 'content_inner')); // show the actual content (forms, lists, whatever) $this->showContent(); @@ -326,19 +326,24 @@ class Action extends HTMLOutputter // lawsuit $this->element('h1', NULL, $this->title()); } + function showPageNoticeBlock() + { + $this->elementStart('dl', array('id' => 'page_notice', + 'class' => 'system_notice')); + $this->element('dt', null, _('Page notice')); + $this->elementStart('dd', null); + $this->showPageNotice(); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + } + // SHOULD overload (unless there's not a notice) function showPageNotice() { - $this->elementStart('dl', array('id' => 'page_notice', - 'class' => 'system_notice')); - $this->element('dt', null, _('Page notice')); - $this->elementStart('dd', null); - // Output a bunch of paragraphs here - $this->elementEnd('dd'); - $this->elementEnd('dl'); } - + // MUST overload function showContent() -- cgit v1.2.3-54-g00ecf From 4b0cf99e56f965e10eeb8b8b19e7b405bda49eaf Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 23:03:38 +0000 Subject: Convert use of common_server_error and common_user_error to methods on Action --- actions/accesstoken.php | 2 +- actions/all.php | 4 ++-- actions/allrss.php | 2 +- actions/api.php | 4 ++-- actions/avatarbynickname.php | 10 ++++----- actions/block.php | 12 +++++------ actions/confirmaddress.php | 14 ++++++------ actions/deleteprofile.php | 2 +- actions/disfavor.php | 8 +++---- actions/doc.php | 2 +- actions/emailsettings.php | 12 +++++------ actions/facebookremove.php | 2 +- actions/favor.php | 8 +++---- actions/favoritesrss.php | 2 +- actions/finishaddopenid.php | 2 +- actions/finishopenidlogin.php | 12 +++++------ actions/finishremotesubscribe.php | 34 ++++++++++++++--------------- actions/foaf.php | 4 ++-- actions/imsettings.php | 8 +++---- actions/invite.php | 2 +- actions/login.php | 8 +++---- actions/logout.php | 2 +- actions/microsummary.php | 4 ++-- actions/newmessage.php | 10 ++++----- actions/newnotice.php | 4 ++-- actions/noticesearch.php | 2 +- actions/nudge.php | 6 +++--- actions/openidlogin.php | 2 +- actions/othersettings.php | 2 +- actions/peopletag.php | 2 +- actions/postnotice.php | 14 ++++++------ actions/profilesettings.php | 12 +++++------ actions/public.php | 2 +- actions/recoverpassword.php | 26 +++++++++++----------- actions/register.php | 10 ++++----- actions/remotesubscribe.php | 4 ++-- actions/replies.php | 4 ++-- actions/repliesrss.php | 2 +- actions/requesttoken.php | 2 +- actions/showfavorites.php | 6 +++--- actions/showmessage.php | 4 ++-- actions/shownotice.php | 6 +++--- actions/showstream.php | 4 ++-- actions/smssettings.php | 8 +++---- actions/subedit.php | 12 +++++------ actions/subscribe.php | 8 +++---- actions/tagother.php | 12 +++++------ actions/tagrss.php | 2 +- actions/twitapiaccount.php | 16 +++++++------- actions/twitapiblocks.php | 8 +++---- actions/twitapidirect_messages.php | 18 ++++++++-------- actions/twitapifavorites.php | 20 ++++++++--------- actions/twitapifriendships.php | 16 +++++++------- actions/twitapihelp.php | 4 ++-- actions/twitapilaconica.php | 6 +++--- actions/twitapinotifications.php | 4 ++-- actions/twitapistatuses.php | 44 +++++++++++++++++++------------------- actions/twitapiusers.php | 4 ++-- actions/twittersettings.php | 2 +- actions/unblock.php | 10 ++++----- actions/unsubscribe.php | 10 ++++----- actions/updateprofile.php | 36 +++++++++++++++---------------- actions/userauthorization.php | 12 +++++------ actions/userbyid.php | 4 ++-- actions/userrss.php | 4 ++-- actions/xrds.php | 2 +- lib/action.php | 4 ++-- 67 files changed, 275 insertions(+), 275 deletions(-) (limited to 'actions/showfavorites.php') diff --git a/actions/accesstoken.php b/actions/accesstoken.php index 072ce27eb..ad03b7019 100644 --- a/actions/accesstoken.php +++ b/actions/accesstoken.php @@ -38,7 +38,7 @@ class AccesstokenAction extends Action common_debug('printing the access token', __FILE__); print $token; } catch (OAuthException $e) { - common_server_error($e->getMessage()); + $this->serverError($e->getMessage()); } } } diff --git a/actions/all.php b/actions/all.php index a8a74fb33..4ad7f12ae 100644 --- a/actions/all.php +++ b/actions/all.php @@ -33,14 +33,14 @@ class AllAction extends StreamAction $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } diff --git a/actions/allrss.php b/actions/allrss.php index 660afb9e2..56818d605 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -34,7 +34,7 @@ class AllrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; diff --git a/actions/api.php b/actions/api.php index 9cbf9a468..64971774d 100644 --- a/actions/api.php +++ b/actions/api.php @@ -103,10 +103,10 @@ class ApiAction extends Action call_user_func(array($action_obj, $this->api_method), $_REQUEST, $apidata); } else { - common_user_error("API method not found!", $code=404); + $this->clientError("API method not found!", $code=404); } } else { - common_user_error("API method not found!", $code=404); + $this->clientError("API method not found!", $code=404); } } diff --git a/actions/avatarbynickname.php b/actions/avatarbynickname.php index 666f386f6..d2d078b61 100644 --- a/actions/avatarbynickname.php +++ b/actions/avatarbynickname.php @@ -26,28 +26,28 @@ class AvatarbynicknameAction extends Action parent::handle($args); $nickname = $this->trimmed('nickname'); if (!$nickname) { - $this->client_error(_('No nickname.')); + $this->clientError(_('No nickname.')); return; } $size = $this->trimmed('size'); if (!$size) { - $this->client_error(_('No size.')); + $this->clientError(_('No size.')); return; } $size = strtolower($size); if (!in_array($size, array('original', '96', '48', '24'))) { - $this->client_error(_('Invalid size.')); + $this->clientError(_('Invalid size.')); return; } $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $profile = $user->getProfile(); if (!$profile) { - $this->client_error(_('User has no profile.')); + $this->clientError(_('User has no profile.')); return; } if ($size == 'original') { diff --git a/actions/block.php b/actions/block.php index f8f6f24fd..738cbfbf7 100644 --- a/actions/block.php +++ b/actions/block.php @@ -30,28 +30,28 @@ class BlockAction extends Action parent::prepare($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return false; } $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $id = $this->trimmed('blockto'); if (!$id) { - $this->client_error(_('No profile specified.')); + $this->clientError(_('No profile specified.')); return false; } $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return false; } @@ -119,14 +119,14 @@ class BlockAction extends Action $cur = common_current_user(); if ($cur->hasBlocked($this->profile)) { - $this->client_error(_('You have already blocked this user.')); + $this->clientError(_('You have already blocked this user.')); return; } $result = $cur->block($this->profile); if (!$result) { - $this->server_error(_('Failed to save block information.')); + $this->serverError(_('Failed to save block information.')); return; } diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index 31a157768..53410fbe6 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -32,26 +32,26 @@ class ConfirmaddressAction extends Action } $code = $this->trimmed('code'); if (!$code) { - $this->client_error(_('No confirmation code.')); + $this->clientError(_('No confirmation code.')); return; } $confirm = Confirm_address::staticGet('code', $code); if (!$confirm) { - $this->client_error(_('Confirmation code not found.')); + $this->clientError(_('Confirmation code not found.')); return; } $cur = common_current_user(); if ($cur->id != $confirm->user_id) { - $this->client_error(_('That confirmation code is not for you!')); + $this->clientError(_('That confirmation code is not for you!')); return; } $type = $confirm->address_type; if (!in_array($type, array('email', 'jabber', 'sms'))) { - $this->server_error(sprintf(_('Unrecognized address type %s'), $type)); + $this->serverError(sprintf(_('Unrecognized address type %s'), $type)); return; } if ($cur->$type == $confirm->address) { - $this->client_error(_('That address has already been confirmed.')); + $this->clientError(_('That address has already been confirmed.')); return; } @@ -71,7 +71,7 @@ class ConfirmaddressAction extends Action if (!$result) { common_log_db_error($cur, 'UPDATE', __FILE__); - $this->server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -83,7 +83,7 @@ class ConfirmaddressAction extends Action if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } diff --git a/actions/deleteprofile.php b/actions/deleteprofile.php index ef4687d5f..cc236f847 100644 --- a/actions/deleteprofile.php +++ b/actions/deleteprofile.php @@ -24,7 +24,7 @@ class DeleteprofileAction extends Action function handle($args) { parent::handle($args); - $this->server_error(_('Code not yet ready.')); + $this->serverError(_('Code not yet ready.')); return; if ('POST' === $_SERVER['REQUEST_METHOD']) { $this->handle_post(); diff --git a/actions/disfavor.php b/actions/disfavor.php index 9a27f34b1..fc36f7c75 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -28,7 +28,7 @@ class DisfavorAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -46,7 +46,7 @@ class DisfavorAction extends Action $token = $this->trimmed('token-'.$notice->id); if (!$token || $token != common_session_token()) { - $this->client_error(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_("There was a problem with your session token. Try again, please.")); return; } @@ -54,7 +54,7 @@ class DisfavorAction extends Action $fave->user_id = $this->id; $fave->notice_id = $notice->id; if (!$fave->find(true)) { - $this->client_error(_('This notice is not a favorite!')); + $this->clientError(_('This notice is not a favorite!')); return; } @@ -62,7 +62,7 @@ class DisfavorAction extends Action if (!$result) { common_log_db_error($fave, 'DELETE', __FILE__); - $this->server_error(_('Could not delete favorite.')); + $this->serverError(_('Could not delete favorite.')); return; } diff --git a/actions/doc.php b/actions/doc.php index 98da31267..3d14b25b8 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -28,7 +28,7 @@ class DocAction extends Action $title = $this->trimmed('title'); $filename = INSTALLDIR.'/doc/'.$title; if (!file_exists($filename)) { - common_user_error(_('No such document.')); + $this->clientError(_('No such document.')); return; } $c = file_get_contents($filename); diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 39f186bff..6210c07b4 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -182,7 +182,7 @@ class EmailsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -232,7 +232,7 @@ class EmailsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); - common_server_error(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Couldn\'t insert confirmation code.')); return; } @@ -260,7 +260,7 @@ class EmailsettingsAction extends SettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } @@ -286,7 +286,7 @@ class EmailsettingsAction extends SettingsAction $result = $user->updateKeys($original); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } $user->query('COMMIT'); @@ -308,7 +308,7 @@ class EmailsettingsAction extends SettingsAction if (!$user->updateKeys($orig)) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->server_error(_("Couldn't update user record.")); + $this->serverError(_("Couldn't update user record.")); } $this->show_form(_('Incoming email address removed.'), true); @@ -323,7 +323,7 @@ class EmailsettingsAction extends SettingsAction if (!$user->updateKeys($orig)) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->server_error(_("Couldn't update user record.")); + $this->serverError(_("Couldn't update user record.")); } $this->show_form(_('New incoming email address added.'), true); diff --git a/actions/facebookremove.php b/actions/facebookremove.php index a200fefbf..d0a0dd951 100644 --- a/actions/facebookremove.php +++ b/actions/facebookremove.php @@ -53,7 +53,7 @@ class FacebookremoveAction extends FacebookAction if (!$result) { common_log_db_error($flink, 'DELETE', __FILE__); - common_server_error(_('Couldn\'t remove Facebook user.')); + $this->serverError(_('Couldn\'t remove Facebook user.')); return; } diff --git a/actions/favor.php b/actions/favor.php index 1dfef9bbb..8d751a7a9 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -29,7 +29,7 @@ class FavorAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -48,19 +48,19 @@ class FavorAction extends Action $token = $this->trimmed('token-'.$notice->id); if (!$token || $token != common_session_token()) { - $this->client_error(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_("There was a problem with your session token. Try again, please.")); return; } if ($user->hasFave($notice)) { - $this->client_error(_('This notice is already a favorite!')); + $this->clientError(_('This notice is already a favorite!')); return; } $fave = Fave::addNew($user, $notice); if (!$fave) { - $this->server_error(_('Could not create favorite.')); + $this->serverError(_('Could not create favorite.')); return; } diff --git a/actions/favoritesrss.php b/actions/favoritesrss.php index 8c7ce52bf..3f4ffc63a 100644 --- a/actions/favoritesrss.php +++ b/actions/favoritesrss.php @@ -34,7 +34,7 @@ class FavoritesrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; diff --git a/actions/finishaddopenid.php b/actions/finishaddopenid.php index 7de631712..708e8d4bf 100644 --- a/actions/finishaddopenid.php +++ b/actions/finishaddopenid.php @@ -28,7 +28,7 @@ class FinishaddopenidAction extends Action { parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); } else { $this->try_login(); } diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index 112429002..bc33ac330 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -28,7 +28,7 @@ class FinishopenidloginAction extends Action { parent::handle($args); if (common_logged_in()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -179,7 +179,7 @@ class FinishopenidloginAction extends Action # FIXME: save invite code before redirect, and check here if (common_config('site', 'closed') || common_config('site', 'inviteonly')) { - common_user_error(_('Registration not allowed.')); + $this->clientError(_('Registration not allowed.')); return; } @@ -205,7 +205,7 @@ class FinishopenidloginAction extends Action list($display, $canonical, $sreg) = $this->get_saved_values(); if (!$display || !$canonical) { - common_server_error(_('Stored OpenID not found.')); + $this->serverError(_('Stored OpenID not found.')); return; } @@ -214,7 +214,7 @@ class FinishopenidloginAction extends Action $other = oid_get_user($canonical); if ($other) { - common_server_error(_('Creating new account for OpenID that already has a user.')); + $this->serverError(_('Creating new account for OpenID that already has a user.')); return; } @@ -274,14 +274,14 @@ class FinishopenidloginAction extends Action list($display, $canonical, $sreg) = $this->get_saved_values(); if (!$display || !$canonical) { - common_server_error(_('Stored OpenID not found.')); + $this->serverError(_('Stored OpenID not found.')); return; } $result = oid_link_user($user->id, $canonical, $display); if (!$result) { - common_server_error(_('Error connecting user to OpenID.')); + $this->serverError(_('Error connecting user to OpenID.')); return; } diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php index cee3a1818..f9094a50c 100644 --- a/actions/finishremotesubscribe.php +++ b/actions/finishremotesubscribe.php @@ -30,14 +30,14 @@ class FinishremotesubscribeAction extends Action parent::handle($args); if (common_logged_in()) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } $omb = $_SESSION['oauth_authorization_request']; if (!$omb) { - common_user_error(_('Not expecting this response!')); + $this->clientError(_('Not expecting this response!')); return; } @@ -51,38 +51,38 @@ class FinishremotesubscribeAction extends Action # I think this is the success metric if ($token != $omb['token']) { - common_user_error(_('Not authorized.')); + $this->clientError(_('Not authorized.')); return; } $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { - common_user_error(_('Unknown version of OMB protocol.')); + $this->clientError(_('Unknown version of OMB protocol.')); return; } $nickname = $req->get_parameter('omb_listener_nickname'); if (!$nickname) { - common_user_error(_('No nickname provided by remote server.')); + $this->clientError(_('No nickname provided by remote server.')); return; } $profile_url = $req->get_parameter('omb_listener_profile'); if (!$profile_url) { - common_user_error(_('No profile URL returned by server.')); + $this->clientError(_('No profile URL returned by server.')); return; } if (!Validate::uri($profile_url, array('allowed_schemes' => array('http', 'https')))) { - common_user_error(_('Invalid profile URL returned by server.')); + $this->clientError(_('Invalid profile URL returned by server.')); return; } if ($profile_url == common_local_url('showstream', array('nickname' => $nickname))) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } @@ -91,14 +91,14 @@ class FinishremotesubscribeAction extends Action $user = User::staticGet('nickname', $omb['listenee']); if (!$user) { - common_user_error(_('User being listened to doesn\'t exist.')); + $this->clientError(_('User being listened to doesn\'t exist.')); return; } $other = User::staticGet('uri', $omb['listener']); if ($other) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } @@ -111,7 +111,7 @@ class FinishremotesubscribeAction extends Action list($newtok, $newsecret) = $this->access_token($omb); if (!$newtok || !$newsecret) { - common_user_error(_('Couldn\'t convert request tokens to access tokens.')); + $this->clientError(_('Couldn\'t convert request tokens to access tokens.')); return; } @@ -155,7 +155,7 @@ class FinishremotesubscribeAction extends Action $profile->created = DB_DataObject_Cast::dateTime(); # current time $id = $profile->insert(); if (!$id) { - common_server_error(_('Error inserting new profile')); + $this->serverError(_('Error inserting new profile')); return; } $remote->id = $id; @@ -163,7 +163,7 @@ class FinishremotesubscribeAction extends Action if ($avatar_url) { if (!$this->add_avatar($profile, $avatar_url)) { - common_server_error(_('Error inserting avatar')); + $this->serverError(_('Error inserting avatar')); return; } } @@ -173,19 +173,19 @@ class FinishremotesubscribeAction extends Action if ($exists) { if (!$remote->update($orig_remote)) { - common_server_error(_('Error updating remote profile')); + $this->serverError(_('Error updating remote profile')); return; } } else { $remote->created = DB_DataObject_Cast::dateTime(); # current time if (!$remote->insert()) { - common_server_error(_('Error inserting remote profile')); + $this->serverError(_('Error inserting remote profile')); return; } } if ($user->hasBlocked($profile)) { - $this->client_error(_('That user has blocked you from subscribing.')); + $this->clientError(_('That user has blocked you from subscribing.')); return; } @@ -215,7 +215,7 @@ class FinishremotesubscribeAction extends Action if (!$result) { common_log_db_error($sub, ($sub_exists) ? 'UPDATE' : 'INSERT', __FILE__); - common_user_error(_('Couldn\'t insert new subscription.')); + $this->clientError(_('Couldn\'t insert new subscription.')); return; } diff --git a/actions/foaf.php b/actions/foaf.php index 6f73ce505..a0f8a1ff3 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -40,14 +40,14 @@ class FoafAction extends Action $user = User::staticGet('nickname', $nickname); if (!$user) { - common_user_error(_('No such user.'), 404); + $this->clientError(_('No such user.'), 404); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.'), 500); + $this->serverError(_('User has no profile.'), 500); return; } diff --git a/actions/imsettings.php b/actions/imsettings.php index 693f49efa..14df3451a 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -149,7 +149,7 @@ class ImsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -199,7 +199,7 @@ class ImsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); - common_server_error(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Couldn\'t insert confirmation code.')); return; } @@ -231,7 +231,7 @@ class ImsettingsAction extends SettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } @@ -257,7 +257,7 @@ class ImsettingsAction extends SettingsAction $result = $user->updateKeys($original); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } $user->query('COMMIT'); diff --git a/actions/invite.php b/actions/invite.php index 15233602e..879264deb 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -31,7 +31,7 @@ class InviteAction extends Action { parent::handle($args); if (!common_logged_in()) { - $this->client_error(sprintf(_('You must be logged in to invite other users to use %s'), + $this->clientError(sprintf(_('You must be logged in to invite other users to use %s'), common_config('site', 'name'))); return; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { diff --git a/actions/login.php b/actions/login.php index fd98e656d..060d16ad6 100644 --- a/actions/login.php +++ b/actions/login.php @@ -31,7 +31,7 @@ class LoginAction extends Action { parent::handle($args); if (common_is_real_login()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->check_login(); } else { @@ -46,7 +46,7 @@ class LoginAction extends Action # CSRF protection - token set in common_notice_form() $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } @@ -55,7 +55,7 @@ class LoginAction extends Action if (common_check_user($nickname, $password)) { # success! if (!common_set_user($nickname)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } common_real_login(true); @@ -81,7 +81,7 @@ class LoginAction extends Action # success! if (!common_set_user($user)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } diff --git a/actions/logout.php b/actions/logout.php index 201378730..3001f3613 100644 --- a/actions/logout.php +++ b/actions/logout.php @@ -33,7 +33,7 @@ class LogoutAction extends Action { parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); } else { common_set_user(null); common_real_login(false); # not logged in diff --git a/actions/microsummary.php b/actions/microsummary.php index 13ddc4e3e..b46c5bee5 100644 --- a/actions/microsummary.php +++ b/actions/microsummary.php @@ -31,14 +31,14 @@ class MicrosummaryAction extends Action $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user'), 404); + $this->clientError(_('No such user'), 404); return; } $notice = $user->getCurrentNotice(); if (!$notice) { - $this->client_error(_('No current status'), 404); + $this->clientError(_('No current status'), 404); } header('Content-Type: text/plain'); diff --git a/actions/newmessage.php b/actions/newmessage.php index 6221b67e9..510a5f8f3 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -27,7 +27,7 @@ class NewmessageAction extends Action parent::handle($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.'), 403); + $this->clientError(_('Not logged in.'), 403); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->save_new_message(); } else { @@ -71,10 +71,10 @@ class NewmessageAction extends Action $this->show_form(_('No recipient specified.')); return; } else if (!$user->mutuallySubscribed($other)) { - $this->client_error(_('You can\'t send a message to this user.'), 404); + $this->clientError(_('You can\'t send a message to this user.'), 404); return; } else if ($user->id == $other->id) { - $this->client_error(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), 403); + $this->clientError(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), 403); return; } @@ -113,12 +113,12 @@ class NewmessageAction extends Action $other = User::staticGet('id', $to); if (!$other) { - $this->client_error(_('No such user'), 404); + $this->clientError(_('No such user'), 404); return; } if (!$user->mutuallySubscribed($other)) { - $this->client_error(_('You can\'t send a message to this user.'), 404); + $this->clientError(_('You can\'t send a message to this user.'), 404); return; } diff --git a/actions/newnotice.php b/actions/newnotice.php index 89792d95a..cb02854a1 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -29,13 +29,13 @@ class NewnoticeAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { # CSRF protection - token set in common_notice_form() $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } diff --git a/actions/noticesearch.php b/actions/noticesearch.php index d998b9da8..336e39bd3 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -97,7 +97,7 @@ class NoticesearchAction extends SearchAction $profile = $notice->getProfile(); if (!$profile) { common_log_db_error($notice, 'SELECT', __FILE__); - $this->server_error(_('Notice without matching profile')); + $this->serverError(_('Notice without matching profile')); return; } # XXX: RDFa diff --git a/actions/nudge.php b/actions/nudge.php index de930e462..49223d431 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -29,7 +29,7 @@ class NudgeAction extends Action parent::handle($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -46,12 +46,12 @@ class NudgeAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } if (!$other->email || !$other->emailnotifynudge) { - $this->client_error(_('This user doesn\'t allow nudges or hasn\'t confirmed or set his email yet.')); + $this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set his email yet.')); return; } diff --git a/actions/openidlogin.php b/actions/openidlogin.php index 82791af34..d1989e0de 100644 --- a/actions/openidlogin.php +++ b/actions/openidlogin.php @@ -28,7 +28,7 @@ class OpenidloginAction extends Action { parent::handle($args); if (common_logged_in()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $openid_url = $this->trimmed('openid_url'); diff --git a/actions/othersettings.php b/actions/othersettings.php index 97cbd0094..51f6f8197 100644 --- a/actions/othersettings.php +++ b/actions/othersettings.php @@ -177,7 +177,7 @@ class OthersettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } diff --git a/actions/peopletag.php b/actions/peopletag.php index 2680638d7..7bcfcb93e 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -32,7 +32,7 @@ class PeopletagAction extends Action $tag = $this->trimmed('tag'); if (!common_valid_profile_tag($tag)) { - $this->client_error(sprintf(_('Not a valid people tag: %s'), $tag)); + $this->clientError(sprintf(_('Not a valid people tag: %s'), $tag)); return; } diff --git a/actions/postnotice.php b/actions/postnotice.php index dec62a678..0b4735296 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -36,7 +36,7 @@ class PostnoticeAction extends Action print "omb_version=".OMB_VERSION_01; } } catch (OAuthException $e) { - common_server_error($e->getMessage()); + $this->serverError($e->getMessage()); return; } } @@ -45,36 +45,36 @@ class PostnoticeAction extends Action { $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { - common_user_error(_('Unsupported OMB version'), 400); + $this->clientError(_('Unsupported OMB version'), 400); return false; } # First, check to see $listenee = $req->get_parameter('omb_listenee'); $remote_profile = Remote_profile::staticGet('uri', $listenee); if (!$remote_profile) { - common_user_error(_('Profile unknown'), 403); + $this->clientError(_('Profile unknown'), 403); return false; } $sub = Subscription::staticGet('token', $token->key); if (!$sub) { - common_user_error(_('No such subscription'), 403); + $this->clientError(_('No such subscription'), 403); return false; } $content = $req->get_parameter('omb_notice_content'); $content_shortened = common_shorten_links($content); if (mb_strlen($content_shortened) > 140) { - common_user_error(_('Invalid notice content'), 400); + $this->clientError(_('Invalid notice content'), 400); return false; } $notice_uri = $req->get_parameter('omb_notice'); if (!Validate::uri($notice_uri) && !common_valid_tag($notice_uri)) { - common_user_error(_('Invalid notice uri'), 400); + $this->clientError(_('Invalid notice uri'), 400); return false; } $notice_url = $req->get_parameter('omb_notice_url'); if ($notice_url && !common_valid_http_url($notice_url)) { - common_user_error(_('Invalid notice url'), 400); + $this->clientError(_('Invalid notice url'), 400); return false; } $notice = Notice::staticGet('uri', $notice_uri); diff --git a/actions/profilesettings.php b/actions/profilesettings.php index ef45fc1d9..6ad3f2ef5 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -125,7 +125,7 @@ class ProfilesettingsAction extends SettingsAction if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return; } @@ -298,7 +298,7 @@ class ProfilesettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } else { # Re-initialize language environment if it changed @@ -318,7 +318,7 @@ class ProfilesettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user for autosubscribe.')); + $this->serverError(_('Couldn\'t update user for autosubscribe.')); return; } } @@ -341,7 +341,7 @@ class ProfilesettingsAction extends SettingsAction if (!$result) { common_log_db_error($profile, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t save profile.')); + $this->serverError(_('Couldn\'t save profile.')); return; } @@ -350,7 +350,7 @@ class ProfilesettingsAction extends SettingsAction $result = $user->setSelfTags($tags); if (!$result) { - common_server_error(_('Couldn\'t save tags.')); + $this->serverError(_('Couldn\'t save tags.')); return; } @@ -475,7 +475,7 @@ class ProfilesettingsAction extends SettingsAction } if (!$user->update($original)) { - common_server_error(_('Can\'t save new password.')); + $this->serverError(_('Can\'t save new password.')); return; } diff --git a/actions/public.php b/actions/public.php index 62071eccc..0ceeef98e 100644 --- a/actions/public.php +++ b/actions/public.php @@ -165,7 +165,7 @@ class PublicAction extends Action NOTICES_PER_PAGE + 1); if (!$notice) { - $this->server_error(_('Could not retrieve public stream.')); + $this->serverError(_('Could not retrieve public stream.')); return; } diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php index 3e6ecfb1f..3d839e751 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -30,7 +30,7 @@ class RecoverpasswordAction extends Action { parent::handle($args); if (common_logged_in()) { - $this->client_error(_('You are already logged in!')); + $this->clientError(_('You are already logged in!')); return; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($this->arg('recover')) { @@ -38,7 +38,7 @@ class RecoverpasswordAction extends Action } else if ($this->arg('reset')) { $this->reset_password(); } else { - $this->client_error(_('Unexpected form submission.')); + $this->clientError(_('Unexpected form submission.')); } } else { if ($this->trimmed('code')) { @@ -56,18 +56,18 @@ class RecoverpasswordAction extends Action $confirm = Confirm_address::staticGet('code', $code); if (!$confirm) { - $this->client_error(_('No such recovery code.')); + $this->clientError(_('No such recovery code.')); return; } if ($confirm->address_type != 'recover') { - $this->client_error(_('Not a recovery code.')); + $this->clientError(_('Not a recovery code.')); return; } $user = User::staticGet($confirm->user_id); if (!$user) { - $this->server_error(_('Recovery code for unknown user.')); + $this->serverError(_('Recovery code for unknown user.')); return; } @@ -80,7 +80,7 @@ class RecoverpasswordAction extends Action if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - common_server_error(_('Error with confirmation code.')); + $this->serverError(_('Error with confirmation code.')); return; } @@ -91,7 +91,7 @@ class RecoverpasswordAction extends Action common_log(LOG_WARNING, 'Attempted redemption on recovery code ' . 'that is ' . $touched . ' seconds old. '); - $this->client_error(_('This confirmation code is too old. ' . + $this->clientError(_('This confirmation code is too old. ' . 'Please start again.')); return; } @@ -105,7 +105,7 @@ class RecoverpasswordAction extends Action $result = $user->updateKeys($orig); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->server_error(_('Could not update user with confirmed email address.')); + $this->serverError(_('Could not update user with confirmed email address.')); return; } } @@ -240,7 +240,7 @@ class RecoverpasswordAction extends Action } if (!$user->email && !$confirm_email) { - $this->client_error(_('No registered email address for that user.')); + $this->clientError(_('No registered email address for that user.')); return; } @@ -254,7 +254,7 @@ class RecoverpasswordAction extends Action if (!$confirm->insert()) { common_log_db_error($confirm, 'INSERT', __FILE__); - $this->server_error(_('Error saving address confirmation.')); + $this->serverError(_('Error saving address confirmation.')); return; } @@ -298,7 +298,7 @@ class RecoverpasswordAction extends Action $user = $this->get_temp_user(); if (!$user) { - $this->client_error(_('Unexpected password reset.')); + $this->clientError(_('Unexpected password reset.')); return; } @@ -322,14 +322,14 @@ class RecoverpasswordAction extends Action if (!$user->update($original)) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Can\'t save new password.')); + $this->serverError(_('Can\'t save new password.')); return; } $this->clear_temp_user(); if (!common_set_user($user->nickname)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } diff --git a/actions/register.php b/actions/register.php index bac179687..b4d0d43fb 100644 --- a/actions/register.php +++ b/actions/register.php @@ -26,9 +26,9 @@ class RegisterAction extends Action parent::handle($args); if (common_config('site', 'closed')) { - common_user_error(_('Registration not allowed.')); + $this->clientError(_('Registration not allowed.')); } else if (common_logged_in()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->try_register(); } else { @@ -65,7 +65,7 @@ class RegisterAction extends Action } if (common_config('site', 'inviteonly') && !($code && $invite)) { - $this->client_error(_('Sorry, only invited people can register.')); + $this->clientError(_('Sorry, only invited people can register.')); return; } @@ -115,7 +115,7 @@ class RegisterAction extends Action } # success! if (!common_set_user($user)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } # this is a real login @@ -179,7 +179,7 @@ class RegisterAction extends Action } if (common_config('site', 'inviteonly') && !($code && $invite)) { - $this->client_error(_('Sorry, only invited people can register.')); + $this->clientError(_('Sorry, only invited people can register.')); return; } diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index b9e29d645..32e9bf3d3 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -30,7 +30,7 @@ class RemotesubscribeAction extends Action parent::handle($args); if (common_logged_in()) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } @@ -342,7 +342,7 @@ class RemotesubscribeAction extends Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return; } diff --git a/actions/replies.php b/actions/replies.php index 878550888..84fd894ff 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -40,7 +40,7 @@ class RepliesAction extends StreamAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -57,7 +57,7 @@ class RepliesAction extends StreamAction function no_such_user() { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); } function show_header($user) diff --git a/actions/repliesrss.php b/actions/repliesrss.php index 5f85f8d2e..43be133a4 100644 --- a/actions/repliesrss.php +++ b/actions/repliesrss.php @@ -34,7 +34,7 @@ class RepliesrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; diff --git a/actions/requesttoken.php b/actions/requesttoken.php index a74548739..378db4403 100644 --- a/actions/requesttoken.php +++ b/actions/requesttoken.php @@ -39,7 +39,7 @@ class RequesttokenAction extends Action $token = $server->fetch_request_token($req); print $token; } catch (OAuthException $e) { - common_server_error($e->getMessage()); + $this->serverError($e->getMessage()); } } } diff --git a/actions/showfavorites.php b/actions/showfavorites.php index 1dec3ba5b..caa823893 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -33,14 +33,14 @@ class ShowfavoritesAction extends StreamAction $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -90,7 +90,7 @@ class ShowfavoritesAction extends StreamAction $notice = $user->favoriteNotices(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); if (!$notice) { - $this->server_error(_('Could not retrieve favorite notices.')); + $this->serverError(_('Could not retrieve favorite notices.')); return; } diff --git a/actions/showmessage.php b/actions/showmessage.php index 25330a568..d13e9f671 100644 --- a/actions/showmessage.php +++ b/actions/showmessage.php @@ -32,7 +32,7 @@ class ShowmessageAction extends MailboxAction $message = $this->get_message(); if (!$message) { - $this->client_error(_('No such message.'), 404); + $this->clientError(_('No such message.'), 404); return; } @@ -41,7 +41,7 @@ class ShowmessageAction extends MailboxAction if ($cur && ($cur->id == $message->from_profile || $cur->id == $message->to_profile)) { $this->show_page($cur, 1); } else { - $this->client_error(_('Only the sender and recipient may read this message.'), 403); + $this->clientError(_('Only the sender and recipient may read this message.'), 403); return; } } diff --git a/actions/shownotice.php b/actions/shownotice.php index c519af0ba..82d4bd270 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -37,14 +37,14 @@ class ShownoticeAction extends StreamAction $this->notice = Notice::staticGet($id); if (!$this->notice) { - $this->client_error(_('No such notice.'), 404); + $this->clientError(_('No such notice.'), 404); return false; } $this->profile = $this->notice->getProfile(); if (!$this->profile) { - $this->server_error(_('Notice has no profile'), 500); + $this->serverError(_('Notice has no profile'), 500); return false; } @@ -119,6 +119,6 @@ class ShownoticeAction extends StreamAction function no_such_notice() { - common_user_error(_('No such notice.')); + $this->clientError(_('No such notice.')); } } diff --git a/actions/showstream.php b/actions/showstream.php index 9a59f7ae4..ed38c67f9 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -56,7 +56,7 @@ class ShowstreamAction extends StreamAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -159,7 +159,7 @@ class ShowstreamAction extends StreamAction function no_such_user() { - $this->client_error(_('No such user.'), 404); + $this->clientError(_('No such user.'), 404); } function show_profile($profile) diff --git a/actions/smssettings.php b/actions/smssettings.php index 1be45d1ce..c5879e4d9 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -168,7 +168,7 @@ class SmssettingsAction extends EmailsettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -218,7 +218,7 @@ class SmssettingsAction extends EmailsettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); - common_server_error(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Couldn\'t insert confirmation code.')); return; } @@ -254,7 +254,7 @@ class SmssettingsAction extends EmailsettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } @@ -283,7 +283,7 @@ class SmssettingsAction extends EmailsettingsAction $result = $user->updateKeys($original); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } $user->query('COMMIT'); diff --git a/actions/subedit.php b/actions/subedit.php index 1142b7a03..e22384869 100644 --- a/actions/subedit.php +++ b/actions/subedit.php @@ -30,28 +30,28 @@ class SubeditAction extends Action parent::prepare($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return false; } $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $id = $this->trimmed('profile'); if (!$id) { - $this->client_error(_('No profile specified.')); + $this->clientError(_('No profile specified.')); return false; } $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return false; } @@ -68,7 +68,7 @@ class SubeditAction extends Action 'subscribed' => $this->profile->id)); if (!$sub) { - $this->client_error(_('You are not subscribed to that profile.')); + $this->clientError(_('You are not subscribed to that profile.')); return false; } @@ -81,7 +81,7 @@ class SubeditAction extends Action if (!$result) { common_log_db_error($sub, 'UPDATE', __FILE__); - $this->server_error(_('Could not save subscription.')); + $this->serverError(_('Could not save subscription.')); return false; } diff --git a/actions/subscribe.php b/actions/subscribe.php index 99f9acc24..b6f03f0f1 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -27,7 +27,7 @@ class SubscribeAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -43,7 +43,7 @@ class SubscribeAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } @@ -52,14 +52,14 @@ class SubscribeAction extends Action $other = User::staticGet('id', $other_id); if (!$other) { - $this->client_error(_('Not a local user.')); + $this->clientError(_('Not a local user.')); return; } $result = subs_subscribe_to($user, $other); if($result != true) { - common_user_error($result); + $this->clientError($result); return; } diff --git a/actions/tagother.php b/actions/tagother.php index f0105ec8b..e11e3a00d 100644 --- a/actions/tagother.php +++ b/actions/tagother.php @@ -30,7 +30,7 @@ class TagotherAction extends Action parent::handle($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in'), 403); + $this->clientError(_('Not logged in'), 403); return; } @@ -39,12 +39,12 @@ class TagotherAction extends Action } else { $id = $this->trimmed('id'); if (!$id) { - $this->client_error(_('No id argument.')); + $this->clientError(_('No id argument.')); return; } $profile = Profile::staticGet('id', $id); if (!$profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return; } $this->show_form($profile); @@ -121,7 +121,7 @@ class TagotherAction extends Action $profile = Profile::staticGet('id', $id); if (!$profile) { - $this->client_error(_('No such profile.')); + $this->clientError(_('No such profile.')); return; } @@ -147,14 +147,14 @@ class TagotherAction extends Action !Subscription::pkeyGet(array('subscriber' => $profile->id, 'subscribed' => $user->id))) { - $this->client_error(_('You can only tag people you are subscribed to or who are subscribed to you.')); + $this->clientError(_('You can only tag people you are subscribed to or who are subscribed to you.')); return; } $result = Profile_tag::setTags($user->id, $profile->id, $tags); if (!$result) { - $this->client_error(_('Could not save tags.')); + $this->clientError(_('Could not save tags.')); return; } diff --git a/actions/tagrss.php b/actions/tagrss.php index 912d71413..b0227ab39 100644 --- a/actions/tagrss.php +++ b/actions/tagrss.php @@ -32,7 +32,7 @@ class TagrssAction extends Rss10Action $this->tag = Notice_tag::staticGet('tag', $tag); if (!$this->tag) { - common_user_error(_('No such tag.')); + $this->clientError(_('No such tag.')); return false; } else { return true; diff --git a/actions/twitapiaccount.php b/actions/twitapiaccount.php index 79e1ed990..e51a29a2d 100644 --- a/actions/twitapiaccount.php +++ b/actions/twitapiaccount.php @@ -29,7 +29,7 @@ class TwitapiaccountAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -39,7 +39,7 @@ class TwitapiaccountAction extends TwitterapiAction function end_session($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function update_location($args, $apidata) @@ -47,7 +47,7 @@ class TwitapiaccountAction extends TwitterapiAction parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -56,7 +56,7 @@ class TwitapiaccountAction extends TwitterapiAction if (!is_null($location) && strlen($location) > 255) { // XXX: But Twitter just truncates and runs with it. -- Zach - $this->client_error(_('That\'s too long. Max notice size is 255 chars.'), 406, $apidate['content-type']); + $this->clientError(_('That\'s too long. Max notice size is 255 chars.'), 406, $apidate['content-type']); return; } @@ -64,7 +64,7 @@ class TwitapiaccountAction extends TwitterapiAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -75,7 +75,7 @@ class TwitapiaccountAction extends TwitterapiAction if (!$result) { common_log_db_error($profile, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t save profile.')); + $this->serverError(_('Couldn\'t save profile.')); return; } @@ -91,12 +91,12 @@ class TwitapiaccountAction extends TwitterapiAction function update_delivery_device($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function rate_limit_status($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } } \ No newline at end of file diff --git a/actions/twitapiblocks.php b/actions/twitapiblocks.php index 5d64f2f7d..8135adef3 100644 --- a/actions/twitapiblocks.php +++ b/actions/twitapiblocks.php @@ -32,7 +32,7 @@ class TwitapiblocksAction extends TwitterapiAction $blockee = $this->get_user($apidata['api_arg'], $apidata); if (!$blockee) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } @@ -44,7 +44,7 @@ class TwitapiblocksAction extends TwitterapiAction $this->show_profile($blockee, $type); $this->end_document($type); } else { - common_server_error(_('Block user failed.')); + $this->serverError(_('Block user failed.')); } } @@ -54,7 +54,7 @@ class TwitapiblocksAction extends TwitterapiAction $blockee = $this->get_user($apidata['api_arg'], $apidata); if (!$blockee) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } @@ -66,7 +66,7 @@ class TwitapiblocksAction extends TwitterapiAction $this->show_profile($blockee, $type); $this->end_document($type); } else { - common_server_error(_('Unblock user failed.')); + $this->serverError(_('Unblock user failed.')); } } } \ No newline at end of file diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index 36d2a7e09..db55e8cd0 100644 --- a/actions/twitapidirect_messages.php +++ b/actions/twitapidirect_messages.php @@ -108,7 +108,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction $this->show_json_dmsgs($message); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -119,7 +119,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -134,11 +134,11 @@ class Twitapidirect_messagesAction extends TwitterapiAction $content = $this->trimmed('text'); if (!$content) { - $this->client_error(_('No message text!'), $code = 406, $apidata['content-type']); + $this->clientError(_('No message text!'), $code = 406, $apidata['content-type']); } else { $content_shortened = common_shorten_links($content); if (mb_strlen($content_shortened) > 140) { - $this->client_error(_('That\'s too long. Max message size is 140 chars.'), + $this->clientError(_('That\'s too long. Max message size is 140 chars.'), $code = 406, $apidata['content-type']); return; } @@ -147,15 +147,15 @@ class Twitapidirect_messagesAction extends TwitterapiAction $other = $this->get_user($this->trimmed('user')); if (!$other) { - $this->client_error(_('Recipient user not found.'), $code = 403, $apidata['content-type']); + $this->clientError(_('Recipient user not found.'), $code = 403, $apidata['content-type']); return; } else if (!$user->mutuallySubscribed($other)) { - $this->client_error(_('Can\'t send direct messages to users who aren\'t your friend.'), + $this->clientError(_('Can\'t send direct messages to users who aren\'t your friend.'), $code = 403, $apidata['content-type']); return; } else if ($user->id == $other->id) { // Sending msgs to yourself is allowed by Twitter - $this->client_error(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), + $this->clientError(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), $code = 403, $apidata['content-type']); return; } @@ -164,7 +164,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction html_entity_decode($content, ENT_NOQUOTES, 'UTF-8'), $source); if (is_string($message)) { - $this->server_error($message); + $this->serverError($message); return; } @@ -181,7 +181,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction function destroy($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function show_xml_dmsgs($message) diff --git a/actions/twitapifavorites.php b/actions/twitapifavorites.php index 55e04732f..737b7229f 100644 --- a/actions/twitapifavorites.php +++ b/actions/twitapifavorites.php @@ -32,14 +32,14 @@ class TwitapifavoritesAction extends TwitterapiAction $user = $this->get_user($apidata['api_arg'], $apidata); if (!$user) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -56,7 +56,7 @@ class TwitapifavoritesAction extends TwitterapiAction $notice = $user->favoriteNotices((($page-1)*20), $count); if (!$notice) { - common_server_error(_('Could not retrieve favorite notices.')); + $this->serverError(_('Could not retrieve favorite notices.')); return; } @@ -82,7 +82,7 @@ class TwitapifavoritesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -94,12 +94,12 @@ class TwitapifavoritesAction extends TwitterapiAction // Check for RESTfulness if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { // XXX: Twitter just prints the err msg, no XML / JSON. - $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); return; } if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -109,20 +109,20 @@ class TwitapifavoritesAction extends TwitterapiAction $notice = Notice::staticGet($notice_id); if (!$notice) { - $this->client_error(_('No status found with that ID.'), 404, $apidata['content-type']); + $this->clientError(_('No status found with that ID.'), 404, $apidata['content-type']); return; } // XXX: Twitter lets you fave things repeatedly via api. if ($user->hasFave($notice)) { - $this->client_error(_('This notice is already a favorite!'), 403, $apidata['content-type']); + $this->clientError(_('This notice is already a favorite!'), 403, $apidata['content-type']); return; } $fave = Fave::addNew($user, $notice); if (!$fave) { - common_server_error(_('Could not create favorite.')); + $this->serverError(_('Could not create favorite.')); return; } @@ -140,7 +140,7 @@ class TwitapifavoritesAction extends TwitterapiAction function destroy($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } // XXX: these two funcs swiped from faves. Maybe put in util.php, or some common base class? diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index 458ff48a5..c50c5e84a 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -29,7 +29,7 @@ class TwitapifriendshipsAction extends TwitterapiAction parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -38,7 +38,7 @@ class TwitapifriendshipsAction extends TwitterapiAction $other = $this->get_user($id); if (!$other) { - $this->client_error(_('Could not follow user: User not found.'), 403, $apidata['content-type']); + $this->clientError(_('Could not follow user: User not found.'), 403, $apidata['content-type']); return; } @@ -46,7 +46,7 @@ class TwitapifriendshipsAction extends TwitterapiAction if ($user->isSubscribed($other)) { $errmsg = sprintf(_('Could not follow user: %s is already on your list.'), $other->nickname); - $this->client_error($errmsg, 403, $apidata['content-type']); + $this->clientError($errmsg, 403, $apidata['content-type']); return; } @@ -62,7 +62,7 @@ class TwitapifriendshipsAction extends TwitterapiAction if (!$result) { $errmsg = sprintf(_('Could not follow user: %s is already on your list.'), $other->nickname); - $this->client_error($errmsg, 400, $apidata['content-type']); + $this->clientError($errmsg, 400, $apidata['content-type']); return; } @@ -82,7 +82,7 @@ class TwitapifriendshipsAction extends TwitterapiAction parent::handle($args); if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { - $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); return; } @@ -102,7 +102,7 @@ class TwitapifriendshipsAction extends TwitterapiAction $sub->delete(); $sub->query('COMMIT'); } else { - $this->client_error(_('You are not friends with the specified user.'), 403, $apidata['content-type']); + $this->clientError(_('You are not friends with the specified user.'), 403, $apidata['content-type']); return; } @@ -118,7 +118,7 @@ class TwitapifriendshipsAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -129,7 +129,7 @@ class TwitapifriendshipsAction extends TwitterapiAction $user_b = $this->get_user($user_b_id); if (!$user_a || !$user_b) { - $this->client_error(_('Two user ids or screen_names must be supplied.'), 400, $apidata['content-type']); + $this->clientError(_('Two user ids or screen_names must be supplied.'), 400, $apidata['content-type']); return; } diff --git a/actions/twitapihelp.php b/actions/twitapihelp.php index 531c6e9d3..db5892baf 100644 --- a/actions/twitapihelp.php +++ b/actions/twitapihelp.php @@ -41,7 +41,7 @@ class TwitapihelpAction extends TwitterapiAction print '"ok"'; $this->end_document('json'); } else { - common_user_error(_('API method not found!'), $code=404); + $this->clientError(_('API method not found!'), $code=404); } } @@ -49,7 +49,7 @@ class TwitapihelpAction extends TwitterapiAction function downtime_schedule($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } } \ No newline at end of file diff --git a/actions/twitapilaconica.php b/actions/twitapilaconica.php index 34c8f88fc..8cd7a64b9 100644 --- a/actions/twitapilaconica.php +++ b/actions/twitapilaconica.php @@ -79,7 +79,7 @@ class TwitapilaconicaAction extends TwitterapiAction $this->end_document('json'); break; default: - $this->client_error(_('API method not found!'), $code=404); + $this->clientError(_('API method not found!'), $code=404); } } @@ -148,7 +148,7 @@ class TwitapilaconicaAction extends TwitterapiAction $this->end_document('json'); break; default: - $this->client_error(_('API method not found!'), $code=404); + $this->clientError(_('API method not found!'), $code=404); } } @@ -169,6 +169,6 @@ class TwitapilaconicaAction extends TwitterapiAction function wadl($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), 501); + $this->serverError(_('API method under construction.'), 501); } } diff --git a/actions/twitapinotifications.php b/actions/twitapinotifications.php index a19d652c3..411971af1 100644 --- a/actions/twitapinotifications.php +++ b/actions/twitapinotifications.php @@ -28,13 +28,13 @@ class TwitapinotificationsAction extends TwitterapiAction function follow($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function leave($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } } \ No newline at end of file diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 8d175ecab..a35f4b12e 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -76,12 +76,12 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); break; } } else { - common_server_error(_('Couldn\'t find any statuses.'), $code = 503); + $this->serverError(_('Couldn\'t find any statuses.'), $code = 503); } } @@ -144,7 +144,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -157,14 +157,14 @@ class TwitapistatusesAction extends TwitterapiAction $user = $this->get_user($apidata['api_arg'], $apidata); if (!$user) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -225,7 +225,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -236,12 +236,12 @@ class TwitapistatusesAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -273,7 +273,7 @@ class TwitapistatusesAction extends TwitterapiAction // as "truncated." Sending this error may screw up some clients // that assume Twitter will truncate for them. Should we just // truncate too? -- Zach - $this->client_error(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']); + $this->clientError(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']); return; } @@ -306,7 +306,7 @@ class TwitapistatusesAction extends TwitterapiAction if ($reply) { $reply_to = $in_reply_to_status_id; } else { - $this->client_error(_('Not found'), $code = 404, $apidata['content-type']); + $this->clientError(_('Not found'), $code = 404, $apidata['content-type']); return; } } @@ -315,7 +315,7 @@ class TwitapistatusesAction extends TwitterapiAction $source, 1, $reply_to); if (is_string($notice)) { - $this->server_error($notice); + $this->serverError($notice); return; } @@ -389,7 +389,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notices); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -399,7 +399,7 @@ class TwitapistatusesAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -415,7 +415,7 @@ class TwitapistatusesAction extends TwitterapiAction } } else { // XXX: Twitter just sets a 404 header and doens't bother to return an err msg - $this->client_error(_('No status with that ID found.'), 404, $apidata['content-type']); + $this->clientError(_('No status with that ID found.'), 404, $apidata['content-type']); } } @@ -426,14 +426,14 @@ class TwitapistatusesAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } // Check for RESTfulness if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { // XXX: Twitter just prints the err msg, no XML / JSON. - $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); return; } @@ -443,7 +443,7 @@ class TwitapistatusesAction extends TwitterapiAction $notice = Notice::staticGet($notice_id); if (!$notice) { - $this->client_error(_('No status found with that ID.'), 404, $apidata['content-type']); + $this->clientError(_('No status found with that ID.'), 404, $apidata['content-type']); return; } @@ -460,7 +460,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_single_json_status($notice); } } else { - $this->client_error(_('You may not delete another user\'s status.'), 403, $apidata['content-type']); + $this->clientError(_('You may not delete another user\'s status.'), 403, $apidata['content-type']); } } @@ -487,7 +487,7 @@ class TwitapistatusesAction extends TwitterapiAction $user = $this->get_user($apidata['api_arg'], $apidata); if (!$user) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } @@ -500,7 +500,7 @@ class TwitapistatusesAction extends TwitterapiAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -552,14 +552,14 @@ class TwitapistatusesAction extends TwitterapiAction print json_encode($arrays); break; default: - $this->client_error(_('unsupported file type')); + $this->clientError(_('unsupported file type')); } } function featured($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function supported($cmd) diff --git a/actions/twitapiusers.php b/actions/twitapiusers.php index 409986985..ed2417561 100644 --- a/actions/twitapiusers.php +++ b/actions/twitapiusers.php @@ -29,7 +29,7 @@ class TwitapiusersAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -44,7 +44,7 @@ class TwitapiusersAction extends TwitterapiAction if (!$user) { // XXX: Twitter returns a random(?) user instead of throwing and err! -- Zach - $this->client_error(_('Not found.'), 404, $apidata['content-type']); + $this->clientError(_('Not found.'), 404, $apidata['content-type']); return; } diff --git a/actions/twittersettings.php b/actions/twittersettings.php index 663688037..9c879c965 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -285,7 +285,7 @@ class TwittersettingsAction extends SettingsAction if (!$result) { common_log_db_error($flink, 'DELETE', __FILE__); - common_server_error(_('Couldn\'t remove Twitter user.')); + $this->serverError(_('Couldn\'t remove Twitter user.')); return; } diff --git a/actions/unblock.php b/actions/unblock.php index 112304f71..59270f882 100644 --- a/actions/unblock.php +++ b/actions/unblock.php @@ -30,28 +30,28 @@ class UnblockAction extends Action parent::prepare($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return false; } $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $id = $this->trimmed('unblockto'); if (!$id) { - $this->client_error(_('No profile specified.')); + $this->clientError(_('No profile specified.')); return false; } $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return false; } @@ -74,7 +74,7 @@ class UnblockAction extends Action $result = $cur->unblock($this->profile); if (!$result) { - $this->server_error(_('Error removing the block.')); + $this->serverError(_('Error removing the block.')); return; } diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 455c5e28e..32511a4b4 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -24,7 +24,7 @@ class UnsubscribeAction extends Action { parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -40,28 +40,28 @@ class UnsubscribeAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $other_id = $this->arg('unsubscribeto'); if (!$other_id) { - $this->client_error(_('No profile id in request.')); + $this->clientError(_('No profile id in request.')); return; } $other = Profile::staticGet('id', $other_id); if (!$other_id) { - $this->client_error(_('No profile with that id.')); + $this->clientError(_('No profile with that id.')); return; } $result = subs_unsubscribe_to($user, $other); if ($result != true) { - common_user_error($result); + $this->clientError($result); return; } diff --git a/actions/updateprofile.php b/actions/updateprofile.php index abb034c81..c79112dac 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -37,7 +37,7 @@ class UpdateprofileAction extends Action print "omb_version=".OMB_VERSION_01; } } catch (OAuthException $e) { - $this->server_error($e->getMessage()); + $this->serverError($e->getMessage()); return; } } @@ -46,14 +46,14 @@ class UpdateprofileAction extends Action { $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { - $this->client_error(_('Unsupported OMB version'), 400); + $this->clientError(_('Unsupported OMB version'), 400); return false; } # First, check to see if listenee exists $listenee = $req->get_parameter('omb_listenee'); $remote = Remote_profile::staticGet('uri', $listenee); if (!$remote) { - $this->client_error(_('Profile unknown'), 404); + $this->clientError(_('Profile unknown'), 404); return false; } # Second, check to see if they should be able to post updates! @@ -64,72 +64,72 @@ class UpdateprofileAction extends Action $sub->subscribed = $remote->id; $sub->token = $token->key; if (!$sub->find(true)) { - $this->client_error(_('You did not send us that profile'), 403); + $this->clientError(_('You did not send us that profile'), 403); return false; } $profile = Profile::staticGet('id', $remote->id); if (!$profile) { # This one is our fault - $this->server_error(_('Remote profile with no matching profile'), 500); + $this->serverError(_('Remote profile with no matching profile'), 500); return false; } $nickname = $req->get_parameter('omb_listenee_nickname'); if ($nickname && !Validate::string($nickname, array('min_length' => 1, 'max_length' => 64, 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { - $this->client_error(_('Nickname must have only lowercase letters and numbers and no spaces.')); + $this->clientError(_('Nickname must have only lowercase letters and numbers and no spaces.')); return false; } $license = $req->get_parameter('omb_listenee_license'); if ($license && !common_valid_http_url($license)) { - $this->client_error(sprintf(_("Invalid license URL '%s'"), $license)); + $this->clientError(sprintf(_("Invalid license URL '%s'"), $license)); return false; } $profile_url = $req->get_parameter('omb_listenee_profile'); if ($profile_url && !common_valid_http_url($profile_url)) { - $this->client_error(sprintf(_("Invalid profile URL '%s'."), $profile_url)); + $this->clientError(sprintf(_("Invalid profile URL '%s'."), $profile_url)); return false; } # optional stuff $fullname = $req->get_parameter('omb_listenee_fullname'); if ($fullname && strlen($fullname) > 255) { - $this->client_error(_("Full name is too long (max 255 chars).")); + $this->clientError(_("Full name is too long (max 255 chars).")); return false; } $homepage = $req->get_parameter('omb_listenee_homepage'); if ($homepage && (!common_valid_http_url($homepage) || strlen($homepage) > 255)) { - $this->client_error(sprintf(_("Invalid homepage '%s'"), $homepage)); + $this->clientError(sprintf(_("Invalid homepage '%s'"), $homepage)); return false; } $bio = $req->get_parameter('omb_listenee_bio'); if ($bio && strlen($bio) > 140) { - $this->client_error(_("Bio is too long (max 140 chars).")); + $this->clientError(_("Bio is too long (max 140 chars).")); return false; } $location = $req->get_parameter('omb_listenee_location'); if ($location && strlen($location) > 255) { - $this->client_error(_("Location is too long (max 255 chars).")); + $this->clientError(_("Location is too long (max 255 chars).")); return false; } $avatar = $req->get_parameter('omb_listenee_avatar'); if ($avatar) { if (!common_valid_http_url($avatar) || strlen($avatar) > 255) { - $this->client_error(sprintf(_("Invalid avatar URL '%s'"), $avatar)); + $this->clientError(sprintf(_("Invalid avatar URL '%s'"), $avatar)); return false; } $size = @getimagesize($avatar); if (!$size) { - $this->client_error(sprintf(_("Can't read avatar URL '%s'"), $avatar)); + $this->clientError(sprintf(_("Can't read avatar URL '%s'"), $avatar)); return false; } if ($size[0] != AVATAR_PROFILE_SIZE || $size[1] != AVATAR_PROFILE_SIZE) { - $this->client_error(sprintf(_("Wrong size image at '%s'"), $avatar)); + $this->clientError(sprintf(_("Wrong size image at '%s'"), $avatar)); return false; } if (!in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG))) { - $this->client_error(sprintf(_("Wrong image type for '%s'"), $avatar)); + $this->clientError(sprintf(_("Wrong image type for '%s'"), $avatar)); return false; } } @@ -156,14 +156,14 @@ class UpdateprofileAction extends Action } if (!$profile->update($orig_profile)) { - $this->server_error(_('Could not save new profile info'), 500); + $this->serverError(_('Could not save new profile info'), 500); return false; } else { if ($avatar) { $temp_filename = tempnam(sys_get_temp_dir(), 'listenee_avatar'); copy($avatar, $temp_filename); if (!$profile->setOriginal($temp_filename)) { - $this->server_error(_('Could not save avatar info'), 500); + $this->serverError(_('Could not save avatar info'), 500); return false; } } diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 196fae9ad..838458932 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -54,7 +54,7 @@ class UserauthorizationAction extends Action common_debug('getting new request', __FILE__); $req = $this->get_new_request(); if (!$req) { - $this->client_error(_('No request found!')); + $this->clientError(_('No request found!')); } common_debug('validating request', __FILE__); # XXX: only validate new requests, since nonce is one-time use @@ -64,7 +64,7 @@ class UserauthorizationAction extends Action $this->show_form($req); } catch (OAuthException $e) { $this->clear_request(); - $this->client_error($e->getMessage()); + $this->clientError($e->getMessage()); return; } @@ -137,7 +137,7 @@ class UserauthorizationAction extends Action $req = $this->get_stored_request(); if (!$req) { - common_user_error(_('No authorization request!')); + $this->clientError(_('No authorization request!')); return; } @@ -145,10 +145,10 @@ class UserauthorizationAction extends Action if ($this->arg('accept')) { if (!$this->authorize_token($req)) { - $this->client_error(_('Error authorizing token')); + $this->clientError(_('Error authorizing token')); } if (!$this->save_remote_profile($req)) { - $this->client_error(_('Error saving remote profile')); + $this->clientError(_('Error saving remote profile')); } if (!$callback) { $this->show_accept_message($req->get_parameter('oauth_token')); @@ -160,7 +160,7 @@ class UserauthorizationAction extends Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return; } $params['omb_listener_nickname'] = $user->nickname; diff --git a/actions/userbyid.php b/actions/userbyid.php index d57ed21a5..3ff2c9c41 100644 --- a/actions/userbyid.php +++ b/actions/userbyid.php @@ -32,11 +32,11 @@ class UserbyidAction extends Action parent::handle($args); $id = $this->trimmed('id'); if (!$id) { - $this->client_error(_('No id.')); + $this->clientError(_('No id.')); } $user =& User::staticGet($id); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); } // support redirecting to FOAF rdf/xml if the agent prefers it diff --git a/actions/userrss.php b/actions/userrss.php index 1e9fe121f..d14fc523e 100644 --- a/actions/userrss.php +++ b/actions/userrss.php @@ -34,7 +34,7 @@ class UserrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; @@ -78,7 +78,7 @@ class UserrssAction extends Rss10Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return null; } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); diff --git a/actions/xrds.php b/actions/xrds.php index 9c51f1dd2..7cb2cd210 100644 --- a/actions/xrds.php +++ b/actions/xrds.php @@ -35,7 +35,7 @@ class XrdsAction extends Action $nickname = $this->trimmed('nickname'); $user = User::staticGet('nickname', $nickname); if (!$user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $this->show_xrds($user); diff --git a/lib/action.php b/lib/action.php index d02a1b709..207be3c82 100644 --- a/lib/action.php +++ b/lib/action.php @@ -529,14 +529,14 @@ class Action extends HTMLOutputter // lawsuit } } - function server_error($msg, $code=500) + function serverError($msg, $code=500) { $action = $this->trimmed('action'); common_debug("Server error '$code' on '$action': $msg", __FILE__); common_server_error($msg, $code); } - function client_error($msg, $code=400) + function clientError($msg, $code=400) { $action = $this->trimmed('action'); common_debug("User error '$code' on '$action': $msg", __FILE__); -- cgit v1.2.3-54-g00ecf From b635b6de04073e7b2876801a5f335cc1a80fb084 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 19 Jan 2009 15:28:27 +0000 Subject: Update showfavorites --- actions/showfavorites.php | 199 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 150 insertions(+), 49 deletions(-) (limited to 'actions/showfavorites.php') diff --git a/actions/showfavorites.php b/actions/showfavorites.php index caa823893..d2c91c025 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -1,9 +1,12 @@ . + * + * @category Personal + * @package Laconica + * @author Evan Prodromou + * @copyright 2008-2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('LACONICA')) { + exit(1); +} -require_once(INSTALLDIR.'/actions/showstream.php'); +require_once INSTALLDIR.'/lib/personalgroupnav.php'; +require_once INSTALLDIR.'/lib/noticelist.php'; +require_once INSTALLDIR.'/lib/feedlist.php'; -class ShowfavoritesAction extends StreamAction -{ +/** + * List of replies + * + * @category Personal + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ - function handle($args) +class ShowfavoritesAction extends Action +{ + /** User we're getting the faves of */ + var $user = null; + /** Page of the faves we're on */ + var $page = null; + + /** + * Title of the page + * + * Includes name of user and page number. + * + * @return string title of page + */ + + function title() { + if ($this->page == 1) { + return sprintf(_("%s favorite notices"), $this->user->nickname); + } else { + return sprintf(_("%s favorite notices, page %d"), + $this->user->nickname, + $this->page); + } + } - parent::handle($args); + /** + * Prepare the object + * + * Check the input values and initialize the object. + * Shows an error page on bad input. + * + * @param array $args $_REQUEST data + * + * @return boolean success flag + */ + + function prepare($args) + { + parent::prepare($args); $nickname = common_canonical_nickname($this->arg('nickname')); - $user = User::staticGet('nickname', $nickname); - if (!$user) { + $this->user = User::staticGet('nickname', $nickname); + + if (!$this->user) { $this->clientError(_('No such user.')); - return; + return false; } - $profile = $user->getProfile(); + $this->page = $this->trimmed('page'); - if (!$profile) { - $this->serverError(_('User has no profile.')); - return; + if (!$this->page) { + $this->page = 1; } - # Looks like we're good; show the header - - common_show_header(sprintf(_("%s favorite notices"), $profile->nickname), - array($this, 'show_header'), $user, - array($this, 'show_top')); + return true; + } - $this->show_notices($user); + /** + * Handle a request + * + * Just show the page. All args already handled. + * + * @param array $args $_REQUEST data + * + * @return void + */ - common_show_footer(); + function handle($args) + { + parent::handle($args); + $this->showPage(); } - function show_header($user) + /** + * Feeds for the section + * + * @return void + */ + + function showFeeds() { + $feedurl = common_local_url('favoritesrss', + array('nickname' => + $this->user->nickname)); + $feedtitle = sprintf(_('Feed for favorites of %s'), + $this->user->nickname); + $this->element('link', array('rel' => 'alternate', - 'href' => common_local_url('favoritesrss', array('nickname' => - $user->nickname)), + 'href' => $feedurl, 'type' => 'application/rss+xml', - 'title' => sprintf(_('Feed for favorites of %s'), $user->nickname))); + 'title' => $feedtitle)); } - function show_top($user) - { - $cur = common_current_user(); - - if ($cur && $cur->id == $user->id) { - common_notice_form('all'); - } + /** + * show the personal group nav + * + * @return void + */ - $this->show_feeds_list(array(0=>array('href'=>common_local_url('favoritesrss', array('nickname' => $user->nickname)), - 'type' => 'rss', - 'version' => 'RSS 1.0', - 'item' => 'Favorites'))); - $this->views_menu(); + function showLocalNav() + { + $nav = new PersonalGroupNav($this); + $nav->show(); } - function show_notices($user) + /** + * Show the replies feed links + * + * @return void + */ + + function showExportData() { + $feedurl = common_local_url('favoritesrss', + array('nickname' => + $this->user->nickname)); - $page = $this->trimmed('page'); - if (!$page) { - $page = 1; - } + $fl = new FeedList($this); + + // XXX: I18N + + $fl->show(array(0=>array('href'=> $feedurl, + 'type' => 'rss', + 'version' => 'RSS 1.0', + 'item' => 'Favorites'))); + } + + /** + * Show the content + * + * A list of notices that this user has marked as a favorite + * + * @return void + */ - $notice = $user->favoriteNotices(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); + function showContent() + { + $notice = $this->user->favoriteNotices(($this->page-1)*NOTICES_PER_PAGE, + NOTICES_PER_PAGE + 1); if (!$notice) { $this->serverError(_('Could not retrieve favorite notices.')); return; } - $cnt = $this->show_notice_list($notice); + $nl = new NoticeList($notice, $this); + + $cnt = $nl->show(); - common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, - $page, 'showfavorites', array('nickname' => $user->nickname)); + $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, + $this->page, 'showfavorites', + array('nickname' => $this->user->nickname)); } } -- cgit v1.2.3-54-g00ecf From 7c0286bfcc64525b85cafb68434f0689c03519bc Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 19 Jan 2009 18:10:20 +0000 Subject: Favorites is readonly --- actions/showfavorites.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'actions/showfavorites.php') diff --git a/actions/showfavorites.php b/actions/showfavorites.php index d2c91c025..bb68f8d94 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -52,6 +52,17 @@ class ShowfavoritesAction extends Action /** Page of the faves we're on */ var $page = null; + /** + * Is this a read-only page? + * + * @return boolean true + */ + + function isReadOnly() + { + return true; + } + /** * Title of the page * -- cgit v1.2.3-54-g00ecf