From e4bc53c61702b22c845cbbd22ba3335935ee2c9c Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 19 Mar 2011 15:33:06 +0000 Subject: Fixes #3176 replaced usage of index.php where appropriate git-svn-id: http://code.elgg.org/elgg/trunk@8770 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/file/pages/file/index.php | 69 ------------------------------------------- mod/file/pages/file/owner.php | 69 +++++++++++++++++++++++++++++++++++++++++++ mod/file/start.php | 2 +- 3 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 mod/file/pages/file/index.php create mode 100644 mod/file/pages/file/owner.php (limited to 'mod/file') diff --git a/mod/file/pages/file/index.php b/mod/file/pages/file/index.php deleted file mode 100644 index 617e4c7f4..000000000 --- a/mod/file/pages/file/index.php +++ /dev/null @@ -1,69 +0,0 @@ -name); - -$params = array(); - -if ($owner->guid == elgg_get_logged_in_user_guid()) { - // user looking at own files - $title = elgg_echo('file:yours'); - $params['filter_context'] = 'mine'; -} else if (elgg_instanceof($owner, 'user')) { - // someone else's files - $title = elgg_echo("file:user", array($owner->name)); - // do not show button or select a tab when viewing someone else's posts - $params['filter_context'] = 'none'; - $params['buttons'] = ''; -} else { - // group files - $title = elgg_echo("file:user", array($owner->name)); - $params['filter'] = ''; - if ($owner->isMember(elgg_get_logged_in_user_entity())) { - $url = "file/add/$owner->guid"; - $vars = array( - 'href' => $url, - 'text' => elgg_echo("file:add"), - 'class' => 'elgg-button elgg-button-action', - ); - $button = elgg_view('output/url', $vars); - $params['buttons'] = $button; - } else { - $params['buttons'] = ''; - } -} - -// List files -$content = elgg_list_entities(array( - 'types' => 'object', - 'subtypes' => 'file', - 'container_guid' => $owner->guid, - 'limit' => 10, - 'full_view' => FALSE, -)); -if (!$content) { - $content = elgg_echo("file:none"); -} - -$sidebar = file_get_type_cloud(elgg_get_page_owner_guid()); -if (elgg_instanceof($owner, 'user')) { - $sidebar .= elgg_view_latest_comments(elgg_get_page_owner_guid(), 'object', 'file'); -} - -$params['content'] = $content; -$params['title'] = $title; -$params['sidebar'] = $sidebar; - -$body = elgg_view_layout('content', $params); - -echo elgg_view_page($title, $body); diff --git a/mod/file/pages/file/owner.php b/mod/file/pages/file/owner.php new file mode 100644 index 000000000..617e4c7f4 --- /dev/null +++ b/mod/file/pages/file/owner.php @@ -0,0 +1,69 @@ +name); + +$params = array(); + +if ($owner->guid == elgg_get_logged_in_user_guid()) { + // user looking at own files + $title = elgg_echo('file:yours'); + $params['filter_context'] = 'mine'; +} else if (elgg_instanceof($owner, 'user')) { + // someone else's files + $title = elgg_echo("file:user", array($owner->name)); + // do not show button or select a tab when viewing someone else's posts + $params['filter_context'] = 'none'; + $params['buttons'] = ''; +} else { + // group files + $title = elgg_echo("file:user", array($owner->name)); + $params['filter'] = ''; + if ($owner->isMember(elgg_get_logged_in_user_entity())) { + $url = "file/add/$owner->guid"; + $vars = array( + 'href' => $url, + 'text' => elgg_echo("file:add"), + 'class' => 'elgg-button elgg-button-action', + ); + $button = elgg_view('output/url', $vars); + $params['buttons'] = $button; + } else { + $params['buttons'] = ''; + } +} + +// List files +$content = elgg_list_entities(array( + 'types' => 'object', + 'subtypes' => 'file', + 'container_guid' => $owner->guid, + 'limit' => 10, + 'full_view' => FALSE, +)); +if (!$content) { + $content = elgg_echo("file:none"); +} + +$sidebar = file_get_type_cloud(elgg_get_page_owner_guid()); +if (elgg_instanceof($owner, 'user')) { + $sidebar .= elgg_view_latest_comments(elgg_get_page_owner_guid(), 'object', 'file'); +} + +$params['content'] = $content; +$params['title'] = $title; +$params['sidebar'] = $sidebar; + +$body = elgg_view_layout('content', $params); + +echo elgg_view_page($title, $body); diff --git a/mod/file/start.php b/mod/file/start.php index f49c6fc91..a332b356f 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -91,7 +91,7 @@ function file_page_handler($page) { $page_type = $page[0]; switch ($page_type) { case 'owner': - include "$file_dir/index.php"; + include "$file_dir/owner.php"; break; case 'friends': include "$file_dir/friends.php"; -- cgit v1.2.3