晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/tabatabaei/public_html/wp-content/plugins/elementor/modules/system-info/reporters/ |
Upload File : |
<?php
namespace Elementor\Modules\System_Info\Reporters;
use Elementor\Modules\System_Info\Helpers\Model_Helper;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Elementor base reporter.
*
* A base abstract class that provides the needed properties and methods to
* manage and handle reporter in inheriting classes.
*
* @since 2.9.0
* @abstract
*/
abstract class Base {
/**
* Reporter properties.
*
* Holds the list of all the properties of the report.
*
* @access protected
* @static
*
* @var array
*/
protected $_properties;
/**
* Get report title.
*
* Retrieve the title of the report.
*
* @since 2.9.0
* @access public
* @abstract
*/
abstract public function get_title();
/**
* Get report fields.
*
* Retrieve the required fields for the report.
*
* @since 2.9.0
* @access public
* @abstract
*/
abstract public function get_fields();
/**
* Is report enabled.
*
* Whether the report is enabled.
*
* @since 2.9.0
* @access public
*
* @return bool Whether the report is enabled.
*/
public function is_enabled() {
return true;
}
public function print_html() {
foreach ( $this->get_report( 'html' ) as $field ) {
$warning_class = ! empty( $field['warning'] ) ? ' class="elementor-warning"' : '';
$log_label = ! empty( $field['label'] ) ? $field['label'] . ':' : '';
?>
<tr<?php Utils::print_unescaped_internal_string( $warning_class ); ?>>
<td><?php Utils::print_unescaped_internal_string( $log_label ); ?></td>
<td><?php Utils::print_unescaped_internal_string( $field['value'] ); ?></td>
<td><?php
if ( ! empty( $field['recommendation'] ) ) :
Utils::print_unescaped_internal_string( $field['recommendation'] );
endif;
?></td>
</tr>
<?php
}
}
public function print_html_label( $label ) {
Utils::print_unescaped_internal_string( $label );
}
public function print_raw( $tabs_count ) {
$indent = str_repeat( "\t", $tabs_count - 1 );
$report = $this->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 );
}
}
}