Файловый менеджер - Редактировать - /home/freeclou/app.optimyar.com/front-web/build/assets/resources/agGrid/apps.tar
Назад
admin-apps-page.php 0000755 00000014335 15111605106 0010225 0 ustar 00 <?php namespace Elementor\Modules\Apps; use Elementor\Core\Isolation\Wordpress_Adapter; use Elementor\Core\Isolation\Plugin_Status_Adapter; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Admin_Apps_Page { const APPS_URL = 'https://assets.elementor.com/apps/v1/apps.json'; private static ?Wordpress_Adapter $wordpress_adapter = null; private static ?Plugin_Status_Adapter $plugin_status_adapter = null; public static function render() { ?> <div class="wrap e-a-apps"> <div class="e-a-page-title"> <h2><?php echo esc_html__( 'Popular Add-ons, New Possibilities.', 'elementor' ); ?></h2> <p><?php echo esc_html__( 'Boost your web-creation process with add-ons, plugins, and more tools specially selected to unleash your creativity, increase productivity, and enhance your Elementor-powered website.', 'elementor' ); ?>*<br> <a href="https://go.elementor.com/wp-dash-apps-about-apps-page/" target="_blank"><?php echo esc_html__( 'Learn more about this page.', 'elementor' ); ?></a> </p> </div> <div class="e-a-list"> <?php self::render_plugins_list(); ?> </div> <div class="e-a-page-footer"> <p>*<?php echo esc_html__( 'Please note that certain tools and services on this page are developed by third-party companies and are not part of Elementor\'s suite of products or support. Before using them, we recommend independently evaluating them. Additionally, when clicking on their action buttons, you may be redirected to an external website.', 'elementor' ); ?></p> </div> </div> <?php } private static function render_plugins_list() { $plugins = self::get_plugins(); foreach ( $plugins as $plugin ) { self::render_plugin_item( $plugin ); } } private static function get_plugins(): array { if ( ! self::$wordpress_adapter ) { self::$wordpress_adapter = new Wordpress_Adapter(); } if ( ! self::$plugin_status_adapter ) { self::$plugin_status_adapter = new Plugin_Status_Adapter( self::$wordpress_adapter ); } $apps = static::get_remote_apps(); return static::filter_apps( $apps ); } private static function get_remote_apps() { $apps = wp_remote_get( static::APPS_URL ); if ( is_wp_error( $apps ) ) { return []; } $apps = json_decode( wp_remote_retrieve_body( $apps ), true ); if ( empty( $apps['apps'] ) || ! is_array( $apps['apps'] ) ) { return []; } return $apps['apps']; } private static function filter_apps( $apps ) { $filtered_apps = []; foreach ( $apps as $app ) { if ( static::is_wporg_app( $app ) ) { $app = static::filter_wporg_app( $app ); } if ( static::is_ecom_app( $app ) ) { $app = static::filter_ecom_app( $app ); } if ( empty( $app ) ) { continue; } $filtered_apps[] = $app; } return $filtered_apps; } private static function is_wporg_app( $app ) { return isset( $app['type'] ) && 'wporg' === $app['type']; } private static function filter_wporg_app( $app ) { if ( self::$wordpress_adapter->is_plugin_active( $app['file_path'] ) ) { return null; } if ( self::$plugin_status_adapter->is_plugin_installed( $app['file_path'] ) ) { if ( current_user_can( 'activate_plugins' ) ) { $app['action_label'] = esc_html__( 'Activate', 'elementor' ); $app['action_url'] = self::$plugin_status_adapter->get_activate_plugin_url( $app['file_path'] ); } else { $app['action_label'] = esc_html__( 'Cannot Activate', 'elementor' ); $app['action_url'] = '#'; } } elseif ( current_user_can( 'install_plugins' ) ) { $app['action_label'] = esc_html__( 'Install', 'elementor' ); $app['action_url'] = self::$plugin_status_adapter->get_install_plugin_url( $app['file_path'] ); } else { $app['action_label'] = esc_html__( 'Cannot Install', 'elementor' ); $app['action_url'] = '#'; } return $app; } private static function is_ecom_app( $app ) { return isset( $app['type'] ) && 'ecom' === $app['type']; } private static function filter_ecom_app( $app ) { if ( self::$wordpress_adapter->is_plugin_active( $app['file_path'] ) ) { return null; } if ( ! self::$plugin_status_adapter->is_plugin_installed( $app['file_path'] ) ) { return $app; } if ( current_user_can( 'activate_plugins' ) ) { $app['action_label'] = esc_html__( 'Activate', 'elementor' ); $app['action_url'] = self::$plugin_status_adapter->get_activate_plugin_url( $app['file_path'] ); } else { $app['action_label'] = esc_html__( 'Cannot Activate', 'elementor' ); $app['action_url'] = '#'; } $app['target'] = '_self'; return $app; } private static function get_images_url() { return ELEMENTOR_URL . 'modules/apps/images/'; } private static function is_elementor_pro_installed() { return defined( 'ELEMENTOR_PRO_VERSION' ); } private static function render_plugin_item( $plugin ) { ?> <div class="e-a-item"<?php echo ! empty( $plugin['file_path'] ) ? ' data-plugin="' . esc_attr( $plugin['file_path'] ) . '"' : ''; ?>> <div class="e-a-heading"> <img class="e-a-img" src="<?php echo esc_url( $plugin['image'] ); ?>" alt="<?php echo esc_attr( $plugin['name'] ); ?>"> <?php if ( ! empty( $plugin['badge'] ) ) : ?> <span class="e-a-badge"><?php echo esc_html( $plugin['badge'] ); ?></span> <?php endif; ?> </div> <h3 class="e-a-title"><?php echo esc_html( $plugin['name'] ); ?></h3> <p class="e-a-author"><?php esc_html_e( 'By', 'elementor' ); ?> <a href="<?php echo esc_url( $plugin['author_url'] ); ?>" target="_blank"><?php echo esc_html( $plugin['author'] ); ?></a></p> <div class="e-a-desc"> <p><?php echo esc_html( $plugin['description'] ); ?></p> <?php if ( ! empty( $plugin['offering'] ) ) : ?> <p class="e-a-offering"><?php echo esc_html( $plugin['offering'] ); ?></p> <?php endif; ?> </div> <p class="e-a-actions"> <?php if ( ! empty( $plugin['learn_more_url'] ) ) : ?> <a class="e-a-learn-more" href="<?php echo esc_url( $plugin['learn_more_url'] ); ?>" target="_blank"><?php echo esc_html__( 'Learn More', 'elementor' ); ?></a> <?php endif; ?> <a href="<?php echo esc_url( $plugin['action_url'] ); ?>" class="e-btn e-accent" target="<?php echo isset( $plugin['target'] ) ? esc_attr( $plugin['target'] ) : '_blank'; ?>"><?php echo esc_html( $plugin['action_label'] ); ?></a> </p> </div> <?php } } admin-menu-apps.php 0000755 00000001256 15111605106 0010253 0 ustar 00 <?php namespace Elementor\Modules\Apps; use Elementor\Core\Admin\Menu\Interfaces\Admin_Menu_Item_With_Page; use Elementor\Settings; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Admin_Menu_Apps implements Admin_Menu_Item_With_Page { public function is_visible() { return true; } public function get_parent_slug() { return Settings::PAGE_ID; } public function get_label() { return esc_html__( 'Add-ons', 'elementor' ); } public function get_page_title() { return esc_html__( 'Add-ons', 'elementor' ); } public function get_capability() { return 'manage_options'; } public function render() { Admin_Apps_Page::render(); } } admin-pointer.php 0000755 00000003660 15111605106 0010027 0 ustar 00 <?php namespace Elementor\Modules\Apps; use Elementor\Core\Upgrade\Manager as Upgrade_Manager; use Elementor\User; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Admin_Pointer { const RELEASE_VERSION = '3.15.0'; const CURRENT_POINTER_SLUG = 'e-apps'; public static function add_hooks() { add_action( 'admin_print_footer_scripts-index.php', [ __CLASS__, 'admin_print_script' ] ); } public static function admin_print_script() { if ( static::is_dismissed() || static::is_new_installation() ) { return; } wp_enqueue_script( 'wp-pointer' ); wp_enqueue_style( 'wp-pointer' ); $pointer_content = '<h3>' . esc_html__( 'New! Popular Add-ons', 'elementor' ) . '</h3>'; $pointer_content .= '<p>' . esc_html__( 'Discover our collection of plugins and add-ons carefully selected to enhance your Elementor website and unleash your creativity.', 'elementor' ) . '</p>'; $pointer_content .= sprintf( '<p><a class="button button-primary" href="%s">%s</a></p>', admin_url( 'admin.php?page=' . Module::PAGE_ID ), esc_html__( 'Explore Add-ons', 'elementor' ) ) ?> <script> jQuery( document ).ready( function( $ ) { $( '#toplevel_page_elementor' ).pointer( { content: '<?php echo $pointer_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>', position: { edge: <?php echo is_rtl() ? "'right'" : "'left'"; ?>, align: 'center' }, close: function() { elementorCommon.ajax.addRequest( 'introduction_viewed', { data: { introductionKey: '<?php echo esc_attr( static::CURRENT_POINTER_SLUG ); ?>', }, } ); } } ).pointer( 'open' ); } ); </script> <?php } private static function is_dismissed() { return User::get_introduction_meta( static::CURRENT_POINTER_SLUG ); } private static function is_new_installation() { return Upgrade_Manager::install_compare( static::RELEASE_VERSION, '>=' ); } } module.php 0000755 00000007506 15111605106 0006551 0 ustar 00 <?php namespace Elementor\Modules\Apps; use Elementor\Core\Admin\Menu\Admin_Menu_Manager; use Elementor\Core\Base\Module as BaseModule; use Elementor\Settings; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Module extends BaseModule { const PAGE_ID = 'elementor-apps'; public function get_name() { return 'apps'; } public function __construct() { parent::__construct(); Admin_Pointer::add_hooks(); add_action( 'elementor/admin/menu/register', function( Admin_Menu_Manager $admin_menu ) { $admin_menu->register( static::PAGE_ID, new Admin_Menu_Apps() ); }, 115 ); add_action( 'elementor/admin/menu/after_register', function ( Admin_Menu_Manager $admin_menu, array $hooks ) { if ( ! empty( $hooks[ static::PAGE_ID ] ) ) { add_action( "admin_print_scripts-{$hooks[ static::PAGE_ID ]}", [ $this, 'enqueue_assets' ] ); } }, 10, 2 ); add_filter( 'elementor/finder/categories', function( array $categories ) { $categories['site']['items']['apps'] = [ 'title' => esc_html__( 'Add-ons', 'elementor' ), 'url' => admin_url( 'admin.php?page=' . static::PAGE_ID ), 'icon' => 'apps', 'keywords' => [ 'apps', 'addon', 'plugin', 'extension', 'integration' ], ]; return $categories; } ); // Add the Elementor Apps link to the plugin install action links. add_filter( 'install_plugins_tabs', [ $this, 'add_elementor_plugin_install_action_link' ] ); add_action( 'install_plugins_pre_elementor', [ $this, 'maybe_open_elementor_tab' ] ); add_action( 'admin_print_styles-plugin-install.php', [ $this, 'add_plugins_page_styles' ] ); } public function enqueue_assets() { add_filter( 'admin_body_class', [ $this, 'body_status_classes' ] ); wp_enqueue_style( 'elementor-apps', $this->get_css_assets_url( 'modules/apps/admin' ), [], ELEMENTOR_VERSION ); } public function body_status_classes( $admin_body_classes ) { $admin_body_classes .= ' elementor-apps-page'; return $admin_body_classes; } public function add_elementor_plugin_install_action_link( $tabs ) { $tabs['elementor'] = esc_html__( 'For Elementor', 'elementor' ); return $tabs; } public function maybe_open_elementor_tab() { if ( ! isset( $_GET['tab'] ) || 'elementor' !== $_GET['tab'] ) { return; } $elementor_url = add_query_arg( [ 'page' => static::PAGE_ID, 'tab' => 'elementor', 'ref' => 'plugins', ], admin_url( 'admin.php' ) ); wp_safe_redirect( $elementor_url ); exit; } public function add_plugins_page_styles() { ?> <style> .plugin-install-elementor > a::after { content: ""; display: inline-block; background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.33321 3H12.9999V7.66667H11.9999V4.70711L8.02009 8.68689L7.31299 7.97978L11.2928 4H8.33321V3Z' fill='%23646970'/%3E%3Cpath d='M6.33333 4.1665H4.33333C3.8731 4.1665 3.5 4.5396 3.5 4.99984V11.6665C3.5 12.1267 3.8731 12.4998 4.33333 12.4998H11C11.4602 12.4998 11.8333 12.1267 11.8333 11.6665V9.6665' stroke='%23646970'/%3E%3C/svg%3E%0A"); width: 16px; height: 16px; background-repeat: no-repeat; vertical-align: text-top; margin-left: 2px; } .plugin-install-elementor:hover > a::after { background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.33321 3H12.9999V7.66667H11.9999V4.70711L8.02009 8.68689L7.31299 7.97978L11.2928 4H8.33321V3Z' fill='%23135E96'/%3E%3Cpath d='M6.33333 4.1665H4.33333C3.8731 4.1665 3.5 4.5396 3.5 4.99984V11.6665C3.5 12.1267 3.8731 12.4998 4.33333 12.4998H11C11.4602 12.4998 11.8333 12.1267 11.8333 11.6665V9.6665' stroke='%23135E96'/%3E%3C/svg%3E%0A"); } </style> <?php } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка