aboutsummaryrefslogtreecommitdiff
path: root/mod/file/start.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/file/start.php')
-rw-r--r--mod/file/start.php131
1 files changed, 0 insertions, 131 deletions
diff --git a/mod/file/start.php b/mod/file/start.php
deleted file mode 100644
index 2783e6e64..000000000
--- a/mod/file/start.php
+++ /dev/null
@@ -1,131 +0,0 @@
-<?php
- /**
- * Elgg file browser
- *
- * @package ElggFile
- * @author Marcus Povey
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- */
-
-
- /**
- * File plugin initialisation functions.
- */
- function file_init()
- {
- // Get config
- global $CONFIG;
-
- // Set up menu for logged in users
- if (isloggedin())
- {
- add_menu(elgg_echo('file'), $CONFIG->wwwroot . "pg/file/" . $_SESSION['user']->username, array(
- menu_item(sprintf(elgg_echo("file:yours"),$_SESSION['user']->name), $CONFIG->wwwroot . "pg/file/" . $_SESSION['user']->username),
- menu_item(sprintf(elgg_echo('file:friends'),$_SESSION['user']->name), $CONFIG->wwwroot . "pg/file/". $_SESSION['user']->username . "/friends/"),
- menu_item(elgg_echo('file:all'), $CONFIG->wwwroot . "pg/file/". $_SESSION['user']->username . "/world/"),
- menu_item(elgg_echo('file:upload'), $CONFIG->wwwroot . "pg/file/". $_SESSION['user']->username . "/new/")
- ));
- }
- else
- {
- add_menu(elgg_echo('file'), $CONFIG->wwwroot . "pg/file/" . $_SESSION['user']->username . "/", array(
- menu_item(elgg_echo('file:all'), $CONFIG->wwwroot . "pg/file/". $_SESSION['user']->username . "/world/"),
- ));
- }
-
- // Register a page handler, so we can have nice URLs
- register_page_handler('file','file_page_handler');
-
- }
-
- /**
- * File page handler
- *
- * @param array $page Array of page elements, forwarded by the page handling mechanism
- */
- function file_page_handler($page) {
-
- global $CONFIG;
-
- // The username should be the file we're getting
- if (isset($page[0])) {
- set_input('username',$page[0]);
- }
-
- if (isset($page[1]))
- {
- switch($page[1])
- {
- case "friends":
- include($CONFIG->pluginspath . "file/friends.php");
- break;
- case "world":
- include($CONFIG->pluginspath . "file/world.php");
- break;
- case "new":
- include($CONFIG->pluginspath . "file/upload.php");
- break;
- }
- }
- else
- {
- // Include the standard profile index
- include($CONFIG->pluginspath . "file/index.php");
- }
-
- }
-
- /**
- * Draw an individual file.
- *
- * @param ElggFile $file
- */
- function file_draw_file(ElggFile $file)
- {
- // Get tags
- $tags = $file->getMetaData("tag");
- if (!is_array($tags))
- $tags = array($tags);
-
- // Draw file
- return elgg_view("file/file", array(
- "file_guid" => $file->guid,
- "tags" => $tags,
- "title" => $file->title,
- "description" => $file->description,
- "mimetype" => $file->getMimeType()
- ));
- }
-
- /**
- * Draw a given set of objects.
- *
- * @param array $objects
- */
- function file_draw(array $objects)
- {
- $body = "";
-
- foreach ($objects as $object)
- $body .= file_draw_file($object);
-
- return $body;
- }
-
- function file_draw_footer($limit, $offset)
- {
- return elgg_view("file/footer", array(
- "limit" => $limit,
- "offset" => $offset
- ));
- }
-
- // Make sure test_init is called on initialisation
- register_event_handler('init','system','file_init');
-
- // Register actions
- register_action("file/upload", false, $CONFIG->pluginspath . "file/actions/upload.php");
- register_action("file/download", false, $CONFIG->pluginspath. "file/actions/download.php");
-
-?> \ No newline at end of file