Commit Graph

97 Commits

Author SHA1 Message Date
Tim Almdal
066854424a Add a method to create a micro_thumb that is centered vertically in
its container (initially used for organize album view)
2009-03-27 17:36:14 +00:00
Tim Almdal
9d35437167 Update comments to reflect that the results of item::children or
item::descendants uses the specified sort order
2009-03-26 17:42:17 +00:00
Bharat Mediratta
2067314186 untabify 2009-03-25 01:34:04 +00:00
Tim Almdal
3523bf5d90 Change the item model so it will actually delete all the file system
objects when an item is deleted.
2009-03-24 19:04:43 +00:00
Tim Almdal
fd58fe0ae0 Fix for ticket #168: Set a default value for extra_attrs on the Item_Model::thumb_tag() 2009-03-23 14:51:09 +00:00
Bharat Mediratta
e1c53921d3 Don't divide by zero in thumb_tag if there's no thumbnail 2009-03-20 20:33:20 +00:00
Chad Kieffer
0695be1ccf Restore $extra_attrs in img tags. Roll back to using .gThumbnail in quick pane. 2009-03-20 04:39:27 +00:00
Tim Almdal
ccb02b001f Fix for ticket #155. Delete the item record before unlinking the
files.
2009-03-18 22:42:31 +00:00
Bharat Mediratta
e92e6d4da4 Oops, I used the wrong resize variables in my last change. 2009-03-16 11:33:14 +00:00
Bharat Mediratta
f25ff87ba9 Remove unnecessary __get() function 2009-03-16 07:17:15 +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
Bharat Mediratta
f9122c7908 Don't use html::image because it forces absolute urls, which we don't want. 2009-03-14 21:24:32 +00:00
Bharat Mediratta
e658b9895e Default thumb/resizes to relative urls. 2009-03-14 18:31:56 +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
ac82e0a9df Change Item_Model::get_position to respect the sort order. This also
forced the next/prev buttons in album navication to respect the sort
order as well.
2009-03-09 13:43:13 +00:00
Bharat Mediratta
e37faa0008 More tasks cleanup.
Don't join through to the users table; that won't work in embedded
mode.  Instead, add Tasks_Model::owner() that calls user::lookup() and
refer to the object directly in the view.

Add Admin_Maintenance:remove_finished_tasks() so that we can easily do
old task cleanup.

Hide Running / Finished sections if there aren't any running or
finished tasks.
2009-03-09 07:28:19 +00:00
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
Tim Almdal
dc4f784558 * Refactor task management methods from admin_maintenance.php to
task.php
* Added a owner_id field to the task database
* Modified the admin maintenace to show the owner of the task
<<**** Requires a reinstallation of core ****>>
2009-02-27 16:28:20 +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
Andy Staudacher
dce6548431 Add local localization functionality. Local = no means to upload / download translations to a translation server yet.
- Added an outgoing_translations table to store translations from the local translation UI.
 - I18n class is checking incoming_ and outgoing_translations for translations, giving the latter priority.
 - Not handling plural strings in the translations UI yet.
2009-02-09 08:42:13 +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
ff6791f576 Models should be named in adjective_noun form to make pluralizatoin
more intuitive.

Renamed Translations_Incoming to Incoming_Translation to suit.
2009-01-13 01:05:11 +00:00
Bharat Mediratta
6c2aef1b4a Fix windows-style line endings. 2009-01-11 02:03:42 +00:00
Felix Rabinovich
b647aa0f74 Theme Administration v. 2. Doesn't distinguish between regular and admin themes yet 2009-01-09 23:31:46 +00:00
Andy Staudacher
2917740ba6 First step of i18n refactoring:
- Using DB table translations_incomings as translations storage (file cache to be added)
- Removed overly complex i18n code which will be unnecessary with the future compiled cache files
- Added t() as a translation function (global refactoring from _() to t() to follow)
2009-01-08 06:52:18 +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
ed8689f768 Expand on the maintenance code to make it more robust and give the
admin more control.  You can now track running tasks, resume stalled
tasks, cancel running tasks, and remove finished tasks.

Added graphics::compose() as a placeholder for future watermark
operations.

Added CSRF protection to maintenance urls.
2008-12-28 23:48:15 +00:00
Bharat Mediratta
74d4e7d505 First round of a task framework. Tasks are job definitions stored in
the database.  They're started with admin/maintenance/start/[task_name]
which sends down some JS/HTML which regularly pings the task at
admin/maintenance/start/[task_id] until its done.

The UI is still very rough.  It works, though!
2008-12-28 10:12:41 +00:00
Bharat Mediratta
dee20ed6a2 Added the concept of "permanent" messages that we show to admins. Use
this to show a "your thumbs/resizes are out of date" message whenever
we change the graphics rules.  Tweak watermark module to add graphics
rules whenever we make a change, which triggers the graphics module to
add the permanent message.
2008-12-26 05:43: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
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
3ce32dab55 Report actual log entries in the "log entries" admin block. 2008-12-21 03:56:53 +00:00
Bharat Mediratta
f0b6333344 Add a logging facility, and instrument login/logout to use it. 2008-12-21 03:50:11 +00:00
Bharat Mediratta
99c481897b Add "created" and "updated" timestamps to the items table. 2008-12-20 22:49:32 +00:00