'button'
, 'title' => '' // Title of the button
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
, 'link' => 'javascript:void(0)' // Direct link or skip it
, 'action' => '' // Some JavaScript to execure, for example run the function
, 'class' => 'button-secondary' // button-secondary | button-primary
, 'icon' => ''
, 'font_icon' => ''
, 'icon_position' => 'left' // Position of icon relative to Text: left | right
, 'style' => '' // Any CSS class here
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
, 'attr' => array()
);
*/
function wpbc_bs_button( $item ) {
$default_item_params = array(
'type' => 'button'
, 'title' => '' // Title of the button
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
, 'link' => 'javascript:void(0)' // Direct link or skip it
, 'action' => '' // Some JavaScript to execure, for example run the function
, 'class' => 'button-secondary' // button-secondary | button-primary
, 'icon' => ''
, 'font_icon' => ''
, 'icon_position' => 'left' // Position of icon relative to Text: left | right
, 'style' => '' // Any CSS class here
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
, 'attr' => array()
);
$item_params = wp_parse_args( $item, $default_item_params );
?>
title=""
href=""
onclick="javascript:"
>'; // Img Icon.
} elseif ( ! empty( $item_params['font_icon'] ) ) {
$btn_icon = ''; // Font Icon.
}
if ( ( ! empty( $btn_icon ) ) && ( $item_params['icon_position'] == 'left' ) ){
echo wp_kses_post( $btn_icon );
if (! empty($item_params['title'])) {
echo ' ';
}
}
// Text
echo '';
echo wp_kses_post( $item_params['title'] );
if ( ( ! empty( $btn_icon ) ) && ( $item_params['icon_position'] == 'right' ) )
echo ' ' ;
echo '';
if ( ( ! empty( $btn_icon ) ) && ( $item_params['icon_position'] == 'right' ) )
echo wp_kses_post( $btn_icon );
?> '' // HTML ID of element
, 'value' => ''
, 'placeholder' => ''
, 'style' => '' // CSS of select element
, 'class' => '' // CSS Class of select element
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
);
*/
function wpbc_bs_text( $item ) {
$default_item_params = array(
'type' => 'text'
, 'id' => ''
, 'name' => ''
, 'label' => ''
, 'disabled' => false
, 'class' => ''
, 'style' => ''
, 'placeholder' => ''
, 'attr' => array()
, 'value' => ''
, 'onfocus' => ''
);
$item_params = wp_parse_args( $item, $default_item_params );
?>
onfocus="javascript:"
/> '' // HTML ID of element
, 'name' => ''
, 'style' => '' // CSS of select element
, 'class' => '' // CSS Class of select element
, 'multiple' => false
, 'disabled' => false
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
, 'options' => array() // Associated array of titles and values
, 'disabled_options' => array() // If some options disbaled, then its must list here
, 'value' => '' // Some Value from optins array that selected by default
, 'onfocus' => ''
, 'onchange' => ''
)
*/
function wpbc_bs_select( $item ) {
$default_item_params = array(
'id' => '' // HTML ID of element
, 'name' => ''
, 'style' => '' // CSS of select element
, 'class' => '' // CSS Class of select element
, 'multiple' => false
, 'disabled' => false
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
, 'options' => array() // Associated array of titles and values
, 'disabled_options' => array() // If some options disbaled, then its must list here
, 'value' => '' // Some Value from optins array that selected by default
, 'onfocus' => ''
, 'onchange' => ''
);
$item_params = wp_parse_args( $item, $default_item_params );
?> 'radio'
, 'id' => '' // HTML ID of element
, 'name' => ''
, 'style' => '' // CSS of select element
, 'class' => '' // CSS Class of select element
, 'disabled' => false
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
, 'legend' => '' // aria-label parameter
, 'value' => '' // Some Value from optins array that selected by default
, 'selected' => false // Selected or not
);
*/
function wpbc_bs_radio( $item ) {
$item['type'] = 'radio';
wpbc_bs_checkbox( $item );
}
/**
* Show BS checkbox
*
* @param array $item
array(
'type' => 'checkbox'
, 'id' => '' // HTML ID of element
, 'name' => ''
, 'style' => '' // CSS of select element
, 'class' => '' // CSS Class of select element
, 'disabled' => false
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
, 'legend' => '' // aria-label parameter
, 'value' => '' // Some Value from optins array that selected by default
, 'selected' => false // Selected or not
);
*/
function wpbc_bs_checkbox( $item ) {
$default_item_params = array(
'type' => 'checkbox'
, 'id' => '' // HTML ID of element
, 'name' => ''
, 'style' => '' // CSS of select element
, 'class' => '' // CSS Class of select element
, 'disabled' => false
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
, 'legend' => '' // aria-label parameter
, 'value' => '' // Some Value from optins array that selected by default
, 'selected' => false // Selected or not
);
$item_params = wp_parse_args( $item, $default_item_params );
?>
/> 'addon'
, 'element' => 'text' // text | radio | checkbox
, 'text' => '' // Simple plain text showing
, 'id' => '' // ID, if this radio | checkbox element
, 'name' => '' // Name, if this radio | checkbox element
, 'value' => '' // value, if this radio | checkbox element
, 'selected' => false // Selected, if this radio | checkbox element
, 'legend' => '' // aria-label parameter , if this radio | checkbox element
, 'class' => '' // Any CSS class here
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
, 'text' => '' // Text tp show for Text element
)
*/
function wpbc_bs_addon( $item ) {
$milliseconds = round( microtime( true ) * 1000 ); // FixIn: 8.8.2.1.
$default_item_params = array(
'type' => 'addon'
, 'element' => 'text' // text | radio | checkbox
, 'text' => '' // Simple plain text showing
, 'id' => '' // ID, if this radio | checkbox element
, 'name' => '' // Name, if this radio | checkbox element
, 'value' => '' // value, if this radio | checkbox element
, 'selected' => false // Selected, if this radio | checkbox element
, 'legend' => '' // aria-label parameter , if this radio | checkbox element
, 'class' => '' // Any CSS class here
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
, 'text' => '' // Text tp show for Text element
, 'style' => ''
);
$item_params = wp_parse_args( $item, $default_item_params );
?>
/>
/> '' // HTML ID of element
, 'default' => '' // Some Value from optins array that selected by default
, 'hint' => '' // Hint // array( 'title' => __('Delete booking' ,'booking') , 'position' => 'bottom' )
, 'class' => 'button-secondary'
, 'style' => '' // Any CSS style
, 'label' => '' // Label of element "at Top of element"
, 'title' => '' // Title of element "Inside of element"
, 'align' => 'left' // Align: left | right
, 'attr' => array()
, 'icon' => ''
, 'font_icon' => ''
, 'icon_position' => 'left' // Position of icon relative to Text: left | right
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
, 'disabled' => array() // If some options disbaled, then its must list here
, 'options' => array() // Associated array of titles and values
);
$params = wp_parse_args( $item, $default_item_params );
$milliseconds = round(microtime(true) * 1000);
if ( empty( $params['id'] ) ) $params['id'] = 'wpbc_bs_dropdown' . $milliseconds;
// Check if this list Simple or Complex (with input elements) ////////////
$is_this_simple_list = true; //FixIn: 9.0.1.1.1
foreach ( $params['options'] as $key => $value ) {
if ( is_array( $value ) ) {
$is_this_simple_list = false;
break;
}
}
?>
onclick="javascript:jQuery('#_container').show();"
data-toggle="wpbc_dropdown"
id="_selector"
title=""
class="button dropdown-toggle "
style=""
>'; // Img Icon
} elseif ( ! empty( $params['font_icon'] ) ) {
$btn_icon = ''; // Font Icon
}
if ( ( ! empty( $btn_icon ) ) && ( $params['icon_position'] == 'left' ) )
{echo wp_kses_post( $btn_icon ) . ' ';}
// Text
echo '';
echo wp_kses_post( $params['title'] );
if ( ( ! empty( $btn_icon ) ) && ( $params['icon_position'] == 'right' ) )
echo ' ' ;
echo '';
if ( ( ! empty( $btn_icon ) ) && ( $params['icon_position'] == 'right' ) )
echo wp_kses_post( $btn_icon );
?>
$value ) {
if ( is_array( $value ) ) { // Complex value constructions
?>
'' // HTML ID of element
, 'default' => '' // Some Value from optins array that selected by default
, 'hint' => '' // Hint // array( 'title' => __('Delete booking' ,'booking') , 'position' => 'bottom' )
, 'class' => 'button-secondary'
, 'style' => '' // Any CSS style
, 'label' => '' // Label of element "at Top of element"
, 'title' => '' // Title of element "Inside of element"
, 'align' => 'left' // Align: left | right
, 'attr' => array()
, 'icon' => ''
, 'font_icon' => ''
, 'icon_position' => 'left' // Position of icon relative to Text: left | right
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
, 'disabled' => array() // If some options disbaled, then its must list here
, 'options' => array() // Associated array of titles and values
);
$item_params = wp_parse_args( $item_params, $default_item_params );
?>
"wpbc_close_dropdown_selectbox( '" . $params['id'] . "' )" // Close list and uncheck any checkboxes or radio boxes in dropdown list
);
$item_params = wp_parse_args( $item_params, $default_item_params );
wpbc_bs_button( $item_params );
break;
default:
break;
}
}
?>