Making WordPress.org


Ignore:
Timestamp:
02/18/2017 09:57:45 PM (8 years ago)
Author:
ocean90
Message:

Translate/Rosetta: Add infrastructure for Cross-Locale PTEs.

Props akirk.
See #2000.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-rosetta-roles/inc/class-plugin.php

    r4510 r4929  
    55use GP;
    66use GP_Locales;
     7use Cross_Locale_PTE;
     8
     9require_once WPMU_PLUGIN_DIR . '/rosetta-network/roles/cross-locale-pte.php';
    710
    811class Plugin {
     
    6871        add_action( 'gp_project_created', array( $this, 'project_created' ) );
    6972        add_action( 'gp_project_saved', array( $this, 'project_saved' ) );
     73        add_filter( 'gp_translation_set_import_status', array( 'Cross_Locale_PTE', 'gp_translation_set_import_status' ), 9, 3 );
    7074
    7175        if ( is_admin() ) {
     
    97101        if ( $this->is_global_administrator( $args['user_id'] ) ) {
    98102            return true;
     103        }
     104
     105        // Grant permissions to Cross-Locale PTEs.
     106        $cross_locale_pte_verdict = Cross_Locale_PTE::gp_pre_can_user( $verdict, $args );
     107    #   var_dump($cross_locale_pte_verdict);
     108        if ( is_bool( $cross_locale_pte_verdict ) ) {
     109            return $cross_locale_pte_verdict;
    99110        }
    100111
Note: See TracChangeset for help on using the changeset viewer.