芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/www/wp-content/themes/brunn/framework/lib/qodef.layout.user.php
type = $type; $this->name = $name; $this->label = $label; $this->description = $description; $this->options = $options; $this->args = $args; add_filter( 'brunn_select_filter_user_fields', array( $this, 'addFieldForEditSave' ) ); } public function addFieldForEditSave( $names ) { $names[] = $this->name; return $names; } public function render( $factory ) { $factory->render( $this->type, $this->name, $this->label, $this->description, $this->options, $this->args ); } } abstract class BrunnSelectClassUserFieldType { abstract public function render( $name, $label = "", $description = "", $options = array(), $args = array() ); } class BrunnSelectClassUserFieldText extends BrunnSelectClassUserFieldType { public function render( $name, $label = "", $description = "", $options = array(), $args = array() ) { $user_id = isset( $_GET['user_id'] ) && ! empty( $_GET['user_id'] ) ? $_GET['user_id'] : get_current_user_id(); $value = get_user_meta( intval( $user_id ), $name, true ); ?>
value="">
$value ) { if ( $key == "-1" ) { $key = ""; } ?>
value="">
children = array(); $this->title = $title_user; $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 ); ?>
children as $child ) { $this->renderChild( $child, $factory ); } ?>
render( $factory ); } } class BrunnSelectClassUserFieldFactory { public function render( $field_type, $name, $label = "", $description = "", $options = array(), $args = array(), $hidden = false ) { switch ( strtolower( $field_type ) ) { case 'text': $field = new BrunnSelectClassUserFieldText(); $field->render( $name, $label, $description, $options, $args, $hidden ); break; case 'select': $field = new BrunnSelectClassUserFieldSelect(); $field->render( $name, $label, $description, $options, $args, $hidden ); break; case 'image': $field = new BrunnSelectClassUserFieldImage(); $field->render( $name, $label, $description, $options, $args, $hidden ); break; default: break; } } }