1<?php $helper = plugin_load('helper', 'confmanager');
2/**
3 * @var ConfigManagerTwoLineLeftImageConfigCascade|ConfigManagerTwoLineRightImageConfigCascade $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<?php echo ucfirst($this->imageAlignment) ?>Image">
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 foreach($local as $key => $value):?>
17        <?php $image = $this->getImage('local', $key); ?>
18        <?php $isDefault = array_key_exists($key, $default) ?>
19        <tr>
20                <td>
21                	<?php if ($image !== '' && $this->imageAlignment == 'left'): ?>
22                		<img src="<?php echo hsc($image) ?>" alt="" class="exampleimage <?php echo hsc($this->internalName) ?>" />
23                	<?php endif ?>
24                	<input
25                        name="keys[]"
26                        value="<?php echo hsc($key) ?>"
27                        class="key"
28                    />
29                </td>
30                <td>
31                    <?php if ($image !== '' && $this->imageAlignment == 'right'): ?>
32                        <img src="<?php echo hsc($image) ?>" alt="" class="exampleimage <?php echo hsc($this->internalName) ?>" />
33                    <?php endif ?>
34                    <input
35                        type="text"
36                        name="values[]"
37                        value="<?php echo hsc($value) ?>"
38                        class="edit value"
39                        />
40                    <?php if($isDefault): ?>
41                        <br>
42                        <span class="overriddenValue">
43                            <?php if($value === ''): ?>
44                                <?php echo $helper->getLang('disablesdefault') ?>
45                            <?php else : ?>
46                                <?php echo $helper->getLang('modifiesdefault') ?>
47                            <?php endif ?>
48                        </span>
49                    <?php endif ?>
50                </td>
51                <td>
52                    <?php include DOKU_PLUGIN . 'confmanager/tpl/deleteButton.php' ?>
53
54                    <?php if($isDefault) : ?>
55	                    <img class="upload_image_button"
56							src="<?php echo DOKU_PLUGIN_ICONS.'picture_edit_disabled.png' ?>"
57							alt="<?php echo hsc($helper->getLang('edit_icon_action_disabled')) ?>"
58							title="<?php echo hsc($helper->getLang('edit_icon_action_tooltip_disabled')) ?>" />
59                    <?php else : ?>
60	                    <img class="upload_image_button clickable"
61							src="<?php echo DOKU_PLUGIN_ICONS.'picture_edit.png' ?>"
62							alt="<?php echo hsc($helper->getLang('edit_icon_action')) ?>"
63							title="<?php echo hsc($helper->getLang('edit_icon_action_tooltip')) ?>" />
64                    <?php endif ?>
65
66
67					<?php if($image !== '' && !$isDefault) : ?>
68						<img class="delete_image_button clickable"
69                       		src="<?php echo DOKU_PLUGIN_ICONS.'picture_delete.png' ?>"
70                       		alt="<?php echo hsc($helper->getLang('delete_icon_action')) ?>"
71                       		title="<?php echo hsc($helper->getLang('delete_icon_action_tooltip')) ?>" />
72                    <?php else : ?>
73                       	<img src="<?php echo DOKU_PLUGIN_ICONS.'picture_delete_disabled.png' ?>"
74                       		 alt="<?php echo hsc($helper->getLang('delete_icon_action_disabled')) ?>"
75                       		title="<?php echo hsc($helper->getLang('delete_icon_action_tooltip_disabled')) ?>" />
76                    <?php endif ?>
77                </td>
78            </tr>
79        <?php endforeach ?>
80        <tr>
81            <td>
82                <input class="newItem key" type="text" name="newKey[]">
83            </td>
84            <td>
85                <input class="newItem value submitOnTab" type="text" name="newValue[]" />
86            </td>
87            <td/>
88        </tr>
89	</table>
90	<?php $this->helper->tplSaveButton() ?>
91</div>
92	<h3 class="clickable hoverFeedback" title="<?php echo $helper->getLang('toggle_defaults') ?>">
93		<a id="toggleDefaults">
94			<?php echo $helper->getLang('default_values') ?>
95			<img id="defaults_toggle_button"/>
96		</a>
97	</h3>
98	<div class="defaults">
99		<p>
100			<?php echo hsc($helper->getLang('defaults_description')) ?>
101		</p>
102	    <table class="inline confmanager_twoLineLeftImage">
103	        <tr>
104	            <th><?php echo $helper->getLang('key') ?></th>
105	            <th><?php echo $helper->getLang('value') ?></th>
106	            <th><?php echo $helper->getLang('actions') ?></th>
107	        </tr>
108	        <?php foreach ($default as $key => $value): ?>
109	        	<?php $isOverridden = array_key_exists($key, $local) ?>
110	            <?php $image = $this->getImage('default', $key); ?>
111	            <tr<?php if($isOverridden): ?> class="overridden"<?php endif ?>>
112	                <td>
113	                	<div class="defaultValue" title="<?php echo hsc($helper->getLang('default_value_tooltip')) ?>">
114	                		<?php if ($image !== '' && $this->imageAlignment == 'left'): ?>
115	                            <img src="<?php echo hsc($image) ?>" alt="" class="exampleimage <?php echo hsc($this->internalName) ?>" />
116	                        <?php endif ?>
117                            <span class="default_key"><?php echo hsc($key) ?></span>
118	                	</div>
119	                </td>
120	                <td>
121	                	<div class="defaultValue" title="<?php echo hsc($helper->getLang('default_value_tooltip')) ?>">
122	                        <?php if ($image !== '' && $this->imageAlignment == 'right'): ?>
123	                            <img src="<?php echo hsc($image) ?>" alt="" class="exampleimage <?php echo hsc($this->internalName) ?>" />
124	                        <?php endif ?>
125                            <span class="default_value"><?php echo hsc($value) ?></span>
126                            <?php if($isOverridden): ?>
127                                <br>
128                                <span class="overriddenValue">
129                                    <?php if($local[$key] === ''): ?>
130                                        <?php echo $helper->getLang('disabledbylocal') ?>
131                                    <?php else : ?>
132                                        <?php echo $helper->getLang('modifiedbylocal') ?>
133                                    <?php endif ?>
134                                </span>
135                            <?php endif ?>
136	                    </div>
137	                </td>
138	                <td class="defaultValue">
139                        <?php include DOKU_PLUGIN . 'confmanager/tpl/disableButton.php' ?>
140
141                        <img src="<?php echo DOKU_PLUGIN_ICONS.'picture_edit_disabled.png' ?>"
142                            alt="<?php echo hsc($helper->getLang('edit_icon_action')) ?>"
143                            title="<?php echo hsc($helper->getLang('edit_icon_action_tooltip_disabled')) ?>" />
144	                </td>
145	            </tr>
146	        <?php endforeach ?>
147	    </table>
148    </div>
149</div>
150