aboutsummaryrefslogtreecommitdiff
path: root/wikilib.d/PmWiki.Drafts
blob: 74ab7949022aeb32902e8bd6779cf1cf131d4a8e (plain)
1
2
3
4
5
6
7
8
9
10
version=pmwiki-2.2.122 ordered=1 urlencoded=1
author=Petko
charset=UTF-8
csum=section anchors
ctime=1178938308
name=PmWiki.Drafts
rev=21
targets=PmWiki.EditVariables,PmWiki.Passwords,PmWiki.SecurityVariables,PmWiki.LayoutVariables,PmWiki.Drafts
text=(:Summary: Draft versions of pages:)%0aPmWiki has the capability to stage ''draft'' versions of a page prior to them becoming "official". All of the draft pages end in "-Draft" by default (this can be changed by setting $DraftSuffix). Multiple interim edits to a page can be temporarily saved in a "-Draft" copy of a page until the draft is ready to be published to the original.%0a%0a!! Configuration and usage [[#usage]]%0aWhen the site administrator sets $EnableDrafts in a local customization file, the "Save" button on the edit page is split into separate "Publish" and "Save draft" buttons.  %0a%0aThe "Save draft" button causes any edits to be saved to a "-Draft" copy of the original page, leaving the original page intact.  Subsequent requests to edit the page (either the original or -Draft) bring up the draft copy for further editing.%0a%0aThe "Publish" button saves back to the original non-Draft copy of the page, removing any -Draft page that may have been created.%0a%0aBy default, saving drafts and publishing are available to anyone with 'edit' permissions (see [[Passwords]]).  However, the site administrator can also set the $EnablePublishAttr configuration variable, which provides a separate 'publish' permission that is required to publish to the original page.%0a%0aWhen "publishing", how the page's history is handled depends on whether the administrator has set the $EnableDraftAtomicDiff variable.%0a* 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, so the change "Summary" you enter should summarize the changes.%0a* Otherwise, all of the "draft" history entries are kept -- this is the default. The final "publish" history entry will show changes since the most recent "draft" version.%0a%0a!!Drafts and (All)RecentChanges [[#recentchanges]]%0a%0aBy default, using the "Save draft" or "Save draft and edit" button will be recorded to both Site.AllRecentChanges and Group.RecentChanges. Also after "publishing" a draft version an orphaned link to the "-Draft" page will remain.%0a%0aTo disable on both Site.AllRecentChanges and Group.RecentChanges:%0a%0a->%25hlt php%25[@%0a$DraftRecentChangesFmt = array();%0a@]%0a%0aor alternatively:%0a%0a->%25hlt php%25[@%0aif ( @$EnableDrafts && @$_POST['postedit']>'' || @$_POST['postdraft']>'' )%0a  unset($RecentChangesFmt);%0a@]%0a%0aTo only disable one of these, unset it individually:%0a%0a->%25hlt php%25[@%0aif ( @$EnableDrafts && @$_POST['postedit']>'' || @$_POST['postdraft']>'' ) {%0a  unset($RecentChangesFmt['$Group.RecentChanges']); # -and/or-%0a  unset($RecentChangesFmt['$SiteGroup.AllRecentChanges']);%0a}%0a@]%0a%0aIf a $DraftRecentChangesFmt array is defined, it will be used instead of $RecentChangesFmt when saving a Draft version. For example, to have all draft versions only appear on a page Site.DraftRecentChanges, you could add to config.php:%0a%0a->%25hlt php%25[@%0a$DraftRecentChangesFmt['Site.DraftRecentChanges'] %0a  = '* [[{$Group}.{$Name}]]  . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a@]%0a%0aSee also $RecentChangesFmt and $DraftRecentChangesFmt.%0a%0a!!Drafts with searches, pagelists, and RSS [[#pagelist]]%0a%0aThe drafts module also sets pagelists and searches (and thus RSS feeds) to ignore "-Draft" pages by default; one has to do list=all or similar in order to have draft pages included in a pagelist or RSS feed.%0a%0a>>faq%3c%3c [[#faq]]%0a%0aQ:  How do I moderate all postings?%0a%0aA:  Start by [[Drafts | enabling drafts]] to change the "Save" button into separate "Publish" and "Save draft" buttons.  Then set $EnablePublishAttr.  This adds a "publish" authorization level to distinguish editing of page drafts from publishing.%0a
time=1574371063