From af5b59b518123a15a7182ebfe2487a9e10f67ee8 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 22 Jan 2011 16:36:30 +0000 Subject: more clean up of the pages plugin to use new HTML/CSS git-svn-id: http://code.elgg.org/elgg/trunk@7898 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/pages/start.php | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'mod/pages/start.php') diff --git a/mod/pages/start.php b/mod/pages/start.php index 16b73cce6..5872e6b11 100644 --- a/mod/pages/start.php +++ b/mod/pages/start.php @@ -26,6 +26,7 @@ function pages_init() { // Register a url handler register_entity_url_handler('pages_url', 'object', 'page_top'); register_entity_url_handler('pages_url', 'object', 'page'); + register_extender_url_handler('pages_revision_url', 'annotation', 'page'); // Register some actions $action_base = elgg_get_plugin_path() . 'pages/actions/pages'; @@ -76,14 +77,15 @@ function pages_init() { /** * Dispatcher for pages. * URLs take the form of - * All pages: pg/pages/all - * User's pages: pg/pages/owner/ - * Friends' pages: pg/pages/friends/ - * View page: pg/pages/view// - * New page: pg/pages/add/<guid> (container: user, group, parent) - * Edit page: pg/pages/edit/<guid> - * History of page: pg/pages/history/<guid> - * Group pages: pg/pages/group/<guid>/owner + * All pages: pg/pages/all + * User's pages: pg/pages/owner/<username> + * Friends' pages: pg/pages/friends/<username> + * View page: pg/pages/view/<guid>/<title> + * New page: pg/pages/add/<guid> (container: user, group, parent) + * Edit page: pg/pages/edit/<guid> + * History of page: pg/pages/history/<guid> + * Revision of page: pg/pages/revision/<id> + * Group pages: pg/pages/group/<guid>/owner * * Title is ignored * @@ -132,6 +134,10 @@ function pages_page_handler($page) { set_input('guid', $page[1]); include "$base_dir/history.php"; break; + case 'revision': + set_input('id', $page[1]); + include "$base_dir/revision.php"; + break; case 'all': default: include "$base_dir/world.php"; @@ -152,6 +158,16 @@ function pages_url($entity) { return "pg/pages/view/$entity->guid/$title"; } +/** + * Override the page annotation url + * + * @param ElggAnnotation $annotation + * @return string + */ +function pages_revision_url($annotation) { + return "pg/pages/revision/$annotation->id"; +} + /** * Add a menu item to the user ownerblock */ @@ -241,24 +257,6 @@ function pages_get_path($guid) { return $path; } -/** - * Return the correct sidebar for a given entity - * - * @param ElggObject $entity - */ -function pages_get_entity_sidebar(ElggObject $entity, $fulltree = 0) -{ - $body = ""; - - $children = elgg_get_entities_from_metadata(array('metadata_names' => 'parent_guid', 'metadata_values' => $entity->guid, 'limit' => 9999)); - $body .= elgg_view('pages/sidebar/sidebarthis', array('entity' => $entity, - 'children' => $children, - 'fulltree' => $fulltree)); - //$body = elgg_view('pages/sidebar/wrapper', array('body' => $body)); - - return $body; -} - /** * Extend permissions checking to extend can-edit for write users. * -- cgit v1.2.3