{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{*
// Definition of eZCategorySelectionType class
//
// Created on: <2-Sep-2006 21:00:27 GTM+8>
//
// SOFTWARE NAME: 
// SOFTWARE RELEASE: 
// BUILD VERSION: 
// COPYRIGHT NOTICE: Copyright (C) 1999-2006 ZERUS TECHNOLOGY LTD (http://www.zerustech.com) AS
// SOFTWARE LICENSE: GNU General Public License v2.0
// NOTICE: >
//   This program is free software; you can redistribute it and/or
//   modify it under the terms of version 2.0  of the GNU General
//   Public License as published by the Free Software Foundation.
// 
//   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.
// 
//   You should have received a copy of version 2.0 of the GNU General
//   Public License along with this program; if not, write to the Free
//   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//   MA 02110-1301, USA.
//
//
*}
<div class="block">
<label>{'Threshold'|i18n( 'design/standard/class/datatype' )}:</label>
<input type="text" name="ContentClass_ezcategoryselection_threshold_{$class_attribute.id}" class="box" value="{$class_attribute.data_int3}" />
</div>

<div class="block">
<label>{'Description'|i18n( 'design/standard/class/datatype' )}:</label>
<textarea name="ContentClass_ezcategoryselection_description_{$class_attribute.id}" class="box">{$class_attribute.data_text4}</textarea>
</div>

<div class="block">
<label>{'Style'|i18n( 'design/standard/class/datatype' )}:</label>
<select name="ContentClass_ezcategoryselection_ismultiple_value_{$class_attribute.id}">
<option value="0" {section show=not( $class_attribute.data_int1 )}selected="selected"{/section}>{'Single choice'|i18n( 'design/standard/class/datatype' )}</option>
<option value="1" {section show=$class_attribute.data_int1}selected="selected"{/section}>{'Multiple choice'|i18n( 'design/standard/class/datatype' )}</option>
</select>
</div>

<div class="block">
<label>{'Cross Class'|i18n( 'design/standard/class/datatype' )}:</label>
<select name="ContentClass_ezcategoryselection_iscrossclass_{$class_attribute.id}" onchange="document.getElementById('ezcategoryselection_refresh_button_{$class_attribute.id}').click();">
<option value="0" {section show=not( $class_attribute.data_int2 )}selected="selected"{/section}>{'No'|i18n( 'design/standard/class/datatype' )}</option>
<option value="1" {section show=$class_attribute.data_int2}selected="selected"{/section}>{'Yes'|i18n( 'design/standard/class/datatype' )}</option>
</select>
</div>

{* category start *}

{include uri="design:class/datatype/edit/parts/category.tpl"}

{* category end *}

<div class="block">
<fieldset>
<legend>{'Options'|i18n( 'design/standard/class/datatype' )}</legend>

{if is_set($category_value_string)|not}
{def $category_value_string=""}
{/if}

{if is_set($category_attribute)|not}
{def $category_attribute=null}
{/if}

{if is_set($category_id_string)|not}
{def $category_id_string=""}
{/if}

{if is_set($value_key)|not}
{def $value_key=0}
{/if}

{if is_set($category_options)|not}
{def $category_options = null}
{/if}

{set $category_options = category_options($class_attribute.id,,1)}

{if gt(count($class_attribute.content.options),0)}

<table class="list" cellspacing="0">

{foreach $category_options.options as $categoryOptions}

  <tr>
    <th class="tight">&nbsp;</th>
    <th class="tight">&nbsp;</th>
    <th>{if ne($categoryOptions.0.category_label,"")}{$categoryOptions.0.category_label}{else}None{/if}</th>
    <th></th>
  </tr>

{foreach $categoryOptions as $option}
   
  <tr> 
    <td>[{$option.id}]</td><td><input type="checkbox" 
               name="ContentClass_ezcategoryselection_option_remove_array_{$class_attribute.id}[{$option.id}]" 
               value="1" title="{'Select option for removal.'|i18n( 'design/standard/class/datatype' )}" /></td>

    <td><input class="box" 
               type="text" 
               name="ContentClass_ezcategoryselection_option_name_array_{$class_attribute.id}[{$option.id}]" 
               value="{$option.name}" /></td>
    <td class="tight" nowrap>
     <div class="listbutton">
          <input type="image" src={'button-move_down.gif'|ezimage} alt="{'Down'|i18n( 'design/admin/class/edit' )}" name="option_move_down_array_{$class_attribute.id}[{$option.id}]" value="{$option.id}" />&nbsp;
          <input type="image" src={'button-move_up.gif'|ezimage} alt="{'Down'|i18n( 'design/admin/class/edit' )}" name="option_move_up_array_{$class_attribute.id}[{$option.id}]" value="{$option.id}" />
      </div>
    </td> 
  </tr>
 
{/foreach}

{/foreach}

</table>

{else}

<p>{'There are no options.'|i18n( 'design/standard/class/datatype' )}</p>

{/if}

{* Buttons. *}
{section show=$class_attribute.content.options}
<input class="button" type="submit" name="ContentClass_ezcategoryselection_removeoption_button_{$class_attribute.id}" value="{'Remove selected'|i18n( 'design/standard/class/datatype' )}" title="{'Remove selected options.'|i18n( 'design/standard/class/datatype' )}" />
{section-else}
<input class="button-disabled" type="submit" name="ContentClass_ezcategoryselection_removeoption_button_{$class_attribute.id}" value="{'Remove selected'|i18n( 'design/standard/class/datatype' )}" disabled="disabled" />
{/section}

<input class="button" type="submit" name="ContentClass_ezcategoryselection_newoption_button_{$class_attribute.id}" value="{'New option'|i18n( 'design/standard/class/datatype' )}" title="{'Add a new option.'|i18n( 'design/standard/class/datatype' )}" />
</fieldset>
</div>
