aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/start.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-22 16:36:30 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-22 16:36:30 +0000
commitaf5b59b518123a15a7182ebfe2487a9e10f67ee8 (patch)
tree4fcb24176b2b445acee48869aa816813f03352b6 /mod/pages/start.php
parent186f5474e37f9ebde09b9afe2c82fa711402b421 (diff)
downloadelgg-af5b59b518123a15a7182ebfe2487a9e10f67ee8.tar.gz
elgg-af5b59b518123a15a7182ebfe2487a9e10f67ee8.tar.bz2
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
Diffstat (limited to 'mod/pages/start.php')
-rw-r--r--mod/pages/start.php50
1 files changed, 24 insertions, 26 deletions
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/<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>
- * 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";
@@ -153,6 +159,16 @@ function pages_url($entity) {
}
/**
+ * 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
*/
function pages_owner_block_menu($hook, $type, $return, $params) {
@@ -242,24 +258,6 @@ function pages_get_path($guid) {
}
/**
- * 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.
*
* @param unknown_type $hook