Commit Graph
215 Commits
Author SHA1 Message Date
Felix Rabinovich 50dceb5015 Theme Administration implementation 2009-01-01 18:56:06 +00:00
Bharat Mediratta a542f70551 Allow admins to do anything 2009-01-01 00:42:30 +00:00
Bharat Mediratta 7c82691e00 Move debug CSS into core/css/debug.css, and enable it for admin themes also 2009-01-01 00:16:08 +00:00
Bharat Mediratta 4573ada534 Extend permissions interface to allow resetting to the parental default. 2008-12-31 19:59:42 +00:00
Bharat Mediratta 610494296b Turn permission dialog into a browser where you can look at permissions back up the tree 2008-12-31 09:02:40 +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 bfb040a463 Fix a bug where we were accidentally allowing view permissions when
allowing or resetting permission further down in the tree.  This bug
was introduced when I refactored the view permission cache into the
items table.  Updated test to catch it.
2008-12-31 00:47:15 +00:00
Bharat Mediratta ad719b9b6f Fully implement the view_full permission. 2008-12-31 00:18:24 +00:00
Bharat Mediratta cbbbc23c2f Oops, remove some debug code. 2008-12-30 23:36:58 +00:00
Bharat Mediratta 610aa75d3f Fix a bug. Unit tests ftw! 2008-12-30 23:36:36 +00:00
Bharat Mediratta 6e6d3dd969 Refactor _create_htaccess_files and _delete_htaccess_files into
_update_htaccess_files in preparation for supporting the view_full
permission.
2008-12-30 23:26:55 +00:00
Bharat Mediratta cace8390dd Fix typo. 2008-12-30 23:06:33 +00:00
Bharat Mediratta 06188ad813 Oops, this got left out of r19497 2008-12-30 20:19:32 +00:00
Bharat Mediratta a481a684b6 Add a "Graphics Settings" page that lets admins choose which graphics
toolkit we use.  We only allow users to use one toolkit.  The UI needs
work!
2008-12-30 04:14:57 +00:00
Bharat Mediratta 5f14623a47 Only show site status to admins 2008-12-30 04:13:03 +00:00
Bharat Mediratta 96a2f929ca More phodoc cleanup. 2008-12-30 01:43:16 +00:00
Bharat Mediratta 564bde5c49 comment cleanup. 2008-12-30 01:41:36 +00:00
Bharat Mediratta f29aad03a6 Make some columns smaller so that multi-column keys don't exceed 1024
bytes on some systems.
2008-12-30 01:37:09 +00:00
Bharat Mediratta 4439ca94a9 Don't let the x/y coordinates in composite go negative. 2008-12-29 23:12:26 +00:00
Bharat Mediratta 29c925a3cc Properly implement graphics::composite() 2008-12-29 22:31:06 +00:00
Bharat Mediratta 26417f6dd4 Replace __CSRF__ token with a real csrf. This allows links in site status messages to persiste across sessions. 2008-12-29 21:27:46 +00:00
Bharat Mediratta ef4ec6d513 Oops, my last change broke the default resize dimensions 2008-12-29 21:25:51 +00:00
Bharat Mediratta 2bfddc4c87 Make graphics rules take named parameters. This will give us some
flexibility in the future.
2008-12-29 20:20:10 +00:00
Bharat Mediratta 3cfc9afde4 Remove references to permanent_key 2008-12-29 03:50:48 +00:00
Bharat Mediratta b46bfdd492 Separate permanent messages out of the message helper and put them
into site_status.  Show site status in the header in the admin theme.
2008-12-29 00:35:31 +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 9904c0e5ff Ignore resizes for albums when calculating the dirty count 2008-12-27 03:37:09 +00:00
Bharat Mediratta f808dd9d01 Add clear_permanent() 2008-12-27 03:35:57 +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 e31ca19a06 Added graphics::mark_all_dirty(). The watermark code now marks images
as dirty if the admin changes the watermark at all.
2008-12-26 04:52:18 +00:00
Bharat Mediratta 11d4c2d126 Fix a bug I introduced when I switched from module id to module name; now deleting cleans up vars and graphics rules 2008-12-26 04:49:28 +00:00
Bharat Mediratta eb35afc987 Add module::clear_var() 2008-12-26 01:29:33 +00:00
Bharat Mediratta 2c91a7e9ce Rework log and message helpers to be parallel, but separate.
1) they now have their own matching severity constants
2) they both have convenience functions success(), info(), warning() and error()
3) they both have severity_class()
2008-12-25 23:43:44 +00:00
Bharat Mediratta fdc0f83024 Big round of normalization of the way that our controllers
communicate.  Almost all controllers now use JSON to speak to the
theme when we're dealing with form processing.  This means tht we only
send the form back and forth, but we use a JSON protocol to tell the
browser success/error status as well as the location of any newly
created resources, or where the browser should redirect the user.

Lots of small changes:
1) Admin -> Edit Profile is gone.  Instead I fixed the "Modify Profile" link
   in the top right corner to be a modal dialog

2) We use json_encode everywhere.  No more Atom/XML for now.  We can bring those
   back later, though.  For now there's a lot of code duplication but that'll be
   easy to clean up.

3) REST_Controller is no longer abstract.   All methods its subclasses should create
   throw exceptions, which means that subclasses don't have to implement stubs for
   those methods.

4) New pattern: helper method get_add_form calls take an Item_Model,
   not an id since we have to load the Item_Model in the controller
   anyway to check permissions.

5) User/Groups REST resources are separate from User/Group in the site
   admin.  They do different things, we should avoid confusing overlap.
2008-12-25 05:12:46 +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 360fbda04c Only clear the dirty bit if we updated the specific target. 2008-12-23 04:46:13 +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 ddcf10dfce Allow the site admin to upload watermark images. Can't do much with them yet. 2008-12-23 01:29:17 +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 27a3fc9230 Fix a typo 2008-12-22 20:42:00 +00:00
Bharat Mediratta 3a71a9d5c1 Add message severity CSS classes to status messages. Create
message::severity_class() to do the conversion and convert the log
entry code to use that.
2008-12-22 20:23:28 +00:00
Bharat Mediratta 03042850ad Fix admin/modules url. 2008-12-22 10:32:32 +00:00
Bharat Mediratta bdc0876fa8 Add messaging system for reporting actions back to the user. Make
module install/uninstall work and tie it into the messaging system.
2008-12-22 06:50:20 +00:00
Bharat Mediratta f6381c534e Reinstate the dummy error handler to ensure that we work in a clean install w/ no database 2008-12-22 04:54:51 +00:00
Bharat Mediratta 9cf2c57921 Normalize CSRF handling into the access helper. Probably not the best
place for it, but it'll do for now.

Do CSRF checking in the Admin controller so that we're safe across the
board on the admin side.
2008-12-22 04:33:18 +00:00
Bharat Mediratta 74c417cab9 Lock a couple of modules 2008-12-22 04:31:04 +00:00