Commit Graph

35 Commits

Author SHA1 Message Date
Bharat Mediratta
0373cb0676 Use lower-case aliases for greater portability (thanks Romain LE DISEZ) 2009-05-08 17:48:30 +00:00
Bharat Mediratta
181737fb12 Remove the word 'album' from phpdoc. 2009-03-15 02:00:21 +00:00
Bharat Mediratta
c825ec4ffb Move references to "album" out of ORM_MPTT since it's supposed to be
implementation agnostic.
2009-03-15 01:17:25 +00:00
Tim Almdal
b9ee37f30e Override the ORM_MTTP::children and ORM_MTPP::descendants methods in
the item model and always pass the orderby fields.  This insures that
all children or descendant calls will respect the album sort order.
2009-03-09 14:38:25 +00:00
Tim Almdal
39954ad0b7 Implement Sortable albums. Current sort fields include (Creation
Date, Update Date, Random Key, Title, Mime Type, Item Type & Number of views)
2009-03-08 16:29:01 +00:00
Tim Almdal
c04ff8e02f Change the pattern to identify tables that need prefix substitution to
mirror the drupal pattern of using braces {}.
2009-02-28 06:37:28 +00:00
Tim Almdal
bd15853708 This implements table prefix for all the queries in core, user, exif,
tag, search, comment and notification modules (Ticket #68)
2009-02-27 21:07:18 +00:00
Tim Almdal
80d4df3a4a Convert all item->type == "album" to item->is_album()
Convert all item->type == "photo" to item->is_photo()
2009-02-06 03:47:36 +00:00
Bharat Mediratta
ad82721c3b Fix an off-by-one issue-- the destination level is the target's child, not the target itself. 2009-01-29 03:17:09 +00:00
Bharat Mediratta
01d81ec6b4 Update the level when moving items 2009-01-29 02:57:29 +00:00
Bharat Mediratta
eed57674f9 Add move support. Use the move icon in the quick pane. You can't
move an item into its own hierarchy, or into an album where you don't
have edit permission.
2009-01-24 05:14:44 +00:00
Bharat Mediratta
8f1cd010c0 Reload parent after adding a new item since the left/right pointers have changed. 2008-12-23 06:10:06 +00:00
Bharat Mediratta
af32e5708d Remove all caching from ORM_MPTT. This was premature optimization: it
wasn't benefitting us, and it will get in the way when we want to add
implicit view protection to our queries.
2008-12-16 23:36:56 +00:00
Bharat Mediratta
d9e02a5d0c Various optimizations:
o Add model_cache::get() which caches models avoiding duplicate lookups
o Stop using ORM relationships for Item_Model::owner so that we can use caching
o For Item_Model::xxx_edit fields, don't make them editable for guests
o Other minor stuff.

These optimizations reduce the number of queries for a 9-photos page from ~200
to ~45.  Still way too many!
2008-12-16 04:29:00 +00:00
Bharat Mediratta
fef188d787 Leave all locking in ORM_MPTT::move_to, don't worry about it in
Item_Model::move_to, unless it turns out that we really need to.
2008-12-07 09:25:40 +00:00
Bharat Mediratta
bf7ab8904a Change ORM_MPTT::add_to_parent() to take an ORM instead of an id so
that it's consistent with ORM_MPTT::move_to()
2008-12-07 08:46:44 +00:00
Bharat Mediratta
e40b54a468 Adjust exception text to our normal form. 2008-12-07 08:32:30 +00:00
Bharat Mediratta
c9cc6ffd1a fix a couple of typos. 2008-12-07 08:30:08 +00:00
Bharat Mediratta
055aa04497 Rename moveTo to move_to and extend the test a bit. 2008-12-07 08:23:22 +00:00
Tim Almdal
6ea063bc4c Tweak some issues with the moveTo Processing 2008-12-04 21:33:25 +00:00
Tim Almdal
0f103b1c06 Moving albums around with a drag and drop interface seems to work and preserve the left right pointers.
* changed _lock and _unlock to protected methods lock and lock respectively
* added a moveTo method on the Item_Model
* Corrected the hole closure  on delete.
* added moveTo on the ORM_MTPP class
* Changed the rearrange javascript to do moves with ajax
2008-12-04 20:05:58 +00:00
Bharat Mediratta
375e7c675e Implement ORM_MPTT::delete() properly.
Inline ORM_MPTT::_grow() for now
Rewrite ORM_MPTT tests to be domain specific; they no longer use album/photo helpers.
2008-12-04 05:47:05 +00:00
Tim Almdal
5c095cbd78 Add unit tests to test growing and contracting the left and right pointers
Added a delete method to ORM_MPTT that contracts the tree when an item is deleted
2008-12-04 01:12:44 +00:00
Bharat Mediratta
496007d2ae NULL -> null 2008-11-26 21:15:37 +00:00
Tim Almdal
6fd261c8b0 Add unittest and caching for ORM_MTPP::descendants 2008-11-20 06:05:22 +00:00
Tim Almdal
604e58346b Add unittest and caching to ORM_MTPP::descendants_count 2008-11-20 05:06:24 +00:00
Bharat Mediratta
611627231b Clean up the MediaRSS module a little bit:
* Media_RSS_Controller::$LIMIT is now self::$page_size
* We use ORM_MPTT descendant_counts()
* If the page is out of bounds, put it on a boundary
* Move pub_date into the controller to simplify the mrss file
* Put all the view assignment in one block for easier reading
* Removed stray ; from the end of lines in the mrss file

Clean up ORM_MPTT a bit:
* fix spelling: decendent -> descendant
* Remove unnecessary order_by() clauses
* Set the default for $type to null (not "all").
2008-11-20 02:59:43 +00:00
Tim Almdal
bd76b2e89f changed descendents_by_type to descendents and added descendent_count 2008-11-20 00:45:40 +00:00
Tim Almdal
b3314fc1dc Update the media rss template to include the resize and the fullsize
added descendants by type method to the item model to allow for the selection of children by type
2008-11-19 18:23:30 +00:00
Bharat Mediratta
936decb437 Add children_count() to ORM_MPTT 2008-11-07 06:46:38 +00:00
Bharat Mediratta
ae00f73944 * Add thumbnail and resize dimensions to the item table and use them
properly in the theme.
* Move thumbnail and resize generation down into the model for
  consistency.
* Add a sample thumbnail for albums
* Fix a bug in the ORM to clear the cache when we reload an object.
* Add Kohana docs to the scaffold.
2008-11-05 09:42:47 +00:00
Bharat Mediratta
e44ff9bb60 ORM_MPTT::parents() should not include the node itself. 2008-11-05 07:47:19 +00:00
Bharat Mediratta
d21f3437e6 Add the photo controller, and tie it to the photo page in our theme.
Implement a real breadcrumb.
2008-11-05 07:42:52 +00:00
Bharat Mediratta
ef0bb33a95 Order the children() 2008-11-05 01:40:41 +00:00
Bharat Mediratta
605d2de336 Lots of new stuff!
Replace theme HTML with *almost* the latest stuff from the
mockups.  (it doesn't include r18467 yet).

Our theme format is now modelled after WordPress / Habari's style
where you have one entry point per type (eg: album.php) which can
load up whatever parts it needs (eg: $theme->display("header"))

Created album and photo helpers which have create() functions
that form the base of our new API, along with tests for them.

Created our own version of the ORM_MPTT since the existing
versions were too buggy and unsupported to depend upon.  Only has
a minimal implementation so far, and the tests are not yet
committed.

Added path(), thumbnail_path() and resize_path() to Item_Model

Extended the scaffolding to allow you to add lots of
photos/albums into your hierarchy.

Deleted modules/mptt -- we're not going to use this anymore.
2008-11-04 21:24:42 +00:00