' . esc_html( $text ) . '

'; } /** * A bulleted list of plain items. * * @param string[] $items Items (plain, escaped here). * @return string */ public static function ul( array $items ) { return ''; } /** * Which text depends on what, on a site in several languages (shown in the Guide tab and in its contextual help). * * @return array Pairs of title and explanation. */ public static function languages_guide() { return array( array( __( 'The texts of the plugin', 'vefmultibooking' ), __( 'The buttons, labels and messages that come with the plugin are translated by its language file, whatever multilingual plugin you use. If they stay in English, look for translation updates in Dashboard › Updates.', 'vefmultibooking' ), ), array( __( 'The texts you type', 'vefmultibooking' ), __( 'The names and descriptions of your offers and resources, the extras, the questions and the email texts are your own: translate them with Polylang (Languages › Translations) or WPML (String Translation, group "VEFmultiBooking").', 'vefmultibooking' ), ), array( __( 'Your pages and menus', 'vefmultibooking' ), __( 'The pages and menus belong to WordPress and to your multilingual plugin: create one page for each language, with the booking block on each of them.', 'vefmultibooking' ), ), ); } /** * A numbered list of plain steps. * * @param string[] $steps Steps (plain, escaped here). * @return string */ public static function steps( array $steps ) { return '
    ' . implode( '', array_map( static function ( $step ) { return '
  1. ' . esc_html( $step ) . '
  2. '; }, $steps ) ) . '
'; } /** * A list of terms, each with its explanation. * * @param array $terms Pairs of term and explanation (plain, escaped here). * @return string */ public static function terms( array $terms ) { return ''; } /** * One help tab. * * @param string $id Short identifier. * @param string $title Title shown on the left of the help panel. * @param string $content HTML built with the helpers above. * @return array{id:string,title:string,content:string} */ private static function topic( $id, $title, $content ) { return array( 'id' => $id, 'title' => $title, 'content' => $content ); } /** * The help topics of a tab. * * @param string $tab Tab slug. * @return array */ public static function get_topics( $tab ) { $summaries = self::summaries(); $topics = array(); if ( isset( $summaries[ $tab ] ) ) { $topics[] = self::topic( 'overview', __( 'Overview', 'vefmultibooking' ), self::p( $summaries[ $tab ] ) . '

' . esc_html__( 'Read the full help online', 'vefmultibooking' ) . '

' ); } /** * Lets VEFmultiBooking Pro (or another extension) add help topics to a screen, or give the help of * its own tabs. * * @param array $topics Topics of the screen. * @param string $tab Tab slug. */ $topics = apply_filters( 'vefmb_admin_help_tabs', $topics, $tab ); // Older extensions give one text per tab: it becomes a single topic. if ( empty( $topics ) ) { /** * Older way for an extension to give the help of its own tabs: one text per tab. * * @param string $content Text (empty by default). * @param string $tab Tab slug. */ $legacy = (string) apply_filters( 'vefmb_admin_contextual_help_content', '', $tab ); if ( '' !== $legacy ) { $topics[] = self::topic( 'overview', __( 'Overview', 'vefmultibooking' ), self::p( $legacy ) ); } } return $topics; } /** * The blocks (modules, widgets) the plugin adds to the page builders, with what each one is for and how to * use it well. Shown in the Guide tab and as a topic of the contextual help. VEFmultiBooking Pro adds its * own blocks through the `vefmb_help_blocks` filter. * * @return array}> */ public static function blocks() { $blocks = array( array( 'title' => __( 'VEF Booking', 'vefmultibooking' ), 'purpose' => __( 'The complete booking module: the visitor chooses an offer, a date, fills in the details and contact, then pays or confirms. It ends with a confirmation.', 'vefmultibooking' ), 'tips' => array(), ), array( 'title' => __( 'VEF Offers', 'vefmultibooking' ), 'purpose' => __( 'A catalog of your published offers, each with its description, its price and a "Book" button.', 'vefmultibooking' ), 'tips' => array(), ), array( 'title' => __( 'VEF Availability', 'vefmultibooking' ), 'purpose' => __( 'A month calendar that shows visitors which days can be booked and which are full. It is read only: a free day opens the booking page on that day.', 'vefmultibooking' ), 'tips' => array(), ), array( 'title' => __( 'VEF Booking Summary', 'vefmultibooking' ), 'purpose' => __( 'The summary of one booking: number, offer, dates, persons, lines, total, amount paid and balance to pay.', 'vefmultibooking' ), 'tips' => array(), ), ); /** * Lets VEFmultiBooking Pro (or another extension) describe its own blocks in the Help. * * @param array $blocks Each item: title, purpose, tips (list of strings). */ return (array) apply_filters( 'vefmb_help_blocks', $blocks ); } /** * Registers the help of a tab on a screen: its topics and the sidebar of useful links. * * @param string $tab Tab slug. * @param WP_Screen $screen Screen. * @return void */ public static function register( $tab, $screen ) { foreach ( self::get_topics( $tab ) as $topic ) { $screen->add_help_tab( array( 'id' => 'vefmb-help-' . $tab . '-' . $topic['id'], 'title' => $topic['title'], 'content' => wp_kses_post( $topic['content'] ), ) ); } $screen->set_help_sidebar( '

' . esc_html__( 'More help', 'vefmultibooking' ) . '

' . '

' . esc_html__( 'Getting started guide', 'vefmultibooking' ) . '

' . '

' . esc_html__( 'Support and feature requests', 'vefmultibooking' ) . '

' . '

' . esc_html__( 'Plugin page', 'vefmultibooking' ) . '

' ); } /** * Address of the full help of a screen, on the publisher's site. The pages hold the complete text, so the * plugin only carries a short summary of each screen (fewer texts to translate, one place to keep up to date). * * @param string $tab Tab slug. * @return string */ public static function online_url( $tab ) { $slug = 'help' === $tab ? 'guide' : sanitize_key( $tab ); $url = 'https://v-images.com/plugin-vefmultibooking/help/' . $slug . '/'; /** * Lets an extension or a site point to another address for the full help of a screen. * * @param string $url Address. * @param string $tab Tab slug. */ return (string) apply_filters( 'vefmb_admin_help_online_url', $url, $tab ); } /** * The short summary of each screen. * * @return array Text by tab slug. */ private static function summaries() { return array( 'dashboard' => __( 'What needs your attention over the next 14 days, and the bookings waiting for your validation.', 'vefmultibooking' ), 'calendar' => __( 'Your bookings under several views. Drag a booking to another day to move it: availability is checked again first.', 'vefmultibooking' ), 'bookings' => __( 'Every booking, whatever the way it was made. Open one to confirm, validate or cancel it, to see its payments or to write to the customer. "+ Manual booking" enters one yourself.', 'vefmultibooking' ), 'customers' => __( 'Search a customer by name or email to see their contact details and all their bookings.', 'vefmultibooking' ), 'offers' => __( 'An offer is what the customer buys. Link the resources it uses, set its prices, options and questions, then publish it.', 'vefmultibooking' ), 'resources' => __( 'A resource is everything that can be booked. Choose its kind, then its settings: how it is booked follows its availability.', 'vefmultibooking' ), 'availability' => __( 'When a resource can be booked: recurring rules and slots for an activity, nights for an accommodation, blocked periods and seasons.', 'vefmultibooking' ), 'staff' => __( 'List the people who run your activities, then switch on the activities each one can run.', 'vefmultibooking' ), 'setup' => __( 'The guide takes you step by step through everything needed to sell something. The points to correct never block anything.', 'vefmultibooking' ), 'seasons' => __( 'A season is a named period of the year, defined once and picked in opening periods and in prices.', 'vefmultibooking' ), 'settings' => __( 'Booking rules, currency and online payment (start with the test mode of Stripe and PayPal), and the display of the admin.', 'vefmultibooking' ), 'emails' => __( 'The automatic emails sent to your customers and to you. Edit each template and use the tokens in curly braces to insert the booking details.', 'vefmultibooking' ), 'style' => __( 'The default look of the widgets: fonts, colors, shape, shadows and layout. Each block of your page builder can override it.', 'vefmultibooking' ), 'help' => __( 'A step-by-step guide to set the plugin up, the blocks it adds and what is translated where.', 'vefmultibooking' ), 'licenses' => __( 'About the plugin, the free and Pro versions, the versions available and the optional free license.', 'vefmultibooking' ), 'diagnostic' => __( 'Technical information for a support request, the support form and the temporary support access, which you open and close yourself.', 'vefmultibooking' ), ); } }