← All changes
|
classes/views/frm-fields/back-end/inline-modal.php
+33
-11
6.4.2
→
trunk
View file →
| @@ -1,20 +1,42 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * Inline modal wrapper used inside field settings. | |
| 4 | + * | |
| 5 | + * @package Formidable | |
| 6 | + * | |
| 7 | + * @var array $args Modal arguments: dismiss-icon (bool), show (bool), class (string), id (string), title (string), inside_class (string), callback (callable), args (mixed). | |
| 8 | + */ | |
| 9 | + | |
| 2 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | 11 | die( 'You are not allowed to call this page directly.' ); |
| 4 | 12 | } |
| 13 | + | |
| 14 | +if ( ! $args['dismiss-icon'] ) { | |
| 15 | + $args['class'] .= ' frm-modal-no-dismiss'; | |
| 16 | +} | |
| 17 | + | |
| 18 | +if ( ! $args['show'] ) { | |
| 19 | + $args['class'] .= ' frm_hidden'; | |
| 20 | +} | |
| 5 | 21 | ?> |
| 6 | -<div class="frm-inline-modal frm-modal postbox <?php echo esc_attr( $args['class'] . ( $args['show'] ? '' : ' frm_hidden' ) ); ?>" id="<?php echo esc_attr( $args['id'] ); ?>"> | |
| 7 | - <a href="#" class="dismiss" title="<?php esc_attr_e( 'Close', 'formidable' ); ?>"> | |
| 8 | - <?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon', array( 'aria-label' => __( 'Close', 'formidable' ) ) ); ?> | |
| 9 | - </a> | |
| 10 | - <ul class="frm-nav-tabs"> | |
| 11 | - <li class="frm-tabs"> | |
| 12 | - <a href="#"> | |
| 13 | - <?php echo esc_html( $args['title'] ); ?> | |
| 14 | - </a> | |
| 15 | - </li> | |
| 16 | - </ul> | |
| 22 | +<div class="frm-inline-modal frm-modal postbox <?php echo esc_attr( $args['class'] ); ?>" id="<?php echo esc_attr( $args['id'] ); ?>"> | |
| 23 | + <?php if ( $args['dismiss-icon'] ) { ?> | |
| 24 | + <a href="#" class="dismiss" title="<?php esc_attr_e( 'Close', 'formidable' ); ?>"> | |
| 25 | + <?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon', array( 'aria-label' => __( 'Close', 'formidable' ) ) ); ?> | |
| 26 | + </a> | |
| 27 | + <?php } ?> | |
| 28 | + | |
| 29 | + <?php if ( $args['title'] ) { ?> | |
| 30 | + <ul class="frm-nav-tabs"> | |
| 31 | + <li class="frm-tabs"> | |
| 32 | + <a href="#"> | |
| 33 | + <?php echo esc_html( $args['title'] ); ?> | |
| 34 | + </a> | |
| 35 | + </li> | |
| 36 | + </ul> | |
| 37 | + <?php } ?> | |
| 38 | + | |
| 17 | 39 | <div class="<?php echo esc_attr( $args['inside_class'] ); ?>"> |
| 18 | 40 | <?php call_user_func( $args['callback'], $args['args'] ); ?> |
| 19 | 41 | </div> |
| 20 | 42 | </div> |