1<?php $helper = plugin_load('helper', 'confmanager');
2/**
3 * @var ConfigManagerTwoLineCascadeConfig $this
4 * @var array $local
5 * @var array $default
6 * @var array[] $configs
7 */ ?>
8<div class="table">
9	<h3><?php echo $helper->getLang('user_defined_values') ?></h3>
10    <table class="inline confmanager_twoLine">
11        <tr>
12            <th><?php echo $helper->getLang('key') ?></th>
13            <th><?php echo $helper->getLang('value') ?></th>
14            <th><?php echo $helper->getLang('actions') ?></th>
15        </tr>
16        <?php $lineCounter = 0; ?>
17        <?php foreach ($local as $key => $value): ?>
18            <?php $isDefault = array_key_exists($key, $default) ?>
19
20            <tr>
21                <td>
22                	<input
23                        type="text"
24                        name="keys[]"
25                        id="key<?php echo $lineCounter ?>"
26                        value="<?php echo hsc($key) ?>"
27                        class="key"
28                    >
29                </td>
30                <td>
31                    <input
32                    	id="value<?php echo $lineCounter ?>"
33                        type="text"
34                        name="values[<?php echo hsc($key) ?>]"
35                        value="<?php echo hsc($value) ?>"
36                        class="edit value"
37                        />
38                    <?php if($isDefault): ?>
39                        <br>
40                        <span class="overriddenValue">
41                            <?php if($value === ''): ?>
42                                <?php echo $helper->getLang('disablesdefault') ?>
43                            <?php else : ?>
44                                <?php echo $helper->getLang('modifiesdefault') ?>
45                            <?php endif ?>
46                        </span>
47                    <?php endif ?>
48                </td>
49                <td>
50                    <?php include DOKU_PLUGIN . 'confmanager/tpl/deleteButton.php' ?>
51                </td>
52            </tr>
53            <?php $lineCounter++; ?>
54        <?php endforeach ?>
55        <tr>
56            <td>
57                <input class="newItem key" type="text" name="newKey[]">
58            </td>
59            <td>
60                <input class="newItem value submitOnTab" type="text" name="newValue[]" />
61            </td>
62            <td/>
63        </tr>
64    </table>
65    <?php $this->helper->tplSaveButton() ?>
66    <h3 class="clickable hoverFeedback" title="<?php echo $helper->getLang('toggle_defaults') ?>">
67		<a id="toggleDefaults">
68			<?php echo $helper->getLang('default_values') ?>
69			<img id="defaults_toggle_button"/>
70		</a>
71	</h3>
72	<div class="defaults">
73		<p>
74			<?php echo hsc($helper->getLang('defaults_description')) ?>
75		</p>
76		<table class="inline confmanager_twoLine">
77			<tr>
78				<th><?php echo $helper->getLang('key') ?></th>
79	            <th><?php echo $helper->getLang('value') ?></th>
80                <th><?php echo $helper->getLang('actions') ?></th>
81            </tr>
82			<?php foreach($default as $key => $value): ?>
83                <?php $isOverridden = array_key_exists($key, $local) ?>
84
85                <tr<?php if($isOverridden): ?> class="overridden"<?php endif ?>>
86					<td class="defaultValue">
87						<span class="default_key"><?php echo hsc($key); ?></span>
88					</td>
89					<td class="defaultValue">
90						<span class="default_value"><?php echo hsc($value); ?></span>
91                        <?php if($isOverridden): ?>
92                            <br>
93                            <span class="overriddenValue">
94                                <?php if($local[$key] === ''): ?>
95                                    <?php echo $helper->getLang('disabledbylocal') ?>
96                                <?php else : ?>
97                                    <?php echo $helper->getLang('modifiedbylocal') ?>
98                                <?php endif ?>
99                            </span>
100                        <?php endif ?>
101					</td>
102                    <td class="default_value">
103                        <?php include DOKU_PLUGIN . 'confmanager/tpl/disableButton.php' ?>
104                    </td>
105				</tr>
106			<?php endforeach ?>
107		</table>
108	</div>
109</div>
110