Commit Graph

112 Commits

Author SHA1 Message Date
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
39499cdf2e Add /welcome/form/add/photos to give you the add photo form. 2008-12-03 05:40:59 +00:00
Tim Almdal
3953dde2c6 The rearrange module will now add an album if you drag the "new album" onto the album tree. I haven't had a chance to figure out why the form does get any styling or why a textarea is no included as a list item. 2008-12-02 21:25:15 +00:00
Bharat Mediratta
ed2cb2a86d Fix profiler settings in the scaffolding 2008-12-01 10:40:40 +00:00
Bharat Mediratta
5c303aa07b Add access::reset() so that you can specify your intent to use the
parent's permissions.

Update scaffolding to demonstrate that it works.
2008-12-01 09:57:03 +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
6b03b798f3 Move rearrange HTML generation into welcome.php so that we gracefully
handle the case where the DB is not installed yet.
2008-11-30 21:39:23 +00:00
Bharat Mediratta
4271f7702a Add access model (not fully baked yet).
Update scaffolding to allow addition of just albums (helpful for testing permissions)
2008-11-29 22:47:15 +00:00
Tim Almdal
70de32ebb4 Insure that the page and offset refere to valid items 2008-11-29 17:08:42 +00:00
Tim Almdal
6a76d6f747 Dynamically create the list of available modules. This permits new modules to be added without having to update the config.php file 2008-11-28 21:22:34 +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
Bharat Mediratta
2c86723942 Add an easy way to add a bunch of servers from the server side 2008-11-28 05:45:35 +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
Tim Almdal
bac4ff2046 1) Create a Theme_View class that combines the functionality of the Theme class with the View class.
2) Only define the form.html.php::DrawForm method once if there are multiple forms on the page (i.e. comments and add tags)
2008-11-27 16:19:07 +00:00
Bharat Mediratta
d909fc1070 Make tags look a little better. 2008-11-27 10:25:50 +00:00
Bharat Mediratta
c95c17b133 Centralize logging around installing/uninstalling modules. 2008-11-27 09:45:26 +00:00
Bharat Mediratta
7e5f59bcb7 Add children_count to album/photo controllers for consistency with tags 2008-11-27 05:59:37 +00:00
Bharat Mediratta
691faa0e83 Draw an album tree in the access -> permissions tab. 2008-11-26 23:07:37 +00:00
Bharat Mediratta
974f9f7788 Add a new "tag" page type.
Create the concept of "page types" which let us specify the kind of
page that we're rendering in high level terms.  Currently there are
three page types: album, photo and tag.

The tag page type uses slightly different variables.  It has a $tag
but no $item.  Adjust all sidebar_block() functions to avoid printing
stuff that's dependent on the item if there is no item.

Simplify the tag code to stop trying to fake an item.

Update the theme slightly to use $item and $tag where appropriate
(notably, for making the <title> element).
2008-11-26 21:50:45 +00:00
Bharat Mediratta
9c60566197 Add support for marking users as "admin" 2008-11-26 04:54:43 +00:00
Bharat Mediratta
226df2a8f8 Add support in the scaffolding for adding users to groups, adding and
removing users and groups.
2008-11-26 04:45:43 +00:00
Bharat Mediratta
242b3a1403 Use lorem2 words as inputs to generateTags. Limiting the number of
tags results in a better distribution of the tags (so the cloud looks
nicer).
2008-11-26 03:48:42 +00:00
Bharat Mediratta
5fce343ca4 Create user/group create/delete functions and have the scaffolding use them. 2008-11-26 03:34:39 +00:00
Tim Almdal
d554adc484 1) Changed how the test tags are generated to be able to create a better distribution
2) Added a new helper function "load_buckets" assign the class suffix to each tag
3) Created a unit test to test the load_buckets function
2008-11-25 18:14:52 +00:00
Bharat Mediratta
565f1a260c The scaffolding can now add and delete users and groups. Yippee! 2008-11-25 09:39:45 +00:00
Bharat Mediratta
9bdf825a94 Add a "Access" tab to the scaffolding and list users and groups.
Refactor welcome.php a little bit to make index() more readable.
2008-11-25 09:15:45 +00:00
Bharat Mediratta
fe602433a8 tag::add_tag() -> tag::add 2008-11-25 04:36:31 +00:00
Bharat Mediratta
dcf3693b3e Add theme debugging. Activate it in the [info] tab in the
scaffolding, then browse around your Gallery3 to see where you can add
visible elements via modules.
2008-11-25 02:17:53 +00:00
Tim Almdal
f81a9879be Moved the creation of tags into the tag helper library. Added a count field to the tags table. Bharat, I know you said not to worry about caching, but I want to explore what are some of the issues with keeping track of the counts as we go. (i.e. is it a pain in the a__) 2008-11-24 23:18:32 +00:00
Bharat Mediratta
983a893e86 Show a link to the item with the most tags. 2008-11-24 08:57:04 +00:00
Bharat Mediratta
226dc45203 Fix a typo in _show() that broke proper redirection 2008-11-24 08:54:03 +00:00
Bharat Mediratta
b60e3e13a4 Show the tag count, too.
Try using array_rand to simplify tag creation logic.  Is it better?  Maybe.
2008-11-24 08:27:52 +00:00
Tim Almdal
d7288d33e6 Remove the has_many_and_belongs_to_many relations from the item model 2008-11-24 05:55:29 +00:00
Tim Almdal
39f00707ac Add the creation of tags to the scaffolding code 2008-11-24 05:03:52 +00:00
Bharat Mediratta
02486f2401 Show the # of comments 2008-11-23 20:31:43 +00:00
Bharat Mediratta
f39cf6ed2f Add a button to install all plugins at once, now that we have so many.
Improve the style a bit, sort the plugins, put core first and make it
stand out so that you don't accidentally uninstall it.
2008-11-23 07:46:50 +00:00
Jozef Selesi
88f799be6f Fixed a bug in the REST controller dispatcher and added a test case that excercises it. 2008-11-21 21:07:36 +00:00
Tim Almdal
992cf22c79 Revert module block approach 2008-11-21 07:06:11 +00:00
Jozef Selesi
c3fc1cb7ec * Added HTTP status constants and helper functions to REST helper.
* HTTP header setting in comment module now going through REST helper API.
* Fixed items controller test.
* Fixed user installer test.
* Fixed _create() handling in the REST controller.
* Fixed routing for edit and add forms.
* Added some tests for the REST controller.
* Set svn:eol-style to LF on a bunch of files.
* Added preamble to MY_Forge.php.
2008-11-20 01:25:29 +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
Bharat Mediratta
c0aa61787c Change output_format() to autodetect for html / xml / json 2008-11-19 03:42:43 +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
Jozef Selesi
1992343c2e * Changed REST API. Now there are two separate methods for forms:
GET /form/edit/{controller}/{resource_id} -> controller::_form_edit($resource)
  GET /form/add/{controller}/{parameters}   -> controller::_form_add($parameters)
* Updated comment, user and core modules to reflect the API changes
* Cleaned up routing and handling of requests to /{controller}
2008-11-18 23:40:47 +00:00
Jozef Selesi
b63ea2cdbf - All comments of an item can now be seen /comments?item_id=
- Return proper Content-Type header for GET /comments requests
- Got rid of the query processing for index() in REST_Controller()
- Small misc fixes
2008-11-18 15:48:08 +00:00
Bharat Mediratta
d8225e44c4 Fix a typo user_id -> owner_id 2008-11-18 09:03:49 +00:00
Jozef Selesi
3ebb751cda First iteration of REST controller refactoring. RESTful controllers that refer to collections should now have plural names and there should be only one controller per resource. Updated existing classes that implement REST_Controller. The routing now works like this:
GET    /controller    -> controller::_index()
POST   /controller    -> controller::_create()
GET    /controller/id -> controller::_show()
PUT    /controller/id -> controller::_update()
DELETE /controller/id -> controller::_delete()
GET    /form/edit/controller/resource_id -> controller::_form()
GET    /form/add/controller/data         -> controller::_form()
2008-11-18 08:28:32 +00:00
Bharat Mediratta
c91e90406b Add output formats to our REST controllers. Add support for JSON and
XML to the comment controllers as a proof of concept.  It's not fully
baked; we should examine ways to create helpers to make this process
easier.
2008-11-17 00:30:18 +00:00
Bharat Mediratta
b6de985922 Handle _method in either GET or POST 2008-11-16 19:22:27 +00:00
Bharat Mediratta
5d14531af9 Drop the call to render() and just use the View's __toString method to
print it out.
2008-11-16 19:12:01 +00:00