/
surveyToolsDropdownItems.php
151 lines (131 loc) · 5.78 KB
/
surveyToolsDropdownItems.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
//todo: this one comes from old TopbarWidget
?>
<ul class="dropdown-menu">
<?php if ($hasDeletePermission): ?>
<!-- Delete survey -->
<li>
<a class="dropdown-item"
href="<?php echo App()->createUrl("surveyAdministration/delete/", ['iSurveyID' => $sid]); ?>">
<span class="ri-delete-bin-fill text-danger"></span>
<?php eT("Delete survey"); ?>
</a>
</li>
<?php endif; ?>
<?php if ($hasSurveyTranslatePermission): ?>
<!-- surveytranslate -->
<?php if ($hasAdditionalLanguages): ?>
<!-- Quick-translation -->
<li>
<a class="dropdown-item"
href="<?= App()->createUrl("quickTranslation/index/surveyid/{$oSurvey->sid}"); ?>">
<span class="ri-global-line"></span>
<?php eT("Quick-translation"); ?>
</a>
</li>
<?php else: ?>
<!-- Quick-translation disabled -->
<li class="disabled">
<a class="dropdown-item" href="#" class="btntooltip disabled" data-bs-toggle="tooltip"
data-bs-placement="bottom"
title="<?php eT('Currently there are no additional languages configured for this survey.'); ?>">
<span class="ri-global-line"></span>
<?php eT("Quick-translation"); ?>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
<?php if ($hasSurveyContentPermission): ?>
<?php if ($conditionsCount > 0): ?>
<li>
<!-- condition -->
<a class="dropdown-item"
href="<?php echo App()->createUrl("/admin/conditions/sa/index/subaction/resetsurveylogic/surveyid/{$oSurvey->sid}"); ?>">
<span class="icon-resetsurveylogic"></span>
<?php eT("Reset conditions"); ?>
</a>
</li>
<?php else : ?>
<li class="disabled">
<!-- condition disabled -->
<a class="dropdown-item" href="#" class="btntooltip disabled" data-bs-toggle="tooltip"
data-bs-placement="bottom"
title="<?php eT("Currently there are no conditions configured for this survey.", "js"); ?>">
<span class="icon-resetsurveylogic"></span>
<?php eT("Reset conditions"); ?>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
<?php if ($hasSurveyReadPermission): ?>
<!-- survey content -->
<?php if (count($oSurvey->allLanguages) == 1): ?>
<!-- one language -->
<!-- Survey logic file -->
<li>
<a class="dropdown-item"
href='<?php echo App()->createUrl("admin/expressions/sa/survey_logic_file/sid/$oSurvey->sid/"); ?>'>
<span class="icon-expressionmanagercheck"></span>
<?php eT("Survey logic file"); ?>
</a>
</li>
<?php else : ?>
<!-- multilangue -->
<li role="separator" class="dropdown-divider"></li>
<!-- Survey logic file -->
<li class="dropdown-header"><?php eT("Survey logic file"); ?></li>
<?php foreach ($oSurvey->allLanguages as $tmp_lang): ?>
<!-- Languages -->
<li>
<a class="dropdown-item"
href='<?php echo App()->createUrl("admin/expressions/sa/survey_logic_file/sid/$oSurvey->sid/lang/$tmp_lang"); ?>'>
<span class="icon-expressionmanagercheck"></span>
<?php echo getLanguageNameFromCode($tmp_lang, false); ?>
</a>
</li>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php if (!$oSurvey->isActive && $hasSurveyContentPermission): ?>
<li role="separator" class="dropdown-divider"></li>
<!-- Regenerate question codes -->
<li class="dropdown-header">
<?php eT("Regenerate question codes"); ?>
</li>
<!-- Straight -->
<li>
<a class="dropdown-item"
href="<?php echo App()->createUrl("/surveyAdministration/regenerateQuestionCodes/surveyid/{$sid}/subaction/straight"); ?>">
<span class="icon-resetsurveylogic"></span>
<?php eT("Straight"); ?>
</a>
</li>
<!-- By question group -->
<li>
<a class="dropdown-item"
href="<?php echo App()->createUrl("/surveyAdministration/regenerateQuestionCodes/surveyid/{$sid}/subaction/bygroup"); ?>">
<span class="icon-resetsurveylogic"></span>
<?php eT("By question group"); ?>
</a>
</li>
<?php endif; ?>
<?php if (!empty($extraToolsMenuItems)): ?>
<?php foreach ($extraToolsMenuItems as $menuItem): ?>
<?php if ($menuItem->isDivider()): ?>
<li class="dropdown-divider"></li>
<?php elseif ($menuItem->isSmallText()): ?>
<li class="dropdown-header"><?php echo $menuItem->getLabel(); ?></li>
<?php else: ?>
<li>
<a class="dropdown-item" href="<?php echo $menuItem->getHref(); ?>">
<!-- Spit out icon if present -->
<?php if ($menuItem->getIconClass() != ''): ?>
<span class="<?php echo $menuItem->getIconClass(); ?>"> </span>
<?php endif; ?>
<?php echo $menuItem->getLabel(); ?>
</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
</ul>