Location: PHPKode > projects > OpenNitro > trunk/Nitro/Defaults/Templates/BackOffice/widget.tpl
<!-- BackOffice Widget template -->
{if $WidgetType eq "SELECT" or $WidgetType eq "SELECTMULTIPLE"}
	<select class="DefaultSelectInput" name="{$Name}" id="{$Name}" class="styled"{if $Style} style="{$Style}"{/if}{if $WidgetType eq "SELECTMULTIPLE"} multiple{/if} onchange="{if $WidgetAutoSubmit} this.form.submit();{/if}{if $OnChange} {$OnChange}{/if}"{if $Script}{foreach from=$Script item=JS} {$JS}{/foreach}{/if}{if $Custom.SIZE.0} size="{$Custom.SIZE.0}"{/if}>
		{foreach from=$Values item=Value key=Key}
			<option value="{$Key}"{if in_array($Key, $Selected) or $Selected.0 eq "ALL"} selected{/if}>{$Value}</option>
		{/foreach}
	</select>
{elseif $WidgetType eq "TEXT"}
	<input type="text" name="{$Name}" id="{$Name}" class="styled" value="{$Values.0|htmlentities}"{if $Style} style="{$Style}"{/if} onchange="{if $WidgetAutoSubmit} this.form.submit();{/if}{if $OnChange} {$OnChange}{/if};"{if $Custom.MAXLENGTH.0} maxlength="{$Custom.MAXLENGTH.0}"{/if}{if $Script}{foreach from=$Script item=JS} {$JS}{/foreach}{/if}>
{elseif $WidgetType eq "TEXTAREA"}
	<DIV CLASS="WidgetTextArea">
	<TEXTAREA NAME="{$Name}" ID="{$Name}"{if $Style} STYLE="{$Style}"{/if} onChange="{if $WidgetAutoSubmit} this.form.submit();{/if}{if $OnChange} {$OnChange}{/if}"{if $Custom.ROWS.0} ROWS="{$Custom.ROWS.0}"{/if}{if $Custom.COLS.0} COLS="{$Custom.COLS.0}"{/if}{if $Custom.HTML_EDITOR.0} HTML_EDITOR="{$Custom.HTML_EDITOR.0}"{/if}>{$Values.0|htmlentities}</TEXTAREA>
	</DIV>
{elseif $WidgetType eq "TEXTHTML"}
	<!-- DIV CLASS="WidgetTextHtml" -->
	{if $Nitro_Editor}
	{$Name|Nitro_Editor:$Custom.ROWS.0:$Custom.COLS.0:$Values.0}
	{else}
	<TEXTAREA NAME="{$Name}" ID="{$Name}"{if $Style} STYLE="{$Style}"{/if} onChange="{if $WidgetAutoSubmit} this.form.submit();{/if}{if $OnChange} {$OnChange}{/if}"{if $Custom.ROWS.0} ROWS="{$Custom.ROWS.0}"{/if}{if $Custom.COLS.0} COLS="{$Custom.COLS.0}"{/if}>{$Values.0|htmlentities}</TEXTAREA>
	{/if}
	<!-- /DIV -->
{elseif $WidgetType eq "PASSWORD"}
	<DIV CLASS="WidgetPassword">
	<INPUT TYPE="PASSWORD" NAME="{$Name}" ID="{$Name}" VALUE="{$Values.0}"{if $Style} STYLE="{$Style}"{/if} onChange="{if $WidgetAutoSubmit} this.form.submit();{/if}{if $OnChange} {$OnChange}{/if}">
	</DIV>
{elseif $WidgetType eq "HIDDEN"}
	<DIV CLASS="WidgetHidden">
	<INPUT TYPE="HIDDEN" NAME="{$Name}" ID="{$Name}" VALUE="{$Values.0}">
	</DIV>
{elseif $WidgetType eq "RADIO"}
	<DIV CLASS="WidgetRadio">
	{foreach from=$Values item=Value key=Key}
		<INPUT TYPE="RADIO" NAME="{$Name}" ID="{$Name}" ID="{$ID|default:"`$Name`_$Key"}" VALUE="{$Key}"{if $Style} STYLE="{$Style}"{/if} onChange="{if $WidgetAutoSubmit} this.form.submit();{/if}{if $OnChange} {$OnChange}{/if}"{if in_array($Key, $Selected)} CHECKED{/if}>{$Value}{if $Custom.BreakLine}<BR />{/if}
	{/foreach}
	</DIV>
{elseif $WidgetType eq "CHECKBOX"}
	<DIV CLASS="WidgetCheckBox">
	{foreach from=$Values item=Value key=Key}
		<INPUT TYPE="CHECKBOX" NAME="{$Name}" ID="{$Name}" VALUE="{$Key}"{if $Style} STYLE="{$Style}"{/if} onChange="{if $WidgetAutoSubmit} this.form.submit();{/if}{if $OnChange} {$OnChange}{/if}"{if in_array($Key, $Selected)} CHECKED{/if}> <LABEL FOR="{$Name}">{$Value}</LABEL>
	{/foreach}
	</DIV>
{elseif $WidgetType eq "READONLY"}
	<DIV CLASS="WidgetReadOnly">
	<INPUT TYPE="HIDDEN" NAME="{$Name}" ID="{$Name}" VALUE="{$Values.0}">{$Values.0}
	</DIV>
{elseif $WidgetType eq "DIV"}
	<DIV CLASS="WidgetDiv" NAME="{$Name}" ID="{$Name}">{$Values.0}</DIV>
{elseif $WidgetType eq "BUTTON"}
	<INPUT TYPE="{if $Custom.SRC}IMAGE" SRC="{$Custom.SRC.0}{else}BUTTON{/if}" NAME="{$Name}" ID="{$Name}" VALUE="{$Lable}"{if $Style} STYLE="{$Style}"{/if}{if $Custom.onClick} onClick="{foreach from=$Custom.onClick item=onC}{$onC};{/foreach}"{/if}>
{elseif $WidgetType eq "HTML"}
	<DIV CLASS="WidgetHTML">
	{$Custom.HTML|default:$Values.0}
	</DIV>
{elseif $WidgetType eq "TAB"}
	<DIV NAME="{$Name|replace:" ":"_"}_TAB" ID="{$Name|replace:" ":"_"}_TAB" CLASS="WidgetTab">
	<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR>
		<INPUT type=HIDDEN name="TAB_Selected" value=0>
		{if $Tabs|@count}
		<TD style="padding:0">
			<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="SmallTab"><TR>
			{foreach name=TABS from=$Tabs item=Tab key=ID}
			<TD  ID="{$Name|replace:" ":"_"}_TD_{$ID}" CLASS="{if (!$SelectedTab && $smarty.foreach.TABS.first) or $SelectedTab eq $ID}SmallTab_tab_active{else}SmallTab_tab{/if}" STYLE="{if !$smarty.foreach.TABS.first} border-left: 1px solid #3399CC;{/if}">
				<A HREF="#" onclick="ChangeTab('{$Name|replace:" ":"_"}', '{$ID}'); return false;">{$Tab}</A>
				{foreach from=$TabActions.$ID item=Action}
				&nbsp;<A HREF="{$Action.URL}">{$Action.Name}</A>
				{/foreach}
			</TD>
			{/foreach}
			</TR></TABLE>
		</TD>
		{/if}
		<TD>
			{foreach from=$Actions item=Action}
			&nbsp;<A HREF="{$Action.URL}" {if $Action.onClick}onClick="{$Action.onClick}"{/if}{if $Script}{foreach from=$Script item=JS} {$JS}{/foreach}{/if}>{$Action.Name}</A>
			{/foreach}
		</TD>
	</TR></TABLE>

	{if $Tabs|@count}
		<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" STYLE="border: 1px solid #CCCCCC"  width="100%"><TR><TD>
			{foreach name=TABS from=$Tabs item=Tab key=ID}
				<DIV NAME="{$Name|replace:" ":"_"}_TAB_{$ID}" ID="{$Name|replace:" ":"_"}_TAB_{$ID}" STYLE="display: {if (!$SelectedTab && $smarty.foreach.TABS.first) or $SelectedTab eq $ID}block{else}none{/if};">
					<INPUT TYPE=HIDDEN NAME="{$Name|replace:" ":"_"}_TAB_{$ID}_Modified" VALUE="0">
					{if $Controls.$ID|count}
						<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="5" width="100%">
							{foreach from=$Controls.$ID item=Control}
								{if $Control.WidgetType eq 'HIDDEN'}
								{$Control.Controls}
								{else}
								<TR>
									{if $Control.Lable && $Control.Lable != "__FALSE"}<TD VALIGN="TOP">{$Control.Lable}{if $Control.Lable neq ' '}:{/if} {if $Control.Help}{$Control.Help}{/if} </TD>{/if}
									<TD VALIGN="TOP"{if !$Control.Lable} COLSPAN="2"{/if}>{$Control.Controls}</TD>
								</TR>
								{/if}
							{/foreach}
						</TABLE>
					{/if}
				</DIV>
			{/foreach}
		</TD></TR></TABLE>
	{/if}
	</DIV>
{elseif $WidgetType eq "GROUP"}
	<FIELDSET><LEGEND>{$Lable}</LEGEND>
	<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="5">
		{foreach from=$Controls item=Control}
			{if $Control.WidgetType eq 'HIDDEN'}
			{$Control.Controls}
			{else}
			<TR>
				{if $Control.Lable && $Control.Lable != "__FALSE"}<TD VALIGN="TOP">{$Control.Lable}{if $Control.Lable neq ' '}:{/if} {if $Control.Help}{$Control.Help}{/if} </TD>{/if}
				<TD VALIGN="TOP"{if !$Control.Lable} COLSPAN="2"{/if}>{$Control.Controls}</TD>
			</TR>
			{/if}
		{/foreach}
	</TABLE>
	</FIELDSET>
{elseif $WidgetType eq "DATE"}
	
		<INPUT class="TextInput" TYPE="TEXT" NAME="{$Name}" ID="{$Name}" VALUE="{$Values.0|htmlentities}"{if $Style} STYLE="{$Style}"{/if} onChange="{if $WidgetAutoSubmit} this.form.submit();{/if}{if $OnChange} {$OnChange}{/if}"{if $Custom.MAXLENGTH.0} MAXLENGTH="{$Custom.MAXLENGTH.0}"{/if}{if $Script}{foreach from=$Script item=JS} {$JS}{/foreach}{/if}><img style="position:relative; top:3px;" hspace=10 src="./GetObject.php?NitroDefault=Images/calendar.gif" onclick="showChooser(this, '{$Name}', 'chooserSpan', 1950, 2015, 'Y-m-d', false);"><div id="chooserSpan" class="dateChooser select-free" style="display: none; visibility: hidden; width: 160px;"></div>
	
{elseif $WidgetType eq "FILE"}
	<DIV CLASS="WidgetFile">
	<TABLE BORDER=1 CELLSPACING="0" CELLPADDING="2">
	<TR><TD><INPUT TYPE="FILE" NAME="{$Name}" ID="{$Name}" VALUE="{$Values.0}"{if $Style} STYLE="{$Style}"{/if} onChange="{if $WidgetAutoSubmit} this.form.submit();{/if}{if $OnChange} {$OnChange}{/if}"{if $Custom.MAXLENGTH.0} MAXLENGTH="{$Custom.MAXLENGTH.0}"{else} MAXLENGTH=255{/if}></TD></TR>
	</TABLE>
	</DIV>
{elseif $WidgetType eq "FROMTOSELECT"}
	<script type='text/javascript' language='javascript'>
		{foreach from=$Values item=Value key=Key}
			AvailableLanguages['{$Key}'] = '{$Value}';
		{/foreach}
	</script>
	<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
		<tr>
			<th>{if $Custom.FROMHEAD.0}{$Custom.FROMHEAD.0}{/if}</th>
			<th colspan="3">&nbsp;</th>
			<th>{if $Custom.TOHEAD.0}{$Custom.TOHEAD.0}{/if}</th>
		</tr>
		<tr>
			<td width="25%">
				<select class="SelectInput" name="{$Custom.FROMID.0}"{if $Style} style="{$Style}"{/if} multiple{if $Custom.SIZE.0} size="{$Custom.SIZE.0}"{/if}>
					{foreach from=$Values item=Value key=Key}
						{if strstr($Key, "FROM_")}
							<option value="{$Key}"{if in_array($Key, $Selected) or $Selected.0 eq "ALL"} selected="selected"{/if}>{$Value}</option>
						{/if}
					{/foreach}
				</select>
			</td>
			<td width="20%">&nbsp;</td>
			<td width="30%" align="center" valign="middle">
				&nbsp;&nbsp;&nbsp;&nbsp;
					<a href="#" onclick="DoSelectedLang('{$Custom.FROMID.0}', '{$Custom.TOID.0}');"><img src="./GetObject.php?NitroDefault=Images/arrow_right.gif" width="17" height="13" alt="" border="0" /></a>
				&nbsp;&nbsp;&nbsp;&nbsp;
					<br /><br />
				&nbsp;&nbsp;&nbsp;&nbsp;
					<a href="#" onclick="RemoveSelected('{$Custom.TOID.0}'); reDrawAvailable('{$Custom.TOID.0}', '{$Custom.FROMID.0}');"><img src="./GetObject.php?NitroDefault=Images/arrow_left.gif" width="17" height="13" alt="" border="0" /></a>
				&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
			<td width="20%">&nbsp;</td>
			<td width="25%">
				<select class="SelectInput" name="{$Custom.TOID.0}"{if $Style} style="{$Style}"{/if} multiple{if $Custom.SIZE.0} size="{$Custom.SIZE.0}"{/if}>
					{foreach from=$Values item=Value key=Key}
						{if strstr($Key, "TO_")}
							<option value="{$Key}"{if in_array($Key, $Selected) or $Selected.0 eq "ALL"} selected="selected"{/if}>{$Value}</option>
						{/if}
					{/foreach}
				</select>
			</td>
		</tr>
	</table>
{/if}
Return current item: OpenNitro