fix indentation in EmailSummaryPlugin.php
This commit is contained in:
parent
128bfd7011
commit
59afc4aa56
@ -62,15 +62,15 @@ class EmailSummaryPlugin extends Plugin
|
|||||||
array(new ColumnDef('user_id', 'integer', null,
|
array(new ColumnDef('user_id', 'integer', null,
|
||||||
false, 'PRI'),
|
false, 'PRI'),
|
||||||
new ColumnDef('send_summary', 'tinyint', null,
|
new ColumnDef('send_summary', 'tinyint', null,
|
||||||
false, null, 1),
|
false, null, 1),
|
||||||
new ColumnDef('last_summary_id', 'integer', null,
|
new ColumnDef('last_summary_id', 'integer', null,
|
||||||
true),
|
true),
|
||||||
new ColumnDef('created', 'datetime', null,
|
new ColumnDef('created', 'datetime', null,
|
||||||
false),
|
false),
|
||||||
new ColumnDef('modified', 'datetime', null,
|
new ColumnDef('modified', 'datetime', null,
|
||||||
false),
|
false),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,17 +88,17 @@ class EmailSummaryPlugin extends Plugin
|
|||||||
$dir = dirname(__FILE__);
|
$dir = dirname(__FILE__);
|
||||||
|
|
||||||
switch ($cls)
|
switch ($cls)
|
||||||
{
|
{
|
||||||
case 'SiteEmailSummaryHandler':
|
case 'SiteEmailSummaryHandler':
|
||||||
case 'UserEmailSummaryHandler':
|
case 'UserEmailSummaryHandler':
|
||||||
include_once $dir . '/'.strtolower($cls).'.php';
|
include_once $dir . '/'.strtolower($cls).'.php';
|
||||||
return false;
|
|
||||||
case 'Email_summary_status':
|
|
||||||
include_once $dir . '/'.$cls.'.php';
|
|
||||||
return false;
|
return false;
|
||||||
default:
|
case 'Email_summary_status':
|
||||||
return true;
|
include_once $dir . '/'.$cls.'.php';
|
||||||
}
|
return false;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -131,9 +131,9 @@ class EmailSummaryPlugin extends Plugin
|
|||||||
|
|
||||||
function onEndInitializeQueueManager($qm)
|
function onEndInitializeQueueManager($qm)
|
||||||
{
|
{
|
||||||
$qm->connect('sitesum', 'SiteEmailSummaryHandler');
|
$qm->connect('sitesum', 'SiteEmailSummaryHandler');
|
||||||
$qm->connect('usersum', 'UserEmailSummaryHandler');
|
$qm->connect('usersum', 'UserEmailSummaryHandler');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -146,15 +146,15 @@ class EmailSummaryPlugin extends Plugin
|
|||||||
|
|
||||||
function onEndEmailFormData($action)
|
function onEndEmailFormData($action)
|
||||||
{
|
{
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
$action->elementStart('li');
|
$action->elementStart('li');
|
||||||
$action->checkbox('emailsummary',
|
$action->checkbox('emailsummary',
|
||||||
// TRANS: Checkbox label in e-mail preferences form.
|
// TRANS: Checkbox label in e-mail preferences form.
|
||||||
_('Send me a periodic summary of updates from my network.'),
|
_('Send me a periodic summary of updates from my network.'),
|
||||||
Email_summary_status::getSendSummary($user->id));
|
Email_summary_status::getSendSummary($user->id));
|
||||||
$action->elementEnd('li');
|
$action->elementEnd('li');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -167,36 +167,36 @@ class EmailSummaryPlugin extends Plugin
|
|||||||
|
|
||||||
function onEndEmailSaveForm($action)
|
function onEndEmailSaveForm($action)
|
||||||
{
|
{
|
||||||
$sendSummary = $action->boolean('emailsummary');
|
$sendSummary = $action->boolean('emailsummary');
|
||||||
|
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
if (!empty($user)) {
|
if (!empty($user)) {
|
||||||
|
|
||||||
$ess = Email_summary_status::staticGet('user_id', $user->id);
|
$ess = Email_summary_status::staticGet('user_id', $user->id);
|
||||||
|
|
||||||
if (empty($ess)) {
|
if (empty($ess)) {
|
||||||
|
|
||||||
$ess = new Email_summary_status();
|
$ess = new Email_summary_status();
|
||||||
|
|
||||||
$ess->user_id = $user->id;
|
$ess->user_id = $user->id;
|
||||||
$ess->send_summary = $sendSummary;
|
$ess->send_summary = $sendSummary;
|
||||||
$ess->created = common_sql_now();
|
$ess->created = common_sql_now();
|
||||||
$ess->modified = common_sql_now();
|
$ess->modified = common_sql_now();
|
||||||
|
|
||||||
$ess->insert();
|
$ess->insert();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$orig = clone($ess);
|
$orig = clone($ess);
|
||||||
|
|
||||||
$ess->send_summary = $sendSummary;
|
$ess->send_summary = $sendSummary;
|
||||||
$ess->modified = common_sql_now();
|
$ess->modified = common_sql_now();
|
||||||
|
|
||||||
$ess->update($orig);
|
$ess->update($orig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user