wpml-tf-backend-feedback-row-view.php
3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* Class WPML_TF_Backend_Feedback_Row_View
*/
class WPML_TF_Backend_Feedback_Row_View {
const TEMPLATE_FOLDER = '/templates/translation-feedback/backend/';
const SUMMARY_TEMPLATE = 'feedback-list-page-table-row.twig';
const DETAILS_TEMPLATE = 'feedback-list-page-table-row-details.twig';
/** @var IWPML_Template_Service $template_service */
private $template_service;
/**
* WPML_TF_Backend_Feedback_Row_View constructor.
*
* @param IWPML_Template_Service $template_service
*/
public function __construct( IWPML_Template_Service $template_service ) {
$this->template_service = $template_service;
}
/** @param WPML_TF_Feedback $feedback */
public function render_summary_row( WPML_TF_Feedback $feedback ) {
$model = array(
'strings' => self::get_summary_strings(),
'has_admin_capabilities' => current_user_can( 'manage_options' ),
'feedback' => $feedback,
);
return $this->template_service->show( $model, self::SUMMARY_TEMPLATE );
}
/** @param WPML_TF_Feedback $feedback */
public function render_details_row( WPML_TF_Feedback $feedback ) {
$model = array(
'strings' => self::get_details_strings(),
'has_admin_capabilities' => current_user_can( 'manage_options' ),
'feedback' => $feedback,
);
return $this->template_service->show( $model, self::DETAILS_TEMPLATE );
}
/** @return array */
public static function get_columns_strings() {
return array(
'feedback' => __( 'Feedback', 'sitepress' ),
'rating' => __( 'Rating', 'sitepress' ),
'status' => __( 'Status', 'sitepress' ),
'document' => __( 'Translated post', 'sitepress' ),
'date' => __( 'Date', 'sitepress' ),
);
}
/** @return array */
public static function get_summary_strings() {
return array(
'select_validation' => __( 'Select Validation', 'sitepress' ),
'inline_actions' => array(
'review' => __( 'Review', 'sitepress' ),
'trash' => __( 'Trash', 'sitepress' ),
'view_post' => __( 'View post', 'sitepress' ),
'untrash' => __( 'Restore', 'sitepress' ),
'delete' => __( 'Delete permanently', 'sitepress' ),
),
'columns' => self::get_columns_strings(),
);
}
/** @return array */
public static function get_details_strings() {
return array(
'title' => __( 'Translation Feedback', 'sitepress' ),
'translation' => __( 'Translation:', 'sitepress' ),
'edit_translation' => __( 'Edit translation', 'sitepress' ),
'original_post' => __( 'Original post:', 'sitepress' ),
'rating' => __( 'Rating:', 'sitepress' ),
'feedback' => __( 'Feedback:', 'sitepress' ),
'edit_feedback' => __( 'Edit feedback', 'sitepress' ),
'status' => __( 'Status:', 'sitepress' ),
'refresh_status' => __( 'Check for updates', 'sitepress' ),
'translated_by' => __( 'Translated by:', 'sitepress' ),
'corrected_by' => __( 'Corrected by:', 'sitepress' ),
'reviewed_by' => __( 'Reviewed by:', 'sitepress' ),
'add_note_to_translator' => __( 'Add a note to the translator', 'sitepress' ),
'add_note_to_admin' => __( 'Add a note to the administrator', 'sitepress' ),
'communication' => __( 'Communication:', 'sitepress' ),
'reply_to_translator_label' => __( 'Reply to translator:', 'sitepress' ),
'reply_to_admin_label' => __( 'Reply to admin:', 'sitepress' ),
'cancel_button' => __( 'Cancel', 'sitepress' ),
'trash_button' => __( 'Trash', 'sitepress' ),
'translation_fixed_button' => __( 'Mark as fixed', 'sitepress' ),
'no_translator_available' => __( 'No translator available for this language pair.', 'sitepress' ),
);
}
}