%META:TOPICPARENT{name="Plugins"}%
---+!! <nop>%TOPIC%

Allows editing of preferences using fields predefined in a %SYSTEMWEB%.DataForms. However, the edit fields are inlined in the text, similar to how tables are edited in Foswiki:Extensions/EditTablePlugin.

%TOC%

Insert the =%<nop>EDITPREFERENCES%= preference (see below) anywhere in your topic. It will be replaced by a button that allows editing each preference in its predefined input format (or a text box, when no format is defined for this preference).

In edit mode, the edit button is replaced by Save and Cancel buttons, with their obvious meanings.

---++ Syntax Rules

   * =%<nop>EDITPREFERENCES{ "topic" }%=
      * _topic_ references a [[%SYSTEMWEB%.DataForms][DataForm]] defining the format of the edit fields for preferences. It may be prefixed by a web.
      * If a [[%SYSTEMWEB%.PreferenceSettings][preference setting]] is not mentioned in the form referenced by _topic_, a text input box of the specified length is provided.
      * Otherwise, the input can be through textareas, select, radio, checkbox, date, or text, as provided by %SYSTEMWEB%.DataForms.
   * =%<nop>EDITPREFERENCES%=
      * Edit existing preferences in the topic using a simple text field.
---++ Examples
   * =%<nop>EDITPREFERENCES%= 
   * =%<nop>EDITPREFERENCES{ "%<nop>SYSTEMWEB%.DefaultPreferencesForm" }%= 

<!--
   * Set SHORTDESCRIPTION = Allows editing of preferences using fields predefined in a form
-->

---++ Plugin Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in =configure=, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.

   * If the installation was successful, an edit button should appear below:
%EDITPREFERENCES%

---++ Plugin Info

|  Copyright: | Copyright (C) Foswiki:Main.ThomasWeigert and Foswiki Contributors |
|  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
|  Version: | 14572 (2012-04-06) |
|  Release: | 1.1.3 |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  06 Apr 2012 (1.1.3) | Foswikitask:Item11445: Use %<nop>SANDBOXWEB% macro. |
|  02 Dec 2011 (1.1.2) | Minor updates for internal compatibility with Foswiki |
|  29 Jun 2011 (1.1.1) | Switch to x.y.z version numbering. Minor update to play better with custom formfield types ( =Foswiki::Meta->new()= behaviour ) |
|  11 Apr 2011: | Version released with Foswiki 1.1.3. Only a minor change related to how the plugin is being upgraded |
|  20 Sep 2009: | Small documentation update. Code tidied up. No preferences in plugin topic. No other functional changes. |
|  19 Apr 2009: | Ignore all saving unless it happened by saving a form using POST method. |
|  15 Dec 2008: | Arthur Clemens added reading of =Local= preferences. Foswiki version |
|  05 Nov 2007: | Kenneth Lavrsen fixed problem when settings are hidden in html comments. These settings are now ignored. |
|  23 Jun 2007: | Crawford Currie added testcases, recoded to work without a form definition, fixed for TWiki 4.2 |
|  08 Feb 2007: | Arthur Clemens added access keys for Save and Cancel, bold style for editable preference names, and a descriptive Save button label. |
|  15 Apr 2006: | Adding css classes to buttons. Removed debug print statement causing 500s on !SunOne. Prevent extra space in settings on saves. Switched to earlier handler. Converted all SCRIPTURL to SCRIPTURLPATH, and added support. The only SCRIPTURLs should be the one in the BASE tag and those in mail notification templates. Because the forms package was throwing an exception when it failed to create a form, the edit preferences plugin was aborting the whole of the session whenever the form specified in EDITPREFERENCES didn't exist. Changed it so that the Form constructor does not throw, but returns undef on a non-existant form, and changed preferences plugin to be tolerant of missing forms (ie defaults all fields to text if the form is missing, of is a Set exists which is not in the form). | 
|  26 May 2005: | Crawford Currie recoded to use code from Form.pm to render form fields. |
|  08 May 2005: | Add plugin preference to define default input length  |
|  07 May 2005: | Initial version |
|  Plugin Home: | http://foswiki.org/Extensions/%TOPIC% |
|  Support: | http://foswiki.org/Support/%TOPIC% |

---
*Related Topics:* %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences, %SYSTEMWEB%.DataForms


