aboutsummaryrefslogtreecommitdiff
path: root/views/default/tidypics
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/tidypics')
-rw-r--r--views/default/tidypics/forms/ajax_upload.php137
-rw-r--r--views/default/tidypics/forms/setupFlickr.php45
-rw-r--r--views/default/tidypics/forms/upload.php103
3 files changed, 0 insertions, 285 deletions
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 @@
-<?php
-
-elgg_extend_view('metatags', 'tidypics/js/uploader');
-
-$album = $vars['album'];
-
-$ts = time();
-$token = generate_action_token($ts);
-$batch = time();
-$tidypics_token = md5(session_id() . get_site_secret() . $ts . get_loggedin_user()->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;
- }
-}
-
-?>
-
-<div class="contentWrapper">
-
- <p><?php echo sprintf(elgg_echo('tidypics:uploader:instructs'), $basic_uploader_url); ?></p>
-
- <ul id="tidypics_uploader_steps">
- <li>
- <div id="tidypics_uploader">
- <a id="tidypics_choose_button" href="<?php echo $basic_uploader_url; ?>">
- 1. <?php echo elgg_echo('tidypics:uploader:choose'); ?>
- </a>
- <div id="tidypics_flash_uploader">
- <input type="file" id="uploadify" name="uploadify" />
- </div>
- </div>
- </li>
- <li>
- <a id="tidypics_upload_button" class="tidypics_disable" href="javascript:$('#uploadify').uploadifyUpload();">
- 2. <?php echo elgg_echo('tidypics:uploader:upload'); ?>
- </a>
- </li>
- <li>
- <a id="tidypics_describe_button" class="tidypics_disable" href="<?php echo $vars['url']; ?>pg/photos/batch/<?php echo $batch; ?>">
- 3. <?php echo elgg_echo('tidypics:uploader:describe'); ?>
- </a>
- </li>
- </ul>
-</div>
-
-<script type="text/javascript">
-
-$("#uploadify").uploadify({
- 'uploader' : '<?php echo $vars['url']; ?>mod/tidypics/vendors/uploadify/uploadify.swf',
- 'script' : '<?php echo $upload_endpoint_url; ?>',
- 'scriptData' : {
- 'album_guid' : '<?php echo $album->guid; ?>',
- 'user_guid' : '<?php echo get_loggedin_userid(); ?>',
- '__elgg_token' : '<?php echo $token; ?>',
- '__elgg_ts' : '<?php echo $ts; ?>',
- 'Elgg' : '<?php echo session_id(); ?>',
- 'tidypics_token' : '<?php echo $tidypics_token; ?>',
- 'batch' : '<?php echo $batch; ?>'
- },
- 'fileDataName' : 'Image',
- 'cancelImg' : '<?php echo $vars['url']; ?>_graphics/icon_customise_remove.gif',
- 'multi' : true,
- 'auto' : false,
- 'wmode' : 'transparent',
- 'buttonImg' : " ",
- 'height' : 20,
- 'width' : 130,
- 'onEmbedFlash' : function(event) {
- $("#" + event.id).hover(
- function(){
- $("#tidypics_choose_button").addClass('tidypics_choose_button_hover');
- },
- function(){
- $("#tidypics_choose_button").removeClass('tidypics_choose_button_hover');
- }
- );
- },
- 'onSelectOnce' : function() {
- $("#tidypics_upload_button").removeClass('tidypics_disable');
- },
- 'onAllComplete' : function() {
- $("#tidypics_choose_button").addClass('tidypics_disable');
- $("#tidypics_upload_button").addClass('tidypics_disable');
- $("#tidypics_choose_button").attr("href", "javascript:void(0)");
- $("#tidypics_upload_button").attr("href", "javascript:void(0)");
-
- $("#tidypics_describe_button").removeClass('tidypics_disable');
- $.post(
- '<?php echo $upload_complete_url; ?>',
- {
- album_guid : '<?php echo $album->guid; ?>',
- __elgg_token : '<?php echo $token; ?>',
- __elgg_ts : '<?php echo $ts; ?>',
- batch : '<?php echo $batch; ?>'
- }
- );
- },
- 'onComplete' : function(event, queueID, fileObj, response) {
- // check for errors here
- if (response != 'success') {
- $("#uploadify" + queueID + " .percentage").text(" - " + response);
- $("#uploadify" + queueID).addClass('uploadifyError');
- }
- $("#uploadify" + queueID + " > .cancel").remove();
- return false;
- },
- 'onCancel' : function(event, queueID, fileObj, data) {
- if (data.fileCount == 0) {
- $("#tidypics_upload_button").addClass('tidypics_disable');
- }
- }
-
-});
-</script>
-
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 @@
-<?php
-require_once( dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . "/lib/flickr.php";
-
-$user = get_loggedin_user();
-$flickr_username = get_metadata_byname( $user->guid, "flickr_username" );
-$flickr_album_id = get_metadata_byname( $user->guid, "flickr_album_id" );
-
-$action = $vars['url'] . 'admin/action/tidypics/flickrSetup';
-
-$form_body = "<p>". elgg_echo( 'flickr:intro' ) . "</p><p>";
-$form_body .= elgg_echo( 'flickr:usernamesetup') . " <input style='width: 20%;' type='text' name='flickr_username' value='$flickr_username->value' ' class='input-text' /> <br />";
-$form_body .= "<input type='hidden' name='return_url' value='$_SERVER[REQUEST_URI]' />";
-
-$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 .= "<br />" . elgg_echo( 'flickr:albumdesc' );
-$form_body .= elgg_view('input/pulldown', array('internalname' => 'album_id',
- 'options_values' => $options,
- 'value' => $flickr_album_id->value ));
-$form_body .= "<br />";
-$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 @@
-<?php
-global $CONFIG;
-
-//this is for image uploads only. Image edits are handled by edit.php form
-
-$album = $vars['album'];
-$access_id = $album->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;
- }
-}
-
-?>
-<div id="tidypics_ref"></div>
-<div class="contentWrapper">
- <?php
- ob_start();
- ?>
- <p style="line-height:1.6em;">
- <label><?php echo elgg_echo("tidypics:uploader:upload"); ?></label><br />
- <i><?php echo sprintf(elgg_echo('tidypics:uploader:basic'), $maxfilesize); ?></i><br />
- <?php
- if ($quota) {
- ?>
- <i><?php echo elgg_echo("tidypics:quota") . ' ' . $image_repo_size . '/' . $quota . " MB ({$quote_percentage}%)"; ?></i><br />
- <?php
- }
- ?>
- <div class="tidypics_popup">
- <?php echo elgg_echo("tidypics:uploading:images"); ?><br />
- <div style="margin:20px 0px 20px 80px;"><img id="progress" alt="..." border="0" src="<?php echo $vars['url'].'mod/tidypics/graphics/loader.gif' ?>" /></div>
- </div>
- <ol id="tidypics_image_upload_list">
- <?php
- for ($x = 0; $x < 10; $x++) {
- echo '<li>' . elgg_view("input/file",array('internalname' => "upload_$x")) . '</li>';
- }
- ?>
- </ol>
-</p>
-<p>
- <?php
- if ($album) {
- echo '<input type="hidden" name="album_guid" value="' . $album->guid . '" />';
- }
- if ($access_id) {
- echo '<input type="hidden" name="access_id" value="' . $access_id . '" />';
- }
- ?>
- <input type="submit" value="<?php echo elgg_echo("save"); ?>" onclick="displayProgress();" />
-</p>
-<?php
-$form_body = ob_get_clean();
-
-echo elgg_view('input/form', array(
- 'action' => "{$vars['url']}action/tidypics/upload",
- 'body' => $form_body,
- 'internalid' => 'tidypicsUpload',
- 'enctype' => 'multipart/form-data',
- 'method' => 'post',)
-);
-?>
-</div>
-<script type="text/javascript">
-
- function displayProgress()
- {
- offsetY = 60;
- offsetX = 120;
-
- divWidth = $('#tidypics_ref').width();
- imgOffset = $('#tidypics_ref').offset();
- imgWidth = $('#tidypics_ref').width();
-
- _top = imgOffset.top + offsetY;
- _left = imgOffset.left + offsetX;
-
- $('.tidypics_popup').show().css({
- "top": _top + "px",
- "left": _left + "px"
- });
-
- setTimeout('document.images["progress"].src = "<?php echo $vars['url'].'mod/tidypics/graphics/loader.gif' ?>"', 200);
- }
-</script> \ No newline at end of file