assemble( $post_id ); include PRAUTOBLOGGER_PLUGIN_DIR . 'templates/admin/dossier-page.php'; } /** * Enqueue dossier-specific CSS + JS. * * The hook suffix for an options.php-parent page is `admin_page_{slug}`. * * @param string $hook_suffix Current admin page hook suffix. * @return void */ public function on_enqueue_assets( string $hook_suffix ): void { // options.php-parent pages resolve to 'admin_page_{slug}' (not 'prautoblogger_page_*'). $dossier_hook = 'admin_page_' . self::PAGE_SLUG; if ( $hook_suffix !== $dossier_hook ) { return; } wp_enqueue_style( 'prautoblogger-dossier', PRAUTOBLOGGER_PLUGIN_URL . 'assets/css/dossier.css', array( 'prautoblogger-admin' ), PRAUTOBLOGGER_VERSION ); wp_enqueue_script( 'prautoblogger-dossier', PRAUTOBLOGGER_PLUGIN_URL . 'assets/js/dossier.js', array(), PRAUTOBLOGGER_VERSION, true ); // M3: edit + re-run layer (separate files; dossier.css is not grown). wp_enqueue_style( 'prautoblogger-dossier-edit', PRAUTOBLOGGER_PLUGIN_URL . 'assets/css/dossier-edit.css', array( 'prautoblogger-dossier' ), PRAUTOBLOGGER_VERSION ); wp_enqueue_script( 'prautoblogger-dossier-edit', PRAUTOBLOGGER_PLUGIN_URL . 'assets/js/dossier-edit.js', array(), PRAUTOBLOGGER_VERSION, true ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only context resolution for script config. $post_id = isset( $_GET['post_id'] ) ? absint( $_GET['post_id'] ) : 0; wp_localize_script( 'prautoblogger-dossier-edit', 'prabDossierEdit', array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( PRAutoBlogger_Dossier_Actions::NONCE_ACTION ), 'postId' => $post_id, // Settings read at point of use -- same poll setting as the board. 'pollInterval' => max( 3, (int) get_option( 'prautoblogger_board_poll_interval', 5 ) ), 'strings' => array( 'saving' => __( 'Saving…', 'prautoblogger' ), 'error' => __( 'Request failed — try again.', 'prautoblogger' ), 'queued' => __( 'Queued…', 'prautoblogger' ), 'rerunFromLabel' => __( 'Re-run from here', 'prautoblogger' ), 'confirmReplay' => __( 'Queue a re-run of this stage with your edited input? This makes a new LLM call billed against this run\'s ceiling, and all downstream stages will be marked stale (nothing re-runs automatically).', 'prautoblogger' ), 'confirmRerunFrom' => __( 'Queue a re-run of this stage AND every stage after it? Each re-run stage makes new LLM calls billed against this run\'s ceiling. The article draft will be refreshed; published posts are never touched.', 'prautoblogger' ), ), ) ); } /** * Build the URL to the dossier for a given post. * * Deep-link URLs use admin.php?page= which is parent-agnostic. * This method is unchanged from v0.19.2 -- only the registration parent changed. * * @param int $post_id WordPress post ID. * @return string Admin URL to the dossier page. */ public static function url_for_post( int $post_id ): string { return admin_url( 'admin.php?page=' . self::PAGE_SLUG . '&post_id=' . $post_id ); } }