芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/optimyar/wp-content/plugins/shortcodes-ultimate/inc/core/generator-views.php
'' ) ); $return = '
'; return $return; } public static function textarea( $id, $field ) { $field = wp_parse_args( $field, array( 'rows' => 3, 'default' => '' ) ); $return = '
' . esc_textarea( $field['default'] ) . '</textarea>'; return $return; } public static function select( $id, $field ) { // Multiple selects $multiple = isset( $field['multiple'] ) && $field['multiple'] ? ' multiple' : ''; $return = '
'; // Create options foreach ( $field['values'] as $option_value => $option_title ) { // Is this option selected $selected = ( $field['default'] === $option_value ) ? ' selected="selected"' : ''; // Create option $return .= '
' . $option_title . '
'; } $return .= '
'; return $return; } public static function post_type( $id, $field ) { // Get post types $types = get_post_types( array(), 'objects', 'or' ); // Prepare empty array for values $field['values'] = array( 'any' => _x( 'Any post type', 'shortcodes-ultimate' ), ); // Fill the array foreach( $types as $type ) { $field['values'][$type->name] = $type->label; } // Create select return self::select( $id, $field ); } public static function taxonomy( $id, $field ) { // Get taxonomies $taxonomies = get_taxonomies( array(), 'objects', 'or' ); // Prepare empty array for values $field['values'] = array(); // Fill the array foreach( $taxonomies as $taxonomy ) { $field['values'][$taxonomy->name] = $taxonomy->label; } // Create select return self::select( $id, $field ); } public static function term( $id, $field ) { // Get categories $field['values'] = Su_Generator::get_terms( 'category' ); // Create select return self::select( $id, $field ); } public static function bool( $id, $field ) { $return = '
' . __( 'Yes', 'shortcodes-ultimate' ) . '
' . __( 'No', 'shortcodes-ultimate' ) . '
'; return $return; } public static function upload( $id, $field ) { $return = '
' . __( 'Media manager', 'shortcodes-ultimate' ) . '
'; return $return; } public static function icon( $id, $field ) { $return = '
' . __( 'Media manager', 'shortcodes-ultimate' ) . '
' . __( 'Icon picker', 'shortcodes-ultimate' ) . '
'; return $return; } public static function color( $id, $field ) { $return = '
'; return $return; } public static function number( $id, $field ) { $return = '
'; return $return; } public static function slider( $id, $field ) { $return = '
'; return $return; } public static function shadow( $id, $field ) { $defaults = ( $field['default'] === 'none' ) ? array ( '0', '0', '0', '#000000' ) : explode( ' ', str_replace( 'px', '', $field['default'] ) ); $return = '
' . __( 'Horizontal offset', 'shortcodes-ultimate' ) . ' (px)
' . __( 'Vertical offset', 'shortcodes-ultimate' ) . ' (px)
' . __( 'Blur', 'shortcodes-ultimate' ) . ' (px)
' . __( 'Color', 'shortcodes-ultimate' ) . '
'; return $return; } public static function border( $id, $field ) { $defaults = ( $field['default'] === 'none' ) ? array ( '0', 'solid', '#000000' ) : explode( ' ', str_replace( 'px', '', $field['default'] ) ); $borders = su_html_dropdown( array( 'options' => su_get_config( 'borders' ), 'class' => 'su-generator-bp-style', 'selected' => $defaults[1] ) ); $return = '
' . __( 'Border width', 'shortcodes-ultimate' ) . ' (px)
' . $borders . '
' . __( 'Border style', 'shortcodes-ultimate' ) . '
' . __( 'Border color', 'shortcodes-ultimate' ) . '
'; return $return; } public static function image_source( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => 'none' ) ); if ( ! isset( $field['media_sources'] ) ) { $field['media_sources'] = array( 'media' => __( 'Media library', 'shortcodes-ultimate' ), 'posts: recent' => __( 'Recent posts', 'shortcodes-ultimate' ), 'taxonomy' => __( 'Taxonomy', 'shortcodes-ultimate' ), ); } $sources = su_html_dropdown( array( 'options' => $field['media_sources'], 'selected' => '0', 'none' => __( 'Select images source', 'shortcodes-ultimate' ) . '…', 'class' => 'su-generator-isp-sources' ) ); $categories = su_html_dropdown( array( 'options' => Su_Generator::get_terms( 'category' ), 'multiple' => true, 'size' => 10, 'class' => 'su-generator-isp-categories' ) ); $taxonomies = su_html_dropdown( array( 'options' => Su_Generator::get_taxonomies(), 'none' => __( 'Select taxonomy', 'shortcodes-ultimate' ) . '…', 'selected' => '0', 'class' => 'su-generator-isp-taxonomies' ) ); $terms = su_html_dropdown( array( 'class' => 'su-generator-isp-terms', 'multiple' => true, 'size' => 10, 'disabled' => true, 'style' => 'display:none' ) ); $return = '
' . $sources . '
' . __( 'Add images', 'shortcodes-ultimate' ) . '
' . __( 'Click the button above and select images.
You can select multimple images with Ctrl (Cmd) key', 'shortcodes-ultimate' ) . '
' . __( 'Select categories to retrieve posts from.
You can select multiple categories with Ctrl (Cmd) key', 'shortcodes-ultimate' ) . '
' . $categories . '
' . __( 'Select taxonomy and it\'s terms.
You can select multiple terms with Ctrl (Cmd) key', 'shortcodes-ultimate' ) . '
' . $taxonomies . $terms . '
'; return $return; } public static function extra_css_class( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => '' ) ); $return = '
'; return $return; } }