[ Index ] |
PHP Cross Reference of DokuWiki |
[Summary view] [Print] [Text view]
1 <?php 2 3 namespace dokuwiki\Ui; 4 5 use dokuwiki\Draft; 6 use dokuwiki\Form\Form; 7 8 /** 9 * DokuWiki Page Draft Interface 10 * 11 * @package dokuwiki\Ui 12 */ 13 class PageDraft extends Ui 14 { 15 /** 16 * Display the Page Draft Form 17 * ask the user about how to handle an exisiting draft 18 * 19 * @author Andreas Gohr <andi@splitbrain.org> 20 * 21 * @return void 22 */ 23 public function show() 24 { 25 global $INFO; 26 global $lang; 27 28 $draft = new Draft($INFO['id'], $INFO['client']); 29 $text = $draft->getDraftText(); 30 31 // print intro 32 print p_locale_xhtml('draft'); 33 34 // print difference 35 (new PageDiff($INFO['id']))->compareWith($text)->preference('showIntro', false)->show(); 36 37 // create the draft form 38 $form = new Form(['id' => 'dw__editform']); 39 $form->addTagOpen('div')->addClass('no'); 40 $form->setHiddenField('id', $INFO['id']); 41 $form->setHiddenField('date', $draft->getDraftDate()); 42 $form->setHiddenField('wikitext', $text); 43 44 $form->addTagOpen('div')->id('draft__status'); 45 $form->addHTML($draft->getDraftMessage()); 46 $form->addTagClose('div'); 47 $form->addButton('do[recover]', $lang['btn_recover'] )->attrs(['type' => 'submit', 'tabindex' => '1']); 48 $form->addButton('do[draftdel]', $lang['btn_draftdel'])->attrs(['type' => 'submit', 'tabindex' => '2']); 49 $form->addButton('do[show]', $lang['btn_cancel'] )->attrs(['type' => 'submit', 'tabindex' => '3']); 50 $form->addTagClose('div'); 51 52 print $form->toHTML('Draft'); 53 } 54 55 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body