| @@ -4,14 +4,8 @@ | ||
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | class FrmTipsHelper { |
| 7 | 7 | |
| 8 | - /** | |
| 9 | - * @param string $callback | |
| 10 | - * @param string $html | |
| 11 | - * | |
| 12 | - * @return void | |
| 13 | - */ | |
| 14 | 8 | public static function pro_tip( $callback, $html = '' ) { |
| 15 | 9 | if ( FrmAppHelper::pro_is_installed() ) { |
| 16 | 10 | return; |
| 17 | 11 | } |
| @@ -18,50 +12,29 @@ | ||
| 18 | 12 | |
| 19 | 13 | $tips = self::$callback(); |
| 20 | 14 | $tip = self::get_random_tip( $tips ); |
| 21 | 15 | |
| 22 | - self::show_tip( $tip ); | |
| 23 | - } | |
| 16 | + if ( 'p' === $html ) { | |
| 17 | + echo '<p class="frmcenter frm_no_top_margin">'; | |
| 18 | + } | |
| 24 | 19 | |
| 25 | - /** | |
| 26 | - * Shows tip. | |
| 27 | - * | |
| 28 | - * @since 6.0 | |
| 29 | - * | |
| 30 | - * @param array $tip { | |
| 31 | - * Tip args | |
| 32 | - * | |
| 33 | - * @type array $link Tip link data. See the first parameter of {@see FrmAppHelper::admin_upgrade_link()} for more details. | |
| 34 | - * @type string $page The based link of the tip. If this is empty, `https://formidableforms.com/lite-upgrade/` will | |
| 35 | - * be used. Otherwise, `https://formidableforms.com/{$page}` will be used. | |
| 36 | - * @type string $tip Tip text. | |
| 37 | - * @type string $call Call to action text. | |
| 38 | - * } | |
| 39 | - * @param string $html | |
| 40 | - * | |
| 41 | - * @return void | |
| 42 | - */ | |
| 43 | - public static function show_tip( $tip, $html = '' ) { | |
| 44 | 20 | if ( ! isset( $tip['page'] ) ) { |
| 45 | 21 | $tip['page'] = ''; |
| 46 | 22 | } |
| 47 | - if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) { | |
| 23 | + if ( ! isset( $tip['link']['medium'] ) ) { | |
| 48 | 24 | $tip['link']['medium'] = 'tip'; |
| 49 | 25 | } |
| 50 | 26 | |
| 51 | - if ( 'p' === $html ) { | |
| 52 | - echo '<p class="frmcenter frm-mt-0">'; | |
| 53 | - } | |
| 54 | - | |
| 55 | - $link = empty( $tip['link'] ) ? $tip['page'] : FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] ); | |
| 27 | + $link = FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] ); | |
| 56 | 28 | ?> |
| 57 | - <a href="<?php echo esc_url( $link ); ?>" <?php echo empty( $tip['link'] ) ? '' : 'target="_blank"'; ?> class="frm_pro_tip"> | |
| 58 | - <?php FrmAppHelper::icon_by_class( 'frmfont frm_lightning', array( 'aria-hidden' => 'true' ) ); ?> | |
| 29 | + <a href="<?php echo esc_url( $link ); ?>" target="_blank" class="frm_pro_tip"> | |
| 30 | + <?php FrmAppHelper::icon_by_class( 'frmfont frm_star_full_icon', array( 'aria-hidden' => 'true' ) ); ?> | |
| 31 | + <span class="pro-tip"> | |
| 32 | + <?php esc_html_e( 'Pro Tip:', 'formidable' ); ?> | |
| 33 | + </span> | |
| 59 | 34 | |
| 60 | 35 | <?php if ( isset( $tip['call'] ) ) { ?> |
| 61 | - <span class="frm-tip-info"> | |
| 62 | - <?php echo esc_html( $tip['tip'] ); ?> | |
| 63 | - </span> | |
| 36 | + <?php echo esc_html( $tip['tip'] ); ?> | |
| 64 | 37 | <span class="frm-tip-cta"> |
| 65 | 38 | <?php echo esc_html( $tip['call'] ); ?> |
| 66 | 39 | </span> |
| 67 | 40 | <?php } else { ?> |
| @@ -70,17 +43,13 @@ | ||
| 70 | 43 | </span> |
| 71 | 44 | <?php } ?> |
| 72 | 45 | </a> |
| 73 | 46 | <?php |
| 74 | - | |
| 75 | 47 | if ( 'p' === $html ) { |
| 76 | 48 | echo '</p>'; |
| 77 | 49 | } |
| 78 | 50 | } |
| 79 | 51 | |
| 80 | - /** | |
| 81 | - * @return array | |
| 82 | - */ | |
| 83 | 52 | public static function get_builder_tip() { |
| 84 | 53 | $tips = array( |
| 85 | 54 | array( |
| 86 | 55 | 'link' => array( |
| @@ -134,11 +103,8 @@ | ||
| 134 | 103 | |
| 135 | 104 | return $tips; |
| 136 | 105 | } |
| 137 | 106 | |
| 138 | - /** | |
| 139 | - * @return array | |
| 140 | - */ | |
| 141 | 107 | public static function get_form_settings_tip() { |
| 142 | 108 | $tips = array( |
| 143 | 109 | array( |
| 144 | 110 | 'link' => array( |
| @@ -157,8 +123,15 @@ | ||
| 157 | 123 | 'call' => __( 'Let users save drafts and return later!', 'formidable' ), |
| 158 | 124 | ), |
| 159 | 125 | array( |
| 160 | 126 | 'link' => array( |
| 127 | + 'content' => 'ajax', | |
| 128 | + ), | |
| 129 | + 'tip' => __( 'Want to submit forms without reloading the page?', 'formidable' ), | |
| 130 | + 'call' => __( 'Get ajax form submit.', 'formidable' ), | |
| 131 | + ), | |
| 132 | + array( | |
| 133 | + 'link' => array( | |
| 161 | 134 | 'content' => 'form-scheduling', |
| 162 | 135 | 'param' => 'schedule-forms-wordpress', |
| 163 | 136 | ), |
| 164 | 137 | 'tip' => __( 'Want your form open only for a certain time period?', 'formidable' ), |
| @@ -168,11 +141,8 @@ | ||
| 168 | 141 | |
| 169 | 142 | return $tips; |
| 170 | 143 | } |
| 171 | 144 | |
| 172 | - /** | |
| 173 | - * @return array | |
| 174 | - */ | |
| 175 | 145 | public static function get_form_action_tip() { |
| 176 | 146 | $tips = array( |
| 177 | 147 | array( |
| 178 | 148 | 'link' => array( |
| @@ -203,9 +173,9 @@ | ||
| 203 | 173 | 'content' => 'mailchimp', |
| 204 | 174 | 'page' => 'mailchimp-tip', |
| 205 | 175 | ), |
| 206 | 176 | 'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ), |
| 207 | - 'call' => __( 'Send leads straight to Mailchimp.', 'formidable' ), | |
| 177 | + 'call' => __( 'Send leads straight to MailChimp.', 'formidable' ), | |
| 208 | 178 | ), |
| 209 | 179 | array( |
| 210 | 180 | 'link' => array( |
| 211 | 181 | 'content' => 'paypal-revenue', |
| @@ -253,24 +223,13 @@ | ||
| 253 | 223 | ), |
| 254 | 224 | 'tip' => __( 'Send an SMS message when a form is submitted.', 'formidable' ), |
| 255 | 225 | 'call' => __( 'Get the Twilio integration.', 'formidable' ), |
| 256 | 226 | ), |
| 257 | - array( | |
| 258 | - 'link' => array( | |
| 259 | - 'content' => 'acf-tip', | |
| 260 | - 'param' => 'acf-tip', | |
| 261 | - ), | |
| 262 | - 'tip' => __( 'Fill Advanced Custom Fields from a form.', 'formidable' ), | |
| 263 | - 'call' => __( 'Add ACF Integration', 'formidable' ), | |
| 264 | - ), | |
| 265 | 227 | ); |
| 266 | 228 | |
| 267 | 229 | return $tips; |
| 268 | 230 | } |
| 269 | 231 | |
| 270 | - /** | |
| 271 | - * @return array | |
| 272 | - */ | |
| 273 | 232 | public static function get_styling_tip() { |
| 274 | 233 | $tips = array( |
| 275 | 234 | array( |
| 276 | 235 | 'link' => array( |
| @@ -279,32 +238,13 @@ | ||
| 279 | 238 | ), |
| 280 | 239 | 'tip' => __( 'Make your sidebar and footer forms stand out.', 'formidable' ), |
| 281 | 240 | 'call' => __( 'Use multiple style templates.', 'formidable' ), |
| 282 | 241 | ), |
| 283 | - array( | |
| 284 | - 'link' => array( | |
| 285 | - 'content' => 'style', | |
| 286 | - 'param' => 'bg-image-style-settings', | |
| 287 | - ), | |
| 288 | - 'tip' => __( 'Want to add a background image?', 'formidable' ), | |
| 289 | - 'call' => __( 'Upgrade to Pro.', 'formidable' ), | |
| 290 | - ), | |
| 291 | - array( | |
| 292 | - 'link' => array( | |
| 293 | - 'content' => 'style', | |
| 294 | - 'param' => 'duplicate-style', | |
| 295 | - ), | |
| 296 | - 'tip' => __( 'Want to duplicate a style?', 'formidable' ), | |
| 297 | - 'call' => __( 'Upgrade to Pro.', 'formidable' ), | |
| 298 | - ), | |
| 299 | 242 | ); |
| 300 | 243 | |
| 301 | 244 | return $tips; |
| 302 | 245 | } |
| 303 | 246 | |
| 304 | - /** | |
| 305 | - * @return array | |
| 306 | - */ | |
| 307 | 247 | public static function get_entries_tip() { |
| 308 | 248 | $tips = array( |
| 309 | 249 | array( |
| 310 | 250 | 'link' => array( |
| @@ -335,11 +275,8 @@ | ||
| 335 | 275 | |
| 336 | 276 | return $tips; |
| 337 | 277 | } |
| 338 | 278 | |
| 339 | - /** | |
| 340 | - * @return array | |
| 341 | - */ | |
| 342 | 279 | public static function get_import_tip() { |
| 343 | 280 | $tips = array( |
| 344 | 281 | array( |
| 345 | 282 | 'link' => array( |
| @@ -353,11 +290,8 @@ | ||
| 353 | 290 | |
| 354 | 291 | return $tips; |
| 355 | 292 | } |
| 356 | 293 | |
| 357 | - /** | |
| 358 | - * @return array | |
| 359 | - */ | |
| 360 | 294 | public static function get_banner_tip() { |
| 361 | 295 | $tips = array( |
| 362 | 296 | array( |
| 363 | 297 | 'link' => array( |
| @@ -380,9 +314,9 @@ | ||
| 380 | 314 | 'medium' => 'banner', |
| 381 | 315 | 'content' => 'automate', |
| 382 | 316 | ), |
| 383 | 317 | 'tip' => __( 'Automate your business and increase revenue.', 'formidable' ), |
| 384 | - 'call' => __( 'Collect instant payments, and send leads to Mailchimp.', 'formidable' ), | |
| 318 | + 'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ), | |
| 385 | 319 | ), |
| 386 | 320 | ); |
| 387 | 321 | $random = rand( 0, count( $tips ) - 1 ); |
| 388 | 322 | $tip = $tips[ $random ]; |