Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 1
<?php
2
echo showSectionHead($spTextPanel['User Type Settings']);
3
$actionLink = "user-types-manager.php?plugin_id=$pluginId&class_name=$className&sec=edit_plugin_user_type_settings";
4
$changeUserTypeAction = "doLoad('user_type_id', '$actionLink', 'content')";
5
$actionLink .= "&user_type_id=$userTypeId";
6
 
7
// if saved successfully
8
if (!empty($saved)) {
9
	showSuccessMsg($spTextSettings['allsettingssaved'], false);
10
}
11
 
12
// save process failed
13
if (!empty($errorMsg)) {
14
	echo showErrorMsg($errorMsg, false);
15
}
16
?>
17
<form id="editPluginUserType">
18
<input type="hidden" name="sec" value="edit_plugin_user_type_settings"/>
19
<input type="hidden" name="plugin_id" value="<?php echo $pluginId?>"/>
20
<input type="hidden" name="class_name" value="<?php echo $className?>"/>
21
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
22
	<tr class="listHead">
23
		<td class="left" width='30%'><?php echo $spTextPanel['User Type Settings']?></td>
24
		<td class="right">&nbsp;</td>
25
	</tr>
26
 
27
	<tr class="white_row">
28
		<td class="td_left_col"><?php echo $spText['login']['User Type']?>:</td>
29
		<td class="td_right_col">
30
			<select name="user_type_id" id="user_type_id" onchange="<?php echo $changeUserTypeAction?>">
31
				<?php foreach ($userTypeList as $key => $val) {?>
32
					<?php if ($userTypeId == $val['id']) {?>
33
						<option value="<?php echo $val['id']?>" selected><?php echo $val['user_type']?></option>
34
					<?php } else {?>
35
						<option value="<?php echo $val['id']?>"><?php echo $val['user_type']?></option>
36
					<?php }?>
37
				<?php }?>
38
			</select>
39
		</td>
40
	</tr>
41
 
42
	<?php
43
	foreach ($specColList as $specCol => $specColInfo) {
44
 
45
		$styleClass = ($i++ % 2) ? "blue_row" : "white_row";
46
		switch($specColInfo['field_type']){
47
 
48
			case "small":
49
				$width = 40;
50
				break;
51
 
52
			case "bool":
53
				if(empty($specColInfo['spec_value'])){
54
					$selectYes = "";
55
					$selectNo = "selected";
56
				}else{
57
					$selectYes = "selected";
58
					$selectNo = "";
59
				}
60
				break;
61
 
62
			case "medium":
63
				$width = 200;
64
				break;
65
 
66
			case "large":
67
			case "text":
68
				$width = 500;
69
				break;
70
		}
71
		?>
72
		<tr class="<?php echo $styleClass?>">
73
			<td class="td_left_col"><?php echo $specText[$specCol]; ?>:</td>
74
			<td class="td_right_col">
75
				<?php if ($specColInfo['field_type'] == 'bool') {?>
76
					<select  name="<?php echo $specCol?>">
77
						<option value="1" <?php echo $selectYes?>><?php echo $spText['common']['Yes']?></option>
78
						<option value="0" <?php echo $selectNo?>><?php echo $spText['common']['No']?></option>
79
					</select>
80
				<?php } else if ($specColInfo['field_type'] == 'select') {?>
81
					<select name="<?php echo $specCol?>">
82
						<?php
83
						foreach ($specColInfo['options'] as $optVal => $optLabel) {
84
							$selected = ($optVal == $specColInfo['spec_value']) ? " selected" : "";
85
							?>
86
							<option value="<?php echo $optVal?>" <?php echo $selected?>><?php echo $optLabel?></option>
87
							<?php
88
						}?>
89
					</select>
90
				<?php } else if ($specColInfo['field_type'] == 'text') {?>
91
					<textarea name="<?php echo $specCol?>" style='width:<?php echo $width?>px'><?php echo stripslashes($specColInfo['spec_value'])?></textarea>
92
				<?php } else {?>
93
					<input type="text" name="<?php echo $specCol?>" value="<?php echo stripslashes($specColInfo['spec_value'])?>" style='width:<?php echo $width?>px'>
94
				<?php }?>
95
				<?php echo $errMsg[$specCol]?>
96
			</td>
97
		</tr>
98
	<?php }?>
99
 
100
	<tr class="white_row">
101
		<td class="tab_left_bot_noborder"></td>
102
		<td class="tab_right_bot"></td>
103
	</tr>
104
	<tr class="listBot">
105
		<td class="left" colspan="1"></td>
106
		<td class="right"></td>
107
	</tr>
108
 
109
</table>
110
 
111
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="actionSec">
112
	<tr>
113
    	<td style="padding-top: 6px;text-align:right;">
114
    		<a onclick="scriptDoLoad('<?php echo $actionLink?>', 'content')" href="javascript:void(0);" class="actionbut">
115
         		<?php echo $spText['button']['Cancel']?>
116
         	</a> &nbsp;
117
         	<?php $actFun = SP_DEMO ? "alertDemoMsg()" : "confirmSubmit('user-types-manager.php', 'editPluginUserType', 'content')"; ?>
118
         	<a onclick="<?php echo $actFun?>" href="javascript:void(0);" class="actionbut">
119
         		<?php echo $spText['button']['Proceed']?>
120
         	</a>
121
    	</td>
122
	</tr>
123
</table>
124
</form>