Changeset 4929 for sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php
- Timestamp:
- 02/18/2017 09:57:45 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php
r4347 r4929 12 12 } 13 13 14 require __DIR__ . '/cross-locale-pte.php'; 15 14 16 class Rosetta_Roles { 15 17 /** … … 68 70 $this->gp_locale = $gp_locale; 69 71 70 add_action( 'admin_menu', array( $this, 'register_translation_editors_page' ) ); 71 add_filter( 'set-screen-option', array( $this, 'save_custom_screen_options' ), 10, 3 ); 72 73 add_action( 'translation_editor_added', array( $this, 'update_wporg_profile_badge' ) ); 74 add_action( 'translation_editor_removed', array( $this, 'update_wporg_profile_badge' ) ); 72 if ( ! is_main_site() ) { 73 add_action( 'admin_menu', array( $this, 'register_translation_editors_page' ) ); 74 add_filter( 'set-screen-option', array( $this, 'save_custom_screen_options' ), 10, 3 ); 75 76 add_action( 'translation_editor_added', array( $this, 'update_wporg_profile_badge' ) ); 77 add_action( 'translation_editor_removed', array( $this, 'update_wporg_profile_badge' ) ); 78 } 75 79 76 80 add_action( 'wp_ajax_rosetta-get-projects', array( $this, 'ajax_rosetta_get_projects' ) ); 81 82 Cross_Locale_PTE::init_admin(); 77 83 } 78 84 … … 93 99 add_action( 'load-' . $this->translation_editors_page, array( $this, 'load_translation_editors_page' ) ); 94 100 add_action( 'load-' . $this->translation_editors_page, array( $this, 'register_screen_options' ) ); 95 add_action( 'admin_print_scripts-' . $this->translation_editors_page, array( $this, 'enqueue_scripts' ) );96 add_action( 'admin_footer-' . $this->translation_editors_page, array( $this, 'print_js_templates' ) );97 add_action( 'admin_print_styles-' . $this->translation_editors_page, array( $this, 'enqueue_styles' ) );101 add_action( 'admin_print_scripts-' . $this->translation_editors_page, array( __CLASS__, 'enqueue_scripts' ) ); 102 add_action( 'admin_footer-' . $this->translation_editors_page, array( __CLASS__, 'print_js_templates' ) ); 103 add_action( 'admin_print_styles-' . $this->translation_editors_page, array( __CLASS__, 'enqueue_styles' ) ); 98 104 } 99 105 … … 101 107 * Enqueues scripts. 102 108 */ 103 public function enqueue_scripts() {109 public static function enqueue_scripts() { 104 110 wp_enqueue_script( 'string_score', plugins_url( '/js/string_score.min.js', __FILE__ ), array(), '0.1.22', true ); 105 wp_enqueue_script( 'rosetta-roles', plugins_url( '/js/rosetta-roles.js', __FILE__ ), array( 'jquery', 'wp-backbone', 'string_score' ), ' 9', true );111 wp_enqueue_script( 'rosetta-roles', plugins_url( '/js/rosetta-roles.js', __FILE__ ), array( 'jquery', 'wp-backbone', 'string_score' ), '10', true ); 106 112 } 107 113 … … 109 115 * Enqueues styles. 110 116 */ 111 public function enqueue_styles() {117 public static function enqueue_styles() { 112 118 $suffix = is_rtl() ? '-rtl' : ''; 113 119 wp_enqueue_style( 'rosetta-roles', plugins_url( "/css/rosetta-roles$suffix.css", __FILE__ ), array(), '4' ); … … 117 123 * Prints JavaScript templates. 118 124 */ 119 public function print_js_templates() {125 public static function print_js_templates() { 120 126 ?> 121 127 <script id="tmpl-project-checkbox" type="text/html">
Note: See TracChangeset
for help on using the changeset viewer.