summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gallery.common.css46
-rw-r--r--lib/uploadify/cancel.pngbin0 -> 603 bytes
-rw-r--r--lib/uploadify/jquery.uploadify.min.js26
-rw-r--r--lib/uploadify/uploadify.allglyphs.swfbin0 -> 239838 bytes
-rw-r--r--lib/uploadify/uploadify.css53
-rw-r--r--lib/uploadify/uploadify.flabin0 -> 125952 bytes
-rw-r--r--lib/uploadify/uploadify.swfbin0 -> 23118 bytes
-rw-r--r--modules/gallery/controllers/simple_uploader.php2
-rw-r--r--modules/gallery/css/gallery.css76
-rw-r--r--modules/gallery/helpers/gallery_theme.php1
-rw-r--r--modules/gallery/views/simple_uploader.html.php356
-rw-r--r--modules/slideshow/helpers/slideshow_event.php16
-rw-r--r--modules/slideshow/helpers/slideshow_theme.php2
-rw-r--r--themes/night_wind/css/screen.css70
14 files changed, 259 insertions, 389 deletions
diff --git a/lib/gallery.common.css b/lib/gallery.common.css
index c80dc90f..7fbb9db0 100644
--- a/lib/gallery.common.css
+++ b/lib/gallery.common.css
@@ -593,6 +593,52 @@ div#g-action-status {
margin-left: 0;
}
+/* Simple uploader ~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-add-photos-canvas {
+ border: 1px solid #ccc;
+ height: 200px;
+ margin: .5em 0;
+ overflow: auto;
+ width: 469px;
+}
+
+#g-add-photos-status {
+ border: 1px solid #ccc;
+ height: 125px;
+ margin: .5em 0;
+ overflow: auto;
+ width: 469px;
+}
+
+#g-add-photos button {
+ float: right;
+ margin-bottom: .5em;
+ margin-left: .5em;
+}
+
+#g-add-photos-status li {
+ text-align: left;
+ padding-left: 2em;
+}
+
+#g-add-photos-status li.g-success {
+ background: #d9efc2 url('images/ico-success.png') no-repeat .4em 50%;
+}
+
+#g-add-photos-status li.g-error {
+ background: #f6cbca url('images/ico-error.png') no-repeat .4em 50%;
+/* color: #f00;*/
+}
+
+#g-add-photos p {
+ margin: 0
+}
+
+#g-add-photos .g-breadcrumbs li {
+ padding-top: .5em;
+}
+
/** *******************************************************************
* 7) Right to left language styles
**********************************************************************/
diff --git a/lib/uploadify/cancel.png b/lib/uploadify/cancel.png
new file mode 100644
index 00000000..1c062ae5
--- /dev/null
+++ b/lib/uploadify/cancel.png
Binary files differ
diff --git a/lib/uploadify/jquery.uploadify.min.js b/lib/uploadify/jquery.uploadify.min.js
new file mode 100644
index 00000000..43053119
--- /dev/null
+++ b/lib/uploadify/jquery.uploadify.min.js
@@ -0,0 +1,26 @@
+/*
+Uploadify v2.1.0
+Release Date: August 24, 2009
+
+Copyright (c) 2009 Ronnie Garcia, Travis Nickels
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('<div id="'+a(this).attr("id")+h+'" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+h+'\')"><img src="'+settings.cancelImg+'" border="0" /></a></div><span class="fileName">'+fileName+" ("+k+l+')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="'+a(this).attr("id")+h+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div></div></div>')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full. The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}return g}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,false)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)}; \ No newline at end of file
diff --git a/lib/uploadify/uploadify.allglyphs.swf b/lib/uploadify/uploadify.allglyphs.swf
new file mode 100644
index 00000000..4bad0117
--- /dev/null
+++ b/lib/uploadify/uploadify.allglyphs.swf
Binary files differ
diff --git a/lib/uploadify/uploadify.css b/lib/uploadify/uploadify.css
new file mode 100644
index 00000000..a0279443
--- /dev/null
+++ b/lib/uploadify/uploadify.css
@@ -0,0 +1,53 @@
+/*
+Uploadify v2.1.0
+Release Date: August 24, 2009
+
+Copyright (c) 2009 Ronnie Garcia, Travis Nickels
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+.uploadifyQueueItem {
+ font: 11px Verdana, Geneva, sans-serif;
+ border: 2px solid #E5E5E5;
+ background-color: #F5F5F5;
+ margin-top: 5px;
+ padding: 10px;
+ width: auto;
+}
+.uploadifyError {
+ border: 2px solid #FBCBBC !important;
+ background-color: #FDE5DD !important;
+}
+.uploadifyQueueItem .cancel {
+ float: right;
+}
+.uploadifyProgress {
+ background-color: #FFFFFF;
+ border-top: 1px solid #808080;
+ border-left: 1px solid #808080;
+ border-right: 1px solid #C5C5C5;
+ border-bottom: 1px solid #C5C5C5;
+ margin-top: 10px;
+ width: 100%;
+}
+.uploadifyProgressBar {
+ background-color: #0099FF;
+ width: 1px;
+ height: 3px;
+}
diff --git a/lib/uploadify/uploadify.fla b/lib/uploadify/uploadify.fla
new file mode 100644
index 00000000..c07bbaf3
--- /dev/null
+++ b/lib/uploadify/uploadify.fla
Binary files differ
diff --git a/lib/uploadify/uploadify.swf b/lib/uploadify/uploadify.swf
new file mode 100644
index 00000000..0385d9e6
--- /dev/null
+++ b/lib/uploadify/uploadify.swf
Binary files differ
diff --git a/modules/gallery/controllers/simple_uploader.php b/modules/gallery/controllers/simple_uploader.php
index bc508319..d43d2f9d 100644
--- a/modules/gallery/controllers/simple_uploader.php
+++ b/modules/gallery/controllers/simple_uploader.php
@@ -79,7 +79,7 @@ class Simple_Uploader_Controller extends Controller {
print "FILEID: $item->id";
} else {
header("HTTP/1.1 400 Bad Request");
- print "ERROR: Invalid Upload";
+ print "ERROR: " . t("Invalid Upload");
}
}
diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css
index 3262dee2..113f0e09 100644
--- a/modules/gallery/css/gallery.css
+++ b/modules/gallery/css/gallery.css
@@ -54,68 +54,6 @@
margin: 0;
}
-/* Simple uploader ~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#g-add-photos #SWFUpload_0 {
- left: 134px;
- position: relative;
- top: -200px;
-}
-
-#g-add-photos-canvas {
- border: 1px solid #ccc;
- height: 325px;
- margin: .5em 0;
- overflow: auto;
- width: 469px;
-}
-
-#g-add-photos button {
- float: right;
- margin-bottom: .5em;
-}
-
-#g-uploadqueue-infobar {
- clear: both;
-}
-
-#g-uploadqueue-infobar #g-cancelupload {
- cursor: pointer;
- display: none;
-}
-
-#g-add-photos-queue .progressbar {
- height: 4px;
-}
-
-#g-add-photos-queue .status {
- font-size: .75em;
-}
-
-#g-add-photos-queue .box {
- padding: .2em;
-}
-
-#g-add-photos-queue .pending {
- background-color: #e8e8e8;
- border: 1px solid #d7d7d7;
-}
-
-#g-add-photos-queue .error {
- background-color: #fcc;
- border: 1px solid #ebb;
-}
-
-#g-add-photos-queue .uploading {
- background-color: #ff9;
- border: 1px solid #ee8;
-}
-
-#g-add-photos-queue .complete {
- background-color: #cfc;
- border: 1px solid #beb;
-}
-
/** *******************************************************************
* 2) Admin
**********************************************************************/
@@ -129,23 +67,23 @@
}
#g-languages-form table {
- width: 40%;
- margin: 0 3em 1em 0;
+ width: 40%;
+ margin: 0 3em 1em 0;
}
#g-languages-form input {
- clear: both;
+ clear: both;
}
#g-translations ol {
- margin: 0 0 1em 2em;
+ margin: 0 0 1em 2em;
}
#g-translations ol li {
list-style-type: decimal;
- line-height: 150%;
+ line-height: 150%;
}
#g-translations .g-button {
- padding: .5em;
- margin-bottom: 1em;
+ padding: .5em;
+ margin-bottom: 1em;
}
diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php
index ab3e7eb5..0018fd9a 100644
--- a/modules/gallery/helpers/gallery_theme.php
+++ b/modules/gallery/helpers/gallery_theme.php
@@ -49,6 +49,7 @@ class gallery_theme_Core {
$theme->script("l10n_client.js");
}
+ $theme->css("uploadify/uploadify.css");
return $buf;
}
diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php
index b9c33d32..8133f6c2 100644
--- a/modules/gallery/views/simple_uploader.html.php
+++ b/modules/gallery/views/simple_uploader.html.php
@@ -1,250 +1,126 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<script type="text/javascript" src="<?= url::file("lib/swfupload/swfupload.js") ?>"></script>
-<script type="text/javascript" src="<?= url::file("lib/swfupload/swfupload.queue.js") ?>"></script>
-<script type="text/javascript" src="<?= url::file("lib/jquery.scrollTo.js") ?>"></script>
+<script type="text/javascript" src="<?= url::file("lib/swfobject.js") ?>"></script>
+<script type="text/javascript" src="<?= url::file("lib/uploadify/jquery.uploadify.min.js") ?>"></script>
+<script type="text/javascript">
+ $("#g-add-photos-canvas").ready(function () {
+ $("#g-uploadify").uploadify({
+ uploader: "<?= url::file("lib/uploadify/uploadify.swf") ?>",
+ script: "<?= url::site("simple_uploader/add_photo/{$item->id}") ?>",
+ scriptData: <?= json_encode(array(
+ "g3sid" => Session::instance()->id(),
+ "user_agent" => Input::instance()->server("HTTP_USER_AGENT"),
+ "csrf" => $csrf)) ?>,
+ fileExt: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4",
+ fileDesc: <?= t("Photos and movies")->for_js() ?>,
+ cancelImg: "<?= url::file("lib/uploadify/cancel.png") ?>",
+ buttonText: <?= t("Select Files")->for_js() ?>,
+ simUploadLimit: 10,
+ auto: true,
+ multi: true,
+ onAllComplete: function(filesUploaded, errors, allbytesLoaded, speed) {
+ $("#g-upload-cancel-all")
+ .addClass("ui-state-disabled")
+ .attr("disabled", "disabled");
+ return true;
+ },
+ onClearQueue: function(event) {
+ $("#g-upload-cancel-all")
+ .addClass("ui-state-disabled")
+ .attr("disabled", "disabled");
+ return true;
+ },
+ onComplete: function(event, queueID, fileObj, response, data) {
+ // @todo handle a response of "Error: xxxx" as an error
+ var re = /^error: (.*)$/i;
+ var msg = re.exec(response);
+ if (msg) {
+ $("#g-add-photos-status ul").append(
+ "<li class=\"g-error\">" + fileObj.name + " - " + msg[1] + "</li>");
+ } else {
+ $("#g-add-photos-status ul").append(
+ "<li class=\"g-success\">" + fileObj.name + "</li>");
+ }
+ return true;
+ },
+
+ onError: function(event, queueID, fileObj, errorObj) {
+ var msg = " - ";
+ if (errorObj.type == "HTTP") {
+ if (errorObj.info == "500") {
+ msg += "Error occurred processing the file";
+ // Server error - check server logs
+ } else if (errorObj.info == "404") {
+ msg += "The upload script was not found.";
+ // Server script not found
+ } else {
+ // Server Error: status: errorObj.info
+ msg += "Error occurred communication with the server, status: " + errorObj.info;
+ }
+ } else if (errorObj.type == "File Size") {
+ var sizelimit = $("#g-uploadify").uploadifySettings(sizeLimit);
+ msg += fileObj.name+' '+errorObj.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB';
+ } else {
+ msg += "Error occurred communication with the server, error " + errorObj.type + ": " + errorObj.info;
+ }
+ $("#g-add-photos-status ul").append(
+ "<li class=\"g-error\">" + fileObj.name + msg + "</li>");
+ $("#g-uploadify" + queueID).remove();
+ //return false;
+ },
+ onSelect: function(event) {
+ if ($("#g-upload-cancel-all").hasClass("ui-state-disabled")) {
+ $("#g-upload-cancel-all")
+ .removeClass("ui-state-disabled")
+ .attr("disabled", null);
+ }
+ return true;
+ }
+ });
+ });
+</script>
-<!-- hack to set the title for the dialog -->
<form id="g-add-photos-form" action="<?= url::site("simple_uploader/finish?csrf=$csrf") ?>">
<fieldset>
<legend> <?= t("Add photos to %album_title", array("album_title" => html::purify($item->title))) ?> </legend>
- </fieldset>
-</form>
-<div id="g-add-photos">
- <? if (ini_get("suhosin.session.encrypt")): ?>
- <ul id="g-action-status" class="g-message-block">
- <li class="g-error">
- <?= t("Error: your server is configured to use the <a href=\"%encrypt_url\"><code>suhosin.session.encrypt</code></a> setting from <a href=\"%suhosin_url\">Suhosin</a>. You must disable this setting to upload photos.",
+ </fieldset>
+ <div id="g-add-photos">
+ <? if (ini_get("suhosin.session.encrypt")): ?>
+ <ul id="g-action-status" class="g-message-block">
+ <li class="g-error">
+ <?= t("Error: your server is configured to use the <a href=\"%encrypt_url\"><code>suhosin.session.encrypt</code></a> setting from <a href=\"%suhosin_url\">Suhosin</a>. You must disable this setting to upload photos.",
array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt",
- "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?>
- </li>
- </ul>
- <? endif ?>
-
- <p>
- <?= t("Photos will be uploaded to album: ") ?>
- </p>
- <ul class="g-breadcrumbs">
- <? $i = 0 ?>
- <? foreach ($item->parents() as $parent): ?>
- <li<? if ($i == 0) print " class=\"g-first\"" ?>> <?= html::clean($parent->title) ?> </li>
- <? $i++ ?>
- <? endforeach ?>
- <li class="g-active"> <?= html::purify($item->title) ?> </li>
- </ul>
-
- <div id="g-uploadqueue-infobar">
- <?= t("Upload queue") ?>
- <span id="g-uploadstatus"></span>
- <a id="g-cancelupload" title="<?= t("Cancel all the pending uploads")->for_html_attr() ?>" onclick="swfu.cancelQueue();"><?= t("cancel") ?></a>
- </div>
- <div id="g-add-photos-canvas" style="text-align: center;">
- <div id="g-add-photos-queue"></div>
- <div id="g-edit-photos-queue"></div>
- </div>
- <span id="g-choose-files-placeholder"></span>
-
- <!-- Proxy the done request back to our form, since its been ajaxified -->
- <button class="ui-state-default ui-corner-all" onclick="$('#g-add-photos-form').submit()">
- <?= t("Done") ?>
- </button>
-</div>
-
-<script type="text/javascript">
- var swfu = new SWFUpload({
- flash_url: <?= html::js_string(url::file("lib/swfupload/swfupload.swf")) ?>,
- upload_url: <?= html::js_string(url::site("simple_uploader/add_photo/$item->id")) ?>,
- post_params: <?= json_encode(array(
- "g3sid" => Session::instance()->id(),
- "user_agent" => Input::instance()->server("HTTP_USER_AGENT"),
- "csrf" => $csrf)) ?>,
- file_size_limit: <?= html::js_string(ini_get("upload_max_filesize") ? num::convert_to_bytes(ini_get("upload_max_filesize"))."B" : "100MB") ?>,
- file_types: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4",
- file_types_description: <?= t("Photos and movies")->for_js() ?>,
- file_upload_limit: 1000,
- file_queue_limit: 0,
- custom_settings: { },
- debug: false,
-
- // Button settings
- button_image_url: <?= html::js_string(url::file(gallery::find_file("images", "select-photos-backg.png"))) ?>,
- button_width: "202",
- button_height: "45",
- button_placeholder_id: "g-choose-files-placeholder",
- button_text: <?= json_encode('<span class="swfUploadFont">' . t("Select photos...") . '</span>') ?>,
- button_text_style: ".swfUploadFont { color: #2E6E9E; font-size: 16px; font-family: Lucida Grande,Lucida Sans,Arial,sans-serif; font-weight: bold; }",
- button_text_left_padding: 30,
- button_text_right_padding: 30,
- button_text_top_padding: 10,
-
- // The event handler functions are defined in handlers.js
- file_queued_handler: file_queued,
- file_queue_error_handler: file_queue_error,
- file_dialog_complete_handler: file_dialog_complete,
- upload_start_handler: upload_start,
- upload_progress_handler: upload_progress,
- upload_error_handler: upload_error,
- upload_success_handler: upload_success,
- upload_complete_handler: upload_complete,
- queue_complete_handler: queue_complete
- });
+ "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?>
+ </li>
+ </ul>
+ <? endif ?>
- // @todo add support for cancelling individual uploads
- function File_Progress(file) {
- this.box = $("#" + file.id);
- if (!this.box.length) {
- $("#g-add-photos-queue").append(
- "<div class=\"box\" id=\"" + file.id + "\">" +
- "<div class=\"title\"></div>" +
- "<div class=\"status\"></div>" +
- "<div class=\"progressbar\"></div>" +
- "</div>");
- this.box = $("#" + file.id);
- }
- this.title = this.box.find(".title");
- this.status = this.box.find(".status");
- this.progress_bar = this.box.find(".progressbar");
- this.progress_bar.progressbar();
- this.progress_bar.css("visibility", "hidden");
- }
+ <div>
+ <p>
+ <?= t("Photos will be uploaded to album: ") ?>
+ </p>
+ <ul class="g-breadcrumbs">
+ <? foreach ($item->parents() as $i => $parent): ?>
+ <li<? if ($i == 0) print " class=\"g-first\"" ?>> <?= html::clean($parent->title) ?> </li>
+ <? endforeach ?>
+ <li class="g-active"> <?= html::purify($item->title) ?> </li>
+ </ul>
+ </div>
- File_Progress.prototype.set_status = function(status_class, msg) {
- this.box.removeClass("pending error uploading complete").addClass(status_class);
- this.status.html(msg);
- }
+ <div id="g-add-photos-canvas" style="text-align: center;">
+ <div id="g-uploadify"></div>
+ </div>
+ <div id="g-add-photos-status" style="text-align: center;">
+ <ul>
+ </ul>
+ </div>
- function file_queued(file) {
- var fp = new File_Progress(file);
- fp.title.html(file.name);
- fp.set_status("pending", <?= t("Pending...")->for_js() ?>);
- // @todo add cancel button to call this.cancelUpload(file.id)
- }
-
- function file_queue_error(file, error_code, message) {
- if (error_code === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
- alert(<?= t("You have attempted to queue too many files.")->for_js() ?>);
- return;
- }
-
- var fp = new File_Progress(file);
- switch (error_code) {
- case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
- fp.title.html(file.name);
- fp.set_status("error", <?= t("<strong>File is too big.</strong> A likely error source is a too low value for <em>upload_max_filesize</em> (%upload_max_filesize) in your <em>php.ini</em>.", array("upload_max_filesize" => ini_get("upload_max_filesize")))->for_js() ?>);
- break;
- case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
- fp.title.html(file.name);
- fp.set_status("error", <?= t("Cannot upload empty files.")->for_js() ?>);
- break;
- case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
- fp.title.html(file.name);
- fp.set_status("error", <?= t("Invalid file type.")->for_js() ?>);
- break;
- default:
- if (file !== null) {
- fp.title.html(file.name);
- fp.set_status("error", <?= t("Unknown error")->for_js() ?>);
- }
- break;
- }
- }
-
- function file_dialog_complete(num_files_selected, num_files_queued) {
- if (num_files_selected > 0) {
- $("#g-cancelupload").show();
- $("#g-uploadstatus").text(get_completed_status_msg(this.getStats()));
- }
-
- // Auto start the upload
- this.startUpload();
- }
-
- function upload_start(file) {
- // Do all file validation on the server side. Update the UI here because in Linux
- // no uploadProgress events are called (limitation in the Linux Flash VM).
- var fp = new File_Progress(file);
- fp.title.html(file.name);
- fp.set_status("uploading", <?= t("Uploading...")->for_js() ?>);
- $("#g-add-photos-canvas").scrollTo(fp.box, 1000);
-
- // move file select button
- $("#SWFUpload_0").css({'left': '0', 'top': '0'});
- swfu.setButtonText(<?= json_encode('<span class="swfUploadFont">' . t("Select more photos...") . '</span>') ?>);
-
- return true;
- // @todo add cancel button to call this.cancelUpload(file.id)
- }
-
- function upload_progress(file, bytes_loaded, bytes_total) {
- var percent = Math.ceil((bytes_loaded / bytes_total) * 100);
- var fp = new File_Progress(file);
- fp.set_status("uploading", <?= t("Uploading...")->for_js() ?>);
- fp.progress_bar.css("visibility", "visible");
- fp.progress_bar.progressbar("value", percent);
- }
-
- function upload_success(file, serverData) {
- var fp = new File_Progress(file);
- fp.progress_bar.progressbar("value", 100);
- fp.set_status("complete", <?= t("Complete.")->for_js() ?>);
- }
-
- function upload_error(file, error_code, message) {
- var fp = new File_Progress(file);
- switch (error_code) {
- case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
- fp.set_status("error", <?= t("Upload error: bad image file")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
- fp.set_status("error", <?= t("Upload failed")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.IO_ERROR:
- fp.set_status("error", <?= t("Server error")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
- fp.set_status("error", <?= t("Security error")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
- fp.set_status("error", <?= t("Upload limit exceeded")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
- fp.set_status("error", <?= t("Failed validation. File skipped")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
- // If there aren't any files left (they were all cancelled) disable the cancel button
- if (this.getStats().files_queued === 0) {
- $("#g-cancelupload").hide();
- }
- fp.set_status("error", <?= t("Cancelled")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
- fp.set_status("error", <?= t("Stopped")->for_js() ?>);
- break;
- default:
- fp.set_status("error", <?= t("Unknown error: ")->for_js() ?> + error_code);
- break;
- }
- }
-
- function upload_complete(file) {
- var stats = this.getStats();
- $("#g-uploadstatus").text(get_completed_status_msg(stats));
- if (stats.files_queued === 0) {
- $("#g-cancelupload").hide();
- }
- }
-
- function get_completed_status_msg(stats) {
- var msg = <?= t("(completed %completed of %total)", array("completed" => "__COMPLETED__", "total" => "__TOTAL__"))->for_js() ?>;
- msg = msg.replace("__COMPLETED__", stats.successful_uploads);
- msg = msg.replace("__TOTAL__", stats.files_queued + stats.successful_uploads +
- stats.upload_errors + stats.upload_cancelled + stats.queue_errors);
- return msg;
- }
-
- // This event comes from the Queue Plugin
- function queue_complete(num_files_uploaded) {
- var status_msg = <?= t("Uploaded: __COUNT__")->for_js() ?>;
- $("#g-upload-status").html(status_msg.replace("__COUNT__", num_files_uploaded));
- }
-</script>
+ <!-- Proxy the done request back to our form, since its been ajaxified -->
+ <button id="g-upload-done" class="ui-state-default ui-corner-all" onclick="$('#g-add-photos-form').submit();return false;">
+ <?= t("Done") ?>
+ </button>
+ <button id="g-upload-cancel-all" class="ui-state-default ui-corner-all ui-state-disabled" onclick="$('#g-uploadify').uploadifyClearQueue();return false;" disabled="disabled">
+ <?= t("Cancel All") ?>
+ </button>
+ </div>
+</form>
diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php
index 0afe8126..099f5fdb 100644
--- a/modules/slideshow/helpers/slideshow_event.php
+++ b/modules/slideshow/helpers/slideshow_event.php
@@ -37,8 +37,8 @@ class slideshow_event_Core {
$menu->append(Menu::factory("link")
->id("slideshow")
->label(t("View slideshow"))
- ->url("javascript:PicLensLite.start(" .
- "{maxScale:0,feedUrl:'" . self::_feed_url($theme) . "'})")
+ ->url("javascript:cooliris.embed.show(" .
+ "{maxScale:0,feed:'" . self::_feed_url($theme) . "'})")
->css_id("g-slideshow-link"));
}
}
@@ -47,8 +47,8 @@ class slideshow_event_Core {
$menu->append(Menu::factory("link")
->id("slideshow")
->label(t("View slideshow"))
- ->url("javascript:PicLensLite.start(" .
- "{maxScale:0,feedUrl:'" . self::_feed_url($theme) . "'})")
+ ->url("javascript:cooliris.embed.show(" .
+ "{maxScale:0,feed:'" . self::_feed_url($theme) . "'})")
->css_id("g-slideshow-link"));
}
@@ -56,8 +56,8 @@ class slideshow_event_Core {
$menu->append(Menu::factory("link")
->id("slideshow")
->label(t("View slideshow"))
- ->url("javascript:PicLensLite.start(" .
- "{maxScale:0,feedUrl:'" . self::_feed_url($theme) . "'})")
+ ->url("javascript:cooliris.embed.show(" .
+ "{maxScale:0,feed:'" . self::_feed_url($theme) . "'})")
->css_id("g-slideshow-link"));
}
@@ -66,9 +66,9 @@ class slideshow_event_Core {
if (!$item->is_album()) {
$item = $item->parent();
}
- return rss::url("gallery/album/{$item->id}?page_size=100");
+ return rss::url("gallery/album/{$item->id}?page_size=20");
} else {
- return rss::url("tag/tag/{$theme->tag()->id}?page_size=100");
+ return rss::url("tag/tag/{$theme->tag()->id}?page_size=20");
}
}
}
diff --git a/modules/slideshow/helpers/slideshow_theme.php b/modules/slideshow/helpers/slideshow_theme.php
index 269a93ce..163d2bd8 100644
--- a/modules/slideshow/helpers/slideshow_theme.php
+++ b/modules/slideshow/helpers/slideshow_theme.php
@@ -20,7 +20,7 @@
class slideshow_theme_Core {
static function head($theme) {
$proto = (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] === "off") ? "http" : "https";
- return "<script src=\"$proto://lite.piclens.com/current/piclens_optimized.js\" " .
+ return "<script src=\"$proto://apps.cooliris.com/slideshow/go.js\" " .
"type=\"text/javascript\"></script>";
}
}
diff --git a/themes/night_wind/css/screen.css b/themes/night_wind/css/screen.css
index cd1824d1..92c3041f 100644
--- a/themes/night_wind/css/screen.css
+++ b/themes/night_wind/css/screen.css
@@ -750,76 +750,6 @@ li.g-error select {
/*************** STUFF THAT NEEDS A HOME ****************/
-#g-add-photos #SWFUpload_0 {
- position: relative;
- top: -200px;
- left: 134px;
-}
-#g-add-photos .g-breadcrumbs {
- border: 0;
- margin: 0;
- padding-left:10px;
-}
-#g-add-photos-canvas {
- border: 1px solid #CCCCCC;
- margin: .5em 0 .5em 0;
- width: 469px;
- height: 325px;
- overflow: auto;
-}
-#g-add-photos button {
- margin-bottom: .5em;
- float: right;
-}
-#g-uploadqueue-infobar {
- clear: both;
-}
-#g-uploadqueue-infobar #g-cancelupload {
- display: none;
- cursor: pointer;
-}
-
-#g-add-photos-canvas {
-
-}
-
-#g-add-photos-queue .progressbar {
- height: 4px;
-}
-
-#g-add-photos-queue .title {
- font-size: 1.25em;
-}
-
-#g-add-photos-queue .status {
- font-size: .75em;
-}
-
-#g-add-photos-queue .box {
- margin-bottom: 8px;
- padding: 4px;
-}
-
-#g-add-photos-queue .pending {
- background-color: #e8e8e8;
- border: 1px solid #d7d7d7;
-}
-
-#g-add-photos-queue .error {
- background-color: #fcc;
- border: 1px solid #ebb;
-}
-
-#g-add-photos-queue .uploading {
- background-color: #ff9;
- border: 1px solid #ee8;
-}
-
-#g-add-photos-queue .complete {
- background-color: #cfc;
- border: 1px solid #beb;
-}
-
#g-admin-g2-import-notes {
padding-bottom: 20px;
}