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.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'];