| Server IP : 3.96.16.70 / Your IP : 216.73.216.15 Web Server : Apache System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/wondermakr.com/wp-content/plugins/modula/includes/admin/ |
Upload File : |
<?php
namespace Modula_Pro\Admin;
use Modula_Pro\Extensions\Licensing;
use Modula_Pro\Utils\Bulk_Editor;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Admin {
public function __construct() {
add_action( 'admin_enqueue_scripts', array( $this, 'license_script' ) );
add_filter( 'modula_admin_page_tabs', array( $this, 'add_license_tab' ) );
add_action( 'admin_footer', array( $this, 'add_css_translation' ) );
if ( Licensing::get_instance()->is_license_valid() ) {
// Remove Albums upsell metabox.
add_action( 'do_meta_boxes', array( $this, 'remove_albums_upsell_metabox' ), 16, 1 );
// Enqueue block assets.
add_action( 'modula_block_style', array( $this, 'enqueue_modula_block_styles' ) );
add_action( 'modula_block_scripts', array( $this, 'enqueue_modula_block_scripts' ) );
// Run bulk editor functionality
new Bulk_Editor();
}
}
// deprecated, should be removed after 2.9.0
public function add_license_tab() {}
public function add_css_translation() {
global $pagenow, $typenow;
if ( 'post.php' === $pagenow && 'modula-gallery' === $typenow ) {
// Injectăm CSS-ul în footer
echo '<style>
:root {
--modula-hidden-text: "' . esc_html__( 'Hidden', 'modula-pro' ) . '";
}
</style>';
}
}
public function license_script() {
global $id, $post;
// Get current screen.
$screen = get_current_screen();
wp_enqueue_style( 'modula-pro-style', MODULA_PRO_URL . 'assets/js/misc/wp-modula-pro.css', array(), MODULA_PRO_VERSION );
}
public function remove_albums_upsell_metabox() {
remove_meta_box( 'modula-albums-upsell', 'modula-gallery', 'normal' );
}
public function enqueue_modula_block_styles() {
wp_enqueue_style( 'modula-pro-effects', MODULA_PRO_URL . 'assets/js/misc/effects.css', array(), MODULA_PRO_VERSION );
wp_enqueue_style( 'modula-pro-bnb', MODULA_PRO_URL . 'assets/js/misc/modula-pro.css', array(), MODULA_PRO_VERSION );
}
public function enqueue_modula_block_scripts() {
$screen = get_current_screen();
if ( 'post' !== $screen->base && 'page' !== $screen->base && 'widgets' !== $screen->base ) {
return;
}
wp_enqueue_script( 'modula-pro-gutenberg', MODULA_PRO_URL . 'assets/js/gutenberg/modula-pro.js', array( 'jquery' ), MODULA_PRO_VERSION, true );
wp_enqueue_script( 'modula-pro', MODULA_PRO_URL . 'assets/js/misc/modula-pro.js', array( 'jquery' ), MODULA_PRO_VERSION, true );
wp_enqueue_script( 'modula-pro-tilt', MODULA_PRO_URL . 'assets/js/misc/modula-pro-tilt.js', array( 'jquery' ), MODULA_PRO_VERSION, true );
}
}