Dynamic Preferences
Table of contents
What
Dynamic preferences is a new feature of Tiki4, part of the Workspace which- Makes it possible to create custom admin panels
- Makes it possible to have a Perspective admin interface (where each preference can be overridden per perspective
- Makes management of current admin panels (tiki-admin.php) easier.
Benefits
- Global or workspace-level dynamically generated admin panel (to do, presumably with system wiki pages)
- Search/filter becomes possible -> currently testing http://framework.zend.com/manual/en/zend.search.lucene.html
- Use data for Profiler Tool (GUI to generate profiles) (at idea stage for now)
About
Code name: "lesser magic"Started in lesser-magic
Magic didn't succeed. It was probably too ambitious because it was trying to make all preferences dynamic (that's good), but to also automagically generate all admin panels (very hard because of exceptions)
For Workspace Ideas / Perspectives, we need a way to set preferences in a workspace which are different than the global. We also want a way to provide workspace admins to set some of the prefs. But of course, not all 1000+ prefs! Only the ones that are relevant (turn wiki on/off, change theme, etc.)
So we need a dynamic admin panel per workspace. What is configurable by the workspace admin should be defined in the profile
Normal admin panels (tiki-admin.php) will remain so UX can have full control of how things are positioned, and to hide/show features depending on another setting. However, for the settings that are defined, the html can be generated dynamically (like a Smarty plugin)
Help needed
All the previous preferences need to be converted to this new system. Here is a good example migration:http://tikiwiki.svn.sourceforge.net/viewvc/tikiwiki?view=rev&revision=21418
How to hide options with dependencies
Just add id="feature_xyz_childcontainer" where feature_xyz is the name of the parent features. So if parent feature is off...
For a radio field use id="fgal_use_db_childcontainer_1" for the first radio button, id="fgal_use_db_childcontainer_2" for the second radio button ...
<div class="adminoptionboxchild" id="feature_multilingual_childcontainer"> This text will just appear if feature_multilingual is activated </div>
http://tikiwiki.svn.sourceforge.net/viewvc/tikiwiki/trunk/templates/tiki-admin-include-i18n.tpl?view=markup&pathrev=21821
Templates
The templates to modify the look & feel of the preferences:http://tikiwiki.svn.sourceforge.net/viewvc/tikiwiki/trunk/templates/prefs/
Field types
Dynamic preferences are dealing with 6 different field types:
- flag: shows a checkbox
- text: shows a textfield. This field type accepts 2 properties:
- size: the size of the input field (in characters). Default size is "80"
- filter: the type of data (digits or .....). Default is "accept everything"
- textarea: shows a textarea. This field type accepts 2 properties:
- size: the amount of lines displayed in the textarea.
- filter: the type of data (digits or .....). Default is "accept everything"
- list: prints a dropdown with a single selection. This field type requires the options array
- multilist: prints a dropdown with multiple choice possible. This field requires, too, the options array.
- radio: radio
name and description are indexed for searching. The quality of the text will impact the usefulness of the search.
hint can be used on any preference. The text will be displayed as a note below close to the field.
shorthint can be used on text. The text will be displayed on the right of the text box
An example. It's a list definition:
'wiki_page_regex' => array(
'name' => tra('Wiki link format'),
'description' => tra('Character set used when detecting wiki links within pages.'),
'type' => 'list',
'options' => array(
'complete' => tra('Complete'),
'full' => tra('Latin'),
'strict' => tra('English'),
),
),For this preference, as the name begin with wiki_, the definition will be put in lib/prefs/wiki.php
Preference name without _ must go in lib/prefs/global.php
Perspectives
Preferences can be overridden per perspective. But when this is not wanted/suitable/logical/safe:To make it impossible to change a preference per perspective
'perspective' => false,
Wishlist
- Indicate to user what is the default value (ex.: reset to default)
- A visual indicator that current value is not default
- Indicate changes in system log, very useful when many admins are co-managing a site and for reverting settings in case of problems (ex.: a profile) -> All preferences changes in tiki-syslog.php
- search for alink doesn't find alink plugin
Alias
Contributors to this page: marclaporte
,
sylvie
,
lphuberdeau
and
pkdille
.
Page last modified on Tuesday 23 February, 2010 03:13:18 UTC by marclaporte
.
Sidebar
Sidebar
To register
To have an account at this site, please register at Tikiwiki.org
, and then use that user name and password to log in here.

Last Comments