PluginProbe
Insert Html Snippet / trunk
Insert Html Snippet vtrunk
1.4.6 trunk 1.0 1.0.1 1.1 1.1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.4 1.4.1 1.4.2 1.4.3 All 27 releases
insert-html-snippet / admin / menu.php

menu.php in Insert Html Snippet trunk, at admin/menu.php

92 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) )
3 exit;
4 if(isset($_GET['page']) && $_GET['page']=='insert-html-snippet-suggest-features' ){
5 ob_start();
6 }
7 if(isset($_GET['page']) && $_GET['page']=='insert-html-snippet-manage' ){
8 ob_start();
9 }
10 add_action('admin_menu', 'xyz_ihs_menu');
11
12
13 function xyz_ihs_menu(){
14
15 add_menu_page('insert-html-snippet', 'Insert Html Snippet', 'manage_options', 'insert-html-snippet-manage','xyz_ihs_snippets',plugins_url('images/logo.png',XYZ_INSERT_HTML_PLUGIN_FILE));
16
17 add_submenu_page('insert-html-snippet-manage', 'HTML Snippets', 'HTML Snippets', 'manage_options', 'insert-html-snippet-manage','xyz_ihs_snippets');
18 add_submenu_page('insert-html-snippet-manage', 'HTML Snippets - Manage settings', 'Settings', 'manage_options', 'insert-html-snippet-settings' ,'xyz_ihs_settings');
19 add_submenu_page('insert-html-snippet-manage', 'HTML Snippets - About', 'About', 'manage_options', 'insert-html-snippet-about' ,'xyz_ihs_about');
20 add_submenu_page('insert-html-snippet-manage', 'HTML Snippets - Suggest Feature', 'Suggest a Feature', 'manage_options', 'insert-html-snippet-suggest-features' ,'xyz_ihs_suggest_feature');
21 }
22
23 function xyz_ihs_snippets(){
24 $formflag = 0;
25 if(isset($_GET['action']) && $_GET['action']=='snippet-delete' )
26 {
27 include(dirname( __FILE__ ) . '/snippet-delete.php');
28 $formflag=1;
29 }
30 if(isset($_GET['action']) && $_GET['action']=='snippet-edit' )
31 {
32 require( dirname( __FILE__ ) . '/header.php' );
33 include(dirname( __FILE__ ) . '/snippet-edit.php');
34 require( dirname( __FILE__ ) . '/footer.php' );
35 $formflag=1;
36 }
37 if(isset($_GET['action']) && $_GET['action']=='snippet-add' )
38 {
39 require( dirname( __FILE__ ) . '/header.php' );
40 require( dirname( __FILE__ ) . '/snippet-add.php' );
41 require( dirname( __FILE__ ) . '/footer.php' );
42 $formflag=1;
43 }
44 if(isset($_GET['action']) && $_GET['action']=='snippet-status' )
45 {
46 require( dirname( __FILE__ ) . '/snippet-status.php' );
47 $formflag=1;
48 }
49 if($formflag == 0){
50 require( dirname( __FILE__ ) . '/header.php' );
51 require( dirname( __FILE__ ) . '/snippets.php' );
52 require( dirname( __FILE__ ) . '/footer.php' );
53 }
54 }
55
56 function xyz_ihs_settings()
57 {
58 require( dirname( __FILE__ ) . '/header.php' );
59 require( dirname( __FILE__ ) . '/settings.php' );
60 require( dirname( __FILE__ ) . '/footer.php' );
61
62 }
63
64 function xyz_ihs_about(){
65 require( dirname( __FILE__ ) . '/header.php' );
66 require( dirname( __FILE__ ) . '/about.php' );
67 require( dirname( __FILE__ ) . '/footer.php' );
68 }
69
70 function xyz_ihs_suggest_feature(){
71 require( dirname( __FILE__ ) . '/header.php' );
72 require( dirname( __FILE__ ) . '/suggest_feature.php' );
73 require( dirname( __FILE__ ) . '/footer.php' );
74 }
75
76 function xyz_ihs_add_style_script(){
77
78 wp_enqueue_script('jquery');
79 $current_version = xyz_ihs_plugin_get_version();
80 // Register and enqueue script with versioning
81 wp_register_script( 'xyz_ihs_notice_script', plugins_url('js/notice.js', XYZ_INSERT_HTML_PLUGIN_FILE ),array(),$current_version);
82 wp_enqueue_script( 'xyz_ihs_notice_script' );
83
84
85 // Register stylesheets
86 wp_register_style('xyz_ihs_style',plugins_url('css/xyz_ihs_styles.css', XYZ_INSERT_HTML_PLUGIN_FILE ),array(),$current_version);
87 wp_enqueue_style('xyz_ihs_style');
88 }
89 add_action('admin_enqueue_scripts', 'xyz_ihs_add_style_script');
90
91 ?>
92