Location: PHPKode > projects > Aratix > aratix/admin/templates/user_add.tpl
<div class="heading">{i18n s="admin_user_edit"}</div>
<div class="content">
<form name="user" action="index.php">
	<table class="user">
		<tr>
			<td class="user_text">{i18n s="admin_user_login"}</td><td class="user_value">
				<input type="text" name="login" class="user_short" />&nbsp;<button class="user" onclick="generate_login()" type="button">{i18n s="core_suggest"}</button>
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_name"}</td><td class="user_value"><input type="text" name="name" class="user" onfocus="generate_short_name()" onkeydown="generate_short_name()" onkeyup="generate_short_name()" /></td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_last_name"}</td><td class="user_value"><input type="text" name="last_name" class="user" onfocus="generate_short_name()" onkeydown="generate_short_name()" onkeyup="generate_short_name()" /></td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_short_name"}</td><td class="user_value"><input type="text" name="short_name" class="user" /></td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_email"}</td><td class="user_value"><input type="text" name="email" class="user" /></td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_groups"}</td><td class="user_value">
				<div onclick="change_display('block', 'groups')" style="cursor: pointer;">
					{i18n s="core_select"}
				</div>
				<div class="user_dropdown" onmouseout="change_display('none', 'groups')" onmouseover="change_display('block', 'groups')" onclick="change_display('block', 'groups')" id="groups">
					{foreach from=$group_list item=group name=groups}
						<input type="checkbox" name="{$group.id}" id="groups_{$smarty.foreach.groups.iteration}" onmouseover="change_display('block', 'groups')"{if $group.id eq "99999"} onchange="change_radio('groups', '{$smarty.foreach.groups.total}')"{/if}{if $group.id eq "3"} checked{/if}>&nbsp;{$group.name}<br />
					{/foreach}
				</div>
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_language"}</td><td class="user_value">
				<select name="language" class="user">
				{foreach from=$language_list item=language name=languages}
					<option value="{$language.id}">{$language.language}</option>
				{/foreach}
				</select>
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_layout"}</td><td class="user_value">
				<select name="layout" class="user">
				{foreach from=$layout_list item=layout name=layouts}
					<option value="{$layout.id}">{$layout.name} - {$layout.description|truncate:100:"..."}</option>
				{/foreach}
				</select>
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_group_admin"}</td><td class="user_value">
				<div onclick="change_display('block', 'group_admin')" style="cursor: pointer;">
					{i18n s="core_select"}
				</div>
				<div class="user_dropdown" onmouseout="change_display('none', 'group_admin')" onmouseover="change_display('block', 'group_admin')" onclick="change_display('block', 'group_admin')" id="group_admin">
					{foreach from=$group_list item=group name=group_admin} {* Layer für Auswahl durchlaufen *}
						<input type="checkbox" name="{$group.id}" id="group_admin_{$smarty.foreach.group_admin.iteration}" onmouseover="change_display('block', 'group_admin')"{if $group.id eq "99999"} onchange="change_radio('group_admin', '{$smarty.foreach.group_admin.total}')"{/if}>&nbsp;{$group.name}<br />
					{/foreach}
				</div>
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_page_admin"}</td><td class="user_value">
				<div onclick="change_display('block', 'page')" style="cursor: pointer;">
					{i18n s="core_select"}
				</div>
				<div class="user_dropdown" onmouseout="change_display('none', 'page')" onmouseover="change_display('block', 'page')" onclick="change_display('block', 'page')" id="page">
					{foreach from=$page_list item=page name=pages} {* Layer für Auswahl durchlaufen *}
						<input type="checkbox" name="{$page.id}" id="page_{$smarty.foreach.pages.iteration}" onmouseover="change_display('block', 'page')">&nbsp;{$page.menu_text}<br />
					{/foreach}
				</div>
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_block_admin"}</td><td class="user_value">
				<div onclick="change_display('block', 'block')" style="cursor: pointer;">
					{i18n s="core_select"}
				</div>
				<div class="user_dropdown" onmouseout="change_display('none', 'block')" onmouseover="change_display('block', 'block')" onclick="change_display('block', 'block')" id="block">
					{foreach from=$block_list item=block name=blocks} {* Layer für Auswahl durchlaufen *}
						<input type="checkbox" name="{$block.id}" id="block_{$smarty.foreach.blocks.iteration}" onmouseover="change_display('block', 'block')">&nbsp;{$block.name}<br />
					{/foreach}
				</div>
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_module_admin"}</td><td class="user_value">
			{if $module_list.1.name eq ""}
				<div>
					{i18n s="admin_user_no_module"}
				</div>
			{else}
				<div onclick="change_display('block', 'module')" style="cursor: pointer;">
					{i18n s="core_select"}
				</div>
				<div class="user_dropdown" onmouseout="change_display('none', 'module')" onmouseover="change_display('block', 'module')" onclick="change_display('block', 'module')" id="module">
					{foreach from=$module_list item=module name=modules} {* Layer für Auswahl durchlaufen *}
						<input type="checkbox" name="{$module.id}" id="module_{$smarty.foreach.modules.iteration}" onmouseover="change_display('block', 'module')">&nbsp;{$module.name}<br />
					{/foreach}
				</div>
			{/if}
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_plugin_admin"}</td><td class="user_value">
			{if $plugin_list.1.name eq ""}
				<div>
					{i18n s="admin_user_no_plugin"}
				</div>
			{else}
				<div onclick="change_display('block', 'plugin')" style="cursor: pointer;">
					{i18n s="core_select"}
				</div>
				<div class="user_dropdown" onmouseout="change_display('none', 'plugin')" onmouseover="change_display('block', 'plugin')" onclick="change_display('block', 'plugin')" id="plugin">
					{foreach from=$plugin_list item=plugin name=plugins} {* Layer für Auswahl durchlaufen *}
						<input type="checkbox" name="{$plugin.id}" id="plugin_{$smarty.foreach.plugins.iteration}" onmouseover="change_display('block', 'plugin')">&nbsp;{$plugin.name}<br />
					{/foreach}
				</div>
			{/if}
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_category_admin"}</td><td class="user_value">
				<div onclick="change_display('block', 'category')" style="cursor: pointer;">
					{i18n s="core_select"}
				</div>
				<div class="user_dropdown" onmouseout="change_display('none', 'category')" onmouseover="change_display('block', 'category')" onclick="change_display('block', 'category')" id="category">
					{foreach from=$category_list item=category name=categorys} {* Layer für Auswahl durchlaufen *}
						<input type="checkbox" name="{$category.id}" id="category_{$smarty.foreach.categorys.iteration}" onmouseover="change_display('block', 'category')">&nbsp;{$category.name}<br />
					{/foreach}
				</div>
			</td>
		</tr><tr>
			<td class="user_button" colspan="2">
				<button type="submit" value="submit" name="submit">{i18n s="core_submit"}</button>
			</td>
		</tr>
</table>
<input type="hidden" name="session" value="{$session}" />
<input type="hidden" name="ident" value="{$ident}" />
<input type="hidden" name="module" value="user" />
<input type="hidden" name="action" value="add" />
</form>
{literal}
<script type="text/javascript">
function change_display(vis,vis_type){
	document.getElementById(vis_type).style.display = vis;
}
function generate_password(conf){
	if(!conf){
		document.getElementById('button1').disabled = true;
		document.getElementById('button2').disabled = false;
	}
	else{
// 		var new_password = "{/literal}{$new_password}{literal}";
// 		alert("Neues Passwort: " + new_password + " -> User-ID: {/literal}{$user_id}{literal}");
		var e_mail = document.user.email.value;

		if(e_mail != "")
			sender = window.open("inc/send_pass.php?{/literal}{$session_string}&user_id={$user_id}&new_pass={$new_password}{literal}&email=" + e_mail);
		else{
			alert("Keine Mailadresse angegeben! Neues Passwort wird nicht zugesendet!");
			sender = window.open("inc/send_pass.php?{/literal}{$session_string}&user_id={$user_id}&new_pass={$new_password}{literal}&email=false");
		}
	}
}
function change_radio(id, num){
	if(num != ""){
		var dis = document.getElementById(id + "_1").checked;

		for(count = 2; count <= num; count++){
			document.getElementById(id + "_" + count).disabled = dis;
		}
	}
}
function generate_short_name(){
	var first_name = document.user.name.value.toLowerCase();
	var last_name = document.user.last_name.value.toLowerCase();

	if(last_name.substr(0, 3) == "sch")
		lastname = last_name.substr(0, 3);
	else
		lastname = last_name.substr(0, 1);

	document.user.short_name.value = first_name.substr(0, 1) + lastname;
}
function generate_login(){
	var first_name = document.user.name.value.toLowerCase();
	var last_name = document.user.last_name.value.toLowerCase();

	if(first_name == "" && last_name == "")
		alert("{/literal}{i18n s="module_config_error_generate_login"}{literal}");
	else
		document.user.login.value = first_name.substr(0, 4) + last_name.substr(0, 4);
}
change_radio('groups', '{/literal}{$smarty.foreach.groups.total}{literal}');
change_radio('user', '{/literal}{$smarty.foreach.user.total}{literal}');
change_radio('page', '{/literal}{$smarty.foreach.pages.total}{literal}');
change_radio('block', '{/literal}{$smarty.foreach.blocks.total}{literal}');
change_radio('module', '{/literal}{$smarty.foreach.modules.total}{literal}');
change_radio('plugin', '{/literal}{$smarty.foreach.plugins.total}{literal}');
change_radio('category', '{/literal}{$smarty.foreach.category.total}{literal}');
</script>
{/literal}













Return current item: Aratix