Administration of Actions

This is the development page for the action administration module.

Main goals of this module

Needed metadata

Where metadata are stored

For each action in "/action" directory, the header of the action file is read (eg : "/action/image/image.php")
Action file header contains all the required metadata, prefixed by a specific tag.
Each action directory contains an additional file "".

Data formats :
1) PHP array (best method?)
$action_infos = array(
    'category' => 'hidden',
    'tag' => 'image',
    'title' => 'Image',
    'summary' => 'Display an image.',
    'usage' => '',
    'params' => array(
        'url' => array(
            'default_value' => 'url',
            'description' => 'Image URL. Can be relative (images/img.png) or external (',
            'importance' => 2
        'title' => array(
            'default_value' => 'text',
            'description' => 'Image title',
            'importance' => 1
        'alt' => array(
            'default_value' => 'text',
            'description' => 'Alternate text when image can\'t be displayed',
            'importance' => 1
        'class' => array(
            'default_value' => 'className',
            'description' => 'Class name (defined in the CSS file)'
        'link' => array(
            'default_value' => 'url',
            'description' => 'Add a link to the image'

+ fastest
- may introduce some errors (especially with comma or parentheses)

2) INI-file
summary=Display an image.

description=Image URL. Can be relative (images/img.png) or external (

description=Image title

description=Alternate text when image can't be displayed

description=Class name (defined in the CSS file)

description=Image title

+ easiest to read and write
- no hierarchical structure (action and parameters data are mixed together)

3) XML
    <summary>Display an image.</summary>
            <description>Image URL. Can be relative (images/img.png) or external (</description>
            <description>Image title</description>
            <description>Alternate text when image can't be displayed</description>
            <description>Class name (defined in the CSS file)</description>
            <description>Image title</description>

- give headaches to read or write
- slow to parse

Caching metadata

Parsing the "/action" directory on each request is too slow. Moreover, additional data like action ACLs can't be stored in the file itself.

Solution : add to the database two tables : "wikka_actions" and "wikka_action_params"
CREATE TABLE `wikka_actions` (
  `tag` varchar(75) NOT NULL,
  `title` varchar(75) NOT NULL,
  `summary` varchar(200) NOT NULL,
  `usage_infos` varchar(400) NOT NULL,
  `category` varchar(75) NOT NULL,
  `acl` text NOT NULL,
  PRIMARY KEY  (`tag`)

CREATE TABLE `wikka_action_params` (
  `action_tag` varchar(75) NOT NULL,
  `name` varchar(75) NOT NULL,
  `description` varchar(400) NOT NULL,
  `default_value` varchar(75) NOT NULL,
  `importance` tinyint(1) NOT NULL,
  PRIMARY KEY  (`action_tag`,`name`)

Field "importance" :
- it is only used by WikkaEdit
- values : 0=none, 1=default, 2=mandatory
- when adding an action, the "mandatory" and "default" parameters are added automatically. If a "mandatory" parameter is removed, the editor will display a warning.

When metadata cache is updated ?

These databases are currently updated each time AdminAction is called (an "update action list" link may be a better solution)

User interface

The UI is based on UserAdmin and PageAdmin style.
The ACLs are currently not used (see following chapiter "Actions ACLs")

Actions Administration

Filter view:

Records (28): 1-15 | 16-28
Sorted by: tag, asc
Action Tag Action Title ACLS
adminpagesPages administrationJohnDoeedit
adminusersUsers administration*edit
checkversionVersion checker*edit
colorText color*edit
contactAdministrator email address*edit
countcommentsCount comments*edit
countownedCount owned*edit
countpagesCount pages*edit
countusersCount users*edit
emailpasswordLost password form*edit
usersettingsMy user settings*edit

Actions ACLs

The main idea of ACLs is to allow the admin to disable non-safe actions like "files" or "iframe", or allow only some users to use them.
For basic actions, these ACLs are really useless (eg: "color", "image", "table"...)

Ideas :
- ACLs could be used to replace the hardcoded "if ($this->IsAdmin($this->GetUser()))" in some actions

Problems :
- "wikka_actions" and "wikka_action_params" tables are not always up-to-date (only updated when the AdminActions action is called)
- the ACLs are currently ignored by the core (and can't be added due to the 1st problem)

There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki