{capture name="mainbox"} {if !$action}
{include file="common_templates/subheader.tpl" title=$lang.global_options}

{if $global_options} {foreach from=$global_options item="po"} {/foreach} {else} {/if}
 {$lang.position_short}   {$lang.option_name}   {$lang.description}  {$lang.inventory}   {$lang.type}   
{if 'SRC'|strpos:$po.option_type !== false} {else} - {/if} {include file="products_pages/option_types.tpl" name="product_options[`$po.option_id`][option_type]" value=$po.option_type display="select"}  {if $po.option_type == 'S' || $po.option_type == 'R' || $po.option_type == 'C'}{include file="buttons/button.tpl" but_text=$lang.details but_style="text" but_href="$index_script?$target_name=product_options&$mode_name=option_details&option_id=`$po.option_id`"}{/if}

{$lang.text_no_items_found|replace:'[items]':$lang.options}

{if 'manage_catalog'|fn_check_privileges:true} {if $global_options}

{include file="buttons/update.tpl" but_onclick="javascript:document.global_options_form.submit();"}     {include file="buttons/delete_selected.tpl" but_onclick="javascript:fn_delete_selected('global_options_form','delete', '', '','$action_name');"} {include file="buttons/button.tpl" but_text=$lang.apply_to_products but_style="text" but_href="$index_script?$target_name=product_options&$mode_name=global&$action_name=apply"}

{/if} {/if}

{** New options dialog **} {if 'manage_catalog'|fn_check_privileges:true} {include file="common_templates/subheader.tpl" title=$lang.add_options}
{$lang.position_short} {$lang.option_name} {$lang.description} {$lang.inventory} {$lang.type}  
{include file="products_pages/option_types.tpl" name="add_product_options[0][option_type]" value="" tag_id="x_new_variants" check="Y"} {include file="buttons/multiple_buttons.tpl" item_id="new_options"}
 
 {$lang.variant_name}   {$lang.position_short}   {$lang.modifier}   {$lang.type}   
{include file="buttons/multiple_buttons.tpl" item_id="new_variants" tag_level="2"}

{include file="buttons/add_new.tpl" but_onclick="javascript: document.add_options.submit();"}

{** /New options dialog **} {/if}
{elseif $action=='apply'} {** Add option to products **} {include file="common_templates/subheader.tpl" title=$lang.products}

{capture name="section"} {assign var="class_id" value=$option_class.class_id} {include file="products_pages/products_search_form.tpl" target="product_options" mode="global" category_id=$smarty.get.category_id|escape:'HTML' search_products="Y"} {/capture} {include file="common_templates/section.tpl" section_title=$lang.search_for_products section_content=$smarty.capture.section}
{if $smarty.get.search_products == 'Y'} {include file="products_pages/products_list.tpl" products=$products form_name="add_global_options" checkbox_id="add_global_options_checkbox" pagination_suffix="#add_global_options"} {/if}
{** Form submit section **} {** /Form submit section **} {include file="common_templates/subheader.tpl" title=$lang.select_options}

{$lang.multiple_selectbox_notice}


{include file="buttons/button.tpl" but_text=$lang.apply_to_products but_type="input" action_but="action_" but_onclick="javascript: if (fn_check_selected('add_global_options','add_global_options_checkbox')) document.add_global_options.submit();"} {$lang.apply_as_link}

{** /Add option to products **} {/if} {/capture} {include file="common_templates/mainbox.tpl" title=$lang.global_options content=$smarty.capture.mainbox}