Making WordPress.org


Ignore:
Timestamp:
04/25/2016 03:38:34 PM (10 years ago)
Author:
ocean90
Message:

Translate: Refactor the Custom Routes plugin to use an autoloader.

See #1682.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc
Files:
1 added
1 copied
1 moved

Legend:

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

    r2999 r3002  
    11<?php
    22
     3namespace WordPressdotorg\GlotPress\Routes\Routes;
     4
    35// wporg_get_plugin_icon()
    4 if ( file_exists( WPORGPATH . 'extend/plugins-plugins/_plugin-icons.php' ) ) {
    5     include_once WPORGPATH . 'extend/plugins-plugins/_plugin-icons.php';
    6 }
     6use GP;
     7use GP_Locales;
     8use GP_Route;
     9use stdClass;
    710
    811/**
     
    1114 * Provides the route for translate.wordpress.org/locale/$locale.
    1215 */
    13 class WPorg_GP_Route_Locale extends GP_Route {
     16class Locale extends GP_Route {
    1417
    1518    /**
    1619     * Prints projects/translation sets of a top level project.
    1720     *
    18      * @param string $locale_slug      Slug of the locale.
    19      * @param string $set_slug         Slug of the translation set.
    20      * @param string $project_path    Path of a project.
     21     * @param string      $locale_slug  Slug of the locale.
     22     * @param string      $set_slug     Slug of the translation set.
     23     * @param bool|string $project_path Path of a project.
    2124     */
    2225    public function get_locale_projects( $locale_slug, $set_slug = 'default', $project_path = false ) {
     
    101104        $project_ids = array_merge(
    102105            $project_ids,
    103             $wpdb->get_col( "SELECT id FROM {$wpdb->gp_projects} WHERE parent_project_id IN(" . implode(', ', $project_ids  ) . ")" )
     106            $wpdb->get_col( "SELECT id FROM {$wpdb->gp_projects} WHERE parent_project_id IN( " . implode( ', ', $project_ids ) . ')' )
    104107        );
    105108
     
    192195        }
    193196
    194         switch( $project->slug ) {
     197        switch ( $project->slug ) {
    195198            case 'wp':
    196199                return '<div class="wordpress-icon"><span class="dashicons dashicons-wordpress-alt"></span></div>';
    197200            case 'meta':
    198                 switch( $sub_project->slug ) {
     201                switch ( $sub_project->slug ) {
    199202                    case 'forums':
    200203                        return '<div class="default-icon"><span class="dashicons dashicons-format-chat"></span></div>';
Note: See TracChangeset for help on using the changeset viewer.