Blob


1 version=pmwiki-2.3.17 ordered=1 urlencoded=1
2 author=Petko
3 charset=UTF-8
4 csum=$EnableGUIButtons require php-json (+224)
5 name=PmWiki.EditVariables
6 rev=103
7 targets=PmWiki.Functions,PmWiki.EditVariables,Cookbook.NotSavedWarning,Cookbook.EditHelp,Cookbook.EditTemplates,PmWiki.SecurityVariables,PmWiki.Drafts,Cookbook.FixURL,Cookbook.PreviewChanges,PmWiki.IncludeOtherPages,PmWiki.PageTextVariables,PmWiki.BasicVariables,Cookbook.ROSPatterns,Category.PmWikiDeveloper,!PmWikiDeveloper
8 text=(:Summary:variables used when editing pages:)%0aTo set many of the variables below specify them in @@config.php@@.%0a%0a:$EnableReadOnly: Set to 1 to disable editing. Note this doesn't automatically prevent changes to the wiki by recipes, unless they use the [[Functions#Lock|core Lock() function]] correctly.%0a: : %25hlt php%25@@ $EnableReadOnly = 1; # disable editing@@%0a%0a:$EnableNotSavedWarning: Set to 1 to warn the editors if they are about to leave the edit form without saving their changes. Based on Cookbook:NotSavedWarning. By default this is disabled. If you enable it, please disable any addons that may provide a similar feature, notably an older version of Cookbook:NotSavedWarning.%0a: : %25hlt php%25@@ $EnableNotSavedWarning = 0; # disable warning, default 1 (enabled, since 2.3.0)@@%0a%0a:$EnableEditAutoText: Set to 1 to enable basic predictive editing like automatically inserted list bullets, see Cookbook:EditHelp. By default this is disabled. If you enable it, please disable any addons that may provide a similar feature, notably an older version of Cookbook:EditHelp.%0a: : %25hlt php%25@@ $EnableEditAutoText = 1;@@%0a%0a:$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 %25hlt php%25[@%0a $AutoCreate[REGEXP] = PAGE_PARAMETERS;%0a@]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 %25hlt php%25[@%0a $AutoCreate['/^Category\\./'] = array('ctime' => $Now);%0a@]will create a blank page with a current creation time for any missing Category page.%0a%0a:$DefaultPageTextFmt:The text that should be displayed when browsing non-existent pages. As default PmWiki uses the contents of Site.PageNotFound: %25hlt php%25[@%0a $DefaultPageTextFmt = '(:include $[{$SiteGroup}.PageNotFound]:)';@] %0a%0a:$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). %25hlt php%25[@%0a## Change delete word to "remove":%0a$DeleteKeyPattern = "^\\s*remove\\s*$";%0a## Delete any page with no visible text, i.e., empty:%0a$DeleteKeyPattern = "^\\s*$";@]%0a%0a:$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.: %25hlt php%25[@%0a $DiffKeepDays = 30; # keep revisions at least 30 days%0a@]If you want to suppress a page's revision history, you can insert into a customization file %25hlt php%25[@%0a $DiffKeepDays = $DiffKeepNum = -1; # suppress revision history %0a@]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.%0a%0a:$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. %25hlt php%25[@%0a $DiffKeepNum = 50; # keep at least 50 revisions (default is 20)%0a@]To suppress page's revision history with [@$DiffKeepNum = -1@] see $DiffKeepDays above.%0a%0a:$DraftActionsPattern:The actions which allow full loading of the draft.php functionality for custom actions. Default is 'edit'. You can enable drafts for other actions like: %25hlt php%25[@%0a $DraftActionsPattern = 'edit|pmform|translate';%0a # Enable drafts for actions 'edit', 'pmform' and 'translate'.@]%0a%0a:$DraftSuffix:The suffix to use for draft versions of pages (default "-Draft").%0a%0a:$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: %25hlt php%25[@%0a$EditFunctions = array('EditTemplate', 'RestorePage', 'ReplaceOnSave',%0a 'SaveAttributes', 'PostPage', 'PostRecentChanges', 'AutoCreateTargets', 'PreviewPage');%0a%0a@]Many recipes manipulate this array, so it is recommended, instead of redefining the complete array to add your custom functions, to use functions like %25hlt php%25@@array_unshift()@@, @@array_push()@@ and @@array_splice()@@.%0a%0a:$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. %25hlt php%25[@%0a## Redirect to Main.HomePage:%0a$EditRedirectFmt = 'Main.HomePage';%0a## Redirect to HomePage of current group:%0a$EditRedirectFmt = '{$Group}.HomePage';@]%0a%0a:$EditTemplatesFmt:Name of the page (or an array of names) to be used as the default text for any newly created pages. %25hlt php%25[@%0a## Use 'Main.NewPageTemplate' as default text of all new pages:%0a $EditTemplatesFmt = 'Main.NewPageTemplate';%0a## Use 'Template' in the current group for new pages:%0a $EditTemplatesFmt = '$Group.Template';%0a## Use 'Template' in the current group if it exists, otherwise%0a## use 'Main.NewPageTemplate':%0a $EditTemplatesFmt = array('$Group.Template', 'Main.NewPageTemplate');@]%0a-> See [[Cookbook:EditTemplates]] for more information.%0a%0a%0a:$EnableDrafts:When set to '1', enables the "Save draft" button and built-in handling of "draft" versions of pages, where: %0a## Initial "Save draft" of an existing page ("PageName") saves changes to a new name ("PageName-Draft").%0a## Subsequent attempts to edit PageName causes PageName-Draft to be edited.%0a## Subsequent selections of "Save draft" cause PageName-Draft to be saved.%0a## Pressing "Publish" causes PageName-Draft to be posted to PageName, and deleted.%0a-> Turn on draft edits: %25hlt php%25[@%0a $EnableDrafts = 1;@]%0a-> A related variable, $EnablePublishAttr, adds a new "publish" authorization level to distinguish editing of drafts from publishing them.%0a%0a:$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.)%0a%0a:$EnableGUIButtons:When set to '1', turns on the graphical buttons in the "Edit Page" form. %25hlt php%25[@%0a## Turn on graphical edit buttons:%0a$EnableGUIButtons = 1;@]%0a%0a:$EnableGuiEditFixUrl: Enables an icon "%252" that can help encoding special characters in URL links, see Cookbook:FixURL. $EnableGUIButtons need to be enabled.%0a: : %25hlt php%25@@$EnableGuiEditFixUrl = 2000; # place the button near the end of the Edit toolbar@@%0a%0a:$EnablePreviewChanges:When set to '1', the "Preview" function will show the highlighted changes in the wiki markup before the rendered page preview. See Cookbook:PreviewChanges. %25hlt php%25[@%0a $EnablePreviewChanges = 1;@]%0a%0a:$EnableListIncludedPages: When set to '1', inserts in the edit form a list with pages included in the currently edited page either via the [[IncludeOtherPages|include markup]], or via [[page text variables]] (and any nested pages and variables). The list appears in a collapsed %25hlt html%25@@%3cdetails>@@ element between the text area and the summary field.%0a%0a:$EnablePostAuthorRequired:When set to '1', posting of pages (and uploading files since 2.2.117) requires the author to provide an author name. Otherwise, authors can post without a name. %25hlt php%25[@%0a## Require authors to provide a name:%0a$EnablePostAuthorRequired = 1;@] %0a%0a:$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. %0a%0a:$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. %25hlt php%25[@%0a## Store browser user agent with page diffs:%0a $EnableRevUserAgent = 1; @]%0a%0a:$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.%0a%0a:$HandleEditFmt: Like $HandleBrowseFmt, this specifies the entire output format for [@?action=edit@] for a page.%0a%0a:$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).%0a %0a:$PageEditFmt: By default, this is the HTML to be displayed for an edit form.%0a%0a:$PageEditForm: Specifies the edit form for [@?action=edit@]. Defaults to '@@$SiteGroup.EditForm@@'.%0a%0a:$ROEPatterns: With this array you can add a pattern as ''key'' and set a text ''value'' which replace it on every edit request, using %25hlt php%25@@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:ROSPatterns for examples.%0a%0a:$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.%0a%0a:$EnableROSEscape: If set to 1, the $ROEPatterns and $ROSPatterns replacements will skip escaped text (surrounded by %25pmhlt%25[@[=...=]@] or @@[=[@...@]=]@@). If not set, or if set to 0, the replacements will happen even inside escaped text.%0a%0a%0aCategories: [[!PmWiki Developer]]
9 time=1671285454