/** * Marks the end of a collapse block's open phase and the beginning * of the closed phase. * This will be visible if the block is collapsed and javascript is enabled. * @param string $p_name Collapse block name. * @param string $p_section Collapse block section. * @return void */ 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; $t_div_id = $t_block . '_closed'; $t_collapse_status_class = $t_display ? 'collapse-open' : 'collapse-closed'; echo "\n" . '<div id="', $t_div_id, '" class="collapse-section-closed ' . $t_collapse_status_class . '">'; }
/** * 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; }