config.class.php
4.5 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
/**
* Goodao Translate Automate
* http://www.Goodao.cn/
*
* LICENSE
*
* @package /license/ WP Translate
* @copyright Copyright (c) Goodao.cn
* @license http://www.Goodao.cn
* @version 1.1
* @date 2017-04-14
*/
class PrisnaWPTranslateAutomateConfig {
const NAME = 'PrisnaWPTranslateAutomateAutomate';
const VERSION = '1.1';
const UI_NAME = 'Goodao Translate Automate';
const ADMIN_LANGUAGE_DOMAIN = 'prisna_wp_translate_automate';
const ADMIN_SETTINGS_NAME = 'prisna-translate-automate-settings';
protected static $_settings = null;
public static function getName($_to_lower=false, $_ui=false) {
if ($_ui)
return $_to_lower ? strtolower(self::UI_NAME) : self::UI_NAME;
else
return $_to_lower ? strtolower(self::NAME) : self::NAME;
}
public static function getVersion() {
return self::VERSION;
}
public static function getAdminLanguageDomain() {
return self::ADMIN_LANGUAGE_DOMAIN;
}
public static function getAdminHandle() {
return self::ADMIN_SETTINGS_NAME;
}
public static function getSettings($_force=false, $_direct=false) {
return self::getDefaults();
}
public static function getDefaults($_force=false) {
return array(
'automate_to' => array(
'title_message' => PrisnaWPTranslateAutomateMessage::get('automate_to_title'),
'description_message' => PrisnaWPTranslateAutomateMessage::get('automate_to_description'),
'id' => 'prisna_automate_to',
'values' => PrisnaWPTranslateCommon::getLanguages(),
'value' => array(),
'type' => 'language',
'enable_order' => false,
'columns' => 4,
'group' => 0
),
'automate_source' => array(
'title_message' => PrisnaWPTranslateAutomateMessage::get('automate_source_title'),
'description_message' => PrisnaWPTranslateAutomateMessage::get('automate_source_description'),
'id' => 'prisna_automate_source',
'type' => 'radio',
'value' => 'sitemap',
'values' => array(
'sitemap' => PrisnaWPTranslateAutomateMessage::get('automate_source_sitemap'),
'url' => PrisnaWPTranslateAutomateMessage::get('automate_source_url'),
'category' => PrisnaWPTranslateAutomateMessage::get('automate_source_category')
),
'group' => 0
),
'automate_source_value_sitemap' => array(
'title_message' => PrisnaWPTranslateAutomateMessage::get('automate_source_value_sitemap_title'),
'description_message' => PrisnaWPTranslateAutomateMessage::get('automate_source_value_sitemap_description'),
'id' => 'prisna_automate_source_value_sitemap',
'type' => 'text',
'value' => '',
'dependence' => 'automate_source',
'dependence_show_value' => 'sitemap',
'group' => 0
),
'automate_source_value_url' => array(
'title_message' => PrisnaWPTranslateAutomateMessage::get('automate_source_value_url_title'),
'description_message' => PrisnaWPTranslateAutomateMessage::get('automate_source_value_url_description'),
'id' => 'prisna_automate_source_value_url',
'value' => '',
'dependence' => 'automate_source',
'dependence_show_value' => 'url',
'type' => 'textarea',
'group' => 0
),
'automate_source_value_category' => array(
'title_message' => PrisnaWPTranslateAutomateMessage::get('automate_source_value_category_title'),
'description_message' => PrisnaWPTranslateAutomateMessage::get('automate_source_value_category_description'),
'id' => 'prisna_automate_source_value_category',
'type' => 'text',
'value' => '',
'dependence' => 'automate_source',
'dependence_show_value' => 'category',
'group' => 0
),
'automate_retranslate_url' => array(
'title_message' => PrisnaWPTranslateAutomateMessage::get('automate_retranslate_url_title'),
'description_message' => PrisnaWPTranslateAutomateMessage::get('automate_retranslate_url_description'),
'id' => 'prisna_automate_action',
'type' => 'radio',
'value' => 'retranslate',
'values' => array(
'retranslate' => PrisnaWPTranslateAutomateMessage::get('automate_retranslate_url_retranslate'),
'skip' => PrisnaWPTranslateAutomateMessage::get('automate_retranslate_url_skip')
),
'group' => 0
),
'automate_timeout' => array(
'title_message' => PrisnaWPTranslateAutomateMessage::get('automate_timeout_title'),
'description_message' => PrisnaWPTranslateAutomateMessage::get('automate_timeout_description'),
'values' => PrisnaWPTranslateAutomateCommon::getTimeoutValues(),
'id' => 'prisna_automate_timeout',
'value' => '60',
'type' => 'select',
'group' => 0
),
);
}
}
?>