Commit Graph

10 Commits

Author SHA1 Message Date
Bharat Mediratta
0a4bce3f67 Remove debug line. 2009-03-25 02:13:01 +00:00
Bharat Mediratta
f3ba69c1d6 Make sure that helper functions are all static. Add new
File_Structure_Test to make sure we don't regress.

According to the PHP docs, the "public" keyword is implied on static
functions, so remove it.  Also, require private static functions to
start with an _.

http://php.net/manual/en/language.oop5.visibility.php
2009-01-14 04:12:02 +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
Tim Almdal
27a9c14d27 If the the post and get arrays don't contain a _method parameter, then use the request::method() to determine the actual request method (i.e. delete doesn't show up in either places) 2008-12-03 17:33:18 +00:00
Bharat Mediratta
b79ce414de Detect browsers that prefer XHTML (Chrome!) and normalize it to HTML
so that we don't ship XML down to Chrome.
2008-11-24 07:50:20 +00:00
Tim Almdal
a347ed5c10 Correct case on helper class names. By convention, helper class names are lower case:
http://docs.kohanaphp.com/general/helpers

Remove block_helper file as the abstract class os no longer required.
2008-11-22 06:01:08 +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
Bharat Mediratta
e2b040c6ae Add a missing slash in the HTTP return code 2008-11-20 06:49:43 +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