Dynamic Preferences
Table of contents
What
Dynamic preferences is a new feature of Tiki4, part of the Workspace project 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
About
Code name: "lesser magic"
Started in lesser-magic branch and later added to trunk for release in Tiki 4.0 Work is started to migrate all the 1000+ preferences from the old system to the new and is, with a few exceptions, completed in Tiki5.
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 Workspaces / 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>
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:
'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) -> -
Script to check all doc page links in all prefs (LPH)php doc/devtools/lessermagicreport.php > lessermagicreport.htm - Test on Fresh installs, that no unwanted changes appears. Ex.: (?????)
- as of 2010-01-06: feature_wiki_mandatory_category, wikiHomePage, email_due, pass_due, users_prefs_display_timezone, etc
- no pref modifications should be leftover in tiki-admin_include_*.php files
- option to clear cache upon modif of this pref
Alias
Contributors to this page: Marc Laporte
,
sylvie
,
pkdille
and
Louis-Philippe Huberdeau
.
Page last modified on Saturday 28 August, 2010 21:15:03 UTC by Marc Laporte
.
Sidebar
Sidebar
Search
Last Changed Items
- dev.tw.o: users apparently can delete their tracker items but they are not deleted and no message
- TW5.0B1 Tracker plugin: attachment cannot be saved twice with the same name even if it is part of a different tracker item
- realName user preference is not used in trackerlist, tracker, and pretty tracker
- calendar - update end date of event after start date exceeds it
- Allow Tiki to use virtual currency servers powered by CCLite

Last Comments