From Habari Project

Jump to: navigation, search

Each page in admin is child of AdminPage class.


Entry act_admin()

$page $action $request_method $vars $theme

create new AdminPage object. pass vars in.

calls $obj->$request_method_$action();

OR if no action


Entry act_admin_ajax()

$page $action $request_method $vars

no $theme by default as it's not alwasy needed. can be page-per-page.

create new AdminPage object. pass vars in.


OR if no action


ACL Check

checks done in adminPage. Describe access to each action/method.


AJAX return

Using Owen's idea from bug #898 -

The structure could include a callback that can execute arbitrary javascript, a slot each for notice and error arrays, and a potential object for one or more HTML sections. An example might look like this:

  callback: function(){alert('foo');},
  notice: ['Notice number one','Notice nubmer two'],
  error: ['Error number one', 'Error number two'],
  html: {
    title: 'My <b>title</b>',
    body: '<p>This is the <em>body</em>.</p>'

It might be interesting if there was a way to pre-define what happens to the returned values without having to handle them individually when the ajax call is made. We might consider writing a new $.habariAjax() method (or similar) for this purpose. This might look like this:

var values = ['posted','values'];
var returnmap = {title: '.jquery .selector', body: '.post .body'};
$.habariAjax(habari.url.ajaxWhatever, values, returnmap);

The call would automatically handle the spinner visibility and report http transaction errors as humane messages, rather than spinning indefinitely with no notice.

Item Manage

Standardize management pages (with HIG) to use common layouts for the "ItemManage" stuff. Use a itemManage stack (similar to formUI?), and allow for an itemManage interface for objects, like Post, Comment, etc.. eg.

$items = new ItemManage;
$items->push($posts); // could be array of itemManage interface, or single obj.
// add one item with special action
$item = $items->push($post);
// add global actions
// get html output based on context etc.
$theme->item_manage = $items->get_html($context, $page, ...);

ItemManage interface

based on the common layout. get_item_manage($context) returns array of data or each "section" as per context.

Common layout

all items have dropbutton for actions. have standard layout sections, and allow for plugin filtering

Check box | Title | meta |date | dropbutton actions moremeta | Description


ItemManage has common interface for processing data, and returning data as per the HabariJSON standard.

Personal tools