30 Commits

Author SHA1 Message Date
shadlaws
4b28478776 #2040 - Deactivate modules that no longer exist.
- added module::deactivate_missing_modules()
- revised module::deactivate() to change log message if the module is missing
- added call to new function in module::get_obsolete_modules_message()
- added call to new function when loading admin/maintenance menu
2013-03-05 16:54:41 +01:00
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Bharat Mediratta
b42fcb9cda Use db::expr instead of "new Database_Expression". Resolves #1560. 2010-12-28 23:10:05 -08:00
Bharat Mediratta
fad1f05203 The Kohana folks removed the cache cleanup code back in
http://dev.kohanaframework.org/projects/kohana2/repository/revisions/4605

So now our cache entries don't expire.  For now, do cache expiration
whenever we render Admin > Maintenance, since that's the type of place
that users will go when they want their cache to expire anyway.
2010-09-18 17:46:28 -07:00
Bharat Mediratta
c33b24c9fa Make maintenance mode a variable instead of a config. Then create
links on the Admin > Maintenance page to allow you to turn it on and
off.  This should be efficient since we cache all vars and look them
up on every request anyway.

This also allows us to have the Fix task enable maintenance mode while
it's running which greatly reduces the chances that somebody will come
along and hork the database while we're tinkering with MPTT pointers.

Fixes ticket #1259.
2010-08-01 21:00:30 -07:00
Bharat Mediratta
7607e1f932 Full pass over all the JSON encoding and JS dialog code. We now abide
by the following rules:

1) An initial dialog or panel load can take either HTML or JSON, but
   the mime type must accurately reflect its payload.

2) dialog form submits can handle a pure HTML response, but the mime
   type must also be correct.  This properly resolves the problem
   where the reauth code gets a JSON response first from the reauth
   code, and then an HTML response when you reauth and continue on to
   a given form -- try it out with Admin > Settings > Advanced.

3) All JSON replies must set the mime type correctly.  The json::reply
   convenience function does this for us.

4) By default, any HTML content sent back in the JSON response should be
   in the "html" field, no longer the "form" field.

The combination of these allows us to stop doing boilerplate code like
this in our controllers:

  // Print our view, JSON encoded
  json::reply(array("form" => (string) $view));

instead, controllers can just return HTML, eg:

  // Print our view
  print $view;

That's much more intuitive for developers.
2010-07-31 21:16:17 -07:00
Tim Almdal
91a2c04a24 More patches as part of #1225. Change the 'core' modules to use the json::reply
method to set the content type header and encode the response as a json object
2010-07-31 15:44:55 -07:00
Tim Almdal
dbf3199e46 Fix for ticket #1181. Use $.getJSON to retrieve the json contents of the dialog. Convert all the controllers
that create the data to go into a dialog to return the html as part of a json object.
2010-07-06 14:12:01 -07:00
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Andy Staudacher
a19b97f8d6 First step towards fixing ticket #1038: Allowing for custom page <title> in admin pages, just like in non-admin pages.
TODO: Set $view->page_title in the many admin controllers we have. I just set it for admin_maintenance.php to show how it's intended to be used. I copied the title from views/admin_maintenance.html.php to the controller.
2010-02-28 13:35:58 -08:00
Andy Staudacher
8e7eda9cc6 Fix progress bar / maintenance tasks for locales that use comma as decimal separator, such as German. 2010-02-21 23:23:48 -08:00
Tim Almdal
b8047db539 Revert "Add the scheduler component to the admin maintenance screen."
This reverts commit 48cb5021c6.
2010-02-07 21:40:34 -08:00
Tim Almdal
316b0583b3 Revert "Refactor the admin maintenance screen so that events are used to
populate the action buttons and other content such as the list of scheduled
tasks."

Leaving this api out of RC1.

This reverts commit 19fee6b5e4.

Conflicts:

	modules/gallery/views/admin_maintenance.html.php
2010-02-07 21:38:51 -08:00
Tim Almdal
19fee6b5e4 Refactor the admin maintenance screen so that events are used to pupluate the action buttons and other content such as the list of scheduled tasks. 2010-02-02 14:34:50 -08:00
Tim Almdal
5ded9e8ac5 Refactor starting a task into the task helper so we can call it multiple times. 2010-02-01 16:31:24 -08:00
Tim Almdal
48cb5021c6 Add the scheduler component to the admin maintenance screen. 2010-02-01 16:28:52 -08:00
Bharat Mediratta
3ed81869cb Cast the SafeString $task->status to (string) so that it doesn't come
down to the JS as an object.
2010-01-28 20:44:10 -08:00
Andy Staudacher
6dd92cfa1c Fix maintenance tasks / language admin for bug introduced earlier by no longer casting in ORM.
Task->done is now a string, boolean false is stored as integer 0 and loaded as string "0". On the client side that's interpreted as truthy in JavaScript.
Fix: cast "0" to (bool) before encoding to JSON.
2010-01-20 23:12:36 -08:00
Bharat Mediratta
d2cb217e20 Convert more database calls over to the new format
- admin/maintenance page loads, the rebuild thumbs/resizes task works
- Fixed up some conversion bugs in the Cache driver
2009-12-02 00:34:34 -08:00
Bharat Mediratta
1fd0e14359 Convert all DB where() calls to take 3 arguments.
Convert all open_paren() calls to and_open() or or_open() as appropriate.
2009-11-26 12:09:04 -08:00
Bharat Mediratta
0121bfd585 ORM::orderby -> ORM::order_by 2009-11-25 19:26:52 -08:00
Bharat Mediratta
2e420522ec Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add()
- Kohana::config_XXX -> Kohana_Config::instance()->XXX
- Implement View::set_global in MY_View
- Updated Cache_Database_Driver to latest APIs
- ORM::$loaded -> ORM::loaded()
- Updated item::viewable() to use K2.4 parenthesization
2009-11-25 13:22:24 -08:00
Andy Staudacher
8312eb116e XSS review fixes (mostly adding missing html::mark_clean()) calls. 2009-08-31 02:12:01 -07:00
Tim Almdal
5d9e334fe6 Added a wee bit of phpDoc.
Changed the name of the method get_task_log to get_log
Changed the default name of the file when the log is downloaded to
gallery3_task_log.txt
2009-07-07 12:49:21 -07:00
Tim Almdal
493fb27825 Cleanup remove task processing. Change Task_Model::delete to call parent::delete
instead of parent::save. :-) Also change admin_maintenance_controller to delete
via looping over all of the completed tasks and delete individually, so we can
delete the associated cache entries at the same time.
2009-07-06 22:20:04 -07:00
Tim Almdal
04f02b49c5 Add task logging functionality. When a task runs, it creates a log that is
stored in the persistant cache for 30 days.  On the admin_maintenance page
there is a new link for completed tasks "browse log".  Clicking this will
open a dialog box that has the the contents of the log displayed.

The user can then view the log and close the dialog, or press the save button
to download the log to their local machine.
2009-07-05 17:38:49 -07:00
Bharat Mediratta
0d5826ab9f Fix log links. html::anchor() implicitly calls url::site(), calling
it a second time mangles the urls.

Fixes ticket #360.
2009-06-10 20:37:38 -07:00
Bharat Mediratta
28b41056e3 Restructure things so that the application is now just another module.
Kohana makes this type of transition fairly straightforward in that
all controllers/helpers/etc are still located in the cascading
filesystem without any extra effort, except that I've temporarily
added a hack to force modules/gallery into the module path.

Rename what's left of "core" to be "application" so that it conforms
more closely to the Kohana standard (basically, just
application/config/config.php which is the minimal thing that you need
in the application directory)

There's still considerable work left to be done here.
2009-05-27 15:07:27 -07:00