/
setusertemplates.php
74 lines (67 loc) · 2.94 KB
/
setusertemplates.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
<div class="pagetitle h3"><?php printf(gT('Edit theme permissions for user %s'),"<em>".\CHtml::encode($oUser->users_name)."</em>");?></div>
<div class="row">
<div class="col-lg-12">
<p><?php eT("If the user doesn't have global view/read global permission for themes, please select the themes he should be able to use for surveys."); ?></p>
</div>
</div>
<div class="row" style="margin-bottom: 100px">
<div class="col-lg-6 col-lg-offset-3 content-right">
<?php echo CHtml::form(array("admin/user/sa/usertemplates"), 'post', array('name'=>'modtemplaterightsform', 'id'=>'modtemplaterightsform')); ?>
<table id="user-template-permissions" class="table table-striped activecell" style="margin:0 auto;">
<thead>
<tr>
<th>
<?php eT('Theme name');?>
</th>
<th>
<?php eT('Available for surveys');?>
</th>
</tr>
<tr>
<th>
<?php eT('All themes');?>
</th>
<th>
<?php $this->widget('yiiwheels.widgets.switch.WhSwitch', array(
'name' => 'alltemplates',
'id'=>'alltemplates',
'value' => 0,
'onLabel'=>gT('On'),
'offLabel' => gT('Off')));
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="2">
<input type="submit" class="hidden" value="<?php eT('Save settings');?>" />
<input type="hidden" name="action" value="usertemplates" />
<input type="hidden" name="uid" value="<?php echo $oUser->uid;?>" />
</td>
</tr>
</tfoot>
<tbody>
<?php
$templaterights=$data['templaterights'];
$table_row_odd_even = 'odd';
foreach ($data['templates'] as $trow)
{?>
<tr>
<td><?php echo $trow["folder"];?></td>
<td>
<?php $this->widget('yiiwheels.widgets.switch.WhSwitch', array(
'name' => $trow['folder'].'_use',
'id'=>$trow['folder'].'_use',
'value' => isset($templaterights[$trow['folder']]['use'])?$templaterights[$trow['folder']]['use']:0,
'onLabel'=>gT('On'),
'offLabel' => gT('Off')));
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
</div>
</div>