aboutsummaryrefslogtreecommitdiff
path: root/start.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-03 20:05:08 +0100
committerSem <sembrestels@riseup.net>2011-11-03 20:05:08 +0100
commitde84bf42063eae58bd5832d125c6445b5315baaf (patch)
treec67bb7c1a0380882785ce46b684aea102ed1db03 /start.php
parente4488e9319a43afe2b4cb8359de11c22cccc6116 (diff)
downloadelgg-de84bf42063eae58bd5832d125c6445b5315baaf.tar.gz
elgg-de84bf42063eae58bd5832d125c6445b5315baaf.tar.bz2
Moved event handler and action registering functions into init one.
Diffstat (limited to 'start.php')
-rw-r--r--start.php38
1 files changed, 18 insertions, 20 deletions
diff --git a/start.php b/start.php
index c931cf035..9e8f73f92 100644
--- a/start.php
+++ b/start.php
@@ -8,6 +8,9 @@
* @author Prateek Choudhary <synapticfield@gmail.com>
* @copyright Prateek Choudhary
*/
+
+register_elgg_event_handler('init','system','videolist_init');
+
function videolist_init() {
global $CONFIG;
@@ -28,6 +31,15 @@ function videolist_init() {
if (is_callable('register_notification_object')) {
register_notification_object('object', 'videolist', elgg_echo('videolist:new'));
}
+
+ // Register a handler for adding videos
+ register_elgg_event_handler('create', 'videolist', 'videolist_create_event_listener');
+
+ // Register a handler for delete videos
+ register_elgg_event_handler('delete', 'videolist', 'videolist_delete_event_listener');
+
+ register_elgg_event_handler('pagesetup','system','videolist_pagesetup');
+ register_elgg_event_handler('annotate','all','videolist_object_notifications');
register_plugin_hook('object:notifications','object','videolist_object_notifications_intercept');
@@ -49,6 +61,12 @@ function videolist_init() {
// override icons for ElggEntity::getIcon()
register_plugin_hook('entity:icon:url', 'user', 'profile_usericon_hook');
+
+ // Register actions
+ register_action("videolist/add", $CONFIG->pluginspath . "videolist/actions/add.php");
+ register_action("videolist/edit", $CONFIG->pluginspath . "videolist/actions/edit.php");
+ register_action("videolist/tubesearch", $CONFIG->pluginspath . "videolist/actions/tubesearch.php");
+ register_action("videolist/delete", $CONFIG->pluginspath . "videolist/actions/delete.php");
}
/**
@@ -258,23 +276,3 @@ function videolist_get_entity_icon_url(ElggEntity $entity, $size = 'medium') {
return $entity->thumbnail;
}
-
-// Register a handler for adding videos
-register_elgg_event_handler('create', 'videolist', 'videolist_create_event_listener');
-
-// Register a handler for delete videos
-register_elgg_event_handler('delete', 'videolist', 'videolist_delete_event_listener');
-
-// Make sure the status initialisation function is called on initialisation
-register_elgg_event_handler('init','system','videolist_init');
-
-register_elgg_event_handler('pagesetup','system','videolist_pagesetup');
-register_elgg_event_handler('annotate','all','videolist_object_notifications');
-
-// Register actions
-global $CONFIG;
-
-register_action("videolist/add", false, $CONFIG->pluginspath . "videolist/actions/add.php");
-register_action("videolist/edit", false, $CONFIG->pluginspath . "videolist/actions/edit.php");
-register_action("videolist/tubesearch", false, $CONFIG->pluginspath . "videolist/actions/tubesearch.php");
-register_action("videolist/delete", false, $CONFIG->pluginspath . "videolist/actions/delete.php"); \ No newline at end of file