Revision [19770]

This is an old revision of AdminActions made by OlivierBorowski on 2008-04-11 05:31:44.

 

Administration of Actions


This is the development page for the action administration module.

Main goals of this module


Needed metadata


How metadata are updated

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 "actionname.inc.php".

Data formats :
1) PHP array (best method?)
<?php
$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 (http://example.com/example.jpg)',
            'mandatory' => 1
        ),
        'title' => array(
            'default_value' => 'text',
            'description' => 'Image title',
            'default' => 1
        ),
        'alt' => array(
            'default_value' => 'text',
            'description' => 'Alternate text when image can\'t be displayed',
            'default' => 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'
        )
    )
);
?>


2) INI-file
[action]
category=hidden
tag=image
title=Image
summary=Display an image.
usage=

[url]
default_value=url
description=Image URL. Can be relative (images/img.png) or external (http://example.com/example.jpg)
mandatory=1

[title]
default_value=text
description=Image title
default=1

[alt]
default_value=text
description=Alternate text when image can't be displayed
default=1

[class]
default_value=className
description=Class name (defined in the CSS file)

[link]
default_value=url
description=Image title


3) XML
<action>
    <category>hidden</category>
    <tag>image</tag>
    <title>Image</title>
    <summary>Display an image.</summary>
    <usage></usage>
    <params>
        <url>
            <default_value>url</default_value>
            <description>Image URL. Can be relative (images/img.png) or external (http://example.com/example.jpg)</description>
            <mandatory>1</mandatory>
        </url>
        <title>
            <default_value>text</default_value>
            <description>Image title</description>
            <default>1</default>
        </title>
        <alt>
            <default_value>text</default_value>
            <description>Alternate text when image can't be displayed</description>
            <default>1</default>
        </alt>
        <class>
            <default_value>className</default_value>
            <description>Class name (defined in the CSS file)</description>
        </class>
        <link>
            <default_value>url</default_value>
            <description>Image title</description>
        </link>
    </params>
</action>


How metadata are stored

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

We may add an "action" table to the database.


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