Changeset 3451114 for wp-lightbox-2/trunk/admin/admin_menu.php
- Timestamp:
- 01/31/2026 05:51:00 PM (8 weeks ago)
- File:
-
- 1 edited
-
wp-lightbox-2/trunk/admin/admin_menu.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-lightbox-2/trunk/admin/admin_menu.php
r1220099 r3451114 1 <?php 2 require_once($this->plugin_path.'admin/general_settings.php'); 1 <?php 3 2 4 class wp_lightbox_admin_menu{ 5 6 private $menu_name; 7 3 require_once $this->plugin_path . 'admin/general_settings.php'; 4 5 class wp_lightbox_admin_menu { 6 7 private $menu_name; 8 8 private $databese_parametrs; 9 10 9 private $plugin_url; 11 12 10 private $plugin_path; 13 14 private $text_parametrs;15 11 16 public $wp_lightbox_2_general_settings_page; 17 18 function __construct($param){ 19 $this->menu_name='WP Lightbox 2'; 20 $this->databese_parametrs=$param['databese_parametrs']->get_general_settings; 21 22 $this->wp_lightbox_2_general_settings_page =new wp_lightbox_2_general_settings_page( array( 'plugin_url'=> $this->plugin_url, 'plugin_path' => $this->plugin_path,'databese_settings' =>$this->databese_parametrs)); 23 12 public $wp_lightbox_2_general_settings_page; 13 14 public function __construct( $param = array() ) { 15 $this->menu_name = 'WP Lightbox 2'; 16 $this->databese_parametrs = $param[ 'databese_parametrs' ]->get_general_settings; 17 18 $this->wp_lightbox_2_general_settings_page = new wp_lightbox_2_general_settings_page( array( 19 'plugin_url' => $this->plugin_url, 20 'plugin_path' => $this->plugin_path, 21 'databese_settings' => $this->databese_parametrs 22 ) ); 23 24 24 // set plugin url 25 if(isset($param['plugin_url'])) 26 $this->plugin_url=$param['plugin_url']; 27 else 28 $this->plugin_url=trailingslashit(dirname(plugins_url('',__FILE__))); 25 if ( isset( $param[ 'plugin_url' ] ) ) { 26 $this->plugin_url = $param[ 'plugin_url' ]; 27 } else { 28 $this->plugin_url = trailingslashit( dirname( plugins_url( '', __FILE__ ) ) ); 29 } 30 29 31 // set plugin path 30 if(isset($param['plugin_path'])) 31 $this->plugin_path=$param['plugin_path']; 32 else 33 $this->plugin_path=trailingslashit(dirname(plugin_dir_path(__FILE__))); 34 35 36 32 if ( isset( $param[ 'plugin_path' ] ) ) { 33 $this->plugin_path = $param[ 'plugin_path' ]; 34 } else { 35 $this->plugin_path = trailingslashit( dirname( plugin_dir_path( __FILE__ ) ) ); 36 } 37 37 } 38 38 39 40 /// function for registr new button 41 function poll_button_register($plugin_array) 42 { 43 $url = $this->plugin_url.'admin/scripts/editor_plugin.js'; 44 $plugin_array["poll_mce"] = $url; 39 public function poll_button_register( $plugin_array = array() ) { 40 $url = $this->plugin_url . 'admin/scripts/editor_plugin.js'; 41 $plugin_array[ "poll_mce" ] = $url; 42 45 43 return $plugin_array; 46 47 44 } 48 45 46 public function create_menu() { 49 47 50 public function window_for_inserting_contentt(){} 51 public function create_menu(){ 52 53 $manage_page_main = add_menu_page( $this->menu_name, $this->menu_name, 'manage_options', str_replace( ' ', '-', $this->menu_name), array($this->wp_lightbox_2_general_settings_page, 'controller_page'),$this->plugin_url.'admin/images/icon_lightboxx2.png'); 54 add_submenu_page( str_replace( ' ', '-', $this->menu_name), 'General settings', 'General settings', 'manage_options', str_replace( ' ', '-', $this->menu_name), array($this->wp_lightbox_2_general_settings_page, 'controller_page')); 55 add_action('admin_print_styles-' .$manage_page_main, array($this,'menu_requeried_scripts')); 48 $manage_page_main = add_menu_page( 49 $this->menu_name, 50 $this->menu_name, 51 'manage_options', 52 str_replace( ' ', '-', $this->menu_name ), 53 array( 54 $this->wp_lightbox_2_general_settings_page, 55 'controller_page' 56 ), 57 $this->plugin_url . 'admin/images/icon_lightboxx2.png' 58 ); 59 60 add_submenu_page( 61 str_replace( ' ', '-', $this->menu_name ), 62 'General settings', 63 'General settings', 64 'manage_options', 65 str_replace( ' ', '-', $this->menu_name ), 66 array( 67 $this->wp_lightbox_2_general_settings_page, 68 'controller_page' 69 ) 70 ); 71 72 add_action( 73 'admin_print_styles-' . $manage_page_main, 74 array( 75 $this, 76 'menu_requeried_scripts' 77 ) 78 ); 56 79 } 57 public function menu_requeried_scripts(){ 58 wp_enqueue_script('jquery-ui-style'); 59 wp_enqueue_script('jquery'); 60 wp_enqueue_script('jquery-ui-core'); 61 wp_enqueue_script("jquery-ui-widget"); 62 wp_enqueue_script("jquery-ui-mouse"); 63 wp_enqueue_script("jquery-ui-slider"); 64 wp_enqueue_script("jquery-ui-sortable"); 65 wp_enqueue_script('wp-color-picker'); 66 wp_enqueue_style("jquery-ui-style"); 67 wp_enqueue_style("admin_style_wp_lightbox"); 80 81 public function menu_requeried_scripts() { 82 wp_enqueue_script( 'jquery-ui-style' ); 83 wp_enqueue_script( 'jquery' ); 84 wp_enqueue_script( 'jquery-ui-core' ); 85 wp_enqueue_script( 'jquery-ui-widget' ); 86 wp_enqueue_script( 'jquery-ui-mouse' ); 87 wp_enqueue_script( 'jquery-ui-slider' ); 88 wp_enqueue_script( 'jquery-ui-sortable' ); 89 wp_enqueue_script( 'wp-color-picker' ); 90 91 wp_enqueue_style( 'jquery-ui-style' ); 92 wp_enqueue_style( 'admin_style_wp_lightbox' ); 68 93 wp_enqueue_style( 'wp-color-picker' ); 94 69 95 add_thickbox(); 70 71 96 } 72 73 97 }
Note: See TracChangeset
for help on using the changeset viewer.