I strongly support these changes.

Adminhandler.php, as it stands, is an unholy beast which we must slay.

I would recommend that we create some sort of standardized "AJAX"  
class in both PHP *and* JS. The PHP AJAX class would be called by  
AdminPages (and possible ItemManage). The JS class would handle  
interpreting errors, executing data, etc.

I would caution that we shouldn't limit the AJAX class to *only* HTML.  
You should also be able to map a "success" function which would  
receive data (not necessarily html) and process it. Ex.

{
   notice: ['Notice number one','Notice nubmer two'],
   error: ['Error number one', 'Error number two'],
   data: {
     name: "james"
   }
}

$.habariAjax(habari.url.ajaxWhatever, values, success: function(data)  
{ alert(data.name); } );

In regards to the CRUD aspect, I'm not an expert. However, it does  
seem a little complicated and constraining to me. I'd have to see an  
actual implementation before I'm convinced. Maybe we'd be better off  
starting by transferring everything into classes, then pursuing such  
alternate plans. Consider me skeptical but open to persuasion.

I'm still a little fuzzy about the ItemManage class, but it does seem  
like a good idea. We were trying to do something like this with the  
JS, but standardization (of html) would definitely help. However, I  
don't think we need to *require* that every itemset has all the html  
sections. Not all sections make sense for all of them.

Instead, there should be a customizable addition list. We'd  
*standardize* the types (just like FormUI), but not require that every  
itemset has all of them. In fact, there might also be some ability to  
define where the values *come from* (it'll be different for different  
objects). Ex.

$items->add_sections(array(
        'title' => 'title',
        'description' => 'content'
));

In that case, it'd only display the "title" and "description" fields.  
These would be populated according to the passed source. Ex. $object- 
 >{$source}. We'd also include some defaults, so you could do  
something like this:

$items->add_sections(array('title', 'description'));

Ideally, all of this would also be extendable by plugins, in a similar  
way to FormUI. The $items class would simply be passed to an action  
before given to the theme.

Here's some hooks I'd like to include:

$items->remove_sections();
$items->add_sections(array($name => $source)); // Allow sections to be  
remapped in this way as well, as above
$items->move_section_after($name, $preceding);
$items->move_section_before($name, $proceeding);

I'd be willing to help out in whatever capacity I can (especially the  
JS), but I've been less involved of late. I'm also not sure certain  
people want my code touching any of this.

~Arthus

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to