Skip to content

Commit

Permalink
addign event to get related urls direct to the comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jan 23, 2013
1 parent c7e7a31 commit 7561b07
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Core/Comments/Lib/CommentsEvents.php
Expand Up @@ -148,7 +148,7 @@ public function onUserProfile(Event $Event, array $user) {

/**
* When a new comment is made send out all the emails
*
*
* @param Event $Event
* @param array $comment
*/
Expand Down Expand Up @@ -189,4 +189,17 @@ public function onNewCommentSaved(Event $Event, array $comment) {
));
}
}

public function onSlugUrl(Event $Event, array $data) {
if (!empty($data['data']['id'])) {
$url = ClassRegistry::init('Comments.InfinitasComment')->find('urlData', $data['data']['id']);
$data = current(EventCore::trigger($Event->Handler, $url['plugin'] . '.slugUrl', $url['data']));

$data[$url['plugin']]['#'] = $url['id'];
$data[$url['plugin']][] = $data[$url['plugin']]['id'];
unset($data[$url['plugin']]['id']);
return $data[$url['plugin']];
}
return array();
}
}

0 comments on commit 7561b07

Please sign in to comment.