[Show/Hide Right Column]

Print

Dynamic Preferences

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

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>

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) ->
  • 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 Laporte2679 points  , sylvie2503 points  , pkdille642 points  and Louis-Philippe Huberdeau1099 points  .
Page last modified on Saturday 28 August, 2010 21:15:03 UTC by Marc Laporte2679 points .

Search Wishes (subject only) [toggle]

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.


Show php error messages
 
PHP (5.2.10-2ubuntu6.4) NOTICE (E_NOTICE):
File: comments.php
Line: 272
Type: Undefined variable: tiki_p_forum_vote
PHP (5.2.10-2ubuntu6.4) ERROR (E_USER_WARNING):
File: lib/core/lib/TikiFilter.php
Line: 77
Type: Filter not found: description