firstlogin.js
1.66 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
// Class Wizard
var ajaxOn;
var ktfolderAccess = "plugins/commercial/folder-templates/KTFolderTemplates.php?action=";
var ktmanageFolderAccess = "admin.php?kt_path_info=misc/adminfoldertemplatesmanagement&action=";
var actionForm = false;
function firstlogin() {
this.ajaxOn = false;
}
var showFolderTemplateTree = function(templateId) {
alert($('template_' + templateId).attr('style'));
$('template_' + templateId).attr('style', 'display:block'); // Show template
// var address = this.ktfolderAccess + "getTemplateNodes&templateId="+templateId;
// getUrl("templates_" + templateId, "template_" + templateId, address);
}
/*
* Create the dialog
*/
var showForm = function() {
createForm(); // Populate the form
this.win = new Ext.Window({ // create the window
applyTo : 'firstlogin',
layout : 'fit',
width : 800,
height : 500,
closeAction :'destroy',
y : 75,
shadow: false,
modal: true
});
this.win.show();
}
var createForm = function() {
var holder = "<div id='firstlogin'></div>";
$("#wrapper").append(holder); // Append to current dashboard
var address = "setup/firstlogin/index.php";
getUrl(address, "firstlogin"); // Pull in existing wizard
}
// Send request and update a div
var getUrl = function (address, div) {
$.ajax({
url: address,
dataType: "html",
type: "POST",
cache: false,
success: function(data) {
$("#"+div).empty();
$("#"+div).append(data);
}
});
}
$(function() { // Document is ready
if($("#wrapper").attr('class') != 'wizard') // Check if we in a wizard, or on the dashboard
showForm(); // Display first login wizard
});