Lines Matching +full:draft -(+path:inc +path:lang) -(+path:lib +path:plugins +path:lang) -(+path:lib +path:tpl +path:dokuwiki +path:lang)
8 * Class Draft
12 class Draft
20 * Draft constructor.
22 * @param string $ID the page id for this draft
23 * @param string $client the client identification (username or ip or similar) for this draft
29 $this->cname = getCacheName("$client\n$ID", '.draft');
32 // remove stale draft
39 * Get the filename for this draft (whether or not it exists)
49 * Checks if this draft exists on the filesystem
59 * Save a draft of a current edit session
61 * The draft will not be saved if
68 * @return bool whether has the draft been saved
82 $draft = [
92 $event = new Event('DRAFT_SAVE', $draft);
94 $draft['hasBeenSaved'] = io_saveFile($draft['cname'], serialize($draft));
95 if ($draft['hasBeenSaved']) {
96 $INFO['draft'] = $draft['cname'];
99 $draft['hasBeenSaved'] = false;
103 $this->errors = $draft['errors'];
105 return $draft['hasBeenSaved'];
109 * Get the text from the draft file
111 * @throws \RuntimeException if the draft file doesn't exist
119 "Draft for page $this->id and user $this->client doesn't exist at $this->cname."
122 $draft = unserialize(io_readFile($this->cname, false));
123 return cleanText(con($draft['prefix'], $draft['text'], $draft['suffix'], true));
127 * Remove the draft from the filesystem
129 * Also sets $INFO['draft'] to null
135 $INFO['draft'] = null;
139 * Get a formatted message stating when the draft was saved
150 * Retrieve the errors that occured when saving the draft
160 * Get the timestamp when this draft was saved