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