wpml-user-jobs-notification-settings-template.php
1.37 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
<?php
/**
* Class WPML_User_Jobs_Notification_Settings_Template
*/
class WPML_User_Jobs_Notification_Settings_Template {
const TEMPLATE_FILE = 'job-email-notification.twig';
/**
* @var WPML_Twig_Template
*/
private $template_service;
/**
* WPML_User_Jobs_Notification_Settings_Template constructor.
*
* @param IWPML_Template_Service $template_service
*/
public function __construct( IWPML_Template_Service $template_service ) {
$this->template_service = $template_service;
}
/**
* @param string $notification_input
*
* @return string
*/
public function get_setting_section( $notification_input ) {
$model = $this->get_model( $notification_input );
return $this->template_service->show( $model, self::TEMPLATE_FILE );
}
/**
* @param string $notification_input
*
* @return array
*/
private function get_model( $notification_input ) {
$model = array(
'strings' => array(
'section_title' => __( 'WPML Translator Settings', 'wpml-translation-management' ),
'field_title' => __( 'Notification emails:', 'wpml-translation-management' ),
'field_name' => WPML_User_Jobs_Notification_Settings::BLOCK_NEW_NOTIFICATION_FIELD,
'field_text' => __( 'Send me a notification email when there is something new to translate', 'wpml-translation-management' ),
'checked' => $notification_input,
),
);
return $model;
}
}