晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
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/persian-gravity-forms/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/rainic/www/oldTZh/wp-content/plugins/persian-gravity-forms/includes/class-admin.php
<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class GFPersian_Admin extends GFPersian_Core {

	public function __construct() {
		add_filter( 'gform_print_styles', [ $this, 'print_styles' ], 10, 2 );
		add_action( 'admin_enqueue_scripts', [ $this, 'admin_styles' ], 999 );
		add_filter( 'gform_noconflict_styles', [ $this, 'noconflict_styles' ] );
		add_action( 'wp_dashboard_setup', [ $this, 'dashboard_rss_widget' ] );
		add_action( 'admin_footer', [ $this, 'hide_license' ], 9999 );
		add_action( 'admin_head', [ $this, 'admin_general_style' ], 999 );
	}


	/**
	 * Load general inline admin styles to work with plugin elements
	 *
	 * @actino admin_head
	 *
	 * @return void
	 */
	public function admin_general_style(): void {
		?>
		<style id="persian_gravity_forms_general_style">
            #gf_dashboard_message a:last-child {
                float: left !important;
            }
		</style>
		<?php
	}

	/**
	 * Load admin rtl style when it's only a GForm showing
	 *
	 * @action admin_enqueue_scripts
	 *
	 * @return void
	 */
	public function admin_styles(): void {

		if ( ! $this->is_gravity_page() ) {
			return;
		}

		if ( is_rtl() && $this->option( 'rtl_admin', '1' ) == '1' ) {
			wp_register_style( 'gform_admin_rtl_style', GF_PERSIAN_URL . 'assets/css/rtl-admin.css' );
			wp_enqueue_style( 'gform_admin_rtl_style' );
		}

		$this->font_styles();
	}

	/**
	 * @filter gform_print_styles
	 *
	 * @param bool $print false Set to true if style should be printed.
	 * @param array $form The Form object
	 *
	 * @return array of registered style hooks
	 */
	public function print_styles( bool $print, array $form ): array {
		$styles = [];

		if ( ! is_rtl() || $this->option( 'rtl_admin', '1' ) !== '1' ) {
			return $styles;
		}

		$styles[] = $style = 'gform_print_rtl_style';
		wp_register_style( $style, GF_PERSIAN_URL . 'assets/css/rtl-print.css' );

		return array_merge( $styles, $this->font_styles() );
	}

	/**
	 * Register, Enqueue and returns the list of font handles
	 *
	 * @param bool $only_face Set if only font face should be loaded or load with admin font applier
	 *
	 * @return array
	 */
	private function font_styles( bool $only_face = false ): array {
		$styles = [];
		$font   = $this->option( 'font_admin', 'vazir' );

		if ( empty( $font ) ) {
			return $styles;
		}

		$styles[] = $style = 'gform_admin_font_face';

		wp_register_style( $style, GF_PERSIAN_URL . "assets/css/font-face-{$font}.css" );
		wp_enqueue_style( $style );

		if ( ! $only_face ) {
			$styles[] = $style = 'gform_print_font_style';
			wp_register_style( $style, GF_PERSIAN_URL . "assets/css/font-admin.css" );
			wp_enqueue_style( $style );
		}

		return $styles;
	}

	/**
	 * Define no conflict style hooks for GForm
	 *
	 * @filter gform_noconflict_styles
	 *
	 * @param array $styles
	 *
	 * @return array
	 */
	public function noconflict_styles( array $styles ): array {
		return array_merge( $styles, [
			'gform_print_rtl_style',
			'gform_admin_rtl_style',
			'gform_admin_font_face',
			'gform_print_font_style'
		] );
	}

	/**
	 * Add last news rss of Persian GForm into admin area
	 *
	 * @action wp_dashboard_setup
	 *
	 * @return void
	 */
	public function dashboard_rss_widget(): void {

		if ( ! current_user_can( 'manage_options' ) || $this->option( 'rss_widget', '1' ) !== '1' ) {
			return;
		}

		add_meta_box( 'GFPersian_RSS', 'آخرین مطالب گرویتی فرم فارسی', [ $this, 'callback_rss_widget' ], 'dashboard', 'side', 'low' );
	}

	/**
	 * RSS meta box html output
	 *
	 * @return void
	 */
	public function callback_rss_widget(): void {
		$font  = $this->font_styles( true );
		$style = ! empty( $font ) ? 'style="font-family: GFPersian;"' : '';

		?>
		<div class="rss-widget" <?php echo esc_attr( $style ); ?>>
			<?php wp_widget_rss_output( [
				'url'          => 'https://gravityforms.ir/feed/',
				'items'        => 2,
				'show_summary' => 1,
				'show_author'  => 1,
				'show_date'    => 1
			] ); ?>
			<div style="border-top: 1px solid #e7e7e7; padding-top: 12px !important; font-size: 13px; height: 20px;">

				<img src="<?php echo GF_PERSIAN_URL ?>assets/images/logo.png" width="30" height="auto"
				     alt="گرویتی فرم فارسی"
				     style="float: right; margin: -10px 1px 0 10px"/>

				<a href="https://gravityforms.ir" target="_blank" title="گرویتی فرم فارسی">
					مشاهده وب سایت گرویتی فرم فارسی
				</a>
			</div>
		</div>
		<?php
	}

	/**
	 * Hide deactivated license GForm banner
	 *
	 * @action admin_footer
	 *
	 * @return void
	 */
	public function hide_license(): void {

		if ( ! $this->is_gravity_page() || $this->option( 'hide_lic', '0' ) !== '1' ) {
			return;
		}

		?>
		<script type="text/javascript">
            jQuery(document).ready(function ($) {
                $('img').each(function () {
                    if (this.title.indexOf("licensed") !== -1 || this.alt.indexOf("licensed") !== -1)
                        $(this).hide().parent("a").hide().parent("div").hide();
                });
            });
		</script>
		<?php
	}

}

new GFPersian_Admin();

haha - 2025