芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/www/wp-content/themes/brunn/framework/lib/qodef.layout.dashboard.php
children = array(); $this->name = $name; $this->form_id = $form_id; $this->form_method = $form_method; $this->form_action = $form_action; $this->form_nonce_action = $form_nonce_action; $this->form_nonce_name = $form_nonce_name; $this->button_label = $button_label; $this->button_args = $button_args; } public function hasChidren() { return ( count( $this->children ) > 0 ) ? true : false; } public function getChild( $key ) { return $this->children[ $key ]; } public function addChild( $key, $value ) { $this->children[ $key ] = $value; } public function render( $factory ) { $user_id = get_current_user_id(); $action_class = ''; //set default class for form if action is set if ( $this->form_action !== '' ) { $action_class = 'qodef-dashboard-form'; } ?>
children as $child ) { $this->renderChild( $child, $factory ); } ?> 'button', 'custom_class' => 'qodef-dashboard-form-button', 'text' => esc_html( $this->button_label ), 'custom_attrs' => $this->button_args ) ); } else { echo '
' . esc_html( $this->button_label ) . '
'; } ?> form_nonce_action !== '' && $this->form_nonce_name !== '' ) { wp_nonce_field( $this->form_nonce_action, $this->form_nonce_name ); } else { wp_nonce_field( 'qodef_validate_' . $this->name . '_' . $user_id, 'qodef_nonce_' . $this->name . '_' . $user_id ); } ?>
render( $factory ); } } /* Class: BrunnSelectClassDashboardGroup A class that initializes BrunnSelectClass Group Field */ class BrunnSelectClassDashboardGroup implements iBrunnSelectInterfaceLayoutNode, iBrunnSelectInterfaceRender { public $children; public $name; public $title; public $description; function __construct( $name = "", $title_label = "", $description = "" ) { $this->children = array(); $this->name = $name; $this->title = $title_label; $this->description = $description; } public function hasChidren() { return ( count( $this->children ) > 0 ) ? true : false; } public function getChild( $key ) { return $this->children[ $key ]; } public function addChild( $key, $value ) { $this->children[ $key ] = $value; } public function render( $factory ) { ?>
title ); ?>
description ); ?>
children as $child ) { ?>
renderChild( $child, $factory ); ?>
render( $factory ); } } /* Class: BrunnSelectClassDashboardTitle A class that initializes Dashboard Title */ class BrunnSelectClassDashboardTitle implements iBrunnSelectInterfaceRender { private $name; private $title; private $args = array(); function __construct( $name = "", $title_dash = "", $args = array() ) { $this->title = $title_dash; $this->name = $name; $this->args = $args; } public function render( $factory ) { $class = ''; if ( isset( $this->args['custom_class'] ) && $this->args['custom_class'] != '' ) { $class .= ' ' . $this->args['custom_class']; } ?>
title ); ?>
type = $type; $this->name = $name; $this->label = $label; $this->description = $description; $this->options = $options; $this->args = $args; $this->value = $value; } public function render( $factory ) { $factory->render( $this->type, $this->name, $this->label, $this->description, $this->options, $this->args, $this->value ); } } abstract class BrunnSelectClassDashboardFieldType { abstract public function render( $name, $label = "", $description = "", $options = array(), $args = array(), $value = "" ); } class BrunnSelectClassDashboardFieldText extends BrunnSelectClassDashboardFieldType { public function render( $name, $label = "", $description = "", $options = array(), $args = array(), $value = '', $repeat = array() ) { $col_width = 12; if ( isset( $args['col_width'] ) ) { $col_width = $args['col_width']; } $input_type = 'text'; if ( isset( $args['input_type'] ) ) { $input_type = $args['input_type']; } if ( $input_type == 'password' ) { $value = ''; } $suffix = ! empty( $args['suffix'] ) ? $args['suffix'] : false; $class = ''; if ( ! empty( $repeat ) && array_key_exists( 'name', $repeat ) && array_key_exists( 'index', $repeat ) ) { $id = $name . '-' . $repeat['index']; $name = $repeat['name'] . '[' . $repeat['index'] . '][' . $name . ']'; } else { $id = $name; } if ( $description !== '' ) { $class .= ' qodef-has-description'; } if ( isset( $args['custom_class'] ) && $args['custom_class'] != '' ) { $class .= ' ' . $args['custom_class']; } ?>
</textarea>
' . esc_html( $value ) . ''; } else { if ( is_numeric( $value ) ) { $value_html = '
' . wp_get_attachment_image( $value, 'thumbnail' ) . '
'; } else { $value_html = '
'; } } ?>
esc_html__( 'Upload', 'brunn' ), 'custom_class' => 'qodef-dashboard-gallery-upload' ) ); } else { echo '
' . esc_html__( 'Upload', 'brunn' ) . '
'; } ?>
esc_html__( 'Upload', 'brunn' ), 'custom_class' => 'qodef-dashboard-gallery-upload' ) ); } else { echo '
' . esc_html__( 'Upload', 'brunn' ) . '
'; } ?>
$svalue ) { if ( $key == "-1" ) { $key = ""; } ?>
value="">
getIconCollectionsEmpty(); $icons_collections = brunn_select_icon_collections()->getIconCollectionsKeys(); if ( ! empty( $repeat ) && array_key_exists( 'name', $repeat ) && array_key_exists( 'index', $repeat ) ) { $id = $name . '-' . $repeat['index']; $name = $repeat['name'] . '[' . $repeat['index'] . '][' . $name . ']'; } else { $id = $name; } $class = ''; if ( $description !== '' ) { $class .= ' qodef-has-description'; } if ( isset( $args['custom_class'] ) && $args['custom_class'] != '' ) { $class .= ' ' . $args['custom_class']; } ?>
$ivalue ) { ?>
value="">
getIconCollectionParamNameByKey( $icons_collection ); $field_class = ! empty( $value ) && $value['icon_pack'] == $icons_collection ? 'qodef-show-field' : 'qodef-hide-field'; ?>
getIconCollection( $icons_collection ); $active_icon = $value[ $icons_param ]; foreach ( $icons->icons as $key => $ivalue ) { ?>
value="">
$option_label ) { $i = 1; $checked = is_array( $value ) && in_array( $option_key, $value ); $checked_attr = $checked ? 'checked' : ''; ?>
type="checkbox" id="" name="" value="">
label = $label; $this->description = $description; $this->fields = $fields; $this->name = $name; $this->num_of_rows = 1; $this->button_text = ! empty( $button_text ) ? $button_text : esc_html__( 'Add New Item', 'brunn' ); $this->table_layout = $table_layout; $this->value = $value; $counter = 0; foreach ( $this->fields as $field ) { if ( ! isset( $this->fields[ $counter ]['options'] ) ) { $this->fields[ $counter ]['options'] = array(); } if ( ! isset( $this->fields[ $counter ]['args'] ) ) { $this->fields[ $counter ]['args'] = array(); } if ( ! isset( $this->fields[ $counter ]['label'] ) ) { $this->fields[ $counter ]['label'] = ''; } if ( ! isset( $this->fields[ $counter ]['description'] ) ) { $this->fields[ $counter ]['description'] = ''; } if ( ! isset( $this->fields[ $counter ]['default_value'] ) ) { $this->fields[ $counter ]['default_value'] = ''; } $counter ++; } } public function render( $factory ) { global $post; $clones = array(); $wrapper_classes = array(); if ( ! empty( $this->value ) ) { $clones = $this->value; } $sortable_class = 'sortable'; foreach ( $this->fields as $field ) { if ( $field['type'] == 'textareahtml' ) { $sortable_class = ''; break; } } if ( $this->table_layout ) { $wrapper_classes[] = 'qodef-dashboard-repeater-table'; } ?>
label !== '' ) { ?>
label ); ?>
description != '' ) { ?>
description ); ?>
table_layout ) { ?>
fields as $field ) { $col_width_class = 'col-lg-12'; if ( ! empty( $field['col_width'] ) ) { $col_width_class = 'col-lg-' . $field['col_width']; } ?>
0 ) { $counter = 0; foreach ( $clones as $clone ) { ?>
fields as $field ) { $col_width_class = 'col-lg-12'; if ( ! empty( $field['col_width'] ) ) { $col_width_class = 'col-lg-' . $field['col_width']; } ?>
0 ) { $counter2 = 0; foreach ( $clone[ $field['name'] ] as $clone_inner ) { ?>
render( $field_inner['type'], $field_inner['name'], $field_inner['label'], $field_inner['description'], $field_inner['options'], $field_inner['args'], $repeater_inner_field_value, array( 'name' => $this->name . '[' . $counter . '][' . $field['name'] . ']', 'index' => $counter2 ) ); ?>
render( $field['type'], $field['name'], $field['label'], $field['description'], $field['options'], $field['args'], $repeater_field_value, array( 'name' => $this->name, 'index' => $counter ) ); } ?>
fields as $field ) { if ( $field['type'] == 'repeater' ) { ?>
button_text ); ?>
render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'textarea': $field = new BrunnSelectClassDashboardFieldTextArea(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'date': $field = new BrunnSelectClassDashboardFieldDate(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'image': $field = new BrunnSelectClassDashboardFieldImage(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'gallery': $field = new BrunnSelectClassDashboardFieldGallery(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'select': $field = new BrunnSelectClassDashboardFieldSelect(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'icon': $field = new BrunnSelectClassDashboardFieldIcon(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'color': $field = new BrunnSelectClassDashboardFieldColor(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'checkboxgroup': $field = new BrunnSelectClassDashboardFieldCheckBoxGroup(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'address': $field = new BrunnSelectClassDashboardFieldAddress(); $field->render( $name, $label, $description, $options, $args, $value ); break; default: break; } } }