2009-08-05 10:26:11 -07:00
<? php defined ( "SYSPATH" ) or die ( "No direct script access." ) ?>
2010-03-27 11:16:41 -07:00
<script type="text/javascript" src="<?= url::file("lib/swfobject.js") ?>"></script>
<style type="text/css" media="screen">
.g-organize {
padding: 0;
margins: 0;
}
object {
display: block;
outline: none;
}
#g-dialog {
padding: 0;
}
</style>
2009-08-13 21:31:20 -07:00
<script type="text/javascript">
2010-08-30 22:21:00 -07:00
$("#g-dialog").bind("dialogclose", function(event, ui) {
// @todo do a call to organize/closing to end the batch
2010-09-11 22:18:53 -07:00
if ($(this).data("reload.location")) {
window.location = $(this).data("reload.location");
} else {
window.location.reload();
}
2010-08-30 22:21:00 -07:00
});
2010-03-27 11:16:41 -07:00
function closeOrganizeDialog() {
$("#g-dialog").dialog("close");
}
2010-09-07 18:53:17 -07:00
function setLocation(url) {
$("#g-dialog").data("reload.location", url);
}
2010-06-10 13:12:10 -07:00
function setTitle(title) {
2010-06-13 17:58:50 -07:00
$("#ui-dialog-title-g-dialog").text(<?= t("Organize :: ")->for_js() ?> + title);
2010-06-10 13:12:10 -07:00
}
2010-03-27 11:16:41 -07:00
function getOrganizeStyles() {
2010-06-13 17:58:50 -07:00
return {
color: colorToHex($("#g-organize").css("color")),
backgroundColor: colorToHex($("#g-organize").css("backgroundColor")),
borderColor: colorToHex($("#g-organize").css("borderLeftColor")),
rollOverColor: colorToHex($("#g-organize-hover").css("backgroundColor")),
selectionColor: colorToHex($("#g-organize-active").css("backgroundColor"))
2010-03-27 11:16:41 -07:00
};
}
function colorToHex(color) {
2010-06-13 17:58:50 -07:00
// Surprising no one, the color extracted from the css is in a different format
// in IE than it is when extracted from FF or Chrome. FF and Chrome return
// the of "rgb(nn,nn,nn)". Where as IE returns it as #hhhhhh.
2010-03-27 11:16:41 -07:00
2010-06-13 17:58:50 -07:00
if (color.indexOf("#") === 0) {
return '0x' + color.substring(1);
} else {
var digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color);
2010-03-27 11:16:41 -07:00
2010-06-13 17:58:50 -07:00
var red = parseInt(digits[2]);
var green = parseInt(digits[3]);
var blue = parseInt(digits[4]);
var rgb = blue | (green << 8) | (red << 16);
return digits[1] + '0x' + rgb.toString(16);
}
2010-03-27 11:16:41 -07:00
}
function getTextStrings() {
2010-06-13 17:58:50 -07:00
return {
statusText: <?= t("Drag and drop photos to re-order or move between album")->for_js() ?>,
remoteError:
2010-06-10 09:14:13 -07:00
<?= t("Remote server error, please contact your gallery administrator")->for_js() ?>,
2010-06-13 17:58:50 -07:00
addAlbumError: <?= t("The above highlighted fields are invalid")->for_js() ?>,
errorOccurred: <?= t("Remote error ocurred")->for_js() ?>,
addAlbum: <?= t("Add album")->for_js() ?>,
addImages: <?= t("Add photo")->for_js() ?>,
deleteSelected: <?= t("Delete")->for_js() ?>,
uploadedText: <?= t("Uploaded {0}")->for_js() ?>,
removeFileText: <?= t("Remove")->for_js() ?>,
progressLabel: <?= t("Completed image %1 of %2")->for_js() ?>,
uploadLabel: <?= t("Loaded %1 of %2 bytes")->for_js() ?>,
moveTitle: <?= t("Move images")->for_js() ?>,
deleteTitle: <?= t("Delete image")->for_js() ?>,
uploadTitle: <?= t("Upload image")->for_js() ?>,
cancel: <?= t("Cancel")->for_js() ?>,
close: <?= t("Close")->for_js() ?>
2010-03-27 11:16:41 -07:00
};
}
2010-06-13 17:58:50 -07:00
function getGalleryParameters() {
return {
domain: "<?= $domain ?>",
2010-06-14 13:07:58 -07:00
accessKey: "<?= $access_key ?>",
2010-06-18 15:20:32 -07:00
protocol: "<?= request::protocol() ?>",
2010-06-14 13:07:58 -07:00
fileFilter: "<?= $file_filter ?>",
2010-06-13 17:58:50 -07:00
sortOrder: "<?= $sort_order ?>",
sortFields: "<?= $sort_fields ?>",
albumId: "<?= $album->id ?>",
2010-08-22 00:27:24 -07:00
selectedId: "<?= $selected_id ?>",
2010-06-17 10:21:37 -07:00
restUri: "<?= $rest_uri ?>",
2010-06-17 17:41:35 -07:00
controllerUri: "<?= $controller_uri ?>"
2010-06-13 17:58:50 -07:00
};
};
2010-07-20 07:03:43 -07:00
// For version detection, set to minimum required Flash Player version, or 0 (or 0.0.0),
// for no version detection.
var swfVersionStr = "<?= $flash_minimum_version = "10.0.0" ?>";
// To use express install, set to playerProductInstall.swf, otherwise the empty string.
2010-03-27 15:55:42 -07:00
var xiSwfUrlStr = "";
2010-06-13 17:58:50 -07:00
var flashvars = {};
2010-03-27 11:16:41 -07:00
var size = $.gallery_get_viewport_size();
var params = {};
params.quality = "high";
params.bgcolor = "#ffffff";
params.allowNetworking = "all";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
2010-06-13 17:58:50 -07:00
attributes.id = "Gallery3WebClient";
attributes.name = "Gallery3WebClient";
2010-03-27 11:16:41 -07:00
attributes.align = "middle";
2010-06-18 19:05:59 -07:00
swfobject.embedSWF("<?= $swf_uri ?>",
2010-03-27 11:16:41 -07:00
"flashContent", size.width() - 100, size.height() - 135,
swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
2009-08-13 21:31:20 -07:00
</script>
2009-10-04 00:27:22 -06:00
<div id="g-organize" class="g-dialog-panel">
2010-03-27 15:55:42 -07:00
<!-- The following spans are placeholders so we can load the hover and active styles for the flex component -->
2010-03-27 11:16:41 -07:00
<span id="g-organize-hover" /><span id="g-organize-active" />
2010-06-13 17:58:50 -07:00
<h1 style="display:none"><?= t("Organize :: %name", array("name" => html::purify($album->title))) ?></h1>
2010-07-27 11:18:55 -07:00
<div id="flashContent">
<p>
2010-08-30 22:21:00 -07:00
<?= t("Your browser must have Adobe Flash Player version %flash_minimum_version or greater installed to use this feature.", array("flash_minimum_version" => $flash_minimum_version)) ?>
2010-07-27 11:18:55 -07:00
</p>
<a href="http://www.adobe.com/go/getflashplayer">
<img src="<?= request::protocol() ?>://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
alt=<?= t("Get Adobe Flash Player")->for_js() ?> />
</a>
</div>
2009-08-05 10:26:11 -07:00
</div>