xref: /plugin/bez/tpl/commcause_form.php (revision 8a6381983135ed7de69b33e64aa0c1b16dbf69b0)
1<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
2<?php $url = $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action',
3	$tpl->param('action') == 'commcause_edit' ? 'commcause_edit' : 'commcause_add',
4'kid', $tpl->param('kid')) ?>
5<a id="k_"></a>
6<form class="bez_form_blank" action="<?php echo $url ?>" method="POST">
7	<input type="hidden" name="id" value="">
8	<div class="bez_comment bez_comment_form">
9		<div class="bez_avatar">
10			<img src="<?php echo DOKU_URL ?>lib/plugins/bez/images/avatar_default.png" />
11		</div>
12		<div class="bez_text_comment">
13			<span class="bez_arrow-tip-container">
14				<span class="bez_arrow-tip">
15					<span class="bez_arrow-tip-grad"></span>
16				</span>
17			</span>
18			<div class="commcause_content">
19			<h2>
20				<?php if ($tpl->static_acl('thread_comment', 'type') >= BEZ_PERMISSION_CHANGE): ?>
21				<ul class="bez_tabs">
22					<li
23                        <?php if (  $tpl->value('type') == '' ||
24                                    $tpl->value('type') == 'comment') echo 'class="active"' ?>
25                        <?php if (  $tpl->param('kid') !== '' &&
26                                    $tpl->get('thread_comment')->task_count > 0)
27                                echo 'style="display:none;"';
28                        ?>
29                    >
30                        <a href="#comment"><?php echo $tpl->getLang('comment_noun') ?></a>
31                    </li>
32					<li <?php if(strpos($tpl->value('type'), 'cause') === 0) echo 'class="active"' ?>>
33						<a href="#cause"><?php echo $tpl->getLang('cause_noun') ?></a>
34                    </li>
35				</ul>
36				<?php endif ?>
37				<div class="bez_toolbar"></div>
38			</h2>
39			</div>
40			<div class="bez_content">
41				<textarea data-validation="required" name="content" class="bez_textarea_content" id="content1"><?php echo $tpl->value('content') ?></textarea>
42
43				<input class="bez_comment_type" type="hidden" name="type" value="comment" />
44				<?php if ($tpl->static_acl('thread_comment', 'type') >= BEZ_PERMISSION_CHANGE): ?>
45					<div class="bez_cause_type">
46						<div style="margin-bottom: 10px;">
47						<label for="potential">
48							<?php echo $tpl->getLang('cause_type') ?>:
49						</label>
50                        <label>
51                            <input type="radio" name="type" value="cause_real"
52                                <?php if($tpl->value('type') != 'cause_potential') echo 'checked' ?>/>
53                                <?php echo $tpl->getLang('cause_type_default') ?>
54						</label>
55						&nbsp;&nbsp;
56                        <label>
57                            <input type="radio" name="type" value="cause_potential"
58                                <?php if($tpl->value('type') == 'cause_potential') echo 'checked' ?>/>
59                                <?php echo $tpl->getLang('cause_type_potential') ?>
60                        </label>
61					   </div>
62                    </div>
63				<?php endif ?>
64				<input type="submit" value="<?php echo $tpl->param('kid') != '' ? $tpl->getLang('correct') : $tpl->getLang('add') ?>">
65				 <a href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id) ?><?php if ($tpl->param('kid') !== '-1') echo '#k'.$tpl->param('kid') ?>" class="bez_delete_button bez_link_button bez_cancel_button">
66					<?php echo $tpl->getLang('cancel') ?>
67				</a>
68		</div>
69        <?php if (  $tpl->param('kid') !== '-1' &&
70                    $tpl->get('thread_comment')->task_count > 0): ?>
71            <div style="margin-top: 10px; margin-left: 40px">
72                <?php foreach ($tpl->get('thread_comment')->get_tasks() as $task): ?>
73                    <?php $tpl->set('task', $task) ?>
74                    <?php if (	$tpl->action() == 'task_edit' &&
75                                $tpl->param('kid') == $task->id): ?>
76                        <?php include 'task_form.php' ?>
77                    <?php else: ?>
78                        <?php include 'task_box.php' ?>
79                    <?php endif ?>
80                <?php endforeach ?>
81            </div>
82        <?php endif ?>
83    </div>
84    </div>
85</form>
86