diff --git a/README.md b/README.md index cd936aa..471d682 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,12 @@ Then Please go to Frontend Dashboard | Frontend Dashboard | Login (Tab) | Settin 6. [fed_user role=user_role] to generate the role based user page ### Changelog + +**v1.1 [11-August-2017]** +* Added more filter and action hooks for developers +* Minor: Bug fixed + + **v1.0 [04-August-2017]** - Public release diff --git a/admin/assets/fed_admin_script.js b/admin/assets/fed_admin_script.js index 1e97b9f..a8e86a8 100644 --- a/admin/assets/fed_admin_script.js +++ b/admin/assets/fed_admin_script.js @@ -250,7 +250,7 @@ jQuery(document).ready(function ($) { } - e.preventDefault; + e.preventDefault(); }); $('.fed_add_edit_input_container .fed_button.active').trigger('click'); diff --git a/admin/assets/fed_admin_style.css b/admin/assets/fed_admin_style.css index f70fe2e..314cf80 100644 --- a/admin/assets/fed_admin_style.css +++ b/admin/assets/fed_admin_style.css @@ -528,6 +528,12 @@ Loader border: 1px solid #e0e0e0; cursor: pointer; } +.bc_fed.fed_plugins .thumbnail > img, .bc_fed.fed_plugins .thumbnail a > img { + width: 100% !important; +} +.bc_fed.fed_plugins .thumbnail { + padding:0 !important; +} .bc_fed .fed_buttons_container .fed_button.active { background-color: #00B5AD; color: white; diff --git a/admin/function-admin.php b/admin/function-admin.php index d209f1a..dd98b8f 100644 --- a/admin/function-admin.php +++ b/admin/function-admin.php @@ -124,123 +124,90 @@ function fed_profile_enable_disable( $condition = '', $type = '' ) { * @return string */ function fed_get_input_details( $attr ) { - - $placeholder = isset( $attr['placeholder'] ) && $attr['placeholder'] != '' ? esc_attr( $attr['placeholder'] ) : ''; - $class = isset( $attr['class_name'] ) && $attr['class_name'] != '' ? 'form-control ' . esc_attr( $attr['class_name'] ) : 'form-control'; - $name = isset( $attr['input_meta'] ) && $attr['input_meta'] != '' ? esc_attr( $attr['input_meta'] ) : $attr['input_meta']; - $value = isset( $attr['user_value'] ) && $attr['user_value'] != '' ? $attr['user_value'] : ''; - $required = isset( $attr['is_required'] ) && $attr['is_required'] == 'true' ? 'required="required"' : ''; -// $required = isset( $attr['is_required'] ) && $attr['is_required'] == 'true' ? '' : ''; - $id = isset( $attr['id_name'] ) && $attr['id_name'] != '' ? $attr['id_name'] : ''; - $input = ''; - $readonly = isset( $attr['readonly'] ) && $attr['readonly'] != '' ? esc_attr( $attr['readonly'] ) : ''; - - $attr['extended'] = isset( $attr['extended'] ) ? ( is_string( $attr['extended'] ) ? unserialize( $attr['extended'] ) : $attr['extended'] ) : array(); - - $altFormat = isset( $attr['extended']['date_format'] ) && $attr['extended']['date_format'] != '' ? esc_attr( $attr['extended']['date_format'] ) : 'm-d-Y'; - - $dateFormat = isset( $attr['extended']['date_format'] ) && $attr['extended']['date_format'] != '' ? esc_attr( $attr['extended']['date_format'] ) : 'm-d-Y'; - - $mode = isset( $attr['extended']['date_mode'] ) && $attr['extended']['date_mode'] != '' ? esc_attr( $attr['extended']['date_mode'] ) : 'single'; - - $enableTime = isset( $attr['extended']['enable_time'] ) && $attr['extended']['enable_time'] != '' ? esc_attr( $attr['extended']['enable_time'] ) : false; - - $time_24hr = isset( $attr['extended']['time_24hr'] ) && $attr['extended']['time_24hr'] != '' ? esc_attr( $attr['extended']['time_24hr'] ) : false; - - switch ( $attr['input_type'] ) { + $values = array(); + $values['placeholder'] = isset( $attr['placeholder'] ) && $attr['placeholder'] != '' ? esc_attr( $attr['placeholder'] ) : ''; + $values['input_type'] = isset( $attr['input_type'] ) && $attr['input_type'] != '' ? esc_attr( $attr['input_type'] ) : 'text'; + $values['class'] = isset( $attr['class_name'] ) && $attr['class_name'] != '' ? 'form-control ' . esc_attr( $attr['class_name'] ) : 'form-control'; + $values['name'] = isset( $attr['input_meta'] ) && $attr['input_meta'] != '' ? esc_attr( $attr['input_meta'] ) : 'BUG'; + $values['value'] = isset( $attr['user_value'] ) && $attr['user_value'] != '' ? $attr['user_value'] : ''; + $values['required'] = isset( $attr['is_required'] ) && $attr['is_required'] == 'true' ? 'required="required"' : ''; + $values['id'] = isset( $attr['id_name'] ) && $attr['id_name'] != '' ? $attr['id_name'] : ''; + $values['default_value'] = isset( $attr['default_value'] ) && $attr['default_value'] != '' ? $attr['default_value'] : 'yes'; + $input = ''; + $values['readonly'] = isset( $attr['readonly'] ) && $attr['readonly'] === true ? 'readonly=readonly' : ''; + $values['disabled'] = isset( $attr['disabled'] ) && $attr['disabled'] === true ? 'disabled=disabled' : ''; + + $label = isset( $attr['label'] ) ? $attr['label'] : ''; + $values['extended'] = isset( $attr['extended'] ) ? ( is_string( $attr['extended'] ) ? unserialize( $attr['extended'] ) : $attr['extended'] ) : array(); + + $values['extra'] = isset( $attr['extra'] ) ? $attr['extra'] : ''; + + switch ( $values['input_type'] ) { case 'single_line': - $input .= ''; + $input .= ''; break; + case 'hidden': - $input .= ''; + $input .= ''; break; + case 'email': - $input .= ''; - break; - case 'password': - $input .= ''; - break; - case 'date': - $input .= ''; + $input .= ''; break; - case 'url': - $input .= ''; + case 'password': + $input .= ''; break; - case 'color': - if ( $value == '' ) { - $value = '#000000'; - } - $input .= ''; - break; - case 'file': - if ( $value != '' ) { - $value = (int) $value; - $img = wp_get_attachment_image( $value, array( 100, 100 ) ); - if ( $img == '' ) { - $img = ''; - } - } else { - $value = ''; - $img = ''; - } - $input .= '
-
' . $img . '
- -
'; + case 'url': + $input .= ''; break; case 'multi_line': $rows = isset( $attr['rows'] ) ? absint( $attr['rows'] ) : 4; - $input .= ''; + $input .= ''; break; case 'checkbox': - $label = isset( $attr['label'] ) ? $attr['label'] : ''; - $class = $class == 'form-control' ? '' : $class; - $input .= ''; + $values['class'] = $values['class'] == 'form-control' ? '' : $values['class']; + $input .= ''; break; case 'select': - //$options = is_array( $attr['input_value'] ) ? $attr['input_value'] : array(); - $options = strlen( $attr['input_value'] ) > 0 ? fed_convert_comma_separated_key_value( $attr['input_value'] ) : array(); - $input .= ''; foreach ( $options as $key => $label ) { $input .= ''; + value="' . esc_attr( $key ) . '" ' . selected( $values['value'], $key, false ) . '>' . $label . ''; } $input .= ''; break; case 'number': $min = isset( $attr['input_min'] ) ? $attr['input_min'] : 0; - $max = isset( $attr['input_max'] ) ? $attr['input_max'] : 0; + $max = isset( $attr['input_max'] ) ? $attr['input_max'] : 999999; $step = isset( $attr['input_step'] ) ? $attr['input_step'] : 'any'; - $input .= ''; + step="' . esc_attr( $step ) . '" id="' . $values['id'] . '">'; break; case 'radio': -// $options = is_array( $attr['options'] ) ? $attr['options'] : array(); - $class = $class == 'form-control' ? '' : $class; - $options = strlen( $attr['input_value'] ) > 0 ? fed_convert_comma_separated_key_value( $attr['input_value'] ) : array(); + $values['class'] = $values['class'] == 'form-control' ? '' : $values['class']; + $options = strlen( $attr['input_value'] ) > 0 ? fed_convert_comma_separated_key_value( $attr['input_value'] ) : array(); foreach ( $options as $key => $label ) { - $input .= '