PageSourceSearch

https://www.visegradgroup.eu/js/aitia/aitia_user.js?ts=1610541287

js visegradgroup.eu collected 2026-09-24 18:15:03 UTC 10,151 bytes, 376 lines download raw bytes

1// függőségek
2if ("undefined" == typeof AITIA) {
3	alert("AITIA include missing!");
4}
5
6if ("undefined" == typeof AITIA_COOKIE) {
7	alert("AITIA_COOKIE include missing!");
8}
9
10if ("undefined" == typeof AITIA_UTIL) {
11	alert("AITIA_UTIL include missing!");
12}
13
14if ("undefined" == typeof AITIA_EVENT) {
15	alert("AITIA_EVENT include missing!");
16}
17
18// többszörös include
19if ("undefined" != typeof AITIA_USER) {
20	 alert("AITIA_USER multiple insert!");
21}
22
23AITIA_USER = 1;
24
25Aitia.User = {};
26
27Aitia.User.user = Aitia.Cookie.getCookie("lastuser");
28
29Aitia.User.profile = langprofile;
30
31/*
32Aitia.User.profile.ST = {};
33
34Aitia.User.profile.TREE = {};
35
36Aitia.User.profile.TREE.cookies = {};
37
38Aitia.User.profile.empty = 1;
39*/
40
41Aitia.User.session = langsession;
42
43if(typeof profileURL != 'undefined') {
44	Aitia.User.url = profileURL;
45}
46
47this.profileStr = '';
48 
49Aitia.User.setProfile = function(text) {
50	try {
51		if(text != '') {
52			try {
53				eval(unescape(text));
54			} 
55			catch(e) {
56				;
57			}
58			this.profile.empty = 0;
59			if(typeof this.profile.ST == "undefined") {
60				this.profile.ST = {};
61			}
62			if(typeof this.profile.TREE == "undefined") {
63				this.profile.TREE = {};
64			}
65			if(typeof this.profile.TREE.cookies == "undefined") {
66				this.profile.TREE.cookies = {};
67			}
68			this.handlePanels();
69			//this.handleSortableTables();
70			if(typeof document.body != "undefined") {
71		//		loadingIndicator(0);
72			}
73		}
74	}
75	catch(e) {
76		;
77	}
78}
79
80Aitia.User.getPanel = function(side) {
81	var currentObject = 'empty';
82	if(typeof tree != "undefined") {
83		currentObject = tree.sUniqueName;
84	}
85	if(typeof xmlEditor != "undefined") {
86		currentObject = 'xmlEditor';
87	}
88	var viewName = 'a';
89	if(typeof Aitia.User.session != "undefined" && typeof Aitia.User.session['tree_setup_' + currentObject] != "undefined") {
90		viewName = Aitia.User.session['tree_setup_' + currentObject]['selectedView'];
91	}
92	if(typeof this.profile.TREE == "undefined") {
93		this.profile.TREE = {};
94	}
95	var p = 0;
96	if(typeof this.profile.TREE[currentObject] != "undefined") {
97		if(typeof this.profile.TREE[currentObject][viewName] != "undefined") {
98			if(typeof this.profile.TREE[currentObject][viewName][side + '_panel'] != "undefined") {
99				return this.profile.TREE[currentObject][viewName][side + '_panel'];
100			}
101		}
102	}
103}
104
105
106Aitia.User.savePanelBoxes = function(target_body, clicked_arrow, open) {
107	var str = 'panelbox##' + target_body + '##' + clicked_arrow.id;
108	var currentObject = 'empty';
109	var viewName = 'a';
110	if(typeof tree != "undefined") {
111		currentObject = tree.sUniqueName;
112	}
113	if(typeof xmlEditor != "undefined") {
114		currentObject = 'xmlEditor';
115	}	
116	//fa nézete a sessionből
117	if(typeof Aitia.User.session != "undefined" && typeof Aitia.User.session['tree_setup_' + currentObject] != "undefined") {
118		viewName = Aitia.User.session['tree_setup_' + currentObject]['selectedView'];
119	}
120	Aitia.User.add2profile(this.profile, 'TREE');
121	var o;
122	o = Aitia.User.add2profile(this.profile.TREE, currentObject);
123	o = Aitia.User.add2profile(o, viewName);
124	
125	if(!(o[str] && o[str] == open)) {
126		o[str] = open;
127	}
128}
129
130Aitia.User.loadPanelBoxes = function() {
131	if(this.profile.empty  == 1) {
132		this.loadFromProfile();
133	}
134	
135	var currentObject = 'empty';
136	if(typeof tree != "undefined") {
137		currentObject = tree.sUniqueName;
138	}
139	if(typeof xmlEditor != "undefined") {
140		currentObject = 'xmlEditor';
141	}
142	var viewName = 'a';
143	if(typeof Aitia.User.session != "undefined" && typeof Aitia.User.session['tree_setup_' + currentObject] != "undefined") {
144		viewName = Aitia.User.session['tree_setup_' + currentObject]['selectedView'];
145	}
146	if(typeof this.profile.TREE == "undefined") {
147		this.profile.TREE = {};
148	}
149	var p = 0;
150	if(typeof this.profile.TREE[currentObject] != "undefined") {
151		if(typeof this.profile.TREE[currentObject][viewName] != "undefined") {
152			var current = this.profile.TREE[currentObject][viewName];
153			for(var i in current) {
154				var tmp = i.split('##');
155				if(3 == tmp.size()) {
156					if(1 == current[i] && $(tmp[2])) {
157						if(!$(tmp[2]).hasClassName('side_box_header_toggle_on')) {
158							toggle_side_box(tmp[1], $(tmp[2]), true);
159						}
160					}
161				}
162			}
163		}
164	}
165}
166
167Aitia.User.setPanel = function(side, val) {
168	var panel = side + '_panel';
169	var currentObject = 'empty';
170	var viewName = 'a';
171	if(typeof tree != "undefined") {
172		currentObject = tree.sUniqueName;
173	}
174	if(typeof xmlEditor != "undefined") {
175		currentObject = 'xmlEditor';
176	}	
177	//fa nézete a sessionből
178	if(typeof Aitia.User.session != "undefined" && typeof Aitia.User.session['tree_setup_' + currentObject] != "undefined") {
179		viewName = Aitia.User.session['tree_setup_' + currentObject]['selectedView'];
180	}
181	Aitia.User.add2profile(this.profile, 'TREE');
182	var o;
183	o = Aitia.User.add2profile(this.profile.TREE, currentObject);
184	o = Aitia.User.add2profile(o, viewName);
185	
186	if(!(o[panel] && o[panel] == val)) {
187		o[panel] = val;
188	}
189}
190
191Aitia.User.handleTrees = function() {
192	if(this.profile.empty  == 1) {
193		this.loadFromProfile();
194	}
195}
196
197/**
198 * panelek beállítása
199 * jelenleg fa illetve cikkszerkesztő jelenlétében működik
200 *
201 */
202Aitia.User.handlePanels = function() {
203	// Bal oldali panel
204	var lp = this.getPanel('left');
205	var lpMd = this.getPanel('mdLeftBlock');
206	var lpLg = this.getPanel('lgLeftBlock');
207
208	var mcO = document.getElementById('main_content');
209
210	if(typeof lpMd != "undefined" && lpMd == 1) {
211		Aitia.Style.addClass(mcO, 'mdLeftBlock');
212	}
213
214	if(typeof lpLg != "undefined" && lpLg == 1) {
215		Aitia.Style.addClass(mcO, 'lgLeftBlock');
216	}
217
218	if(typeof lp != "undefined") {
219		if(lp == 0) {
220			toggle_w3('left_block', true);
221		} else {
222			toggle_w3('center_left', true);
223		}
224	}
225
226	// Jobb oldali panel
227	var rp = this.getPanel('right');
228	var rpMd = this.getPanel('mdRightBlock');
229	var rpLg = this.getPanel('lgRightBlock');
230
231	if(typeof rpMd != "undefined" && rpMd == 1) {
232		Aitia.Style.addClass(mcO, 'mdRightBlock');
233	}
234
235	if(typeof rpLg != "undefined" && rpLg == 1) {
236		Aitia.Style.addClass(mcO, 'lgRightBlock');
237	}
238
239	if(typeof rp != "undefined") {
240		if(rp == 0) {
241			toggle_w3('right_block', true);
242		} else {
243			toggle_w3('center_right', true);
244		}
245	}
246}
247
248Aitia.User.handleSortableTables = function() {
249	if(typeof Aitia.User.profile.ST != "undefined") {
250		try {
251			var pst = Aitia.User.profile.ST;
252			if(typeof webra_sorttables != "undefined") {
253				for(s in webra_sorttables) {
254					var currentST = webra_sorttables[s];
255					if(typeof pst[currentST.unique_name] != "undefined") {
256						var viewName = getParamValue(currentST.configParams, "viewName");
257						if(typeof pst[currentST.unique_name][viewName] != "undefined") {
258							var currentSTprefs = pst[currentST.unique_name][viewName];
259							//rendezni is kell
260							//currentST.sort(currentSTprefs.sortColumnPos, currentSTprefs.sortDir_descending, currentSTprefs.sSortType);
261							
262							//látható oszlopok beállítása
263							var reload = false;
264							if(currentSTprefs.visibleheaders) {
265								if('' != currentSTprefs.visibleheaders) {
266									/*
267									currentST.status_visibleHeaders = currentSTprefs.visibleheaders;
268									currentST.status_removeHeader = "";
269									reload = true;
270									*/
271								}
272							}
273							if(currentSTprefs.grouping) {
274								// csak a csoportosítással kell foglalkozni
275								if('' != currentSTprefs.grouping) {
276									//currentST.status_groupField = currentSTprefs.grouping;
277									//reload = true;
278								}
279							}
280							if(reload) {
281								currentST.ST_resubmit(currentST.addURLParam(currentST.homeURL, "ctag", "reload"), "SortableTable.ST_callback_reload");
282							}
283							currentST.selectFirstItem();
284						}
285					}
286				}
287			}
288		}
289		catch(e) {}
290	}
291}
292
293/**
294 * létrehoz egy gyereket a szülőobjektumon belül
295 *
296 * @param object szülő
297 * @param string gyerek azonosítója
298 *
299 * @return object gyerek objektum
300 */
301Aitia.User.add2profile = function(parentO, childStr) {
302	if('' == childStr) {
303		childStr = 'xn';
304	}
305	if(typeof parentO[childStr] == "undefined") {
306		parentO[childStr] = {};
307	}
308	return parentO[childStr];
309}
310
311
312Aitia.User.saveToProfile = function(name, value) {
313	if(this.profile.name != value) {
314		this.profile[name] = value;
315		var params = setParamValue(params, "nodoctype", 1);
316		params = setParamValue(params, "webra_action", 'jsprofile');
317		params = setParamValue(params, "action", 'set');
318		params = setParamValue(params, "name", name);
319		params = setParamValue(params, "value", value);
320		if(this.url) {
321			addRequest(this.url, '', params);
322		}
323	}
324}
325
326/**
327 * elküldi a profil objektumot JSON formátumban
328 *
329 */
330Aitia.User.saveToProfileAll = function() {
331	if(this.profile.empty == 1) {
332		this.loadFromProfile();
333	}
334	var s = "{}";
335	try {
336		s = Object.toJSON(this.profile);
337	} 
338	catch(e) {
339		s = "{}";
340	}
341	var params = setParamValue(params, "nodoctype", 1);
342	params = setParamValue(params, "webra_action", 'jsprofile');
343	params = setParamValue(params, "action", 'saveAll');
344	params = setParamValue(params, "profile", s);
345	profileUrl = this.url;
346	profileParams = params;
347	
348	Aitia.Util.timer('addRequest(profileUrl, \'\', profileParams, profileParams, \'saveToProfileAll\');', 'profilesaver', 1000);
349}
350
351Aitia.User.loadFromProfile = function() {
352	try {
353		if(this.url) {
354			var params = setParamValue(params, "nodoctype", 1);
355			params = setParamValue(params, "webra_action", 'jsprofile');
356			params = setParamValue(params, "action", 'get');
357			resp = processXmlHttpRequest(this.url, '', params, Array(), 0);
358			this.setProfile(resp);
359		}
360	}
361	catch(e) {
362		;
363	}
364}
365
366Aitia.User.deleteFromProfile = function(name) {
367	var params = setParamValue(params, "nodoctype", 1);
368	params = setParamValue(params, "webra_action", 'jsprofile');
369	params = setParamValue(params, "name", name);
370	params = setParamValue(params, "action", 'del');
371	try {
372		addRequest(this.url, '', params);
373		delete this.profile.name;
374	}
375	catch(e) {}
376}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.