Commit Graph

26 Commits

Author SHA1 Message Date
Andy Staudacher
e4a9b19bf9 Changing t() placeholder syntax from {{replace_me}} to %replace_me. 2009-01-15 10:02:41 +00:00
Bharat Mediratta
034f30190e Rename 'xxx_changed' events to 'xxx_updated' 2009-01-15 02:52:42 +00:00
Bharat Mediratta
ad4f495e56 Rename events
album_created, photo_created  -> item_created
  album_updated, photo_updated  -> item_updated
2009-01-15 02:51:16 +00:00
Andy Staudacher
a631fe29f3 i18n refactoring: Rename all _() (reserved by gettext) calls to t().
- And refactor printf to our string interpolation / pluralization syntax
- Also, a slight change to the translations_incomings table, using binary(16) instead of char(32) as message key.
2009-01-08 17:13:06 +00:00
Bharat Mediratta
8620c3fa01 Update event calls to take the orig and new models so that event listeners can do comparisons 2009-01-08 02:39:21 +00:00
Bharat Mediratta
fc56ebd434 Simplify the next/previous logic in the theme by passing in a null
next/prev sib if one didn't exist.  (that's what we were supposed to
be doing in the first place, anyway)
2008-12-31 07:22:35 +00:00
Bharat Mediratta
44c987e89e Add sibling information on photo pages and a very simple next/previous interface. 2008-12-31 07:06:10 +00:00
Bharat Mediratta
b7f451635a change single to double quotes. 2008-12-31 06:44:38 +00:00
Bharat Mediratta
6ab195854d Remove rest::JSON content type; it's causing lots of problems and it doesn't directly help since text/html works just as well for our JSON communications 2008-12-29 22:41:53 +00:00
Felix Rabinovich
6b1fa62173 Added content type to JSON output functions 2008-12-26 20:08:15 +00:00
Bharat Mediratta
2c91a7e9ce Rework log and message helpers to be parallel, but separate.
1) they now have their own matching severity constants
2) they both have convenience functions success(), info(), warning() and error()
3) they both have severity_class()
2008-12-25 23:43:44 +00:00
Bharat Mediratta
fdc0f83024 Big round of normalization of the way that our controllers
communicate.  Almost all controllers now use JSON to speak to the
theme when we're dealing with form processing.  This means tht we only
send the form back and forth, but we use a JSON protocol to tell the
browser success/error status as well as the location of any newly
created resources, or where the browser should redirect the user.

Lots of small changes:
1) Admin -> Edit Profile is gone.  Instead I fixed the "Modify Profile" link
   in the top right corner to be a modal dialog

2) We use json_encode everywhere.  No more Atom/XML for now.  We can bring those
   back later, though.  For now there's a lot of code duplication but that'll be
   easy to clean up.

3) REST_Controller is no longer abstract.   All methods its subclasses should create
   throw exceptions, which means that subclasses don't have to implement stubs for
   those methods.

4) New pattern: helper method get_add_form calls take an Item_Model,
   not an id since we have to load the Item_Model in the controller
   anyway to check permissions.

5) User/Groups REST resources are separate from User/Group in the site
   admin.  They do different things, we should avoid confusing overlap.
2008-12-25 05:12:46 +00:00
Bharat Mediratta
f6ebb436e4 Rest_Controller -> REST_Controller everywhere, for consistency. 2008-12-25 02:38:53 +00:00
Bharat Mediratta
c7193f9b2e Normalize our Admin controllers so that functions always print out
their results, as opposed to having them return their view back
upstream.  This is a little more code in every controller, but it's
much less magical and more consistent.

Look up the active_theme and active_admin_theme inside the view
itself, no need to do that in the controllers.  This makes view
initialization easier in the controllers.
2008-12-24 04:22:22 +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
ec8462410f Update view counts for albums also 2008-12-20 20:11:51 +00:00
Bharat Mediratta
50b0613243 Add view counts and show them properly. 2008-12-20 20:04:57 +00:00
Tim Almdal
942dbe175c Remove a couple of todo's by store the "theme name", "admin theme name" and "page size" in the vars table and initializing when the core module is installed 2008-12-12 19:39:38 +00:00
Bharat Mediratta
18a6614a11 Change all access API methods to take ORMs instead of ids. This will
minimize reloading objects from the database.
2008-12-10 07:05:49 +00:00
Bharat Mediratta
4a0e4b798e Check view permissions before allowing view access to albums/photos. 2008-12-09 10:14:09 +00:00
Tim Almdal
fb6e22e145 Implemented photo::_get_photo_add(). You need to create the var/uploads directory and make it writable by the server. The location of the temporary upload directory is specified in config/upload.php 2008-12-06 21:14:36 +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
7e5f59bcb7 Add children_count to album/photo controllers for consistency with tags 2008-11-27 05:59: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
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