summaryrefslogtreecommitdiffstats
path: root/extensions/Example/Extension.pm
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Example/Extension.pm')
-rw-r--r--extensions/Example/Extension.pm45
1 files changed, 45 insertions, 0 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm
index c0e44aa59..1a483ad53 100644
--- a/extensions/Example/Extension.pm
+++ b/extensions/Example/Extension.pm
@@ -246,6 +246,51 @@ sub flag_end_of_update {
# warn $result;
}
+sub group_before_delete {
+ my ($self, $args) = @_;
+ # This code doesn't actually *do* anything, it's just here to show you
+ # how to use this hook.
+
+ my $group = $args->{'group'};
+ my $group_id = $group->id;
+ # Uncomment this line to see a line in your webserver's error log whenever
+ # you file a bug.
+ # warn "Group $group_id is about to be deleted!";
+}
+
+sub group_end_of_create {
+ my ($self, $args) = @_;
+ # This code doesn't actually *do* anything, it's just here to show you
+ # how to use this hook.
+ my $group = $args->{'group'};
+
+ my $group_id = $group->id;
+ # Uncomment this line to see a line in your webserver's error log whenever
+ # you create a new group.
+ #warn "Group $group_id has been created!";
+}
+
+sub group_end_of_update {
+ my ($self, $args) = @_;
+ # This code doesn't actually *do* anything, it's just here to show you
+ # how to use this hook.
+
+ my ($group, $changes) = @$args{qw(group changes)};
+
+ foreach my $field (keys %$changes) {
+ my $used_to_be = $changes->{$field}->[0];
+ my $now_it_is = $changes->{$field}->[1];
+ }
+
+ my $group_id = $group->id;
+ my $num_changes = scalar keys %$changes;
+ my $result =
+ "There were $num_changes changes to fields on group $group_id.";
+ # Uncomment this line to see $result in your webserver's error log whenever
+ # you update a group.
+ #warn $result;
+}
+
sub install_before_final_checks {
my ($self, $args) = @_;
print "Install-before_final_checks hook\n" unless $args->{silent};