{% INCLUDE 'overall_header.html' %}

{% INCLUDEJS 'portal/acp_editor.js' %}
<script type="text/javascript">
// <![CDATA[
/**
* bbCode control by subBlue design [ www.subBlue.com ]
* Includes unixsafe colour palette selector by SHS`
*/

// Startup variables
var imageTag = false;
var theSelection = false;

var bbcodeEnabled = true;
// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
var baseHeight;

var form_name = 'acp_portal_welcome';
var text_name = 'welcome_message';
var load_draft = false;
var upload = false;

// Define the bbCode tags
var bbcode = new Array();
var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'{% for custom_tags in loops.custom_tags %}, {{ custom_tags.BBCODE_NAME }}{% endfor %});
var imageTag = false;

// Helpline messages
var help_line = {
	b: '{{ lang('BBCODE_B_HELP')|escape('js') }}',
	i: '{{ lang('BBCODE_I_HELP')|escape('js') }}',
	u: '{{ lang('BBCODE_U_HELP')|escape('js') }}',
	q: '{{ lang('BBCODE_Q_HELP')|escape('js') }}',
	c: '{{ lang('BBCODE_C_HELP')|escape('js') }}',
	l: '{{ lang('BBCODE_L_HELP')|escape('js') }}',
	o: '{{ lang('BBCODE_O_HELP')|escape('js') }}',
	p: '{{ lang('BBCODE_P_HELP')|escape('js') }}',
	w: '{{ lang('BBCODE_W_HELP')|escape('js') }}',
	a: '{{ lang('BBCODE_A_HELP')|escape('js') }}',
	s: '{{ lang('BBCODE_S_HELP')|escape('js') }}',
	f: '{{ lang('BBCODE_F_HELP')|escape('js') }}',
	e: '{{ lang('BBCODE_E_HELP')|escape('js') }}',
	d: '{{ lang('BBCODE_D_HELP')|escape('js') }}'
	{% for custom_tags in loops.custom_tags %}
		,cb_{{ custom_tags.BBCODE_ID }}: '{{ custom_tags.A_BBCODE_HELPLINE }}'
	{% endfor %}
}

function change_palette()
{
	phpbb.toggleDisplay('colour_palette');
	e = document.getElementById('colour_palette');

	if (e.style.display == 'block')
	{
		document.getElementById('bbpalette').value = '{{ lang('FONT_COLOR_HIDE')|escape('js') }}';
	}
	else
	{
		document.getElementById('bbpalette').value = '{{ lang('FONT_COLOR')|escape('js') }}';
	}
}

// ]]>
</script>

<a name="maincontent"></a>

<h1>{{ lang('TITLE') }}</h1>

<p>{{ lang('TITLE_EXPLAIN') }}</p>

{% if S_ERROR %}
	<div class="errorbox">
		<h3>{{ lang('WARNING') }}</h3>
		<p>{{ ERROR_MSG }}</p>
	</div>
{% endif %}
<form id="acp_portal_config" method="post" action="{{ B3P_U_ACTION }}">
{% if SHOW_MODULE_OPTIONS %}
		<fieldset>
			<legend>{{ lang('MODULE_OPTIONS') }}</legend>
			<dl>
				<dt><label for="module_name">{{ lang('MODULE_NAME') }}{{ lang('COLON') }}</label><br /><span>{{ lang('MODULE_NAME_EXP') }}</span></dt>
				<dd><input id="module_name" type="text" value="{{ MODULE_NAME }}" name="module_name" maxlength="255" size="64" /></dd>
			</dl>
			{% if MODULE_SHOW_IMAGE %}
			<dl>
				<dt><label for="module_image">{{ lang('MODULE_IMAGE') }}{{ lang('COLON') }}</label><br /><span>{{ lang('MODULE_IMAGE_EXP') }}</span></dt>
				<dd><input id="module_image" type="text" value="{{ MODULE_IMAGE }}" name="module_image" maxlength="255" size="64" /></dd>
				{% if MODULE_IMAGE_SRC %}<dd><img src="{{ MODULE_IMAGE_SRC }}" alt="{{ lang('MODULE_IMAGE') }}" /></dd>{% endif %}
			</dl>
			{% if MODULE_IMAGE_SRC %}
			<dl>
				<dt><label for="module_img_width">{{ lang('MODULE_IMAGE_WIDTH') }}{{ lang('COLON') }}</label><br /><span>{{ lang('MODULE_IMAGE_WIDTH_EXP') }}</span></dt>
				<dd><input id="module_img_width" type="number" value="{{ MODULE_IMAGE_WIDTH }}" name="module_img_width" min="1" />&nbsp;{{ lang('PIXEL') }}</dd>
			</dl>
			<dl>
				<dt><label for="module_img_height">{{ lang('MODULE_IMAGE_HEIGHT') }}{{ lang('COLON') }}</label><br /><span>{{ lang('MODULE_IMAGE_HEIGHT_EXP') }}</span></dt>
				<dd><input id="module_img_height" type="number" value="{{ MODULE_IMAGE_HEIGHT }}" name="module_img_height" min="1" />&nbsp;{{ lang('PIXEL') }}</dd>
			</dl>
			{% endif %}
			<dl>
				<dt><label for="module_fa">{{ lang('MODULE_FA') }}{{ lang('COLON') }}</label><br/><span>{{ lang('MODULE_FA_EXP') }}</span></dt>
				<dd><input id="module_fa" type="text" value="{{ MODULE_FA }}" name="module_fa" maxlength="255" size="64"/></dd>
			</dl>
			<dl>
				<dt><label for="module_fa_size">{{ lang('MODULE_FA_SIZE') }}{{ lang('COLON') }}</label><br/><span>{{ lang('MODULE_FA_SIZE_EXP') }}</span></dt>
				<dd><input id="module_fa_size" type="number" value="{{ MODULE_FA_SIZE }}" name="module_fa_size" min="1"/>&nbsp;{{ lang('PIXEL') }}</dd>
			</dl>
			{% endif %}
			<dl>
				<dt><label for="module_reset">{{ lang('MODULE_RESET') }}{{ lang('COLON') }}</label><br /><span style="color: #BC2A4D;">{{ lang('MODULE_RESET_EXP') }}</span></dt>
				<dd><input id="module_reset" type="checkbox" value="1" name="module_reset" /></dd>
			</dl>
			<dl>
				<dt><label for="module_status">{{ lang('MODULE_STATUS') }}{{ lang('COLON') }}</label></dt>
				<dd>
					<label><input type="radio" class="radio" name="module_status" value="1" id="module_status"{% if MODULE_ENABLED %} checked="checked"{% endif %} />{{ lang('YES') }}</label>
					<label><input type="radio" class="radio" name="module_status" value="0"{% if not MODULE_ENABLED %} checked="checked"{% endif %} /> {{ lang('NO') }}</label>
				</dd>
			</dl>
			{% if loops.permission_setting|length %}
			<dl>
				<dt><label for="permission-setting">{{ lang('MODULE_PERMISSIONS') }}{{ lang('COLON') }}</label><br /><span>{{ lang('MODULE_PERMISSIONS_EXP') }}</span></dt>
				<dd>
					<select id="permission-setting" size="10" multiple="multiple" name="permission-setting[]">
						{% for permission_setting in loops.permission_setting %}
						<option value="{{ permission_setting.GROUP_ID }}"{% if permission_setting.SELECTED %}selected="selected"{% endif %}>{{ permission_setting.GROUP_NAME }}</option>
						{% endfor %}
					</select>
				</dd>
			</dl>
			{% endif %}
		</fieldset>
{% endif %}
		{% if S_PREVIEW %}
		<fieldset>
			<legend>{{ lang('ACP_PORTAL_WELCOME_PREVIEW') }}</legend>
		<dl>
			<dt style="border: none; width: 100%;">
				{{ PREVIEW_TEXT }}
			</dt>
		</dl>
		</fieldset>
		{% endif %}
		<fieldset>
			<legend>{{ lang('PORTAL_WELCOME') }}</legend>
		<dl><dt style="display: none;"></dt>
			<dd>
				<div id="colour_palette" style="display: none;">
					<dl style="clear: left;">
						<dt style="border: none;"><label>{{ lang('FONT_COLOR') }}{{ lang('COLON') }}</label></dt>
						<dd></dd>
					</dl>
					<dl style="clear: left;">
						<dt id="color_palette_placeholder" style="border: none;"></dt>
						<dd></dd>
					</dl>
				</div>
				<div id="format-buttons">
					<input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{{ lang('BBCODE_B_HELP') }}" />
					<input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" title="{{ lang('BBCODE_I_HELP') }}" />
					<input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" title="{{ lang('BBCODE_U_HELP') }}" />
					{% if S_BBCODE_QUOTE %}
						<input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" title="{{ lang('BBCODE_Q_HELP') }}" />
					{% endif %}
					<input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" title="{{ lang('BBCODE_C_HELP') }}" />
					<input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" title="{{ lang('BBCODE_L_HELP') }}" />
					<input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" title="{{ lang('BBCODE_O_HELP') }}" />
					<input type="button" class="button2" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" title="{{ lang('BBCODE_LISTITEM_HELP') }}" />
					{% if S_BBCODE_IMG %}
						<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{{ lang('BBCODE_P_HELP') }}" />
					{% endif %}
					{% if S_LINKS_ALLOWED %}
						<input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" title="{{ lang('BBCODE_W_HELP') }}" />
					{% endif %}
					{% if S_BBCODE_FLASH %}
						<input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" title="{{ lang('BBCODE_D_HELP') }}" />
					{% endif %}
					<select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{{ lang('BBCODE_F_HELP') }}">
						<option value="50">{{ lang('FONT_TINY') }}</option>
						<option value="85">{{ lang('FONT_SMALL') }}</option>
						<option value="100" selected="selected">{{ lang('FONT_NORMAL') }}</option>
						{% if not MAX_FONT_SIZE or MAX_FONT_SIZE >= 150 %}
							<option value="150">{{ lang('FONT_LARGE') }}</option>
							{% if not MAX_FONT_SIZE or MAX_FONT_SIZE >= 200 %}
								<option value="200">{{ lang('FONT_HUGE') }}</option>
							{% endif %}
						{% endif %}
					</select>
					<input type="button" class="button2" name="bbpalette" id="bbpalette" value="{{ lang('FONT_COLOR') }}" onclick="change_palette();" title="{{ lang('BBCODE_S_HELP') }}" />
					{% for custom_tags in loops.custom_tags %}
						<input type="button" class="button2" name="addbbcode{{ custom_tags.BBCODE_ID }}" value="{{ custom_tags.BBCODE_TAG }}" onclick="bbstyle({{ custom_tags.BBCODE_ID }})" title="{{ custom_tags.BBCODE_HELPLINE }}" />
					{% endfor %}
				</div>
			</dd>
		</dl>
		<dl>
			<dt>
				<label for="welcome_message">{{ lang('ACP_PORTAL_WELCOME_MESSAGE') }}{{ lang('COLON') }}</label><br />
				<span>{{ lang('ACP_PORTAL_WELCOME_MESSAGE_EXP') }}</span>
			</dt>
			<dd><textarea name="welcome_message" id="welcome_message" cols="6" rows="12">{{ WELCOME_MESSAGE }}</textarea></dd>
		</dl>
{% if S_AUTH %}
	{% for auth_tpl in loops.auth_tpl %}
		{{ auth_tpl.TPL }}
	{% endfor %}
{% endif %}

	<p class="submit-buttons">
		<input class="button2" type="submit" id="preview" name="preview" value="{{ lang('PREVIEW') }}" />&nbsp;
		<input class="button1" type="submit" id="submit" name="submit" value="{{ lang('SUBMIT') }}" />&nbsp;
		<input class="button2" type="reset" id="reset" name="reset" value="{{ lang('RESET') }}" />
	</p>
	{{ S_FORM_TOKEN }}
</fieldset>
</form>

{% INCLUDE 'overall_footer.html' %}