diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/account/forgotten_password.php | 27 | ||||
-rw-r--r-- | pages/account/login.php | 28 | ||||
-rw-r--r-- | pages/account/register.php | 58 | ||||
-rw-r--r-- | pages/account/reset_password.php | 40 | ||||
-rw-r--r-- | pages/avatar/edit.php | 32 | ||||
-rw-r--r-- | pages/avatar/view.php | 54 | ||||
-rw-r--r-- | pages/entities/index.php | 56 | ||||
-rw-r--r-- | pages/friends/collections/add.php | 22 | ||||
-rw-r--r-- | pages/friends/collections/pickercallback.php | 59 | ||||
-rw-r--r-- | pages/friends/collections/view.php | 21 | ||||
-rw-r--r-- | pages/friends/index.php | 35 | ||||
-rw-r--r-- | pages/friends/of.php | 35 | ||||
-rw-r--r-- | pages/profile/edit.php | 32 | ||||
-rw-r--r-- | pages/river.php | 61 | ||||
-rw-r--r-- | pages/settings/account.php | 28 | ||||
-rw-r--r-- | pages/settings/statistics.php | 28 | ||||
-rw-r--r-- | pages/settings/tools.php | 29 | ||||
-rw-r--r-- | pages/tasks/edit_task.php | 62 | ||||
-rw-r--r-- | pages/tasks/friends.php | 33 | ||||
-rw-r--r-- | pages/tasks/new_task.php | 48 | ||||
-rw-r--r-- | pages/tasks/owner.php | 58 | ||||
-rw-r--r-- | pages/tasks/view.php | 71 | ||||
-rw-r--r-- | pages/tasks/world.php | 41 |
23 files changed, 645 insertions, 313 deletions
diff --git a/pages/account/forgotten_password.php b/pages/account/forgotten_password.php new file mode 100644 index 000000000..f464f98c9 --- /dev/null +++ b/pages/account/forgotten_password.php @@ -0,0 +1,27 @@ +<?php +/** + * Assembles and outputs the forgotten password page. + * + * @package Elgg.Core + * @subpackage Registration + */ + +if (elgg_is_logged_in()) { + forward(); +} + +$title = elgg_echo("user:password:lost"); +$content = elgg_view_title($title); + +$content .= elgg_view_form('user/requestnewpassword', array( + 'class' => 'elgg-form-account', +)); + +if (elgg_get_config('walled_garden')) { + elgg_load_css('elgg.walled_garden'); + $body = elgg_view_layout('walled_garden', array('content' => $content)); + echo elgg_view_page($title, $body, 'walled_garden'); +} else { + $body = elgg_view_layout('one_column', array('content' => $content)); + echo elgg_view_page($title, $body); +} diff --git a/pages/account/login.php b/pages/account/login.php new file mode 100644 index 000000000..6aa3752d0 --- /dev/null +++ b/pages/account/login.php @@ -0,0 +1,28 @@ +<?php +/** + * Assembles and outputs a login page. + * + * This page serves as a fallback for non-JS users who click on the login + * drop down link. + * + * If the user is logged in, this page will forward to the front page. + * + * @package Elgg.Core + * @subpackage Accounts + */ + +if (elgg_is_logged_in()) { + forward(''); +} + +$title = elgg_echo('login'); +$content = elgg_view('core/account/login_box'); + +if (elgg_get_config('walled_garden')) { + elgg_load_css('elgg.walled_garden'); + $body = elgg_view_layout('walled_garden', array('content' => $content)); + echo elgg_view_page($title, $body, 'walled_garden'); +} else { + $body = elgg_view_layout('one_column', array('content' => $content)); + echo elgg_view_page($title, $body); +} diff --git a/pages/account/register.php b/pages/account/register.php new file mode 100644 index 000000000..2fe8b74c0 --- /dev/null +++ b/pages/account/register.php @@ -0,0 +1,58 @@ +<?php +/** + * Assembles and outputs the registration page. + * + * Since 1.8, registration can be disabled via administration. If this is + * the case, calls to this page will forward to the network front page. + * + * If the user is logged in, this page will forward to the network + * front page. + * + * @package Elgg.Core + * @subpackage Registration + */ + +// check new registration allowed +if (elgg_get_config('allow_registration') == false) { + register_error(elgg_echo('registerdisabled')); + forward(); +} + +$friend_guid = (int) get_input('friend_guid', 0); +$invitecode = get_input('invitecode'); + +// only logged out people need to register +if (elgg_is_logged_in()) { + forward(); +} + +$title = elgg_echo("register"); + +$content = elgg_view_title($title); + +// create the registration url - including switching to https if configured +$register_url = elgg_get_site_url() . 'action/register'; +if (elgg_get_config('https_login')) { + $register_url = str_replace("http:", "https:", $register_url); +} +$form_params = array( + 'action' => $register_url, + 'class' => 'elgg-form-account', +); + +$body_params = array( + 'friend_guid' => $friend_guid, + 'invitecode' => $invitecode +); +$content .= elgg_view_form('register', $form_params, $body_params); + +$content .= elgg_view('help/register'); + +if (elgg_get_config('walled_garden')) { + elgg_load_css('elgg.walled_garden'); + $body = elgg_view_layout('walled_garden', array('content' => $content)); + echo elgg_view_page($title, $body, 'walled_garden'); +} else { + $body = elgg_view_layout('one_column', array('content' => $content)); + echo elgg_view_page($title, $body); +} diff --git a/pages/account/reset_password.php b/pages/account/reset_password.php new file mode 100644 index 000000000..3ab8ccf3e --- /dev/null +++ b/pages/account/reset_password.php @@ -0,0 +1,40 @@ +<?php +/** + * Page for resetting a forgotten password + * + * @package Elgg.Core + * @subpackage Registration + */ + +if (elgg_is_logged_in()) { + forward(); +} + +$user_guid = get_input('u'); +$code = get_input('c'); + +$user = get_entity($user_guid); + +// don't check code here to avoid automated attacks +if (!$user instanceof ElggUser) { + register_error(elgg_echo('user:passwordreset:unknown_user')); + forward(); +} + +$params = array( + 'guid' => $user_guid, + 'code' => $code, +); +$form = elgg_view_form('user/passwordreset', array('class' => 'elgg-form-account'), $params); + +$title = elgg_echo('resetpassword'); +$content = elgg_view_title(elgg_echo('resetpassword')) . $form; + +if (elgg_get_config('walled_garden')) { + elgg_load_css('elgg.walled_garden'); + $body = elgg_view_layout('walled_garden', array('content' => $content)); + echo elgg_view_page($title, $body, 'walled_garden'); +} else { + $body = elgg_view_layout('one_column', array('content' => $content)); + echo elgg_view_page($title, $body); +} diff --git a/pages/avatar/edit.php b/pages/avatar/edit.php new file mode 100644 index 000000000..56aede887 --- /dev/null +++ b/pages/avatar/edit.php @@ -0,0 +1,32 @@ +<?php +/** + * Upload and crop an avatar page + */ + +// Only logged in users +gatekeeper(); + +elgg_set_context('profile_edit'); + +$title = elgg_echo('avatar:edit'); + +$entity = elgg_get_page_owner_entity(); +if (!elgg_instanceof($entity, 'user') || !$entity->canEdit()) { + register_error(elgg_echo('avatar:noaccess')); + forward(REFERER); +} + +$content = elgg_view('core/avatar/upload', array('entity' => $entity)); + +// only offer the crop view if an avatar has been uploaded +if (isset($entity->icontime)) { + $content .= elgg_view('core/avatar/crop', array('entity' => $entity)); +} + +$params = array( + 'content' => $content, + 'title' => $title, +); +$body = elgg_view_layout('one_sidebar', $params); + +echo elgg_view_page($title, $body); diff --git a/pages/avatar/view.php b/pages/avatar/view.php new file mode 100644 index 000000000..10d81fef1 --- /dev/null +++ b/pages/avatar/view.php @@ -0,0 +1,54 @@ +<?php +/** + * View an avatar + */ + +// page owner library sets this based on URL +$user = elgg_get_page_owner_entity(); + +// Get the size +$size = strtolower(get_input('size')); +if (!in_array($size, array('master', 'large', 'medium', 'small', 'tiny', 'topbar'))) { + $size = 'medium'; +} + +// If user doesn't exist, return default icon +if (!$user) { + $url = "_graphics/icons/default/{$size}.png"; + $url = elgg_normalize_url($url); + forward($url); +} + +$user_guid = $user->getGUID(); + +// Try and get the icon +$filehandler = new ElggFile(); +$filehandler->owner_guid = $user_guid; +$filehandler->setFilename("profile/{$user_guid}{$size}.jpg"); + +$success = false; + +try { + if ($filehandler->open("read")) { + if ($contents = $filehandler->read($filehandler->size())) { + $success = true; + } + } +} catch (InvalidParameterException $e) { + elgg_log("Unable to get avatar for user with GUID $user_guid", 'ERROR'); +} + + +if (!$success) { + $url = "_graphics/icons/default/{$size}.png"; + $url = elgg_normalize_url($url); + forward($url); +} + +header("Content-type: image/jpeg", true); +header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', strtotime("+6 months")), true); +header("Pragma: public", true); +header("Cache-Control: public", true); +header("Content-Length: " . strlen($contents)); + +echo $contents; diff --git a/pages/entities/index.php b/pages/entities/index.php new file mode 100644 index 000000000..e73d65db4 --- /dev/null +++ b/pages/entities/index.php @@ -0,0 +1,56 @@ +<?php +/** + * Generic entity viewer + * Given a GUID, this page will try and display any entity + * + * @package Elgg + * @subpackage Core + */ + + +// Get the GUID of the entity we want to view +$guid = (int) get_input('guid'); +$shell = get_input('shell'); +if ($shell == "no") { + $shell = false; +} else { + $shell = true; +} + +$context = get_input('context'); +if ($context) { + elgg_set_context($context); +} + +// Get the entity, if possible +if ($entity = get_entity($guid)) { + if ($entity->container_guid) { + elgg_set_page_owner_guid($entity->container_guid); + } else { + elgg_set_page_owner_guid($entity->owner_guid); + } + + // Set the body to be the full view of the entity, and the title to be its title + if ($entity instanceof ElggObject) { + $title = $entity->title; + } else if ($entity instanceof ElggEntity) { + $title = $entity->name; + } + $area1 = elgg_view_entity($entity, array('full_view' => true)); + if ($shell) { + $body = elgg_view_layout('one_column', array('content' => $area1)); + } else { + $body = $area1; + } +} else { + $body = elgg_echo('notfound'); +} + +// Display the page +if ($shell) { + echo elgg_view_page($title, $body); +} else { + header("Content-type: text/html; charset=UTF-8"); + echo $title; + echo $body; +}
\ No newline at end of file diff --git a/pages/friends/collections/add.php b/pages/friends/collections/add.php new file mode 100644 index 000000000..60f7586ba --- /dev/null +++ b/pages/friends/collections/add.php @@ -0,0 +1,22 @@ +<?php +/** + * Elgg add a collection of friends + * + * @package Elgg.Core + * @subpackage Social.Collections + */ + +// You need to be logged in for this one +gatekeeper(); + +$title = elgg_echo('friends:collections:add'); + +$content = elgg_view_title($title); + +$content .= elgg_view_form('friends/collections/add', array(), array( + 'friends' => get_user_friends(elgg_get_logged_in_user_guid(), "", 9999), +)); + +$body = elgg_view_layout('one_sidebar', array('content' => $content)); + +echo elgg_view_page(elgg_echo('friends:collections:add'), $body); diff --git a/pages/friends/collections/pickercallback.php b/pages/friends/collections/pickercallback.php new file mode 100644 index 000000000..c6ed61cf0 --- /dev/null +++ b/pages/friends/collections/pickercallback.php @@ -0,0 +1,59 @@ +<?php +/** + * Elgg friends picker callback + * + * @package Elgg.Core + * @subpackage Social.Collections + */ + +// Load Elgg engine +require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"); + +$site_url = elgg_get_site_url(); + +// Get callback type (list or picker) +$type = get_input('type', 'picker'); + +$collection = (int) get_input('collection', 0); +$members = get_members_of_access_collection($collection, true); +if (!$members) { + $members = array(); +} + +$friendspicker = (int) get_input('friendspicker', 0); + +// Get page owner (bomb out if there isn't one) +$pageowner = elgg_get_page_owner_entity(); +if (!$pageowner) { + forward(); + exit; +} + +// Depending on the view type, launch a different view +switch($type) { + case 'list': + $js_segment = elgg_view('core/friends/tablelistcountupdate', array( + 'friendspicker' => $friendspicker, + 'count' => sizeof($members), + )); + $content = elgg_view('core/friends/tablelist', array( + 'entities' => $members, + 'content' => $js_segment, + )); + break; + default: + $friends = $pageowner->getFriends('', 9999); + + $content = elgg_view('input/friendspicker', array( + 'entities' => $friends, + 'value' => $members, + 'callback' => true, + 'friendspicker' => $friendspicker, + 'collection_id' => $collection, + 'formtarget' => $site_url . 'action/friends/collections/edit', + )); + break; +} + +// Output the content +echo $content;
\ No newline at end of file diff --git a/pages/friends/collections/view.php b/pages/friends/collections/view.php new file mode 100644 index 000000000..0d72fe788 --- /dev/null +++ b/pages/friends/collections/view.php @@ -0,0 +1,21 @@ +<?php +/** + * Elgg collections of friends + * + * @package Elgg.Core + * @subpackage Social.Collections + */ + +$title = elgg_echo('friends:collections'); +elgg_register_title_button('collections', 'add'); + +$content = elgg_view_access_collections(elgg_get_logged_in_user_guid()); + +$body = elgg_view_layout('content', array( + 'filter' => false, + 'content' => $content, + 'title' => $title, + 'context' => 'collections', +)); + +echo elgg_view_page($title, $body); diff --git a/pages/friends/index.php b/pages/friends/index.php new file mode 100644 index 000000000..63518a413 --- /dev/null +++ b/pages/friends/index.php @@ -0,0 +1,35 @@ +<?php +/** + * Elgg friends page + * + * @package Elgg.Core + * @subpackage Social.Friends + */ + +$owner = elgg_get_page_owner_entity(); +if (!$owner) { + // unknown user so send away (@todo some sort of 404 error) + forward(); +} + +$title = elgg_echo("friends:owned", array($owner->name)); + +$options = array( + 'relationship' => 'friend', + 'relationship_guid' => $owner->getGUID(), + 'inverse_relationship' => FALSE, + 'type' => 'user', + 'full_view' => FALSE +); +$content = elgg_list_entities_from_relationship($options); +if (!$content) { + $content = elgg_echo('friends:none'); +} + +$params = array( + 'content' => $content, + 'title' => $title, +); +$body = elgg_view_layout('one_sidebar', $params); + +echo elgg_view_page($title, $body); diff --git a/pages/friends/of.php b/pages/friends/of.php new file mode 100644 index 000000000..aa9ee8bee --- /dev/null +++ b/pages/friends/of.php @@ -0,0 +1,35 @@ +<?php +/** + * Elgg friends of page + * + * @package Elgg.Core + * @subpackage Social.Friends + */ + +$owner = elgg_get_page_owner_entity(); +if (!$owner) { + // unknown user so send away (@todo some sort of 404 error) + forward(); +} + +$title = elgg_echo("friends:of:owned", array($owner->name)); + +$options = array( + 'relationship' => 'friend', + 'relationship_guid' => $owner->getGUID(), + 'inverse_relationship' => TRUE, + 'type' => 'user', + 'full_view' => FALSE +); +$content = elgg_list_entities_from_relationship($options); +if (!$content) { + $content = elgg_echo('friends:none'); +} + +$params = array( + 'content' => $content, + 'title' => $title, +); +$body = elgg_view_layout('one_sidebar', $params); + +echo elgg_view_page($title, $body); diff --git a/pages/profile/edit.php b/pages/profile/edit.php new file mode 100644 index 000000000..0ffb8783f --- /dev/null +++ b/pages/profile/edit.php @@ -0,0 +1,32 @@ +<?php +/** + * Edit profile page + */ + +gatekeeper(); + +$user = elgg_get_page_owner_entity(); +if (!$user) { + register_error(elgg_echo("profile:notfound")); + forward(); +} + +// check if logged in user can edit this profile +if (!$user->canEdit()) { + register_error(elgg_echo("profile:noaccess")); + forward(); +} + +elgg_set_context('profile_edit'); + +$title = elgg_echo('profile:edit'); + +$content = elgg_view_form('profile/edit', array(), array('entity' => $user)); + +$params = array( + 'content' => $content, + 'title' => $title, +); +$body = elgg_view_layout('one_sidebar', $params); + +echo elgg_view_page($title, $body); diff --git a/pages/river.php b/pages/river.php new file mode 100644 index 000000000..801d9f664 --- /dev/null +++ b/pages/river.php @@ -0,0 +1,61 @@ +<?php +/** + * Main activity stream list page + */ + +$options = array(); + +$page_type = preg_replace('[\W]', '', get_input('page_type', 'all')); +$type = preg_replace('[\W]', '', get_input('type', 'all')); +$subtype = preg_replace('[\W]', '', get_input('subtype', '')); +if ($subtype) { + $selector = "type=$type&subtype=$subtype"; +} else { + $selector = "type=$type"; +} + +if ($type != 'all') { + $options['type'] = $type; + if ($subtype) { + $options['subtype'] = $subtype; + } +} + +switch ($page_type) { + case 'mine': + $title = elgg_echo('river:mine'); + $page_filter = 'mine'; + $options['subject_guid'] = elgg_get_logged_in_user_guid(); + break; + case 'friends': + $title = elgg_echo('river:friends'); + $page_filter = 'friends'; + $options['relationship_guid'] = elgg_get_logged_in_user_guid(); + $options['relationship'] = 'friend'; + break; + default: + $title = elgg_echo('river:all'); + $page_filter = 'all'; + break; +} + +$activity = elgg_list_river($options); +if (!$activity) { + $activity = elgg_echo('river:none'); +} + +$content = elgg_view('core/river/filter', array('selector' => $selector)); + +$sidebar = elgg_view('core/river/sidebar'); + +$params = array( + 'title' => $title, + 'content' => $content . $activity, + 'sidebar' => $sidebar, + 'filter_context' => $page_filter, + 'class' => 'elgg-river-layout', +); + +$body = elgg_view_layout('content', $params); + +echo elgg_view_page($title, $body); diff --git a/pages/settings/account.php b/pages/settings/account.php new file mode 100644 index 000000000..962e1fc37 --- /dev/null +++ b/pages/settings/account.php @@ -0,0 +1,28 @@ +<?php +/** + * Elgg user account settings. + * + * @package Elgg + * @subpackage Core + */ + +// Only logged in users +gatekeeper(); + +// Make sure we don't open a security hole ... +if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) { + register_error(elgg_echo('noaccess')); + forward('/'); +} + +$title = elgg_echo('usersettings:user'); + +$content = elgg_view('core/settings/account'); + +$params = array( + 'content' => $content, + 'title' => $title, +); +$body = elgg_view_layout('one_sidebar', $params); + +echo elgg_view_page($title, $body); diff --git a/pages/settings/statistics.php b/pages/settings/statistics.php new file mode 100644 index 000000000..9dcc9211d --- /dev/null +++ b/pages/settings/statistics.php @@ -0,0 +1,28 @@ +<?php +/** + * Elgg user statistics. + * + * @package Elgg + * @subpackage Core + */ + +// Only logged in users +gatekeeper(); + +// Make sure we don't open a security hole ... +if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) { + register_error(elgg_echo('noaccess')); + forward('/'); +} + +$title = elgg_echo("usersettings:statistics"); + +$content = elgg_view("core/settings/statistics"); + +$params = array( + 'content' => $content, + 'title' => $title, +); +$body = elgg_view_layout('one_sidebar', $params); + +echo elgg_view_page($title, $body); diff --git a/pages/settings/tools.php b/pages/settings/tools.php new file mode 100644 index 000000000..ed6b941c0 --- /dev/null +++ b/pages/settings/tools.php @@ -0,0 +1,29 @@ +<?php +/** + * Elgg user tools settings + * + * @package Elgg + * @subpackage Core + */ + +// Only logged in users +gatekeeper(); + +// Make sure we don't open a security hole ... +if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) { + register_error(elgg_echo('noaccess')); + forward('/'); +} + +$title = elgg_echo("usersettings:plugins"); + +$content = elgg_view("core/settings/tools", + array('installed_plugins' => elgg_get_plugins())); + +$params = array( + 'content' => $content, + 'title' => $title, +); +$body = elgg_view_layout('one_sidebar', $params); + +echo elgg_view_page($title, $body); diff --git a/pages/tasks/edit_task.php b/pages/tasks/edit_task.php deleted file mode 100644 index 646418761..000000000 --- a/pages/tasks/edit_task.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * Edit a task - * - * @package ElggTasks - */ - -gatekeeper(); - -$task_guid = (int)get_input('guid'); -$task = get_entity($task_guid); -if (!$task) { - -} - -$container = $task->getContainerEntity(); -if (!$container) { - -} - -$list = get_entity($task->list_guid); -if (!$list) { - -} - -elgg_set_page_owner_guid($container->getGUID()); - -if (elgg_instanceof($container, 'user')) { - elgg_push_breadcrumb($container->name, "tasks/owner/$container->username/"); -} elseif (elgg_instanceof($container, 'group')) { - elgg_push_breadcrumb($container->name, "tasks/group/$container->guid/all"); -} -if($list) { - elgg_push_breadcrumb($list->title, "tasks/view/$list->guid/$list->title"); -} -elgg_push_breadcrumb($task->title, $task->getURL()); -elgg_push_breadcrumb(elgg_echo('edit')); - -$title = elgg_echo("tasks:edit"); - -if ($task->canEdit()) { - $vars = array( - 'guid' => $task_guid, - 'container_guid' => $container->guid, - ); - - foreach(array_keys(elgg_get_config('tasks')) as $variable){ - $vars[$variable] = $task->$variable; - } - - $content = elgg_view_form('tasks/edit', array(), $vars); -} else { - $content = elgg_echo("tasks:noaccess"); -} - -$body = elgg_view_layout('content', array( - 'filter' => '', - 'content' => $content, - 'title' => $title, -)); - -echo elgg_view_page($title, $body); diff --git a/pages/tasks/friends.php b/pages/tasks/friends.php deleted file mode 100644 index cda0d6788..000000000 --- a/pages/tasks/friends.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * List a user's friends' tasks - * - * @package ElggTasks - */ - -$owner = elgg_get_page_owner_entity(); -if (!elgg_instanceof($owner, 'user')) { - forward('tasks/all'); -} - -elgg_register_title_button('tasks', 'add'); - -elgg_push_breadcrumb($owner->name, "tasks/owner/$owner->username"); -elgg_push_breadcrumb(elgg_echo('friends')); - -$title = elgg_echo('tasks:friends'); - -$content = list_user_friends_objects($owner->guid, 'task', 10, false); -if (!$content) { - $content = elgg_echo('tasks:none'); -} - -$params = array( - 'filter_context' => 'friends', - 'content' => $content, - 'title' => $title, -); - -$body = elgg_view_layout('content', $params); - -echo elgg_view_page($title, $body); diff --git a/pages/tasks/new_task.php b/pages/tasks/new_task.php deleted file mode 100644 index 06a98466d..000000000 --- a/pages/tasks/new_task.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Create a new task - * - * @package ElggTasks - */ - -gatekeeper(); - -$list_guid = (int) get_input('guid'); -$list = get_entity($list_guid); -if (!$list) { -} - -if (elgg_instanceof($list, 'object', 'task') || elgg_instanceof($list, 'object', 'tasklist')) { - $container = $list->getContainerEntity(); - if (!$container) { - $container = elgg_get_logged_in_user_guid(); - } -} elseif (elgg_instanceof($list, 'user') || elgg_instanceof($list, 'group')) { - $container = $list; - // not a real list - $list_guid = null; -} - -elgg_set_page_owner_guid($container->getGUID()); - -if (elgg_instanceof($container, 'user')) { - elgg_push_breadcrumb($container->name, "tasks/owner/$container->username/"); -} elseif (elgg_instanceof($container, 'group')) { - elgg_push_breadcrumb($container->name, "tasks/group/$container->guid/all"); -} - -$title = elgg_echo('tasks:add'); -elgg_push_breadcrumb($title); - - -$vars = task_prepare_form_vars(null, $list_guid); - -$content = elgg_view_form('tasks/edit', array(), $vars); - -$body = elgg_view_layout('content', array( - 'filter' => '', - 'content' => $content, - 'title' => $title, -)); - -echo elgg_view_page($title, $body); diff --git a/pages/tasks/owner.php b/pages/tasks/owner.php deleted file mode 100644 index 801c00be9..000000000 --- a/pages/tasks/owner.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * List a user's or group's tasks - * - * @package ElggTasks - */ - -$owner = elgg_get_page_owner_entity(); -if (!$owner) { - forward('tasks/all'); -} - -// access check for closed groups -group_gatekeeper(); - -$title = elgg_echo('tasks:lists:owner', array($owner->name)); - -elgg_push_breadcrumb($owner->name); - -elgg_register_title_button('tasks', 'add'); - -$options = array( - 'type' => 'object', - 'subtypes' => 'task', - 'container_guid' => elgg_get_page_owner_guid(), - 'full_view' => false, - 'metadata_name' => 'list_guid', - 'metadata_value' => 0, -); - -$content = elgg_list_entities_from_metadata($options); - -if (!$content) { - $content = '<p>' . elgg_echo('tasks:none') . '</p>'; -} - -$filter_context = ''; -if (elgg_get_page_owner_guid() == elgg_get_logged_in_user_guid()) { - $filter_context = 'mine'; -} - -$sidebar = elgg_view('tasks/sidebar/navigation'); -$sidebar .= elgg_view('tasks/sidebar'); - -$params = array( - 'filter_context' => $filter_context, - 'content' => $content, - 'title' => $title, - 'sidebar' => $sidebar, -); - -if (elgg_instanceof($owner, 'group')) { - $params['filter'] = ''; -} - -$body = elgg_view_layout('content', $params); - -echo elgg_view_page($title, $body); diff --git a/pages/tasks/view.php b/pages/tasks/view.php deleted file mode 100644 index 51759dda1..000000000 --- a/pages/tasks/view.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * View a single task - * - * @package ElggTasks - */ - -$guid = get_input('guid'); -$entity = get_entity($guid); -if (!$entity) { - forward(); -} - -$container = $entity->getContainerEntity(); -$list = get_entity($entity->list_guid); - -elgg_set_page_owner_guid($container->guid); - -group_gatekeeper(); - -if (!$container) { -} - -$title = $entity->title; - -// bread crumbs -if (elgg_instanceof($container, 'user')) { - elgg_push_breadcrumb($container->name, "tasks/owner/$container->username/"); -} elseif (elgg_instanceof($container, 'group')) { - elgg_push_breadcrumb($container->name, "tasks/group/$container->guid/all"); -} - -$crumbs = array(); -while($list && !($list instanceof ElggUser || $list instanceof ElggGroup)) { - array_unshift($crumbs, $list); - $list = get_entity($list->list_guid); -} -foreach($crumbs as $crumb) { - elgg_push_breadcrumb($crumb->title, $crumb->getURL()); -} -elgg_push_breadcrumb($title); - -// content -$content = elgg_view_entity($entity, array('full_view' => true)); - -//if (!elgg_instanceof($entity, 'object', 'task') && $container->canWriteToContainer(0, 'object', 'task')) { -if ($container->canWriteToContainer(0, 'object', 'task')) { - elgg_load_js('elgg.tasks'); - - $url = "tasks/add/$entity->guid"; - elgg_register_menu_item('title', array( - 'name' => 'subtask', - 'href' => $url, - 'text' => elgg_echo('tasks:newchild'), - 'link_class' => 'elgg-button elgg-button-action', - )); - - $can_comment = $entity->canEdit(); - $content .= elgg_view_comments($entity, $can_comment); -} -/*} elseif (elgg_instanceof($entity, 'object', 'task')) { -}*/ - -$body = elgg_view_layout('content', array( - 'filter' => '', - 'content' => $content, - 'title' => $title, - 'sidebar' => elgg_view('tasks/sidebar/navigation', array('entity' => $entity)), -)); - -echo elgg_view_page($title, $body); diff --git a/pages/tasks/world.php b/pages/tasks/world.php deleted file mode 100644 index 93dcb2762..000000000 --- a/pages/tasks/world.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * List all tasks - * - * @package ElggTasks - */ - -$title = elgg_echo('tasks:all'); - -elgg_pop_breadcrumb(); -elgg_push_breadcrumb(elgg_echo('tasks')); - -$lists = elgg_get_entities_from_metadata(array( - 'type' => 'object', - 'subtype' => 'task', - 'count' => true, - 'metadata_name' => 'list_guid', - 'metadata_value' => 0, -)); - -elgg_register_title_button('tasks', 'add'); - -$content = elgg_list_entities_from_metadata(array( - 'type' => 'object', - 'subtype' => 'task', - 'full_view' => false, - 'metadata_name' => 'list_guid', - 'metadata_value' => 0, -)); -if (!$content) { - $content = '<p>' . elgg_echo('tasks:none') . '</p>'; -} - -$body = elgg_view_layout('content', array( - 'filter_context' => 'all', - 'content' => $content, - 'title' => $title, - 'sidebar' => elgg_view('tasks/sidebar'), -)); - -echo elgg_view_page($title, $body); |