summaryrefslogtreecommitdiffstats
path: root/wp-admin
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-15 11:31:33 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-15 11:31:33 +0000
commit3e5dd9c91c401c1489dab6debc2bcf5bc9b3f26a (patch)
tree2f36d6e6009bd0f711786d8cc00183b4ff5ca10c /wp-admin
parenteb7857f7c040f22d42f13af86e8ae990bbc8f6be (diff)
downloadwordpress-mu-3e5dd9c91c401c1489dab6debc2bcf5bc9b3f26a.tar.gz
wordpress-mu-3e5dd9c91c401c1489dab6debc2bcf5bc9b3f26a.tar.xz
wordpress-mu-3e5dd9c91c401c1489dab6debc2bcf5bc9b3f26a.zip
Move custom upload functions into mu.php
Added get_space_allowed() git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1071 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin')
-rw-r--r--wp-admin/includes/mu.php25
-rw-r--r--wp-admin/includes/upload.php24
2 files changed, 25 insertions, 24 deletions
diff --git a/wp-admin/includes/mu.php b/wp-admin/includes/mu.php
index 8599860..3f23e5f 100644
--- a/wp-admin/includes/mu.php
+++ b/wp-admin/includes/mu.php
@@ -199,4 +199,29 @@ function get_site_allowed_themes() {
return $allowed_themes;
}
+
+function get_space_allowed() {
+ $spaceAllowed = get_option("blog_upload_space");
+ if( $spaceAllowed == false )
+ $spaceAllowed = get_site_option("blog_upload_space");
+ if(empty($spaceAllowed) || !is_numeric($spaceAllowed)) $spaceAllowed = 50;
+
+ return $spaceAllowed;
+}
+
+function display_space_usage() {
+ $space = get_space_allowed();
+ $percentused = ( intval( get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ) )/1024/1024 ) / $space ) * 100;
+
+ if( $space > 1000 ) {
+ $space = number_format( $space / 1024 );
+ $space .= "GB";
+ } else {
+ $space .= "MB";
+ }
+ ?>
+ <strong>Used: <?php echo number_format( $percentused ) ?>% of <?php echo $space ?></strong>
+ <?php
+}
+
?>
diff --git a/wp-admin/includes/upload.php b/wp-admin/includes/upload.php
index 61b042b..9d3fda1 100644
--- a/wp-admin/includes/upload.php
+++ b/wp-admin/includes/upload.php
@@ -183,30 +183,6 @@ function wp_upload_form() {
<?php
}
-function display_space_usage() {
- $space = get_space_allowed();
- $percentused = ( intval( get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ) )/1024/1024 ) / $space ) * 100;
- $buymore = '';
- if( $space < 10000 )
- $buymore = '<a target="_blank" title="opens in new window" href="/wp-admin/paid-upgrades.php">Buy more</a>'; // open in new window in case they have a post open
-
- /*
- if( $space < 10000 ) {
- $buymore = '<a target="_blank" title="opens in new window" href="/wp-admin/paid-upgrades.php">Buy more space</a>'; // open in new window in case they have a post open
- if( get_option( 'use_upgraded_upload_filetypes' ) != '1' ) { $buymore .= __( " and you can upload " ) . str_replace( " ", ", ", get_site_option( "upgraded_upload_filetypes" ) ) . __(" files");}
- }
- */
- if( $space > 1000 ) {
- $space = number_format( $space / 1024 );
- $space .= "GB";
- } else {
- $space .= "MB";
- }
- ?>
- <strong>Used: <?php echo number_format( $percentused ) ?>% of <?php echo $space . ". $buymore" ?></strong>
- <?php
-}
-
function wp_upload_tab_upload() {
wp_upload_form();
}