';
return $output;
}
}
//Yes/No radio selection field
if ( ! function_exists( 'cpotheme_form_yesno' ) ) {
function cpotheme_form_yesno( $name, $value, $args = null ) {
$name = esc_attr( $name );
$checked_yes = '';
$checked_no = ' checked';
if ( '1' == $value ) {
$checked_yes = ' checked';
$checked_no = '';
}
$output = '';
$output .= '';
$output .= ' ';
$output .= '';
return $output;
}
}
//Dropdown list field
if ( ! function_exists( 'cpotheme_form_select' ) ) {
function cpotheme_form_select( $name, $value, $list, $args = null ) {
$name = esc_attr( $name );
if ( isset( $args['width'] ) ) {
$field_width = ' style="width:' . esc_attr( $args['width'] ) . ';"';
} else {
$field_width = '';
}
$field_class = isset( $args['class'] ) ? esc_attr( $args['class'] ) : '';
$output = '';
return $output;
}
}
//Image list selection
if ( ! function_exists( 'cpotheme_form_imagelist' ) ) {
function cpotheme_form_imagelist( $name, $value, $list, $args = null ) {
$name = esc_attr( $name );
$output = '
';
return $output;
}
}
//Icon list selection
if ( ! function_exists( 'cpotheme_form_iconlist' ) ) {
function cpotheme_form_iconlist( $name, $value, $args = null ) {
$name = esc_attr( $name );
$output = '';
$list = cpotheme_metadata_icons();
foreach ( $list as $library_key => $library_value ) {
$output .= '
' . $library_value['name'] . '
';
foreach ( $library_value['icons'] as $list_key => $list_value ) {
$checked = null;
$selected = '';
$current_value = esc_attr( $library_key . '-' . $list_key );
if ( $current_value === $value && '' != $value ) {
$checked = ' checked="checked"';
$selected = ' cpotheme-iconlist-selected';
}
$output .= '
';
}
}
$output .= '
';
return $output;
}
}