CHANNELS IN DEPTH PARTNERS GREENWASHING US!
Ecology
Environment
Extreme Weather
Global Warming
Drought
Ozone Depletion
Deforestation
Pollution
Extinction
Resource Wars
Greenwashing
Media
Education
Government
Politics
Add news
RecentChanges Page History Edit Page

To set many of the variables below specify them in config.php.

%apply=item id=AutoCreate?%$AutoCreate
Used in conjunction with the AutoCreateTargets? edit function, this array records any sets of pages which should be created automatically if they don't exist. The syntax is
$AutoCreate[REGEXP] = PAGE_PARAMETERS;
where REGEXP is a regular expression which will identify the pages to be autocreated, and PAGE_PARAMETERS is an array of attributes for the page to be created. For example,
$AutoCreate['/^Category\\./'] = array('ctime' => $Now);
will create a blank page with a current creation time for any missing Category page.
%apply=item id=DefaultPageTextFmt?%$DefaultPageTextFmt
The text that should be displayed when browsing non-existent pages. As default PmWiki uses the contents of Site.PageNotFound
$DefaultPageTextFmt = '(:include $[{$SiteGroup}.PageNotFound]:)';
%apply=item id=DeleteKeyPattern?%$DeleteKeyPattern
The pattern used to determine if a page should be deleted. The default is to remove pages that contain only the single word "delete" (and optional spaces).
# change delete word to "remove"
$DeleteKeyPattern = "^\\s*remove\\s*$";
# delete any page with no visible text, i.e., empty
$DeleteKeyPattern = "^\\s*$";
%apply=item id=DiffKeepDays?%$DiffKeepDays
The $DiffKeepDays variable sets the minimum length of time that a page's revision history is kept. By default it is set to 3650 days, or a little less than ten years. You can change this value in a customization file to be something smaller, e.g.:
$DiffKeepDays = 30; # keep revisions at least 30 days
Note that a specific page revision isn't removed from the page until the first edit after the time specified by $DiffKeepDays has elapsed. Thus, it's still possible for some pages to have revisions older than $DiffKeepDays -- such revisions will be removed the next time those pages are edited.
%apply=item id=DiffKeepNum?%$DiffKeepNum
This variable contains the minimum number of changes to be kept in the page history, even if some of them are older than the limit defined by $DiffKeepDays. It prevents lost history of pages that are older, but have few changes.
$DiffKeepNum = 50; # keep at least 50 revisions (default is 20)
%apply=item id=DraftActionsPattern?%$DraftActionsPattern
The actions which allow full loading of the draft.php functionnality for custom actions. Default is 'edit'. You can enable drafts for other actions like:
$DraftActionsPattern = 'edit|pmform|translate'; # Enable drafts for actions 'edit', 'pmform' and 'translate'.
%apply=item id=DraftSuffix?%$DraftSuffix
The suffix to use for draft versions of pages (default "-Draft").
%apply=item id=EditFunctions?%$EditFunctions
This array contains the sequence of functions that are called when a page is edited. It can be customized to provide additional functions to be called as part of the editing process. The standard setting is:
$EditFunctions = array('EditTemplate', 'RestorePage', 'ReplaceOnSave',
  'SaveAttributes', 'PostPage', 'PostRecentChanges', 'AutoCreateTargets', 'PreviewPage'); 
Many recipes manipulate this array, so it is recommended, instead of redefining the complete array to add your custom functions, to use functions like array_unshift(), array_push() and array_splice().
%apply=item id=EditRedirectFmt?%$EditRedirectFmt
The page to which an author is sent after pressing "Save" or "Cancel" from an edit form. Defaults to "$FullName", which sends the author to the page just edited, but can be changed to specify another page.
# redirect to Main.HomePage
$EditRedirectFmt = 'Main.HomePage';  
# redirect to HomePage of current group
$EditRedirectFmt = '{$Group}.HomePage';
%apply=item id=EditTemplatesFmt?%$EditTemplatesFmt
Name of the page (or an array of names) to be used as the default text for any newly created pages.
# Use 'Main.NewPageTemplate' as default text of all new pages
$EditTemplatesFmt = 'Main.NewPageTemplate';
# Use 'Template' in the current group for new pages
$EditTemplatesFmt = '$Group.Template';
# Use 'Template' in the current group if it exists, otherwise
# use 'Main.NewPageTemplate'
$EditTemplatesFmt = array('$Group.Template', 'Main.NewPageTemplate');
See Cookbook:EditTemplates for more information.
%apply=item id=EnableDrafts?%$EnableDrafts
When set to '1', enables the "Save draft" button and built-in handling of "draft" versions of pages, where:
  1. initial "Save draft" of an existing page ("PageName?") saves changes to a new name ("PageName?-Draft")
  2. subsequent attempts to edit PageName? causes PageName?-Draft to be edited
  3. subsequent selections of "Save draft" cause PageName?-Draft to be saved
  4. pressing "Publish" causes PageName?-Draft to be posted to PageName?, and deleted.
# turn on draft edits
A related variable, $EnablePublishAttr, adds a new "publish" authorization level to distinguish editing of drafts from publishing them.
%apply=item id=EnableDraftAtomicDiff?%$EnableDraftAtomicDiff
When set to 1, "publishing" a draft version will clear the "draft" history, leaving a single "diff" between the latest and the previous "published" versions. Note that this will delete the author names, dates and contributions of the intermediate, unpublished versions. (Drafts need to be enabled, see $EnableDrafts.)
%apply=item id=EnableGUIButtons?%$EnableGUIButtons
When set to '1', turns on the graphical buttons in the "Edit Page" form.
# turn on graphical edit buttons
%apply=item id=EnablePostAuthorRequired?%$EnablePostAuthorRequired
When set to '1', posting of pages requires the author to provide an author name. Otherwise, authors can post without a name.
# require authors to provide a name
%apply=item id=EnableRevUserAgent?%$EnableRevUserAgent
When set to '1', the page history will store the "User agent" string from the browser of the writer (by default this feature is disabled). This can be useful for tracking bugs in custom applications, by examining the disk files in wiki.d.
# Store browser user agent with page diffs
%apply=item id=GUIButtons?%$GUIButtons
Allows the configuration of the buttons which appear at the top of the text area when editing a page. See scripts/guiedit.php for the default definition. Note that the 5th element can be HTML code rather than just the url of a gif - this allows more flexibility in defining the related javascript.
%apply=item id=HandleEditFmt?%$HandleEditFmt
Like $HandleBrowseFmt, this specifies the entire output format for ?action=edit for a page.
%apply=item id=IsPagePosted?%$IsPagePosted
Set to a true value if the page is actually saved (e.g., this is used to tell the RecentChanges? handlers if they need to update).
%apply=item id=PageEditFmt?%$PageEditFmt
By default, this is the HTML to be displayed for an edit form.
%apply=item id=PageEditForm?%$PageEditForm
Specifies the edit form for ?action=edit. Defaults to '$SiteGroup.EditForm?'.
%apply=item id=ROEPatterns?%$ROEPatterns
With this array you can add a pattern as key and set a text value which replace it on every edit request, using preg_replace function. Specifically it is replaced when the page is loaded into the editform, whenever a preview is done, and when the page is saved (from PmWiki 2.2.0beta45). See Cookbook:ROEPatterns for examples.
%apply=item id=ROSPatterns?%$ROSPatterns
With this array you can add patterns as key and set a text value which will replace it when the edited page is posted (as signaled by $EnablePost). It is not replaced when the page is loaded into the editform nor when a preview is done, but it is replaced only when the page is saved. See Cookbook:ROSPatterns for examples.
%apply=item id=EnableROSEscape?%$EnableROSEscape
If set to 1, the $ROEPatterns and $ROSPatterns replacements will skip escaped text (surrounded by [=...=] or [@...@]). If not set, or if set to 0, the replacements will happen even inside escaped text.

Categories: PmWiki Developer


This page may have a more recent version on pmwiki.org: PmWiki:EditVariables, and a talk page: PmWiki:EditVariables-Talk.

  Last modified May 15, 2016, at 10:50 AM EST  © Transnational Temps
- - Vote Green
LegalThis site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available in our efforts to advance understanding of environmental, political, human rights, economic, democracy, scientific, and social justice issues, etc. We believe this constitutes a 'fair use' of any such copyrighted material as provided for in section 107 of the US Copyright Law. In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit to those who have expressed a prior interest in receiving the included information for research and educational purposes. For more information go to: http://www.law.cornell.edu/uscode/17/107.shtml. If you wish to use copyrighted material from this site for purposes of your own that go beyond 'fair use', you must obtain permission from the copyright owner.