Merge commit 'jeff-themovie/0.8.x-subsystems-enabled' into 0.8.x

This commit is contained in:
Craig Andrews 2009-08-06 22:38:06 -04:00
commit 1c3a1360a9
12 changed files with 116 additions and 32 deletions

24
README
View File

@ -1228,6 +1228,30 @@ enabled: Set to true to enable. Default false.
server: a string with the hostname of the sphinx server. server: a string with the hostname of the sphinx server.
port: an integer with the port number of the sphinx server. port: an integer with the port number of the sphinx server.
emailpost
---------
For post-by-email.
enabled: Whether to enable post-by-email. Defaults to true. You will
also need to set up maildaemon.php.
sms
---
For SMS integration.
enabled: Whether to enable SMS integration. Defaults to true. Queues
should also be enabled.
twitter
-------
For Twitter integration
enabled: Whether to enable Twitter integration. Defaults to true.
Queues should also be enabled.
integration integration
----------- -----------

View File

@ -122,7 +122,7 @@ class EmailsettingsAction extends AccountSettingsAction
} }
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
if ($user->email) { if (common_config('emailpost', 'enabled') && $user->email) {
$this->elementStart('fieldset', array('id' => 'settings_email_incoming')); $this->elementStart('fieldset', array('id' => 'settings_email_incoming'));
$this->element('legend',_('Incoming email')); $this->element('legend',_('Incoming email'));
if ($user->incomingemail) { if ($user->incomingemail) {
@ -173,11 +173,13 @@ class EmailsettingsAction extends AccountSettingsAction
_('Allow friends to nudge me and send me an email.'), _('Allow friends to nudge me and send me an email.'),
$user->emailnotifynudge); $user->emailnotifynudge);
$this->elementEnd('li'); $this->elementEnd('li');
if (common_config('emailpost', 'enabled')) {
$this->elementStart('li'); $this->elementStart('li');
$this->checkbox('emailpost', $this->checkbox('emailpost',
_('I want to post notices by email.'), _('I want to post notices by email.'),
$user->emailpost); $user->emailpost);
$this->elementEnd('li'); $this->elementEnd('li');
}
$this->elementStart('li'); $this->elementStart('li');
$this->checkbox('emailmicroid', $this->checkbox('emailmicroid',
_('Publish a MicroID for my email address.'), _('Publish a MicroID for my email address.'),

View File

@ -84,6 +84,12 @@ class ImsettingsAction extends ConnectSettingsAction
function showContent() function showContent()
{ {
if (!common_config('xmpp', 'enabled')) {
$this->element('div', array('class' => 'error'),
_('IM is not available.'));
return;
}
$user = common_current_user(); $user = common_current_user();
$this->elementStart('form', array('method' => 'post', $this->elementStart('form', array('method' => 'post',
'id' => 'form_settings_im', 'id' => 'form_settings_im',

View File

@ -80,6 +80,12 @@ class SmssettingsAction extends ConnectSettingsAction
function showContent() function showContent()
{ {
if (!common_config('sms', 'enabled')) {
$this->element('div', array('class' => 'error'),
_('SMS is not available.'));
return;
}
$user = common_current_user(); $user = common_current_user();
$this->elementStart('form', array('method' => 'post', $this->elementStart('form', array('method' => 'post',

View File

@ -174,14 +174,26 @@ class SubscriptionsListItem extends SubscriptionListItem
return; return;
} }
if (!common_config('xmpp', 'enabled') && !common_config('sms', 'enabled')) {
return;
}
$this->out->elementStart('form', array('id' => 'subedit-' . $this->profile->id, $this->out->elementStart('form', array('id' => 'subedit-' . $this->profile->id,
'method' => 'post', 'method' => 'post',
'class' => 'form_subscription_edit', 'class' => 'form_subscription_edit',
'action' => common_local_url('subedit'))); 'action' => common_local_url('subedit')));
$this->out->hidden('token', common_session_token()); $this->out->hidden('token', common_session_token());
$this->out->hidden('profile', $this->profile->id); $this->out->hidden('profile', $this->profile->id);
if (common_config('xmpp', 'enabled')) {
$this->out->checkbox('jabber', _('Jabber'), $sub->jabber); $this->out->checkbox('jabber', _('Jabber'), $sub->jabber);
} else {
$this->out->hidden('jabber', $sub->jabber);
}
if (common_config('sms', 'enabled')) {
$this->out->checkbox('sms', _('SMS'), $sub->sms); $this->out->checkbox('sms', _('SMS'), $sub->sms);
} else {
$this->out->hidden('sms', $sub->sms);
}
$this->out->submit('save', _('Save')); $this->out->submit('save', _('Save'));
$this->out->elementEnd('form'); $this->out->elementEnd('form');
return; return;

View File

@ -85,6 +85,12 @@ class TwittersettingsAction extends ConnectSettingsAction
function showContent() function showContent()
{ {
if (!common_config('twitter', 'enabled')) {
$this->element('div', array('class' => 'error'),
_('Twitter is not available.'));
return;
}
$user = common_current_user(); $user = common_current_user();
$profile = $user->getProfile(); $profile = $user->getProfile();

View File

@ -164,6 +164,15 @@ $config['sphinx']['port'] = 3312;
// $config['memcached']['server'] = 'localhost'; // $config['memcached']['server'] = 'localhost';
// $config['memcached']['port'] = 11211; // $config['memcached']['port'] = 11211;
// Disable post-by-email
// $config['emailpost']['enabled'] = false;
// Disable SMS
// $config['sms']['enabled'] = false;
// Disable Twitter integration
// $config['twitter']['enabled'] = false;
// Twitter integration source attribute. Note: default is Laconica // Twitter integration source attribute. Note: default is Laconica
// $config['integration']['source'] = 'Laconica'; // $config['integration']['source'] = 'Laconica';

View File

@ -402,6 +402,14 @@ class Action extends HTMLOutputter // lawsuit
function showPrimaryNav() function showPrimaryNav()
{ {
$user = common_current_user(); $user = common_current_user();
$connect = '';
if (common_config('xmpp', 'enabled')) {
$connect = 'imsettings';
} else if (common_config('sms', 'enabled')) {
$connect = 'smssettings';
} else if (common_config('twitter', 'enabled')) {
$connect = 'twittersettings';
}
$this->elementStart('dl', array('id' => 'site_nav_global_primary')); $this->elementStart('dl', array('id' => 'site_nav_global_primary'));
$this->element('dt', null, _('Primary site navigation')); $this->element('dt', null, _('Primary site navigation'));
@ -413,12 +421,9 @@ class Action extends HTMLOutputter // lawsuit
_('Home'), _('Personal profile and friends timeline'), false, 'nav_home'); _('Home'), _('Personal profile and friends timeline'), false, 'nav_home');
$this->menuItem(common_local_url('profilesettings'), $this->menuItem(common_local_url('profilesettings'),
_('Account'), _('Change your email, avatar, password, profile'), false, 'nav_account'); _('Account'), _('Change your email, avatar, password, profile'), false, 'nav_account');
if (common_config('xmpp', 'enabled')) { if ($connect) {
$this->menuItem(common_local_url('imsettings'), $this->menuItem(common_local_url($connect),
_('Connect'), _('Connect to IM, SMS, Twitter'), false, 'nav_connect'); _('Connect'), _('Connect to services'), false, 'nav_connect');
} else {
$this->menuItem(common_local_url('smssettings'),
_('Connect'), _('Connect to SMS, Twitter'), false, 'nav_connect');
} }
if (common_config('invite', 'enabled')) { if (common_config('invite', 'enabled')) {
$this->menuItem(common_local_url('invite'), $this->menuItem(common_local_url('invite'),

View File

@ -183,6 +183,12 @@ $config =
array('piddir' => '/var/run', array('piddir' => '/var/run',
'user' => false, 'user' => false,
'group' => false), 'group' => false),
'emailpost' =>
array('enabled' => true),
'sms' =>
array('enabled' => true),
'twitter' =>
array('enabled' => true),
'twitterbridge' => 'twitterbridge' =>
array('enabled' => false), array('enabled' => false),
'integration' => 'integration' =>

View File

@ -99,25 +99,27 @@ class ConnectSettingsNav extends Widget
function show() function show()
{ {
# action => array('prompt', 'title') # action => array('prompt', 'title')
$menu = $menu = array();
array('imsettings' => if (common_config('xmpp', 'enabled')) {
$menu['imsettings'] =
array(_('IM'), array(_('IM'),
_('Updates by instant messenger (IM)')), _('Updates by instant messenger (IM)'));
'smssettings' => }
if (common_config('sms', 'enabled')) {
$menu['smssettings'] =
array(_('SMS'), array(_('SMS'),
_('Updates by SMS')), _('Updates by SMS'));
'twittersettings' => }
if (common_config('twitter', 'enabled')) {
$menu['twittersettings'] =
array(_('Twitter'), array(_('Twitter'),
_('Twitter integration options'))); _('Twitter integration options'));
}
$action_name = $this->action->trimmed('action'); $action_name = $this->action->trimmed('action');
$this->action->elementStart('ul', array('class' => 'nav')); $this->action->elementStart('ul', array('class' => 'nav'));
foreach ($menu as $menuaction => $menudesc) { foreach ($menu as $menuaction => $menudesc) {
if ($menuaction == 'imsettings' &&
!common_config('xmpp', 'enabled')) {
continue;
}
$this->action->menuItem(common_local_url($menuaction), $this->action->menuItem(common_local_url($menuaction),
$menudesc[0], $menudesc[0],
$menudesc[1], $menudesc[1],

View File

@ -43,7 +43,11 @@ if(common_config('twitterbridge','enabled')) {
echo "twitterstatusfetcher.php "; echo "twitterstatusfetcher.php ";
} }
echo "ombqueuehandler.php "; echo "ombqueuehandler.php ";
echo "twitterqueuehandler.php "; if (common_config('twitter', 'enabled')) {
echo "twitterqueuehandler.php ";
}
echo "facebookqueuehandler.php "; echo "facebookqueuehandler.php ";
echo "pingqueuehandler.php "; echo "pingqueuehandler.php ";
echo "smsqueuehandler.php "; if (common_config('sms', 'enabled')) {
echo "smsqueuehandler.php ";
}

View File

@ -385,5 +385,7 @@ class MailerDaemon
} }
} }
$md = new MailerDaemon(); if (common_config('emailpost', 'enabled')) {
$md->handle_message('php://stdin'); $md = new MailerDaemon();
$md->handle_message('php://stdin');
}