-
Notifications
You must be signed in to change notification settings - Fork 989
/
questionToolsDropdownItems.php
91 lines (86 loc) · 4.09 KB
/
questionToolsDropdownItems.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php if($hasSurveyContentUpdatePermission):?>
<!-- Conditions -->
<li>
<a class="dropdown-item" id="conditions_button" href="<?php echo Yii::App()->createUrl("admin/conditions/sa/index/subaction/editconditionsform/surveyid/$surveyid/gid/$gid/qid/$qid"); ?>">
<span class="ri-git-branch-fill icon"></span>
<?php eT("Condition designer"); ?>
</a>
</li>
<?php endif;?>
<?php if($hasSurveyContentUpdatePermission && $hasdefaultvalues > 0):?>
<!-- Default Values -->
<li>
<a class="dropdown-item" id="default_value_button" href="<?php echo Yii::App()->createUrl("questionAdministration/editdefaultvalues/surveyid/$surveyid/gid/$gid/qid/$qid"); ?>">
<span class="ri-grid-line"></span>
<?php eT("Edit default answers"); ?>
</a>
</li>
<?php endif;?>
<?php if($hasSurveyContentExportPermission):?>
<!-- Export -->
<li>
<a class="dropdown-item" href="<?php echo Yii::App()->createUrl("admin/export/sa/question/surveyid/$surveyid/gid/$gid/qid/{$qid}");?>">
<span class="ri-download-fill"></span>
<?php eT("Export"); ?>
</a>
</li>
<?php endif; ?>
<?php if($hasSurveyContentCreatePermission && ($oSurvey->active!='Y')):?>
<!-- Copy -->
<li>
<a class="dropdown-item" id="copy_button" href='<?php echo Yii::App()->createUrl("questionAdministration/copyQuestion/surveyId/{$oQuestion->sid}/questionGroupId/{$oQuestion->gid}/questionId/{$oQuestion->qid}");?>'>
<span class="ri-file-copy-line icon"></span>
<?php eT("Copy"); ?>
</a>
</li>
<?php endif; ?>
<?php if($hasSurveyContentReadPermission): ?>
<?php if (count($surveyLanguages) > 1): ?>
<!-- Check survey logic multilanguage -->
<li role="separator" class="dropdown-divider"></li>
<li class="dropdown-header"><?php eT("Check logic"); ?></li>
<?php foreach ($surveyLanguages as $languageCode => $languageName): ?>
<li>
<a class="dropdown-item" href="<?php echo Yii::App()->createUrl("admin/expressions/sa/survey_logic_file/sid/{$surveyid}/gid/{$gid}/qid/{$qid}/lang/" . $languageCode); ?>" >
<span class="ri-checkbox-fill"></span>
<?php echo $languageName; ?>
</a>
</li>
<?php endforeach; ?>
<?php else:?>
<!-- Check survey logic -->
<li>
<a class="pjax dropdown-item" href="<?php echo Yii::App()->createUrl("admin/expressions/sa/survey_logic_file/sid/{$surveyid}/gid/{$gid}/qid/{$qid}"); ?>">
<span class="ri-checkbox-fill"></span>
<?php eT("Check logic"); ?>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
<?php if (!empty($showDeleteButton)) : ?>
<!-- Delete -->
<?php if ($oSurvey->active !== 'Y') : ?>
<li>
<a href="#" onclick="return false;"
class="dropdown-item"
data-bs-toggle="modal"
data-bs-target="#confirmation-modal"
data-btnclass="btn-danger"
data-title="<?= gt('Delete this question') ?>"
data-btntext="<?= gt('Delete') ?>"
data-onclick='(function() { <?php echo convertGETtoPOST(Yii::app()->createUrl("questionAdministration/delete/", ["qid" => $qid, "redirectTo" => "groupoverview"])); ?>})'
data-message="<?php eT("Deleting this question will also delete any answer options and subquestions it includes. Are you sure you want to continue?", "js"); ?>"
>
<span class="ri-delete-bin-fill text-danger"></span>
<?php eT("Delete question"); ?>
</a>
</li>
<?php else : ?>
<li class="disabled">
<a class="btntooltip dropdown-item" disabled data-bs-toggle="tooltip" data-bs-placement="bottom" title="<?php eT("You can't delete a question if the survey is active."); ?>">
<span class="ri-delete-bin-fill text-danger"></span>
<?php eT("Delete question"); ?>
</a>
</li>
<?php endif; ?>
<?php endif; ?>