summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/helpers/comment.php7
-rw-r--r--modules/tag/hooks/photo_created.php2
-rw-r--r--modules/user/controllers/logout.php1
-rw-r--r--modules/user/helpers/user.php4
4 files changed, 11 insertions, 3 deletions
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index 099a3833..8bbb68d6 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -31,7 +31,7 @@ class comment_Core {
const SECONDS_IN_A_YEAR = 31556926;
/**
- * Create a new photo.
+ * Create a new comment.
* @param string $author author's name
* @param string $email author's email
* @param string $text comment body
@@ -51,7 +51,10 @@ class comment_Core {
$comment->datetime = $datetime;
$comment->item_id = $item_id;
- return $comment->save();
+ $comment->save();
+ Event::run("gallery.comment.created", $comment);
+
+ return $comment;
}
static function get_add_form($item_id) {
diff --git a/modules/tag/hooks/photo_created.php b/modules/tag/hooks/photo_created.php
index 8f6cbab6..8d033317 100644
--- a/modules/tag/hooks/photo_created.php
+++ b/modules/tag/hooks/photo_created.php
@@ -1,2 +1,2 @@
<?php defined('SYSPATH') or die('No direct script access.');
-Event::add("gallery.photo_created", array('tag', 'on_photo_create'));
+Event::add("gallery.photo.created", array('tag', 'on_photo_create'));
diff --git a/modules/user/controllers/logout.php b/modules/user/controllers/logout.php
index 524c79f8..c9ad1b6a 100644
--- a/modules/user/controllers/logout.php
+++ b/modules/user/controllers/logout.php
@@ -21,6 +21,7 @@ class Logout_Controller extends Controller {
public function index() {
try {
Session::instance()->destroy();
+ Event::run("gallery.user.logout", $user);
} catch (Exception $e) {
Kohana::log("error", $e);
}
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php
index e035a7fb..0133a153 100644
--- a/modules/user/helpers/user.php
+++ b/modules/user/helpers/user.php
@@ -81,6 +81,8 @@ class user_Core {
group::add_user(group::REGISTERED_USERS, $user->id);
+ Event::run("gallery.user.created", $user);
+
return $user;
}
@@ -91,6 +93,7 @@ class user_Core {
*/
static function delete($id) {
ORM::factory("user", $id)->delete();
+ Event::run("gallery.user.deleted", $user);
}
/**
@@ -146,6 +149,7 @@ class user_Core {
$user->save();
Session::instance()->set('user', $user);
+ Event::run("gallery.user.login", $user);
}
/**