Commit Graph
1018 Commits
Author SHA1 Message Date
Bharat Mediratta e87a37b855 Rename 'tags' module to 'tag' for consistency of pluralization 2008-11-16 07:17:29 +00:00
Bharat Mediratta 140736a1e4 Several large changes:
1) Changed the way that we get forms.  Now, if you want to get a form
   for a REST resource you prefix /form to the resource id.  So:
    /form/photo/1    : returns a form for editing photo id 1
    /form/comments/1 : returns a form for adding a comment to photo id 1
    /form/comment/1  : returns a form for editing comment id 1

2) Changed the comment module to have two controllers:
    comment:  deals with a single comment resource
    comments: deal with collections of comments attached to an item

Related stuff:
- Moved the comments js into the theme
- Reworked Comment_Helper for clarity
- Moved form generation code down into Comment_Helper
- Cleaned up routes (eliminating new comment ones added in recent rev)
- Added form() function to all REST controllers
- Changed comment module to use a block instead of an arbitrary helper call from the theme
- Comment controller only returns HTML currently, but returns a 201 Created status
  code when a new comment is added, which the Ajax code can catch and act upon.
- Got rid of a lot of extra views in comment module
2008-11-16 07:14:12 +00:00
Tim Almdal be67187ad9 Create MY_Forge to specify the defaul html 2008-11-16 06:43:31 +00:00
Felix Rabinovich f27929e126 create a regular user and make scaffolding assign owner to logged in user 2008-11-16 05:46:42 +00:00
Jozef Selesi f9eaa8c220 Initial add comment implementation. 2008-11-15 16:52:23 +00:00
Bharat Mediratta e901d613bf Add Theme::module() and module::get() 2008-11-15 09:08:18 +00:00
Bharat Mediratta db6061096e Item / Owner changes.
* Hardcode the item has_one owner relationship again
* Overload User_Model::__get to handle missing owners gracefully
* Fix Item_Controller to take the owner_id from the session or
  from the parent album when adding new albums and photos.
2008-11-15 08:44:01 +00:00
Felix Rabinovich 6dbf5ae172 Clean user / item relationship. Upload files gets the ownership of current user; and the views don't break if user module is not installed 2008-11-15 08:19:14 +00:00
Bharat Mediratta ae7839ffaa Revise the user login code.
* Remove user registration link and popup from the theme; this
  shouldn't be done in a popup. Use ajaxform to simplify the way
  that we load the login popup.

* Create form.html.php, this is a template for Forge based forms.

* Move user validation rules into User_Model and let forms
  populate the rules into their forms as useful.

* Undo r18688's changes regarding the REST code.  We should never
  accept a null resource, this breaks the REST abstraction.

* Change login and user controllers to use Forge which lets us delete
  login.html.php and user.html.php since those now are generated by
  the theme-owned form template
2008-11-15 06:23:09 +00:00
Tim Almdal e0ec9dd76a Allow the HTTP get method to be called without an id to create any empty template. 2008-11-14 16:51:11 +00:00
Tim Almdal b5f48e4ab3 Use the shortform to load the resource. 2008-11-14 07:30:47 +00:00
Bharat Mediratta 0fe8d44472 Create module helper and refactor all the code that creates, updates
and deletes modules into it.
2008-11-13 10:38:28 +00:00
Jozef Selesi 56dcb953b0 Code cleanup, add test for time formatting function. 2008-11-12 15:43:05 +00:00
Bharat Mediratta 453e15f502 Throw an exception when we can't upload a file. This is not the best solution, but it works for now. 2008-11-12 10:11:05 +00:00
Felix Rabinovich 7423c755c0 aliasing owner to user 2008-11-12 08:30:55 +00:00
Bharat Mediratta 51c64f1d28 Create a simple benchmark that loads 500 localized messages and performs
500 localizations on them.
2008-11-12 00:05:47 +00:00
Bharat Mediratta fd4faa89e6 Override View_Core::render so that we trap errors stemming from bad
PHP includes and show a visible stack trace to help developers.
2008-11-11 23:07:30 +00:00
Bharat Mediratta a15c7cb11f Change the PUT/DELETE tunneling param from __action to _method
to be like Rails.
2008-11-11 13:11:20 +00:00
Bharat Mediratta ee413f5f39 Updated for recent Item_Controller API change 2008-11-11 13:00:11 +00:00
Jozef Selesi 1651b3fe85 Move scaffolding code out of the comments controller to welcome.php. 2008-11-11 12:20:20 +00:00
Tim Almdal bba5289035 Change Album and Photo controllers to set the user object as a global variable; change the header so it links to the user controllers; and add the user controllers which don't do anything. 2008-11-11 07:39:20 +00:00
Bharat Mediratta 87f1115113 Change REST API to use non-routable functions: _get(), _post(),
_put(), _delete().

This should make it more obvious that these are not your typical
routes, simplifies overall routing by removing a rule and removes the
possibility of accidentally leaking information if we route to one of
them by accident.
2008-11-11 07:29:48 +00:00
Bharat Mediratta d35f337b7b Add phpdocs to explain how to use REST_Controller 2008-11-11 06:24:30 +00:00
Tim Almdal 9f261213a5 Reset PasswordHash.php to its original state and exclude it from the file_structure_test 2008-11-11 06:21:21 +00:00
Bharat Mediratta dae36c2aa4 Create REST_Controller abstract base class for all REST based resource
controllers.  Any controller that wants to act RESTful can extend this
class and implement get/post/put/delete.

Tweak default routes to disallow direct access to the REST controller
and direct access to any REST methods.
2008-11-11 06:18:45 +00:00
Bharat Mediratta ffa39aabb9 Manually delete the auth table and module entry to ease transitions for devs. 2008-11-10 21:55:27 +00:00
Jozef Selesi ddf0a51900 Comment creation controller, helper and test. Add comments from the scaffold. 2008-11-10 17:32:04 +00:00
Tim Almdal 359e28a50f Remove Auth module 2008-11-10 16:45:06 +00:00
Tim Almdal d4415d0d3e Reset the links in the header and update the readme 2008-11-10 16:36:56 +00:00
Bharat Mediratta 7a1b2b0ca7 Add a test to make sure that we have no windows-style line endings. 2008-11-10 15:33:55 +00:00
Bharat Mediratta ceb0782233 Add support for multi-file-upload using jquery.MultiFile and modify
Item_Controller to accept it.
2008-11-10 12:28:58 +00:00
Tim Almdal 8858b957b0 The start of the login functionality. It shows the login popup but doesn't do anything else. Just got tire of my changes being clobbered :-) 2008-11-10 03:17:56 +00:00
Bharat Mediratta c2162a645a Clean up HTML for adding albums/photos a tad. 2008-11-10 00:34:02 +00:00
Bharat Mediratta b5f2443bb5 Add the ability to create albums to the scaffolding
Revert $_POST back to $this->input->post() because that supports default values.
2008-11-10 00:25:59 +00:00
Bharat Mediratta 085ba7cd46 Tests for Item_Controller 2008-11-10 00:16:41 +00:00
Bharat Mediratta c054b4de04 Convert quote styles
Convert $this->input->post to $_POST
2008-11-10 00:16:03 +00:00
Bharat Mediratta 223cba531e Rename tests to make room for controller tests
Album_Test -> Album_Helper_Test
  Photo_Test -> Photo_Helper_Test
2008-11-09 23:49:09 +00:00
Bharat Mediratta e7155c09c5 Implement Item_Controller::put() and delete()
Adjust/simplify photo::create
Add image uploading to the scaffolding
2008-11-09 23:40:28 +00:00
Bharat Mediratta 25dd0bbf1c style fix 2008-11-09 23:29:05 +00:00
Jozef Selesi 24decb7fa4 Beginnings of the comment module. Install and uninstall. 2008-11-09 22:57:55 +00:00
Bharat Mediratta 1b490c5fe6 Make Gallery3 more RESTful.
Create Item_Controller as a common superclass for Album_Controller and
Photo_Controller.  Change routes to route requests to Item_Controller
for dispatching, which in turn will generate get/post/put/delete
requests to the controlller so that each controller has a RESTful
surface.

Change in_place editing to take advantage of this.
2008-11-09 19:20:23 +00:00
Bharat Mediratta e8d989ff9a Simplify the CSS a bit. 2008-11-08 10:21:18 +00:00
Bharat Mediratta 0238925a63 Restrict our dom traversal to look only for span.gInPlaceEdit for speed. 2008-11-08 09:35:46 +00:00
Bharat Mediratta 950c58e6d3 Add support for in-place editing of data fields. 2008-11-08 09:28:11 +00:00
Bharat Mediratta ac8199a09a Tell users to install the user module before installing auth. 2008-11-08 07:51:19 +00:00
Bharat Mediratta 418c0aab69 Create permanent owner_id column in the item table, and use a soft
relationship to bind the two.  To do this, I overrode __get in
Item_Model so that $item->owner returns the appropriate User_Model.
2008-11-08 07:48:36 +00:00
Bharat Mediratta ea7cc4f46e Simplify the way that we find the user id (just look it up, and if there's a database exception use the null value) 2008-11-08 07:27:46 +00:00
Felix Rabinovich 28b739a210 Adding user (owner) to items; info module 2008-11-08 07:18:56 +00:00
Bharat Mediratta 36d1be4717 44 --> E_DATABASE_ERROR 2008-11-08 05:12:37 +00:00
Tim Almdal d025155314 The start of an authentication module. This provides the installation and a basic install test. There is no interface at the moment to do authentication. It is dependent on the install of the user module. 2008-11-08 01:56:59 +00:00