From 3c7ff4340f018d6b70cf8f2dd60de0250d3fcb66 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 22 Aug 2009 15:10:42 +0000 Subject: moved core pages to new pages structure --- pages/edit.php | 51 ++++++++++++++++++++++++++++++++++++++++++++ pages/friends.php | 38 +++++++++++++++++++++++++++++++++ pages/newalbum.php | 32 ++++++++++++++++++++++++++++ pages/ownedalbums.php | 51 ++++++++++++++++++++++++++++++++++++++++++++ pages/tagged.php | 50 ++++++++++++++++++++++++++++++++++++++++++++ pages/upload.php | 42 +++++++++++++++++++++++++++++++++++++ pages/viewalbum.php | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ pages/viewimage.php | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ pages/world.php | 33 +++++++++++++++++++++++++++++ 9 files changed, 411 insertions(+) create mode 100644 pages/edit.php create mode 100644 pages/friends.php create mode 100644 pages/newalbum.php create mode 100644 pages/ownedalbums.php create mode 100644 pages/tagged.php create mode 100644 pages/upload.php create mode 100644 pages/viewalbum.php create mode 100644 pages/viewimage.php create mode 100644 pages/world.php (limited to 'pages') diff --git a/pages/edit.php b/pages/edit.php new file mode 100644 index 000000000..3f13abae9 --- /dev/null +++ b/pages/edit.php @@ -0,0 +1,51 @@ +canEdit()) + forward(); + + $subtype = $entity->getSubtype(); + + if ($subtype == 'album') { + $title = elgg_echo('album:edit'); + + if ($container = $entity->container_guid) + set_page_owner($container); + + } else if ($subtype == 'image') { + $title = elgg_echo('image:edit'); + + if ($container = get_entity($entity->container_guid)->container_guid) + set_page_owner($container); + + } else { + forward(); + } + + $page_owner = page_owner_entity(); + if ($page_owner instanceof ElggGroup) { + add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name), + $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); + } + + + $area2 .= elgg_view_title($title); + $area2 .= elgg_view('tidypics/forms/edit', array('entity' => $entity, 'subtype' => $subtype)); + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + + page_draw($title, $body); +?> \ No newline at end of file diff --git a/pages/friends.php b/pages/friends.php new file mode 100644 index 000000000..8ac1e21d0 --- /dev/null +++ b/pages/friends.php @@ -0,0 +1,38 @@ +guid == get_loggedin_userid()) + $title = elgg_echo('album:yours:friends'); + else + $title = sprintf(elgg_echo('album:friends'), $user->name); + + $area2 = elgg_view_title($title); + + // get html for viewing list of photo albums + set_context('search'); + set_input('search_viewtype', 'gallery'); // need to force gallery view + $area2 .= list_user_friends_objects($user->guid, 'album', 10, true, false); + + + $body = elgg_view_layout('two_column_left_sidebar', '', $area2); + + page_draw($title, $body); +?> \ No newline at end of file diff --git a/pages/newalbum.php b/pages/newalbum.php new file mode 100644 index 000000000..006c61b54 --- /dev/null +++ b/pages/newalbum.php @@ -0,0 +1,32 @@ +name), + $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); + } + + $area2 = elgg_view_title(elgg_echo('album:add')); + $area2 .= elgg_view("tidypics/forms/edit"); + + // Display page + page_draw(elgg_echo('album:add'),elgg_view_layout("two_column_left_sidebar", $area1, $area2, $area3 )); + +?> \ No newline at end of file diff --git a/pages/ownedalbums.php b/pages/ownedalbums.php new file mode 100644 index 000000000..a28020216 --- /dev/null +++ b/pages/ownedalbums.php @@ -0,0 +1,51 @@ +username) || empty($owner->username)) { + forward('pg/photos/world'); + } + + + // setup group menu for album index + if ($owner instanceof ElggGroup) { + add_submenu_item( sprintf(elgg_echo('album:group'),$owner->name), + $CONFIG->wwwroot . "pg/photos/owned/" . $owner->username); + if (can_write_to_container(0, $owner->guid)) { + add_submenu_item( elgg_echo('album:create'), + $CONFIG->wwwroot . 'pg/photos/new/' . $owner->username, + 'tidypics'); + } + } + + //set the title + $title = sprintf(elgg_echo('album:user'), $owner->name); + $area2 = elgg_view_title($title); + + // Get objects + set_context('search'); + set_input('search_viewtype', 'gallery'); + if ($owner instanceof ElggGroup) + $area2 .= list_entities("object", "album", $owner->guid, 12); + else + $area2 .= list_entities("object", "album", $owner->guid, 12); + + set_context('photos'); + $body = elgg_view_layout('two_column_left_sidebar', '', $area2); + + // Finally draw the page + page_draw($title, $body); +?> \ No newline at end of file diff --git a/pages/tagged.php b/pages/tagged.php new file mode 100644 index 000000000..0bc562f5b --- /dev/null +++ b/pages/tagged.php @@ -0,0 +1,50 @@ +name); + else + $title = "User does not exist"; + + + + // create main column + $body = elgg_view_title($title); + + set_context('search'); + set_input('search_viewtype', 'gallery'); // need to force gallery view + $body .= list_entities_from_relationship('phototag', $guid, false, 'object', 'image'); + + // Set up submenus + if (isloggedin()) { + add_submenu_item( elgg_echo("album:yours"), + $CONFIG->wwwroot . "pg/photos/owned/" . $_SESSION['user']->username, + 'tidypics-b' ); + } + add_submenu_item( elgg_echo('album:all'), + $CONFIG->wwwroot . "pg/photos/world/", + 'tidypics-z'); + add_submenu_item( elgg_echo('tidypics:mostrecent'), + $CONFIG->wwwroot . 'pg/photos/mostrecent', + 'tidypics-z'); + + + + $body = elgg_view_layout('two_column_left_sidebar','',$body); + + + page_draw($title,$body); + +?> \ No newline at end of file diff --git a/pages/upload.php b/pages/upload.php new file mode 100644 index 000000000..3550d5620 --- /dev/null +++ b/pages/upload.php @@ -0,0 +1,42 @@ +canEdit()) { + // throw warning and forward to previous page + forward($_SERVER['HTTP_REFERER']); + } + + // set page owner based on container (user or group) + $container = $album->container_guid; + set_page_owner($container); + + $page_owner = page_owner_entity(); + if ($page_owner instanceof ElggGroup) { + add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name), + $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); + } + + set_context('photos'); + $title = elgg_echo('album:addpix') . ': ' . $album->title; + $area2 .= elgg_view_title($title); + + $area2 .= elgg_view("tidypics/forms/upload", array('album' => $album_guid ) ); + $body = elgg_view_layout('two_column_left_sidebar', '', $area2); + + page_draw($title, $body); +?> \ No newline at end of file diff --git a/pages/viewalbum.php b/pages/viewalbum.php new file mode 100644 index 000000000..b451b6993 --- /dev/null +++ b/pages/viewalbum.php @@ -0,0 +1,58 @@ +container_guid) + set_page_owner($album->container_guid); + else + set_page_owner($album->owner_guid); + + $owner = page_owner_entity(); + + // setup group menu + if ($owner instanceof ElggGroup) { + add_submenu_item( sprintf(elgg_echo('album:group'),$owner->name), + $CONFIG->wwwroot . "pg/photos/owned/" . $owner->username); + } + + if (can_write_to_container(0, $album->container_guid)) { + if ($owner instanceof ElggGroup) { + add_submenu_item( elgg_echo('album:create'), + $CONFIG->wwwroot . 'pg/photos/new/' . $owner->username, + 'photos'); + } + add_submenu_item( elgg_echo('album:addpix'), + $CONFIG->wwwroot . 'pg/photos/upload/' . $album_guid, + 'photos'); + add_submenu_item( elgg_echo('album:edit'), + $CONFIG->wwwroot . 'pg/photos/edit/' . $album_guid, + 'photos'); + add_submenu_item( elgg_echo('album:delete'), + $CONFIG->wwwroot . 'pg/photos/delete/' . $album_guid, + 'photos', + true); + } + + // create body + $area2 = elgg_view_entity($album, true); + $body = elgg_view_layout('two_column_left_sidebar', '', $area2); + + page_draw($album->title, $body); +?> \ No newline at end of file diff --git a/pages/viewimage.php b/pages/viewimage.php new file mode 100644 index 000000000..5caccdf06 --- /dev/null +++ b/pages/viewimage.php @@ -0,0 +1,56 @@ +owner_guid); + $album = get_entity($photo->container_guid); + if ($album) { + $owner_guid = $album->container_guid; + if ($owner_guid) + set_page_owner($owner_guid); + } + + + $page_owner = page_owner_entity(); + if ($page_owner instanceof ElggGroup) { + add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name), + $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); + } + + if (can_write_to_container(0, $album->container_guid)) { + add_submenu_item( elgg_echo('image:edit'), + $CONFIG->wwwroot . 'pg/photos/edit/' . $photo_guid, + 'photos'); + add_submenu_item( elgg_echo('image:delete'), + $CONFIG->wwwroot . 'pg/photos/delete/' . $photo_guid, + 'photos', + true); + } + + + $title = $photo->title; + $area2 = elgg_view_title($title); + $area2 .= elgg_view_entity($photo, true); + + $body = elgg_view_layout('two_column_left_sidebar', '', $area2); + + page_draw($title, $body); +?> \ No newline at end of file diff --git a/pages/world.php b/pages/world.php new file mode 100644 index 000000000..1ed712ac9 --- /dev/null +++ b/pages/world.php @@ -0,0 +1,33 @@ +name), $body); +?> \ No newline at end of file -- cgit v1.2.3