<commit_before><?php
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines http://www.simplemachines.org
 * @copyright 2014 Simple Machines and individual contributors
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.1 Alpha 1
 */

// The main sub template - for theme administration.
function template_main()
{
	global $context, $settings, $scripturl, $txt, $modSettings;

	echo '
	<div id="admincenter">';

	// Theme install info.
	echo '
		<div class="cat_bar">
		<h3 class="catbg">
			<a href="', $scripturl, '?action=helpadmin;help=themes" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics_hd.png" class="icon" alt="', $txt['help'], '"></a>
			', $txt['themeadmin_title'], '
		</h3>
		</div>
		<div class="information">
			', $txt['themeadmin_explain'], '
		</div>';

	echo '<br>
		<form action="', $scripturl, '?action=admin;area=theme;sa=admin" method="post" accept-charset="', $context['character_set'], '">
			<div class="cat_bar">
				<h3 class="catbg">',
					$txt['settings'], '
				</h3>
			</div>
			<div class="windowbg2">
				<div class="content">
					<dl class="settings">
						<dt>
							<label for="options-theme_allow"> ', $txt['theme_allow'], '</label>
						</dt>
						<dd>
							<input type="checkbox" name="options[theme_allow]" id="options-theme_allow" value="1"', !empty($modSettings['theme_allow']) ? ' checked' : '', ' class="input_check">
						</dd>
						<dt>
							<label for="known_themes_list">', $txt['themeadmin_selectable'], '</label>:
						</dt>
						<dd>
							<div id="known_themes_list">';

	foreach ($context['themes'] as $theme)
		echo '
								<label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', ' class="input_check"> ', $theme['name'], '</label><br>';

		echo '
							</div>
							<a href="javascript:void(0);" onclick="document.getElementById(\'known_themes_list\').style.display=\'block\'; document.getElementById(\'known_themes_link\').style.display = \'none\'; return false; " id="known_themes_link" style="display: none;">[ ', $txt['themeadmin_themelist_link'], ' ]</a>
							<script><!-- // --><![CDATA[
								document.getElementById("known_themes_list").style.display = "none";
								document.getElementById("known_themes_link").style.display = "";
							// ]]></script>
						</dd>
						<dt>
							<label for="theme_guests">', $txt['theme_guests'], ':</label>
						</dt>
						<dd>
							<select name="options[theme_guests]" id="theme_guests">';

	// Put an option for each theme in the select box.
	foreach ($context['themes'] as $theme)
		echo '
								<option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>';

	echo '
							</select>
							<span class="smalltext pick_theme"><a href="', $scripturl, '?action=theme;sa=pick;u=-1;', $context['session_var'], '=', $context['session_id'], '">', $txt['theme_select'], '</a></span>
						</dd>
						<dt>
							<label for="theme_reset">', $txt['theme_reset'], '</label>:
						</dt>
						<dd>
							<select name="theme_reset" id="theme_reset">
								<option value="-1" selected>', $txt['theme_nochange'], '</option>
								<option value="0">', $txt['theme_forum_default'], '</option>';

	// Same thing, this time for changing the theme of everyone.
	foreach ($context['themes'] as $theme)
		echo '
								<option value="', $theme['id'], '">', $theme['name'], '</option>';

	echo '
							</select>
							<span class="smalltext pick_theme"><a href="', $scripturl, '?action=theme;sa=pick;u=0;', $context['session_var'], '=', $context['session_id'], '">', $txt['theme_select'], '</a></span>
						</dd>
					</dl>
					<input type="submit" name="save" value="' . $txt['save'] . '" class="button_submit">
					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
					<input type="hidden" name="', $context['admin-tm_token_var'], '" value="', $context['admin-tm_token'], '">
					<input type="hidden" value="0" name="options[theme_allow]">
				</div>
			</div>
		</form>';

	// Link to simplemachines.org for latest themes and info!
	echo '<commit_msg>! "Allow members to select their own themes" - wrong position Signed-off-by: Antes <<EMAIL>><commit_after><?php
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines http://www.simplemachines.org
 * @copyright 2014 Simple Machines and individual contributors
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.1 Alpha 1
 */

// The main sub template - for theme administration.
function template_main()
{
	global $context, $settings, $scripturl, $txt, $modSettings;

	echo '
	<div id="admincenter">';

	// Theme install info.
	echo '
		<div class="cat_bar">
		<h3 class="catbg">
			<a href="', $scripturl, '?action=helpadmin;help=themes" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics_hd.png" class="icon" alt="', $txt['help'], '"></a>
			', $txt['themeadmin_title'], '
		</h3>
		</div>
		<div class="information">
			', $txt['themeadmin_explain'], '
		</div>';

	echo '<br>
		<form action="', $scripturl, '?action=admin;area=theme;sa=admin" method="post" accept-charset="', $context['character_set'], '">
			<div class="cat_bar">
				<h3 class="catbg">',
					$txt['settings'], '
				</h3>
			</div>
			<div class="windowbg2">
				<div class="content">
					<dl class="settings">
						<dt>
							<label for="options-theme_allow"> ', $txt['theme_allow'], '</label>
						</dt>
						<dd>
							<input type="hidden" value="0" name="options[theme_allow]">
							<input type="checkbox" name="options[theme_allow]" id="options-theme_allow" value="1"', !empty($modSettings['theme_allow']) ? ' checked' : '', ' class="input_check">
						</dd>
						<dt>
							<label for="known_themes_list">', $txt['themeadmin_selectable'], '</label>:
						</dt>
						<dd>
							<div id="known_themes_list">';

	foreach ($context['themes'] as $theme)
		echo '
								<label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', ' class="input_check"> ', $theme['name'], '</label><br>';

		echo '
							</div>
							<a href="javascript:void(0);" onclick="document.getElementById(\'known_themes_list\').style.display=\'block\'; document.getElementById(\'known_themes_link\').style.display = \'none\'; return false; " id="known_themes_link" style="display: none;">[ ', $txt['themeadmin_themelist_link'], ' ]</a>
							<script><!-- // --><![CDATA[
								document.getElementById("known_themes_list").style.display = "none";
								document.getElementById("known_themes_link").style.display = "";
							// ]]></script>
						</dd>
						<dt>
							<label for="theme_guests">', $txt['theme_guests'], ':</label>
						</dt>
						<dd>
							<select name="options[theme_guests]" id="theme_guests">';

	// Put an option for each theme in the select box.
	foreach ($context['themes'] as $theme)
		echo '
								<option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>';

	echo '
							</select>
							<span class="smalltext pick_theme"><a href="', $scripturl, '?action=theme;sa=pick;u=-1;', $context['session_var'], '=', $context['session_id'], '">', $txt['theme_select'], '</a></span>
						</dd>
						<dt>
							<label for="theme_reset">', $txt['theme_reset'], '</label>:
						</dt>
						<dd>
							<select name="theme_reset" id="theme_reset">
								<option value="-1" selected>', $txt['theme_nochange'], '</option>
								<option value="0">', $txt['theme_forum_default'], '</option>';

	// Same thing, this time for changing the theme of everyone.
	foreach ($context['themes'] as $theme)
		echo '
								<option value="', $theme['id'], '">', $theme['name'], '</option>';

	echo '
							</select>
							<span class="smalltext pick_theme"><a href="', $scripturl, '?action=theme;sa=pick;u=0;', $context['session_var'], '=', $context['session_id'], '">', $txt['theme_select'], '</a></span>
						</dd>
					</dl>
					<input type="submit" name="save" value="' . $txt['save'] . '" class="button_submit">
					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
					<input type="hidden" name="', $context['admin-tm_token_var'], '" value="', $context['admin-tm_token'], '">
				</div>
			</div>
		</form>';

	// Link to simplemachines.org for latest themes and info!
	echo '
{'fraction_non_alphanumeric': 0.22891022021456803, 'fraction_numerical': 0.004291360813099943, 'mean_word_length': 4.034678794769755, 'pattern_counts': {'":': 0, '<': 175, '<?xml version=': 0, '>': 173, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5088704', 'n_tokens_mistral': 3573, 'n_tokens_neox': 2898, 'n_words': 598}