breznflow/includes/Admin/views/list.php
Michael fd83e4810b BreznFlow 1.0.0 — WordPress.org submission
Initial public release of BreznFlow, an n8n workflow renderer for WordPress.
Fully PHPCS-compliant (WordPress Coding Standards), security-hardened,
and ready for WordPress.org plugin review.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 11:27:36 +00:00

65 lines
2 KiB
PHP

<?php
/**
* Template: Workflow list table page.
*
* @package BreznFlow
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- template file, not global scope
/**
* The workflow list table instance passed from AdminMenu.
*
* @var \BreznFlow\Admin\WorkflowListTable $table
*/
?>
<div class="wrap breznflow-list-page">
<h1 class="wp-heading-inline"><?php esc_html_e( 'Workflows', 'breznflow' ); ?></h1>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=breznflow-add' ) ); ?>" class="page-title-action">
<?php esc_html_e( 'Add Workflow', 'breznflow' ); ?>
</a>
<?php if ( isset( $_GET['deleted'] ) ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
<div class="notice notice-success is-dismissible">
<p>
<?php
$deleted_count = absint( $_GET['deleted'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
printf(
/* translators: %d: number of deleted workflows */
esc_html( _n( '%d workflow moved to trash.', '%d workflows moved to trash.', $deleted_count, 'breznflow' ) ),
absint( $deleted_count )
);
?>
</p>
</div>
<?php endif; ?>
<?php if ( isset( $_GET['published'] ) ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
<div class="notice notice-success is-dismissible">
<p>
<?php
$pid = isset( $_GET['post_id'] ) ? (int) $_GET['post_id'] : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( $pid > 0 ) {
$sc = '[breznflow id="' . $pid . '"]';
printf(
/* translators: %s: shortcode string */
esc_html__( 'Workflow published! Use shortcode: %s', 'breznflow' ),
'<code>' . esc_html( $sc ) . '</code>'
);
} else {
esc_html_e( 'Workflow published!', 'breznflow' );
}
?>
</p>
</div>
<?php endif; ?>
<form method="get">
<input type="hidden" name="page" value="breznflow" />
<?php $table->display(); ?>
</form>
</div>