aboutsummaryrefslogtreecommitdiff
path: root/mod/externalpages/start.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-13 22:19:14 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-13 22:19:14 +0000
commitc1c2563fc1cd451afaf735350eb1c576740be2f4 (patch)
treec101b4050ee0fbc356699276590bd7138e7ddbdb /mod/externalpages/start.php
parentb42125b50f3fcd518ef058211a318ce5c6b66e1b (diff)
downloadelgg-c1c2563fc1cd451afaf735350eb1c576740be2f4.tar.gz
elgg-c1c2563fc1cd451afaf735350eb1c576740be2f4.tar.bz2
swapping sitepages for externalpages since the external pages is easier to integrate into 1.8 . sitepages needs more work before it is ready for release (plus we would need an upgrade script)
git-svn-id: http://code.elgg.org/elgg/trunk@8206 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/externalpages/start.php')
-rw-r--r--mod/externalpages/start.php74
1 files changed, 74 insertions, 0 deletions
diff --git a/mod/externalpages/start.php b/mod/externalpages/start.php
new file mode 100644
index 000000000..33bd7e189
--- /dev/null
+++ b/mod/externalpages/start.php
@@ -0,0 +1,74 @@
+<?php
+ /**
+ * Elgg Simple editing of external pages frontpage/about/term/contact and privacy
+ *
+ * @package ElggExPages
+ */
+
+ function expages_init() {
+
+ global $CONFIG;
+
+ // Register a page handler, so we can have nice URLs
+ register_page_handler('expages','expages_page_handler');
+
+ // Register a URL handler for external pages
+ register_entity_url_handler('expages_url','object','expages');
+
+ // extend views
+ elgg_extend_view('footer/links', 'expages/footer_menu');
+ elgg_extend_view('index/righthandside', 'expages/front_right');
+ elgg_extend_view('index/lefthandside', 'expages/front_left');
+
+ }
+
+ /**
+ * Page setup. Adds admin controls to the admin panel.
+ *
+ */
+ function expages_pagesetup()
+ {
+ if (get_context() == 'admin' && isadminloggedin()) {
+ global $CONFIG;
+ add_submenu_item(elgg_echo('expages'), $CONFIG->wwwroot . 'pg/expages/');
+ }
+ }
+
+ function expages_url($expage) {
+
+ global $CONFIG;
+ return $CONFIG->url . "pg/expages/";
+
+ }
+
+
+ function expages_page_handler($page)
+ {
+ global $CONFIG;
+
+ if ($page[0])
+ {
+ switch ($page[0])
+ {
+ case "read": set_input('expages',$page[1]);
+ include(dirname(__FILE__) . "/read.php");
+ break;
+ default : include($CONFIG->pluginspath . "externalpages/index.php");
+ }
+ }
+ else
+ include($CONFIG->pluginspath . "externalpages/index.php");
+ }
+
+ // Initialise log browser
+ register_elgg_event_handler('init','system','expages_init');
+ register_elgg_event_handler('pagesetup','system','expages_pagesetup');
+
+ // Register actions
+ global $CONFIG;
+ register_action("expages/add",false,$CONFIG->pluginspath . "externalpages/actions/add.php");
+ register_action("expages/addfront",false,$CONFIG->pluginspath . "externalpages/actions/addfront.php");
+ register_action("expages/edit",false,$CONFIG->pluginspath . "externalpages/actions/edit.php");
+ register_action("expages/delete",false,$CONFIG->pluginspath . "externalpages/actions/delete.php");
+
+?> \ No newline at end of file