Changeset 12063 for sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-gp-translation-helpers.php
- Timestamp:
- 09/15/2022 03:13:17 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-gp-translation-helpers.php
r12014 r12063 68 68 gp_enqueue_style( 'thickbox' ); 69 69 70 wp_register_style( 'gp-discussion-css', plugins_url( '/../css/discussion.css', __FILE__ ), array(), '20220801' ); 70 wp_register_style( 71 'gp-discussion-css', 72 plugins_url( 'css/discussion.css', __DIR__ ), 73 array(), 74 filemtime( plugin_dir_path( __DIR__ ) . 'css/discussion.css' ) 75 ); 71 76 gp_enqueue_style( 'gp-discussion-css' ); 72 77 … … 76 81 'gp_tmpl_load_locations', 77 82 function( $locations, $template, $args, $template_path ) { 78 if ( 'translation-row-editor-meta-status' === $template ) {83 if ( 'translation-row-editor-meta-status' === $template || 'locale-projects' === $template ) { 79 84 array_unshift( $locations, dirname( dirname( __FILE__ ) ) . '/templates/gp-templates-overrides/' ); 80 85 } else { … … 190 195 ); 191 196 192 wp_register_style( 'gp-translation-helpers-css', plugins_url( 'css/translation-helpers.css', __DIR__ ), '', '20220801' ); // todo: add the version as global element. 197 wp_register_style( 198 'gp-translation-helpers-css', 199 plugins_url( 'css/translation-helpers.css', __DIR__ ), 200 array(), 201 filemtime( plugin_dir_path( __DIR__ ) . 'css/translation-helpers.css' ) 202 ); 193 203 gp_enqueue_style( 'gp-translation-helpers-css' ); 194 204 195 wp_register_script( 'gp-translation-helpers', plugins_url( '/js/translation-helpers.js', __DIR__ ), array( 'gp-editor' ), '20220801', true ); 205 wp_register_script( 206 'gp-translation-helpers', 207 plugins_url( 'js/translation-helpers.js', __DIR__ ), 208 array( 'gp-editor' ), 209 filemtime( plugin_dir_path( __DIR__ ) . 'js/translation-helpers.js' ), 210 true 211 ); 196 212 gp_enqueue_scripts( array( 'gp-translation-helpers' ) ); 197 213 … … 312 328 GP::$router->prepend( "/$project/-get-translation-helpers/$id", array( 'GP_Route_Translation_Helpers', 'ajax_translation_helpers' ), 'get' ); 313 329 GP::$router->prepend( "/$project/$locale/$dir/-get-translation-helpers/$id", array( 'GP_Route_Translation_Helpers', 'ajax_translation_helpers_locale' ), 'get' ); 330 GP::$router->prepend( "/locale/$locale/$dir/discussions/?", array( 'GP_Route_Translation_Helpers', 'discussions_dashboard' ), 'get' ); 314 331 } 315 332 … … 364 381 } 365 382 366 wp_register_script( 'gp-comment-feedback-js', plugins_url( '/../js/reject-feedback.js', __FILE__ ), array( 'jquery', 'gp-common', 'gp-editor', 'thickbox' ), '20220812' ); 383 wp_register_script( 384 'gp-comment-feedback-js', 385 plugins_url( 'js/reject-feedback.js', __DIR__ ), 386 array( 'jquery', 'gp-common', 'gp-editor', 'thickbox' ), 387 filemtime( plugin_dir_path( __DIR__ ) . 'js/reject-feedback.js' ) 388 ); 367 389 gp_enqueue_script( 'gp-comment-feedback-js' ); 368 390 … … 403 425 $comment = sanitize_text_field( $_POST['data']['comment'] ); 404 426 405 if ( ! $locale_slug || ! $translation_id_array || ! $original_id_array || ( ! $comment_reason && ! $comment ) ) { 406 wp_send_json_error(); 427 if ( ! $locale_slug ) { 428 wp_send_json_error( 'Oops! Locale slug missing' ); 429 } 430 if ( ! $translation_id_array ) { 431 wp_send_json_error( 'Oops! Translation ID missing' ); 432 } 433 if ( ! $original_id_array ) { 434 wp_send_json_error( 'Oops! Original ID missing' ); 435 } 436 if ( ! $comment_reason && ! $comment ) { 437 wp_send_json_error( 'Oops! No comment and reason found' ); 407 438 } 408 439
Note: See TracChangeset
for help on using the changeset viewer.