<?xml version="1.0" encoding="utf-8"?>
<!--
 @package SobiPro multi-directory component with content construction support

 @author
 Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH
 Url: https://www.Sigsiu.NET

 @copyright Copyright (C) 2006 - 2024 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved.
 @license GNU/GPL Version 3
 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3
 as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3.
 See https://www.gnu.org/licenses/gpl.html and https://www.sigsiu.net/licenses.

 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

 @created 7 December 2012 by Radek Suski
 @modified 13 February 2024 by Sigrid Suski
-->

<definition>
	<header>
		<file type="script" filename="adm.tabs"/>
		<file type="script" filename="adm.template"/>
	</header>

	<toolbar title="TP.INFO_SITE_TITLE" class="template info">
		<button type="duplicate" task="template.clone" trim="true" label="TB.CLONE" colour="new"/>
		<button type="delete" task="template.delete" colour="delete" confirm="TB.JS_DELETE_TEMPLATE_WARN"/>
		<buttons type="sections" buttons="sections-list"/>
		<buttons type="options">
			<button type="url" task="panel"/>
			<button type="url" task="config" condition="acl.config"/>
			<button type="url" task="acl" condition="acl.admin"/>
			<button type="url" task="extensions.installed" condition="acl.apps"/>
			<button type="url" task="template.info" condition="acl.config"/>
			<button type="url" task="error" condition="acl.admin"/>
			<button type="help" target="_blank"/>
		</buttons>
	</toolbar>

	<body>
		<div class="row">
			<div class="col-lg-3" id="spctrl-menu">
				<menu/>
			</div>
			<div class="col-lg-9 sp-main-area">
				<message id="spctrl-message"/>
				<tabs>
					<tab label="TP.INFO">
						<fieldset>
							<field type="output" value="template.name" label="TP.TEMPLATE_NAME" class="h2"/>
							<field type="output" value="template.author.url" label="TP.AUTHORURL" condition="template.author.url">
								<value>
									<url type="external" content="template.author.name" uri="template.author.url"/>
								</value>
							</field>
							<field type="output" value="template.author.name" label="TP.AUTHORURL" invert-condition="template.author.url"/>
							<field type="output" value="template.copyright" label="TP.COPYR"/>
							<field type="output" value="template.license" label="TP.LIC"/>
							<field type="output" value="template.version" label="TP.VER"/>
							<field type="dategetter" value="template.date" label="TP.DATE" dateFormat="cfg:list_format"/>
							<field type="output" value="template.description" label="TP.DESC"/>
						</fieldset>
						<div condition="template.preview">
							<fieldset label="TP.TEMPLATE_PREVIEW">
								<div class="row mb-3">
									<div class="dk-preview col-lg-9 offset-lg-3">
										<img class="accordion img-fluid" src="var:[template.preview]" alt="preview template"/>
									</div>
								</div>
							</fieldset>
						</div>
					</tab>
					<tab label="TP.FILES_DECS" condition="files.length">
						<div class="table-responsive">
							<table class="table-hover table-sm">
								<head>
									<cell label="TP.HEAD_FILENAME" type="text" class="dk-cell w-25 text-start"/>
									<cell label="TP.HEAD_FILE_DESC" type="text" class="dk-cell text-start"/>
								</head>
								<loop subject="files">
									<cell type="link" value="file" condition="filepath">
										<url type="intern">
											<param name="task" value="template.edit"/>
											<param name="file" value="filepath" parse="true"/>
											<param name="sid" value="sid" parse="true" subject="skip"/>
										</url>
									</cell>
									<cell type="text" value="file" invert-condition="filepath"/>
									<cell type="text" value="description" class="dk-cell text-start"/>
								</loop>
							</table>
						</div>
					</tab>
				</tabs>
			</div>
		</div>
	</body>
	<config>
		<action value="index.php"/>
		<hidden>
			<field name="option" default="com_sobipro"/>
			<field name="task" default=""/>
			<field name="templateNewName" default=""/>
			<field name="pid" value="sid"/>
		</hidden>
	</config>
</definition>
