From 451b29b0f5fef1f41b209c51b57d6362c13696a1 Mon Sep 17 00:00:00 2001 From: pete Date: Mon, 15 Mar 2010 18:07:38 +0000 Subject: Updated File mod to new UI. git-svn-id: http://code.elgg.org/elgg/trunk@5409 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/file/edit.php | 6 +- mod/file/friends.php | 12 +- mod/file/index.php | 12 +- mod/file/languages/en.php | 4 +- mod/file/search.php | 14 +- mod/file/start.php | 48 ++---- mod/file/upload.php | 6 +- mod/file/views/default/file/css.php | 161 +++++++++------------ mod/file/views/default/file/groupprofile_files.php | 15 +- mod/file/views/default/file/typecloud.php | 89 +++++------- mod/file/views/default/file/upload.php | 6 +- mod/file/views/default/object/file.php | 32 ++-- mod/file/world.php | 8 +- 13 files changed, 171 insertions(+), 242 deletions(-) (limited to 'mod/file') diff --git a/mod/file/edit.php b/mod/file/edit.php index 9dfc12eea..c7b823947 100644 --- a/mod/file/edit.php +++ b/mod/file/edit.php @@ -34,8 +34,8 @@ if (!$file->canEdit()) { } $title = elgg_echo('file:edit'); -$area2 = elgg_view_title($title); -$area2 .= elgg_view("file/upload", array('entity' => $file)); +$area1 = elgg_view_title($title); +$area1 .= elgg_view("file/upload", array('entity' => $file)); -$body = elgg_view_layout('two_column_left_sidebar', '', $area2); +$body = elgg_view_layout('one_column_with_sidebar', $area1); page_draw($title, $body); diff --git a/mod/file/friends.php b/mod/file/friends.php index 71dd2b10a..eff4a4aa0 100644 --- a/mod/file/friends.php +++ b/mod/file/friends.php @@ -17,23 +17,21 @@ $owner = page_owner_entity(); $title = sprintf(elgg_echo("file:friends"),$owner->name); - - $area2 = elgg_view_title($title); - + $area1 = elgg_view('page_elements/content_header', array('context' => "friends", 'type' => 'file')); set_context('search'); // offset is grabbed in list_user_friends_objects $content = list_user_friends_objects($owner->guid, 'file', 10, false); set_context('file'); - $area1 = get_filetype_cloud($owner->guid, true); + $area1 .= get_filetype_cloud($owner->guid, true); // handle case where friends don't have any files if (empty($content)) { - $area2 .= elgg_view('page_elements/contentwrapper',array('body' => elgg_echo("file:none"))); + $area2 .= "

".elgg_echo("file:none")."

"; } else { $area2 .= $content; } - - $body = elgg_view_layout('two_column_left_sidebar',$area1, $area2); + $content = "
".$area1.$area2."
"; + $body = elgg_view_layout('one_column_with_sidebar', $content); page_draw($title, $body); ?> \ No newline at end of file diff --git a/mod/file/index.php b/mod/file/index.php index af3d4c471..e05f98eb2 100644 --- a/mod/file/index.php +++ b/mod/file/index.php @@ -20,11 +20,11 @@ //set the title if (page_owner() == get_loggedin_userid()) { $title = elgg_echo('file:yours'); + $area1 = elgg_view('page_elements/content_header', array('context' => "mine", 'type' => 'file')); } else { $title = sprintf(elgg_echo("file:user"),page_owner_entity()->name); + $area1 = elgg_view('page_elements/content_header', array('context' => "friends", 'type' => 'file')); } - - $area2 = elgg_view_title($title); // Get objects set_context('search'); @@ -33,12 +33,12 @@ set_context('file'); $get_filter = get_filetype_cloud(page_owner()); if ($get_filter) { - $area1 = $get_filter; + $area1 .= $get_filter; } else { - $area2 .= elgg_view('page_elements/contentwrapper',array('body' => elgg_echo("file:none"))); + $area2 .= "

".elgg_echo("file:none")."

"; } - - $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + $content = "
".$area1.$area2."
"; + $body = elgg_view_layout('one_column_with_sidebar', $content); page_draw($title, $body); ?> \ No newline at end of file diff --git a/mod/file/languages/en.php b/mod/file/languages/en.php index ac3795cfb..619434e66 100644 --- a/mod/file/languages/en.php +++ b/mod/file/languages/en.php @@ -15,7 +15,7 @@ */ 'file' => "Files", - 'files' => "Files", + 'files' => "My Files", 'file:yours' => "Your files", 'file:yours:friends' => "Your friends' files", 'file:user' => "%s's files", @@ -33,7 +33,7 @@ 'file:upload' => "Upload a file", 'file:replace' => 'Replace file content (leave blank to not change file)', - 'file:newupload' => 'New file upload', + 'file:new' => 'Upload a file', 'file:file' => "File", 'file:title' => "Title", diff --git a/mod/file/search.php b/mod/file/search.php index ea85e862d..9907b02e3 100644 --- a/mod/file/search.php +++ b/mod/file/search.php @@ -50,14 +50,18 @@ if (empty($tag)) { $title = elgg_echo('file:type:all'); $area2 = elgg_view_title(elgg_echo('file:type:all')); + $area2 = elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'file')); } else { $title = sprintf(elgg_echo('searchtitle'),$tag); if (is_array($owner_guid)) { - $area2 = elgg_view_title(elgg_echo("file:friends:type:" . $tag)); + //$area2 = elgg_view_title(elgg_echo("file:friends:type:" . $tag)); + $area2 = elgg_view('page_elements/content_header', array('context' => "friends", 'type' => 'file')); } else if (page_owner() && page_owner() != $_SESSION['guid']) { - $area2 = elgg_view_title(sprintf(elgg_echo("file:user:type:" . $tag),page_owner_entity()->name)); + //$area2 = elgg_view_title(sprintf(elgg_echo("file:user:type:" . $tag),page_owner_entity()->name)); + $area2 = elgg_view('page_elements/content_header', array('context' => "mine", 'type' => 'file')); } else{ - $area2 = elgg_view_title(elgg_echo("file:type:" . $tag)); + //$area2 = elgg_view_title(elgg_echo("file:type:" . $tag)); + $area2 = elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'file')); } } if ($friends) { @@ -82,7 +86,9 @@ set_context("file"); - $body = elgg_view_layout('two_column_left_sidebar',$area1, $area2); + $content = "
".$area1.$area2."
"; + + $body = elgg_view_layout('one_column_with_sidebar', $content); page_draw($title, $body); 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']; diff --git a/mod/file/upload.php b/mod/file/upload.php index d0b503e0c..7aa0553ca 100644 --- a/mod/file/upload.php +++ b/mod/file/upload.php @@ -18,9 +18,9 @@ // Render the file upload page $container_guid = page_owner(); - $area2 = elgg_view_title($title = elgg_echo('file:upload')); - $area2 .= elgg_view("file/upload", array('container_guid' => $container_guid)); - $body = elgg_view_layout('two_column_left_sidebar', '', $area2); + $area1 = elgg_view_title($title = elgg_echo('file:upload')); + $area1 .= elgg_view("file/upload", array('container_guid' => $container_guid)); + $body = elgg_view_layout('one_column_with_sidebar', $area1); page_draw(elgg_echo("file:upload"), $body); diff --git a/mod/file/views/default/file/css.php b/mod/file/views/default/file/css.php index 64642d9de..d6f94b61d 100644 --- a/mod/file/views/default/file/css.php +++ b/mod/file/views/default/file/css.php @@ -9,8 +9,67 @@ * @link http://elgg.org/ */ ?> +.files .entity_listing .entity_listing_info { + width:453px; +} +.files .entity_listing:hover { + background-color: white; +} + + + +/* files - gallery view */ +.entity_gallery_item .filerepo_gallery_item { + margin:10px 10px 0 0; + padding:5px; + text-align:center; + background-color: #eeeeee; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + width:165px; +} +.entity_gallery_item .filerepo_gallery_item:hover { + background-color: #333333; +} +.filerepo_download, +.filerepo_controls { + padding:0 0 1px 0; + margin:0 0 10px 0; +} +.entity_gallery .filerepo_title { + font-weight: bold; + line-height: 1.1em; + margin:0 0 10px 0; +} +.filerepo_gallery_item p { + margin:0; + padding:0; +} +.filerepo_gallery_item .filerepo_controls { + margin-top:10px; +} +.filerepo_gallery_item .filerepo_controls a { + padding-right:10px; + padding-left:10px; +} +.entity_gallery .filerepo_comments { + font-size:90%; +} +.filerepo_user_gallery_link { + float:right; + margin:5px 5px 5px 50px; +} +.filerepo_user_gallery_link a { + padding:2px 25px 5px 0; + background: transparent url(_graphics/icon_gallery.gif) no-repeat right top; + display:block; +} +.filerepo_user_gallery_link a:hover { + background-position: right -40px; +} +/* p.filerepo_owner { margin:0; padding:0; @@ -47,8 +106,10 @@ p.filerepo_owner { color:white; text-decoration: none; } +*/ /* FILE REPRO WIDGET VIEW */ +/* .filerepo_widget_singleitem { margin:0 0 5px 0; padding:5px; @@ -97,8 +158,10 @@ p.filerepo_owner { margin:0 10px 0 10px; background: none; } +*/ /* widget gallery view */ +/* #filerepo_widget_layout .filerepo_widget_galleryview { -webkit-border-radius: 8px; -moz-border-radius: 8px; @@ -113,59 +176,10 @@ p.filerepo_owner { .filerepo_widget_galleryview img:hover { border:1px solid #333333; } +*/ -/* SINGLE ITEM VIEW */ -.filerepo_file { - background:white; - margin:10px 10px 0 10px; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; -} -.filerepo_file .filerepo_title_owner_wrapper { - min-height:60px; - -} -.filerepo_title_owner_wrapper .filerepo_title, -.filerepo_title_owner_wrapper .filerepo_owner { - margin-left: 70px !important; -} -.filerepo_file .filerepo_maincontent { - padding:0 20px 0 0; -} -.filerepo_file .filerepo_icon { - width: 70px; - position: absolute; - margin:10px 0 10px 10px; -} -.filerepo_file .filerepo_title { - margin:0; - padding:7px 4px 10px 10px; - line-height: 1.2em; -} -.filerepo_file .filerepo_owner { - padding:0 0 0 10px; -} -.filerepo_file .filerepo_description { - margin:10px 0 0 0; - padding:0 0 0 10px; -} -.filerepo_download, -.filerepo_controls { - padding:0 0 1px 10px; - margin:0 0 10px 0; -} -.filerepo_file .filerepo_description p { - padding:0 0 5px 0; - margin:0; -} -.filerepo_file .filerepo_specialcontent img { - padding:10px; - margin:0 0 0 10px; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - background: black; -} /* zaudio player */ +/* .filerepo_maincontent .filerepo_specialcontent { margin:0 0 20px 0; } @@ -173,52 +187,9 @@ p.filerepo_owner { padding:0 0 10px 10px; margin:0; } +*/ -/* file repro gallery items */ -.search_gallery .filerepo_controls { - padding:0; -} -.search_gallery .filerepo_title { - font-weight: bold; - line-height: 1.1em; - margin:0 0 10px 0; -} -.filerepo_gallery_item { - margin:0; - padding:0; - text-align:center; - -} -.filerepo_gallery_item p { - margin:0; - padding:0; -} -.filerepo_gallery_item .filerepo_controls { - margin-top:10px; -} -.filerepo_gallery_item .filerepo_controls a { - padding-right:10px; - padding-left:10px; -} -.search_gallery .filerepo_comments { - font-size:90%; -} - -.filerepo_user_gallery_link { - float:right; - margin:5px 5px 5px 50px; -} -.filerepo_user_gallery_link a { - padding:2px 25px 5px 0; - background: transparent url(_graphics/icon_gallery.gif) no-repeat right top; - display:block; -} -.filerepo_user_gallery_link a:hover { - background-position: right -40px; -} -/* IE6 */ -* html #description_tbl { width:676px !important;} diff --git a/mod/file/views/default/file/groupprofile_files.php b/mod/file/views/default/file/groupprofile_files.php index 778de3301..444398522 100644 --- a/mod/file/views/default/file/groupprofile_files.php +++ b/mod/file/views/default/file/groupprofile_files.php @@ -1,20 +1,18 @@ files_enable != 'no'){ ?> @@ -66,7 +64,6 @@ $('a.show_file_desc').click(function () { } ?> -
- - - - -
-
+ -
-
+

-
-
+ \ No newline at end of file diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index 9568074b2..da555772d 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -28,21 +28,21 @@ if (get_context() == "search") { // Start search listing version if (get_input('search_viewtype') == "gallery") { - echo "