<?php
if( $kind = ic_get_post( 'kind' ) ) {
	if( $kind == 'c' || $kind == 'cod' ) { $sym = '#'; $kind = 'cod'; }
	else if( $kind == 'l' || $kind == 'loc' ) { $sym = '@'; $kind = 'loc'; }
	else if( $kind == 's' || $kind == 'str' ) { $sym = '*'; $kind = 'str'; }
	else if( $kind == 'u' || $kind == 'usr' ) { $sym = '+'; $kind = 'usr'; }

	if( $name = ic_get_post( 'filters-req' ) ) {
		$filter = $_SESSION['filters'][$sym.$name];
		$filter->manage( 'req' ); 
	} else if( $name = ic_get_post( 'filters-sign' ) ) {
		$filter = $_SESSION['filters'][$sym.$name];
		$filter->manage( 'sign' );
	} else if( $name = ic_get_post( 'trashed_filter' ) ) {
		$filter = $_SESSION['filters'][$sym.$name];
		$filter->manage( 'clear' );
	} else if( $name = ic_get_post( 'new_filter' ) ) {
		$sign = ( $post_meta = ic_get_post( 'new_sign' ) ) ? $post_meta : 'd';
		$filter = new filter( $name, $kind, $sign );
		$filter->manage( 'add' );
	} $filter_change = TRUE;	
}

if( isset( $filter_change ) || ic_get_post( 'filters_refresh' ) ) {
	foreach( $_SESSION['filters'] as $filter ) $filter->tag();
} else {
	$sign_filters = get_setting( 'sign_filters');
	$on = $sign_filters != 1 ? ',\'d\'' : ',0'; 
	$filts = $sign_filters != 1 ?  'style="display:none;"' : '';
	$hover = get_setting( 'hover_help' ); 

	?>

<div id="hover-help">
	<div class="hover-off" id="hh-ftradd"><?php tr( 'ftradd', 'h' ) ?></div>
</div>

<div class="text-box" id="shell-filters">

<div class="filters-choice filters-choice-signs"><?php filter::add_filters( 'input-filters', 'addFilter()', 'addFilterSelect()' ) ?></div>

<div id="filters">
<?php 

$filter_change = TRUE;

include( 'filters-main.php' );

echo '</div></div>';

}
