author | Dan |
Sun, 02 Nov 2008 01:42:17 -0400 | |
changeset 718 | 12485b1d41fd |
parent 694 | 43367c66d869 |
child 729 | ebac7eeb89eb |
permissions | -rw-r--r-- |
1 | 1 |
// Javascript routines for the ACL editor |
2 |
||
3 |
var aclManagerID = 'enano_aclmanager_' + Math.floor(Math.random() * 1000000); |
|
4 |
var aclPermList = false; |
|
5 |
var aclDataCache = false; |
|
6 |
||
7 |
function ajaxOpenACLManager(page_id, namespace) |
|
8 |
{ |
|
9 |
if(IE) |
|
10 |
return true; |
|
585
35e91d16ecf5
Fixed javascript ACL manager and captcha not showing on ajax login lockout_captcha event
Dan
parents:
582
diff
changeset
|
11 |
|
586
234ddd896555
Made encryption work in form-based logon again; modified load_component() to fetch compressed versions when possible
Dan
parents:
585
diff
changeset
|
12 |
load_component('l10n'); |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
568
diff
changeset
|
13 |
load_component('messagebox'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
568
diff
changeset
|
14 |
load_component('fadefilter'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
568
diff
changeset
|
15 |
load_component('template-compiler'); |
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
651
diff
changeset
|
16 |
load_component('autofill'); |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
568
diff
changeset
|
17 |
|
1 | 18 |
if(!page_id || !namespace) |
19 |
{ |
|
20 |
var data = strToPageID(title); |
|
21 |
var page_id = data[0]; |
|
22 |
var namespace = data[1]; |
|
23 |
} |
|
24 |
var params = { |
|
25 |
'mode' : 'listgroups', |
|
26 |
'page_id' : page_id, |
|
27 |
'namespace' : namespace |
|
28 |
}; |
|
29 |
params = toJSONString(params); |
|
30 |
params = ajaxEscape(params); |
|
31 |
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() { |
|
407
35d94240a197
Mass-fixed all AJAX functions to also check the HTTP status code before parsing the response
Dan
parents:
377
diff
changeset
|
32 |
if ( ajax.readyState == 4 && ajax.status == 200 ) |
1 | 33 |
{ |
327 | 34 |
var response = String(ajax.responseText + ''); |
651
ce9d78d7251d
Improved JSON validation and error interface when validation fails; made rank manager support custom CSS
Dan
parents:
586
diff
changeset
|
35 |
if ( !check_json_response(response) ) |
327 | 36 |
{ |
37 |
handle_invalid_json(ajax.responseText); |
|
38 |
return false; |
|
39 |
} |
|
40 |
try { |
|
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
41 |
var groups = parseJSON(ajax.responseText); |
327 | 42 |
} catch(e) { |
43 |
handle_invalid_json(ajax.responseText); |
|
44 |
} |
|
1 | 45 |
__aclBuildWizardWindow(); |
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
46 |
if ( groups.mode == 'error' ) |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
47 |
{ |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
48 |
alert(groups.error); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
49 |
killACLManager(); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
50 |
return false; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
51 |
} |
1 | 52 |
aclDataCache = groups; |
53 |
__aclBuildSelector(groups); |
|
54 |
} |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
327
diff
changeset
|
55 |
}, true); |
1 | 56 |
return false; |
57 |
} |
|
58 |
||
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
59 |
function ajaxOpenDirectACLRule(rule_id) |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
60 |
{ |
694
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
61 |
load_component('l10n'); |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
62 |
load_component('messagebox'); |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
63 |
load_component('fadefilter'); |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
64 |
load_component('template-compiler'); |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
65 |
load_component('autofill'); |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
66 |
|
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
67 |
var params = { |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
68 |
target_id: rule_id, |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
69 |
mode: 'seltarget_id' |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
70 |
}; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
71 |
params = ajaxEscape(toJSONString(params)); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
72 |
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() { |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
73 |
if ( ajax.readyState == 4 && ajax.status == 200 ) |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
74 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
75 |
var response = String(ajax.responseText + ''); |
651
ce9d78d7251d
Improved JSON validation and error interface when validation fails; made rank manager support custom CSS
Dan
parents:
586
diff
changeset
|
76 |
if ( !check_json_response(response) ) |
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
77 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
78 |
handle_invalid_json(ajax.responseText); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
79 |
return false; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
80 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
81 |
try |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
82 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
83 |
response = parseJSON(response); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
84 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
85 |
catch(e) |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
86 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
87 |
handle_invalid_json(response); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
88 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
89 |
if ( !document.getElementById(aclManagerID) ) |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
90 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
91 |
__aclBuildWizardWindow(); |
513 | 92 |
var main = document.getElementById(aclManagerID + '_main'); |
93 |
main.style.padding = '10px'; |
|
94 |
} |
|
95 |
else |
|
96 |
{ |
|
97 |
var main = document.getElementById(aclManagerID + '_main'); |
|
98 |
main.style.backgroundImage = 'none'; |
|
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
99 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
100 |
if ( response.mode == 'error' ) |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
101 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
102 |
alert(response.error); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
103 |
killACLManager(); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
104 |
return false; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
105 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
106 |
aclDataCache = response; |
513 | 107 |
aclBuildRuleEditor(response, true); |
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
108 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
109 |
}, true); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
110 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
111 |
|
1 | 112 |
function ajaxACLSwitchToSelector() |
113 |
{ |
|
114 |
params = { |
|
115 |
'mode' : 'listgroups' |
|
116 |
}; |
|
117 |
if ( aclDataCache.page_id && aclDataCache.namespace ) |
|
118 |
{ |
|
119 |
params.page_id = aclDataCache.page_id; |
|
120 |
params.namespace = aclDataCache.namespace; |
|
121 |
} |
|
122 |
params = toJSONString(params); |
|
123 |
params = ajaxEscape(params); |
|
124 |
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() { |
|
407
35d94240a197
Mass-fixed all AJAX functions to also check the HTTP status code before parsing the response
Dan
parents:
377
diff
changeset
|
125 |
if ( ajax.readyState == 4 && ajax.status == 200 ) |
1 | 126 |
{ |
127 |
document.getElementById(aclManagerID+'_main').innerHTML = ''; |
|
128 |
document.getElementById(aclManagerID + '_back').style.display = 'none'; |
|
218 | 129 |
document.getElementById(aclManagerID + '_next').value = $lang.get('etc_wizard_next'); |
1 | 130 |
groups = parseJSON(ajax.responseText); |
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
131 |
if ( groups.mode == 'error' ) |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
132 |
{ |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
133 |
alert(groups.error); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
134 |
killACLManager(); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
135 |
return false; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
136 |
} |
1 | 137 |
aclDataCache = groups; |
138 |
thispage = strToPageID(title); |
|
139 |
groups.page_id = thispage[0]; |
|
140 |
groups.namespace = thispage[1]; |
|
141 |
__aclBuildSelector(groups); |
|
142 |
} |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
327
diff
changeset
|
143 |
}, true); |
1 | 144 |
} |
145 |
||
146 |
function __aclBuildSelector(groups) |
|
147 |
{ |
|
148 |
thispage = strToPageID(title); |
|
149 |
do_scopesel = ( thispage[0] == groups.page_id && thispage[1] == groups.namespace ); |
|
150 |
||
513 | 151 |
document.getElementById(aclManagerID + '_next').style.display = 'inline'; |
152 |
||
1 | 153 |
seed = Math.floor(Math.random() * 1000000); |
154 |
||
155 |
main = document.getElementById(aclManagerID + '_main'); |
|
156 |
main.style.padding = '10px'; |
|
513 | 157 |
main.style.backgroundImage = 'none'; |
158 |
||
159 |
// the "edit existing" button |
|
160 |
var editbtn_wrapper = document.createElement('div'); |
|
161 |
editbtn_wrapper.style.styleFloat = 'right'; |
|
162 |
editbtn_wrapper.style.cssFloat = 'right'; |
|
163 |
editbtn_wrapper.style.fontSize = 'smaller'; |
|
164 |
var editbtn = document.createElement('a'); |
|
165 |
editbtn.href = '#'; |
|
166 |
editbtn.innerHTML = $lang.get('acl_btn_show_existing'); |
|
167 |
editbtn_wrapper.appendChild(editbtn); |
|
168 |
main.appendChild(editbtn_wrapper); |
|
169 |
||
170 |
editbtn.onclick = function() |
|
171 |
{ |
|
172 |
aclSetViewListExisting(); |
|
173 |
return false; |
|
174 |
} |
|
1 | 175 |
|
176 |
selector = document.createElement('div'); |
|
177 |
||
178 |
grpsel = __aclBuildGroupsHTML(groups); |
|
179 |
grpsel.name = 'group_id'; |
|
180 |
||
181 |
span = document.createElement('div'); |
|
182 |
span.id = "enACL_grpbox_"+seed+""; |
|
183 |
||
184 |
// Build the selector |
|
185 |
grpb = document.createElement('input'); |
|
186 |
grpb.type = 'radio'; |
|
187 |
grpb.name = 'target_type'; |
|
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
188 |
grpb.value = '1'; // ACL_TYPE_GROUP |
1 | 189 |
grpb.checked = 'checked'; |
190 |
grpb.className = seed; |
|
191 |
grpb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'block'; document.getElementById('enACL_usrbox_'+seed).style.display = 'none'; }; |
|
192 |
lbl = document.createElement('label'); |
|
193 |
lbl.appendChild(grpb); |
|
218 | 194 |
lbl.appendChild(document.createTextNode($lang.get('acl_radio_usergroup'))); |
1 | 195 |
lbl.style.display = 'block'; |
196 |
span.appendChild(grpsel); |
|
197 |
||
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
198 |
anoninfo = document.createElement('div'); |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
199 |
anoninfo.className = 'info-box-mini'; |
218 | 200 |
anoninfo.appendChild(document.createTextNode($lang.get('acl_msg_guest_howto'))); |
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
201 |
span.appendChild(document.createElement('br')); |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
202 |
span.appendChild(anoninfo); |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
203 |
|
1 | 204 |
usrb = document.createElement('input'); |
205 |
usrb.type = 'radio'; |
|
206 |
usrb.name = 'target_type'; |
|
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
207 |
usrb.value = '2'; // ACL_TYPE_USER |
1 | 208 |
usrb.className = seed; |
209 |
usrb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'none'; document.getElementById('enACL_usrbox_'+seed).style.display = 'block'; }; |
|
210 |
lbl2 = document.createElement('label'); |
|
211 |
lbl2.appendChild(usrb); |
|
218 | 212 |
lbl2.appendChild(document.createTextNode($lang.get('acl_radio_user'))); |
1 | 213 |
lbl2.style.display = 'block'; |
214 |
||
215 |
usrsel = document.createElement('input'); |
|
216 |
usrsel.type = 'text'; |
|
217 |
usrsel.name = 'username'; |
|
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
651
diff
changeset
|
218 |
usrsel.className = 'autofill username'; |
1 | 219 |
usrsel.id = 'userfield_' + aclManagerID; |
220 |
try { |
|
221 |
usrsel.setAttribute("autocomplete","off"); |
|
222 |
} catch(e) {}; |
|
223 |
||
224 |
span2 = document.createElement('div'); |
|
225 |
span2.id = "enACL_usrbox_"+seed+""; |
|
226 |
span2.style.display = 'none'; |
|
227 |
span2.appendChild(usrsel); |
|
228 |
||
229 |
// Scope selector |
|
230 |
if(do_scopesel) |
|
231 |
{ |
|
232 |
scopediv1 = document.createElement('div'); |
|
233 |
scopediv2 = document.createElement('div'); |
|
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
234 |
scopediv3 = document.createElement('div'); |
1 | 235 |
scopeRadioPage = document.createElement('input'); |
236 |
scopeRadioPage.type = 'radio'; |
|
237 |
scopeRadioPage.name = 'scope'; |
|
238 |
scopeRadioPage.value = 'page'; |
|
239 |
scopeRadioPage.checked = 'checked'; |
|
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
240 |
scopeRadioPage.className = '1048576'; |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
74
diff
changeset
|
241 |
if ( groups.page_groups.length > 0 ) scopeRadioPage.onclick = function() { var id = 'enACL_pgsel_' + this.className; document.getElementById(id).style.display = 'none'; }; |
1 | 242 |
scopeRadioGlobal = document.createElement('input'); |
243 |
scopeRadioGlobal.type = 'radio'; |
|
244 |
scopeRadioGlobal.name = 'scope'; |
|
245 |
scopeRadioGlobal.value = 'global'; |
|
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
246 |
scopeRadioGlobal.className = '1048576'; |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
74
diff
changeset
|
247 |
if ( groups.page_groups.length > 0 ) scopeRadioGlobal.onclick = function() { var id = 'enACL_pgsel_' + this.className; document.getElementById(id).style.display = 'none'; }; |
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
248 |
scopeRadioGroup = document.createElement('input'); |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
249 |
scopeRadioGroup.type = 'radio'; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
250 |
scopeRadioGroup.name = 'scope'; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
251 |
scopeRadioGroup.value = 'group'; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
252 |
scopeRadioGroup.className = '1048576'; |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
74
diff
changeset
|
253 |
if ( groups.page_groups.length > 0 ) scopeRadioGroup.onclick = function() { var id = 'enACL_pgsel_' + this.className; document.getElementById(id).style.display = 'block'; }; |
1 | 254 |
lblPage = document.createElement('label'); |
255 |
lblPage.style.display = 'block'; |
|
256 |
lblPage.appendChild(scopeRadioPage); |
|
218 | 257 |
lblPage.appendChild(document.createTextNode($lang.get('acl_radio_scope_thispage'))); |
1 | 258 |
lblGlobal = document.createElement('label'); |
259 |
lblGlobal.style.display = 'block'; |
|
260 |
lblGlobal.appendChild(scopeRadioGlobal); |
|
218 | 261 |
lblGlobal.appendChild(document.createTextNode($lang.get('acl_radio_scope_wholesite'))); |
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
262 |
lblGroup = document.createElement('label'); |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
263 |
lblGroup.style.display = 'block'; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
264 |
lblGroup.appendChild(scopeRadioGroup); |
218 | 265 |
lblGroup.appendChild(document.createTextNode($lang.get('acl_radio_scope_pagegroup'))); |
1 | 266 |
scopediv1.appendChild(lblPage); |
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
267 |
scopediv2.appendChild(lblGroup); |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
268 |
scopediv3.appendChild(lblGlobal); |
1 | 269 |
|
270 |
scopedesc = document.createElement('p'); |
|
218 | 271 |
scopedesc.appendChild(document.createTextNode($lang.get('acl_lbl_scope'))); |
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
272 |
|
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
273 |
scopePGrp = document.createElement('select'); |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
274 |
scopePGrp.style.marginLeft = '13px'; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
275 |
scopePGrp.style.display = 'none'; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
276 |
scopePGrp.id = "enACL_pgsel_1048576"; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
277 |
|
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
278 |
var opt; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
279 |
for ( var i = 0; i < groups.page_groups.length; i++ ) |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
280 |
{ |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
281 |
opt = document.createElement('option'); |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
282 |
opt.value = groups.page_groups[i].id; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
283 |
opt.appendChild(document.createTextNode(groups.page_groups[i].name)); |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
284 |
scopePGrp.appendChild(opt); |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
285 |
} |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
286 |
|
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
287 |
scopediv2.appendChild(scopePGrp); |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
288 |
|
1 | 289 |
} |
290 |
||
291 |
// Styles |
|
292 |
span.style.marginLeft = '13px'; |
|
293 |
span.style.padding = '5px 0'; |
|
294 |
span2.style.marginLeft = '13px'; |
|
295 |
span2.style.padding = '5px 0'; |
|
296 |
||
297 |
selector.appendChild(lbl); |
|
298 |
selector.appendChild(span); |
|
299 |
||
300 |
selector.appendChild(lbl2); |
|
301 |
selector.appendChild(span2); |
|
302 |
||
303 |
container = document.createElement('div'); |
|
304 |
container.style.margin = 'auto'; |
|
305 |
container.style.width = '360px'; |
|
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
306 |
container.style.paddingTop = '50px'; |
1 | 307 |
|
308 |
head = document.createElement('h2'); |
|
218 | 309 |
head.appendChild(document.createTextNode($lang.get('acl_lbl_welcome_title'))); |
1 | 310 |
|
311 |
desc = document.createElement('p'); |
|
218 | 312 |
desc.appendChild(document.createTextNode($lang.get('acl_lbl_welcome_body'))); |
1 | 313 |
|
314 |
container.appendChild(head); |
|
315 |
container.appendChild(desc); |
|
316 |
container.appendChild(selector); |
|
317 |
||
318 |
if(do_scopesel) |
|
319 |
{ |
|
320 |
container.appendChild(scopedesc); |
|
321 |
container.appendChild(scopediv1); |
|
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
74
diff
changeset
|
322 |
if ( groups.page_groups.length > 0 ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
74
diff
changeset
|
323 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
74
diff
changeset
|
324 |
container.appendChild(scopediv2); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
74
diff
changeset
|
325 |
} |
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
326 |
container.appendChild(scopediv3); |
1 | 327 |
} |
328 |
||
329 |
main.appendChild(container); |
|
330 |
||
331 |
var mode = document.createElement('input'); |
|
332 |
mode.name = 'mode'; |
|
333 |
mode.type = 'hidden'; |
|
334 |
mode.id = aclManagerID + '_mode'; |
|
335 |
mode.value = 'seltarget'; |
|
336 |
||
337 |
var theform = document.getElementById(aclManagerID + '_formobj_id'); |
|
338 |
if ( !theform.mode ) |
|
339 |
{ |
|
340 |
theform.appendChild(mode); |
|
341 |
} |
|
342 |
else |
|
343 |
{ |
|
344 |
theform.removeChild(theform.mode); |
|
345 |
theform.appendChild(mode); |
|
346 |
} |
|
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
651
diff
changeset
|
347 |
|
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
651
diff
changeset
|
348 |
autofill_init_element(usrsel, { |
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
651
diff
changeset
|
349 |
allow_anon: true |
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
651
diff
changeset
|
350 |
}); |
1 | 351 |
} |
352 |
||
353 |
var aclDebugWin = false; |
|
354 |
||
355 |
function aclDebug(text) |
|
356 |
{ |
|
357 |
if(!aclDebugWin) |
|
358 |
aclDebugWin = pseudoWindowOpen("data:text/html;plain,<html><head><title>debug win</title></head><body><h1>Debug window</h1></body></html>", "aclDebugWin"); |
|
359 |
setTimeout(function() { |
|
360 |
aclDebugWin.pre = aclDebugWin.document.createElement('pre'); |
|
361 |
aclDebugWin.pre.appendChild(aclDebugWin.document.createTextNode(text)); |
|
362 |
aclDebugWin.b = aclDebugWin.document.getElementsByTagName('body')[0]; |
|
363 |
aclDebugWin.b.appendChild(aclDebugWin.pre);}, 1000); |
|
364 |
} |
|
365 |
||
366 |
var pseudoWindows = new Object(); |
|
367 |
||
368 |
function pseudoWindowOpen(url, id) |
|
369 |
{ |
|
370 |
if(pseudoWindows[id]) |
|
371 |
{ |
|
372 |
document.getElementById('pseudowin_ifr_'+id).src = url; |
|
373 |
} |
|
374 |
else |
|
375 |
{ |
|
376 |
win = document.createElement('iframe'); |
|
377 |
win.style.position='fixed'; |
|
378 |
win.style.width = '640px'; |
|
379 |
win.style.height = '480px'; |
|
380 |
win.style.top = '0px'; |
|
381 |
win.style.left = '0px'; |
|
382 |
win.style.zIndex = getHighestZ() + 1; |
|
383 |
win.style.backgroundColor = '#FFFFFF'; |
|
384 |
win.name = 'pseudo_ifr_'+id; |
|
385 |
win.id = 'pseudowindow_ifr_'+id; |
|
386 |
win.src = url; |
|
387 |
body = document.getElementsByTagName('body')[0]; |
|
388 |
body.appendChild(win); |
|
389 |
} |
|
390 |
win_obj = eval("( pseudo_ifr_"+id+" )"); |
|
391 |
return win_obj; |
|
392 |
} |
|
393 |
||
394 |
function __aclJSONSubmitAjaxHandler(params) |
|
395 |
{ |
|
396 |
params = toJSONString(params); |
|
397 |
params = ajaxEscape(params); |
|
398 |
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() { |
|
407
35d94240a197
Mass-fixed all AJAX functions to also check the HTTP status code before parsing the response
Dan
parents:
377
diff
changeset
|
399 |
if ( ajax.readyState == 4 && ajax.status == 200 ) |
1 | 400 |
{ |
327 | 401 |
var response = String(ajax.responseText + ''); |
651
ce9d78d7251d
Improved JSON validation and error interface when validation fails; made rank manager support custom CSS
Dan
parents:
586
diff
changeset
|
402 |
if ( !check_json_response(response) ) |
327 | 403 |
{ |
404 |
handle_invalid_json(ajax.responseText); |
|
405 |
return false; |
|
406 |
} |
|
513 | 407 |
try |
408 |
{ |
|
409 |
var data = parseJSON(ajax.responseText); |
|
410 |
} |
|
411 |
catch(e) |
|
412 |
{ |
|
327 | 413 |
handle_invalid_json(ajax.responseText); |
513 | 414 |
return false; |
1 | 415 |
} |
416 |
aclDataCache = data; |
|
417 |
switch(data.mode) |
|
418 |
{ |
|
419 |
case 'seltarget': |
|
420 |
||
421 |
// Build the ACL edit form |
|
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
422 |
aclBuildRuleEditor(data); |
1 | 423 |
|
424 |
break; |
|
425 |
case 'success': |
|
426 |
var note = document.createElement('div'); |
|
427 |
note.className = 'info-box'; |
|
428 |
note.style.marginLeft = '0'; |
|
429 |
var b = document.createElement('b'); |
|
218 | 430 |
b.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_title'))); |
1 | 431 |
note.appendChild(b); |
432 |
note.appendChild(document.createElement('br')); |
|
218 | 433 |
note.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_body', { target_name: data.target_name }))); |
1 | 434 |
note.appendChild(document.createElement('br')); |
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
435 |
|
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
436 |
/* |
1 | 437 |
var a = document.createElement('a'); |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
327
diff
changeset
|
438 |
a.href = '#'; |
419
b8b4e38825db
Unsuccessful attempt at fixing "dismiss"/"close manager" buttons in ACL editor; non-breaking change to template API to allow plugins to add "normal" sidebar widgets in addition to the special "raw" block type, specified as the third parameter to $template->sidebar_widget(). Defaults to false, which is old behavior; new behavior (enabled by passing TRUE as the 3rd param) means that the content of the block is primarily block-level links.
Dan
parents:
407
diff
changeset
|
439 |
a.id = aclManagerID + '_btn_dismiss'; |
218 | 440 |
a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :')); |
1 | 441 |
note.appendChild(a); |
442 |
var a2 = document.createElement('a'); |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
327
diff
changeset
|
443 |
a2.href = '#'; |
419
b8b4e38825db
Unsuccessful attempt at fixing "dismiss"/"close manager" buttons in ACL editor; non-breaking change to template API to allow plugins to add "normal" sidebar widgets in addition to the special "raw" block type, specified as the third parameter to $template->sidebar_widget(). Defaults to false, which is old behavior; new behavior (enabled by passing TRUE as the 3rd param) means that the content of the block is primarily block-level links.
Dan
parents:
407
diff
changeset
|
444 |
a.id = aclManagerID + '_btn_close'; |
218 | 445 |
a2.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]')); |
1 | 446 |
note.appendChild(a2); |
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
447 |
*/ |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
448 |
|
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
449 |
var a_dismiss = document.createElement('a'); |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
450 |
a_dismiss.href = '#'; |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
451 |
a_dismiss.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :')); |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
452 |
note.appendChild(a_dismiss); |
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
453 |
|
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
454 |
var a_close = document.createElement('a'); |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
455 |
a_close.href = '#'; |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
456 |
a_close.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]')); |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
457 |
note.appendChild(a_close); |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
458 |
|
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
459 |
document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild); |
419
b8b4e38825db
Unsuccessful attempt at fixing "dismiss"/"close manager" buttons in ACL editor; non-breaking change to template API to allow plugins to add "normal" sidebar widgets in addition to the special "raw" block type, specified as the third parameter to $template->sidebar_widget(). Defaults to false, which is old behavior; new behavior (enabled by passing TRUE as the 3rd param) means that the content of the block is primarily block-level links.
Dan
parents:
407
diff
changeset
|
460 |
|
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
461 |
a_dismiss.setAttribute('onclick', 'var parent = this.parentNode.parentNode; parent.removeChild(this.parentNode); return false;'); |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
462 |
a_close.setAttribute('onclick', 'killACLManager(); return false;'); |
419
b8b4e38825db
Unsuccessful attempt at fixing "dismiss"/"close manager" buttons in ACL editor; non-breaking change to template API to allow plugins to add "normal" sidebar widgets in addition to the special "raw" block type, specified as the third parameter to $template->sidebar_widget(). Defaults to false, which is old behavior; new behavior (enabled by passing TRUE as the 3rd param) means that the content of the block is primarily block-level links.
Dan
parents:
407
diff
changeset
|
463 |
|
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
464 |
if ( !document.getElementById(aclManagerID+'_deletelnk') ) |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
465 |
document.getElementById(aclManagerID + '_main').innerHTML += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'' + $lang.get('acl_msg_deleterule_confirm') + '\')) __aclDeleteRule(); return false;" style="color: red;">' + $lang.get('acl_lbl_deleterule') + '</a></p>'; |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
466 |
|
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
467 |
document.getElementById(aclManagerID+'_main').scrollTop = 0; |
513 | 468 |
document.getElementById(aclManagerID+'_main').style.backgroundImage = 'none'; |
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
419
diff
changeset
|
469 |
|
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
470 |
aclDataCache.mode = 'save_edit'; |
1 | 471 |
break; |
472 |
case 'delete': |
|
473 |
||
474 |
params = { |
|
475 |
'mode' : 'listgroups' |
|
476 |
}; |
|
477 |
params = toJSONString(params); |
|
478 |
params = ajaxEscape(params); |
|
479 |
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() { |
|
407
35d94240a197
Mass-fixed all AJAX functions to also check the HTTP status code before parsing the response
Dan
parents:
377
diff
changeset
|
480 |
if ( ajax.readyState == 4 && ajax.status == 200 ) |
1 | 481 |
{ |
482 |
document.getElementById(aclManagerID+'_main').innerHTML = ''; |
|
483 |
document.getElementById(aclManagerID + '_back').style.display = 'none'; |
|
218 | 484 |
document.getElementById(aclManagerID + '_next').value = $lang.get('etc_wizard_next'); |
1 | 485 |
var thispage = strToPageID(title); |
486 |
groups.page_id = thispage[0]; |
|
487 |
groups.namespace = thispage[1]; |
|
488 |
__aclBuildSelector(groups); |
|
489 |
||
490 |
note = document.createElement('div'); |
|
491 |
note.className = 'info-box'; |
|
492 |
note.style.marginLeft = '0'; |
|
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
493 |
note.style.position = 'absolute'; |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
494 |
note.style.width = '558px'; |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
495 |
note.id = 'aclSuccessNotice_' + Math.floor(Math.random() * 100000); |
1 | 496 |
b = document.createElement('b'); |
218 | 497 |
b.appendChild(document.createTextNode($lang.get('acl_lbl_delete_success_title'))); |
1 | 498 |
note.appendChild(b); |
499 |
note.appendChild(document.createElement('br')); |
|
336
bfa2e9c23f03
Added ability to require CAPTCHA for guests when editing pages (AJAX INTERFACE ONLY)
Dan
parents:
335
diff
changeset
|
500 |
note.appendChild(document.createTextNode($lang.get('acl_lbl_delete_success_body', { target_name: aclDataCache.target_name }))); |
1 | 501 |
note.appendChild(document.createElement('br')); |
502 |
a = document.createElement('a'); |
|
503 |
a.href = '#'; |
|
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
504 |
a.onclick = function() { opacity(this.parentNode.id, 100, 0, 1000); setTimeout('var div = document.getElementById("' + this.parentNode.id + '"); div.parentNode.removeChild(div);', 1100); return false; }; |
218 | 505 |
a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :')); |
1 | 506 |
note.appendChild(a); |
507 |
a = document.createElement('a'); |
|
508 |
a.href = '#'; |
|
509 |
a.onclick = function() { killACLManager(); return false; }; |
|
218 | 510 |
a.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]')); |
1 | 511 |
note.appendChild(a); |
512 |
document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild); |
|
513 |
//fadeInfoBoxes(); |
|
514 |
||
515 |
} |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
327
diff
changeset
|
516 |
}, true); |
1 | 517 |
|
518 |
break; |
|
519 |
case 'error': |
|
520 |
alert("Server side processing error:\n"+data.error); |
|
521 |
break; |
|
522 |
case 'debug': |
|
523 |
aclDebug(data.text); |
|
524 |
break; |
|
513 | 525 |
case 'list_existing': |
526 |
aclSetViewListExistingRespond(data); |
|
527 |
break; |
|
1 | 528 |
default: |
327 | 529 |
handle_invalid_json(ajax.responseText); |
1 | 530 |
break; |
531 |
} |
|
532 |
} |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
327
diff
changeset
|
533 |
}, true); |
1 | 534 |
} |
535 |
||
513 | 536 |
function aclBuildRuleEditor(data, from_direct) |
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
537 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
538 |
var act_desc = ( data.type == 'new' ) ? $lang.get('acl_lbl_editwin_title_create') : $lang.get('acl_lbl_editwin_title_edit'); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
539 |
var target_type_t = ( data.target_type == 1 ) ? $lang.get('acl_target_type_group') : $lang.get('acl_target_type_user'); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
540 |
var target_name_t = data.target_name; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
541 |
var scope_type = ( data.page_id == false && data.namespace == false ) ? $lang.get('acl_scope_type_wholesite') : ( data.namespace == '__PageGroup' ) ? $lang.get('acl_scope_type_pagegroup') : $lang.get('acl_scope_type_thispage'); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
542 |
|
513 | 543 |
document.getElementById(aclManagerID + '_next').style.display = 'inline'; |
544 |
||
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
545 |
html = '<h2>'+act_desc+'</h2>'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
546 |
html += '<p>' + $lang.get('acl_lbl_editwin_body', { target_type: target_type_t, target: target_name_t, scope_type: scope_type }) + '</p>'; |
679 | 547 |
|
548 |
// preset management |
|
549 |
var load_flags = 'href="#" onclick="aclShowPresetLoader(); return false;"'; |
|
550 |
var save_flags = 'href="#" onclick="aclShowPresetSave(); return false;"'; |
|
551 |
html += '<div style="float: right;">'; |
|
552 |
html += $lang.get('acl_btn_edit_presets', { load_flags: load_flags, save_flags: save_flags }); |
|
553 |
html += '</div>'; |
|
554 |
html += '<div style="clear: both;"></div>'; |
|
555 |
||
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
556 |
parser = new templateParser(data.template.acl_field_begin); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
557 |
html += parser.run(); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
558 |
|
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
559 |
cls = 'row2'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
560 |
for(var i in data.acl_types) |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
561 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
562 |
if(typeof(data.acl_types[i]) == 'number') |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
563 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
564 |
cls = ( cls == 'row1' ) ? 'row2' : 'row1'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
565 |
p = new templateParser(data.template.acl_field_item); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
566 |
vars = new Object(); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
567 |
if ( data.acl_descs[i].match(/^([a-z0-9_]+)$/) ) |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
568 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
569 |
vars['FIELD_DESC'] = $lang.get(data.acl_descs[i]); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
570 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
571 |
else |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
572 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
573 |
vars['FIELD_DESC'] = data.acl_descs[i]; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
574 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
575 |
vars['FIELD_INHERIT_CHECKED'] = ''; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
576 |
vars['FIELD_DENY_CHECKED'] = ''; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
577 |
vars['FIELD_DISALLOW_CHECKED'] = ''; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
578 |
vars['FIELD_WIKIMODE_CHECKED'] = ''; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
579 |
vars['FIELD_ALLOW_CHECKED'] = ''; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
580 |
vars['FIELD_NAME'] = i; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
581 |
if ( !data.current_perms[i] ) |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
582 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
583 |
data.current_perms[i] = 'i'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
584 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
585 |
switch(data.current_perms[i]) |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
586 |
{ |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
587 |
case 'i': |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
588 |
default: |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
589 |
vars['FIELD_INHERIT_CHECKED'] = 'checked="checked"'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
590 |
break; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
591 |
case 1: |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
592 |
vars['FIELD_DENY_CHECKED'] = 'checked="checked"'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
593 |
break; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
594 |
case 2: |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
595 |
vars['FIELD_DISALLOW_CHECKED'] = 'checked="checked"'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
596 |
break; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
597 |
case 3: |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
598 |
vars['FIELD_WIKIMODE_CHECKED'] = 'checked="checked"'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
599 |
break; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
600 |
case 4: |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
601 |
vars['FIELD_ALLOW_CHECKED'] = 'checked="checked"'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
602 |
break; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
603 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
604 |
vars['ROW_CLASS'] = cls; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
605 |
p.assign_vars(vars); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
606 |
html += p.run(); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
607 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
608 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
609 |
|
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
610 |
var parser = new templateParser(data.template.acl_field_end); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
611 |
html += parser.run(); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
612 |
|
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
613 |
if(data.type == 'edit') |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
614 |
html += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'' + $lang.get('acl_msg_deleterule_confirm') + '\')) __aclDeleteRule(); return false;" style="color: red;">' + $lang.get('acl_lbl_deleterule') + '</a></p>'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
615 |
|
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
616 |
var main = document.getElementById(aclManagerID + '_main'); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
617 |
main.innerHTML = html; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
618 |
|
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
619 |
var form = document.getElementById(aclManagerID + '_formobj_id'); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
620 |
|
513 | 621 |
if ( from_direct ) |
622 |
{ |
|
623 |
var modeobj = document.getElementById(aclManagerID + '_mode'); |
|
624 |
modeobj.value = 'save_edit'; |
|
625 |
} |
|
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
626 |
else |
513 | 627 |
{ |
628 |
var modeobj = form_fetch_field(form, 'mode'); |
|
629 |
if ( modeobj ) |
|
630 |
modeobj.value = 'save_' + data.type; |
|
631 |
else |
|
632 |
alert('modeobj is invalid: '+modeobj); |
|
633 |
} |
|
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
634 |
|
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
635 |
aclPermList = array_keys(data.acl_types); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
636 |
|
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
637 |
document.getElementById(aclManagerID + '_back').style.display = 'inline'; |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
638 |
document.getElementById(aclManagerID + '_next').value = $lang.get('etc_save_changes'); |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
639 |
} |
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
parents:
511
diff
changeset
|
640 |
|
1 | 641 |
function __aclBuildGroupsHTML(groups) |
642 |
{ |
|
643 |
groups = groups.groups; |
|
644 |
select = document.createElement('select'); |
|
645 |
for(var i in groups) |
|
646 |
{ |
|
647 |
if(typeof(groups[i]['name']) == 'string' && i != 'toJSONString') |
|
648 |
{ |
|
649 |
o = document.createElement('option'); |
|
650 |
o.value = groups[i]['id']; |
|
651 |
t = document.createTextNode(groups[i]['name']); |
|
652 |
o.appendChild(t); |
|
653 |
select.appendChild(o); |
|
654 |
} |
|
655 |
} |
|
656 |
return select; |
|
657 |
} |
|
658 |
||
659 |
function __aclBuildWizardWindow() |
|
660 |
{ |
|
151
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
661 |
darken(aclDisableTransitionFX); |
1 | 662 |
box = document.createElement('div'); |
663 |
box.style.width = '640px' |
|
664 |
box.style.height = '440px'; |
|
665 |
box.style.position = 'fixed'; |
|
666 |
width = getWidth(); |
|
667 |
height = getHeight(); |
|
668 |
box.style.left = ( width / 2 - 320 ) + 'px'; |
|
669 |
box.style.top = ( height / 2 - 250 ) + 'px'; |
|
670 |
box.style.backgroundColor = 'white'; |
|
671 |
box.style.zIndex = getHighestZ() + 1; |
|
672 |
box.id = aclManagerID; |
|
673 |
box.style.opacity = '0'; |
|
674 |
box.style.filter = 'alpha(opacity=0)'; |
|
675 |
box.style.display = 'none'; |
|
676 |
||
677 |
mainwin = document.createElement('div'); |
|
678 |
mainwin.id = aclManagerID + '_main'; |
|
679 |
mainwin.style.clip = 'rect(0px,640px,440px,0px)'; |
|
680 |
mainwin.style.overflow = 'auto'; |
|
681 |
mainwin.style.width = '620px'; |
|
682 |
mainwin.style.height = '420px'; |
|
683 |
||
684 |
panel = document.createElement('div'); |
|
685 |
panel.style.width = '620px'; |
|
686 |
panel.style.padding = '10px'; |
|
687 |
panel.style.lineHeight = '40px'; |
|
688 |
panel.style.textAlign = 'right'; |
|
689 |
panel.style.position = 'fixed'; |
|
690 |
panel.style.left = ( width / 2 - 320 ) + 'px'; |
|
691 |
panel.style.top = ( height / 2 + 190 ) + 'px'; |
|
692 |
panel.style.backgroundColor = '#D0D0D0'; |
|
693 |
panel.style.opacity = '0'; |
|
694 |
panel.style.filter = 'alpha(opacity=0)'; |
|
695 |
panel.id = aclManagerID + '_panel'; |
|
696 |
||
697 |
form = document.createElement('form'); |
|
698 |
form.method = 'post'; |
|
699 |
form.action = 'javascript:void(0)'; |
|
700 |
form.onsubmit = function() { if(this.username && !submitAuthorized) return false; __aclSubmitManager(this); return false; }; |
|
701 |
form.name = aclManagerID + '_formobj'; |
|
702 |
form.id = aclManagerID + '_formobj_id'; |
|
703 |
||
704 |
back = document.createElement('input'); |
|
705 |
back.type = 'button'; |
|
218 | 706 |
back.value = $lang.get('etc_wizard_back'); |
1 | 707 |
back.style.fontWeight = 'normal'; |
708 |
back.onclick = function() { ajaxACLSwitchToSelector(); return false; }; |
|
709 |
back.style.display = 'none'; |
|
710 |
back.id = aclManagerID + '_back'; |
|
711 |
||
712 |
saver = document.createElement('input'); |
|
713 |
saver.type = 'submit'; |
|
218 | 714 |
saver.value = $lang.get('etc_wizard_next'); |
1 | 715 |
saver.style.fontWeight = 'bold'; |
716 |
saver.id = aclManagerID + '_next'; |
|
717 |
||
718 |
closer = document.createElement('input'); |
|
719 |
closer.type = 'button'; |
|
218 | 720 |
closer.value = $lang.get('etc_cancel_changes'); |
541
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
721 |
closer.onclick = function() |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
722 |
{ |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
723 |
miniPromptMessage({ |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
724 |
title: $lang.get('acl_msg_closeacl_confirm_title'), |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
725 |
message: $lang.get('acl_msg_closeacl_confirm_body'), |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
726 |
buttons: [ |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
727 |
{ |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
728 |
text: $lang.get('acl_btn_close'), |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
729 |
color: 'red', |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
730 |
style: { |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
731 |
fontWeight: 'bold' |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
732 |
}, |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
733 |
onclick: function(e) |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
734 |
{ |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
735 |
killACLManager(); |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
736 |
miniPromptDestroy(this); |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
737 |
} |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
738 |
}, |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
739 |
{ |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
740 |
text: $lang.get('etc_cancel'), |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
741 |
onclick: function(e) |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
742 |
{ |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
743 |
miniPromptDestroy(this); |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
744 |
} |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
745 |
} |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
746 |
] |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
747 |
}); |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
748 |
return false; |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
535
diff
changeset
|
749 |
} |
1 | 750 |
|
751 |
spacer1 = document.createTextNode(' '); |
|
752 |
spacer2 = document.createTextNode(' '); |
|
753 |
||
754 |
panel.appendChild(back); |
|
755 |
panel.appendChild(spacer1); |
|
756 |
panel.appendChild(saver); |
|
757 |
panel.appendChild(spacer2); |
|
758 |
panel.appendChild(closer); |
|
759 |
form.appendChild(mainwin); |
|
760 |
form.appendChild(panel); |
|
761 |
box.appendChild(form); |
|
762 |
||
763 |
body = document.getElementsByTagName('body')[0]; |
|
764 |
body.appendChild(box); |
|
151
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
765 |
if ( aclDisableTransitionFX ) |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
766 |
{ |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
767 |
document.getElementById(aclManagerID).style.display = 'block'; |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
768 |
changeOpac(100, aclManagerID); |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
769 |
changeOpac(100, aclManagerID + '_panel'); |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
770 |
} |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
771 |
else |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
772 |
{ |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
773 |
setTimeout("document.getElementById('"+aclManagerID+"').style.display = 'block'; opacity('"+aclManagerID+"', 0, 100, 500); opacity('"+aclManagerID + '_panel'+"', 0, 100, 500);", 1000); |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
774 |
} |
1 | 775 |
} |
776 |
||
777 |
function killACLManager() |
|
778 |
{ |
|
779 |
el = document.getElementById(aclManagerID); |
|
780 |
if(el) |
|
781 |
{ |
|
151
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
782 |
if ( aclDisableTransitionFX ) |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
783 |
{ |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
784 |
enlighten(true); |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
785 |
el.parentNode.removeChild(el); |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
786 |
} |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
787 |
else |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
788 |
{ |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
789 |
opacity(aclManagerID, 100, 0, 500); |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
790 |
setTimeout('var el = document.getElementById(aclManagerID); el.parentNode.removeChild(el); enlighten();', 750); |
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
parents:
76
diff
changeset
|
791 |
} |
1 | 792 |
} |
793 |
} |
|
794 |
||
795 |
function __aclSubmitManager(form) |
|
796 |
{ |
|
797 |
var thefrm = document.forms[form.name]; |
|
798 |
var modeobj = form_fetch_field(thefrm, 'mode'); |
|
799 |
if ( typeof(modeobj) == 'object' ) |
|
800 |
{ |
|
801 |
var mode = (thefrm.mode.value) ? thefrm.mode.value : 'cant_get'; |
|
802 |
} |
|
803 |
else |
|
804 |
{ |
|
805 |
var mode = ''; |
|
806 |
} |
|
807 |
switch(mode) |
|
808 |
{ |
|
809 |
case 'cant_get': |
|
810 |
alert('BUG: can\'t get the state value from the form field.'); |
|
811 |
break; |
|
812 |
case 'seltarget': |
|
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
813 |
var target_type = parseInt(getRadioState(thefrm, 'target_type', ['1', '2'])); |
1 | 814 |
if(isNaN(target_type)) |
815 |
{ |
|
218 | 816 |
alert($lang.get('acl_err_pleaseselect_targettype')); |
1 | 817 |
return false; |
818 |
} |
|
819 |
target_id = ( target_type == 1 ) ? parseInt(thefrm.group_id.value) : thefrm.username.value; |
|
820 |
||
821 |
obj = { 'mode' : mode, 'target_type' : target_type, 'target_id' : target_id }; |
|
822 |
||
823 |
thispage = strToPageID(title); |
|
824 |
do_scopesel = ( thispage[0] == aclDataCache.page_id && thispage[1] == aclDataCache.namespace ); |
|
825 |
||
826 |
if(do_scopesel) |
|
827 |
{ |
|
535 | 828 |
scope = getRadioState(thefrm, 'scope', ['page', 'group', 'global']); |
1 | 829 |
if(scope == 'page') |
830 |
{ |
|
831 |
pageid = strToPageID(title); |
|
832 |
obj['page_id'] = pageid[0]; |
|
833 |
obj['namespace'] = pageid[1]; |
|
834 |
} |
|
835 |
else if(scope == 'global') |
|
836 |
{ |
|
837 |
obj['page_id'] = false; |
|
838 |
obj['namespace'] = false; |
|
839 |
} |
|
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
840 |
else if(scope == 'group') |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
841 |
{ |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
842 |
obj['page_id'] = document.getElementById('enACL_pgsel_1048576').value; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
843 |
obj['namespace'] = '__PageGroup'; |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
42
diff
changeset
|
844 |
} |
1 | 845 |
else |
846 |
{ |
|
847 |
alert('Invalid scope'); |
|
848 |
return false; |
|
849 |
} |
|
850 |
} |
|
851 |
else |
|
852 |
{ |
|
853 |
obj['page_id'] = aclDataCache.page_id; |
|
854 |
obj['namespace'] = aclDataCache.namespace; |
|
855 |
} |
|
856 |
if(target_id == '') |
|
857 |
{ |
|
218 | 858 |
alert($lang.get('acl_err_pleaseselect_username')); |
1 | 859 |
return false; |
860 |
} |
|
861 |
__aclJSONSubmitAjaxHandler(obj); |
|
862 |
break; |
|
863 |
case 'save_edit': |
|
864 |
case 'save_new': |
|
865 |
var form = document.forms[aclManagerID + '_formobj']; |
|
866 |
selections = new Object(); |
|
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
867 |
var dbg = ''; |
511
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
868 |
var warned_everyone = false; |
1 | 869 |
for(var i in aclPermList) |
870 |
{ |
|
679 | 871 |
selections[aclPermList[i]] = getRadioState(form, aclPermList[i], ['i', 1, 2, 3, 4]); |
511
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
872 |
// If we're editing permissions for everyone on the entire site and the |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
873 |
// admin selected to deny privileges, give a stern warning about it. |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
874 |
if ( selections[aclPermList[i]] == 1 && aclDataCache.target_type == 1 /* ACL_TYPE_GROUP */ && aclDataCache.target_id == 1 && !warned_everyone ) |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
875 |
{ |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
876 |
warned_everyone = true; |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
877 |
if ( !confirm($lang.get('acl_msg_deny_everyone_confirm')) ) |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
878 |
{ |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
879 |
return false; |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
880 |
} |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
472
diff
changeset
|
881 |
} |
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
882 |
dbg += aclPermList[i] + ': ' + selections[aclPermList[i]] + "\n"; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
883 |
if(!selections[aclPermList[i]]) |
1 | 884 |
{ |
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
885 |
alert("Invalid return from getRadioState: "+i+": "+selections[i]+" ("+typeof(selections[i])+")"); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
886 |
return false; |
1 | 887 |
} |
888 |
} |
|
889 |
obj = new Object(); |
|
890 |
obj['perms'] = selections; |
|
891 |
obj['mode'] = mode; |
|
892 |
obj['target_type'] = aclDataCache.target_type; |
|
893 |
obj['target_id'] = aclDataCache.target_id; |
|
894 |
obj['target_name'] = aclDataCache.target_name; |
|
895 |
obj['page_id'] = aclDataCache.page_id; |
|
896 |
obj['namespace'] = aclDataCache.namespace; |
|
897 |
__aclJSONSubmitAjaxHandler(obj); |
|
898 |
break; |
|
899 |
default: |
|
900 |
alert("JSON form submit: invalid mode string "+mode+", stopping execution"); |
|
901 |
return false; |
|
902 |
break; |
|
903 |
} |
|
904 |
} |
|
905 |
||
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
906 |
function getRadioState(form, name, valArray) |
1 | 907 |
{ |
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
908 |
// Konqueror/Safari fix |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
909 |
if ( form[name] ) |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
910 |
{ |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
911 |
var formitem = form[name]; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
912 |
if ( String(formitem) == '[object DOMNamedNodesCollection]' || is_Safari ) |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
913 |
{ |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
914 |
var i = 0; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
915 |
var radios = new Array(); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
916 |
var radioids = new Array(); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
917 |
while(true) |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
918 |
{ |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
919 |
var elem = formitem[i]; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
920 |
if ( !elem ) |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
921 |
break; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
922 |
radios.push(elem); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
923 |
if ( !elem.id ) |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
924 |
{ |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
925 |
elem.id = 'autoRadioBtn_' + Math.floor(Math.random() * 1000000); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
926 |
} |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
927 |
radioids.push(elem.id); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
928 |
i++; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
929 |
} |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
930 |
var cr; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
931 |
for ( var i = 0; i < radios.length; i++ ) |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
932 |
{ |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
933 |
cr = document.getElementById(radioids[i]); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
934 |
if ( cr.value == 'on' || cr.checked == true ) |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
935 |
{ |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
936 |
try { |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
937 |
return ( typeof ( valArray[i] ) != 'undefined' ) ? valArray[i] : false; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
938 |
} catch(e) { |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
939 |
// alert('Didn\'t get value for index: ' + i); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
940 |
return false; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
941 |
} |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
942 |
} |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
943 |
} |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
944 |
return false; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
945 |
} |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
946 |
} |
1 | 947 |
inputs = form.getElementsByTagName('input'); |
948 |
radios = new Array(); |
|
949 |
for(var i in inputs) |
|
950 |
{ |
|
951 |
if(inputs[i]) if(inputs[i].type == 'radio') |
|
952 |
radios.push(inputs[i]); |
|
953 |
} |
|
954 |
for(var i in radios) |
|
955 |
{ |
|
956 |
if(radios[i].checked && radios[i].name == name) |
|
957 |
return radios[i].value; |
|
958 |
} |
|
959 |
return false; |
|
960 |
} |
|
961 |
||
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
962 |
function __aclSetAllRadios(val, valArray) |
1 | 963 |
{ |
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
964 |
val = String(val); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
965 |
var form = document.forms[aclManagerID + '_formobj']; |
1 | 966 |
if (!form) |
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
967 |
{ |
1 | 968 |
return false; |
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
969 |
} |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
970 |
var inputs = form.getElementsByTagName('input'); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
971 |
var radios = new Array(); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
972 |
var dbg = ''; |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
973 |
for(var i = 0; i < inputs.length; i++) |
1 | 974 |
{ |
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
1
diff
changeset
|
975 |
dbg += String(inputs[i]) + "\n"; |
1 | 976 |
if(inputs[i].type == 'radio') |
977 |
radios.push(inputs[i]); |
|
978 |
} |
|
979 |
for(var i in radios) |
|
980 |
{ |
|
981 |
if(radios[i].value == val) |
|
982 |
radios[i].checked = true; |
|
983 |
else |
|
984 |
radios[i].checked = false; |
|
985 |
} |
|
986 |
} |
|
987 |
||
988 |
function __aclDeleteRule() |
|
989 |
{ |
|
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
990 |
if(!aclDataCache) |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
991 |
{ |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
992 |
if ( window.console ) |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
993 |
{ |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
994 |
try{ console.error('ACL editor: can\'t load data cache on delete'); } catch(e) {}; |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
995 |
} |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
996 |
return false; |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
997 |
} |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
998 |
if(aclDataCache.mode != 'seltarget' && aclDataCache.mode != 'save_new' && aclDataCache.mode != 'save_edit') |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
999 |
{ |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
1000 |
if ( window.console ) |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
1001 |
{ |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
1002 |
try{ console.error('ACL editor: wrong mode on aclDataCache: ' + aclDataCache.mode); } catch(e) {}; |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
1003 |
} |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
1004 |
return false; |
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
parents:
40
diff
changeset
|
1005 |
} |
1 | 1006 |
parms = { |
1007 |
'target_type' : aclDataCache.target_type, |
|
1008 |
'target_id' : aclDataCache.target_id, |
|
1009 |
'target_name' : aclDataCache.target_name, |
|
1010 |
'page_id' : aclDataCache.page_id, |
|
1011 |
'namespace' : aclDataCache.namespace, |
|
1012 |
'mode' : 'delete' |
|
1013 |
}; |
|
1014 |
__aclJSONSubmitAjaxHandler(parms); |
|
1015 |
} |
|
1016 |
||
513 | 1017 |
function aclSetViewListExisting() |
1018 |
{ |
|
1019 |
if ( !document.getElementById(aclManagerID) ) |
|
1020 |
{ |
|
1021 |
return false; |
|
1022 |
} |
|
1023 |
||
1024 |
var main = document.getElementById(aclManagerID + '_main'); |
|
1025 |
main.innerHTML = ''; |
|
1026 |
main.style.backgroundImage = 'url(' + scriptPath + '/images/loading-big.gif)'; |
|
1027 |
main.style.backgroundRepeat = 'no-repeat'; |
|
1028 |
main.style.backgroundPosition = 'center center'; |
|
1029 |
||
1030 |
var parms = { |
|
1031 |
'mode' : 'list_existing' |
|
1032 |
}; |
|
1033 |
__aclJSONSubmitAjaxHandler(parms); |
|
1034 |
} |
|
1035 |
||
1036 |
function aclSetViewListExistingRespond(data) |
|
1037 |
{ |
|
1038 |
var main = document.getElementById(aclManagerID + '_main'); |
|
1039 |
main.style.padding = '10px'; |
|
1040 |
main.innerHTML = ''; |
|
1041 |
||
1042 |
var heading = document.createElement('h3'); |
|
1043 |
heading.appendChild(document.createTextNode($lang.get('acl_msg_scale_intro_title'))); |
|
1044 |
main.appendChild(heading); |
|
1045 |
||
1046 |
var p = document.createElement('p'); |
|
1047 |
p.appendChild(document.createTextNode($lang.get('acl_msg_scale_intro_body'))); |
|
1048 |
main.appendChild(p); |
|
1049 |
||
1050 |
||
1051 |
main.innerHTML += data.key; |
|
1052 |
main.style.backgroundImage = 'none'; |
|
1053 |
||
1054 |
document.getElementById(aclManagerID + '_back').style.display = 'inline'; |
|
1055 |
document.getElementById(aclManagerID + '_next').style.display = 'none'; |
|
1056 |
||
1057 |
for ( var i = 0; i < data.rules.length; i++ ) |
|
1058 |
{ |
|
1059 |
var rule = data.rules[i]; |
|
1060 |
// build the rule, this is just more boring DOM crap. |
|
1061 |
var div = document.createElement('div'); |
|
1062 |
div.style.padding = '5px 3px'; |
|
1063 |
div.style.backgroundColor = '#' + rule.color; |
|
1064 |
div.style.cursor = 'pointer'; |
|
1065 |
div.rule_id = rule.rule_id; |
|
1066 |
div.onclick = function() |
|
1067 |
{ |
|
1068 |
var main = document.getElementById(aclManagerID + '_main'); |
|
1069 |
main.innerHTML = ''; |
|
1070 |
main.style.backgroundImage = 'url(' + scriptPath + '/images/loading-big.gif)'; |
|
1071 |
ajaxOpenDirectACLRule(parseInt(this.rule_id)); |
|
1072 |
} |
|
1073 |
div.innerHTML = rule.score_string; |
|
1074 |
main.appendChild(div); |
|
1075 |
} |
|
1076 |
} |
|
1077 |
||
679 | 1078 |
function aclShowPresetLoader() |
1079 |
{ |
|
1080 |
var prompt = miniPrompt(function(parent) |
|
1081 |
{ |
|
1082 |
parent.innerHTML = '<img style="display: block; margin: 0 auto;" src="' + cdnPath + '/images/loading-big.gif" />'; |
|
1083 |
}); |
|
1084 |
var request = toJSONString({ |
|
1085 |
mode: 'list_presets' |
|
1086 |
}); |
|
1087 |
ajaxPost(stdAjaxPrefix + '&_mode=acljson', 'acl_params=' + ajaxEscape(request), function() |
|
1088 |
{ |
|
1089 |
if ( ajax.readyState == 4 && ajax.status == 200 ) |
|
1090 |
{ |
|
1091 |
if ( !check_json_response(ajax.responseText) ) |
|
1092 |
{ |
|
1093 |
miniPromptDestroy(prompt); |
|
1094 |
return handle_invalid_json(ajax.responseText); |
|
1095 |
} |
|
1096 |
var response = parseJSON(ajax.responseText); |
|
1097 |
if ( response.mode == 'error' ) |
|
1098 |
{ |
|
1099 |
alert(response.error); |
|
1100 |
miniPromptDestroy(prompt); |
|
1101 |
return false; |
|
1102 |
} |
|
1103 |
prompt = prompt.firstChild.nextSibling; |
|
1104 |
prompt.style.textAlign = 'center'; |
|
1105 |
prompt.innerHTML = '<h3>' + $lang.get('acl_lbl_preset_load_title') + '</h3>'; |
|
1106 |
||
1107 |
if ( response.presets.length > 0 ) |
|
1108 |
{ |
|
1109 |
// selection box |
|
1110 |
var para = document.createElement('p'); |
|
1111 |
var select = document.createElement('select'); |
|
1112 |
||
1113 |
var option = document.createElement('option'); |
|
1114 |
option.value = '0'; |
|
1115 |
option.appendChild(document.createTextNode($lang.get('acl_lbl_preset_load'))); |
|
1116 |
select.appendChild(option); |
|
1117 |
||
1118 |
for ( var i = 0; i < response.presets.length; i++ ) |
|
1119 |
{ |
|
1120 |
var preset = response.presets[i]; |
|
1121 |
var option = document.createElement('option'); |
|
1122 |
option.value = preset.rule_id; |
|
1123 |
option.preset_data = preset; |
|
1124 |
option.appendChild(document.createTextNode($lang.get(preset.preset_name))); |
|
1125 |
select.appendChild(option); |
|
1126 |
} |
|
1127 |
||
1128 |
para.appendChild(select); |
|
1129 |
prompt.appendChild(para); |
|
1130 |
||
1131 |
// buttons |
|
1132 |
var buttons = document.createElement('p'); |
|
1133 |
||
1134 |
// load button |
|
1135 |
var btn_load = document.createElement('a'); |
|
1136 |
btn_load.className = 'abutton abutton_green'; |
|
1137 |
btn_load.style.fontWeight = 'bold'; |
|
1138 |
btn_load.appendChild(document.createTextNode($lang.get('acl_btn_load_preset'))); |
|
1139 |
btn_load.selectobj = select; |
|
1140 |
btn_load.onclick = function() |
|
1141 |
{ |
|
1142 |
if ( this.selectobj.value == '0' ) |
|
1143 |
{ |
|
1144 |
alert($lang.get('acl_err_select_preset')); |
|
1145 |
return false; |
|
1146 |
} |
|
1147 |
// retrieve preset data |
|
1148 |
for ( var i = 0; i < this.selectobj.childNodes.length; i++ ) |
|
1149 |
{ |
|
1150 |
if ( this.selectobj.childNodes[i].tagName == 'OPTION' ) |
|
1151 |
{ |
|
1152 |
var node = this.selectobj.childNodes[i]; |
|
1153 |
if ( node.value == this.selectobj.value ) |
|
1154 |
{ |
|
1155 |
aclSetRulesAbsolute(node.preset_data.rules); |
|
1156 |
break; |
|
1157 |
} |
|
1158 |
} |
|
1159 |
} |
|
1160 |
miniPromptDestroy(this); |
|
1161 |
return false; |
|
1162 |
} |
|
1163 |
btn_load.href = '#'; |
|
1164 |
buttons.appendChild(btn_load); |
|
1165 |
||
1166 |
buttons.appendChild(document.createTextNode(' ')); |
|
1167 |
||
1168 |
// cancel button |
|
1169 |
var btn_cancel = document.createElement('a'); |
|
1170 |
btn_cancel.className = 'abutton'; |
|
1171 |
btn_cancel.appendChild(document.createTextNode($lang.get('etc_cancel'))); |
|
1172 |
btn_cancel.onclick = function() |
|
1173 |
{ |
|
1174 |
miniPromptDestroy(this); |
|
1175 |
return false; |
|
1176 |
} |
|
1177 |
btn_cancel.href = '#'; |
|
1178 |
buttons.appendChild(btn_cancel); |
|
1179 |
||
1180 |
prompt.appendChild(buttons); |
|
1181 |
} |
|
1182 |
else |
|
1183 |
{ |
|
1184 |
// "no presets" |
|
1185 |
prompt.innerHTML += '<p>' + $lang.get('acl_msg_no_presets', { close_flags: 'href="#" onclick="miniPromptDestroy(this); return false;"' }) + '</p>'; |
|
1186 |
} |
|
1187 |
} |
|
1188 |
}); |
|
1189 |
} |
|
1190 |
||
1191 |
function aclSetRulesAbsolute(rules) |
|
1192 |
{ |
|
1193 |
__aclSetAllRadios('i'); |
|
1194 |
||
1195 |
var form = document.forms[aclManagerID + '_formobj']; |
|
1196 |
if (!form) |
|
1197 |
{ |
|
1198 |
return false; |
|
1199 |
} |
|
1200 |
var inputs = form.getElementsByTagName('input'); |
|
1201 |
var radios = new Array(); |
|
1202 |
var dbg = ''; |
|
1203 |
for(var i = 0; i < inputs.length; i++) |
|
1204 |
{ |
|
1205 |
if(inputs[i].type == 'radio') |
|
1206 |
radios.push(inputs[i]); |
|
1207 |
} |
|
1208 |
for(var i in radios) |
|
1209 |
{ |
|
1210 |
if ( typeof(rules[ radios[i]['name'] ]) == 'number' ) |
|
1211 |
{ |
|
1212 |
radios[i].checked = ( rules[radios[i]['name']] == radios[i].value ); |
|
1213 |
} |
|
1214 |
} |
|
1215 |
} |
|
1216 |
||
1217 |
function aclShowPresetSave() |
|
1218 |
{ |
|
1219 |
miniPrompt(function(parent) |
|
1220 |
{ |
|
1221 |
parent.style.textAlign = 'center'; |
|
1222 |
||
1223 |
parent.innerHTML = '<h3>' + $lang.get('acl_lbl_preset_save_title') + '</h3>'; |
|
1224 |
var input = document.createElement('input'); |
|
1225 |
input.id = aclManagerID + '_preset_save'; |
|
1226 |
input.type = 'text'; |
|
1227 |
input.size = '30'; |
|
1228 |
input.onkeypress = function(e) |
|
1229 |
{ |
|
1230 |
// javascript sucks. IE and several others throw myriad errors unless it's done this way. |
|
1231 |
if ( e ) |
|
1232 |
if ( e.keyCode ) |
|
1233 |
if ( e.keyCode == 13 ) |
|
1234 |
{ |
|
1235 |
if ( aclSavePreset() ) |
|
1236 |
{ |
|
694
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1237 |
if ( window.opera ) |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1238 |
{ |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1239 |
// damn weird opera bug. |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1240 |
var input = this; |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1241 |
setTimeout(function() |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1242 |
{ |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1243 |
miniPromptDestroy(input); |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1244 |
}, 10); |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1245 |
} |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1246 |
else |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1247 |
{ |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1248 |
miniPromptDestroy(this); |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
679
diff
changeset
|
1249 |
} |
679 | 1250 |
} |
1251 |
} |
|
1252 |
else if ( e.keyCode == 27 ) |
|
1253 |
{ |
|
1254 |
miniPromptDestroy(this); |
|
1255 |
} |
|
1256 |
} |
|
1257 |
var para = document.createElement('p'); |
|
1258 |
para.appendChild(input); |
|
1259 |
||
1260 |
parent.appendChild(para); |
|
1261 |
||
1262 |
// buttons |
|
1263 |
var buttons = document.createElement('p'); |
|
1264 |
||
1265 |
// save button |
|
1266 |
var btn_save = document.createElement('a'); |
|
1267 |
btn_save.className = 'abutton abutton_green'; |
|
1268 |
btn_save.style.fontWeight = 'bold'; |
|
1269 |
btn_save.appendChild(document.createTextNode($lang.get('acl_btn_save_preset'))); |
|
1270 |
btn_save.selectobj = select; |
|
1271 |
btn_save.onclick = function() |
|
1272 |
{ |
|
1273 |
if ( aclSavePreset() ) |
|
1274 |
{ |
|
1275 |
miniPromptDestroy(this); |
|
1276 |
} |
|
1277 |
return false; |
|
1278 |
} |
|
1279 |
btn_save.href = '#'; |
|
1280 |
buttons.appendChild(btn_save); |
|
1281 |
||
1282 |
buttons.appendChild(document.createTextNode(' ')); |
|
1283 |
||
1284 |
// cancel button |
|
1285 |
var btn_cancel = document.createElement('a'); |
|
1286 |
btn_cancel.className = 'abutton'; |
|
1287 |
btn_cancel.appendChild(document.createTextNode($lang.get('etc_cancel'))); |
|
1288 |
btn_cancel.onclick = function() |
|
1289 |
{ |
|
1290 |
miniPromptDestroy(this); |
|
1291 |
return false; |
|
1292 |
} |
|
1293 |
btn_cancel.href = '#'; |
|
1294 |
buttons.appendChild(btn_cancel); |
|
1295 |
||
1296 |
parent.appendChild(buttons); |
|
1297 |
||
1298 |
var timeout = ( aclDisableTransitionFX ) ? 10 : 1000; |
|
1299 |
setTimeout(function() |
|
1300 |
{ |
|
1301 |
input.focus(); |
|
1302 |
}, timeout); |
|
1303 |
}); |
|
1304 |
} |
|
1305 |
||
1306 |
function aclSavePreset() |
|
1307 |
{ |
|
1308 |
var input = document.getElementById(aclManagerID + '_preset_save'); |
|
1309 |
if ( trim(input.value) == '' ) |
|
1310 |
{ |
|
1311 |
alert($lang.get('acl_err_preset_name_empty')); |
|
1312 |
return false; |
|
1313 |
} |
|
1314 |
var form = document.forms[aclManagerID + '_formobj'], selections = {}; |
|
1315 |
var dbg = ''; |
|
1316 |
var warned_everyone = false; |
|
1317 |
for(var i in aclPermList) |
|
1318 |
{ |
|
1319 |
selections[aclPermList[i]] = getRadioState(form, aclPermList[i], ['i', 1, 2, 3, 4]); |
|
1320 |
// If we're editing permissions for everyone on the entire site and the |
|
1321 |
// admin selected to deny privileges, give a stern warning about it. |
|
1322 |
if ( selections[aclPermList[i]] == 1 && aclDataCache.target_type == 1 /* ACL_TYPE_GROUP */ && aclDataCache.target_id == 1 && !warned_everyone ) |
|
1323 |
{ |
|
1324 |
warned_everyone = true; |
|
1325 |
if ( !confirm($lang.get('acl_msg_deny_everyone_confirm')) ) |
|
1326 |
{ |
|
1327 |
return false; |
|
1328 |
} |
|
1329 |
} |
|
1330 |
dbg += aclPermList[i] + ': ' + selections[aclPermList[i]] + "\n"; |
|
1331 |
if(!selections[aclPermList[i]]) |
|
1332 |
{ |
|
1333 |
alert("Invalid return from getRadioState: "+i+": "+selections[i]+" ("+typeof(selections[i])+")"); |
|
1334 |
return false; |
|
1335 |
} |
|
1336 |
} |
|
1337 |
||
1338 |
var packet = toJSONString({ |
|
1339 |
mode: 'save_preset', |
|
1340 |
preset_name: input.value, |
|
1341 |
perms: selections |
|
1342 |
}); |
|
1343 |
||
1344 |
var whitey = whiteOutElement(document.getElementById(aclManagerID)); |
|
1345 |
||
1346 |
ajaxPost(stdAjaxPrefix + '&_mode=acljson', 'acl_params=' + ajaxEscape(packet), function() |
|
1347 |
{ |
|
1348 |
if ( ajax.readyState == 4 && ajax.status == 200 ) |
|
1349 |
{ |
|
1350 |
if ( !check_json_response(ajax.responseText) ) |
|
1351 |
{ |
|
1352 |
whitey.parentNode.removeChild(whitey); |
|
1353 |
return handle_invalid_json(ajax.responseText); |
|
1354 |
} |
|
1355 |
var response = parseJSON(ajax.responseText); |
|
1356 |
if ( response.mode == 'error' ) |
|
1357 |
{ |
|
1358 |
whitey.parentNode.removeChild(whitey); |
|
1359 |
alert(response.error); |
|
1360 |
return false; |
|
1361 |
} |
|
1362 |
whiteOutReportSuccess(whitey); |
|
1363 |
} |
|
1364 |
}); |
|
1365 |
||
1366 |
return true; |
|
1367 |
} |
|
1368 |
||
1 | 1369 |
function array_keys(obj) |
1370 |
{ |
|
1371 |
keys = new Array(); |
|
1372 |
for(var i in obj) |
|
1373 |
keys.push(i); |
|
1374 |
return keys; |
|
1375 |
} |