* @param string $forwarder Optionally, the location to forward to
*
* @link http://docs.elgg.org/Actions
-* @see register_action()
+* @see elgg_register_action()
*
* @return void
*/
*
* Actions should be namedspaced for your plugin. Example:
* <code>
- * register_action('myplugin/save_settings', ...);
+ * elgg_register_action('myplugin/save_settings', ...);
* </code>
*
* @tip Put action files under the actions/ directory of your plugin.
/**
* Initialize some ajaxy actions features
*/
-function actions_init()
-{
- register_action('security/refreshtoken', TRUE);
+function actions_init() {
+ elgg_register_action('security/refreshtoken', '', 'public');
elgg_view_register_simplecache('js/languages/en');
* @return void
*/
function admin_init() {
- register_action('admin/user/ban', FALSE, "", TRUE);
- register_action('admin/user/unban', FALSE, "", TRUE);
- register_action('admin/user/delete', FALSE, "", TRUE);
- register_action('admin/user/resetpassword', FALSE, "", TRUE);
- register_action('admin/user/makeadmin', FALSE, "", TRUE);
- register_action('admin/user/removeadmin', FALSE, "", TRUE);
-
- register_action('admin/site/update_basic', FALSE, "", TRUE);
- register_action('admin/site/update_advanced', FALSE, "", TRUE);
-
- register_action('admin/menu_items', FALSE, "", TRUE);
-
- register_action('admin/plugins/simple_update_states', FALSE, '', TRUE);
+ elgg_register_action('admin/user/ban', '', 'admin');
+ elgg_register_action('admin/user/unban', '', 'admin');
+ elgg_register_action('admin/user/delete', '', 'admin');
+ elgg_register_action('admin/user/resetpassword', '', 'admin');
+ elgg_register_action('admin/user/makeadmin', '', 'admin');
+ elgg_register_action('admin/user/removeadmin', '', 'admin');
+
+ elgg_register_action('admin/site/update_basic', '', 'admin');
+ elgg_register_action('admin/site/update_advanced', '', 'admin');
+
+ elgg_register_action('admin/menu_items', '', 'admin');
+
+ elgg_register_action('admin/plugins/simple_update_states', '', 'admin');
// admin area overview and basic site settings
elgg_add_admin_submenu_item('overview', elgg_echo('admin:overview'));
function elgg_init() {
global $CONFIG;
- register_action('comments/add');
- register_action('comments/delete');
- register_action('likes/add');
- register_action('likes/delete');
+ elgg_register_action('comments/add');
+ elgg_register_action('comments/delete');
+ elgg_register_action('likes/add');
+ elgg_register_action('likes/delete');
register_page_handler('js', 'js_page_handler');
function export_init() {
global $CONFIG;
- register_action("import/opendd", false);
+ elgg_register_action("import/opendd");
}
// Register a startup event
* @return void
*/
function plugin_init() {
- // Now run this stuff, but only once
run_function_once("plugin_run_once");
- // Register some actions
- register_action("plugins/settings/save", false, "", true);
- register_action("plugins/usersettings/save");
-
- register_action('admin/plugins/enable', false, "", true);
- register_action('admin/plugins/disable', false, "", true);
- register_action('admin/plugins/enableall', false, "", true);
- register_action('admin/plugins/disableall', false, "", true);
-
- register_action('admin/plugins/reorder', false, "", true);
+ elgg_register_action("plugins/settings/save", '', 'admin');
+ elgg_register_action("plugins/usersettings/save");
+
+ elgg_register_action('admin/plugins/enable', '', 'admin');
+ elgg_register_action('admin/plugins/disable', '', 'admin');
+ elgg_register_action('admin/plugins/enableall', '', 'admin');
+ elgg_register_action('admin/plugins/disableall', '', 'admin');
+
+ elgg_register_action('admin/plugins/reorder', '', 'admin');
}
-// Register a startup event
elgg_register_event_handler('init', 'system', 'plugin_init');
unset($_SESSION['guid']);
unset($_SESSION['id']);
unset($_SESSION['user']);
-
+
setcookie("elggperm", "", (time() - (86400 * 30)), "/");
// pass along any messages
set_last_action($_SESSION['guid']);
}
- register_action("login", true);
- register_action("logout");
+ elgg_register_action("login", '', 'public');
+ elgg_register_action("logout");
// Register a default PAM handler
register_pam_handler('pam_auth_userpass');
register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler');
register_page_handler('login', 'elgg_user_login_page_handler');
- register_action("register", true);
- register_action("useradd", true);
- register_action("friends/add");
- register_action("friends/remove");
- //register_action('friends/addcollection');
- //register_action('friends/deletecollection');
- //register_action('friends/editcollection');
- //register_action("user/spotlight");
+ elgg_register_action("register", '', 'public');
+ elgg_register_action("useradd", '', 'public');
+ elgg_register_action("friends/add");
+ elgg_register_action("friends/remove");
+ //elgg_register_action('friends/addcollection');
+ //elgg_register_action('friends/deletecollection');
+ //elgg_register_action('friends/editcollection');
+ //elgg_register_action("user/spotlight");
- register_action("usersettings/save");
+ elgg_register_action("usersettings/save");
- register_action("user/passwordreset", TRUE);
- register_action("user/requestnewpassword", TRUE);
+ elgg_register_action("user/passwordreset", '', 'public');
+ elgg_register_action("user/requestnewpassword", '', 'public');
// User name change
extend_elgg_settings_page('user/settings/name', 'usersettings/user', 1);
- //register_action("user/name");
+ //elgg_register_action("user/name");
// User password change
extend_elgg_settings_page('user/settings/password', 'usersettings/user', 1);
- //register_action("user/password");
+ //elgg_register_action("user/password");
// Add email settings
extend_elgg_settings_page('user/settings/email', 'usersettings/user', 1);
- //register_action("email/save");
+ //elgg_register_action("email/save");
// Add language settings
extend_elgg_settings_page('user/settings/language', 'usersettings/user', 1);
// Add default access settings
extend_elgg_settings_page('user/settings/default_access', 'usersettings/user', 1);
- //register_action("user/language");
+ //elgg_register_action("user/language");
// Register the user type
register_entity_type('user', '');
* @return void
*/
function elgg_widgets_init() {
- register_action('widgets/save');
- register_action('widgets/add');
- register_action('widgets/move');
- register_action('widgets/delete');
+ elgg_register_action('widgets/save');
+ elgg_register_action('widgets/add');
+ elgg_register_action('widgets/move');
+ elgg_register_action('widgets/delete');
run_function_once("elgg_widget_run_once");
}
$action_path = dirname(__FILE__) . '/actions/blog';
- register_action('blog/save', FALSE, "$action_path/save.php");
- register_action('blog/auto_save_revision', FALSE, "$action_path/auto_save_revision.php");
- register_action('blog/delete', FALSE, "$action_path/delete.php");
+ elgg_register_action('blog/save', "$action_path/save.php");
+ elgg_register_action('blog/auto_save_revision', "$action_path/auto_save_revision.php");
+ elgg_register_action('blog/delete', "$action_path/delete.php");
// ecml
elgg_register_plugin_hook_handler('get_views', 'ecml', 'blog_ecml_views_hook');
// Register actions
global $CONFIG;
-register_action('bookmarks/add',false,$CONFIG->pluginspath . "bookmarks/actions/add.php");
-register_action('bookmarks/edit',false,$CONFIG->pluginspath . "bookmarks/actions/edit.php");
-register_action('bookmarks/delete',false,$CONFIG->pluginspath . "bookmarks/actions/delete.php");
-register_action('bookmarks/reference',false,$CONFIG->pluginspath . "bookmarks/actions/reference.php");
-register_action('bookmarks/remove',false,$CONFIG->pluginspath . "bookmarks/actions/remove.php");
+elgg_register_action('bookmarks/add', $CONFIG->pluginspath . "bookmarks/actions/add.php");
+elgg_register_action('bookmarks/edit', $CONFIG->pluginspath . "bookmarks/actions/edit.php");
+elgg_register_action('bookmarks/delete', $CONFIG->pluginspath . "bookmarks/actions/delete.php");
+elgg_register_action('bookmarks/reference', $CONFIG->pluginspath . "bookmarks/actions/reference.php");
+elgg_register_action('bookmarks/remove', $CONFIG->pluginspath . "bookmarks/actions/remove.php");
elgg_extend_view('css', 'categories/css');
- register_action('settings/categories/save', FALSE, $CONFIG->pluginspath . 'categories/actions/save.php', TRUE);
+ elgg_register_action('settings/categories/save', $CONFIG->pluginspath . 'categories/actions/save.php', 'admin');
register_page_handler('categories', 'categories_page_handler');
elgg_register_plugin_hook_handler('permissions_check', 'object', 'defaultwidgets_can_edit');
elgg_register_plugin_hook_handler('container_permissions_check', 'user', 'defaultwidgets_can_edit_container');
-register_action("defaultwidgets/update", false, $CONFIG->pluginspath . "defaultwidgets/actions/update.php");
+elgg_register_action("defaultwidgets/update", $CONFIG->pluginspath . "defaultwidgets/actions/update.php");
register_page_handler('diagnostics','diagnostics_page_handler');
// Register some actions
- register_action("diagnostics/download",false, $CONFIG->pluginspath . "diagnostics/actions/download.php");
+ elgg_register_action("diagnostics/download", $CONFIG->pluginspath . "diagnostics/actions/download.php");
}
/**
elgg_extend_view('css', 'ecml/admin/css');
// admin action to save permissions
- register_action('settings/ecml/save', FALSE, dirname(__FILE__) . '/actions/save_permissions.php', TRUE);
+ elgg_register_action('settings/ecml/save', dirname(__FILE__) . '/actions/save_permissions.php', 'admin');
// show ECML-enabled icon on free-text input areas
//elgg_extend_view('input/longtext', 'ecml/input_ext', 0);
elgg_register_event_handler('pagesetup','system','file_submenus');
// Register actions
- register_action("file/upload", false, $CONFIG->pluginspath . "file/actions/upload.php");
- register_action("file/save", false, $CONFIG->pluginspath . "file/actions/save.php");
- register_action("file/delete", false, $CONFIG->pluginspath. "file/actions/delete.php");
+ elgg_register_action("file/upload", $CONFIG->pluginspath . "file/actions/upload.php");
+ elgg_register_action("file/save", $CONFIG->pluginspath . "file/actions/save.php");
+ elgg_register_action("file/delete", $CONFIG->pluginspath. "file/actions/delete.php");
// temporary - see #2010
- register_action("file/download", false, $CONFIG->pluginspath. "file/actions/download.php");
+ elgg_register_action("file/download", $CONFIG->pluginspath. "file/actions/download.php");
?>
register_page_handler('groupicon','groups_icon_handler');
// Register some actions
- register_action("groups/edit",false, $CONFIG->pluginspath . "groups/actions/edit.php");
- register_action("groups/delete",false, $CONFIG->pluginspath . "groups/actions/delete.php");
- register_action("groups/join",false, $CONFIG->pluginspath . "groups/actions/join.php");
- register_action("groups/leave",false, $CONFIG->pluginspath . "groups/actions/leave.php");
- register_action("groups/joinrequest",false, $CONFIG->pluginspath . "groups/actions/joinrequest.php");
- register_action("groups/killrequest",false,$CONFIG->pluginspath . "groups/actions/groupskillrequest.php");
- register_action("groups/killinvitation",false,$CONFIG->pluginspath . "groups/actions/groupskillinvitation.php");
- register_action("groups/addtogroup",false, $CONFIG->pluginspath . "groups/actions/addtogroup.php");
- register_action("groups/invite",false, $CONFIG->pluginspath . "groups/actions/invite.php");
+ elgg_register_action("groups/edit", $CONFIG->pluginspath . "groups/actions/edit.php");
+ elgg_register_action("groups/delete", $CONFIG->pluginspath . "groups/actions/delete.php");
+ elgg_register_action("groups/join", $CONFIG->pluginspath . "groups/actions/join.php");
+ elgg_register_action("groups/leave", $CONFIG->pluginspath . "groups/actions/leave.php");
+ elgg_register_action("groups/joinrequest", $CONFIG->pluginspath . "groups/actions/joinrequest.php");
+ elgg_register_action("groups/killrequest", $CONFIG->pluginspath . "groups/actions/groupskillrequest.php");
+ elgg_register_action("groups/killinvitation", $CONFIG->pluginspath . "groups/actions/groupskillinvitation.php");
+ elgg_register_action("groups/addtogroup", $CONFIG->pluginspath . "groups/actions/addtogroup.php");
+ elgg_register_action("groups/invite", $CONFIG->pluginspath . "groups/actions/invite.php");
// Use group widgets
use_widgets('groups');
// Register actions
global $CONFIG;
- register_action("groups/addtopic",false,$CONFIG->pluginspath . "groups/actions/forums/addtopic.php");
- register_action("groups/deletetopic",false,$CONFIG->pluginspath . "groups/actions/forums/deletetopic.php");
- register_action("groups/addpost",false,$CONFIG->pluginspath . "groups/actions/forums/addpost.php");
- register_action("groups/edittopic",false,$CONFIG->pluginspath . "groups/actions/forums/edittopic.php");
- register_action("groups/deletepost",false,$CONFIG->pluginspath . "groups/actions/forums/deletepost.php");
- register_action("groups/featured",false,$CONFIG->pluginspath . "groups/actions/featured.php");
- register_action("groups/editpost",false,$CONFIG->pluginspath . "groups/actions/forums/editpost.php");
+ elgg_register_action("groups/addtopic", $CONFIG->pluginspath . "groups/actions/forums/addtopic.php");
+ elgg_register_action("groups/deletetopic", $CONFIG->pluginspath . "groups/actions/forums/deletetopic.php");
+ elgg_register_action("groups/addpost", $CONFIG->pluginspath . "groups/actions/forums/addpost.php");
+ elgg_register_action("groups/edittopic", $CONFIG->pluginspath . "groups/actions/forums/edittopic.php");
+ elgg_register_action("groups/deletepost", $CONFIG->pluginspath . "groups/actions/forums/deletepost.php");
+ elgg_register_action("groups/featured", $CONFIG->pluginspath . "groups/actions/featured.php");
+ elgg_register_action("groups/editpost", $CONFIG->pluginspath . "groups/actions/forums/editpost.php");
?>
}
}
-register_action('invitefriends/invite', false, $CONFIG->pluginspath . 'invitefriends/actions/invite.php');
+elgg_register_action('invitefriends/invite', $CONFIG->pluginspath . 'invitefriends/actions/invite.php');
elgg_register_event_handler('pagesetup', 'system', 'invitefriends_pagesetup');
elgg_register_event_handler('init', 'system', 'messageboard_init');
// Register actions
-register_action("messageboard/add", FALSE, $CONFIG->pluginspath . "messageboard/actions/add.php");
-register_action("messageboard/delete", FALSE, $CONFIG->pluginspath . "messageboard/actions/delete.php");
+elgg_register_action("messageboard/add", $CONFIG->pluginspath . "messageboard/actions/add.php");
+elgg_register_action("messageboard/delete", $CONFIG->pluginspath . "messageboard/actions/delete.php");
// Register actions
global $CONFIG;
-register_action("messages/send",false,$CONFIG->pluginspath . "messages/actions/send.php");
-register_action("messages/delete",false,$CONFIG->pluginspath . "messages/actions/delete.php");
\ No newline at end of file
+elgg_register_action("messages/send", $CONFIG->pluginspath . "messages/actions/send.php");
+elgg_register_action("messages/delete", $CONFIG->pluginspath . "messages/actions/delete.php");
\ No newline at end of file
elgg_register_event_handler('init', 'system', 'notifications_plugin_init', 1000);
-register_action("notificationsettings/save", FALSE, $CONFIG->pluginspath . "notifications/actions/save.php");
-register_action("notificationsettings/groupsave", FALSE, $CONFIG->pluginspath . "notifications/actions/groupsave.php");
+elgg_register_action("notificationsettings/save", $CONFIG->pluginspath . "notifications/actions/save.php");
+elgg_register_action("notificationsettings/groupsave", $CONFIG->pluginspath . "notifications/actions/groupsave.php");
register_entity_url_handler('pages_url','object', 'page');
// Register some actions
- register_action("pages/edit",false, $CONFIG->pluginspath . "pages/actions/pages/edit.php");
- register_action("pages/editwelcome",false, $CONFIG->pluginspath . "pages/actions/pages/editwelcome.php");
- register_action("pages/delete",false, $CONFIG->pluginspath . "pages/actions/pages/delete.php");
+ elgg_register_action("pages/edit", $CONFIG->pluginspath . "pages/actions/pages/edit.php");
+ elgg_register_action("pages/editwelcome", $CONFIG->pluginspath . "pages/actions/pages/editwelcome.php");
+ elgg_register_action("pages/delete", $CONFIG->pluginspath . "pages/actions/pages/delete.php");
// Extend some views
elgg_extend_view('css','pages/css');
// Register actions
global $CONFIG;
-register_action("profile/edit",false,$CONFIG->pluginspath . "profile/actions/edit.php");
-register_action("profile/iconupload",false,$CONFIG->pluginspath . "profile/actions/iconupload.php");
-register_action("profile/cropicon",false,$CONFIG->pluginspath . "profile/actions/cropicon.php");
-register_action("profile/editdefault",false,$CONFIG->pluginspath . "profile/actions/editdefault.php", true);
-register_action("profile/editdefault/delete",false,$CONFIG->pluginspath . "profile/actions/deletedefaultprofileitem.php", true);
-register_action("profile/editdefault/reset",false,$CONFIG->pluginspath . "profile/actions/resetdefaultprofile.php", true);
-register_action("profile/editdefault/reorder",false,$CONFIG->pluginspath . "profile/actions/reorder.php", true);
-register_action("profile/editdefault/editfield",false,$CONFIG->pluginspath . "profile/actions/editfield.php", true);
-register_action("profile/addcomment",false,$CONFIG->pluginspath . "profile/actions/addcomment.php");
-register_action("profile/deletecomment",false,$CONFIG->pluginspath . "profile/actions/deletecomment.php");
+elgg_register_action("profile/edit", $CONFIG->pluginspath . "profile/actions/edit.php");
+elgg_register_action("profile/iconupload", $CONFIG->pluginspath . "profile/actions/iconupload.php");
+elgg_register_action("profile/cropicon", $CONFIG->pluginspath . "profile/actions/cropicon.php");
+elgg_register_action("profile/editdefault", $CONFIG->pluginspath . "profile/actions/editdefault.php", 'admin');
+elgg_register_action("profile/editdefault/delete", $CONFIG->pluginspath . "profile/actions/deletedefaultprofileitem.php", 'admin');
+elgg_register_action("profile/editdefault/reset", $CONFIG->pluginspath . "profile/actions/resetdefaultprofile.php", 'admin');
+elgg_register_action("profile/editdefault/reorder", $CONFIG->pluginspath . "profile/actions/reorder.php", 'admin');
+elgg_register_action("profile/editdefault/editfield", $CONFIG->pluginspath . "profile/actions/editfield.php", 'admin');
+elgg_register_action("profile/addcomment", $CONFIG->pluginspath . "profile/actions/addcomment.php");
+elgg_register_action("profile/deletecomment", $CONFIG->pluginspath . "profile/actions/deletecomment.php");
elgg_add_admin_submenu_item('reportedcontent', elgg_echo('reportedcontent'), 'overview');
//register action
- register_action('reportedcontent/add', FALSE, "{$CONFIG->pluginspath}reportedcontent/actions/add.php");
- register_action('reportedcontent/delete', FALSE, "{$CONFIG->pluginspath}reportedcontent/actions/delete.php");
- register_action('reportedcontent/archive', FALSE, "{$CONFIG->pluginspath}reportedcontent/actions/archive.php");
+ elgg_register_action('reportedcontent/add', "{$CONFIG->pluginspath}reportedcontent/actions/add.php");
+ elgg_register_action('reportedcontent/delete', "{$CONFIG->pluginspath}reportedcontent/actions/delete.php");
+ elgg_register_action('reportedcontent/archive', "{$CONFIG->pluginspath}reportedcontent/actions/archive.php");
}
// Initialise Reported Content
// hook into the walled garden pages
elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'sitepages_public_pages');
- register_action('settings/sitepages/save', FALSE, "{$CONFIG->pluginspath}sitepages/actions/edit_settings.php");
+ elgg_register_action('settings/sitepages/save', "{$CONFIG->pluginspath}sitepages/actions/edit_settings.php");
}
// Extend system CSS with our own styles, which are defined in the thewire/css view
elgg_extend_view('css','thewire/css');
- //extend views
+ //extend views
elgg_extend_view('profile/status', 'thewire/profile_status');
// Register a page handler, so we can have nice URLs
register_entity_url_handler('thewire_url','object','thewire');
// Your thewire widget
- add_widget_type('thewire',elgg_echo("thewire:read"),elgg_echo("thewire:yourdesc"));
-
+ add_widget_type('thewire',elgg_echo("thewire:read"),elgg_echo("thewire:yourdesc"));
+
// Register entity type
register_entity_type('object','thewire');
// Set its description appropriately
$thewire->description = elgg_substr(strip_tags($post), 0, 160);
- // add some metadata
- $thewire->method = $method; //method, e.g. via site, sms etc
- $thewire->parent = $parent; //used if the note is a reply
-
- //save
+ // add some metadata
+ $thewire->method = $method; //method, e.g. via site, sms etc
+ $thewire->parent = $parent; //used if the note is a reply
+
+ //save
$save = $thewire->save();
if($save)
add_to_river('river/object/thewire/create','create',$SESSION['user']->guid,$thewire->guid);
-
- return $save;
+
+ return $save;
}
// Register actions
global $CONFIG;
- register_action("thewire/add",false,$CONFIG->pluginspath . "thewire/actions/add.php");
- register_action("thewire/delete",false,$CONFIG->pluginspath . "thewire/actions/delete.php");
+ elgg_register_action("thewire/add", $CONFIG->pluginspath . "thewire/actions/add.php");
+ elgg_register_action("thewire/delete", $CONFIG->pluginspath . "thewire/actions/delete.php");
?>
$action_path = dirname(__FILE__) . '/actions';
- register_action('uservalidationbyemail/validate', FALSE, "$action_path/validate.php", TRUE);
- register_action('uservalidationbyemail/resend_validation', FALSE, "$action_path/resend_validation.php", TRUE);
- register_action('uservalidationbyemail/delete', FALSE, "$action_path/delete.php", TRUE);
- register_action('uservalidationbyemail/bulk_action', FALSE, "$action_path/bulk_action.php", TRUE);
+ elgg_register_action('uservalidationbyemail/validate', "$action_path/validate.php", 'admin');
+ elgg_register_action('uservalidationbyemail/resend_validation', "$action_path/resend_validation.php", 'admin');
+ elgg_register_action('uservalidationbyemail/delete', "$action_path/delete.php", 'admin');
+ elgg_register_action('uservalidationbyemail/bulk_action', "$action_path/bulk_action.php", 'admin');
}
/**