Location: PHPKode > projects > Aratix > admin/templates/user_edit.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"><span style="font-weight: bold;">{$user_data.login}</span> ({i18n s="core_no_changeable"})</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_name"}</td><td class="user_value"><input type="text" value="{$user_data.name}" name="name" class="user" /></td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_last_name"}</td><td class="user_value"><input type="text" value="{$user_data.last_name}" name="last_name" class="user" /></td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_short_name"}</td><td class="user_value"><input type="text" value="{$user_data.short_name}" 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" value="{$user_data.email}" name="email" class="user" /></td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_password"}</td><td class="user_value">
				<button type="button" onclick="generate_password()" id="button1" class="user">{i18n s="admin_user_generate_password"}</button>
				<button type="button" onclick="generate_password('confirm')" disabled id="button2" class="user">{i18n s="admin_user_generate_password_confirm"}</button>
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_groups"}</td><td class="user_value">
			{if $user_id eq 1}
				<div>
					<span style="font-weight: bold;">{i18n s="core_all"}</span> ({i18n s="core_no_changeable"})
				</div>
			{else}
				<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} {* Layer für Auswahl durchlaufen *}
						<input type="checkbox" name="{$group.id}" id="groups_{$smarty.foreach.groups.iteration}" onmouseover="change_display('block', 'groups')"
							{foreach from=$all_groups item=act_group name=group} {* feststellen, ob Kategorie aktiviert ist *}
								{if $act_group eq $group.id} checked{/if}{if $group.id eq "99999"} onchange="change_radio('groups', '{$smarty.foreach.groups.total}')"{/if}
							{/foreach}
						>&nbsp;{$group.name}<br />
					{/foreach}
				</div>
			{/if}
			</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}"{if $language.id eq $user_data.language} selected{/if}>{$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}"{if $layout.name eq $user_data.layout} selected{/if}>{$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">
			{if $user_id eq 1}
				<div>
					<span style="font-weight: bold;">{i18n s="core_all"}</span> ({i18n s="core_no_changeable"})
				</div>
			{else}
				<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')"
							{foreach from=$group_admin item=act_group name=group} {* feststellen, ob Kategorie aktiviert ist *}
								{if $act_group eq $group.id} checked{/if}{if $group.id eq "99999"} onchange="change_radio('group_admin', '{$smarty.foreach.group_admin.total}')"{/if}
							{/foreach}
						>&nbsp;{$group.name}<br />
					{/foreach}
				</div>
			{/if}
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_page_admin"}</td><td class="user_value">
			{if $user_id eq 1}
				<div>
					<span style="font-weight: bold;">{i18n s="core_all"}</span> ({i18n s="core_no_changeable"})
				</div>
			{else}
				<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')"
							{foreach from=$page_admin item=act_page name=page} {* feststellen, ob Kategorie aktiviert ist *}
								{if $act_group eq $group.id} checked{/if}{if $group.id eq "99999"} onchange="change_radio('groups', '{$smarty.foreach.pages.total}')"{/if}
							{/foreach}
						>&nbsp;{$page.menu_text}<br />
					{/foreach}
				</div>
			{/if}
			</td>
		</tr><tr>
			<td class="user_text">{i18n s="admin_user_block_admin"}</td><td class="user_value">
			{if $user_id eq 1}
				<div>
					<span style="font-weight: bold;">{i18n s="core_all"}</span> ({i18n s="core_no_changeable"})
				</div>
			{else}
				<div onclick="change_display('block', 'block')" style="cursor: pointer;">
					{i18n s="core_select"}
				</div>
			{/if}
				<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')"
							{foreach from=$block_admin item=act_block name=block} {* feststellen, ob Kategorie aktiviert ist *}
								{if $act_group eq $group.id} checked{/if}{if $group.id eq "99999"} onchange="change_radio('groups', '{$smarty.foreach.blocks.total}')"{/if}
							{/foreach}
						>&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 $user_id eq 1}
				<div>
					<span style="font-weight: bold;">{i18n s="core_all"}</span> ({i18n s="core_no_changeable"})
				</div>
			{elseif $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')"
							{foreach from=$module_admin item=act_module name=module} {* feststellen, ob Kategorie aktiviert ist *}
								{if $act_group eq $group.id} checked{/if}{if $group.id eq "99999"} onchange="change_radio('groups', '{$smarty.foreach.modules.total}')"{/if}
							{/foreach}
						>&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 $user_id eq 1}
				<div>
					<span style="font-weight: bold;">{i18n s="core_all"}</span> ({i18n s="core_no_changeable"})
				</div>
			{elseif $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')"
							{foreach from=$plugin_admin item=act_plugin name=plugin} {* feststellen, ob Kategorie aktiviert ist *}
								{if $act_group eq $group.id} checked{/if}{if $group.id eq "99999"} onchange="change_radio('groups', '{$smarty.foreach.plugins.total}')"{/if}
							{/foreach}
						>&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">
			{if $user_id eq 1}
				<div>
					<span style="font-weight: bold;">{i18n s="core_all"}</span> ({i18n s="core_no_changeable"})
				</div>
			{else}
				<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')"
							{foreach from=$category_admin item=act_category name=category} {* feststellen, ob Kategorie ... *}
								{if $act_group eq $group.id} checked{/if}{if $group.id eq "99999"} onchange="change_radio('groups', '{$smarty.foreach.categorys.total}')"{/if}
							{/foreach}
						>&nbsp;{$category.name}<br />
					{/foreach}
				</div>
			{/if}
			</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="edit" />
<input type="hidden" name="id" value="{$user_id}" />
</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++){
			eval("document.getElementById('" + id + "_" + count + "').disabled = dis");
		}
	}
}
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