Commit Graph

72 Commits

Author SHA1 Message Date
Bharat Mediratta
8d4bd0c814 Update tests to reflect the fact that the admin group is gone.
Fix a bug in user::create(), found by the unit tests (hooray)!
2008-11-27 19:46:39 +00:00
Bharat Mediratta
e183901dc3 Give the admin user actual admin privileges 2008-11-27 11:43:11 +00:00
Bharat Mediratta
34a286ae90 Add navigation_top() and navigation_bottom() insertion points
Move "My Gallery" navigation tab into the user module and only show it
if you're logged in
2008-11-27 11:33:45 +00:00
Bharat Mediratta
c95c17b133 Centralize logging around installing/uninstalling modules. 2008-11-27 09:45:26 +00:00
Tim Almdal
27e64f1dc6 Move javascript from default theme to appropriate modules 2008-11-27 06:14:32 +00:00
Bharat Mediratta
e1f39ac13f Re-enable code to drop view columns from the items table when deleting groups. 2008-11-26 09:38:39 +00:00
Bharat Mediratta
427dc7a0d1 Ignore errors from dropping view columns from the items table. 2008-11-26 09:34:31 +00:00
Tim Almdal
de56a33c9c Clean tag creation 2008-11-26 06:37:12 +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
5ccb050413 group::create() and group::delete() now manage the view_## columns in
the items table.

Convert installer over to using new creation API.
2008-11-26 04:13:57 +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
Chad Kieffer
e85282b709 Make login form JS unobtrusive. Needs work. 2008-11-24 00:27:45 +00:00
Bharat Mediratta
c6f0cc036d Move all block callbacks from View::block_type() to
$theme->block_type() so that the themer has a consistent interface.
Also added a bunch more callbacks and normalized the names so that the
module author has plenty of options for where stuff gets put on the
page.  Especially renamed album/photo/sidebar to be album_blocks()
photo_blocks() and sidebar_blocks() to make it clear that those are
going to be larger content sections and not just basic insertion
points.

Used __call() to collapse all functions in the theme, which
incidentally makes it trivially easy to add a new insertion point.
2008-11-22 21:46:34 +00:00
Chad Kieffer
ac9df35d8a Cleanup of header to normalize margins and white space. Improved display of user login form. Added gHide, gShowBlock, gShowInline, gClose classes to handle show and hide functions. Half-baked idea which will need refinement. 2008-11-22 20:36:46 +00:00
Tim Almdal
4f5e3ad6d5 Use the new block mechanism to insert user related content into the html pages 2008-11-21 20:46:25 +00:00
Bharat Mediratta
340a0d7117 Add a @todo to change user "joe" in the future. 2008-11-20 06:26:42 +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
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
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
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
59dbd1dc83 Move User_Controller to Users_Controller per jozefs request. 2008-11-18 08:10:14 +00:00
Tim Almdal
8b6796fa5f Synchronize the model rules with the database definitions and vice-versa. 2008-11-18 00:38:36 +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
0975e702a9 Add _method=put to the edit form
Properly implement User_Controller::_put()
2008-11-16 19:26:44 +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
Bharat Mediratta
4610fc8e7f Create Forge::add_rules_from() which pulls validation rules from the model and
associates them with the form.  This replaces the various _add_validation_rules()
functions in the user and comment modules.

Move user edit form into user helper for consistency with the comment module.

Implement missing _form method in the user controller.
2008-11-16 07:51:42 +00:00
Bharat Mediratta
b8b60df391 Rename gLogin -> gLoginForm
This disambiguates forms from blocks (for example in the comment
module we were calling both the form and block gComments).
2008-11-16 07:07:16 +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
Bharat Mediratta
6fd7194544 Destroy the session on logout, don't just delete the user. 2008-11-15 21:47:21 +00:00
Bharat Mediratta
16828a4bc7 Delete the user from the session when uninstalling the user module 2008-11-15 09:08:59 +00:00
Bharat Mediratta
c152e5db5a Only remove the user from the session when logging out. 2008-11-15 09:05:21 +00:00
Bharat Mediratta
9d1a598ec0 Add support for modifying user data. It still needs work.
Make the continue= param a GET only parameter so that it's not part of
the form.
2008-11-15 08:15:00 +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
bd1ec2df1f The state of of the user registration functionality 2008-11-14 18:16:13 +00:00
Tim Almdal
d7745f2ad8 Add the name attr to the input fields and use the form.serialize() method to generate the post data 2008-11-14 17:23:10 +00:00
Tim Almdal
ed90edfa96 Remove class="gInline" and set the css as suggested by thumb in -devel 2008-11-14 16:56:17 +00:00
Bharat Mediratta
5a2fe6bb0b Internationalize all strings 2008-11-14 08:22:53 +00:00
Tim Almdal
652cc48b77 change the display name to a varchar 2008-11-14 07:42:20 +00:00
Tim Almdal
2386902926 Remove the logout action from the login controller 2008-11-14 07:20:00 +00:00
Bharat Mediratta
f0695f2030 Move logout to its own controller 2008-11-14 05:21:47 +00:00
Bharat Mediratta
71dc730986 Change quotes style 2008-11-14 05:09:07 +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
Tim Almdal
6d7130bffc Progress is being made... you can now logout 2008-11-13 05:17:58 +00:00
Tim Almdal
f62719ba61 Login is now working, but you can't logout 2008-11-13 04:56:12 +00:00
Chad Kieffer
c63ddc3432 Major updates to form CSS. Now using unordered lists for layouts. Added .gInline for forms like login, search, tags. Updated comment, login, search, and tagging forms. All form styles live in screen.css now. Still a lot to do, but this is a good foundation. 2008-11-13 03:39:18 +00:00
Tim Almdal
74216a3c63 The login processing is starting to take shape. Login_Form is gone. The html for the login form is retrieve via an ajax call when the user clicks on login. Can't login with a valid id yet, but you certainly get error messages when things are wrong :-) 2008-11-12 21:42:40 +00:00
Tim Almdal
2a9f8b5bcd Added a legend to the fieldset 2008-11-12 18:13:59 +00:00