aboutsummaryrefslogtreecommitdiff
path: root/mod/file/start.php
diff options
context:
space:
mode:
authorpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-15 18:07:38 +0000
committerpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-15 18:07:38 +0000
commit451b29b0f5fef1f41b209c51b57d6362c13696a1 (patch)
tree28e45d071a26d0306dd845e9b5085149aed00f6b /mod/file/start.php
parentaa55192c5e2347e31a905d4e218477dd1e0ff333 (diff)
downloadelgg-451b29b0f5fef1f41b209c51b57d6362c13696a1.tar.gz
elgg-451b29b0f5fef1f41b209c51b57d6362c13696a1.tar.bz2
Updated File mod to new UI.
git-svn-id: http://code.elgg.org/elgg/trunk@5409 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/file/start.php')
-rw-r--r--mod/file/start.php48
1 files changed, 10 insertions, 38 deletions
diff --git a/mod/file/start.php b/mod/file/start.php
index b6af2fb18..bd0389106 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -11,17 +11,14 @@
/**
* Override the ElggFile so that
*/
- class FilePluginFile extends ElggFile
- {
- protected function initialise_attributes()
- {
+ class FilePluginFile extends ElggFile {
+ protected function initialise_attributes() {
parent::initialise_attributes();
$this->attributes['subtype'] = "file";
}
- public function __construct($guid = null)
- {
+ public function __construct($guid = null) {
parent::__construct($guid);
}
}
@@ -30,15 +27,12 @@
/**
* File plugin initialisation functions.
*/
- function file_init()
- {
+ function file_init() {
global $CONFIG;
- // Set up menu (tools dropdown or other uses as defined by theme)
+ // Set up menu (tools dropdown)
if (isloggedin()) {
- add_menu(elgg_echo('file'), $CONFIG->wwwroot . "pg/file/" . get_loggedin_user()->username);
- } else {
- add_menu(elgg_echo('file'), $CONFIG->wwwroot . "pg/file/world/world/" );
+ add_menu(elgg_echo('files'), $CONFIG->wwwroot . "pg/file/" . get_loggedin_user()->username);
}
// Extend CSS
@@ -90,23 +84,6 @@
add_submenu_item(sprintf(elgg_echo("file:group"),$page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
}
}
-
- // General submenu options
-
- if (get_context() == "file") {
- if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {
- add_submenu_item(sprintf(elgg_echo("file:yours"),$page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
- add_submenu_item(sprintf(elgg_echo('file:yours:friends'),$page_owner->name), $CONFIG->wwwroot . "pg/file/". $page_owner->username . "/friends/");
- } else if (page_owner()) {
- add_submenu_item(sprintf(elgg_echo("file:user"),$page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
- if ($page_owner instanceof ElggUser) // This one's for users, not groups
- add_submenu_item(sprintf(elgg_echo('file:friends'),$page_owner->name), $CONFIG->wwwroot . "pg/file/". $page_owner->username . "/friends/");
- }
- add_submenu_item(elgg_echo('file:all'), $CONFIG->wwwroot . "pg/file/world/world/");
- if (can_write_to_container($_SESSION['guid'], page_owner()) && isloggedin())
- add_submenu_item(elgg_echo('file:upload'), $CONFIG->wwwroot . "pg/file/". $page_owner->username . "/new/");
- }
-
}
/**
@@ -123,10 +100,8 @@
set_input('username',$page[0]);
}
- if (isset($page[1]))
- {
- switch($page[1])
- {
+ if (isset($page[1])) {
+ switch($page[1]) {
case "read":
set_input('guid',$page[2]);
include(dirname(dirname(dirname(__FILE__))) . "/entities/index.php");
@@ -141,9 +116,7 @@
include($CONFIG->pluginspath . "file/upload.php");
break;
}
- }
- else
- {
+ } else {
// Include the standard profile index
include($CONFIG->pluginspath . "file/index.php");
}
@@ -158,8 +131,7 @@
* @param unknown_type $returnvalue
* @param unknown_type $params
*/
- function file_notify_message($hook, $entity_type, $returnvalue, $params)
- {
+ function file_notify_message($hook, $entity_type, $returnvalue, $params) {
$entity = $params['entity'];
$to_entity = $params['to_entity'];
$method = $params['method'];