| @@ -1,10 +1,19 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * Loads & Manages exporter classes. | |
| 4 | + * | |
| 5 | + * @package WP_Stream | |
| 6 | + */ | |
| 7 | + | |
| 2 | 8 | namespace WP_Stream; |
| 3 | 9 | |
| 10 | +/** | |
| 11 | + * Class - Export | |
| 12 | + */ | |
| 4 | 13 | class Export { |
| 5 | 14 | /** |
| 6 | - * Hold Plugin class | |
| 15 | + * Holds instance of plugin object | |
| 7 | 16 | * |
| 8 | 17 | * @var Plugin |
| 9 | 18 | */ |
| 10 | 19 | public $plugin; |
| @@ -72,14 +81,16 @@ | ||
| 72 | 81 | |
| 73 | 82 | /** |
| 74 | 83 | * Add Export options to record actions menu |
| 75 | 84 | * |
| 85 | + * @param array $action_menu_items Export types. | |
| 86 | + * | |
| 76 | 87 | * @return array |
| 77 | 88 | */ |
| 78 | 89 | public function actions_menu_export_items( $action_menu_items ) { |
| 79 | 90 | foreach ( $this->get_exporters() as $exporter ) { |
| 80 | 91 | $action = 'export-' . $exporter->slug; |
| 81 | - // translators: Placeholder refers to an export format (e.g. "CSV") | |
| 92 | + /* translators: %s: an export format (e.g. "CSV") */ | |
| 82 | 93 | $action_menu_items[ $action ] = sprintf( __( 'Export as %s', 'stream' ), $exporter->name ); |
| 83 | 94 | } |
| 84 | 95 | |
| 85 | 96 | return $action_menu_items; |
| @@ -98,9 +109,9 @@ | ||
| 98 | 109 | $row_out = array(); |
| 99 | 110 | foreach ( array_keys( $columns ) as $column_name ) { |
| 100 | 111 | switch ( $column_name ) { |
| 101 | 112 | case 'date': |
| 102 | - $created = date( 'Y-m-d H:i:s', strtotime( $record->created ) ); | |
| 113 | + $created = gmdate( 'Y-m-d H:i:s', strtotime( $record->created ) ); | |
| 103 | 114 | $row_out[ $column_name ] = get_date_from_gmt( $created, 'Y/m/d h:i:s A' ); |
| 104 | 115 | break; |
| 105 | 116 | |
| 106 | 117 | case 'summary': |
| @@ -163,9 +174,9 @@ | ||
| 163 | 174 | 'action' => $columns['action'], |
| 164 | 175 | 'ip' => $columns['ip'], |
| 165 | 176 | ); |
| 166 | 177 | |
| 167 | - if ( is_multisite() && is_plugin_active_for_network( $this->plugin->locations['plugin'] ) ) { | |
| 178 | + if ( is_multisite() && $this->plugin->is_network_activated() ) { | |
| 168 | 179 | $new_columns['blog_id'] = __( 'Blog ID', 'stream' ); |
| 169 | 180 | } |
| 170 | 181 | |
| 171 | 182 | return $new_columns; |
| @@ -202,9 +213,9 @@ | ||
| 202 | 213 | * @param array $classes An array of Exporter objects. In the format exporter_slug => Exporter_Class() |
| 203 | 214 | */ |
| 204 | 215 | $this->exporters = apply_filters( 'wp_stream_exporters', $classes ); |
| 205 | 216 | |
| 206 | - // Ensure that all exporters extend Exporter | |
| 217 | + // Ensure that all exporters extend Exporter. | |
| 207 | 218 | foreach ( $this->exporters as $key => $exporter ) { |
| 208 | 219 | if ( ! $this->is_valid_exporter( $exporter ) ) { |
| 209 | 220 | unset( $this->exporters[ $key ] ); |
| 210 | 221 | } |