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 --- lib/common.php | 162 +++--- lib/deleteaction.php | 74 +-- lib/facebookaction.php | 516 +++++++++---------- lib/oauthstore.php | 218 ++++----- lib/omb.php | 378 +++++++------- lib/openid.php | 316 ++++++------ lib/personal.php | 366 +++++++------- lib/profilelist.php | 260 +++++----- lib/queuehandler.php | 194 ++++---- lib/rssaction.php | 322 ++++++------ lib/search_engines.php | 4 +- lib/searchaction.php | 154 +++--- lib/settingsaction.php | 100 ++-- lib/stream.php | 34 +- lib/subs.php | 122 ++--- lib/theme.php | 18 +- lib/twitter.php | 216 ++++---- lib/twitterapi.php | 1224 +++++++++++++++++++++++----------------------- lib/xmppqueuehandler.php | 112 ++--- 19 files changed, 2395 insertions(+), 2395 deletions(-) (limited to 'lib') diff --git a/lib/common.php b/lib/common.php index 5a28c3091..95ba64d0f 100644 --- a/lib/common.php +++ b/lib/common.php @@ -54,100 +54,100 @@ require_once(INSTALLDIR.'/lib/language.php'); $config = array('site' => - array('name' => 'Just another Laconica microblog', - 'server' => 'localhost', - 'theme' => 'default', - 'path' => '/', - 'logfile' => NULL, - 'fancy' => false, - 'locale_path' => INSTALLDIR.'/locale', - 'language' => 'en_US', - 'languages' => get_all_languages(), - 'email' => - array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : NULL, - 'broughtby' => NULL, - 'timezone' => 'UTC', - 'broughtbyurl' => NULL, - 'closed' => false, - 'inviteonly' => false, + array('name' => 'Just another Laconica microblog', + 'server' => 'localhost', + 'theme' => 'default', + 'path' => '/', + 'logfile' => NULL, + 'fancy' => false, + 'locale_path' => INSTALLDIR.'/locale', + 'language' => 'en_US', + 'languages' => get_all_languages(), + 'email' => + array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : NULL, + 'broughtby' => NULL, + 'timezone' => 'UTC', + 'broughtbyurl' => NULL, + 'closed' => false, + 'inviteonly' => false, 'private' => false), - 'syslog' => - array('appname' => 'laconica', # for syslog - 'priority' => 'debug'), # XXX: currently ignored - 'queue' => - array('enabled' => false), - 'license' => - array('url' => 'http://creativecommons.org/licenses/by/3.0/', - 'title' => 'Creative Commons Attribution 3.0', - 'image' => 'http://i.creativecommons.org/l/by/3.0/88x31.png'), - 'mail' => - array('backend' => 'mail', - 'params' => NULL), - 'nickname' => - array('blacklist' => array(), - 'featured' => array()), - 'profile' => - array('banned' => array()), - 'avatar' => - array('server' => NULL), - 'public' => - array('localonly' => true, - 'blacklist' => array()), - 'theme' => - array('server' => NULL), - 'throttle' => + 'syslog' => + array('appname' => 'laconica', # for syslog + 'priority' => 'debug'), # XXX: currently ignored + 'queue' => + array('enabled' => false), + 'license' => + array('url' => 'http://creativecommons.org/licenses/by/3.0/', + 'title' => 'Creative Commons Attribution 3.0', + 'image' => 'http://i.creativecommons.org/l/by/3.0/88x31.png'), + 'mail' => + array('backend' => 'mail', + 'params' => NULL), + 'nickname' => + array('blacklist' => array(), + 'featured' => array()), + 'profile' => + array('banned' => array()), + 'avatar' => + array('server' => NULL), + 'public' => + array('localonly' => true, + 'blacklist' => array()), + 'theme' => + array('server' => NULL), + 'throttle' => array('enabled' => false, // whether to throttle edits; false by default 'count' => 20, // number of allowed messages in timespan 'timespan' => 600), // timespan for throttling - 'xmpp' => - array('enabled' => false, - 'server' => 'INVALID SERVER', - 'port' => 5222, - 'user' => 'update', - 'encryption' => true, - 'resource' => 'uniquename', - 'password' => 'blahblahblah', - 'host' => NULL, # only set if != server - 'debug' => false, # print extra debug info - 'public' => array()), # JIDs of users who want to receive the public stream + 'xmpp' => + array('enabled' => false, + 'server' => 'INVALID SERVER', + 'port' => 5222, + 'user' => 'update', + 'encryption' => true, + 'resource' => 'uniquename', + 'password' => 'blahblahblah', + 'host' => NULL, # only set if != server + 'debug' => false, # print extra debug info + 'public' => array()), # JIDs of users who want to receive the public stream 'sphinx' => array('enabled' => false, 'server' => 'localhost', 'port' => 3312), - 'tag' => - array('dropoff' => 864000.0), - 'popular' => - array('dropoff' => 864000.0), - 'daemon' => - array('piddir' => '/var/run', - 'user' => false, - 'group' => false), - 'integration' => - array('source' => 'Laconica'), # source attribute for Twitter - 'memcached' => - array('enabled' => false, - 'server' => 'localhost', - 'port' => 11211), - 'inboxes' => - array('enabled' => true), # on by default for new sites - ); + 'tag' => + array('dropoff' => 864000.0), + 'popular' => + array('dropoff' => 864000.0), + 'daemon' => + array('piddir' => '/var/run', + 'user' => false, + 'group' => false), + 'integration' => + array('source' => 'Laconica'), # source attribute for Twitter + 'memcached' => + array('enabled' => false, + 'server' => 'localhost', + 'port' => 11211), + 'inboxes' => + array('enabled' => true), # on by default for new sites + ); $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options'); $config['db'] = array('database' => 'YOU HAVE TO SET THIS IN config.php', - 'schema_location' => INSTALLDIR . '/classes', - 'class_location' => INSTALLDIR . '/classes', - 'require_prefix' => 'classes/', - 'class_prefix' => '', - 'mirror' => NULL, + 'schema_location' => INSTALLDIR . '/classes', + 'class_location' => INSTALLDIR . '/classes', + 'require_prefix' => 'classes/', + 'class_prefix' => '', + 'mirror' => NULL, 'db_driver' => 'DB', # XXX: JanRain libs only work with DB - 'quote_identifiers' => false, - 'type' => 'mysql' ); + 'quote_identifiers' => false, + 'type' => 'mysql' ); if (function_exists('date_default_timezone_set')) { - /* Work internally in UTC */ - date_default_timezone_set('UTC'); + /* Work internally in UTC */ + date_default_timezone_set('UTC'); } require_once(INSTALLDIR.'/config.php'); @@ -164,9 +164,9 @@ require_once(INSTALLDIR.'/lib/Shorturl_api.php'); require_once(INSTALLDIR.'/lib/twitter.php'); function __autoload($class) { - if ($class == 'OAuthRequest') { - require_once('OAuth.php'); - } else if (file_exists(INSTALLDIR.'/classes/' . $class . '.php')) { + if ($class == 'OAuthRequest') { + require_once('OAuth.php'); + } else if (file_exists(INSTALLDIR.'/classes/' . $class . '.php')) { require_once(INSTALLDIR.'/classes/' . $class . '.php'); } } diff --git a/lib/deleteaction.php b/lib/deleteaction.php index 5ba0e7e44..335070cc4 100644 --- a/lib/deleteaction.php +++ b/lib/deleteaction.php @@ -21,41 +21,41 @@ if (!defined('LACONICA')) { exit(1); } class DeleteAction extends Action { - function handle($args) { - parent::handle($args); - $user = common_current_user(); - $notice_id = $this->trimmed('notice'); - $notice = Notice::staticGet($notice_id); - if (!$notice) { - common_user_error(_('No such notice.')); - exit; - } - - $profile = $notice->getProfile(); - $user_profile = $user->getProfile(); - - if (!common_logged_in()) { - common_user_error(_('Not logged in.')); - exit; - } else if ($notice->profile_id != $user_profile->id) { - common_user_error(_('Can\'t delete this notice.')); - exit; - } - } - - function show_top($arr=NULL) { - $instr = $this->get_instructions(); - $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); - } - - function get_title() { - return NULL; - } - - function show_header() { - return; - } + function handle($args) { + parent::handle($args); + $user = common_current_user(); + $notice_id = $this->trimmed('notice'); + $notice = Notice::staticGet($notice_id); + if (!$notice) { + common_user_error(_('No such notice.')); + exit; + } + + $profile = $notice->getProfile(); + $user_profile = $user->getProfile(); + + if (!common_logged_in()) { + common_user_error(_('Not logged in.')); + exit; + } else if ($notice->profile_id != $user_profile->id) { + common_user_error(_('Can\'t delete this notice.')); + exit; + } + } + + function show_top($arr=NULL) { + $instr = $this->get_instructions(); + $output = common_markup_to_html($instr); + common_element_start('div', 'instructions'); + common_raw($output); + common_element_end('div'); + } + + function get_title() { + return NULL; + } + + function show_header() { + return; + } } diff --git a/lib/facebookaction.php b/lib/facebookaction.php index 87a82ba01..67595861f 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -10,11 +10,11 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ if (!defined('LACONICA')) { exit(1); } @@ -23,261 +23,261 @@ require_once(INSTALLDIR.'/extlib/facebook/facebook.php'); class FacebookAction extends Action { - function handle($args) { - parent::handle($args); - } - - 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) { - - $notice = $user->getCurrentNotice(); - - # Need to include inline CSS for styling the Profile box - - $style = ''; - - $html = $this->render_notice($notice); - - $fbml = "$content $html"; - $fbml .= "$content $html"; - - $fbml_main = "$content $html"; - - $facebook->api_client->profile_setFBML(NULL, $fbuid, $fbml, NULL, NULL, $fbml_main); - } - - # Display methods - - 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')); - $cssurl = theme_path('facebookapp.css') . "?ts=$ts"; - - $header = ''; - # $header .=''; - $header .= ''; - - $header .= - '' - .'' - .'' - .'' - .''; - $header .= '
'; - - echo $header; - - } - - function show_footer() { - $footer = '
'; - echo $footer; - } - - function show_login_form() { - - $loginform = - '

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

' - .'' - .' ' - .'' - .'

Login

' - .'
' - .'

Login with your username and password. Don\'t have a username yet?' - .' Register a new account.' - .'

' - .'
' - .'
' - .'
' - .'

' - .' ' - .' ' - .'

' - .'

' - .' ' - .' ' - .'

' - .'

' - .' ' - .'

' - .'
' - .'

' - .' Lost or forgotten password?' - .'

' - .'getProfile(); - $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); - - $noticeurl = common_local_url('shownotice', array('notice' => $notice->id)); - - # XXX: we need to figure this out better. Is this right? - if (strcmp($notice->uri, $noticeurl) != 0 && preg_match('/^http/', $notice->uri)) { - $noticeurl = $notice->uri; - } - - $html = - '
  • ' - .'' - .'';
-
-		if ($profile->fullname) {
-			$html .= $profile->fullname;
-		} else {
-			$html .= $profile->nickname;
-		}
-
-		$html .=
-		'' - .'' . $profile->nickname . '' - .'

    ' . $notice->rendered . '

    ' - .'

    ' - .''; - - if ($notice->source) { - $html .= _(' from '); - $html .= $this->source_link($notice->source); - } - - if ($notice->reply_to) { - $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); - $html .= - ' (' . _('in reply to...') . ')'; - } - - $html .= '

  • '; - - return $html; - } - - function source_link($source) { - $source_name = _($source); - - $html = ''; - - switch ($source) { - case 'web': - case 'xmpp': - case 'mail': - case 'omb': - case 'api': - $html .= $source_name; - break; - default: - $ns = Notice_source::staticGet($source); - if ($ns) { - $html .= '' . $ns->name . ''; - } else { - $html .= $source_name; - } - break; - } - - $html .= ''; - - return $html; - } - - function pagination($have_before, $have_after, $page, $fbaction, $args=NULL) { - - $html = ''; - - if ($have_before || $have_after) { - $html = '