Skip to content

Commit

Permalink
1) Change how the size of the flexstage is calculated. (Basically rem…
Browse files Browse the repository at this point in the history
…ove the

   dialogWidth and dialogHeight and adjsut the internal controls when added to
   the stage.
2) Cleanup the controller code
  • Loading branch information
Tim Almdal committed Jun 19, 2010
1 parent ba19c03 commit 545a912
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
31 changes: 13 additions & 18 deletions modules/organize/controllers/organize.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,27 @@ function dialog($album_id) {
access::required("view", $album);
access::required("edit", $album);

$v = new View("organize_dialog.html");
$v->album = $album;

$v->domain = $input->server("SERVER_NAME");

$user = identity::active_user();
$v->access_key = rest::get_access_key($user->id)->access_key;

$v->file_filter = addslashes(json_encode(
array("photo" => array("label" => "Images",
"types" => array("*.jpg", "*.jpeg", "*.png", "*.gif")),
"movie" => array("label" => "Movies", "types" => array("*.flv", "*.mp4")))));

$v->sort_order = addslashes(
json_encode(array("ASC" => (string)t("Ascending"), "DESC" => (string)t("Descending"))));
$sort_fields = array();
foreach (album::get_sort_order_options() as $field => $description) {
$sort_fields[$field] = (string)$description;
}
$v->sort_fields = addslashes(json_encode($sort_fields));
$sort_order = array("ASC" => (string)t("Ascending"), "DESC" => (string)t("Descending"));
$file_filter = json_encode(
array("photo" => array("label" => "Images",
"types" => array("*.jpg", "*.jpeg", "*.png", "*.gif")),
"movie" => array("label" => "Movies", "types" => array("*.flv", "*.mp4"))));

$v = new View("organize_dialog.html");
$v->album = $album;
$v->domain = $input->server("SERVER_NAME");
$v->access_key = rest::get_access_key($user->id)->access_key;
$v->file_filter = addslashes($file_filter);
$v->sort_order = addslashes(json_encode($sort_order));
$v->sort_fields = addslashes(json_encode($sort_fields));
$v->rest_uri = url::site("rest") . "/";

$v->controller_uri = url::site("organize") . "/";

$v->swf_url = url::file("modules/organize/lib/Gallery3WebClient.swf?") .
$v->swf_uri = url::file("modules/organize/lib/Gallery3WebClient.swf?") .
filemtime(MODPATH . "organize/lib/Gallery3WebClient.swf");
print $v;
}
Expand Down
Binary file modified modules/organize/lib/Gallery3WebClient.swf
Binary file not shown.
4 changes: 1 addition & 3 deletions modules/organize/views/organize_dialog.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ function getTextStrings() {

function getGalleryParameters() {
return {
dialogWidth: $("#g-dialog:parent").width(),
dialogHeight: $("#g-dialog").height(),
domain: "<?= $domain ?>",
accessKey: "<?= $access_key ?>",
protocol: "<?= request::protocol() ?>",
Expand Down Expand Up @@ -121,7 +119,7 @@ function getGalleryParameters() {
attributes.id = "Gallery3WebClient";
attributes.name = "Gallery3WebClient";
attributes.align = "middle";
swfobject.embedSWF("<?= $swf_url ?>",
swfobject.embedSWF("<?= $swf_uri ?>",
"flashContent", size.width() - 100, size.height() - 135,
swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
</script>
Expand Down

0 comments on commit 545a912

Please sign in to comment.