' . PHP_EOL;
}
/**
* Prints a html div close tag
* @param string $class
* @since 8.0.0
*/
public static function div_close($class = '') {
// Print the class name as comment in debug mode
$c = (TEACHPRESS_DEBUG === true && $class !== '') ? '' : '';
echo '' . $c . PHP_EOL;
}
/**
* Prepares a title string for normal html output. Works like htmlspecialchars_decode, but with a white list
* @param string $input The input string
* @param string $mode decode or replace
* @return string
* @since 5.0.10
* @access public
*/
public static function prepare_title ($input, $mode = 'decode') {
$search = array('<sub>', '</sub>',
'<sup>', '</sup>',
'<small>', '</small>',
'<i>', '</i>',
'<b>', '</b>',
'<s>', '</s>',
'<del>', '</del>',
'<em>', '</em>',
'<u>', '</u>');
if ( $mode === 'decode' ) {
$replace = array('', '',
'', '',
'', '',
'', '',
'', '',
'', '',
'', '',
'', '',
'', '' );
}
else {
$replace = array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
}
$output = str_replace($search, $replace, $input);
return stripslashes($output);
}
/**
* Prepares a text for normal html output. Works like htmlspecialchars_decode, but with a white list
* @param string $input
* @return string
* @since 5.0.10
* @access public
*/
public static function prepare_text ($input) {
$search = array('<sub>', '</sub>',
'<sup>', '</sup>',
'<i>', '</i>',
'<b>', '</b>',
'<s>', '</s>',
'<em>', '</em>',
'<u>', '</u>',
'<ul>', '</ul>',
'<li>', '</li>',
'<ol>', '</ol>' );
$replace = array('', '',
'', '',
'', '',
'', '',
'', '',
'', '',
'', '',
'