aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 3fbd6587c..2cbdc2e73 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -900,11 +900,35 @@
return trigger_plugin_hook('permissions_check',$entity->type,array('entity' => $entity, 'user' => $user),false);
}
+
+ /**
+ * Page handler for generic entities view system
+ *
+ * @param array $page Page elements from pain page handler
+ */
+ function entities_page_handler($page) {
+ if (isset($page[0])) {
+ global $CONFIG;
+ set_input('guid',$page[0]);
+ @include($CONFIG->path . "entities/index.php");
+ }
+ }
+
+ /**
+ * Entities init function; establishes the page handler
+ *
+ */
+ function entities_init() {
+ register_page_handler('view','entities_page_handler');
+ }
/** Register the import hook */
register_plugin_hook("import", "all", "import_entity_plugin_hook", 0);
/** Register the hook, ensuring entities are serialised first */
- register_plugin_hook("export", "all", "export_entity_plugin_hook", 0);
+ register_plugin_hook("export", "all", "export_entity_plugin_hook", 0);
+
+ /** Register init system event **/
+ register_event_handler('init','system','entities_init');
?> \ No newline at end of file