Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 1
<?php
2
$headLabel = empty($headLabel) ? $spTextPanel['System Settings'] : $headLabel;
3
echo showSectionHead($headLabel);
4
 
5
// if saved successfully
6
if (!empty($saved)) {
7
    showSuccessMsg($spTextSettings['allsettingssaved'], false);
8
}
9
 
10
// save process failed
11
if (!empty($errorMsg)) {
12
    echo showErrorMsg($errorMsg, false);
13
}
14
 
15
// help text to get MOZ account
16
if ($category == "moz") {
17
	?>
18
	<div id="topnewsbox" style="margin-bottom: 20px;">
19
		<a class="bold_link" href="https://moz.com/checkout/api" target="_blank">
20
			<?php echo $spTextSettings['click-to-get-moz-account']; ?> &gt;&gt;
21
		</a>
22
	</div>
23
	<?php
24
} else if ($category == "google") {
25
	?>
26
	<div id="topnewsbox">
27
		<a class="bold_link" href="https://support.google.com/googleapi/answer/6158862?hl=en" target="_blank">
28
			<?php echo $spTextSettings['click-to-get-google-api-key']; ?> &gt;&gt;
29
		</a>
30
	</div>
31
	<div id="topnewsbox" style="margin-bottom: 20px;">
32
		<a class="bold_link" href="<?php echo SP_HELP_LINK?>user_guide/settings.html#google-oauth2-credentials" target="_blank">
33
			<?php echo $spTextSettings['click-to-get-google-api-client-id']; ?> &gt;&gt;
34
		</a>
35
	</div>
36
	<?php
37
}
38
?>
39
<form id="updateSettings">
40
<input type="hidden" value="update" name="sec">
41
<input type="hidden" value="<?php echo $category?>" name="category">
42
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
43
	<tr class="listHead">
44
		<td width='30%'><?php echo $headLabel?></td>
45
		<td>&nbsp;</td>
46
	</tr>
47
	<?php
48
	foreach( $list as $listInfo){
49
		switch($listInfo['set_type']){
50
			case "small":
51
				$width = 100;
52
				break;
53
 
54
			case "bool":
55
				if(empty($listInfo['set_val'])){
56
					$selectYes = "";
57
					$selectNo = "selected";
58
				}else{
59
					$selectYes = "selected";
60
					$selectNo = "";
61
				}
62
				break;
63
 
64
			case "medium":
65
				$width = 300;
66
				break;
67
 
68
			case "large":
69
			case "text":
70
			    $width = 'large';
71
				break;
72
		}
73
 
74
		// sp demo settings
75
		$demoCheckArr = array(
76
			'SP_API_KEY', 'API_SECRET', 'SP_SMTP_PASSWORD', 'SP_MOZ_API_ACCESS_ID', 'SP_MOZ_API_SECRET', 'SP_GOOGLE_API_KEY',
77
			'SP_GOOGLE_API_CLIENT_ID', 'SP_GOOGLE_API_CLIENT_SECRET', 'SP_GOOGLE_ANALYTICS_TRACK_CODE'
78
		);
79
		if (SP_DEMO && in_array($listInfo['set_name'], $demoCheckArr)) {
80
			$listInfo['set_val'] = "********";
81
		}
82
 
83
		?>
84
		<tr>
85
			<td class="td_left_col">
86
				<?php
87
				if ($listInfo['set_name'] == 'SP_PAYMENT_CURRENCY') {
88
					echo $spTextSubscription["Currency"] . ":";
89
				} else {
90
					echo $spTextSettings[$listInfo['set_name']] . ":";
91
				}
92
				?>
93
			</td>
94
			<td class="td_right_col">
95
				<?php if($listInfo['set_type'] != 'text'){?>
96
					<?php if($listInfo['set_type'] == 'bool'){?>
97
						<select  name="<?php echo $listInfo['set_name']?>">
98
							<option value="1" <?php echo $selectYes?>><?php echo $spText['common']['Yes']?></option>
99
							<option value="0" <?php echo $selectNo?>><?php echo $spText['common']['No']?></option>
100
						</select>
101
					<?php }else{?>
102
						<?php if($listInfo['set_name'] == 'SP_DEFAULTLANG') {?>
103
							<select name="<?php echo $listInfo['set_name']?>">
104
								<?php
105
								foreach ($langList as $langInfo) {
106
									$selected = ($langInfo['lang_code'] == $listInfo['set_val']) ? "selected" : "";
107
									?>
108
									<option value="<?php echo $langInfo['lang_code']?>" <?php echo $selected?>><?php echo $langInfo['lang_name']?></option>
109
									<?php
110
								}
111
								?>
112
							</select>
113
						<?php } else if($listInfo['set_name'] == 'SP_TIME_ZONE') {?>
114
							<select name="<?php echo $listInfo['set_name']?>">
115
								<?php
116
								$listInfo['set_val'] = empty($listInfo['set_val']) ? ini_get('date.timezone') : $listInfo['set_val'];
117
								foreach ($timezoneList as $timezoneInfo) {
118
									$selected = ($timezoneInfo['timezone_name'] == $listInfo['set_val']) ? "selected" : "";
119
									?>
120
									<option value="<?php echo $timezoneInfo['timezone_name']?>" <?php echo $selected?>><?php echo $timezoneInfo['timezone_label']?></option>
121
									<?php
122
								}
123
								?>
124
							</select>
125
						<?php } else if ($listInfo['set_name'] == 'SP_PAYMENT_CURRENCY') {?>
126
							<select  name="<?php echo $listInfo['set_name']?>">
127
								<?php
128
								foreach ($currencyList as $currencyInfo) {
129
									$selectedVal = ($listInfo['set_val'] == $currencyInfo['iso_code']) ? "selected" : "";
130
									?>
131
									<option value="<?php echo $currencyInfo['iso_code']; ?>" <?php echo $selectedVal; ?>><?php echo $currencyInfo['name']; ?></option>
132
									<?php
133
								}
134
								?>
135
							</select>
136
						<?php } else {
137
							$passTypeList = array('SP_SMTP_PASSWORD', 'API_SECRET');
138
						    $type = in_array($listInfo['set_name'], $passTypeList) ? "password" : "text";
139
						    $styleOpt = ($width == 'large') ? "class='form-control'" : "style='width: $width"."px'"
140
						    ?>
141
							<input type="<?php echo $type?>" name="<?php echo $listInfo['set_name']?>" value="<?php echo stripslashes($listInfo['set_val'])?>" <?php echo $styleOpt?>>
142
							<?php if ($listInfo['set_name'] == 'SP_MOZ_API_SECRET') {?>
143
								<div style="padding: 10px 6px;">
144
									<a href="javascript:void(0);" onclick="checkMozConnection('settings.php?sec=checkMozCon', 'show_conn_res')" style="text-decoration: none;"><?php echo $spTextSettings['Verify connection']; ?> &gt;&gt;</a>
145
								</div>
146
								<div id="show_conn_res" style="padding: 10px 6px;"></div>
147
							<?php } else if ($listInfo['set_name'] == 'SP_GOOGLE_API_KEY') {?>
148
								<div style="padding: 10px 6px;">
149
									<a href="javascript:void(0);" onclick="checkGoogleAPIConnection('settings.php?sec=checkGoogleAPI', 'show_conn_res')" style="text-decoration: none;"><?php echo $spTextSettings['Verify connection']; ?> &gt;&gt;</a>
150
								</div>
151
								<div id="show_conn_res" style="padding: 10px 6px;"></div>
152
							<?php }?>
153
 
154
						<?php }?>
155
					<?php }?>
156
				<?php }else{?>
157
					<textarea name="<?php echo $listInfo['set_name']?>" class="form-control"><?php echo stripslashes($listInfo['set_val'])?></textarea>
158
				<?php }?>
159
			</td>
160
		</tr>
161
		<?php
162
	}
163
 
164
	if ($category == "google") {
165
		?>
166
		<tr class="white_row">
167
			<td class="td_left_col"><?php echo $spTextSettings["Authorised redirect URI"]?></td>
168
			<td class="td_right_col"><?php echo SP_WEBPATH . "/admin-panel.php?sec=connections&action=connect_return&category=google"?></td>
169
		</tr>
170
		<?php
171
	}
172
	?>
173
	<tr class="blue_row">
174
		<td class="tab_left_bot_noborder"></td>
175
		<td class="tab_right_bot"></td>
176
	</tr>
177
	<tr class="listBot">
178
		<td class="left" colspan="1"></td>
179
		<td class="right"></td>
180
	</tr>
181
</table>
182
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="actionSec">
183
	<tr>
184
    	<td style="padding-top: 6px;text-align:right;">
185
    		<a onclick="scriptDoLoad('settings.php?category=<?php echo $category?>', 'content', 'layout=ajax')" href="javascript:void(0);" class="actionbut">
186
         		<?php echo $spText['button']['Cancel']?>
187
         	</a>&nbsp;
188
         	<?php $actFun = SP_DEMO ? "alertDemoMsg()" : "confirmSubmit('settings.php', 'updateSettings', 'content')"; ?>
189
         	<a onclick="<?php echo $actFun?>" href="javascript:void(0);" class="actionbut">
190
         		<?php echo $spText['button']['Proceed']?>
191
         	</a>
192
    	</td>
193
	</tr>
194
</table>
195
</form>