/**
* Init the Table model by instantiating a Post model and loading the list of tables option.
*
* @since 1.0.0
*/
public function __construct()
{
parent::__construct();
$this->model_post = TablePress::load_model('post');
$params = array('option_name' => 'tablepress_tables', 'default_value' => $this->default_tables);
$this->tables = TablePress::load_class('TablePress_WP_Option', 'class-wp_option.php', 'classes', $params);
}
/**
* Set up the view with data and do things that are specific for this view.
*
* @param string $action Action for this view.
* @param array $data Data for this view.
*/
public function setup($action, array $data)
{
$params = array('option_name' => 'tablepress_stockflock_config', 'default_value' => array());
$this->stockflock_config = TablePress::load_class('TablePress_WP_Option', 'class-wp_option.php', 'classes', $params);
parent::setup($action, $data);
$this->add_header_message('<span>' . __('Please contact stockflock if you get any issue with this plugin.', 'tablepress') . '</span>', 'notice-info');
$this->process_action_messages(array('success_save' => __('Stockflock Changes saved successfully.', 'tablepress'), 'error_save' => __('Error: Stockflock Changes could not be saved.', 'tablepress')));
$this->add_meta_box('stockflock-options', __('Stockflock Options', 'tablepress'), array($this, 'stockflock_plugin_options'), 'normal');
$this->add_text_box('submit', array($this, 'textbox_submit_button'), 'submit');
}
/**
* Initialize all controllers, by loading Plugin and User Options, and performing an update check
*
* @since 1.0.0
*/
public function __construct()
{
$this->model_options = TablePress::load_model('options');
$this->model_table = TablePress::load_model('table');
// update check, in all controllers (frontend and admin), to make sure we always have up-to-date options
$this->plugin_update_check();
// should be done very early
// Admin Page Menu entry, needed for construction of plugin URLs
$this->parent_page = apply_filters('tablepress_admin_menu_parent_page', $this->model_options->get('admin_menu_parent_page'));
$this->is_top_level_page = in_array($this->parent_page, array('top', 'middle', 'bottom'), true);
}
/**
* Print the content of the "No tables found" post meta box
*
* @since 1.0.0
*/
public function postbox_no_tables($data, $box)
{
$add_url = TablePress::url(array('action' => 'add'));
$import_url = TablePress::url(array('action' => 'import'));
?>
<p><?php
_e('No tables found.', 'tablepress');
?>
</p>
<p><?php
printf(__('You should <a href="%s">add</a> or <a href="%s">import</a> a table to get started!', 'tablepress'), $add_url, $import_url);
?>
</p>
<?php
}
/**
* Render the navigation menu with links to the possible actions, highlighting the current one.
*
* @since 1.0.0
*/
protected function print_nav_tab_menu()
{
?>
<h1 id="tablepress-nav" class="nav-tab-wrapper">
<?php
echo '<span class="plugin-name">' . __('TablePress', 'tablepress') . '</span><span class="separator"></span>';
foreach ($this->data['view_actions'] as $action => $entry) {
// Special case: Add a separator before the group that starts with "Plugin Options", for some spacing.
if ('options' === $action) {
echo '<span class="separator"></span><span class="separator"></span>';
}
if ('' === $entry['nav_tab_title']) {
continue;
}
if (!current_user_can($entry['required_cap'])) {
continue;
}
$url = esc_url(TablePress::url(array('action' => $action)));
$active = $action === $this->action ? ' nav-tab-active' : '';
echo "<a class=\"nav-tab{$active}\" href=\"{$url}\">{$entry['nav_tab_title']}</a>";
}
?>
</h1>
<?php
}
/**
* Return the live preview data of table that has non-saved changes.
*
* @since 1.0.0
*/
public function ajax_action_preview_table()
{
if (empty($_POST['tablepress']) || empty($_POST['tablepress']['id'])) {
wp_die('-1');
} else {
$preview_table = wp_unslash($_POST['tablepress']);
}
// Check if the submitted nonce matches the generated nonce we created earlier, dies -1 on failure.
TablePress::check_nonce('preview_table', $preview_table['id'], '_ajax_nonce', true);
// Ignore the request if the current user doesn't have sufficient permissions.
if (!current_user_can('tablepress_preview_table', $preview_table['id'])) {
wp_die('-1');
}
// Default response data.
$success = false;
do {
// to be able to "break;" (allows for better readable code)
// Load table, without table data, but with options and visibility settings.
$existing_table = TablePress::$model_table->load($preview_table['id'], false, true);
if (is_wp_error($existing_table)) {
// maybe somehow load a new table here? (TablePress::$model_table->get_table_template())?
break;
}
// Check and convert data that was transmitted as JSON.
if (empty($preview_table['data']) || empty($preview_table['options']) || empty($preview_table['visibility'])) {
break;
}
$preview_table['data'] = (array) json_decode($preview_table['data'], true);
$preview_table['options'] = (array) json_decode($preview_table['options'], true);
$preview_table['visibility'] = (array) json_decode($preview_table['visibility'], true);
// Check consistency of new table, and then merge with existing table.
$table = TablePress::$model_table->prepare_table($existing_table, $preview_table, true, true);
if (is_wp_error($table)) {
break;
}
// DataTables Custom Commands can only be edit by trusted users.
if (!current_user_can('unfiltered_html')) {
$table['options']['datatables_custom_commands'] = $existing_table['options']['datatables_custom_commands'];
}
// If the ID has changed, and the new ID is valid, render with the new ID (important e.g. for CSS classes/HTML ID).
if ($table['id'] !== $table['new_id'] && 0 === preg_match('/[^a-zA-Z0-9_-]/', $table['new_id'])) {
$table['id'] = $table['new_id'];
}
// Sanitize all table data to remove unsafe HTML from the preview output.
$table = TablePress::$model_table->sanitize($table);
// At this point, the table data is valid and sanitized and can be rendered.
$success = true;
} while (false);
// Do-while-loop through this exactly once, to be able to "break;" early.
// Initialize i18n support, load plugin's textdomain, to retrieve correct translations for the description of the preview.
load_plugin_textdomain('tablepress', false, dirname(TABLEPRESS_BASENAME) . '/i18n');
if ($success) {
// Create a render class instance.
$_render = TablePress::load_class('TablePress_Render', 'class-render.php', 'classes');
// Merge desired options with default render options (see TablePress_Controller_Frontend::shortcode_table()).
$default_render_options = $_render->get_default_render_options();
/** This filter is documented in controllers/controller-frontend.php */
$default_render_options = apply_filters('tablepress_shortcode_table_default_shortcode_atts', $default_render_options);
$render_options = shortcode_atts($default_render_options, $table['options']);
/** This filter is documented in controllers/controller-frontend.php */
$render_options = apply_filters('tablepress_shortcode_table_shortcode_atts', $render_options);
$_render->set_input($table, $render_options);
$head_html = $_render->get_preview_css();
$custom_css = TablePress::$model_options->get('custom_css');
if (!empty($custom_css)) {
$head_html .= "<style type=\"text/css\">\n{$custom_css}\n</style>\n";
}
$body_html = '<div id="tablepress-page"><p>' . __('This is a preview of your table.', 'tablepress') . ' ' . __('Because of CSS styling in your theme, the table might look different on your page!', 'tablepress') . ' ' . __('The features of the DataTables JavaScript library are also not available or visible in this preview!', 'tablepress') . '<br />' . sprintf(__('To insert the table into a page, post, or text widget, copy the Shortcode %s and paste it into the editor.', 'tablepress'), '<input type="text" class="table-shortcode table-shortcode-inline" value="' . esc_attr('[' . TablePress::$shortcode . " id={$table['id']} /]") . '" readonly="readonly" />') . '</p>' . $_render->get_output() . '</div>';
} else {
$head_html = '';
$body_html = __('The preview could not be loaded.', 'tablepress');
}
// Generate the response.
$response = array('success' => $success, 'head_html' => $head_html, 'body_html' => $body_html);
// Buffer all outputs, to prevent errors/warnings being printed that make the JSON invalid.
$output_buffer = ob_get_clean();
if (!empty($output_buffer)) {
$response['output_buffer'] = $output_buffer;
}
// Send the response.
wp_send_json($response);
}
/**
* Handle Shortcode [table-info id=<ID> field=<name> /] in the_content()
*
* @since 1.0.0
*
* @param array $atts list of attributes that where included in the Shortcode
* @return string Text that replaces the Shortcode (error message or asked-for information)
*/
public function shortcode_table_info($shortcode_atts)
{
// parse Shortcode attributes, only allow those that are specified
$default_shortcode_atts = array('id' => 0, 'field' => '', 'format' => '');
$default_shortcode_atts = apply_filters('tablepress_shortcode_table_info_default_shortcode_atts', $default_shortcode_atts);
$shortcode_atts = shortcode_atts($default_shortcode_atts, $shortcode_atts);
$shortcode_atts = apply_filters('tablepress_shortcode_table_info_shortcode_atts', $shortcode_atts);
// allow a filter to determine behavior of this function, by overwriting its behavior, just need to return something other than false
$overwrite = apply_filters('tablepress_shortcode_table_info_overwrite', false, $shortcode_atts);
if ($overwrite) {
return $overwrite;
}
// check, if a table with the given ID exists
$table_id = preg_replace('/[^a-zA-Z0-9_-]/', '', $shortcode_atts['id']);
if (!$this->model_table->table_exists($table_id)) {
$message = "[table “{$table_id}” not found /]<br />\n";
$message = apply_filters('tablepress_table_not_found_message', $message, $table_id);
return $message;
}
// load the table
$table = $this->model_table->load($table_id);
if (false === $table) {
$message = "[table “{$table_id}” could not be loaded /]<br />\n";
$message = apply_filters('tablepress_table_load_error_message', $message, $table_id);
return $message;
}
$field = preg_replace('/[^a-z_]/', '', strtolower($shortcode_atts['field']));
$format = preg_replace('/[^a-z]/', '', strtolower($shortcode_atts['format']));
// generate output, depending on what information (field) was asked for
switch ($field) {
case 'name':
case 'description':
$output = $table[$field];
break;
case 'last_modified':
switch ($format) {
case 'raw':
$output = $table['last_modified'];
break 2;
case 'mysql':
$output = TablePress::format_datetime($table['last_modified'], 'mysql', ' ');
break 2;
case 'human':
$modified_timestamp = strtotime($table['last_modified']);
$current_timestamp = current_time('timestamp');
$time_diff = $current_timestamp - $modified_timestamp;
if ($time_diff >= 0 && $time_diff < DAY_IN_SECONDS) {
// time difference is only shown up to one day
$output = sprintf(__('%s ago', 'tablepress'), human_time_diff($modified_timestamp, $current_timestamp));
} else {
$output = TablePress::format_datetime($table['last_modified'], 'mysql', '<br />');
}
break 2;
default:
$output = TablePress::format_datetime($table['last_modified'], 'mysql', ' ');
}
break;
case 'last_editor':
$output = TablePress::get_user_display_name($table['options']['last_editor']);
break;
case 'author':
$output = TablePress::get_user_display_name($table['author']);
break;
default:
$output = "[table-info field “{$field}” not found in table “{$table_id}” /]<br />\n";
$output = apply_filters('tablepress_table_info_not_found_message', $output, $table, $field, $format);
}
$output = apply_filters('tablepress_shortcode_table_info_output', $output, $table, $shortcode_atts);
return $output;
}
/**
* Test that the screen URLs for toplevel admin menu entries are correct.
*
* @since 1.1.0
*/
public function test_url_toplevel()
{
TablePress::$controller->is_top_level_page = true;
TablePress::$controller->parent_page = 'middle';
$this->assertSame('http://example.org/wp-admin/admin.php?page=tablepress', TablePress::url());
$this->assertSame('http://example.org/wp-admin/admin.php?page=tablepress', TablePress::url(array(), false));
}
/**
* Print a notification about a corrupted table
*
* @since 1.4.0
*/
public function textbox_corrupted_table($data, $box)
{
?>
<div class="error">
<p><strong><?php
_e('Attention: Unfortunately, an error occured.', 'tablepress');
?>
</strong></p>
<p>
<?php
printf(__('The internal data of table “%1$s” (ID %2$s) is corrupted.', 'tablepress'), esc_html($data['table']['name']), esc_html($data['table']['id']));
echo ' ';
printf(__('The following error was registered: <code>%s</code>.', 'tablepress'), esc_html($data['table']['json_error']));
?>
</p>
<p>
<?php
_e('Because of this error, the table can not be edited at this time, to prevent possible further data loss.', 'tablepress');
echo ' ';
printf(__('Please see the <a href="%s">TablePress FAQ page</a> for further instructions.', 'tablepress'), 'http://tablepress.org/faq/corrupted-tables/');
?>
</p>
<p>
<?php
echo '<a href="' . TablePress::url(array('action' => 'list')) . '" class="button">' . __('Back to the List of Tables', 'tablepress') . '</a>';
?>
</p>
</div>
<?php
}
/**
* Handle Shortcode [table-info id=<ID> field=<name> /] in the_content()
*
* @since 1.0.0
*
* @param array $shortcode_atts List of attributes that where included in the Shortcode
* @return string Text that replaces the Shortcode (error message or asked-for information)
*/
public function shortcode_table_info($shortcode_atts)
{
// For empty Shortcodes like [table-info] or [table-info /], an empty string is passed, see Core #26927
$shortcode_atts = (array) $shortcode_atts;
// parse Shortcode attributes, only allow those that are specified
$default_shortcode_atts = array('id' => '', 'field' => '', 'format' => '');
/**
* Filter the available/default attributes for the [table-info] Shortcode.
*
* @since 1.0.0
*
* @param array $default_shortcode_atts The [table-info] Shortcode default attributes.
*/
$default_shortcode_atts = apply_filters('tablepress_shortcode_table_info_default_shortcode_atts', $default_shortcode_atts);
$shortcode_atts = shortcode_atts($default_shortcode_atts, $shortcode_atts);
// Optional third argument left out on purpose. Use filter in the next line instead.
/**
* Filter the attributes that were passed to the [table-info] Shortcode.
*
* @since 1.0.0
*
* @param array $shortcode_atts The attributes passed to the [table-info] Shortcode.
*/
$shortcode_atts = apply_filters('tablepress_shortcode_table_info_shortcode_atts', $shortcode_atts);
/**
* Filter whether the output of the [table-info] Shortcode is overwritten/short-circuited.
*
* @since 1.0.0
*
* @param bool|string $overwrite Whether the [table-info] output is overwritten. Return false for the regular content, and a string to overwrite the output.
* @param array $shortcode_atts The attributes passed to the [table-info] Shortcode.
*/
$overwrite = apply_filters('tablepress_shortcode_table_info_overwrite', false, $shortcode_atts);
if ($overwrite) {
return $overwrite;
}
// check, if a table with the given ID exists
$table_id = preg_replace('/[^a-zA-Z0-9_-]/', '', $shortcode_atts['id']);
if (!TablePress::$model_table->table_exists($table_id)) {
$message = "[table “{$table_id}” not found /]<br />\n";
/** This filter is documented in controllers/controller-frontend.php */
$message = apply_filters('tablepress_table_not_found_message', $message, $table_id);
return $message;
}
// load the table
$table = TablePress::$model_table->load($table_id, true, true);
// Load table, with table data, options, and visibility settings
if (is_wp_error($table)) {
$message = "[table “{$table_id}” could not be loaded /]<br />\n";
/** This filter is documented in controllers/controller-frontend.php */
$message = apply_filters('tablepress_table_load_error_message', $message, $table_id, $table);
return $message;
}
$field = preg_replace('/[^a-z_]/', '', strtolower($shortcode_atts['field']));
$format = preg_replace('/[^a-z]/', '', strtolower($shortcode_atts['format']));
// generate output, depending on what information (field) was asked for
switch ($field) {
case 'name':
case 'description':
$output = $table[$field];
break;
case 'last_modified':
switch ($format) {
case 'raw':
$output = $table['last_modified'];
break 2;
case 'human':
$modified_timestamp = strtotime($table['last_modified']);
$current_timestamp = current_time('timestamp');
$time_diff = $current_timestamp - $modified_timestamp;
if ($time_diff >= 0 && $time_diff < DAY_IN_SECONDS) {
// time difference is only shown up to one day
$output = sprintf(__('%s ago', 'tablepress'), human_time_diff($modified_timestamp, $current_timestamp));
} else {
$output = TablePress::format_datetime($table['last_modified'], 'mysql', '<br />');
}
break 2;
case 'mysql':
default:
$output = TablePress::format_datetime($table['last_modified'], 'mysql', ' ');
break 2;
}
break;
case 'last_editor':
$output = TablePress::get_user_display_name($table['options']['last_editor']);
break;
case 'author':
$output = TablePress::get_user_display_name($table['author']);
break;
case 'number_rows':
$output = count($table['data']);
if ('raw' != $format) {
//.........这里部分代码省略.........
function load_tablepress_in_the_admin()
{
if (is_admin() && defined('DOING_AJAX') && DOING_AJAX) {
TablePress::load_controller('frontend');
// работает на дефолтной теме
// TablePress::$controller = TablePress::load_controller( 'admin_ajax' );
}
}
/**
* Save "Custom CSS" to a file, or return HTML for the credentials form
*
* @since 1.0.0
*
* @return string (if necessary) HTML for the credentials form for the WP_Filesystem API
*/
public function save_custom_css_to_file()
{
// Set current screen to get Screen Icon to have a custom HTML ID, so that we can hide it with CSS
set_current_screen('tablepress_options_invisible');
// Start capturing the output, to get HTML of the credentials form (if needed)
ob_start();
$url = '';
// same page
$credentials = request_filesystem_credentials($url, '', false, false, null);
// do we have credentials already? (Otherwise the form will have been rendered already.)
if (false === $credentials) {
$form_data = ob_get_contents();
ob_end_clean();
$form_data = str_replace('name="upgrade" id="upgrade" class="button"', 'name="upgrade" id="upgrade" class="button button-primary button-large"', $form_data);
return $form_data;
}
// we have received credentials, but don't know if they are valid yet
if (!WP_Filesystem($credentials)) {
// credentials failed, so ask again (with $error flag true)
request_filesystem_credentials($url, '', true, false, null);
$form_data = ob_get_contents();
ob_end_clean();
$form_data = str_replace('name="upgrade" id="upgrade" class="button"', 'name="upgrade" id="upgrade" class="button button-primary button-large"', $form_data);
return $form_data;
}
// we have valid access to the filesystem now -> try to save the file
$filename = WP_CONTENT_DIR . '/tablepress-custom.css';
$filename = apply_filters('tablepress_custom_css_file_name', $filename);
$filename_min = WP_CONTENT_DIR . '/tablepress-custom.min.css';
$filename_min = apply_filters('tablepress_custom_css_minified_file_name', $filename_min);
// Check if file name is valid (0 means yes)
if (0 !== validate_file($filename) || 0 !== validate_file($filename_min)) {
TablePress::redirect(array('action' => 'options', 'message' => 'success_save_error_custom_css'));
}
global $wp_filesystem;
// WP_CONTENT_DIR and (FTP-)Content-Dir can be different (e.g. if FTP working dir is /)
// We need to account for that by replacing the path difference in the filename
$path_difference = str_replace($wp_filesystem->wp_content_dir(), '', trailingslashit(WP_CONTENT_DIR));
if ('' != $path_difference) {
$filename = str_replace($path_difference, '', $filename);
$filename_min = str_replace($path_difference, '', $filename_min);
}
$custom_css = $this->get('custom_css');
$custom_css_minified = $this->get('custom_css_minified');
$result = $wp_filesystem->put_contents($filename, $custom_css, FS_CHMOD_FILE);
$result_min = $wp_filesystem->put_contents($filename_min, $custom_css_minified, FS_CHMOD_FILE);
if (!$result || !$result_min) {
TablePress::redirect(array('action' => 'options', 'message' => 'success_save_error_custom_css'));
}
// at this point, saving was successful, so enable the checkbox again
// (if it was not enabled before, we would never have tried to save)
// and also increase the "Custom CSS" version number (for cache busting)
$this->update(array('use_custom_css_file' => true, 'custom_css_version' => $this->get('custom_css_version') + 1));
TablePress::redirect(array('action' => 'options', 'message' => 'success_save'));
}
/**
* Print the content of the "Admin Options" post meta box.
*
* @since 1.0.0
*
* @param array $data Data for this screen.
* @param array $box Information about the text box.
*/
public function textbox_uninstall_tablepress(array $data, array $box)
{
?>
<h1 style="margin-top:40px;"><?php
_e('Uninstall TablePress', 'tablepress');
?>
</h1>
<p><?php
echo __('Uninstalling <strong>will permanently delete</strong> all TablePress tables and options from the database.', 'tablepress') . '<br />' . __('It is recommended that you create a backup of the tables (by exporting the tables in the JSON format), in case you later change your mind.', 'tablepress') . '<br />' . __('You will manually need to remove the plugin’s files from the plugin folder afterwards.', 'tablepress') . '<br />' . __('Be very careful with this and only click the button if you know what you are doing!', 'tablepress');
?>
</p>
<p><a href="<?php
echo TablePress::url(array('action' => 'uninstall_tablepress'), true, 'admin-post.php');
?>
" id="uninstall-tablepress" class="button"><?php
_e('Uninstall TablePress', 'tablepress');
?>
</a></p>
<?php
}
/**
* Remove all cells from the data set that shall not be rendered, because they are hidden.
*
* @since 1.0.0
*/
protected function _prepare_render_data()
{
$orig_table = $this->table;
$num_rows = count($this->table['data']);
$num_columns = $num_rows > 0 ? count($this->table['data'][0]) : 0;
// Evaluate show/hide_rows/columns parameters.
$actions = array('show', 'hide');
$elements = array('rows', 'columns');
foreach ($actions as $action) {
foreach ($elements as $element) {
if (empty($this->render_options["{$action}_{$element}"])) {
$this->render_options["{$action}_{$element}"] = array();
continue;
}
// Add all rows/columns to array if "all" value set for one of the four parameters.
if ('all' === $this->render_options["{$action}_{$element}"]) {
$this->render_options["{$action}_{$element}"] = range(0, ${'num_' . $element} - 1);
continue;
}
// We have a list of rows/columns (possibly with ranges in it).
$this->render_options["{$action}_{$element}"] = explode(',', $this->render_options["{$action}_{$element}"]);
// Support for ranges like 3-6 or A-BA.
$range_cells = array();
foreach ($this->render_options["{$action}_{$element}"] as $key => $value) {
$range_dash = strpos($value, '-');
if (false !== $range_dash) {
unset($this->render_options["{$action}_{$element}"][$key]);
$start = substr($value, 0, $range_dash);
if (!is_numeric($start)) {
$start = TablePress::letter_to_number($start);
}
$end = substr($value, $range_dash + 1);
if (!is_numeric($end)) {
$end = TablePress::letter_to_number($end);
}
$current_range = range($start, $end);
$range_cells = array_merge($range_cells, $current_range);
}
}
$this->render_options["{$action}_{$element}"] = array_merge($this->render_options["{$action}_{$element}"], $range_cells);
/*
* Parse single letters and change from regular numbering to zero-based numbering,
* as rows/columns are indexed from 0 internally, but from 1 externally
*/
foreach ($this->render_options["{$action}_{$element}"] as $key => $value) {
if (!is_numeric($value)) {
$value = TablePress::letter_to_number($value);
}
$this->render_options["{$action}_{$element}"][$key] = (int) $value - 1;
}
// Remove duplicate entries and sort the array.
$this->render_options["{$action}_{$element}"] = array_unique($this->render_options["{$action}_{$element}"]);
sort($this->render_options["{$action}_{$element}"], SORT_NUMERIC);
}
}
// Load information about hidden rows and columns.
// Get indexes of hidden rows (array value of 0).
$hidden_rows = array_keys($this->table['visibility']['rows'], 0);
$hidden_rows = array_merge($hidden_rows, $this->render_options['hide_rows']);
$hidden_rows = array_diff($hidden_rows, $this->render_options['show_rows']);
// Get indexes of hidden columns (array value of 0).
$hidden_columns = array_keys($this->table['visibility']['columns'], 0);
$hidden_columns = array_merge($hidden_columns, $this->render_options['hide_columns']);
$hidden_columns = array_merge(array_diff($hidden_columns, $this->render_options['show_columns']));
// Remove hidden rows and re-index.
foreach ($hidden_rows as $row_idx) {
unset($this->table['data'][$row_idx]);
}
$this->table['data'] = array_merge($this->table['data']);
// Remove hidden columns and re-index.
foreach ($this->table['data'] as $row_idx => $row) {
foreach ($hidden_columns as $col_idx) {
unset($row[$col_idx]);
}
$this->table['data'][$row_idx] = array_merge($row);
}
/**
* Filter the table after processing the table visibility information.
*
* @since 1.0.0
*
* @param array $table The processed table.
* @param array $orig_table The unprocessed table.
* @param array $render_options The render options for the table.
*/
$this->table = apply_filters('tablepress_table_render_data', $this->table, $orig_table, $this->render_options);
}
/**
* Show a list of tables in the Editor toolbar Thickbox (opened by TinyMCE or Quicktags button)
*
* @since 1.0.0
*/
public function handle_get_action_editor_button_thickbox()
{
TablePress::check_nonce('editor_button_thickbox');
$this->init_i18n_support();
$view_data = array('tables' => $this->model_table->load_all());
set_current_screen('tablepress_editor_button_thickbox');
// Prepare, initialize, and render the view
$this->view = TablePress::load_view('editor_button_thickbox', $view_data);
$this->view->render();
}
请发表评论