4 * CVSSyncMailPlugin Class
7 * This file is part of FusionForge.
9 * FusionForge is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 class CVSSyncMailPlugin extends Plugin {
26 function CVSSyncMailPlugin () {
28 $this->name = "cvssyncmail" ;
29 $this->text = "CVS->Syncmail" ;
30 $this->hooks[] = "groupisactivecheckbox" ; // The "use ..." checkbox in editgroupinfo
31 $this->hooks[] = "groupisactivecheckboxpost" ; //
34 function CallHook ($hookname, &$params) {
35 global $use_cvssyncmailplugin,$G_SESSION,$HTML;
36 $group_id=$params['group'];
37 if ($hookname == "groupisactivecheckbox") {
38 $group = group_get_object($group_id);
39 if ($group->usesPlugin('scmcvs')) {
40 //Check if the group is active
41 // this code creates the checkbox in the project edit public info page to activate/deactivate the plugin
44 echo ' <input type="checkbox" name="use_cvssyncmailplugin" value="1" ';
45 // checked or unchecked?
46 if ( $group->usesPlugin ( $this->name ) ) {
52 echo "<strong>Use ".$this->text." Plugin</strong>";
56 } elseif ($hookname == "groupisactivecheckboxpost") {
57 // this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page
58 $group = group_get_object($group_id);
59 $use_cvssyncmailplugin = getStringFromRequest('use_cvssyncmailplugin');
60 if ( $use_cvssyncmailplugin == 1 ) {
61 $group->setPluginUse ( $this->name );
63 $group->setPluginUse ( $this->name, false );
71 // c-file-style: "bsd"