芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/cepali.edu.mx/wp-content/plugins/elementor/modules/system-info/reporters/base.php
get_report( 'html' ) as $field ) { $warning_class = ! empty( $field['warning'] ) ? ' class="elementor-warning"' : ''; $log_label = ! empty( $field['label'] ) ? $field['label'] . ':' : ''; ?>
>
get_report( 'raw' ); echo PHP_EOL . $indent . '== ' . $this->get_title() . ' =='; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo PHP_EOL; foreach ( $report as $field_name => $field ) : $sub_indent = str_repeat( "\t", $tabs_count ); $label = $field['label']; if ( ! empty( $label ) ) { $label .= ': '; } echo "{$sub_indent}{$label}{$field['value']}" . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped endforeach; } /** * Get report. * * Retrieve the report with all it's containing fields. * * @since 2.9.0 * @access public * * @return \WP_Error | array { * Report fields. * * @type string $name Field name. * @type string $label Field label. * } */ final public function get_report( $format = '' ) { $result = []; $format = ( empty( $format ) ) ? '' : $format . '_'; foreach ( $this->get_fields() as $field_name => $field_label ) { $method = 'get_' . $format . $field_name; if ( ! method_exists( $this, $method ) ) { $method = 'get_' . $field_name; //fallback: if ( ! method_exists( $this, $method ) ) { return new \WP_Error( sprintf( "Getter method for the field '%s' wasn't found in %s.", $field_name, get_called_class() ) ); } } $reporter_field = [ 'name' => $field_name, 'label' => $field_label, ]; $reporter_field = array_merge( $reporter_field, $this->$method() ); $result[ $field_name ] = $reporter_field; } return $result; } /** * Get properties keys. * * Retrieve the keys of the properties. * * @since 2.9.0 * @access public * @static * * @return array { * Property keys. * * @type string $name Property name. * @type string $fields Property fields. * } */ public static function get_properties_keys() { return [ 'name', 'format', 'fields', ]; } /** * Filter possible properties. * * Retrieve possible properties filtered by property keys. * * @since 2.9.0 * @access public * @static * * @param array $properties Properties to filter. * * @return array Possible properties filtered by property keys. */ final public static function filter_possible_properties( $properties ) { return Model_Helper::filter_possible_properties( self::get_properties_keys(), $properties ); } /** * Set properties. * * Add/update properties to the report. * * @since 2.9.0 * @access public * * @param array $key Property key. * @param array $value Optional. Property value. Default is `null`. */ final public function set_properties( $key, $value = null ) { if ( is_array( $key ) ) { $key = self::filter_possible_properties( $key ); foreach ( $key as $sub_key => $sub_value ) { $this->set_properties( $sub_key, $sub_value ); } return; } if ( ! in_array( $key, self::get_properties_keys(), true ) ) { return; } $this->_properties[ $key ] = $value; } /** * Reporter base constructor. * * Initializing the reporter base class. * * @since 2.9.0 * @access public * * @param array $properties Optional. Properties to filter. Default is `null`. */ public function __construct( $properties = null ) { $this->_properties = array_fill_keys( self::get_properties_keys(), null ); if ( $properties ) { $this->set_properties( $properties, null ); } } }