Commit Graph

64 Commits

Author SHA1 Message Date
Bharat Mediratta
1ad7ca639d Make the description a text column so that we can handle much larger
descriptions.
2009-03-09 03:29:22 +00:00
Tim Almdal
f371c663c5 Fix for ticket #114 Permissions seem to be ignored 2009-03-05 17:16:38 +00:00
Bharat Mediratta
83e12961b1 Allow url() to return absolute urls 2009-03-04 06:25:25 +00:00
Bharat Mediratta
515c081f79 Add support MP4 movies also. Flowplayer supports them and can stream
them using the h264streaming plugin.  Everything else is a fairly
minor change.
2009-02-25 05:27:29 +00:00
Tim Almdal
585ea81957 Fix for ticket #98.
The problem was that item::delete was deleting the parent album
2009-02-24 19:52:01 +00:00
Bharat Mediratta
ffbab952c6 If the album_cover_item_id points to a missing item (unlikely but possible) just treat it like it was missing and continue 2009-02-22 23:54:48 +00:00
Bharat Mediratta
baff63b70b Very basic movie support. You can upload a FLV file, we use ffmpeg to
extract a thumbnail out of it and if you click through we show it
using flowplayer.
2009-02-22 05:21:44 +00:00
Tim Almdal
1fc2307fab rollback r20001-r19998, r19995. This may require a reinstall 2009-02-08 02:21:28 +00:00
Tim Almdal
a3704c8dd8 Assign the Album|Photo path field explicitly instead of hiding that in
the item::__set magic method.
2009-02-07 17:16:48 +00:00
Tim Almdal
4e107dac41 Implement fix for ticket #35. *** Requires reinstall of core ***
* Added new field in items table (path) which is sanitized version of
name.
* Added __set method on Items_module to set the path field whenever
the name field is changed.
* Made some changes to the scaffolding so missing the path column
would not kill the scaffolding.
* Changed MY_url::site so not having a 3rd parameter won't throw an error.
2009-02-06 16:39: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
b4f92c7de6 Add delete support as a quick-edit option 2009-01-29 09:26:39 +00:00
Bharat Mediratta
894a33d744 Add support for pretty urls. So now instead of urls like:
http://example.com/gallery3/index.php/albums/2
  http://example.com/gallery3/index.php/photos/9

You'll see urls like:
  http://example.com/gallery3/index.php/Family/Weddings
  http://example.com/gallery3/index.php/Family/Weddings/Bob.jpg
2009-01-29 03:22:02 +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
94e356fc31 Take advantage of the new support for parentheses added in r19879 and
fix a bug in viewable() that was AND'ing all view permissions together
(which meant that you had to have *all* permissions to view an item,
instead of just one).

Also, add a "max" param to the thumb_tag() so that we can specify a
max dimension for the thumbnail.  This will be used in the upcoming
"move item" feature.
2009-01-23 08:11:33 +00:00
Bharat Mediratta
2d7ab6f4da Create Item_Model::thumb_tag() and Item_Model::resize_tag() to provide
an abstraction for when we add movie support.
2009-01-14 07:21:35 +00:00
Bharat Mediratta
7017e95c99 Allow passing a query string as an argument to Item_Model::url() 2009-01-04 09:28:57 +00:00
Bharat Mediratta
3d9e5e439e Stay on the right page when we navigate up in the breadcrumb.
Introduce a "show" parameter which contains the id of the item that we
want to show when we go to the parent's page.
2009-01-03 20:14:06 +00:00
Bharat Mediratta
c1140b5c0a Add Item_Model::url() and use it where appropriate. Cleans up some
grotty looking stuff in themes.
2008-12-31 07:13:34 +00:00
Bharat Mediratta
1579494ec4 Preliminary "Edit Permissions" dialog. You can't change permissions
yet, but it shows you which items have locked view perms.
2008-12-31 04:05:41 +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
2502240ce4 Add very simple graphics toolkits.
Track a set of rules in Graphics_Rule_Model which specify how we turn
original images into thumbnails and resizes.  There's one set of rules
that applies to every image in the Gallery.

Track the state of thumbs and resizes with a "dirty" bit.  The new
graphics helper manages the rules and can rebuild the thumbs and
resizes for any images that are considered "dirty".

Introduce the concept of an "album cover" which is an item that an
album points to.  We'll use that item as the source for the album's
thumbnail/resize.

Conflated with this change (sorry!) I also changed the Var table to
use module_name instead of module_id.  This may be marginally less
efficient, but it's much easier to follow in the database.
2008-12-23 04:14:07 +00:00
Bharat Mediratta
99c481897b Add "created" and "updated" timestamps to the items table. 2008-12-20 22:49:32 +00:00
Bharat Mediratta
b37047ff55 Add Item_Model::viewable() which we can use to restrict any query to
just items viewable by the active user.  Ie:

  ORM::factory("item")
    ->where("name", "foo")
    ->find_all()

Would get all items with the name "foo".

  ORM::factory("item")
    ->viewable()
    ->where("name", "foo")
    ->find_all()

Restricts it to just the set of items that the user is allowed to see.
2008-12-17 22:39:33 +00:00
Bharat Mediratta
8630d61051 Change the album thumbnail/resize from _album.jpg to .album.pjg
because the leading underscore confuses the Kohana router.
2008-12-17 04:55:49 +00:00
Bharat Mediratta
fc7b78492b Separate thumbnails out into var/thumbs. This clears up some ambiguity in Item_Model and simplifies
file_proxy.  It also means we can stop munging file names in the var/resizes hierarchy.

In the process, rename "thumbnail" to "thumb" everywhere in honor of
Chad (well, ok because it's shorter)..
2008-12-17 04:45:35 +00:00
Bharat Mediratta
f4c6a20149 Remove error checking; if this fails let it fail noisily for now so that we can find problems faster. 2008-12-16 23:59:33 +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
Tim Almdal
43e626f99e Change the resize option on creating thumbnails and resizes to Image::AUTO which will preserve the aspect ratio of the original image 2008-12-12 21:37:11 +00:00
Bharat Mediratta
2cf3233f54 Get rid of all pseudo users and pseudo groups, while preserving all
other functionality.  This makes our user/group and access code
fully consistent.
2008-12-12 00:59:30 +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
055aa04497 Rename moveTo to move_to and extend the test a bit. 2008-12-07 08:23:22 +00:00
Tim Almdal
8d1790a0b4 * Add a moveTo unit test
* Pass the module::event(..., $data) by reference to the handlers
2008-12-05 04:56:33 +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
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
Tim Almdal
9ae6acdc0a Before deleting an item, save the path to the image in the var directory as once the item is deleted, the $item->file_path() is no longer valid. 2008-12-04 00:14:52 +00:00
Bharat Mediratta
ccee9854c2 Rename file::unlink() to dir::unlink(). This creates an API that is
clearer about its actions, otherwise we may accidentally blow away an
entire hierarchy when we think we're deleting a single file (there's a
reason why rm won't let you delete dirs that aren't empty!)

Name it "dir" instead of "directory" because apparently "directory" is
already reserved.

Move the delete call out of Items_Controller and into the model.  The
model is responsible for keeping state integrity, not the controller.
2008-12-03 23:31:10 +00:00
Tim Almdal
3953dde2c6 The rearrange module will now add an album if you drag the "new album" onto the album tree. I haven't had a chance to figure out why the form does get any styling or why a textarea is no included as a list item. 2008-12-02 21:25:15 +00:00
Bharat Mediratta
8e6eff096b Don't add in-place-edit CSS unless there's a logged-in user. 2008-11-25 01:39:20 +00:00
Tim Almdal
d7288d33e6 Remove the has_many_and_belongs_to_many relations from the item model 2008-11-24 05:55:29 +00:00
Tim Almdal
ab20406ef2 Tag module database definitions 2008-11-23 18:00:44 +00:00
Tim Almdal
d48d71a705 Correct typo 2008-11-20 00:22:36 +00:00
Bharat Mediratta
4a4eac31ad Create url::abs_site() and url::abs_file() to allow us to generate
full URLs with a clean API, and isolate the cruddy party where we have
to hardcode the server protocol into a single file.
2008-11-19 23:33:50 +00:00
Bharat Mediratta
1b36ce6c7e Fix broken path in url()
Fix some style issues
2008-11-19 22:47:30 +00:00
Tim Almdal
103bd8e8d2 Add the original item height and width to the item table 2008-11-19 22:45:30 +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
Tim Almdal
e14d5574b6 Cleanup media rss feed
added parameters to thumbnail_url and resizes_url to be passed to the url::base call to generate ful urls
2008-11-19 06:05:38 +00:00
Tim Almdal
c7b2090f0c add the mime type column on the item table 2008-11-19 03:29:53 +00:00
Bharat Mediratta
df4832bf6f Change Media_RSS_Controller so that it does not extend REST_Controller, since it
doesn't refer to a fixed resource or collection of resources.

Fix some minor bugs in the code so that we can actually generate a
feed.  It looks pretty cool!  Improved pagination links, but didn't actually test them.
2008-11-19 03:17:56 +00:00
Tim Almdal
ad7ace9b72 The continuing evolution of the slideshow...
1) added a mime_type property to the item module(no database change)
2) created a media_rss module
3) moved most of the functionality for the downloading the images to the media_rss module
2008-11-19 02:31:20 +00:00