Location: PHPKode > projects > Aratix > admin/templates/extension_overview.tpl
<div class="heading">&Uuml;bersicht für Erweiterungen der Art "{$art}"</div>
<tr class="content">
<form name="extension" action="">
	<table class="extension">
		<tr class="extension_header">
			<td class="extension_name">Name</td>
			<td class="extension_text">Beschreibung</td>
			{if $art ne "Layout"}
				<td class="extension_dropdown">Kategorie</td>
			{/if}
			<td class="extension_dropdown">Gruppen</td>
			{if $menupos_dropdown ne ""}
				<td class="extension_dropdown">Position</td>
				<td class="extension_dropdown">Ausrichtung</td>
			{/if}
			<td class="extension_active">Aktiv</td>
			<td class="extension_del">&nbsp;</td>
		</tr>
			{if $overview_array ne false}
				{foreach from=$overview_array item=extension_align name=align}
					{foreach from=$extension_align item=extension_data name=array}
						{if $extension_data.id eq $extension_id}
							<tr class="extension_act">
						{else}
							<tr>
						{/if}
							<td class="extension_name" title="Version {$extension_data.version}">{$extension_data.name}</td>
							<td class="extension_text" title="{$extension_data.description}">{$extension_data.description|truncate:35:" ...":true}</td>
							<td class="extension_dropdown">
							{if $art ne "Layout" && $extension_data.name ne "category" && $extension_data.name ne "mainmenu" && $extension_data.name ne "usermenu" && $extension_data.name ne "login" &&  $extension_data.name ne "images" &&  $extension_data.name ne "profile" && $extension_data.name ne "register"}
								<div onclick="change_display('{$smarty.foreach.array.iteration}', 'block', 'category', '{$extension_data.align}')" style="cursor: pointer;">{i18n s="core_select"}</div>
								<div id="category_{$extension_data.align}_{$smarty.foreach.array.iteration}" class="category" onmouseout="change_display('{$smarty.foreach.array.iteration}', 'none', 'category', '{$extension_data.align}')" onmouseover="change_display('{$smarty.foreach.array.iteration}', 'block', 'category', '{$extension_data.align}')" onclick="change_display('{$smarty.foreach.array.iteration}', 'block', 'category', '{$extension_data.align}')">
								<div class="extension_dropdown_heading" onclick="submit_form('change_category', '{$smarty.foreach.array.iteration}', '{$extension_data.id}', '{$extension_data.align}')">{i18n s="core_submit"}</div><hr />
									<input type="checkbox" name="category_{$extension_data.align}_all" id="category_{$extension_data.align}_{$smarty.foreach.array.iteration}_all"{if $category_array[$smarty.foreach.array.iteration].0 eq ""} checked{/if} onchange="change_radio('category', '{$smarty.foreach.array.iteration}', '{$extension_data.align}')" onmouseover="change_display('{$smarty.foreach.array.iteration}', 'block', 'category', '{$extension_data.align}')" />&nbsp;{i18n s="core_all"}<br />
									{foreach from=$categories item=category name=categories}
										<input type="checkbox" name="{$category.id}" id="category_{$extension_data.align}_{$smarty.foreach.array.iteration}_{$smarty.foreach.categories.iteration}" onmouseover="change_display('{$smarty.foreach.array.iteration}', 'block', 'category', '{$extension_data.align}')"{foreach from=$category_array[$smarty.foreach.array.iteration] item=act_category name=category}{if $act_category eq $category.id} checked{/if}{/foreach}>&nbsp;{$category.name}<br />
									{/foreach}
								</div>
							{else}
								&nbsp;
							{/if}
							</td>
							<td class="extension_dropdown">
								{*if $extension_data.name ne "login" && $extension_data.name ne "category" && $extension_data.name ne "mainmenu" && $extension_data.name ne "usermenu" && $extension_data.name ne "images" &&  $extension_data.name ne "profile" &&  ($extension_data.name ne "default" && $art eq "Layout")*}
								{if $extension_data.name ne "login"}
									<div onclick="change_display('{$smarty.foreach.array.iteration}', 'block', 'groups', '{$extension_data.align}')" style="cursor: pointer;">{i18n s="core_select"}</div>
									<div id="groups_{$extension_data.align}_{$smarty.foreach.array.iteration}" class="groups" onmouseout="change_display('{$smarty.foreach.array.iteration}', 'none', 'groups', '{$extension_data.align}')" onmouseover="change_display('{$smarty.foreach.array.iteration}', 'block', 'groups', '{$extension_data.align}')" onclick="change_display('{$smarty.foreach.array.iteration}', 'block', 'groups', '{$extension_data.align}')">
									<div class="extension_dropdown_heading" onclick="submit_form('change_groups', '{$smarty.foreach.array.iteration}', '{$extension_data.id}', '{$extension_data.align}')">{i18n s="core_submit"}</div><hr />
										<input type="checkbox" name="groups_{$extension_data.align}_all" id="groups_{$extension_data.align}_{$smarty.foreach.array.iteration}_all"{if $group_array[$smarty.foreach.array.iteration].0 eq "2"} checked{/if} onchange="change_radio('groups', '{$smarty.foreach.array.iteration}', '{$extension_data.align}')" onmouseover="change_display('{$smarty.foreach.array.iteration}', 'block', 'groups', '{$extension_data.align}')" />&nbsp;{i18n s="core_all"}<br />
										{foreach from=$groups item=group name=groups}
											{if $group.id ne "2"}
												<input type="checkbox" name="{$group.id}" id="groups_{$extension_data.align}_{$smarty.foreach.array.iteration}_{$smarty.foreach.groups.iteration}" onmouseover="change_display('{$smarty.foreach.array.iteration}', 'block', 'groups', '{$extension_data.align}')"{foreach from=$group_array[$smarty.foreach.array.iteration] item=act_group name=group}{if $act_group eq $group.id} checked{/if}{/foreach}>&nbsp;{$group.name}<br />
											{/if}
										{/foreach}
									</div>
								{else}
									&nbsp;
								{/if}
							</td>
							{if $menupos_dropdown ne ""}
								<td class="extension_dropdown">
									{if $extension_data.align eq "left"}
										{$menupos_dropdown.left[$smarty.foreach.array.iteration]}
									{elseif $extension_data.align eq "right"}
										{$menupos_dropdown.right[$smarty.foreach.array.iteration]}
									{elseif $extension_data.align eq "top"}
										{$menupos_dropdown.top[$smarty.foreach.array.iteration]}
									{elseif $extension_data.align eq "bottom"}
										{$menupos_dropdown.bottom[$smarty.foreach.array.iteration]}
									{/if}
								</td>
								<td class="extension_dropdown">
									<select id="align_{$extension_data.id}" onchange="change_align('{$extension_data.id}')">
										{foreach from=$aligns item=align}
											<option value="{$align}"{if $align eq $extension_data.align} selected{/if}>{i18n s="core_$align"}</option>
										{/foreach}
									</select>
								</td>
							{/if}
							<td class="extension_active">
								{if ($extension_data.id eq 1 && $art eq "Block") || ($extension_data.name eq "default" && $art eq "Layout")}
									<img src="images/active.gif" width="35" height="11" alt="nicht deaktivierbar" title="nicht deaktivierbar" border="0" />
								{else}
									{if $extension_data.active == "true"}
										<a href="index.php?{$session_string}&module=extension&action=deactivate&art={$art}&id={$extension_data.id}"><img src="images/active.gif" width="35" height="11" alt="deaktivieren" title="deaktivieren" border="0" /></a>
									{elseif $extension_data.active == "false"}
										<a href="index.php?{$session_string}&module=extension&action=activate&art={$art}&id={$extension_data.id}"><img src="images/inactive.gif" width="43" height="11" alt="aktivieren" title="aktivieren" border="0" /></a>
									{/if}
								{/if}
							</td>
							<td class="extension_del">
							{if $extension_data.id ne 1 || $art ne "Block"}
								{if $smarty.foreach.array.total > 1 && ($extension_data.name ne "default" && $art eq "Layout") || $art ne "Layout"}
									<a href="#" onclick="delete_extension('{$extension_data.id}')"><img src="images/trash.gif" width="16" height="17" alt="Erweiterung löschen" title="Erweiterung löschen" border="0" /></a>
								{/if}
							{else}
								&nbsp;
							{/if}
							</td>
						</tr>
					{/foreach}
					{if $art eq "Block" && $smarty.foreach.array.total != 0}
						<tr>
							<td colspan="8"><hr /></td>
						</tr>
					{/if}
				{/foreach}
 			{else}
				<tr>
					<td colspan="6" class="extension_error">{i18n s="core_none"} {$art}</td>
				</tr>
			{/if}
	</table>
{literal}
<script type="text/javascript">
	function delete_extension(extension_id){
		check = confirm("Erweiterung wirklich unwiederruflich löschen? Sämtliche Daten, die sich evtl. in der\nDatenbank befinden, werden ebenfalls unwiederruflich gelöscht.");

		if(check == true)
			location.href="index.php?{/literal}{$session_string}&module=extension&action=delete&art={$art}&id=" + extension_id;{literal}
		else
			return;
	}
	function change_display(id,vis,vis_type, align){
		document.getElementById(vis_type + "_" + align + "_" + id).style.display = vis;
	}
	function change_radio(id, counter, align){
		number = new Array();
		{/literal}
			number['groups'] = {arcount a=$groups};
			{if $art ne "Layout"}
				number['category'] = {arcount a=$categories};
			{/if}
		{literal}

		var num = number[id];

		if(num != "" && document.getElementById(id + "_" + align + "_" + counter + "_all")){
			var dis = document.getElementById(id + "_" + align + "_" + counter + "_all").checked;

			for(var c = 1; c <= num; c++){
				if(document.getElementById(id + "_" + align + "_" + counter + "_" + c))
					document.getElementById(id + "_" + align + "_" + counter + "_" + c).disabled = dis;
			}
		}
	}
	function change_menupos(id, align){
		var new_position = document.getElementById('menupos_' + id).options[document.getElementById('menupos_' + id).selectedIndex].value;
		location.href="index.php?{/literal}{$session_string}&module=extension&action=change_menupos&art={$art|lower}&id=" + id + "&new_position=" + new_position + "&align=" + align;{literal}
	}
	function change_align(id){
		var align = document.getElementById('align_' + id).options[document.getElementById('align_' + id).selectedIndex].value;
		location.href="index.php?{/literal}{$session_string}&module=extension&action=change_align&art={$art|lower}&id=" + id + "&align=" + align;{literal}
	}
	function submit_form(action, counter, id, align){
		var groups = {/literal}{if $smarty.foreach.groups.total == 0}0{else}{$smarty.foreach.groups.total}{/if}{literal};
		var categories = {/literal}{if $smarty.foreach.categories.total == 0}0{else}{$smarty.foreach.categories.total}{/if}{literal};

		if(action == "change_groups"){
			var group_acc = "";

			if(document.getElementById('groups_' + align + "_" + counter + "_all").checked){
				group_acc = group_acc + '2,' + document.getElementById('groups_' + align + "_" + counter + "_all").checked + ";";
			}
			else {
				for(group = 1; group <= groups; group++){
					if(document.getElementById('groups_' + align + "_"  + counter + '_' + group)){
						if(document.getElementById('groups_' + align + "_"  + counter + '_' + group).checked){
							group_acc = group_acc + document.getElementById('groups_' + align + "_" + counter + "_" + group).name + ',true;';
						}
					}
				}
			}
			group_acc = group_acc.substr(0, group_acc.length - 1);
			var target_link = "index.php?{/literal}{$session_string}module=extension&action=change_groups&id=" + id + "&group_acc=" + group_acc + "&art={$art|lower}";{literal}
		}
		if(action == "change_category"){
			var category_list = "";
			var category_count = 0;

			if(document.getElementById('category_' + align + "_" + counter + "_all").checked){
				category_list = "";
			}
			else {
				for(category = 1; category <= categories; category++){
					if(document.getElementById('category_' + align + "_" + counter + "_" + category)){
						if(document.getElementById('category_' + align + "_" + counter + "_" + category).checked){
							category_list = category_list + document.getElementById('category_' + align + "_" + counter + "_" + category).name + ',true;';
						}
					}
				}
			}
			category_list = category_list.substr(0, category_list.length - 1);
			var target_link = "index.php?{/literal}{$session_string}module=extension&action=change_category&id=" +id + "&category_list=" + category_list + "&art={$art|lower}";{literal}
		}
		location.href = target_link;
	}
	var counter = {/literal}{arcount a=$groups} * {arcount a=$categories}{literal};

	for(c = 1; c <= counter; c++){
		{/literal}
			{if $art eq "Module"}
				change_radio('category', c, '');
				change_radio('groups', c, '');
			{else}
				{if $art ne "Layout"}
					change_radio('category', c, 'left');
					change_radio('category', c, 'right');
					change_radio('category', c, 'top');
					change_radio('category', c, 'bottom');
				{/if}
				change_radio('groups', c, 'left');
				change_radio('groups', c, 'right');
				change_radio('groups', c, 'top');
				change_radio('groups', c, 'bottom');
			{/if}
	}
</script>
</form>
</div>


Return current item: Aratix