diff options
Diffstat (limited to 'mod/file')
-rw-r--r-- | mod/file/actions/file/upload.php | 6 | ||||
-rw-r--r-- | mod/file/languages/en.php | 2 | ||||
-rw-r--r-- | mod/file/manifest.xml | 1 | ||||
-rw-r--r-- | mod/file/pages/file/friends.php | 3 | ||||
-rw-r--r-- | mod/file/pages/file/owner.php | 3 | ||||
-rw-r--r-- | mod/file/views/default/file/group_module.php | 2 | ||||
-rw-r--r-- | mod/file/views/default/icon/object/file.php | 1 | ||||
-rw-r--r-- | mod/file/views/default/object/file.php | 2 | ||||
-rw-r--r-- | mod/file/views/default/widgets/filerepo/content.php | 1 |
9 files changed, 18 insertions, 3 deletions
diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php index ee2889b4c..3edc87952 100644 --- a/mod/file/actions/file/upload.php +++ b/mod/file/actions/file/upload.php @@ -19,6 +19,11 @@ if ($container_guid == 0) { elgg_make_sticky_form('file'); +// check if upload failed +if (!empty($_FILES['upload']['name']) && $_FILES['upload']['error'] != 0) { + register_error(elgg_echo('file:cannotload')); + forward(REFERER); +} // check whether this is a new file or an edit $new_file = true; @@ -29,7 +34,6 @@ if ($guid > 0) { if ($new_file) { // must have a file if a new file upload if (empty($_FILES['upload']['name'])) { - $error = elgg_echo('file:nofile'); register_error($error); forward(REFERER); diff --git a/mod/file/languages/en.php b/mod/file/languages/en.php index aa30084a9..96fbd1c48 100644 --- a/mod/file/languages/en.php +++ b/mod/file/languages/en.php @@ -100,7 +100,7 @@ $english = array( 'file:downloadfailed' => "Sorry; this file is not available at this time.", 'file:deletefailed' => "Your file could not be deleted at this time.", 'file:noaccess' => "You do not have permissions to change this file", - 'file:cannotload' => "There was an error loading the file", + 'file:cannotload' => "There was an error uploading the file", 'file:nofile' => "You must select a file", ); diff --git a/mod/file/manifest.xml b/mod/file/manifest.xml index aac9c3f6b..8a80e38dc 100644 --- a/mod/file/manifest.xml +++ b/mod/file/manifest.xml @@ -14,6 +14,5 @@ <type>elgg_version</type> <version>2010030101</version> </requires> - <admin_interface>simple</admin_interface> <activate_on_install>true</activate_on_install> </plugin_manifest> diff --git a/mod/file/pages/file/friends.php b/mod/file/pages/file/friends.php index 0b351efaf..f504bdc1f 100644 --- a/mod/file/pages/file/friends.php +++ b/mod/file/pages/file/friends.php @@ -6,6 +6,9 @@ */ $owner = elgg_get_page_owner_entity(); +if (!$owner) { + forward('file/all'); +} elgg_push_breadcrumb(elgg_echo('file'), "file/all"); elgg_push_breadcrumb($owner->name, "file/owner/$owner->username"); diff --git a/mod/file/pages/file/owner.php b/mod/file/pages/file/owner.php index 4e2ec89d4..fb87af1b2 100644 --- a/mod/file/pages/file/owner.php +++ b/mod/file/pages/file/owner.php @@ -9,6 +9,9 @@ group_gatekeeper(); $owner = elgg_get_page_owner_entity(); +if (!$owner) { + forward('file/all'); +} elgg_push_breadcrumb(elgg_echo('file'), "file/all"); elgg_push_breadcrumb($owner->name); diff --git a/mod/file/views/default/file/group_module.php b/mod/file/views/default/file/group_module.php index c37b13927..ad6c58dbb 100644 --- a/mod/file/views/default/file/group_module.php +++ b/mod/file/views/default/file/group_module.php @@ -12,6 +12,7 @@ if ($group->file_enable == "no") { $all_link = elgg_view('output/url', array( 'href' => "file/group/$group->guid/all", 'text' => elgg_echo('link:view:all'), + 'is_trusted' => true, )); elgg_push_context('widgets'); @@ -33,6 +34,7 @@ if (!$content) { $new_link = elgg_view('output/url', array( 'href' => "file/add/$group->guid", 'text' => elgg_echo('file:add'), + 'is_trusted' => true, )); echo elgg_view('groups/profile/module', array( diff --git a/mod/file/views/default/icon/object/file.php b/mod/file/views/default/icon/object/file.php index 7feba7af3..ff729da94 100644 --- a/mod/file/views/default/icon/object/file.php +++ b/mod/file/views/default/icon/object/file.php @@ -36,6 +36,7 @@ if ($url) { $params = array( 'href' => $url, 'text' => $img, + 'is_trusted' => true, ); if (isset($vars['link_class'])) { $params['class'] = $vars['link_class']; diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index 95e190d35..fbd585b8a 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -24,6 +24,7 @@ $body = elgg_view('output/longtext', array('value' => $file->description)); $owner_link = elgg_view('output/url', array( 'href' => "file/owner/$owner->username", 'text' => $owner->name, + 'is_trusted' => true, )); $author_text = elgg_echo('byline', array($owner_link)); @@ -39,6 +40,7 @@ if ($comments_count != 0) { $comments_link = elgg_view('output/url', array( 'href' => $file->getURL() . '#file-comments', 'text' => $text, + 'is_trusted' => true, )); } else { $comments_link = ''; diff --git a/mod/file/views/default/widgets/filerepo/content.php b/mod/file/views/default/widgets/filerepo/content.php index 4288b9e56..f3e152de3 100644 --- a/mod/file/views/default/widgets/filerepo/content.php +++ b/mod/file/views/default/widgets/filerepo/content.php @@ -25,6 +25,7 @@ if ($content) { $more_link = elgg_view('output/url', array( 'href' => $url, 'text' => elgg_echo('file:more'), + 'is_trusted' => true, )); echo "<span class=\"elgg-widget-more\">$more_link</span>"; } else { |