=====Administration of Actions=====
>>**See also:**
- [[http://docs.wikkawiki.org/UsingActions | UsingActions]]
- DescribeActions
- CategoryDevelopmentActions
>>This is the development page for the action administration module.
===Main goals of this module===
~- allow finegrained access control on actions (preferably based on ACLs)
~- make the "intranet" directory obsolete
~- allow WikkaEdit to retrieve the list of installed actions and for each action its description, parameters...
===Needed metadata===
~- action short name = tag name (eg : "files")
~- action name (eg : "File upload form")
~- action description (eg : "Display a form with file attachments to the current page.")
~- parameter 1 short name (eg : "download")
~- parameter 1 description (eg : "prints a link to the file specified in the string")
~- parameter 1 mandatory (or optional) (boolean)
===Where metadata are stored===
- header in action file
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.
- separate data file (best method?)
Each action directory contains an additional file "actionname.inc.php".
__Data formats :__
1) PHP array (best method?)
%%(php)
'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)',
'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
%%(ini)
[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)
importance=2
[title]
default_value=text
description=Image title
importance=1
[alt]
default_value=text
description=Alternate text when image can't be displayed
importance=1
[class]
default_value=className
description=Class name (defined in the CSS file)
[link]
default_value=url
description=Image title
%%
+ easiest to read and write
- no hierarchical structure (action and parameters data are mixed together)
3) XML
%%(xml)
Action Tag | Action Title | ACLS | |
---|---|---|---|
adminpages | Pages administration | JohnDoe | edit |
adminusers | Users administration | * | edit |
backlinks | Backlinks | * | edit |
calendar | Calendar | * | edit |
category | Category | * | edit |
checkversion | Version checker | * | edit |
color | Text color | * | edit |
contact | Administrator email address | * | edit |
countcomments | Count comments | * | edit |
countowned | Count owned | * | edit |
countpages | Count pages | * | edit |
countusers | Count users | * | edit |
emailpassword | Lost password form | * | edit |
image | Image | * | edit |
usersettings | My user settings | * | edit |