@@ -58,76 +58,10 @@ public function __construct( Visualizer_Plugin $plugin ) {
58
58
$ this ->_addAction ( 'admin_footer ' , 'renderTempaltes ' );
59
59
$ this ->_addAction ( 'admin_enqueue_scripts ' , 'enqueueLibraryScripts ' );
60
60
$ this ->_addAction ( 'admin_menu ' , 'registerAdminMenu ' );
61
- // Added by Ash/Upwork for feedback
62
- $ this ->_addAction ( 'admin_init ' , 'visualizerInitFeedback ' );
63
- // Added by Ash/Upwork for feedback
64
61
65
62
$ this ->_addFilter ( 'media_view_strings ' , 'setupMediaViewStrings ' );
66
63
$ this ->_addFilter ( 'plugin_action_links ' , 'getPluginActionLinks ' , 10 , 2 );
67
64
$ this ->_addFilter ( 'plugin_row_meta ' , 'getPluginMetaLinks ' , 10 , 2 );
68
- $ this ->_addFilter ( 'visualizer_admin_pointers ' , 'visualizerAdminPointers ' , 10 , 2 );
69
- // Added by Ash/Upwork for feedback
70
- $ this ->_addFilter ( 'visualizer_feedback_enqueue ' , 'visualizerFeedbackEnqueue ' , 10 , 2 );
71
- $ this ->_addFilter ( 'visualizer_feedback ' , 'visualizerFeedback ' , 10 , 2 );
72
- $ this ->_addFilter ( 'visualizer_feedback_config ' , 'visualizerFeedbackConfig ' , 10 , 2 );
73
- $ this ->_addFilter ( 'visualizer_feedback_action ' , 'visualizerFeedbackAction ' , 10 , 2 );
74
- // Added by Ash/Upwork for feedback
75
- }
76
-
77
- // Added by Ash/Upwork for feedback
78
- function visualizerFeedbackConfig (){
79
- return array (
80
- "title " => "TITLE " ,
81
- "description " => "Message that will ask the user for review " ,
82
- "yes_btn_txt " => "Text to show on yes btn " ,
83
- "no_btn_txt " => "txt to show on no btn " ,
84
- "yes_btn_link " => "link to redirect when click on the yes btn " ,
85
- );
86
- }
87
-
88
- function visualizerFeedbackAction (){
89
- return array ("type " =>"splash " ,"action " =>array ("type " =>"click " ,"target " =>".add-new-h2 " ));
90
- }
91
-
92
- function visualizerFeedback (){
93
- return true ;
94
- }
95
-
96
- function visualizerInitFeedback (){
97
- $ file = trailingslashit (VISUALIZER_ABSPATH ) . "feedback/PluginFeedbackTI.php " ;
98
- if (file_exists ($ file )) {
99
- include_once $ file ;
100
- new PluginFeedbackTI (Visualizer_Plugin::NAME , 1 , Visualizer_Plugin::VERSION , "visualizer_feedback " , "visualizer_feedback_config " , "visualizer_feedback_action " , "visualizer_feedback_enqueue " );
101
- }
102
- }
103
-
104
- function visualizerFeedbackEnqueue (){
105
- wp_register_script ("ti-feedback-func " , VISUALIZER_ABSURL . 'js/feedback-func.js ' );
106
- wp_enqueue_script ("ti-feedback-func " );
107
- }
108
- // Added by Ash/Upwork for feedback
109
-
110
- /**
111
- * Returns wp pointers for visualizer
112
- *
113
- * @since 1.5
114
- *
115
- * @static
116
- * @access private
117
- * @return array The associated array of pointer
118
- */
119
- function visualizerAdminPointers ( $ p ) {
120
- $ p ['visualizer ' ] = array (
121
- 'target ' => '#menu-media ' ,
122
- 'options ' => array (
123
- 'content ' => sprintf ( '<h3> %s </h3> <p> %s </p> ' ,
124
- __ ( 'Visualizer New Features ' , Visualizer_Plugin::NAME ),
125
- __ ( 'Right now the Visualizer Charts and Graphics plugin integrates a live editor and a new importing option for your charts. ' ,Visualizer_Plugin::NAME )
126
- ),
127
- 'position ' => array ( 'edge ' => 'top ' , 'align ' => 'middle ' )
128
- )
129
- );
130
- return $ p ;
131
65
}
132
66
133
67
/**
@@ -175,7 +109,7 @@ public function enqueueMediaScripts() {
175
109
176
110
wp_enqueue_script ( 'visualizer-google-jsapi-new ' , '//www.gstatic.com/charts/loader.js ' , array ( 'media-editor ' ), null , true );
177
111
wp_enqueue_script ( 'visualizer-google-jsapi-old ' , '//www.google.com/jsapi ' , array ( 'visualizer-google-jsapi-new ' ), null , true );
178
- wp_enqueue_script ( 'visualizer-media-model ' , VISUALIZER_ABSURL . 'js/media/model.js ' , array ( 'visualizer-google-jsapi ' ), Visualizer_Plugin::VERSION , true );
112
+ wp_enqueue_script ( 'visualizer-media-model ' , VISUALIZER_ABSURL . 'js/media/model.js ' , array ( 'visualizer-google-jsapi-old ' ), Visualizer_Plugin::VERSION , true );
179
113
wp_enqueue_script ( 'visualizer-media-collection ' , VISUALIZER_ABSURL . 'js/media/collection.js ' , array ( 'visualizer-media-model ' ), Visualizer_Plugin::VERSION , true );
180
114
wp_enqueue_script ( 'visualizer-media-controller ' , VISUALIZER_ABSURL . 'js/media/controller.js ' , array ( 'visualizer-media-collection ' ), Visualizer_Plugin::VERSION , true );
181
115
wp_enqueue_script ( 'visualizer-media-view ' , VISUALIZER_ABSURL . 'js/media/view.js ' , array ( 'visualizer-media-controller ' ), Visualizer_Plugin::VERSION , true );
@@ -258,46 +192,6 @@ public function enqueueLibraryScripts( $suffix ) {
258
192
wp_enqueue_script ( 'google-jsapi-old ' , '//www.google.com/jsapi ' , array ('google-jsapi-new ' ), null , true );
259
193
wp_enqueue_script ( 'visualizer-render ' , VISUALIZER_ABSURL . 'js/render.js ' , array ( 'google-jsapi-old ' , 'visualizer-library ' ), Visualizer_Plugin::VERSION , true );
260
194
}
261
- if ( get_bloginfo ( 'version ' ) < '3.3 ' )
262
- return ;
263
-
264
-
265
- // Get pointers for this screen
266
- $ pointers = apply_filters ( 'visualizer_admin_pointers ' , array () );
267
-
268
- if ( ! $ pointers || ! is_array ( $ pointers ) )
269
- return ;
270
-
271
- // Get dismissed pointers
272
- $ dismissed = explode ( ', ' , (string ) get_user_meta ( get_current_user_id (), 'dismissed_wp_pointers ' , true ) );
273
- $ valid_pointers =array ();
274
- // Check pointers and remove dismissed ones.
275
- foreach ( $ pointers as $ pointer_id => $ pointer ) {
276
-
277
- // Sanity check
278
- if ( in_array ( $ pointer_id , $ dismissed ) || empty ( $ pointer ) || empty ( $ pointer_id ) || empty ( $ pointer ['target ' ] ) || empty ( $ pointer ['options ' ] ) )
279
- continue ;
280
-
281
- $ pointer ['pointer_id ' ] = $ pointer_id ;
282
-
283
- // Add the pointer to $valid_pointers array
284
- $ valid_pointers ['pointers ' ][] = $ pointer ;
285
- }
286
-
287
- // No valid pointers? Stop here.
288
- if ( empty ( $ valid_pointers ) )
289
- return ;
290
-
291
- // Add pointers style to queue.
292
- wp_enqueue_style ( 'wp-pointer ' );
293
- // Add pointers script to queue. Add custom script.
294
- wp_enqueue_script ( 'visualizer-pointer ' , VISUALIZER_ABSURL ."js/visualizer-pointer.js " , array ( 'wp-pointer ' ),Visualizer_Plugin::VERSION );
295
-
296
- // Add pointer options to script.
297
- wp_localize_script ( 'visualizer-pointer ' , 'visualizer ' , $ valid_pointers );
298
-
299
-
300
-
301
195
}
302
196
303
197
/**
0 commit comments