Browse Source

Template fixes: a form tag not needed and indentation

Signed-off-by: emanuele <emanuele45@gmail.com>
emanuele 12 years ago
parent
commit
5d25d9a5fc
1 changed files with 100 additions and 101 deletions
  1. 100 101
      Themes/default/ManageBans.template.php

+ 100 - 101
Themes/default/ManageBans.template.php

@@ -31,113 +31,112 @@ function template_ban_edit()
 	if (!empty($context['error_messages']))
 	{
 		echo '
-				<div class="errorbox">
-					<strong>', $txt['ban_errors_detected'], '</strong>
-					<ul>';
+			<div class="errorbox">
+				<strong>', $txt['ban_errors_detected'], '</strong>
+				<ul>';
 
 		foreach ($context['error_messages'] as $error)
 			echo '
-						<li class="error">', $error, '</li>';
+					<li class="error">', $error, '</li>';
 
 		echo '
-					</ul>
-				</div>';
+				</ul>
+			</div>';
 	}
 
 	echo '
 			<div class="content">
-				<form action="', $scripturl, '?action=admin;area=ban;sa=edit', !empty($context['ban_suggestions']['member']['id']) ? ';u=' . $context['ban_suggestions']['member']['id'] : '', '" method="post" accept-charset="', $context['character_set'], '" onsubmit="if (this.ban_name.value == \'\') {alert(\'', $txt['ban_name_empty'], '\'); return false;} if (this.partial_ban.checked &amp;&amp; !(this.cannot_post.checked || this.cannot_register.checked || this.cannot_login.checked)) {alert(\'', $txt['ban_restriction_empty'], '\'); return false;}">
-					<dl class="settings">
-						<dt id="ban_name_label">
-							<strong>', $txt['ban_name'], ':</strong>
-						</dt>
-						<dd>
-							<input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60" class="input_text" />
-						</dd>';
-
-	if (isset($context['ban']['reason']))
-		echo '
-					<dt>
-						<strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br />
-						<span class="smalltext">', $txt['ban_reason_desc'], '</span>
+				<dl class="settings">
+					<dt id="ban_name_label">
+						<strong>', $txt['ban_name'], ':</strong>
 					</dt>
 					<dd>
-						<textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea>
+						<input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60" class="input_text" />
 					</dd>';
 
+	if (isset($context['ban']['reason']))
+		echo '
+				<dt>
+					<strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br />
+					<span class="smalltext">', $txt['ban_reason_desc'], '</span>
+				</dt>
+				<dd>
+					<textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea>
+				</dd>';
+
 	if (isset($context['ban']['notes']))
 		echo '
-					<dt>
-						<strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br />
-						<span class="smalltext">', $txt['ban_notes_desc'], '</span>
-					</dt>
-					<dd>
-						<textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea>
-					</dd>';
+				<dt>
+					<strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br />
+					<span class="smalltext">', $txt['ban_notes_desc'], '</span>
+				</dt>
+				<dd>
+					<textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea>
+				</dd>';
 
 	echo '
-					</dl>
-					<fieldset class="ban_settings floatleft">
-						<legend>
-							', $txt['ban_expiration'], '
-						</legend>
-						<input type="radio" name="expiration" value="never" id="never_expires" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'never' ? ' checked="checked"' : '', ' class="input_radio" /> <label for="never_expires">', $txt['never'], '</label><br />
-						<input type="radio" name="expiration" value="one_day" id="expires_one_day" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'one_day' ? ' checked="checked"' : '', ' class="input_radio" /> <label for="expires_one_day">', $txt['ban_will_expire_within'], '</label>: <input type="text" name="expire_date" id="expire_date" size="3" value="', $context['ban']['expiration']['days'], '" class="input_text" /> ', $txt['ban_days'], '<br />
-						<input type="radio" name="expiration" value="expired" id="already_expired" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'expired' ? ' checked="checked"' : '', ' class="input_radio" /> <label for="already_expired">', $txt['ban_expired'], '</label>
-					</fieldset>
-					<fieldset class="ban_settings floatright">
-						<legend>
-							', $txt['ban_restriction'], '
-						</legend>
-						<input type="radio" name="full_ban" id="full_ban" value="1" onclick="fUpdateStatus();"', $context['ban']['cannot']['access'] ? ' checked="checked"' : '', ' class="input_radio" /> <label for="full_ban">', $txt['ban_full_ban'], '</label><br />
-						<input type="radio" name="full_ban" id="partial_ban" value="0" onclick="fUpdateStatus();"', !$context['ban']['cannot']['access'] ? ' checked="checked"' : '', ' class="input_radio" /> <label for="partial_ban">', $txt['ban_partial_ban'], '</label><br />
-						<input type="checkbox" name="cannot_post" id="cannot_post" value="1"', $context['ban']['cannot']['post'] ? ' checked="checked"' : '', ' class="ban_restriction input_radio" /> <label for="cannot_post">', $txt['ban_cannot_post'], '</label> (<a href="', $scripturl, '?action=helpadmin;help=ban_cannot_post" onclick="return reqWin(this.href);">?</a>)<br />
-						<input type="checkbox" name="cannot_register" id="cannot_register" value="1"', $context['ban']['cannot']['register'] ? ' checked="checked"' : '', ' class="ban_restriction input_radio" /> <label for="cannot_register">', $txt['ban_cannot_register'], '</label><br />
-						<input type="checkbox" name="cannot_login" id="cannot_login" value="1"', $context['ban']['cannot']['login'] ? ' checked="checked"' : '', ' class="ban_restriction input_radio" /> <label for="cannot_login">', $txt['ban_cannot_login'], '</label><br />
-					</fieldset>
-					<br class="clear_right" />';
+				</dl>
+				<fieldset class="ban_settings floatleft">
+					<legend>
+						', $txt['ban_expiration'], '
+					</legend>
+					<input type="radio" name="expiration" value="never" id="never_expires" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'never' ? ' checked="checked"' : '', ' class="input_radio" /> <label for="never_expires">', $txt['never'], '</label><br />
+					<input type="radio" name="expiration" value="one_day" id="expires_one_day" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'one_day' ? ' checked="checked"' : '', ' class="input_radio" /> <label for="expires_one_day">', $txt['ban_will_expire_within'], '</label>: <input type="text" name="expire_date" id="expire_date" size="3" value="', $context['ban']['expiration']['days'], '" class="input_text" /> ', $txt['ban_days'], '<br />
+					<input type="radio" name="expiration" value="expired" id="already_expired" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'expired' ? ' checked="checked"' : '', ' class="input_radio" /> <label for="already_expired">', $txt['ban_expired'], '</label>
+				</fieldset>
+				<fieldset class="ban_settings floatright">
+					<legend>
+						', $txt['ban_restriction'], '
+					</legend>
+					<input type="radio" name="full_ban" id="full_ban" value="1" onclick="fUpdateStatus();"', $context['ban']['cannot']['access'] ? ' checked="checked"' : '', ' class="input_radio" /> <label for="full_ban">', $txt['ban_full_ban'], '</label><br />
+					<input type="radio" name="full_ban" id="partial_ban" value="0" onclick="fUpdateStatus();"', !$context['ban']['cannot']['access'] ? ' checked="checked"' : '', ' class="input_radio" /> <label for="partial_ban">', $txt['ban_partial_ban'], '</label><br />
+					<input type="checkbox" name="cannot_post" id="cannot_post" value="1"', $context['ban']['cannot']['post'] ? ' checked="checked"' : '', ' class="ban_restriction input_radio" /> <label for="cannot_post">', $txt['ban_cannot_post'], '</label> (<a href="', $scripturl, '?action=helpadmin;help=ban_cannot_post" onclick="return reqWin(this.href);">?</a>)<br />
+					<input type="checkbox" name="cannot_register" id="cannot_register" value="1"', $context['ban']['cannot']['register'] ? ' checked="checked"' : '', ' class="ban_restriction input_radio" /> <label for="cannot_register">', $txt['ban_cannot_register'], '</label><br />
+					<input type="checkbox" name="cannot_login" id="cannot_login" value="1"', $context['ban']['cannot']['login'] ? ' checked="checked"' : '', ' class="ban_restriction input_radio" /> <label for="cannot_login">', $txt['ban_cannot_login'], '</label><br />
+				</fieldset>
+				<br class="clear_right" />';
 
 	if (!empty($context['ban_suggestions']))
 	{
 		echo '
-					<fieldset>
-						<legend>
-							', $txt['ban_triggers'], '
-						</legend>
-						<dl class="settings">
-							<dt>
-								<input type="checkbox" name="ban_suggestions[]" id="main_ip_check" value="main_ip" class="input_check" ', !empty($context['ban_suggestions']['main_ip']) ? 'checked="checked" ' : '', '/>
-								<label for="main_ip_check">', $txt['ban_on_ip'], '</label>
-							</dt>
-							<dd>
-								<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;" class="input_text" />
-							</dd>';
+				<fieldset>
+					<legend>
+						', $txt['ban_triggers'], '
+					</legend>
+					<dl class="settings">
+						<dt>
+							<input type="checkbox" name="ban_suggestions[]" id="main_ip_check" value="main_ip" class="input_check" ', !empty($context['ban_suggestions']['main_ip']) ? 'checked="checked" ' : '', '/>
+							<label for="main_ip_check">', $txt['ban_on_ip'], '</label>
+						</dt>
+						<dd>
+							<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;" class="input_text" />
+						</dd>';
 
 		if (empty($modSettings['disableHostnameLookup']))
 			echo '
-							<dt>
-								<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname" class="input_check" ', !empty($context['ban_suggestions']['hostname']) ? 'checked="checked" ' : '', '/>
-								<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
-							</dt>
-							<dd>
-								<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;" class="input_text" />
-							</dd>';
+						<dt>
+							<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname" class="input_check" ', !empty($context['ban_suggestions']['hostname']) ? 'checked="checked" ' : '', '/>
+							<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
+						</dt>
+						<dd>
+							<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;" class="input_text" />
+						</dd>';
 
 		echo '
-							<dt>
-								<input type="checkbox" name="ban_suggestions[]" id="email_check" value="email" class="input_check" ', !empty($context['ban_suggestions']['email']) ? 'checked="checked" ' : '', '/>
-								<label for="email_check">', $txt['ban_on_email'], '</label>
-							</dt>
-							<dd>
-								<input type="text" name="email" value="', $context['ban_suggestions']['email'], '" size="44" onfocus="document.getElementById(\'email_check\').checked = true;" class="input_text" />
-							</dd>
-							<dt>
-								<input type="checkbox" name="ban_suggestions[]" id="user_check" value="user" class="input_check" ', !empty($context['ban_suggestions']['user']) ||  isset($context['ban']['from_user']) ? 'checked="checked" ' : '', '/>
-								<label for="user_check">', $txt['ban_on_username'], '</label>:
-							</dt>
-							<dd>
-								<input type="text" ', isset($context['ban']['from_user']) ? 'readonly="readonly" value="' . $context['ban_suggestions']['member']['name'] . '"' : ' value=""', ' name="user" id="user" size="44" class="input_text" />
-							</dd>';
+						<dt>
+							<input type="checkbox" name="ban_suggestions[]" id="email_check" value="email" class="input_check" ', !empty($context['ban_suggestions']['email']) ? 'checked="checked" ' : '', '/>
+							<label for="email_check">', $txt['ban_on_email'], '</label>
+						</dt>
+						<dd>
+							<input type="text" name="email" value="', $context['ban_suggestions']['email'], '" size="44" onfocus="document.getElementById(\'email_check\').checked = true;" class="input_text" />
+						</dd>
+						<dt>
+							<input type="checkbox" name="ban_suggestions[]" id="user_check" value="user" class="input_check" ', !empty($context['ban_suggestions']['user']) ||  isset($context['ban']['from_user']) ? 'checked="checked" ' : '', '/>
+							<label for="user_check">', $txt['ban_on_username'], '</label>:
+						</dt>
+						<dd>
+							<input type="text" ', isset($context['ban']['from_user']) ? 'readonly="readonly" value="' . $context['ban_suggestions']['member']['name'] . '"' : ' value=""', ' name="user" id="user" size="44" class="input_text" />
+						</dd>';
 
 		if (!empty($context['ban_suggestions']['message_ips']))
 		{
@@ -149,12 +148,12 @@ function template_ban_edit()
 			$count = 0;
 			foreach ($context['ban_suggestions']['message_ips'] as $ip)
 				echo '
-							<dt>
-								<input type="checkbox" id="ban_suggestions_ips_m_', $count, '" name="ban_suggestions[ips_m][]" ', !empty($context['ban_suggestions']['ips_m']) && in_array($ip, $context['ban_suggestions']['ips_m']) ? 'checked="checked" ' : '', 'value="', $ip, '" class="input_check" />
-							</dt>
-							<dd>
-								<label for="ban_suggestions_ips_m_', $count++, '">', $ip, '</label>
-							</dd>';
+						<dt>
+							<input type="checkbox" id="ban_suggestions_ips_m_', $count, '" name="ban_suggestions[ips_m][]" ', !empty($context['ban_suggestions']['ips_m']) && in_array($ip, $context['ban_suggestions']['ips_m']) ? 'checked="checked" ' : '', 'value="', $ip, '" class="input_check" />
+						</dt>
+						<dd>
+							<label for="ban_suggestions_ips_m_', $count++, '">', $ip, '</label>
+						</dd>';
 		}
 
 		if (!empty($context['ban_suggestions']['error_ips']))
@@ -167,12 +166,12 @@ function template_ban_edit()
 			$count = 0;
 			foreach ($context['ban_suggestions']['error_ips'] as $ip)
 				echo '
-							<dt>
-								<input type="checkbox" id="ban_suggestions_ips_e_', $count, '" name="ban_suggestions[ips_e][]" ', !empty($context['ban_suggestions']['ips_e']) && in_array($ip, $context['ban_suggestions']['ips_e']) ? 'checked="checked" ' : '', 'value="', $ip, '" class="input_check" />
-							</dt>
-							<dd>
-								<label for="ban_suggestions_ips_m_', $count++, '">', $ip, '</label>
-							</dd>';
+						<dt>
+							<input type="checkbox" id="ban_suggestions_ips_e_', $count, '" name="ban_suggestions[ips_e][]" ', !empty($context['ban_suggestions']['ips_e']) && in_array($ip, $context['ban_suggestions']['ips_e']) ? 'checked="checked" ' : '', 'value="', $ip, '" class="input_check" />
+						</dt>
+						<dd>
+							<label for="ban_suggestions_ips_m_', $count++, '">', $ip, '</label>
+						</dd>';
 		}
 
 		echo '
@@ -181,18 +180,18 @@ function template_ban_edit()
 	}
 
 	echo '
-						<input type="submit" name="', $context['ban']['is_new'] ? 'add_ban' : 'modify_ban', '" value="', $context['ban']['is_new'] ? $txt['ban_add'] : $txt['ban_modify'], '" class="button_submit" />
-						<input type="hidden" name="old_expire" value="', $context['ban']['expiration']['days'], '" />
-						<input type="hidden" name="bg" value="', $context['ban']['id'], '" />
-						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
-						<input type="hidden" name="', $context['admin-bet_token_var'], '" value="', $context['admin-bet_token'], '" />
-				</div>
-			</form>';
+				<input type="submit" name="', $context['ban']['is_new'] ? 'add_ban' : 'modify_ban', '" value="', $context['ban']['is_new'] ? $txt['ban_add'] : $txt['ban_modify'], '" class="button_submit" />
+				<input type="hidden" name="old_expire" value="', $context['ban']['expiration']['days'], '" />
+				<input type="hidden" name="bg" value="', $context['ban']['id'], '" />
+				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+				<input type="hidden" name="', $context['admin-bet_token_var'], '" value="', $context['admin-bet_token'], '" />
+			</div>
+		</form>';
 
 	if (!$context['ban']['is_new'] && empty($context['ban_suggestions']))
 	{
 		echo '
-			<br />';
+		<br />';
 		template_show_list('ban_items');
 	}