| @@ -4,21 +4,21 @@ | ||
| 4 | 4 | public static function create( $type ) { |
| 5 | 5 | $exporter = false; |
| 6 | 6 | |
| 7 | 7 | if ( $type === 'rss' ) { |
| 8 | - include_once dirname( dirname( __FILE__ ) ) . '/fileio/rss.php'; | |
| 8 | + include_once dirname( dirname( __FILE__ ) ).'/fileio/rss.php'; | |
| 9 | 9 | $exporter = new Red_Rss_File(); |
| 10 | 10 | } elseif ( $type === 'csv' ) { |
| 11 | - include_once dirname( dirname( __FILE__ ) ) . '/fileio/csv.php'; | |
| 11 | + include_once dirname( dirname( __FILE__ ) ).'/fileio/csv.php'; | |
| 12 | 12 | $exporter = new Red_Csv_File(); |
| 13 | 13 | } elseif ( $type === 'apache' ) { |
| 14 | - include_once dirname( dirname( __FILE__ ) ) . '/fileio/apache.php'; | |
| 14 | + include_once dirname( dirname( __FILE__ ) ).'/fileio/apache.php'; | |
| 15 | 15 | $exporter = new Red_Apache_File(); |
| 16 | 16 | } elseif ( $type === 'nginx' ) { |
| 17 | - include_once dirname( dirname( __FILE__ ) ) . '/fileio/nginx.php'; | |
| 17 | + include_once dirname( dirname( __FILE__ ) ).'/fileio/nginx.php'; | |
| 18 | 18 | $exporter = new Red_Nginx_File(); |
| 19 | 19 | } elseif ( $type === 'json' ) { |
| 20 | - include_once dirname( dirname( __FILE__ ) ) . '/fileio/json.php'; | |
| 20 | + include_once dirname( dirname( __FILE__ ) ).'/fileio/json.php'; | |
| 21 | 21 | $exporter = new Red_Json_File(); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | return $exporter; |
| @@ -29,17 +29,17 @@ | ||
| 29 | 29 | $extension = isset( $parts['extension'] ) ? $parts['extension'] : ''; |
| 30 | 30 | $extension = strtolower( $extension ); |
| 31 | 31 | |
| 32 | 32 | if ( $extension === 'csv' ) { |
| 33 | - include_once dirname( dirname( __FILE__ ) ) . '/fileio/csv.php'; | |
| 33 | + include_once dirname( dirname( __FILE__ ) ).'/fileio/csv.php'; | |
| 34 | 34 | $importer = new Red_Csv_File(); |
| 35 | 35 | $data = ''; |
| 36 | - } elseif ( $extension === 'json' ) { | |
| 37 | - include_once dirname( dirname( __FILE__ ) ) . '/fileio/json.php'; | |
| 36 | + } else if ( $extension === 'json' ) { | |
| 37 | + include_once dirname( dirname( __FILE__ ) ).'/fileio/json.php'; | |
| 38 | 38 | $importer = new Red_Json_File(); |
| 39 | 39 | $data = @file_get_contents( $file['tmp_name'] ); |
| 40 | 40 | } else { |
| 41 | - include_once dirname( dirname( __FILE__ ) ) . '/fileio/apache.php'; | |
| 41 | + include_once dirname( dirname( __FILE__ ) ).'/fileio/apache.php'; | |
| 42 | 42 | $importer = new Red_Apache_File(); |
| 43 | 43 | $data = @file_get_contents( $file['tmp_name'] ); |
| 44 | 44 | } |
| 45 | 45 | |
| @@ -57,20 +57,10 @@ | ||
| 57 | 57 | header( 'Cache-Control: no-cache, must-revalidate' ); |
| 58 | 58 | header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - protected function export_filename( $extension ) { | |
| 62 | - $name = wp_parse_url( home_url(), PHP_URL_HOST ); | |
| 63 | - $name = str_replace( '.', '-', $name ); | |
| 64 | - $date = strtolower( date_i18n( get_option( 'date_format' ) ) ); | |
| 65 | - $date = str_replace( [ ',', ' ', '--' ], '-', $date ); | |
| 66 | - | |
| 67 | - return 'redirection-' . $name . '-' . $date . '.' . $extension; | |
| 68 | - } | |
| 69 | - | |
| 70 | 61 | public static function export( $module_name_or_id, $format ) { |
| 71 | - $groups = false; | |
| 72 | - $items = false; | |
| 62 | + $groups = $items = false; | |
| 73 | 63 | |
| 74 | 64 | if ( $module_name_or_id === 'all' || $module_name_or_id === 0 ) { |
| 75 | 65 | $groups = Red_Group::get_all(); |
| 76 | 66 | $items = Red_Item::get_all(); |