Commit Graph
5882 Commits
Author SHA1 Message Date
Bharat Mediratta d6f5a8a8d1 Add JSONP support. You must specify &output=jsonp?callback=<js_function>
Fixes ticket #1205.
2010-08-08 15:02:24 -07:00
Bharat Mediratta 9b5e058dd3 We can always send back the header because Kohana buffers output. 2010-08-08 15:01:38 -07:00
Bharat Mediratta ab2e2d2d77 Add the $max_level param to all calls to _sanitize_for_dump() 2010-08-08 15:00:23 -07:00
Bharat Mediratta de4d858dc2 Add in the missing 'error' count. 2010-08-08 14:56:28 -07:00
Bharat Mediratta 371a2ff7d2 Adjust the vertical placement of the "Dang" message. 2010-08-08 13:39:27 -07:00
Bharat Mediratta 3c7dc6d7a6 Handle 404 exceptions specially to reduce spam in the log files. Fixes ticket #1228. 2010-08-08 12:46:26 -07:00
Bharat Mediratta ded9ed4df8 Create a registry of REST resources and call it "registry".. Pretty
simple, actually.  Fixes ticket #1173.
2010-08-08 11:35:36 -07:00
Bharat Mediratta a22cf8cf1c Handle "1" as a default order direction in G2. Why would we ever do that? Dunno.
Fixes ticket #1276.
2010-08-08 10:14:29 -07:00
Bharat Mediratta b7700d1eec Require the size parameter. Optional params are confusing. And be
robust in the face of a missing data file (movies and albums lack
resize, albums lack full size, some albums don't have a thumb if they
have no contents, etc)
2010-08-08 09:57:13 -07:00
Bharat Mediratta cc43c37a1c Add a sad face on the dang page. Just cause. 2010-08-08 02:06:50 -07:00
Bharat Mediratta 0d2237979a Make the error page more informative, and include platform information. 2010-08-08 01:48:09 -07:00
Bharat Mediratta 4e95ec843a Allow item_rest::put() to replace the current data file. Remove
data_rest::put() altogether; it's no longer necessary.
2010-08-08 01:12:43 -07:00
Bharat Mediratta 7f61f9754e Change file modes to 644. 2010-08-08 00:30:55 -07:00
Bharat Mediratta 20fd987296 A new REST resource that allows access to view and modify the actual
contents of the file, which enables REST viewers to see the actual
data which is useful when the files are privileged.  Currently it
returns the contents of the file in JSON encoded form, which may not
be the best.  Multipart/mime might be much better.

Fixes ticket #1224.
2010-08-07 22:33:01 -07:00
Bharat Mediratta dfb095a262 Add the ability to replace the source data file in Item_Model::save().
Refactor the rotate code in Quick_Controller to replace the data file,
and then have gallery_event::item_updated_data_file() pick up after
the change is saved, rebuild the image and handle album covers.  This
is much more portable than before and it will allow any mechanism (eg:
REST) to replace the source image.
2010-08-07 22:18:28 -07:00
Bharat Mediratta 1abf43d3f1 Add a max_level to _sanitize_for_dump() so that we don't blow the stack. 2010-08-07 22:06:57 -07:00
Bharat Mediratta c6ca77377f Whitespace fix. 2010-08-07 18:02:39 -07:00
Bharat Mediratta 779d91cca0 Add an index for left_ptr, since we use that in ORM_MPTT::parents()
which is on every album page.  Bump Gallery module version to 33.
2010-08-07 12:18:43 -07:00
Bharat Mediratta 67636ade24 Merge branch 'master' into bharat_dev 2010-08-07 11:22:16 -07:00
Bharat Mediratta 4f0733f2c8 Merge branch 'master' into bharat_dev 2010-08-07 11:16:01 -07:00
Bharat Mediratta 16ae65464c Oops. Fix the upgrader path to add the weight column to the modules table. 2010-08-07 10:57:18 -07:00
Bharat Mediratta 1b2da1ff70 Add a "weight" column to the module table. This allows us to specify
module ordering, which is currently being done in the moduleorder
contrib module.

By default, the weight will be the same as the id of the row which
means that new modules will get added at the end of the list.  This is
covered in the upgrade case as well.

The one gotcha is that we need to make sure that we don't try to sort
by the weight column if the gallery module version is < 32, which is
something we haven't done before.

Fixes ticket #1272.
2010-08-06 20:19:00 -07:00
Bharat Mediratta d3a161ca1b Add a "weight" column to the module table. This allows us to specify
module ordering, which is currently being done in the moduleorder
contrib module.

By default, the weight will be the same as the id of the row which
means that new modules will get added at the end of the list.  This is
covered in the upgrade case as well.

The one gotcha is that we need to make sure that we don't try to sort
by the weight column if the gallery module version is < 32, which is
something we haven't done before.
2010-08-06 10:41:38 -07:00
Bharat Mediratta 0fe44fe380 Use module::install and module::activate for the gallery module as
well; I've verified that it generates the same installer files.
2010-08-06 10:40:41 -07:00
Bharat Mediratta 8559cdb5b6 Add docs reflecting that we may skip some items that have invalid parent_ids 2010-08-04 21:30:48 -07:00
Tim Almdal aa40bdd8e0 Update the wind theme thumbnail to be more reflective of the actual theme (i.e. the layout has changed since the thumbnail was created.) 2010-08-04 11:05:42 -07:00
Tim Almdal 42617117c0 Replace overlooked 'form' parameter in json response with 'html'. 2010-08-03 11:10:13 -07:00
Bharat Mediratta 3492f1712d Fix the i18n error message for missing/incorrect password. Fixes ticket #1265. 2010-08-01 22:18:22 -07:00
Bharat Mediratta 3e8d683ce4 Use the login/html page for maintenance mode; we don't need the
maintenance controller/view anymore.  Fixes ticket #1267.
2010-08-01 22:09:02 -07:00
Bharat Mediratta ca54cdd644 While we're cleaning up albums, also find any cases where we have an
album_cover_item_id that points to an invalid item.
2010-08-01 21:44:24 -07:00
Bharat Mediratta 400c248e2d default maintenance_mode from false -> 0 for consistency with the value we set in the db 2010-08-01 21:10:27 -07:00
Bharat Mediratta 9b1e3eb177 Updated for gallery module v31. 2010-08-01 21:08:03 -07:00
Bharat Mediratta c33b24c9fa Make maintenance mode a variable instead of a config. Then create
links on the Admin > Maintenance page to allow you to turn it on and
off.  This should be efficient since we cache all vars and look them
up on every request anyway.

This also allows us to have the Fix task enable maintenance mode while
it's running which greatly reduces the chances that somebody will come
along and hork the database while we're tinkering with MPTT pointers.

Fixes ticket #1259.
2010-08-01 21:00:30 -07:00
Bharat Mediratta 49eb3e32b9 Make the continuation url go to admin/maintenance. 2010-08-01 20:49:14 -07:00
Bharat Mediratta 56ca3b09b6 Focus on the username field by default. Don't use jQuery because we're operating in a very limited context. 2010-08-01 20:48:57 -07:00
Bharat Mediratta 9369fd55a3 Force the response type for uploaded watermarks to text/html.
// Override the application/json mime type.  The dialog based HTML uploader uses an iframe to
// buffer the reply, and on some browsers (Firefox 3.6) it does not know what to do with the
// JSON that it gets back so it puts up a dialog asking the user what to do with it.  So force
// the encoding type back to HTML for the iframe.
// See: http://jquery.malsup.com/form/#file-upload
2010-08-01 10:39:32 -07:00
Bharat Mediratta 3b187d7fe9 Merge branch 'dialog' 2010-08-01 10:35:15 -07:00
Bharat Mediratta 563afbe6dd "Save" -> "Download" for clarity. 2010-08-01 10:27:38 -07:00
Bharat Mediratta bf7115cf5a Write appropriate PHPdoc for json::reply. 2010-08-01 10:19:36 -07:00
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
Bharat Mediratta e354469285 Merge branch 'dialog' of github.com:gallery/gallery3 into dialog 2010-07-31 15:45:05 -07:00
Tim Almdal a6280641f5 Resend the entire dialog content (including the wrapping view) instead of just the form. 2010-07-31 15:44:56 -07:00
Tim Almdal a6ceb927e6 Sometimes in dialogs, the form is wrapped in a view to provide additional information. We need to replace the contents of the entire dialog, not just the form, otherwise, there could be text floating around that doesn't make sense. 2010-07-31 15:44:56 -07:00
Tim Almdal 0c535c85ed Missing the user name on the reauthenticate form. 2010-07-31 15:44:56 -07:00
Tim Almdal 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