Commit Graph

454 Commits

Author SHA1 Message Date
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
f6ebb436e4 Rest_Controller -> REST_Controller everywhere, for consistency. 2008-12-25 02:38:53 +00:00
Bharat Mediratta
c7193f9b2e Normalize our Admin controllers so that functions always print out
their results, as opposed to having them return their view back
upstream.  This is a little more code in every controller, but it's
much less magical and more consistent.

Look up the active_theme and active_admin_theme inside the view
itself, no need to do that in the controllers.  This makes view
initialization easier in the controllers.
2008-12-24 04:22:22 +00:00
Bharat Mediratta
1ed83e5569 Fix bad <input/> 2008-12-24 04:09:41 +00:00
Bharat Mediratta
863e3712c7 Add atom to the implicit module list. 2008-12-24 04:04:08 +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
8f1cd010c0 Reload parent after adding a new item since the left/right pointers have changed. 2008-12-23 06:10:06 +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
14da6b65b7 Update to reflect change in album::create API 2008-12-23 04:43:54 +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
37d24e863c Internationalize welcome block. 2008-12-22 19:46:40 +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
17f77b8de4 Remove module.info from infrastructure modules that are effectively
libraries that would ship with the core.

Refactor welcome.php to use the newly refactored module::available()
2008-12-22 04:49:30 +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
685a5ca1e1 Support proper rendering of locked modules, add a submit button, point it at admin/modules/save 2008-12-22 04:32:23 +00:00
Bharat Mediratta
74c417cab9 Lock a couple of modules 2008-12-22 04:31:04 +00:00
Bharat Mediratta
b526cc8c0b Add some admin theme callbacks and make them explicitly admin_xxx for consistency
with the callbacks in the xxx_block helpers.  So in the theme we have:

admin.html.php:
  $theme->admin_page_bottom()

then in the helpers:

core_block.php:
  function admin_page_bottom() { }
2008-12-22 03:53:36 +00:00
Bharat Mediratta
fe27bd1eb3 Change the way that we track modules.
Each module now has a "module.info" file that has information about
the module, including the core.  We can display the installed version,
and the version in the code.

Also take a first shot at a modules admin page.
2008-12-22 03:41:33 +00:00
Chad Kieffer
a98d13e9c7 Update Selenium IDE test case file names. 2008-12-22 00:19:58 +00:00
Chad Kieffer
f2f5a67cde Removed my local dev url. 2008-12-21 23:59:53 +00:00
Bharat Mediratta
7934076a3b Add phpdoc comments. 2008-12-21 21:52:49 +00:00
Bharat Mediratta
1432ab9aca Swap "Content" and "Modules" 2008-12-21 20:44:02 +00:00
Bharat Mediratta
849b271a8c Add info/warning/error classes to log messages. 2008-12-21 10:35:30 +00:00
Bharat Mediratta
0573698155 Add some more logging code. Now the site admin has some log entries to look at. 2008-12-21 04:43:47 +00:00
Bharat Mediratta
4c2ddfb868 INFO -> log::INFO 2008-12-21 04:42:25 +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
a19a4729b5 Implement the 'Project News' block with actual news from GMC.. woot! 2008-12-21 02:36:32 +00:00
Bharat Mediratta
f257f1b350 create a more generic random_phrase() function 2008-12-21 02:02:06 +00:00
Bharat Mediratta
8f87a030c8 Implement the photo stream with the most recently uploaded photos. 2008-12-20 23:19:12 +00:00
Bharat Mediratta
99c481897b Add "created" and "updated" timestamps to the items table. 2008-12-20 22:49:32 +00:00
Bharat Mediratta
ec8462410f Update view counts for albums also 2008-12-20 20:11:51 +00:00
Bharat Mediratta
50b0613243 Add view counts and show them properly. 2008-12-20 20:04:57 +00:00
Bharat Mediratta
406830cbf8 use some real stats 2008-12-20 10:54:29 +00:00
Bharat Mediratta
b3b308f369 Add a missing colon. 2008-12-20 02:08:15 +00:00
Bharat Mediratta
a5a9a79fa6 Internationalize. 2008-12-20 02:08:03 +00:00
Bharat Mediratta
0f10f37c16 Replace placeholders with real data 2008-12-20 02:06:14 +00:00
Bharat Mediratta
e4bace4c74 Collapse Admin_Dashboard_Controller down into a single theme call, since now
all dashboard blocks are stored in modules.
2008-12-20 01:42:18 +00:00
Bharat Mediratta
b933d1a170 Move Recent Comments into its own block. 2008-12-20 01:25:03 +00:00
Bharat Mediratta
9afd9d05ae Move log entries into its own block 2008-12-20 01:20:19 +00:00
Bharat Mediratta
16a3e43b45 Move the "Photo Stream" section into its own block 2008-12-20 01:16:46 +00:00