pyrocms/pyrocms — pull request #1099 by obrignoni (2012-01-25 20:58:13+00:00)
Title: Feature/extra triggers

@philsturgeon, @adamfairholm

As we agreed, I am sending this to 2.1/develop

Also, I updated the "create" triggers to pass the id of the inserted data where applicable.

Reminder: For this to work, the corresponding models need to be fixed to return the id.

I suggest that we set a standard for naming triggers. It might be very more intuitive for developers to find triggers beginning with the name of the module.

We can revisit this later when we have time.

Copy / pasting some notes for future reference...

This time I tried following these rules when placing triggers:
1. Use simple and meaningful names
2. Place them where success has been checked
3. Repeat a trigger in places where it is relevant. (like modules)
4. For a create, update and delete operations, pass the inserted ids.

The list of new triggers:

blog_article_deleted
blog_category_created
blog_category_updated
blog_category_deleted

comment_updated
comment_deleted
comment_unapproved

file_uploaded
file_updated
file_deleted
file_folder_created
file_folder_updated
file_folder_deleted

group_created
group_updated
group_deleted

keyword_created
keyword_updated
keyword_deleted

module_enabled
module_disabled

navigation_group_created
navigation_group_deleted

permissions_saved

settings_updated

email_template_created
email_template_updated
email_template_deleted

theme_options_updated
theme_set_default
theme_deleted

user_created
user_updated
user_deleted

widget_enabled
widget_disabled
widget_area_created
widget_area_updated
widget_area_deleted
widget_instance_created
widget_instance_updated
widget_instance_deleted