';
if ( function_exists( 'screen_icon' ) ) // it does not for our pseudo-AJAX requests
screen_icon( 'wp-table-reloaded' );
echo "
{$text}
";
echo '
';
}
// ###################################################################################################################
function print_page_footer() {
echo "
";
}
// ###################################################################################################################
function get_contextual_help_string() {
$help = '
' . sprintf( __( 'More information about WP-Table Reloaded can be found on the plugin\'s website or on its page in the WordPress Plugin Directory.', WP_TABLE_RELOADED_TEXTDOMAIN ), 'http://tobias.baethge.com/go/wp-table-reloaded/website/', 'http://wordpress.org/extend/plugins/wp-table-reloaded/' );
$help .= ' ' . sprintf( __( 'For technical information, see the documentation.', WP_TABLE_RELOADED_TEXTDOMAIN ), 'http://tobias.baethge.com/go/wp-table-reloaded/documentation/' );
$help .= ' ' . sprintf( __( 'Support is provided through the WordPress Support Forums.', WP_TABLE_RELOADED_TEXTDOMAIN ), 'http://tobias.baethge.com/go/wp-table-reloaded/support/', 'http://www.wordpress.org/support/' );
$help .= ' ' . sprintf( __( 'Before asking for support, please carefully read the Frequently Asked Questions where you will find answered to the most common questions, and search through the forums.', WP_TABLE_RELOADED_TEXTDOMAIN ), 'http://tobias.baethge.com/go/wp-table-reloaded/faq/' );
$help .= ' ' . sprintf( __( 'If you like the plugin, a donation is recommended.', WP_TABLE_RELOADED_TEXTDOMAIN ), 'http://tobias.baethge.com/go/wp-table-reloaded/donate/' ) . '
';
return $help;
}
// ###################################################################################################################
function safe_output( $string ) {
$string = stripslashes( $string ); // because $string is add_slashed before WP stores it in DB
return _wp_specialchars( $string, ENT_QUOTES, false, true );
}
// ###################################################################################################################
// create new two-dimensional array with $num_rows rows and $num_cols columns, each cell filled with $default_cell_content
function create_empty_table( $num_rows = 1, $num_cols = 1, $default_cell_content = '' ) {
return array_fill( 0, $num_rows, array_fill( 0, $num_cols, $default_cell_content ) );
}
// ###################################################################################################################
// need to clean this up and find out what's really necessary
function prepare_download( $filename, $filesize, $filetype ) {
@ob_end_clean();
//header( 'Content-Description: File Transfer' );
header( 'Content-Type: application/octet-stream' );
header( 'Content-Disposition: attachment; filename="' . $filename . '"');
header( 'Content-Length: ' . $filesize );
//header( 'Content-type: ' . $filetype. '; charset=' . get_option('blog_charset') );
}
// ###################################################################################################################
// add admin footer text
function add_admin_footer_text( $content ) {
$content .= ' • ' . __( 'Thank you for using WP-Table Reloaded.', WP_TABLE_RELOADED_TEXTDOMAIN ) . ' ' . sprintf( __( 'Support the plugin with your donation!', WP_TABLE_RELOADED_TEXTDOMAIN ), 'http://tobias.baethge.com/donate-message/' );
return $content;
}
// ###################################################################################################################
// state of the postbox, can be filtered
function postbox_closed( $postbox_name, $postbox_closed ) {
$postbox_closed = apply_filters( 'wp_table_reloaded_admin_postbox_closed', $postbox_closed, $postbox_name );
$output = ( $postbox_closed ) ? ' closed' : '';
return $output;
}
// ###################################################################################################################
// retrieve the update message from the development server to notify user of what changes there are in this update, in his language
function retrieve_plugin_update_message( $current_version, $new_version ) {
$message = '';
$wp_locale = get_locale();
$update_message = wp_remote_fopen( "http://dev.tobias.baethge.com/plugin/update/wp-table-reloaded/{$current_version}/{$new_version}/{$wp_locale}/" );
if ( false !== $update_message ) {
if ( 1 == preg_match( '/(.*?)<\/info>/is', $update_message, $matches ) )
$message = $matches[1];
}
return $message;
}
// ###################################################################################################################
// help buttons
function help_button( $id ) {
$help = array(
'colspan' => array(
'text' => __( 'Table cells can span across more than one column or row.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '
' . __( 'Combining consecutive cells within the same row is called "colspanning".', WP_TABLE_RELOADED_TEXTDOMAIN ) . '
' . __( 'To combine cells, add the keyword #colspan# to the cell to the right of the one with the content for the combined cell by using the corresponding button.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '
' . __( 'Repeat this to add the keyword to all cells that shall be connected.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '
' . __( 'Be aware that the JavaScript libraries will not work on tables which have combined cells.', WP_TABLE_RELOADED_TEXTDOMAIN ),
'height' => 200,
'width' => 300
),
'rowspan' => array(
'text' => __( 'Table cells can span across more than one column or row.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '
' . __( 'Combining consecutive cells within the same column is called "rowspanning".', WP_TABLE_RELOADED_TEXTDOMAIN ) . '
' . __( 'To combine cells, add the keyword #rowspan# to the cell below the one with the content for the combined cell by using the corresponding button.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '
' . __( 'Repeat this to add the keyword to all cells that shall be connected.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '
' . __( 'Be aware that the JavaScript libraries will not work on tables which have combined cells.', WP_TABLE_RELOADED_TEXTDOMAIN ),
'height' => 200,
'width' => 300
)
);
if ( !isset( $help[ $id ] ) )
return '';
$title = __( 'Help', WP_TABLE_RELOADED_TEXTDOMAIN );
$text = $help[ $id ]['text'];
$height = $help[ $id ]['height'];
$width = $help[ $id ]['width'];
return "?