4 * SVNCommitEmailPlugin Class
7 * This file is part of GForge.
9 * GForge 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 * GForge 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
20 * along with GForge; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 class SVNCommitEmailPlugin extends Plugin {
26 function SVNCommitEmailPlugin () {
28 $this->name = "svncommitemail" ;
29 $this->text = "svncommitemail" ;
30 $this->hooks[] = "groupisactivecheckbox" ; // The "use ..." checkbox in editgroupinfo
31 $this->hooks[] = "groupisactivecheckboxpost" ; //
34 function CallHook ($hookname, $params) {
35 global $use_svncommitemailplugin,$G_SESSION,$HTML;
36 $group_id=$params['group'];
37 if ($hookname == "groupisactivecheckbox") {
38 //Check if the group is active
39 // this code creates the checkbox in the project edit public info page to activate/deactivate the plugin
40 $group = &group_get_object($group_id);
41 if ($group->usesPlugin('scmsvn')) {
44 echo ' <input type="CHECKBOX" name="use_svncommitemailplugin" 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_svncommitemailplugin = getStringFromRequest('use_svncommitemailplugin');
60 if ( $use_svncommitemailplugin == 1 ) {
61 $group->setPluginUse ( $this->name );
63 $group->setPluginUse ( $this->name, false );
71 // c-file-style: "bsd"