Changeset 2544 for sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php
- Timestamp:
- 02/22/2016 08:50:25 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php
r2523 r2544 77 77 add_action( 'translation_editor_added', array( $this, 'update_wporg_profile_badge' ) ); 78 78 add_action( 'translation_editor_removed', array( $this, 'update_wporg_profile_badge' ) ); 79 80 add_action( 'wp_ajax_rosetta-get-projects', array( $this, 'ajax_rosetta_get_projects' ) ); 79 81 } 80 82 … … 619 621 */ 620 622 private function render_edit_translation_editor( $user_id ) { 623 global $wpdb; 624 625 $project_access_list = $this->get_users_projects( $user_id ); 626 627 $last_updated = $wpdb->get_var( 'SELECT meta_value FROM translate_meta WHERE object_type = "gp_option" AND meta_key = "wporg_projects_last_updated"' ); 628 629 wp_localize_script( 'rosetta-roles', '_rosettaProjectsSettings', array( 630 'l10n' => array( 631 'searchPlaceholder' => esc_attr__( 'Search...', 'rosetta' ), 632 ), 633 'lastUpdated' => $last_updated, 634 'accessList' => $project_access_list, 635 ) ); 636 637 $feedback_message = $this->get_feedback_message(); 638 639 require __DIR__ . '/views/edit-translation-editor.php'; 640 } 641 642 /** 643 * Ajax handler for retrieving projects. 644 */ 645 public function ajax_rosetta_get_projects() { 621 646 $projects = $this->get_translate_projects(); 622 647 $project_tree = $this->get_project_tree( $projects, 0, 1 ); … … 632 657 $project_tree = array_values( $project_tree ); 633 658 634 $project_access_list = $this->get_users_projects( $user_id ); 635 636 wp_localize_script( 'rosetta-roles', '_rosettaProjectsSettings', array( 637 'l10n' => array( 638 'searchPlaceholder' => esc_attr__( 'Search...', 'rosetta' ), 639 ), 640 'data' => $project_tree, 641 'accessList' => $project_access_list, 642 ) ); 643 644 $feedback_message = $this->get_feedback_message(); 645 646 require __DIR__ . '/views/edit-translation-editor.php'; 659 ob_start( 'ob_gzhandler' ); // Compress JSON. 660 wp_send_json_success( $project_tree ); 647 661 } 648 662
Note: See TracChangeset
for help on using the changeset viewer.