Commit Graph

24 Commits

Author SHA1 Message Date
Bharat Mediratta
2c61ad361e Remove some unnecessary blank lines. 2009-05-02 21:19:40 +00:00
Bharat Mediratta
47f531fc9c Mark a task as stalled if it's > 15 seconds old (because tasks should ping back much faster than that) 2009-04-22 19:51:25 +00:00
Bharat Mediratta
6883762238 Completely task-ify the localization scanning code and restore the
incoming_translation key cache.  The only part of this that is not
broken down is the l10n_client::fetch_updates() part.
2009-04-02 23:56:00 +00:00
Tim Almdal
b05b89798a Continuation of r20518. Remove all the cases were the csrf values in
views were being manually set.  Also removed it from the Admin_View.
2009-04-02 21:41:10 +00:00
Bharat Mediratta
921f3a2eee Put csrf token into Admin_View and Theme_View by default, then use it
directly wherever possible instead of access::csrf_token().
2009-03-27 03:43:21 +00:00
Andy Staudacher
ed7175092c Refactor all translation strings that have ambiguous placeholders.
E.g. "%link_startClick here%link_end" is now '<a href="%url">Click here</a>'.

Note: This isn't always the best solution. E.g. consider "Foo <a href='%url' class='gDialogLink'>bar</a>." Now the translator has to deal with 
preserving CSS classes too...
2009-03-21 07:44:46 +00:00
Tim Almdal
8da729cfa1 Refine the task api but removing the optional parameters on the
task::create method call
2009-03-11 03:14:52 +00:00
Bharat Mediratta
47756db856 Get rid of stray 'type' argument to task::get_definitions() 2009-03-11 02:39:52 +00:00
Bharat Mediratta
7aea8f0385 Add a 'cancel all' link too 2009-03-09 07:45:38 +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
23937ff135 Avoid using default task types. Require task::get_definitions() to
specify a single type and ask for it appropriately in
admin_maintenance.  Specify a type for every existing task.
2009-03-05 06:38:11 +00:00
Bharat Mediratta
898ac3ac35 A little task restructuring 2009-03-05 06:28:23 +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
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
Tim Almdal
95fc61c9a8 Standardize to uppercase DESC in the order by method calls 2009-02-22 17:36:58 +00:00
Bharat Mediratta
622da5f3cd Rename Task to Task_Definition to avoid confusion with Task_Model.
Order the finished tasks by update time in the task list.
2009-01-16 05:01:22 +00:00
Bharat Mediratta
72fa5736ff Rename Change xxx_task::available() to xxx_task::available_tasks()
Fix a bug in admin_maintenance.html.php where we were only showing the first task
2009-01-16 04:49:56 +00:00
Bharat Mediratta
2352dd162a Break task definitions out into the <module>_task helper and create a
Task library class as a data structure to hold task definitions.
2009-01-16 04:31:41 +00:00
Andy Staudacher
e4a9b19bf9 Changing t() placeholder syntax from {{replace_me}} to %replace_me. 2009-01-15 10:02:41 +00:00
Andy Staudacher
e53916dd06 Simplifying the way t() is called. Refactoring localization function t($message, $options=array()) into 2 separate functions:
- the new t($message, $options=array()) is for simple strings, optionally with placeholder interpolation.
- t2($singular, $plural, $count, $options=array()) is for plurals.
2009-01-15 09:30:15 +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
763cc32caf Return the task on success so that our UI can show it at 100% 2008-12-29 21:28:28 +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