晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
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/rainic/www/oldTZh/wp-content/plugins/elementor-pro/core/editor/ |
Upload File : |
<?php
namespace ElementorPro\Core\Editor;
use Elementor\Core\Base\App;
use Elementor\Core\Utils\Assets_Config_Provider;
use Elementor\Core\Utils\Assets_Translation_Loader;
use ElementorPro\License\Admin as License_Admin;
use ElementorPro\License\API as License_API;
use ElementorPro\Plugin;
use ElementorPro\Modules\DisplayConditions\Module as Display_Conditions_Module;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Editor extends App {
const EDITOR_V4_PACKAGES = [
'editor-documents-extended',
'editor-controls-extended',
'editor-site-navigation-extended',
'editor-editing-panel-extended',
];
/**
* Get app name.
*
* Retrieve the app name.
*
* @return string app name.
* @since 2.6.0
* @access public
*
*/
public function get_name() {
return 'pro-editor';
}
public function __construct() {
add_action( 'elementor/init', [ $this, 'on_elementor_init' ] );
add_action( 'elementor/editor/init', [ $this, 'on_elementor_editor_init' ] );
add_action( 'elementor/editor/after_enqueue_styles', [ $this, 'enqueue_editor_styles' ] );
add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_editor_scripts' ] );
add_filter( 'elementor/editor/localize_settings', [ $this, 'localize_settings' ] );
add_filter( 'elementor/editor/panel/get_pro_details', function( $get_pro_details ) {
if ( defined( '\Elementor\Modules\Apps\Module::PAGE_ID' ) ) {
$get_pro_details['link'] = admin_url( 'admin.php?page=' . \Elementor\Modules\Apps\Module::PAGE_ID );
$get_pro_details['message'] = __( 'Extend Elementor With Add-ons', 'elementor-pro' );
$get_pro_details['button_text'] = __( 'Explore Add-ons', 'elementor-pro' );
}
return $get_pro_details;
} );
add_action( 'elementor/editor/v2/scripts/enqueue', function () {
$this->enqueue_editor_v2_scripts();
} );
}
public function get_init_settings() {
$settings = [
'isActive' => License_API::is_license_active(),
'urls' => [
'modules' => ELEMENTOR_PRO_MODULES_URL,
'connect' => License_Admin::get_url(),
],
];
/**
* Localized editor settings.
*
* Filters the localized settings used in the editor as JavaScript variables.
*
* By default Elementor Pro passes some editor settings to be consumed as JavaScript
* variables. This hook allows developers to add extra settings values to be consumed
* using JavaScript in the editor.
*
* @since 1.0.0
*
* @param array $settings Localized editor settings.
*/
$settings = apply_filters( 'elementor_pro/editor/localize_settings', $settings );
return $settings;
}
public function enqueue_editor_styles() {
wp_enqueue_style(
'elementor-pro',
$this->get_css_assets_url( 'editor', null, 'default', true ),
[
'elementor-editor',
],
ELEMENTOR_PRO_VERSION
);
}
public function enqueue_editor_scripts() {
wp_enqueue_script(
'elementor-pro',
$this->get_js_assets_url( 'editor' ),
[
'backbone-marionette',
'elementor-common',
'elementor-editor-modules',
'elementor-editor-document',
],
ELEMENTOR_PRO_VERSION,
true
);
wp_set_script_translations( 'elementor-pro', 'elementor-pro' );
$this->print_config( 'elementor-pro' );
}
public function enqueue_editor_v2_scripts() {
$assets_config = ( new Assets_Config_Provider() )
->set_path_resolver( function ( $name ) {
return ELEMENTOR_PRO_ASSETS_PATH . "js/packages/{$name}/{$name}.asset.php";
} );
$packages = apply_filters( 'elementor-pro/editor/v2/packages', self::EDITOR_V4_PACKAGES );
foreach ( $packages as $package ) {
$assets_config->load( $package );
}
foreach ( $assets_config->all() as $package => $config ) {
wp_enqueue_script(
$config['handle'],
$this->get_js_assets_url( "packages/{$package}/{$package}" ),
$config['deps'],
ELEMENTOR_PRO_VERSION,
true
);
wp_set_script_translations( $config['handle'], 'elementor-pro' );
}
if ( class_exists( Assets_Translation_Loader::class ) ) {
$packages_handles = $assets_config->pluck( 'handle' )->all();
Assets_Translation_Loader::for_handles( $packages_handles );
}
}
public function localize_settings( array $settings ) {
$settings['elementPromotionURL'] = Plugin::instance()->license_admin->get_connect_url([
'utm_source' => '%s', // Will be replaced in the frontend to the widget name
'utm_medium' => 'wp-dash',
'utm_campaign' => 'connect-and-activate-license',
'utm_content' => 'editor-widget-promotion',
]);
$settings['dynamicPromotionURL'] = Plugin::instance()->license_admin->get_connect_url( [
'utm_source' => '%s', // Will be replaced in the frontend to the control name
'utm_medium' => 'wp-dash',
'utm_campaign' => 'connect-and-activate-license',
'utm_content' => 'editor-dynamic-promotion',
] );
if ( ! isset( $settings['promotionWidgets'] ) ) {
$settings['promotionWidgets'] = License_API::get_promotion_widgets();
}
if ( Display_Conditions_Module::can_use_display_conditions() ) {
$settings['displayConditions'] = Display_Conditions_Module::instance()
->get_conditions_manager()
->get_conditions_config();
}
return $settings;
}
public function on_elementor_init() {
Plugin::elementor()->editor->notice_bar = new Notice_Bar();
if ( isset( Plugin::elementor()->editor->promotion ) ) {
Plugin::elementor()->editor->promotion = new Promotion();
}
}
public function on_elementor_editor_init() {
Plugin::elementor()->common->add_template( __DIR__ . '/template.php' );
}
protected function get_assets_base_url() {
return ELEMENTOR_PRO_URL;
}
}