Server IP : 172.67.216.182 / Your IP : 104.23.175.175 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/wwwroot/coircraft.com/wp-content/plugins/wpforms-lite/src/Admin/Builder/ |
Upload File : |
<?php namespace WPForms\Admin\Builder; /** * Form Builder Keyboard Shortcuts modal content. * * @since 1.6.9 */ class Shortcuts { /** * Initialize class. * * @since 1.6.9 */ public function init() { // Terminate initialization if not in builder. if ( ! wpforms_is_admin_page( 'builder' ) ) { return; } $this->hooks(); } /** * Hooks. * * @since 1.6.9 */ private function hooks() { add_filter( 'wpforms_builder_strings', [ $this, 'builder_strings' ], 10, 2 ); add_action( 'wpforms_admin_page', [ $this, 'output' ], 30 ); } /** * Get shortcuts list. * * @since 1.6.9 * * @return array */ private function get_list() { return [ 'left' => [ 'ctrl s' => __( 'Save Form', 'wpforms-lite' ), 'ctrl p' => __( 'Preview Form', 'wpforms-lite' ), 'ctrl b' => __( 'Embed Form', 'wpforms-lite' ), 'ctrl f' => __( 'Search Fields', 'wpforms-lite' ), ], 'right' => [ 'ctrl h' => __( 'Open Help', 'wpforms-lite' ), 'ctrl t' => __( 'Toggle Sidebar', 'wpforms-lite' ), 'ctrl e' => __( 'View Entries', 'wpforms-lite' ), 'ctrl q' => __( 'Close Builder', 'wpforms-lite' ), ], ]; } /** * Add Form builder strings. * * @since 1.6.9 * * @param array $strings Form Builder strings. * @param \WP_Post|bool $form Form object. * * @return array */ public function builder_strings( $strings, $form ) { $strings['shortcuts_modal_title'] = esc_html__( 'Keyboard Shortcuts', 'wpforms-lite' ); $strings['shortcuts_modal_msg'] = esc_html__( 'Handy shortcuts for common actions in the builder.', 'wpforms-lite' ); return $strings; } /** * Generate and output shortcuts modal content as the wp.template. * * @since 1.6.9 */ public function output() { echo ' <script type="text/html" id="tmpl-wpforms-builder-keyboard-shortcuts"> <div class="wpforms-columns wpforms-columns-2">'; foreach ( $this->get_list() as $list ) { echo "<ul class='wpforms-column'>"; foreach ( $list as $key => $label ) { $key = explode( ' ', $key ); printf( '<li> %1$s <span> <i>%2$s</i><i>%3$s</i> </span> </li>', esc_html( $label ), esc_html( $key[0] ), esc_html( $key[1] ) ); } echo '</ul>'; } echo ' </div> </script>'; } }