< Debug Variables | Variables | I18n Variables >
To set many of the variables below specify them in config.php.
$EnableReadOnly: :
$EnableReadOnly = 1; # disable editing
$EnableNotSavedWarning: :
$EnableNotSavedWarning = 0; # disable warning, default 1 (enabled, since 2.3.0)
$EnableEditAutoText: :
: : $EnableEditAutoText = 1; # enable for the edit form
$EnableEditAutoText = 2; # enable for any textarea with the class name 'autotext'
:$EditAutoBrackets: An array of key-value pairs defining brackets, parentheses, or quotes. When the user types any key in the editor, both the opening (key) and closing (value) characters will be inserted, with the cursor positioned between them. If text is selected, the characters will wrap around the selection. $EnableEditAutoText needs to also be enabled, see Cookbook:EditHelp.
: :
: : $EditAutoBrackets['cursor'] = '"{[('; # insert "", {}, [], or () if no text is selected$EditAutoBrackets['selection'] = '\'`~"{[(-+@^%_=<>'; # if text is selected
$EnableMinorEditKeepMeta: :
: : This reports the previous page attributes, but Recent Changes pages and page histories are recorded as usual to allow review.
: : Note, if the array is enabled, the 'time' attribute is reported even if not defined above, but for readability and future compatibility it is recommended to define it.
$EnableMinorEditKeepMeta = ['time', 'author', 'csum']; # report the last modified time, author and edit summary on minor edits
$EnableMergeLastMinorEdit: :
: : To only allow this for a limited time between edits, set this variable to the number of seconds. If a longer time has passed, a separate history entry will be added as usual:
: : $EnableMergeLastMinorEdit = 1;
: : See also $EnableMergeLastMinorEdit = 2*3600; # at most 2 hours between merged edits$EnableDraftAtomicDiff.
$AutoCreate
$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.
$DefaultPageTextFmt
$DefaultPageTextFmt = '(:include $[{$SiteGroup}.PageNotFound]:)';
$DeleteKeyPattern## Change delete word to "remove": $DeleteKeyPattern = "^\\s*remove\\s*$"; ## Delete any page with no visible text, i.e., empty: $DeleteKeyPattern = "^\\s*$";
$DiffKeepDays = 30; # keep revisions at least 30 days
If you want to suppress a page's revision history, you can insert into a customization file
$DiffKeepDays = $DiffKeepNum = -1; # suppress revision history
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.
$DiffKeepNum = 50; # keep at least 50 revisions (default is 20)
To suppress page's revision history with $DiffKeepNum = -1 see $DiffKeepDays above.
$DraftActionsPattern
$DraftActionsPattern = 'edit|pmform|translate';
# Enable drafts for actions 'edit', 'pmform' and 'translate'.
$DraftSuffix$EditFunctions
$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 call InsertEditFunction() with your function name. See also UpdatePage().
## Redirect to Main.HomePage:
$EditRedirectFmt = 'Main.HomePage';
## Redirect to HomePage of current group:
$EditRedirectFmt = '{$Group}.HomePage';
$EditTemplatesFmt
## 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');
$EnableDrafts
$EnableDrafts = 1;
$EnablePublishAttr, adds a new "publish" authorization level to distinguish editing of drafts from publishing them.
:$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.) See also $EnableMergeLastMinorEdit.
$EnableGUIButtons## Turn on graphical edit buttons: $EnableGUIButtons = 1;
:$EnableGuiEditFixUrl: Enables an icon "%2" that can help encoding special characters in URL links, see Cookbook:FixURL. $EnableGUIButtons need to be enabled.
: : $EnableGuiEditFixUrl = 2000; # place the button near the end of the Edit toolbar
$EnablePreviewChanges$EnablePreviewChanges = 1;
$EnableListIncludedPages<details> element between the text area and the summary field.
$EnablePostAuthorRequired## Require authors to provide a name: $EnablePostAuthorRequired = 1;
:$EnableUploadAuthorRequired:Whether uploading files requires the name of the uploader to be entered (added in 2.2.117). If unset, will use the value of $EnablePostAuthorRequired.
$EnableRevUserAgent## Store browser user agent with page diffs: $EnableRevUserAgent = 1;
$GUIButtonsscripts/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.
:$HandleEditFmt: Like $HandleBrowseFmt, this specifies the entire output format for ?action=edit for a page.
$IsPagePosted$PageEditFmt:$PageEditForm: Specifies the edit form for ?action=edit. Defaults to '@@$SiteGroup.EditForm@@'.
:$ROSPatterns: ("Replace on Save patterns") With this array you can add patterns as ''key'' and set a text ''value'' which will replace it when the edited page is saved (as signaled by $EnablePost). See Cookbook:ROSPatterns for examples.
:$ROEPatterns: ("Replace on Edit patterns") This behaves similarly to $ROSPatterns but also when the page is loaded into the edit form, and when a preview is done.
:$TROEPatterns: ("Template Replace on Edit patterns") This behaves similarly to $ROEPatterns but only when an empty page is opened for editing and an "edit template" is loaded into the edit form, see $EditTemplatesFmt.
:$EnableROSEscape: If set to 1, the $ROEPatterns, $ROSPatterns, and $TROEPatterns 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
< Debug Variables | Variables | I18n Variables >