Failed Conditions
Pull Request — master (#3198)
by
unknown
02:54
created

Conflict   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A show() 0 24 1
1
<?php
2
3
namespace dokuwiki\Ui;
4
5
use dokuwiki\Extension\Event;
6
use dokuwiki\Form\Form;
7
8
/**
9
 * DokuWiki Conflict Insterface
10
 *
11
 * @package dokuwiki\Ui
12
 */
13
class Conflict extends Ui
14
{
15
    /**
16
     * Show warning on conflict detection
17
     *
18
     * @author   Andreas Gohr <[email protected]>
19
     *
20
     * @triggers HTML_CONFLICTFORM_OUTPUT
21
     * @param string $text
22
     * @param string $summary
23
     * @return void
24
     */
25
    public function show($text = '', $summary = '')
26
    {
27
        global $ID;
28
        global $lang;
29
30
        // print intro
31
        print p_locale_xhtml('conflict');
32
33
        // create the draft form
34
        $form = new Form(['id' => 'dw__editform']);
35
        $form->addTagOpen('div')->addClass('no');
36
        $form->setHiddenField('id', $ID);
37
        $form->setHiddenField('wikitext', $text);
38
        $form->setHiddenField('summary', $summary);
39
40
        $form->addButton('do[save]', $lang['btn_save'] )->attrs(['type' => 'submit', 'accesskey' => 's']);
41
        $form->addButton('do[cancel]', $lang['btn_cancel'] )->attrs(['type' => 'submit']);
42
        $form->addTagClose('div');
43
44
        // emit HTML_CONFLICTFORM_OUTPUT event, print the form
45
        Event::createAndTrigger('HTML_CONFLICTFORM_OUTPUT', $form, 'html_form_output', false);
46
47
        print '<br /><br /><br /><br />'.DOKU_LF;
48
    }
49
50
}
51