analytics.php
3 months ago
design-preview.php
1 year ago
design-settings.php
3 months ago
display-settings.php
3 months ago
floating-widget-settings.php
1 year ago
meta-accounts.php
1 year ago
meta-button-style.php
1 year ago
selected-accounts.php
1 year ago
settings.php
1 year ago
url-settings.php
3 months ago
user-role-settings.php
3 months ago
woocommerce-button.php
3 months ago
meta-accounts.php
119 lines
| 1 | <?php |
| 2 | use NTA_WhatsApp\Helper; |
| 3 | ?> |
| 4 | <table class="form-table" id="nta-custom-wc-button-settings"> |
| 5 | <tbody> |
| 6 | <tr> |
| 7 | <th scope="row"> |
| 8 | <label for="number"> |
| 9 | <?php echo esc_html__( 'Account Number or group chat URL', 'wp-whatsapp' ); ?> |
| 10 | </label> |
| 11 | </th> |
| 12 | <td> |
| 13 | <p> |
| 14 | <input type="text" class="widefat" id="number" name="number" value="<?php echo esc_attr( $meta['number'] ); ?>" autocomplete="off"> |
| 15 | </p> |
| 16 | <p class="description"> |
| 17 | <?php echo wp_kses_post( __( 'Refer to <a href="https://faq.whatsapp.com/en/general/21016748" target="_blank">https://faq.whatsapp.com/en/general/21016748</a> for a detailed explanation.', 'wp-whatsapp' ) ); ?> |
| 18 | </p> |
| 19 | </td> |
| 20 | </tr> |
| 21 | <tr> |
| 22 | <th scope="row"> |
| 23 | <label for="wa-title"><?php echo esc_html__( 'Title', 'wp-whatsapp' ); ?></label> |
| 24 | </th> |
| 25 | <td> |
| 26 | <input type="text" id="wa-title" name="title" value="<?php echo esc_attr( $meta['title'] ); ?>" class="widefat" autocomplete="off"> |
| 27 | </td> |
| 28 | </tr> |
| 29 | <tr> |
| 30 | <th scope="row"> |
| 31 | <label for="predefinedText"><?php echo esc_html__( 'Predefined Text', 'wp-whatsapp' ); ?></label> |
| 32 | </th> |
| 33 | <td> |
| 34 | <textarea name="predefinedText" id="predefinedText" rows="3" class="widefat"><?php echo esc_textarea( $meta['predefinedText'] ); ?></textarea> |
| 35 | <p class="description"> |
| 36 | <?php echo esc_html__( 'Use [njwa_page_title] and [njwa_page_url] shortcodes to output the page\'s title and URL respectively.', 'wp-whatsapp' ); ?> |
| 37 | </p> |
| 38 | </td> |
| 39 | </tr> |
| 40 | <tr> |
| 41 | <th scope="row"> |
| 42 | <label for="isAlwaysAvailable"><?php echo esc_html__( 'Always available online', 'wp-whatsapp' ); ?></label> |
| 43 | </th> |
| 44 | <td> |
| 45 | <div class="nta-wa-switch-control"> |
| 46 | <input type="checkbox" id="nta-wa-switch" name="isAlwaysAvailable" <?php checked( $meta['isAlwaysAvailable'], 'ON' ); ?>> |
| 47 | <label for="nta-wa-switch" class="green"></label> |
| 48 | </div> |
| 49 | </td> |
| 50 | </tr> |
| 51 | |
| 52 | <tr class="nta-btncustom-offline <?php echo ( 'ON' === $meta['isAlwaysAvailable'] ? 'hidden' : '' ); ?>"> |
| 53 | <th scope="row"> |
| 54 | <label><?php echo esc_html__( 'Custom Availability (PRO)', 'wp-whatsapp' ); ?></label> |
| 55 | </th> |
| 56 | <td> |
| 57 | <?php |
| 58 | $haveCustom = array_search( 'ON', array_column( $meta['daysOfWeekWorking'], 'isWorkingOnDay' ) ); |
| 59 | if ( false !== $haveCustom ) : |
| 60 | ?> |
| 61 | <p class="notice notice-warning" style="border-top: 0; border-bottom: 0; border-right: 0; box-shadow: none"> |
| 62 | <?php |
| 63 | printf( |
| 64 | __( 'This feature is now only available in Pro version.<br>If you still want to use it, please <a href="%1$s">Upgrade PRO</a> or turn back to <a href="%2$s">Version 2.6</a><br>Need help? <a href="%3$s" style="color: #444">Contact us</a>', 'wp-whatsapp' ), //phpcs:ignore |
| 65 | 'https://1.envato.market/Upgrade-WhatsApp-Pro', |
| 66 | 'https://downloads.wordpress.org/plugin/wp-whatsapp.2.6.zip', |
| 67 | 'https://ninjateam.org/support/' |
| 68 | ) |
| 69 | ?> |
| 70 | </p> |
| 71 | <?php endif; ?> |
| 72 | <table class="form-table time-available" style="pointer-events: none;"> |
| 73 | <tbody> |
| 74 | <?php foreach ( $daysOfWeek as $dayKey ) : ?> |
| 75 | <?php foreach ( $meta['daysOfWeekWorking'][ $dayKey ]['workHours'] as $i => $workHour ) : ?> |
| 76 | <tr class="working-<?php echo esc_attr( $dayKey ); ?>"> |
| 77 | <td width="150"> |
| 78 | <?php if ( 0 === $i ) : ?> |
| 79 | <input class="njt-wa-pro" type="checkbox" id="daysOfWeekWorking[<?php echo esc_attr( $dayKey ); ?>][isWorkingOnDay]" name="daysOfWeekWorking[<?php echo esc_attr( $dayKey ); ?>][isWorkingOnDay]" <?php checked( $meta['daysOfWeekWorking'][ $dayKey ]['isWorkingOnDay'], 'ON' ); ?>> |
| 80 | <label for="daysOfWeekWorking[<?php echo esc_attr( $dayKey ); ?>][isWorkingOnDay]"><?php echo esc_html__( ucfirst( $dayKey ), 'wp-whatsapp' ); ?> </label> |
| 81 | <?php endif ?> |
| 82 | </td> |
| 83 | <td width="100"> |
| 84 | <select class="njt-wa-pro" name="daysOfWeekWorking[<?php echo esc_attr( $dayKey ); ?>][workHours][<?php echo esc_attr( $i ); ?>][startTime]" class="start-time"><?php echo ( Helper::buildTimeSelector( $workHour['startTime'] ) ); ?></select> |
| 85 | </td> |
| 86 | <td width="100"> |
| 87 | <select class="njt-wa-pro" name="daysOfWeekWorking[<?php echo esc_attr( $dayKey ); ?>][workHours][<?php echo esc_attr( $i ); ?>][endTime]" class="end-time"><?php echo ( Helper::buildTimeSelector( $workHour['endTime'] ) ); ?></select> |
| 88 | </td> |
| 89 | <?php if ( 0 === $i ) : ?> |
| 90 | <td><a href="javascript:;" class="add-custom-time">Add</a></td> |
| 91 | <?php endif; ?> |
| 92 | <?php if ( 0 !== $i ) : ?> |
| 93 | <td><a style="color: #a00" href="javascript:;" class="remove-custom-time">Remove</a></td> |
| 94 | <?php endif; ?> |
| 95 | <?php if ( 'sunday' === $dayKey && 0 === $i ) : ?> |
| 96 | <td> |
| 97 | <a href="javascript:;" type="button" class="button" id="btn-apply-time"><?php echo esc_html__( 'Apply to All Days', 'wp-whatsapp' ); ?></button> |
| 98 | </td> |
| 99 | <?php endif ?> |
| 100 | </tr> |
| 101 | <?php endforeach; ?> |
| 102 | <?php endforeach; ?> |
| 103 | </tbody> |
| 104 | </table> |
| 105 | </td> |
| 106 | </tr> |
| 107 | <tr class="nta-btncustom-offline <?php echo ( 'ON' === $meta['isAlwaysAvailable'] ? 'hidden' : '' ); ?>"> |
| 108 | <th scope="row"><label for="willBeBackText"><?php echo esc_html__( 'Description text when offline (PRO)', 'wp-whatsapp' ); ?></label></th> |
| 109 | <td> |
| 110 | <input type="text" id="willBeBackText" name="willBeBackText" value="<?php echo esc_attr( $meta['willBeBackText'] ); ?>" class="widefat njt-wa-pro" autocomplete="off" readonly> |
| 111 | <p class="description"><?php echo esc_html__( 'You can use shortcode [njwa_time_work] to display the exact time this account is back to work on a working day.', 'wp-whatsapp' ); ?></p> |
| 112 | <input type="text" id="dayOffsText" name="dayOffsText" value="<?php echo esc_attr( $meta['dayOffsText'] ); ?>" class="widefat njt-wa-pro" autocomplete="off" readonly> |
| 113 | <p class="description"><?php echo esc_html__( 'You can use this text to display on days this account does not work.', 'wp-whatsapp' ); ?> |
| 114 | </p> |
| 115 | </td> |
| 116 | </tr> |
| 117 | </tbody> |
| 118 | </table> |
| 119 |