Commit Graph
3755 Commits
Author SHA1 Message Date
Tim Almdal cd50fde5de Specify the charset on the content type header 2010-08-01 08:57:22 -07:00
Tim Almdal a453170727 Merge branch 'dialog' of github.com:gallery/gallery3 into dialog 2010-08-01 08:31:09 -07:00
Tim Almdal fc580037e7 Merge branch 'master' into dialog 2010-08-01 08:26:39 -07:00
Bharat Mediratta a5f701951e Add a localized error message for missing usernames. Fixes ticket #1266. 2010-08-01 01:33:59 -07:00
Bharat Mediratta 7607e1f932 Full pass over all the JSON encoding and JS dialog code. We now abide
by the following rules:

1) An initial dialog or panel load can take either HTML or JSON, but
   the mime type must accurately reflect its payload.

2) dialog form submits can handle a pure HTML response, but the mime
   type must also be correct.  This properly resolves the problem
   where the reauth code gets a JSON response first from the reauth
   code, and then an HTML response when you reauth and continue on to
   a given form -- try it out with Admin > Settings > Advanced.

3) All JSON replies must set the mime type correctly.  The json::reply
   convenience function does this for us.

4) By default, any HTML content sent back in the JSON response should be
   in the "html" field, no longer the "form" field.

The combination of these allows us to stop doing boilerplate code like
this in our controllers:

  // Print our view, JSON encoded
  json::reply(array("form" => (string) $view));

instead, controllers can just return HTML, eg:

  // Print our view
  print $view;

That's much more intuitive for developers.
2010-07-31 21:16:17 -07:00
Bharat Mediratta be4ad8e96d "Save" -> "Download" for clarity. 2010-07-31 16:47:14 -07:00
Tim AlmdalandBharat Mediratta a6280641f5 Resend the entire dialog content (including the wrapping view) instead of just the form. 2010-07-31 15:44:56 -07:00
Tim AlmdalandBharat Mediratta 0c535c85ed Missing the user name on the reauthenticate form. 2010-07-31 15:44:56 -07:00
Tim AlmdalandBharat Mediratta 29f29d2261 When the admin controller redirects to the reauthenticate controller, the value of request::is_ajax() from the original request is lost. This patch stores its value in the session so the reauthenticate controller knows whether its in a dialog/panel or not. 2010-07-31 15:44:56 -07:00
Tim AlmdalandBharat Mediratta 09dfe1a91b Convert the admin_theme controller to use the json::reply method 2010-07-31 15:44:55 -07:00
Tim AlmdalandBharat Mediratta 91a2c04a24 More patches as part of #1225. Change the 'core' modules to use the json::reply
method to set the content type header and encode the response as a json object
2010-07-31 15:44:55 -07:00
Tim AlmdalandBharat Mediratta 89d18c0714 Partial fix for #1225 addresses the issues with the user edit forms. 2010-07-31 15:44:55 -07:00
Tim AlmdalandBharat Mediratta bb04015149 Partial fix for #1225. Create a json reply helper that sets the content type to application/json and then json encodes the reply. 2010-07-31 15:44:55 -07:00
Bharat Mediratta 68f41c7061 Fix typo: ui-corners-all --> ui-corner-all
thanks Lord Beowulf!
2010-07-31 12:12:17 -07:00
Bharat Mediratta a8bb046209 Use readfile() instead of fopen()/fpassthru()/fclose() for brevity.
I've done some tests on a 60M flv and found that there's no difference
in memory consumption with these three approaches:

  public function test() {
    Kohana::close_buffers(false);
    $file = "/home/bharat/basketball.flv";
    if ($fd = fopen($file, "rb")) {
      while (true) {
        $bits = fread($fd, 65535);
        if (strlen($bits) == 0) {
          break;
        }
        print $bits;
        set_time_limit(30);
      }
      fclose($fd);
    }
    Kohana_Log::add("error","test: " . print_r(array(memory_get_peak_usage(true),memory_get_peak_usage(false)),1));
  }

  public function test2() {
    Kohana::close_buffers(false);
    $file = "/home/bharat/basketball.flv";
    $fd = fopen($file, "rb");
    fpassthru($fd);
    fclose($fd);
    Kohana_Log::add("error","test2: " . print_r(array(memory_get_peak_usage(true),memory_get_peak_usage(false)),1));
  }

  public function test3() {
    Kohana::close_buffers(false);
    $file = "/home/bharat/basketball.flv";
    readfile($file);
    Kohana_Log::add("error","test3: " . print_r(array(memory_get_peak_usage(true),memory_get_peak_usage(false)),1));
  }
2010-07-31 11:51:18 -07:00
Tim Almdal f50151cf18 Merge branch 'master' into dialog 2010-07-30 05:48:12 -07:00
Bharat Mediratta 7b8ed10796 Add recovery code for dupe slugs and dupe names to the general purpose Fix
task.  Fixes ticket #1260.
2010-07-29 21:49:29 -07:00
Bharat Mediratta 3f48f17e54 We don't care about the name and slug for the root album so don't bother enforcing them. 2010-07-29 19:41:03 -07:00
Bharat Mediratta ebbb73787d Trap ORM_Validation_Exception specially and report which fields failed validation. 2010-07-29 19:37:38 -07:00
Tim Almdal 21e3e86885 Resend the entire dialog content (including the wrapping view) instead of just the form. 2010-07-29 09:22:32 -07:00
Tim Almdal 6cd31e31af Missing the user name on the reauthenticate form. 2010-07-29 08:57:21 -07:00
Tim Almdal 529b9ac56c Merge branch 'master' into dialog 2010-07-29 06:59:44 -07:00
Bharat Mediratta b3c1b4633c Combine the Fix MPTT and Fix Permissions tasks into one magical fix-it
task.
2010-07-28 22:42:04 -07:00
Tim Almdal 64eae641e5 When the admin controller redirects to the reauthenticate controller, the value of request::is_ajax() from the original request is lost. This patch stores its value in the session so the reauthenticate controller knows whether its in a dialog/panel or not. 2010-07-28 07:57:27 -07:00
Tim Almdal c3a92df6e6 Merge branch 'master' into dialog 2010-07-27 21:35:14 -07:00
Bharat Mediratta dd955781aa "public static" ==> "static" to match code conventions. 2010-07-27 19:54:41 -07:00
Bharat Mediratta 185a736ff9 Revert "Combine all the flex runtime libraries into a single downloadable file. Fixes ticket #1241."
This breaks organize on Chrome 5 (Linux) and Chrome 6 (OSX).  See ticket #1241.

This reverts commit 423fca2d5f.
2010-07-27 11:28:12 -07:00
Bharat Mediratta bf1e1d3d1f Verified 2010-07-27 11:19:48 -07:00
Bharat Mediratta 84a50e737b Fix the "get flashplayer" button. It was throwing a JS error before.
Not sure why it was done in JS in the first place.  Fixes ticket #1256.
2010-07-27 11:18:55 -07:00
Bharat Mediratta f9137c756e Updated 2010-07-27 10:53:31 -07:00
Bharat Mediratta 52f1c4b8c6 Don't invoke a graphics toolkit when setting the album cover from a
clean thumbnail; we can just copy it over.  Should be a decent perf
improvement in many cases.  Fixes ticket #1255.
2010-07-27 10:49:47 -07:00
Bharat Mediratta 2e52bcedcd Update the mock so that all responses return arrays, not stdClass(). 2010-07-27 10:14:52 -07:00
Bharat Mediratta addbd6fb81 Fix ticket #1253 where the maintenance page bombs if you have already
configured your Gallery 2 import but you move your Gallery 3.
2010-07-26 21:38:40 -07:00
Bharat Mediratta f6fb186847 Merge branch 'master' of github.com:gallery/gallery3 2010-07-25 11:12:08 -07:00
Bharat Mediratta 5be9ae3250 Add a new maintenance task that resyncs album .htaccess files with
database access intents.  Use this to fix up .htaccess files after you
relocate your Gallery. Fixes ticket #1252.
2010-07-25 11:10:42 -07:00
Bharat Mediratta 055e115b6a Move the "cancel all" running tasks button up to make it consistent with the "remove all finished" button. 2010-07-25 11:03:32 -07:00
Bharat Mediratta 075cea2a48 Don't use hardcoded id 1 as the everybody group; it won't work with alternative auth schemes. 2010-07-25 10:05:09 -07:00
Tim Almdal 75a181f890 Convert the admin_theme controller to use the json::reply method 2010-07-23 23:05:40 -07:00
Tim Almdal 48c2e73048 More patches as part of #1225. Change the 'core' modules to use the json::reply
method to set the content type header and encode the response as a json object
2010-07-23 23:05:39 -07:00
Tim Almdal 2cb87631b7 Partial fix for #1225 addresses the issues with the user edit forms. 2010-07-23 23:05:39 -07:00
Tim Almdal a331611049 Partial fix for #1225. Create a json reply helper that sets the content type to application/json and then json encodes the reply. 2010-07-23 23:05:39 -07:00
Tim Almdal 9534a1c82a Merge branch 'master' of github.com:gallery/gallery3 2010-07-23 23:00:57 -07:00
Tim Almdal f699d2b385 Fix missing quoate in the organize dialog html template. 2010-07-23 05:56:59 -07:00
Tim Almdal 423fca2d5f Combine all the flex runtime libraries into a single downloadable file. Fixes ticket #1241. 2010-07-23 05:54:50 -07:00
Bharat Mediratta 108fff735c Initialize $request in submit_translations(). Fixes ticket #1239. 2010-07-22 15:53:00 -07:00
Bharat Mediratta 663f079e85 Properly handle the case where the album_cover_item_id points to an
invalid (probably deleted) item.  Fixes ticket #1238.
2010-07-22 14:08:08 -07:00
Bharat Mediratta adeea49e0a Catch any exceptions thrown when we try to restore the original
identity provider after we fail to set up a new one.
2010-07-21 11:43:51 -07:00
Bharat Mediratta 2cf5198353 Null out relative_path_cache and relative_url_cache after we update
the pointers in case the hierarchy was adversely affected by actions
when the MPTT pointers were desynced.  Fixes ticket #1235.
2010-07-21 11:34:19 -07:00
Bharat Mediratta af8bb05d5d Show the old group name in the error message when we fail to modify a group. Fixes ticket #1233. 2010-07-20 15:33:48 -07:00
Bharat Mediratta e5b1a4fc23 Fix a bunch of missing or invalid error messages. Fixes ticket #1232. 2010-07-20 15:21:44 -07:00