Commit Graph

56 Commits

Author SHA1 Message Date
Bharat Mediratta
a676ac8e60 Don't try to make a new photo the album cover unless we can edit the parent album 2009-05-03 21:14:18 +00:00
Bharat Mediratta
b4c9a97050 Create item helper and move move_item(), remove_album_cover() and
make_album_cover() functions into it.
2009-05-02 20:34:02 +00:00
Bharat Mediratta
0fd82598b5 Move make_album_cover and remove_album_cover out of Item_Model and
into the core helper.  Clean up interactions so that when we remove an
album cover we pick a new one, or clean out the old album cover if
there are no other choices.
2009-05-02 20:14:13 +00:00
Tim Almdal
71cac8bf15 Forgot these when i created the make_album_cover method 2009-05-01 23:32:35 +00:00
Jakob Hilden
8db55de4f0 changed order of form fields in photo and album forms so that the confusing "name" field is not on top anymore
changed "name" label to "Filename" for photos and "Directory Name" for albums
2009-04-12 17:52:26 +00:00
Tim Almdal
523c467eed Fixes issues with Server Add:
1) Fixes Ticket #208
2) Fixes Ticket #190
3) Fixes an unticketed issue where two items could collide when
creating the thumbnail and/or resize. For example, loading a.flv and
a.jpg would have generated the same thumbnail image.  This change adds
a random value to the name to avoid conflicts.
4) Added item::__set() to clear the relative path if the name changes
2009-04-08 15:11:55 +00:00
Tim Almdal
f1eec57221 Add a weight column to the items model. Change the album ordering to
use this as the default instead of id.  This prepares the way for
manual reordering in the organize functionality.
2009-04-05 16:57:51 +00:00
Tim Almdal
6b5d395d59 Fix for ticket #153. The sort column was not not initialized for
movies or photos.  Turns out that when you go to delete, ORM tries to
check for children and apply the sort order.
2009-03-18 19:39:34 +00:00
Tim Almdal
d097b4fc02 Update to image_block based on bharat's feedback
1) move the rand_key column into core
2) don't do a max rand, just try to a get a random number less than
the current random number if that doesn't successd look the other way
2009-02-26 23:38:17 +00:00
Tim Almdal
c3fcd3a79b Fix thumbnail and resize generation for photos. the variable $type had
never been set, so it was never equal to "photo" so no thumbnails were generated.
2009-02-26 16:12:09 +00:00
Tim Almdal
0929d41305 Added a check to insure that the resize or thumbs image files do not
exists. As per ticket #109
2009-02-26 14:53:01 +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
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
Bharat Mediratta
dcc42328b1 Fix indentation. 2009-02-19 01:50:38 +00:00
Bharat Mediratta
2ec347a3ae Fix indentation. 2009-02-14 19:32:00 +00:00
Tim Almdal
1fc2307fab rollback r20001-r19998, r19995. This may require a reinstall 2009-02-08 02:21:28 +00:00
Tim Almdal
90277704a2 Changed the way album and photo creation guards against duplicate
names.
Added similiar code to insure that path names are not duplicated.
2009-02-07 18:12:06 +00:00
Tim Almdal
69e0d72b93 Updated comments on photo::create to reflect the inclusion of the
owner_id and shamelessly broke it into two changes to to the 20k commit.
2009-02-07 17:27:09 +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
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
Tim Almdal
a8233ed979 Undo the adding underscores to the id on forge generated forms 2009-01-25 06:28:04 +00:00
Tim Almdal
cbff78daa8 Supply a form id on all forms. This id can be used by modules other
than the originating module to provide additional functionality to the form.
2009-01-24 17:26:47 +00:00
Andy Staudacher
e4a9b19bf9 Changing t() placeholder syntax from {{replace_me}} to %replace_me. 2009-01-15 10:02:41 +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
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
ae73ef3d57 Updated for new Form_Submit API.
OLD:
  $form->submit("Foo")  -->  <input type="submit" value="Foo">

New:
  $form->submit("foo_button")->("Foo") --> <input type="submit" name="foo_button" value="Foo">

Mostly we don't care what the button is so we leave the name blank.
2009-01-12 07:50:04 +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
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
76b1500209 Clean up the way that we upload via dialogs:
1) If the create request is Ajax, then return a 201 Created response code
2) If we receive back a 201 response, then switch to the new page.
3) Display a status message when we do an upload.
2008-12-23 07:30:14 +00:00
Bharat Mediratta
5713e3c66e Change photo::create() and album::create() to take ORM instances
instead of ids.
2008-12-23 04:36:09 +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
608d099669 Update comment. 2008-12-23 01:49:26 +00:00
Bharat Mediratta
f476e2169e Change photo::img_dimensions to take the dimensions, not a photo. This lets us use it in the watermark module too 2008-12-23 01:27:50 +00:00
Bharat Mediratta
8f87a030c8 Implement the photo stream with the most recently uploaded photos. 2008-12-20 23:19:12 +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
Tim Almdal
fc1e7a9333 1) fix Forge_Group to display the label (will raise a bug with Kohana)
2) Change form.html.php to use the group label instead of the name
3) Converted the add photo to explicity set the label of the field (new coding standard)
2008-12-14 03:19:31 +00:00
Tim Almdal
80792d4fb1 Set the resize and thumbnail maximum dimension into the module vars table 2008-12-13 05:01:12 +00:00
Tim Almdal
7b7bf37e67 Set thumbnails to 200x200 and resizes to 640x640 and let the Image::resize method pick the right aspect ratio 2008-12-13 04:12:40 +00:00
Tim Almdal
b409a376f3 1) Change the photo description field to a text area
2) Added a 'type' data element to both forge/Form_Textarea and forge/Form_Upload

The second change allows the drawForm to correctly render both of these elements enclosed in a <li>...</li> html blocl
2008-12-07 17:09:21 +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
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
Bharat Mediratta
8b6ed6c477 Create module::event() which runs Gallery events. It works by
convention.  To respond to the "photo_created" event in the gmaps
module, you create modules/gmaps/helpers/gmaps_event.php containing
class gmaps_event which has function photo_created.

Renamed all events from gallery.foo.bar to foo_bar
Updated tag module to use new convention.
2008-11-28 19:37:01 +00:00
Tim Almdal
828f23896f Rename item events and create events for comment create, login, logout, user creation. I probably forgot some, but its a start. 2008-11-28 00:51:38 +00:00
Tim Almdal
3ad9b6174a Add event plumbing to allow the tag module to be notified when a photo is created. Eventually this will be used to parse the image meta data and extract tags; 2008-11-28 00:19:08 +00:00
Bharat Mediratta
bc210a708e Set resize to 640x480 for now to avoid breaking the default theme layout 2008-11-27 22:08:00 +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
Tim Almdal
6ec266faa6 2nd attempt at inserting html by modules. 2008-11-21 20:13:28 +00:00
Tim Almdal
29cc48ebcf Correct missing quotes 2008-11-20 04:41:29 +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
c7b2090f0c add the mime type column on the item table 2008-11-19 03:29:53 +00:00