From b46b9b1464249916d105ee46f0bdb7972863070d Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 10 Nov 2011 07:00:44 -0500 Subject: moved upload forms to new location --- views/default/forms/tidypics/ajax_upload.php | 141 ++++++++++++++++++++++++++ views/default/forms/tidypics/basic_upload.php | 104 +++++++++++++++++++ views/default/tidypics/forms/ajax_upload.php | 137 ------------------------- views/default/tidypics/forms/setupFlickr.php | 45 -------- views/default/tidypics/forms/upload.php | 103 ------------------- 5 files changed, 245 insertions(+), 285 deletions(-) create mode 100644 views/default/forms/tidypics/ajax_upload.php create mode 100644 views/default/forms/tidypics/basic_upload.php delete mode 100644 views/default/tidypics/forms/ajax_upload.php delete mode 100644 views/default/tidypics/forms/setupFlickr.php delete mode 100644 views/default/tidypics/forms/upload.php (limited to 'views') diff --git a/views/default/forms/tidypics/ajax_upload.php b/views/default/forms/tidypics/ajax_upload.php new file mode 100644 index 000000000..a1d13e80b --- /dev/null +++ b/views/default/forms/tidypics/ajax_upload.php @@ -0,0 +1,141 @@ +salt); + +$basic_uploader_url = current_page_url() . '/basic'; +$upload_endpoint_url = "{$vars['url']}action/tidypics/ajax_upload/"; +$upload_complete_url = "{$vars['url']}action/tidypics/ajax_upload_complete/"; + +$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); +if (!$maxfilesize) { + $maxfilesize = 5; +} + +$quota = get_plugin_setting('quota','tidypics'); +if ($quota) { + $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); + $image_repo_size = (int)$image_repo_size_md->value; + $image_repo_size = $image_repo_size / 1024 / 1024; + $quote_percentage = round(100 * ($image_repo_size / $quota)); + // for small quotas, so one decimal place + if ($quota < 10) { + $image_repo_size = sprintf('%.1f', $image_repo_size); + } else { + $image_repo_size = round($image_repo_size); + } + if ($image_repo_size > $quota) { + $image_repo_size = $quota; + } +} + +?> + +
+ +

+ + +
+ + diff --git a/views/default/forms/tidypics/basic_upload.php b/views/default/forms/tidypics/basic_upload.php new file mode 100644 index 000000000..55ab854a4 --- /dev/null +++ b/views/default/forms/tidypics/basic_upload.php @@ -0,0 +1,104 @@ +access_id; + +$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); +if (!$maxfilesize) { + $maxfilesize = 5; +} + +$quota = get_plugin_setting('quota','tidypics'); +if ($quota) { + $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); + $image_repo_size = (int)$image_repo_size_md->value; + $image_repo_size = $image_repo_size / 1024 / 1024; + $quote_percentage = round(100 * ($image_repo_size / $quota)); + // for small quotas, so one decimal place + if ($quota < 10) { + $image_repo_size = sprintf('%.1f', $image_repo_size); + } else { + $image_repo_size = round($image_repo_size); + } + if ($image_repo_size > $quota) { + $image_repo_size = $quota; + } +} + +?> +
+
+ +

+
+
+ +
+ +

+
+
...
+
+
    + ' . elgg_view("input/file",array('internalname' => "upload_$x")) . ''; + } + ?> +
+

+

+ guid . '" />'; + } + if ($access_id) { + echo ''; + } + ?> + " onclick="displayProgress();" /> +

+ +
+ \ No newline at end of file diff --git a/views/default/tidypics/forms/ajax_upload.php b/views/default/tidypics/forms/ajax_upload.php deleted file mode 100644 index 4a7a05c0c..000000000 --- a/views/default/tidypics/forms/ajax_upload.php +++ /dev/null @@ -1,137 +0,0 @@ -salt); - -$basic_uploader_url = current_page_url() . '/basic'; -$upload_endpoint_url = "{$vars['url']}action/tidypics/ajax_upload/"; -$upload_complete_url = "{$vars['url']}action/tidypics/ajax_upload_complete/"; - -$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); -if (!$maxfilesize) { - $maxfilesize = 5; -} - -$quota = get_plugin_setting('quota','tidypics'); -if ($quota) { - $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); - $image_repo_size = (int)$image_repo_size_md->value; - $image_repo_size = $image_repo_size / 1024 / 1024; - $quote_percentage = round(100 * ($image_repo_size / $quota)); - // for small quotas, so one decimal place - if ($quota < 10) { - $image_repo_size = sprintf('%.1f', $image_repo_size); - } else { - $image_repo_size = round($image_repo_size); - } - if ($image_repo_size > $quota) { - $image_repo_size = $quota; - } -} - -?> - -
- -

- - -
- - - diff --git a/views/default/tidypics/forms/setupFlickr.php b/views/default/tidypics/forms/setupFlickr.php deleted file mode 100644 index 6c461176d..000000000 --- a/views/default/tidypics/forms/setupFlickr.php +++ /dev/null @@ -1,45 +0,0 @@ -guid, "flickr_username" ); -$flickr_album_id = get_metadata_byname( $user->guid, "flickr_album_id" ); - -$action = $vars['url'] . 'admin/action/tidypics/flickrSetup'; - -$form_body = "

". elgg_echo( 'flickr:intro' ) . "

"; -$form_body .= elgg_echo( 'flickr:usernamesetup') . "
"; -$form_body .= ""; - -$albums = elgg_get_entities(array( - "type=" => "object", - "subtype" => "album", - "owner_guid" => $user->guid, -)); -$options = array( 0 => elgg_echo( 'flickr:selectalbum' )); -foreach( $albums as $album ) { - $title = $album->title; - switch( $album->access_id ) { - case ACCESS_PRIVATE: - $title .= " (" . elgg_echo( 'private' ) . ")"; - break; - case ACCESS_PUBLIC: - $title .= " (" . elgg_echo( 'public' ) . ")"; - break; - default: - $title .= " (no known permission set)"; - break; - } - $options[$album->guid] = $title; -} - -$form_body .= "
" . elgg_echo( 'flickr:albumdesc' ); -$form_body .= elgg_view('input/pulldown', array('internalname' => 'album_id', - 'options_values' => $options, - 'value' => $flickr_album_id->value )); -$form_body .= "
"; -$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); - -flickr_menu(); - -echo elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/tidypics/forms/upload.php b/views/default/tidypics/forms/upload.php deleted file mode 100644 index 8bbda08b3..000000000 --- a/views/default/tidypics/forms/upload.php +++ /dev/null @@ -1,103 +0,0 @@ -access_id; - -$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); -if (!$maxfilesize) { - $maxfilesize = 5; -} - -$quota = get_plugin_setting('quota','tidypics'); -if ($quota) { - $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); - $image_repo_size = (int)$image_repo_size_md->value; - $image_repo_size = $image_repo_size / 1024 / 1024; - $quote_percentage = round(100 * ($image_repo_size / $quota)); - // for small quotas, so one decimal place - if ($quota < 10) { - $image_repo_size = sprintf('%.1f', $image_repo_size); - } else { - $image_repo_size = round($image_repo_size); - } - if ($image_repo_size > $quota) { - $image_repo_size = $quota; - } -} - -?> -

-
- -

-
-
- -
- -

-
-
...
-
-
    - ' . elgg_view("input/file",array('internalname' => "upload_$x")) . ''; - } - ?> -
-

-

- guid . '" />'; - } - if ($access_id) { - echo ''; - } - ?> - " onclick="displayProgress();" /> -

- "{$vars['url']}action/tidypics/upload", - 'body' => $form_body, - 'internalid' => 'tidypicsUpload', - 'enctype' => 'multipart/form-data', - 'method' => 'post',) -); -?> -
- \ No newline at end of file -- cgit v1.2.3