Commit Graph

17 Commits

Author SHA1 Message Date
Bharat Mediratta
f6ebb436e4 Rest_Controller -> REST_Controller everywhere, for consistency. 2008-12-25 02:38:53 +00:00
Bharat Mediratta
672eca5337 Lots of deltas rolled up into a bigger change. Sorry for the mess.
1) Deleted in-place-editing.  We'll be replacing this with a real edit
   system that groups settings together and is more coherent.

2) Tweaked the way that dialog boxes work to get the ajax stuff working
   again.  It's imperfect and does not work properly for uploading images.
   This is going to get redone also, but this is a good resting point.

3) Created edit forms for albums and photos.  Moved _update and _create out
   of Items_Controller and into the individual subclasses.

4) Created access::required which is a shorthand for:
    if (!access::can(...)) {
      access::forbidden();
    }

5) Added validation rules to Items_Model

6) Converted login to use the regular modal dialog approach in the theme.
2008-12-24 00:20:26 +00:00
Bharat Mediratta
76b1500209 Clean up the way that we upload via dialogs:
1) If the create request is Ajax, then return a 201 Created response code
2) If we receive back a 201 response, then switch to the new page.
3) Display a status message when we do an upload.
2008-12-23 07:30:14 +00:00
Bharat Mediratta
14da6b65b7 Update to reflect change in album::create API 2008-12-23 04:43:54 +00:00
Bharat Mediratta
0573698155 Add some more logging code. Now the site admin has some log entries to look at. 2008-12-21 04:43:47 +00:00
Bharat Mediratta
2cf3233f54 Get rid of all pseudo users and pseudo groups, while preserving all
other functionality.  This makes our user/group and access code
fully consistent.
2008-12-12 00:59:30 +00:00
Bharat Mediratta
f0a1950597 Fix a bug in the redirect after adding photos. 2008-12-07 04:56:39 +00:00
Tim Almdal
64c380a60d Correct @todo's in Item_Controller 2008-12-06 20:27:55 +00:00
Bharat Mediratta
ccee9854c2 Rename file::unlink() to dir::unlink(). This creates an API that is
clearer about its actions, otherwise we may accidentally blow away an
entire hierarchy when we think we're deleting a single file (there's a
reason why rm won't let you delete dirs that aren't empty!)

Name it "dir" instead of "directory" because apparently "directory" is
already reserved.

Move the delete call out of Items_Controller and into the model.  The
model is responsible for keeping state integrity, not the controller.
2008-12-03 23:31:10 +00:00
Tim Almdal
7bb4b6029d Add a MY_file class that extends the file helper by creating an unlink method that deletes a file or an album directory.
Modify Items_Controller::_delete to call this new helper method when deleting an item
2008-12-03 22:39:57 +00:00
Bharat Mediratta
91c4bda1ec Prototype access control model. There's much left to do, but it's a
working implementation.
2008-12-01 08:50:00 +00:00
Bharat Mediratta
8b6ed6c477 Create module::event() which runs Gallery events. It works by
convention.  To respond to the "photo_created" event in the gmaps
module, you create modules/gmaps/helpers/gmaps_event.php containing
class gmaps_event which has function photo_created.

Renamed all events from gallery.foo.bar to foo_bar
Updated tag module to use new convention.
2008-11-28 19:37:01 +00:00
Tim Almdal
828f23896f Rename item events and create events for comment create, login, logout, user creation. I probably forgot some, but its a start. 2008-11-28 00:51:38 +00:00
Bharat Mediratta
226dc45203 Fix a typo in _show() that broke proper redirection 2008-11-24 08:54:03 +00:00
Bharat Mediratta
161998dde6 Fix some broken-ness:
1) Item_Controller::_create() and _update() were swapped
2) _create() was redirecting to the wrong urls on success
3) Change in-place return parameter from __return to _return
4) Change in-place code to tunnel _put via POST
2008-11-19 06:35:54 +00:00
Bharat Mediratta
5638fc5fb6 Change the way that we do RESTful routing.
1) We now use __call() in REST_Controller to handle any requests to a controller
   that were not already handled.  In the case of RESTful controllers, this should
   be the only entry point (although they're free to break the model and add other
   ones.. nothing stops them).

   This means that we can remove all the catch-all routes in
   routes.php which greatly simplifies it.

2) Move request_method() and output_format() out of REST_Controller and into the REST
   helper in core/helpers/rest.php

3) Experiment with letting the various subclasses check the output_format and deal with
   it themselves.  This simplifies the API, but it might be a bad idea in that it might
   push too much work to the individual controllers.  It's a balancing act, time will tell,
   I'm willing to change it back later.
2008-11-19 04:20:35 +00:00
Jozef Selesi
b2772f5a05 * Renamed the album, item and photo controllers to albums, items and photos in order to follow the convention that controllers that refer to a collection of resources have plural names.
* Added a bug workaround to routes.php
2008-11-19 00:12:25 +00:00