Completed
Push — master ( 2e96ee...51b9e4 )
by Rain
01:37
created

plugins/custom-admin-settings-tab/js/CustomAdminSettings.js   A

Complexity

Total Complexity 7
Complexity/F 1.75

Size

Lines of Code 35
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 7
nc 6
mnd 1
bc 5
fnc 4
dl 0
loc 35
rs 10
bpm 1.25
cpm 1.75
noi 0
c 1
b 0
f 0
1
2
(function () {
3
4
	/**
5
	 * @constructor
6
	 */
7
	function CustomAdminSettings()
8
	{
9
		this.php = ko.observable('');
10
11
		this.loading = ko.observable(false);
12
	}
13
14
	CustomAdminSettings.prototype.onBuild = function () // special function
15
	{
16
		var self = this;
17
18
		this.loading(true);
19
20
		window.rl.pluginRemoteRequest(function (sResult, oData) {
21
22
			self.loading(false);
23
24
			if (window.rl.Enums.StorageResultType.Success === sResult && oData && oData.Result)
25
			{
26
				self.php(oData.Result.PHP || '');
27
			}
28
29
		}, 'AjaxAdminGetData');
30
31
	};
32
33
	window.rl.addSettingsViewModelForAdmin(CustomAdminSettings, 'PluginCustomAdminSettingnTab',
34
		'SETTINGS_CUSTOM_ADMIN_CUSTOM_TAB_PLUGIN/TAB_NAME', 'custom');
35
36
}());