Commit Graph

687 Commits

Author SHA1 Message Date
Bharat Mediratta
23b0abb974 Redefine the batch API to be very very simple. You call
batch::start() before starting a series of events, and batch::stop()
when you're done.

In batch mode, the notification module will store up pending
notifications.  When the batch job is complete, it'll send a single
digested email to each user for all of her notifications.

Updated the scaffold and local_import to use this.  Haven't modified
SimpleUploader yet.
2009-03-04 08:51:49 +00:00
Bharat Mediratta
b493a534f2 A variety of cleanups:
* Allow for the "movie" type in all of our text
* Try to follow the pattern of mainly only passing ORM objects
  to the view and let it generate its own text (this becomes
  even more important when 3rd parties want to customize notification
  messages)
* Rename _send_message to be _notify_subscribers to be more acccurate
  and have it explicitly take a subject in the API
* Use Item_Model::url() in the views instead of hand crafting URLs
* Reformat HTML in views
* Use $comment->author_xxx() functions instead of replicating that code
* Fix several places where we were encoding data by doing ucfirst($item->type)
  with conditionals where we form the text properly.  We should *never*
  be showing data types to the end user!  This is not localizable!

Note that this probably breaks the existing batch processing code.  I
am going to redo that in a subsequent pass.
2009-03-04 06:25:55 +00:00
Bharat Mediratta
3600e73282 Simplify logic a bit and tweak the visible text. 2009-03-04 05:22:42 +00:00
Bharat Mediratta
302ee07acb Indentation and whitespace tweaks. 2009-03-04 04:55:23 +00:00
Bharat Mediratta
3c015b4d5f Fix indentation. 2009-03-04 04:49:00 +00:00
Bharat Mediratta
f71cbc8a71 remove unnecessary render() 2009-03-04 04:46:49 +00:00
Bharat Mediratta
c487443860 Move <label> outside of <?= ?> block 2009-03-04 04:28:04 +00:00
Tim Almdal
81a6dc26cb Send 1 items added notification per batch of items 2009-03-04 03:31:01 +00:00
Tim Almdal
e33ad56b99 Forgot to remove a debugging statement 2009-03-04 03:08:23 +00:00
Tim Almdal
4a5b005931 Use Directory Iterator 2009-03-04 02:03:05 +00:00
Tim Almdal
328a982546 * Validate that the source path is authorized.
* Add site warning message if local_import is installed an there is no
  authorized directories
2009-03-03 23:07:07 +00:00
Tim Almdal
e291e88110 Remove csrf verification from autocomplete handler 2009-03-03 22:27:27 +00:00
Tim Almdal
c864f23f2e Only show local_import head stuff (css and js) when the local_import
admin page is shown
2009-03-03 22:25:22 +00:00
Tim Almdal
08c47f28f2 Inline the admin view creation that was in helpers/local_import.php
and remove it.  Cleanup unused variables. Rename the method remove()
to remove_path()
2009-03-03 22:19:46 +00:00
Tim Almdal
f58bbe0610 Improve the comment about why we skip the first path.
Change to use access::required
2009-03-03 21:43:59 +00:00
Bharat Mediratta
9775cb69e2 Fix indentation, remove unnnecessary csrf check. 2009-03-03 21:19:31 +00:00
Tim Almdal
0408a0096a Undo r20234 2009-03-03 06:29:16 +00:00
Tim Almdal
1c6384f823 Removed the === false and === true checks 2009-03-03 06:18:18 +00:00
Tim Almdal
7cadb4b21b Refactored the batch Api: 1) created a small batch helper class:
Starting a batch call batch::operation(name, item). In the case of
adding photos name = add and item is the parent of the new items.
When the operation is finished the batch::end_operation(name) is
called.
operation and end_operation events are called.  Handlers
(i.e. item_created) can call batch::in_progress(name) to determine if
a batch is being processed.
2009-03-03 05:59:38 +00:00
Tim Almdal
7bcab31f5d Fix issue identified by security review... some table names where not
being translated.
2009-03-03 03:52:21 +00:00
Tim Almdal
512a532650 Simplify the batch api by having the core event handlers for
start_batch and end_batch add and remove the batch id from the
session.  Modules wishing to do batch processing, just need to fire
the start_batch and end_batch events.  Other modules that need to be
aware of batches (i.e. notifications) just check the session for "batch_id".
2009-03-01 19:11:01 +00:00
Tim Almdal
bed1bb48f3 The scaffolding, simple_uploader and local_import now call two new
events: start_add_batch and end_add_batch.  The parameter is a batch
id which is generated on the first add request.  The protocol is call
the add_photo as many times as required and then call finish when
done.
Also renamed the add method in local_import to add_photo so it is
consistent with simple_uploader
2009-02-28 20:12:54 +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
ad56995baf Correct a type and missed a table name 2009-02-28 03:34:03 +00:00
Tim Almdal
1328755b11 This implement table prefix for the watermark notification modules (Ticket #68) 2009-02-27 21:15:13 +00:00
Tim Almdal
fd610589ed This implements table prefix for all the queries in core, user, exif,
tag, search, comment and notification modules (Ticket #68)
(missed this one)
2009-02-27 21:09:00 +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
c4cdecc05f 1) Change the image block so it has the correct url in the anchor tag.
2) Change the wrapping class to gImageBlock instead of gImage so the
quick kinks aren't enabled
2009-02-27 13:44:19 +00:00
Bharat Mediratta
3193c19ca9 Remove unneeded code. 2009-02-27 05:40:29 +00:00
Bharat Mediratta
cd0f9a5d6c Optimize the code by ditching the count query; we don't need it. 2009-02-27 05:39:51 +00:00
Tim Almdal
0b055835fd Remove commented code
Correct unbalanced brackets
2009-02-27 02:50:07 +00:00
Tim Almdal
acdc724fc8 Continue the journey of replacing raw sql with ORM or Database method
calls (Ticket #68)
2009-02-27 00:34:50 +00:00
Tim Almdal
2b1f68a654 Continue the journey of replacing raw sql with ORM or Database method
calls (Ticket #68)
2009-02-27 00:19:12 +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
960c4248de Replace ORM->select(count(*)) with a call to Database::count_records 2009-02-26 21:23:35 +00:00
Tim Almdal
eb589fcce8 Delete unused code 2009-02-26 19:11:50 +00:00
Tim Almdal
2042a4914b Implement fix for ticket #103. If there is no exif data, don't
display the "Show more Information Button".
2009-02-26 16:57:00 +00:00
Tim Almdal
f6169047b1 Fix up add from server:
1) Upload requests are serialized so we don't over load the server or get
race conditions occurring.  
2) new albums are created based on the file structure of the
authorized path that is the source directory.
2009-02-26 16:27:23 +00:00
Tim Almdal
63b3b505c1 Remove debugging statement 2009-02-26 16:02:43 +00:00
Tim Almdal
f87e1de3ec Implement a random image block for the side bar. Ticket #13 2009-02-26 15:02:04 +00:00
Bharat Mediratta
df7b05b40e Move tag CSS into admin theme's screen.css
Use JS to add titles to avoid repeating the same text 10s of times.
2009-02-26 03:38:56 +00:00
Bharat Mediratta
07310c8499 Add slightly more visual feedback when you're hovering over a
draggable user.  Also, drag the icon and name not just the icon.
2009-02-26 03:05:29 +00:00
Bharat Mediratta
11a7b6b751 Minor code simplification. 2009-02-26 02:09:41 +00:00
Bharat Mediratta
d83d753c7b "Import" -> "Add" so that the menu option fits on one line. 2009-02-26 01:48:19 +00:00
Tim Almdal
ec2a032604 Add closing ) 2009-02-25 16:17:34 +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
550d46da66 Added a block to the siebar that lists the available feeds 2009-02-24 19:19:58 +00:00
Tim Almdal
5b35490be1 Major change to local import, in that checking the high level
directory will process all the files underneath w/o having to expand
the tree first.
2009-02-24 16:47:45 +00:00
Andy Staudacher
e031957354 File structure style fixes 2009-02-24 05:54:19 +00:00
Andy Staudacher
41600a982f Fix bootstrap / installation issue for unit test framework:
Install user module before installing other modules. E.g. local_import's installation routine depends on the user module to be installed.
2009-02-24 05:27:07 +00:00