3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2010, StatusNet, Inc.
6 * Sends an email summary of the inbox to users in the network
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 * @author Evan Prodromou <evan@status.net>
26 * @copyright 2010 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET')) {
36 * Plugin for sending email summaries to users
40 * @author Brion Vibber <brionv@status.net>
41 * @author Evan Prodromou <evan@status.net>
42 * @copyright 2010 StatusNet, Inc.
43 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
44 * @link http://status.net/
47 class EmailSummaryPlugin extends Plugin
50 * Database schema setup
52 * @return boolean hook value
55 function onCheckSchema()
57 $schema = Schema::get();
59 // For storing user-submitted flags on profiles
61 $schema->ensureTable('email_summary_status',
62 array(new ColumnDef('user_id', 'integer', null,
64 new ColumnDef('send_summary', 'tinyint', null,
66 new ColumnDef('last_summary', 'datetime', null,
68 new ColumnDef('created', 'datetime', null,
70 new ColumnDef('modified', 'datetime', null,
78 * Load related modules when needed
80 * @param string $cls Name of the class to be loaded
82 * @return boolean hook value; true means continue processing, false means stop.
86 function onAutoload($cls)
88 $dir = dirname(__FILE__);
92 case 'Email_summary_status':
93 include_once $dir . '/'.$cls.'.php';
101 * Version info for this plugin
103 * @param array &$versions array of version data
105 * @return boolean hook value; true means continue processing, false means stop.
109 function onPluginVersion(&$versions)
111 $versions[] = array('name' => 'EmailSummary',
112 'version' => STATUSNET_VERSION,
113 'author' => 'Evan Prodromou',
114 'homepage' => 'http://status.net/wiki/Plugin:EmailSummary',
116 _m('Send an email summary of the inbox to users.'));