Filter to default closed
Posted: 01 Feb 2011, 11:21
Hi,
Is there any config that will unexpanded / closed by default the filter?
Thanks
Is there any config that will unexpanded / closed by default the filter?
Thanks
atrol wrote:AFAIK there is no customization option for this, so you would have to change the source code.
TBH I would not like to work with such a system. If I decide to open the filter I want to see the filter until I decide to hide it.
Actually good point. Probably can be considered a "feature not bug" issueatrol wrote:AFAIK there is no customization option for this, so you would have to change the source code.
TBH I would not like to work with such a system. If I decide to open the filter I want to see the filter until I decide to hide it.
Code: Select all
**
* Marks the beginning of a collapse block's open phase.
* This will be visible if the block is expanded, or if
* javascript is disabled.
* @param string Collapse block name
* @param string Collapse block section
*/
function collapse_open( $p_name, $p_section = '' ) {
global $g_current_collapse_section, $g_open_collapse_section;
$t_block = ( is_blank( $p_section ) ? $p_name : $p_section . '_' . $p_name );
$t_display = collapse_display( $t_block );
# make sure no other collapse section is started
if( $g_current_collapse_section !== null ) {
trigger_error( ERROR_GENERIC, ERROR );
}
$g_open_collapse_section = true;
$g_current_collapse_section = $t_block;
$t_div_id = $t_block . '_open';
echo '<div id="', $t_div_id, '"', ( $t_display ? '' : ' class="hidden"' ), '>';
}
/**
* Marks the end of a collapse block's open phase and the beginning
* of the block's closed phase. Thi will only be visible if the
* block have been collapsed and javascript is enabled.
* @param string Collapse block name
* @param string Collapse block section
*/
function collapse_closed( $p_name, $p_section = '' ) {
global $g_current_collapse_section, $g_open_collapse_section;
$t_block = ( is_blank( $p_section ) ? $p_name : $p_section . '_' . $p_name );
$t_display = !collapse_display( $t_block );
# Make sure a section is opened, and it is the same section.
if( $t_block !== $g_current_collapse_section ) {
trigger_error( ERROR_GENERIC, ERROR );
}
echo '</div>';
$g_open_collapse_section = false;
ob_start();
$t_div_id = $t_block . '_closed';
echo '<div id="', $t_div_id, '"', ( $t_display ? '' : ' class="hidden"' ), '>';
}
/**
* Marks the location where a +/- icon is placed in output
* for the user to toggle the collapse block status.
* This should appear in both the open and closed phase of a block.
* @param string Collapse block name
* @param string Collapse block section
*/
function collapse_icon( $p_name, $p_section = '' ) {
if( OFF == config_get( 'use_javascript' ) ) {
return;
}
$t_block = ( is_blank( $p_section ) ? $p_name : $p_section . '_' . $p_name );
global $g_open_collapse_section;
if( $g_open_collapse_section === true ) {
$t_icon = 'minus.png';
$t_alt = '-';
} else {
$t_icon = 'plus.png';
$t_alt = '+';
}
echo "<a href=\"\" onclick=\"ToggleDiv( '$t_block' ); return false;\"
><img border=\"0\" src=\"images/$t_icon\" alt=\"$t_alt\" /></a> ";
}
/**
* Marks the end of a collaps block's closed phase.
* Closed phase output is discarded if javascript is disabled.
* @param string Collapse block name
* @param string Collapse block section
*/
function collapse_end( $p_name, $p_section = '' ) {
global $g_current_collapse_section, $g_open_collapse_section;
$t_block = ( is_blank( $p_section ) ? $p_name : $p_section . '_' . $p_name );
$t_display = collapse_display( $t_block );
# Make sure a section is opened, and it is the same section.
if( $t_block !== $g_current_collapse_section ) {
ob_end_clean();
trigger_error( ERROR_GENERIC, ERROR );
}
echo '</div>';
$g_open_collapse_section = false;
if( ON == config_get( 'use_javascript' ) ) {
ob_end_flush();
} else {
ob_end_clean();
}
$g_current_collapse_section = null;
}
/**
* Determine if a block should be displayed open by default.
* @param string Collapse block
* @return bool
*/
function collapse_display( $p_block ) {
global $g_collapse_cache_token;
if( !isset( $g_collapse_cache_token[$p_block] ) || OFF == config_get( 'use_javascript' ) ) {
return true;
}
return( true == $g_collapse_cache_token[$p_block] );
}