summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers
AgeCommit message (Collapse)Author
2010-08-11Send back the content length of files. This fixes streaming movies. Fixes ↵Bharat Mediratta
ticket #974.
2010-08-09"Content-type" --> "Content-Type".Bharat Mediratta
2010-08-09The root album's edit form doesn't have a name field, so don't countBharat Mediratta
on it being there in update(). Fixes ticket #1281.
2010-08-08Fix for ticket #1279. In admin themes sanitize the theme name before ↵Tim Almdal
checking that theme.info exists.
2010-08-07Add the ability to replace the source data file in Item_Model::save().Bharat Mediratta
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-07Whitespace fix.Bharat Mediratta
2010-08-06Use module::install and module::activate for the gallery module asBharat Mediratta
well; I've verified that it generates the same installer files.
2010-08-01Use the login/html page for maintenance mode; we don't need theBharat Mediratta
maintenance controller/view anymore. Fixes ticket #1267.
2010-08-01Make maintenance mode a variable instead of a config. Then createBharat Mediratta
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-01Make the continuation url go to admin/maintenance.Bharat Mediratta
2010-07-31Full pass over all the JSON encoding and JS dialog code. We now abideBharat Mediratta
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-31Resend the entire dialog content (including the wrapping view) instead of ↵Tim Almdal
just the form.
2010-07-31Missing the user name on the reauthenticate form.Tim Almdal
2010-07-31When the admin controller redirects to the reauthenticate controller, the ↵Tim Almdal
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-31Convert the admin_theme controller to use the json::reply methodTim Almdal
2010-07-31More patches as part of #1225. Change the 'core' modules to use the json::replyTim Almdal
method to set the content type header and encode the response as a json object
2010-07-31Use readfile() instead of fopen()/fpassthru()/fclose() for brevity.Bharat Mediratta
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-20Cleanup on the Admin > Languages page.Bharat Mediratta
Hide the fieldset and legend in the theme, since they don't add any value. Change l10n_client::_server_url() to use the short style GMC urls and make the API a little tighter.
2010-07-16Improve the fix for #1176 to use request::is_ajax() instead of tackingBharat Mediratta
on a query param to urls that appear in dialogs. This keeps things simpler.
2010-07-15Remove the code to call the controller directly and just use redirect. Now ↵Tim Almdal
that all the form calls actually return the form as a json object, calling the form creation controller method i no longer required.
2010-07-15Rename g-in-dialog to the naming standard for query parameters and give it ↵Tim Almdal
something more representative... 'gallery_dialog_request'
2010-07-15Rename Flash_Uploader to just Uploader. Modules that want to replaceBharat Mediratta
this will just replace the controller. This makes overriding that much easier in the future.
2010-07-13Fix reauth authentication to use the identity helper instead of theBharat Mediratta
user helper directly. Else it doesn't work with LDAP and other identity systems.
2010-07-11Merge branch 'master' into talmdal_devTim Almdal
2010-07-10Rotate all matching album covers when we rotate an item. Fixes ticket #1200.Bharat Mediratta
2010-07-10Wrap album deletes in a batch so that we can handle lots of cascadingBharat Mediratta
deletes in bulk. This lets us avoid the problem where we continually choose and delete album covers which makes deletes really slow. It probably also avoids huge amounts of notification emails (untested). Fixes ticket #1190.
2010-07-10Pass along the from_id in item::get_delete_form() and then check toBharat Mediratta
see if we're deleting the album we're inside in quick::delete. If we delete the album we're currently viewing, redirect to the parent. This fixes ticket #1185.
2010-07-10Accept extension .m4v as video/mp4Romain LE DISEZ
2010-07-09remove debugging statementTim Almdal
2010-07-08Only add the 'Successfully re-authenticated' message to the status if the ↵Tim Almdal
admin page is not displayed in a dialog.
2010-07-07Fix for ticket #1176. Have the gallery.dialog code add a g-in-dialog ↵Tim Almdal
parameter to the url to let the controller know its in a dialog. The reauthenticate controller will format the password prompt as a page or a form content. If authentication is successful, then the original controller is called instead of being redirected to.
2010-07-06Fix for ticket #1181. Use $.getJSON to retrieve the json contents of the ↵Tim Almdal
dialog. Convert all the controllers that create the data to go into a dialog to return the html as part of a json object.
2010-07-05Merge branch 'master' of github.com:gallery/gallery3Bharat Mediratta
2010-07-05Revert "If the admin request originates as a dialog link, don't display the ↵Tim Almdal
entire page when reauthenticating the administrator. Just put the form in the dialog." This reverts commit 8493a3d36f597e183490ae880b35a3d98f50a045.
2010-07-05Merge branch 'master' of github.com:gallery/gallery3Bharat Mediratta
2010-07-05Add maessage when we automatically log you out of the admin area.Bharat Mediratta
2010-07-05If the admin request originates as a dialog link, don't display the entire ↵Tim Almdal
page when reauthenticating the administrator. Just put the form in the dialog.
2010-06-20Rename "simple_uploader" to "flash_uploader" to make room for an HTMLBharat Mediratta
uploader.
2010-06-17Fix for ticket #1110. Need to use the encode_path with a movie extension to ↵Tim Almdal
find the item. Thanks to samdavidoff for the initial fix.
2010-06-15Revert "Change the item rest update processing to call theBharat Mediratta
item::move(source, target) helper when the parent member has changed. Using the move method insures that names and slugs that could conflict in the target album are resolved properly. Changed the item::move method so it returns a message to be displayed if the caller chooses. And changed the move controller to display the message returned by the move if the item name was renamed as part of the move." Rolling this back for a couple of reasons: 1) Bug in move.php ("message.info" is not a function name) 2) Having the message come back from the API call as a side-effect is sloppy. We should find a cleaner way to do this checking. 3) having item::move() call save() on any changed values in the ORM is counter-intuitive. Move should move, save should save. I think the right approach here is to roll the move() code properly into save(). This reverts commit 2492280cc0ec9eb64a8daeccc7b5698ece7fea66.
2010-06-15Revert "Fix for ticket #1118. Create a item::save_with_retries helperBharat Mediratta
method, which encapsulates saving an item and handling name and slug conflicts. Call this instead of doing a save directly." Rolled this back because it fails KISS. We already have an API for saving models with Item_Model::save() that's consistent with all of our other model code. Adding a new way to save items is confusing and inconsistent. This reverts commit 9504f71efcadc7ed27f6f09e5d663e8025bf3b86.
2010-06-15Install the rest module by default.Bharat Mediratta
2010-06-15Sort files by path in _dump_var() for consistent output.Bharat Mediratta
Skip . and .. (PHP 5.3 iterators seem to include those now).
2010-06-15Fix for ticket #1118. Create a item::save_with_retries helper method, which ↵Tim Almdal
encapsulates saving an item and handling name and slug conflicts. Call this instead of doing a save directly.
2010-06-15Change the item rest update processing to call the item::move(source, ↵Tim Almdal
target) helper when the parent member has changed. Using the move method insures that names and slugs that could conflict in the target album are resolved properly. Changed the item::move method so it returns a message to be displayed if the caller chooses. And changed the move controller to display the message returned by the move if the item name was renamed as part of the move.
2010-06-12Bounce the user to the login page if they try to get to part of theBharat Mediratta
admin site as a guest. Also, theme the login/html page.
2010-06-12Make login/logout continuation url code consistent. Where necessary,Bharat Mediratta
we specify the continue_url in the session, but we store it in the login form so that we can propagate it across the session creation that happens at login time.
2010-06-12Use "continue_url" instead of "continue" for consistency with theBharat Mediratta
reauth code.
2010-06-12Push the continue url into the form for consistency with otherBharat Mediratta
login/continue code.
2010-06-12Stop trying to parse the continue url in the logout controller becauseBharat Mediratta
it requires us to reproduce a bunch of complex routing logic. Instead, just have the logout link generating code generate a link that's visible to guests.