PluginProbe
Insert Html Snippet / 1.3
Insert Html Snippet v1.3
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 1.3, at admin/menu.php

106 lines 3.4 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
5 if(isset($_GET['action']) && $_GET['action']=='snippet-status' ){
6 ob_start();
7 }
8
9 if(isset($_GET['action']) && $_GET['action']=='snippet-add' ){
10 ob_start();
11 }
12
13 if(isset($_GET['action']) && $_GET['action']=='snippet-delete' ){
14 ob_start();
15 }
16
17 if(isset($_GET['action']) && $_GET['action']=='snippet-edit' ){
18 ob_start();
19 }
20 if(isset($_GET['page']) && $_GET['page']=='insert-html-snippet-suggest-features' ){
21 ob_start();
22 }
23 if(isset($_GET['page']) && $_GET['page']=='insert-html-snippet-manage' ){
24 ob_start();
25 }
26 add_action('admin_menu', 'xyz_ihs_menu');
27
28
29 function xyz_ihs_menu(){
30
31 add_menu_page('insert-html-snippet', 'XYZ Html', 'manage_options', 'insert-html-snippet-manage','xyz_ihs_snippets',plugins_url('images/logo.png',XYZ_INSERT_HTML_PLUGIN_FILE));
32
33 add_submenu_page('insert-html-snippet-manage', 'HTML Snippets', 'HTML Snippets', 'manage_options', 'insert-html-snippet-manage','xyz_ihs_snippets');
34 add_submenu_page('insert-html-snippet-manage', 'HTML Snippets - Manage settings', 'Settings', 'manage_options', 'insert-html-snippet-settings' ,'xyz_ihs_settings');
35 add_submenu_page('insert-html-snippet-manage', 'HTML Snippets - About', 'About', 'manage_options', 'insert-html-snippet-about' ,'xyz_ihs_about');
36 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');
37 }
38
39 function xyz_ihs_snippets(){
40 $formflag = 0;
41 if(isset($_GET['action']) && $_GET['action']=='snippet-delete' )
42 {
43 include(dirname( __FILE__ ) . '/snippet-delete.php');
44 $formflag=1;
45 }
46 if(isset($_GET['action']) && $_GET['action']=='snippet-edit' )
47 {
48 require( dirname( __FILE__ ) . '/header.php' );
49 include(dirname( __FILE__ ) . '/snippet-edit.php');
50 require( dirname( __FILE__ ) . '/footer.php' );
51 $formflag=1;
52 }
53 if(isset($_GET['action']) && $_GET['action']=='snippet-add' )
54 {
55 require( dirname( __FILE__ ) . '/header.php' );
56 require( dirname( __FILE__ ) . '/snippet-add.php' );
57 require( dirname( __FILE__ ) . '/footer.php' );
58 $formflag=1;
59 }
60 if(isset($_GET['action']) && $_GET['action']=='snippet-status' )
61 {
62 require( dirname( __FILE__ ) . '/snippet-status.php' );
63 $formflag=1;
64 }
65 if($formflag == 0){
66 require( dirname( __FILE__ ) . '/header.php' );
67 require( dirname( __FILE__ ) . '/snippets.php' );
68 require( dirname( __FILE__ ) . '/footer.php' );
69 }
70 }
71
72 function xyz_ihs_settings()
73 {
74 require( dirname( __FILE__ ) . '/header.php' );
75 require( dirname( __FILE__ ) . '/settings.php' );
76 require( dirname( __FILE__ ) . '/footer.php' );
77
78 }
79
80 function xyz_ihs_about(){
81 require( dirname( __FILE__ ) . '/header.php' );
82 require( dirname( __FILE__ ) . '/about.php' );
83 require( dirname( __FILE__ ) . '/footer.php' );
84 }
85
86 function xyz_ihs_suggest_feature(){
87 require( dirname( __FILE__ ) . '/header.php' );
88 require( dirname( __FILE__ ) . '/suggest_feature.php' );
89 require( dirname( __FILE__ ) . '/footer.php' );
90 }
91
92 function xyz_ihs_add_style_script(){
93
94 wp_enqueue_script('jquery');
95
96 wp_register_script( 'xyz_notice_script', plugins_url('js/notice.js', XYZ_INSERT_HTML_PLUGIN_FILE ));
97 wp_enqueue_script( 'xyz_notice_script' );
98
99
100 // Register stylesheets
101 wp_register_style('xyz_ihs_style',plugins_url('css/xyz_ihs_styles.css', XYZ_INSERT_HTML_PLUGIN_FILE ));
102 wp_enqueue_style('xyz_ihs_style');
103 }
104 add_action('admin_enqueue_scripts', 'xyz_ihs_add_style_script');
105
106 ?>