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
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
diff
changeset
+ − 7
// Can be set to true by slow themes (St. Patty)
568
+ − 8
if ( typeof(pref_disable_js_fx) != 'boolean' )
+ − 9
{
+ − 10
var pref_disable_js_fx = false;
+ − 11
}
555
ac4c6a7f01d8
Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
diff
changeset
+ − 12
var aclDisableTransitionFX = ( is_firefox2 || pref_disable_js_fx ) ? true : false;
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
diff
changeset
+ − 13
1
+ − 14
function ajaxOpenACLManager(page_id, namespace)
+ − 15
{
+ − 16
if(IE)
+ − 17
return true;
+ − 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
+ − 32
if ( ajax.readyState == 4 && ajax.status == 200 )
1
+ − 33
{
327
+ − 34
var response = String(ajax.responseText + '');
+ − 35
if ( response.substr(0, 1) != '{' )
+ − 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
diff
changeset
+ − 41
var groups = parseJSON(ajax.responseText);
327
+ − 42
} catch(e) {
+ − 43
handle_invalid_json(ajax.responseText);
+ − 44
}
1
+ − 45
__aclBuildWizardWindow();
40
+ − 46
if ( groups.mode == 'error' )
+ − 47
{
+ − 48
alert(groups.error);
+ − 49
killACLManager();
+ − 50
return false;
+ − 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
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
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
diff
changeset
+ − 60
{
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
diff
changeset
+ − 61
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
diff
changeset
+ − 62
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
diff
changeset
+ − 63
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
diff
changeset
+ − 64
};
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
diff
changeset
+ − 65
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
diff
changeset
+ − 66
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
diff
changeset
+ − 67
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
diff
changeset
+ − 68
{
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
diff
changeset
+ − 69
var response = String(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
diff
changeset
+ − 70
if ( response.substr(0, 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
diff
changeset
+ − 71
{
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
diff
changeset
+ − 72
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
diff
changeset
+ − 73
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
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
diff
changeset
+ − 75
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
diff
changeset
+ − 76
{
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
diff
changeset
+ − 77
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
diff
changeset
+ − 78
}
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
diff
changeset
+ − 79
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
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
diff
changeset
+ − 81
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
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
diff
changeset
+ − 83
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
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
diff
changeset
+ − 85
__aclBuildWizardWindow();
513
+ − 86
var main = document.getElementById(aclManagerID + '_main');
+ − 87
main.style.padding = '10px';
+ − 88
}
+ − 89
else
+ − 90
{
+ − 91
var main = document.getElementById(aclManagerID + '_main');
+ − 92
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
diff
changeset
+ − 93
}
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
diff
changeset
+ − 94
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
diff
changeset
+ − 95
{
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
diff
changeset
+ − 96
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
diff
changeset
+ − 97
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
diff
changeset
+ − 98
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
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
diff
changeset
+ − 100
aclDataCache = response;
513
+ − 101
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
diff
changeset
+ − 102
}
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
diff
changeset
+ − 103
}, 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
diff
changeset
+ − 104
}
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
diff
changeset
+ − 105
1
+ − 106
function ajaxACLSwitchToSelector()
+ − 107
{
+ − 108
params = {
+ − 109
'mode' : 'listgroups'
+ − 110
};
+ − 111
if ( aclDataCache.page_id && aclDataCache.namespace )
+ − 112
{
+ − 113
params.page_id = aclDataCache.page_id;
+ − 114
params.namespace = aclDataCache.namespace;
+ − 115
}
+ − 116
params = toJSONString(params);
+ − 117
params = ajaxEscape(params);
+ − 118
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
407
+ − 119
if ( ajax.readyState == 4 && ajax.status == 200 )
1
+ − 120
{
+ − 121
document.getElementById(aclManagerID+'_main').innerHTML = '';
+ − 122
document.getElementById(aclManagerID + '_back').style.display = 'none';
218
+ − 123
document.getElementById(aclManagerID + '_next').value = $lang.get('etc_wizard_next');
1
+ − 124
groups = parseJSON(ajax.responseText);
40
+ − 125
if ( groups.mode == 'error' )
+ − 126
{
+ − 127
alert(groups.error);
+ − 128
killACLManager();
+ − 129
return false;
+ − 130
}
1
+ − 131
aclDataCache = groups;
+ − 132
thispage = strToPageID(title);
+ − 133
groups.page_id = thispage[0];
+ − 134
groups.namespace = thispage[1];
+ − 135
__aclBuildSelector(groups);
+ − 136
}
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
diff
changeset
+ − 137
}, true);
1
+ − 138
}
+ − 139
+ − 140
function __aclBuildSelector(groups)
+ − 141
{
+ − 142
thispage = strToPageID(title);
+ − 143
do_scopesel = ( thispage[0] == groups.page_id && thispage[1] == groups.namespace );
+ − 144
513
+ − 145
document.getElementById(aclManagerID + '_next').style.display = 'inline';
+ − 146
1
+ − 147
seed = Math.floor(Math.random() * 1000000);
+ − 148
+ − 149
main = document.getElementById(aclManagerID + '_main');
+ − 150
main.style.padding = '10px';
513
+ − 151
main.style.backgroundImage = 'none';
+ − 152
+ − 153
// the "edit existing" button
+ − 154
var editbtn_wrapper = document.createElement('div');
+ − 155
editbtn_wrapper.style.styleFloat = 'right';
+ − 156
editbtn_wrapper.style.cssFloat = 'right';
+ − 157
editbtn_wrapper.style.fontSize = 'smaller';
+ − 158
var editbtn = document.createElement('a');
+ − 159
editbtn.href = '#';
+ − 160
editbtn.innerHTML = $lang.get('acl_btn_show_existing');
+ − 161
editbtn_wrapper.appendChild(editbtn);
+ − 162
main.appendChild(editbtn_wrapper);
+ − 163
+ − 164
editbtn.onclick = function()
+ − 165
{
+ − 166
aclSetViewListExisting();
+ − 167
return false;
+ − 168
}
1
+ − 169
+ − 170
selector = document.createElement('div');
+ − 171
+ − 172
grpsel = __aclBuildGroupsHTML(groups);
+ − 173
grpsel.name = 'group_id';
+ − 174
+ − 175
span = document.createElement('div');
+ − 176
span.id = "enACL_grpbox_"+seed+"";
+ − 177
+ − 178
// Build the selector
+ − 179
grpb = document.createElement('input');
+ − 180
grpb.type = 'radio';
+ − 181
grpb.name = 'target_type';
40
+ − 182
grpb.value = '1'; // ACL_TYPE_GROUP
1
+ − 183
grpb.checked = 'checked';
+ − 184
grpb.className = seed;
+ − 185
grpb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'block'; document.getElementById('enACL_usrbox_'+seed).style.display = 'none'; };
+ − 186
lbl = document.createElement('label');
+ − 187
lbl.appendChild(grpb);
218
+ − 188
lbl.appendChild(document.createTextNode($lang.get('acl_radio_usergroup')));
1
+ − 189
lbl.style.display = 'block';
+ − 190
span.appendChild(grpsel);
+ − 191
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
diff
changeset
+ − 192
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
diff
changeset
+ − 193
anoninfo.className = 'info-box-mini';
218
+ − 194
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
diff
changeset
+ − 195
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
diff
changeset
+ − 196
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
diff
changeset
+ − 197
1
+ − 198
usrb = document.createElement('input');
+ − 199
usrb.type = 'radio';
+ − 200
usrb.name = 'target_type';
40
+ − 201
usrb.value = '2'; // ACL_TYPE_USER
1
+ − 202
usrb.className = seed;
+ − 203
usrb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'none'; document.getElementById('enACL_usrbox_'+seed).style.display = 'block'; };
+ − 204
lbl2 = document.createElement('label');
+ − 205
lbl2.appendChild(usrb);
218
+ − 206
lbl2.appendChild(document.createTextNode($lang.get('acl_radio_user')));
1
+ − 207
lbl2.style.display = 'block';
+ − 208
+ − 209
usrsel = document.createElement('input');
+ − 210
usrsel.type = 'text';
+ − 211
usrsel.name = 'username';
184
+ − 212
usrsel.onkeyup = function() { new AutofillUsername(this, undefined, true); };
1
+ − 213
usrsel.id = 'userfield_' + aclManagerID;
+ − 214
try {
+ − 215
usrsel.setAttribute("autocomplete","off");
+ − 216
} catch(e) {};
+ − 217
+ − 218
span2 = document.createElement('div');
+ − 219
span2.id = "enACL_usrbox_"+seed+"";
+ − 220
span2.style.display = 'none';
+ − 221
span2.appendChild(usrsel);
+ − 222
+ − 223
// Scope selector
+ − 224
if(do_scopesel)
+ − 225
{
+ − 226
scopediv1 = document.createElement('div');
+ − 227
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
diff
changeset
+ − 228
scopediv3 = document.createElement('div');
1
+ − 229
scopeRadioPage = document.createElement('input');
+ − 230
scopeRadioPage.type = 'radio';
+ − 231
scopeRadioPage.name = 'scope';
+ − 232
scopeRadioPage.value = 'page';
+ − 233
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
diff
changeset
+ − 234
scopeRadioPage.className = '1048576';
76
+ − 235
if ( groups.page_groups.length > 0 ) scopeRadioPage.onclick = function() { var id = 'enACL_pgsel_' + this.className; document.getElementById(id).style.display = 'none'; };
1
+ − 236
scopeRadioGlobal = document.createElement('input');
+ − 237
scopeRadioGlobal.type = 'radio';
+ − 238
scopeRadioGlobal.name = 'scope';
+ − 239
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
diff
changeset
+ − 240
scopeRadioGlobal.className = '1048576';
76
+ − 241
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
diff
changeset
+ − 242
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
diff
changeset
+ − 243
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
diff
changeset
+ − 244
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
diff
changeset
+ − 245
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
diff
changeset
+ − 246
scopeRadioGroup.className = '1048576';
76
+ − 247
if ( groups.page_groups.length > 0 ) scopeRadioGroup.onclick = function() { var id = 'enACL_pgsel_' + this.className; document.getElementById(id).style.display = 'block'; };
1
+ − 248
lblPage = document.createElement('label');
+ − 249
lblPage.style.display = 'block';
+ − 250
lblPage.appendChild(scopeRadioPage);
218
+ − 251
lblPage.appendChild(document.createTextNode($lang.get('acl_radio_scope_thispage')));
1
+ − 252
lblGlobal = document.createElement('label');
+ − 253
lblGlobal.style.display = 'block';
+ − 254
lblGlobal.appendChild(scopeRadioGlobal);
218
+ − 255
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
diff
changeset
+ − 256
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
diff
changeset
+ − 257
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
diff
changeset
+ − 258
lblGroup.appendChild(scopeRadioGroup);
218
+ − 259
lblGroup.appendChild(document.createTextNode($lang.get('acl_radio_scope_pagegroup')));
1
+ − 260
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
diff
changeset
+ − 261
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
diff
changeset
+ − 262
scopediv3.appendChild(lblGlobal);
1
+ − 263
+ − 264
scopedesc = document.createElement('p');
218
+ − 265
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
diff
changeset
+ − 266
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
diff
changeset
+ − 267
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
diff
changeset
+ − 268
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
diff
changeset
+ − 269
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
diff
changeset
+ − 270
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
diff
changeset
+ − 271
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
diff
changeset
+ − 272
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
diff
changeset
+ − 273
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
diff
changeset
+ − 274
{
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
diff
changeset
+ − 275
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
diff
changeset
+ − 276
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
diff
changeset
+ − 277
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
diff
changeset
+ − 278
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
diff
changeset
+ − 279
}
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
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
diff
changeset
+ − 281
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
diff
changeset
+ − 282
1
+ − 283
}
+ − 284
+ − 285
// Styles
+ − 286
span.style.marginLeft = '13px';
+ − 287
span.style.padding = '5px 0';
+ − 288
span2.style.marginLeft = '13px';
+ − 289
span2.style.padding = '5px 0';
+ − 290
+ − 291
selector.appendChild(lbl);
+ − 292
selector.appendChild(span);
+ − 293
+ − 294
selector.appendChild(lbl2);
+ − 295
selector.appendChild(span2);
+ − 296
+ − 297
container = document.createElement('div');
+ − 298
container.style.margin = 'auto';
+ − 299
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
diff
changeset
+ − 300
container.style.paddingTop = '50px';
1
+ − 301
+ − 302
head = document.createElement('h2');
218
+ − 303
head.appendChild(document.createTextNode($lang.get('acl_lbl_welcome_title')));
1
+ − 304
+ − 305
desc = document.createElement('p');
218
+ − 306
desc.appendChild(document.createTextNode($lang.get('acl_lbl_welcome_body')));
1
+ − 307
+ − 308
container.appendChild(head);
+ − 309
container.appendChild(desc);
+ − 310
container.appendChild(selector);
+ − 311
+ − 312
if(do_scopesel)
+ − 313
{
+ − 314
container.appendChild(scopedesc);
+ − 315
container.appendChild(scopediv1);
76
+ − 316
if ( groups.page_groups.length > 0 )
+ − 317
{
+ − 318
container.appendChild(scopediv2);
+ − 319
}
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
diff
changeset
+ − 320
container.appendChild(scopediv3);
1
+ − 321
}
+ − 322
+ − 323
main.appendChild(container);
+ − 324
+ − 325
var mode = document.createElement('input');
+ − 326
mode.name = 'mode';
+ − 327
mode.type = 'hidden';
+ − 328
mode.id = aclManagerID + '_mode';
+ − 329
mode.value = 'seltarget';
+ − 330
+ − 331
var theform = document.getElementById(aclManagerID + '_formobj_id');
+ − 332
if ( !theform.mode )
+ − 333
{
+ − 334
theform.appendChild(mode);
+ − 335
}
+ − 336
else
+ − 337
{
+ − 338
theform.removeChild(theform.mode);
+ − 339
theform.appendChild(mode);
+ − 340
}
+ − 341
}
+ − 342
+ − 343
var aclDebugWin = false;
+ − 344
+ − 345
function aclDebug(text)
+ − 346
{
+ − 347
if(!aclDebugWin)
+ − 348
aclDebugWin = pseudoWindowOpen("data:text/html;plain,<html><head><title>debug win</title></head><body><h1>Debug window</h1></body></html>", "aclDebugWin");
+ − 349
setTimeout(function() {
+ − 350
aclDebugWin.pre = aclDebugWin.document.createElement('pre');
+ − 351
aclDebugWin.pre.appendChild(aclDebugWin.document.createTextNode(text));
+ − 352
aclDebugWin.b = aclDebugWin.document.getElementsByTagName('body')[0];
+ − 353
aclDebugWin.b.appendChild(aclDebugWin.pre);}, 1000);
+ − 354
}
+ − 355
+ − 356
var pseudoWindows = new Object();
+ − 357
+ − 358
function pseudoWindowOpen(url, id)
+ − 359
{
+ − 360
if(pseudoWindows[id])
+ − 361
{
+ − 362
document.getElementById('pseudowin_ifr_'+id).src = url;
+ − 363
}
+ − 364
else
+ − 365
{
+ − 366
win = document.createElement('iframe');
+ − 367
win.style.position='fixed';
+ − 368
win.style.width = '640px';
+ − 369
win.style.height = '480px';
+ − 370
win.style.top = '0px';
+ − 371
win.style.left = '0px';
+ − 372
win.style.zIndex = getHighestZ() + 1;
+ − 373
win.style.backgroundColor = '#FFFFFF';
+ − 374
win.name = 'pseudo_ifr_'+id;
+ − 375
win.id = 'pseudowindow_ifr_'+id;
+ − 376
win.src = url;
+ − 377
body = document.getElementsByTagName('body')[0];
+ − 378
body.appendChild(win);
+ − 379
}
+ − 380
win_obj = eval("( pseudo_ifr_"+id+" )");
+ − 381
return win_obj;
+ − 382
}
+ − 383
+ − 384
function __aclJSONSubmitAjaxHandler(params)
+ − 385
{
+ − 386
params = toJSONString(params);
+ − 387
params = ajaxEscape(params);
+ − 388
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
407
+ − 389
if ( ajax.readyState == 4 && ajax.status == 200 )
1
+ − 390
{
327
+ − 391
var response = String(ajax.responseText + '');
+ − 392
if ( response.substr(0, 1) != '{' )
+ − 393
{
+ − 394
handle_invalid_json(ajax.responseText);
+ − 395
return false;
+ − 396
}
513
+ − 397
try
+ − 398
{
+ − 399
var data = parseJSON(ajax.responseText);
+ − 400
}
+ − 401
catch(e)
+ − 402
{
327
+ − 403
handle_invalid_json(ajax.responseText);
513
+ − 404
return false;
1
+ − 405
}
+ − 406
aclDataCache = data;
+ − 407
switch(data.mode)
+ − 408
{
+ − 409
case 'seltarget':
+ − 410
+ − 411
// 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
diff
changeset
+ − 412
aclBuildRuleEditor(data);
1
+ − 413
+ − 414
break;
+ − 415
case 'success':
+ − 416
var note = document.createElement('div');
+ − 417
note.className = 'info-box';
+ − 418
note.style.marginLeft = '0';
+ − 419
var b = document.createElement('b');
218
+ − 420
b.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_title')));
1
+ − 421
note.appendChild(b);
+ − 422
note.appendChild(document.createElement('br'));
218
+ − 423
note.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_body', { target_name: data.target_name })));
1
+ − 424
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
diff
changeset
+ − 425
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
diff
changeset
+ − 426
/*
1
+ − 427
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
diff
changeset
+ − 428
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
diff
changeset
+ − 429
a.id = aclManagerID + '_btn_dismiss';
218
+ − 430
a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
1
+ − 431
note.appendChild(a);
+ − 432
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
diff
changeset
+ − 433
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
diff
changeset
+ − 434
a.id = aclManagerID + '_btn_close';
218
+ − 435
a2.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
1
+ − 436
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
diff
changeset
+ − 437
*/
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
diff
changeset
+ − 438
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
diff
changeset
+ − 439
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
diff
changeset
+ − 440
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
diff
changeset
+ − 441
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
diff
changeset
+ − 442
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
diff
changeset
+ − 443
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
diff
changeset
+ − 444
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
diff
changeset
+ − 445
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
diff
changeset
+ − 446
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
diff
changeset
+ − 447
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
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
diff
changeset
+ − 449
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
diff
changeset
+ − 450
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
diff
changeset
+ − 451
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
diff
changeset
+ − 452
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
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
diff
changeset
+ − 454
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
diff
changeset
+ − 455
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
diff
changeset
+ − 456
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
diff
changeset
+ − 457
document.getElementById(aclManagerID+'_main').scrollTop = 0;
513
+ − 458
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
diff
changeset
+ − 459
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
diff
changeset
+ − 460
aclDataCache.mode = 'save_edit';
1
+ − 461
break;
+ − 462
case 'delete':
+ − 463
+ − 464
params = {
+ − 465
'mode' : 'listgroups'
+ − 466
};
+ − 467
params = toJSONString(params);
+ − 468
params = ajaxEscape(params);
+ − 469
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
407
+ − 470
if ( ajax.readyState == 4 && ajax.status == 200 )
1
+ − 471
{
+ − 472
document.getElementById(aclManagerID+'_main').innerHTML = '';
+ − 473
document.getElementById(aclManagerID + '_back').style.display = 'none';
218
+ − 474
document.getElementById(aclManagerID + '_next').value = $lang.get('etc_wizard_next');
1
+ − 475
var thispage = strToPageID(title);
+ − 476
groups.page_id = thispage[0];
+ − 477
groups.namespace = thispage[1];
+ − 478
__aclBuildSelector(groups);
+ − 479
+ − 480
note = document.createElement('div');
+ − 481
note.className = 'info-box';
+ − 482
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
diff
changeset
+ − 483
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
diff
changeset
+ − 484
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
diff
changeset
+ − 485
note.id = 'aclSuccessNotice_' + Math.floor(Math.random() * 100000);
1
+ − 486
b = document.createElement('b');
218
+ − 487
b.appendChild(document.createTextNode($lang.get('acl_lbl_delete_success_title')));
1
+ − 488
note.appendChild(b);
+ − 489
note.appendChild(document.createElement('br'));
336
+ − 490
note.appendChild(document.createTextNode($lang.get('acl_lbl_delete_success_body', { target_name: aclDataCache.target_name })));
1
+ − 491
note.appendChild(document.createElement('br'));
+ − 492
a = document.createElement('a');
+ − 493
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
diff
changeset
+ − 494
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
+ − 495
a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
1
+ − 496
note.appendChild(a);
+ − 497
a = document.createElement('a');
+ − 498
a.href = '#';
+ − 499
a.onclick = function() { killACLManager(); return false; };
218
+ − 500
a.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
1
+ − 501
note.appendChild(a);
+ − 502
document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
+ − 503
//fadeInfoBoxes();
+ − 504
+ − 505
}
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
diff
changeset
+ − 506
}, true);
1
+ − 507
+ − 508
break;
+ − 509
case 'error':
+ − 510
alert("Server side processing error:\n"+data.error);
+ − 511
break;
+ − 512
case 'debug':
+ − 513
aclDebug(data.text);
+ − 514
break;
513
+ − 515
case 'list_existing':
+ − 516
aclSetViewListExistingRespond(data);
+ − 517
break;
1
+ − 518
default:
327
+ − 519
handle_invalid_json(ajax.responseText);
1
+ − 520
break;
+ − 521
}
+ − 522
}
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
diff
changeset
+ − 523
}, true);
1
+ − 524
}
+ − 525
513
+ − 526
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
diff
changeset
+ − 527
{
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
diff
changeset
+ − 528
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
diff
changeset
+ − 529
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
diff
changeset
+ − 530
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
diff
changeset
+ − 531
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
diff
changeset
+ − 532
513
+ − 533
document.getElementById(aclManagerID + '_next').style.display = 'inline';
+ − 534
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
diff
changeset
+ − 535
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
diff
changeset
+ − 536
html += '<p>' + $lang.get('acl_lbl_editwin_body', { target_type: target_type_t, target: target_name_t, scope_type: scope_type }) + '</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
diff
changeset
+ − 537
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
diff
changeset
+ − 538
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
diff
changeset
+ − 539
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
diff
changeset
+ − 540
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
diff
changeset
+ − 541
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
diff
changeset
+ − 542
{
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
diff
changeset
+ − 543
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
diff
changeset
+ − 544
{
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
diff
changeset
+ − 545
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
diff
changeset
+ − 546
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
diff
changeset
+ − 547
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
diff
changeset
+ − 548
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
diff
changeset
+ − 549
{
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
diff
changeset
+ − 550
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
diff
changeset
+ − 551
}
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
diff
changeset
+ − 552
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
diff
changeset
+ − 553
{
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
diff
changeset
+ − 554
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
diff
changeset
+ − 555
}
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
diff
changeset
+ − 556
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
diff
changeset
+ − 557
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
diff
changeset
+ − 558
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
diff
changeset
+ − 559
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
diff
changeset
+ − 560
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
diff
changeset
+ − 561
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
diff
changeset
+ − 562
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
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
diff
changeset
+ − 564
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
diff
changeset
+ − 565
}
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
diff
changeset
+ − 566
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
diff
changeset
+ − 567
{
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
diff
changeset
+ − 568
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
diff
changeset
+ − 569
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
diff
changeset
+ − 570
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
diff
changeset
+ − 571
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
diff
changeset
+ − 572
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
diff
changeset
+ − 573
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
diff
changeset
+ − 574
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
diff
changeset
+ − 575
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
diff
changeset
+ − 576
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
diff
changeset
+ − 577
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
diff
changeset
+ − 578
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
diff
changeset
+ − 579
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
diff
changeset
+ − 580
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
diff
changeset
+ − 581
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
diff
changeset
+ − 582
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
diff
changeset
+ − 583
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
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
diff
changeset
+ − 585
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
diff
changeset
+ − 586
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
diff
changeset
+ − 587
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
diff
changeset
+ − 588
}
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
diff
changeset
+ − 589
}
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
diff
changeset
+ − 590
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
diff
changeset
+ − 591
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
diff
changeset
+ − 592
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
diff
changeset
+ − 593
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
diff
changeset
+ − 594
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
diff
changeset
+ − 595
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
diff
changeset
+ − 596
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
diff
changeset
+ − 597
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
diff
changeset
+ − 598
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
diff
changeset
+ − 599
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
diff
changeset
+ − 600
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
diff
changeset
+ − 601
513
+ − 602
if ( from_direct )
+ − 603
{
+ − 604
var modeobj = document.getElementById(aclManagerID + '_mode');
+ − 605
modeobj.value = 'save_edit';
+ − 606
}
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
diff
changeset
+ − 607
else
513
+ − 608
{
+ − 609
var modeobj = form_fetch_field(form, 'mode');
+ − 610
if ( modeobj )
+ − 611
modeobj.value = 'save_' + data.type;
+ − 612
else
+ − 613
alert('modeobj is invalid: '+modeobj);
+ − 614
}
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
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
diff
changeset
+ − 616
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
diff
changeset
+ − 617
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
diff
changeset
+ − 618
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
diff
changeset
+ − 619
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
diff
changeset
+ − 620
}
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
diff
changeset
+ − 621
1
+ − 622
function __aclBuildGroupsHTML(groups)
+ − 623
{
+ − 624
groups = groups.groups;
+ − 625
select = document.createElement('select');
+ − 626
for(var i in groups)
+ − 627
{
+ − 628
if(typeof(groups[i]['name']) == 'string' && i != 'toJSONString')
+ − 629
{
+ − 630
o = document.createElement('option');
+ − 631
o.value = groups[i]['id'];
+ − 632
t = document.createTextNode(groups[i]['name']);
+ − 633
o.appendChild(t);
+ − 634
select.appendChild(o);
+ − 635
}
+ − 636
}
+ − 637
return select;
+ − 638
}
+ − 639
+ − 640
function __aclBuildWizardWindow()
+ − 641
{
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
diff
changeset
+ − 642
darken(aclDisableTransitionFX);
1
+ − 643
box = document.createElement('div');
+ − 644
box.style.width = '640px'
+ − 645
box.style.height = '440px';
+ − 646
box.style.position = 'fixed';
+ − 647
width = getWidth();
+ − 648
height = getHeight();
+ − 649
box.style.left = ( width / 2 - 320 ) + 'px';
+ − 650
box.style.top = ( height / 2 - 250 ) + 'px';
+ − 651
box.style.backgroundColor = 'white';
+ − 652
box.style.zIndex = getHighestZ() + 1;
+ − 653
box.id = aclManagerID;
+ − 654
box.style.opacity = '0';
+ − 655
box.style.filter = 'alpha(opacity=0)';
+ − 656
box.style.display = 'none';
+ − 657
+ − 658
mainwin = document.createElement('div');
+ − 659
mainwin.id = aclManagerID + '_main';
+ − 660
mainwin.style.clip = 'rect(0px,640px,440px,0px)';
+ − 661
mainwin.style.overflow = 'auto';
+ − 662
mainwin.style.width = '620px';
+ − 663
mainwin.style.height = '420px';
+ − 664
+ − 665
panel = document.createElement('div');
+ − 666
panel.style.width = '620px';
+ − 667
panel.style.padding = '10px';
+ − 668
panel.style.lineHeight = '40px';
+ − 669
panel.style.textAlign = 'right';
+ − 670
panel.style.position = 'fixed';
+ − 671
panel.style.left = ( width / 2 - 320 ) + 'px';
+ − 672
panel.style.top = ( height / 2 + 190 ) + 'px';
+ − 673
panel.style.backgroundColor = '#D0D0D0';
+ − 674
panel.style.opacity = '0';
+ − 675
panel.style.filter = 'alpha(opacity=0)';
+ − 676
panel.id = aclManagerID + '_panel';
+ − 677
+ − 678
form = document.createElement('form');
+ − 679
form.method = 'post';
+ − 680
form.action = 'javascript:void(0)';
+ − 681
form.onsubmit = function() { if(this.username && !submitAuthorized) return false; __aclSubmitManager(this); return false; };
+ − 682
form.name = aclManagerID + '_formobj';
+ − 683
form.id = aclManagerID + '_formobj_id';
+ − 684
+ − 685
back = document.createElement('input');
+ − 686
back.type = 'button';
218
+ − 687
back.value = $lang.get('etc_wizard_back');
1
+ − 688
back.style.fontWeight = 'normal';
+ − 689
back.onclick = function() { ajaxACLSwitchToSelector(); return false; };
+ − 690
back.style.display = 'none';
+ − 691
back.id = aclManagerID + '_back';
+ − 692
+ − 693
saver = document.createElement('input');
+ − 694
saver.type = 'submit';
218
+ − 695
saver.value = $lang.get('etc_wizard_next');
1
+ − 696
saver.style.fontWeight = 'bold';
+ − 697
saver.id = aclManagerID + '_next';
+ − 698
+ − 699
closer = document.createElement('input');
+ − 700
closer.type = 'button';
218
+ − 701
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
diff
changeset
+ − 702
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
diff
changeset
+ − 703
{
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
diff
changeset
+ − 704
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
diff
changeset
+ − 705
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
diff
changeset
+ − 706
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
diff
changeset
+ − 707
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
diff
changeset
+ − 708
{
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
diff
changeset
+ − 709
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
diff
changeset
+ − 710
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
diff
changeset
+ − 711
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
diff
changeset
+ − 712
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
diff
changeset
+ − 713
},
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
diff
changeset
+ − 714
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
diff
changeset
+ − 715
{
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
diff
changeset
+ − 716
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
diff
changeset
+ − 717
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
diff
changeset
+ − 718
}
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
diff
changeset
+ − 719
},
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
diff
changeset
+ − 720
{
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
diff
changeset
+ − 721
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
diff
changeset
+ − 722
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
diff
changeset
+ − 723
{
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
diff
changeset
+ − 724
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
diff
changeset
+ − 725
}
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
diff
changeset
+ − 726
}
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
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
diff
changeset
+ − 728
});
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
diff
changeset
+ − 729
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
diff
changeset
+ − 730
}
1
+ − 731
+ − 732
spacer1 = document.createTextNode(' ');
+ − 733
spacer2 = document.createTextNode(' ');
+ − 734
+ − 735
panel.appendChild(back);
+ − 736
panel.appendChild(spacer1);
+ − 737
panel.appendChild(saver);
+ − 738
panel.appendChild(spacer2);
+ − 739
panel.appendChild(closer);
+ − 740
form.appendChild(mainwin);
+ − 741
form.appendChild(panel);
+ − 742
box.appendChild(form);
+ − 743
+ − 744
body = document.getElementsByTagName('body')[0];
+ − 745
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
diff
changeset
+ − 746
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
diff
changeset
+ − 747
{
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 748
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
diff
changeset
+ − 749
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
diff
changeset
+ − 750
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
diff
changeset
+ − 751
}
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 752
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
diff
changeset
+ − 753
{
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 754
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
diff
changeset
+ − 755
}
1
+ − 756
}
+ − 757
+ − 758
function killACLManager()
+ − 759
{
+ − 760
el = document.getElementById(aclManagerID);
+ − 761
if(el)
+ − 762
{
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
diff
changeset
+ − 763
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
diff
changeset
+ − 764
{
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 765
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
diff
changeset
+ − 766
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
diff
changeset
+ − 767
}
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 768
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
diff
changeset
+ − 769
{
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 770
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
diff
changeset
+ − 771
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
diff
changeset
+ − 772
}
1
+ − 773
}
+ − 774
}
+ − 775
+ − 776
function __aclSubmitManager(form)
+ − 777
{
+ − 778
var thefrm = document.forms[form.name];
+ − 779
var modeobj = form_fetch_field(thefrm, 'mode');
+ − 780
if ( typeof(modeobj) == 'object' )
+ − 781
{
+ − 782
var mode = (thefrm.mode.value) ? thefrm.mode.value : 'cant_get';
+ − 783
}
+ − 784
else
+ − 785
{
+ − 786
var mode = '';
+ − 787
}
+ − 788
switch(mode)
+ − 789
{
+ − 790
case 'cant_get':
+ − 791
alert('BUG: can\'t get the state value from the form field.');
+ − 792
break;
+ − 793
case 'seltarget':
40
+ − 794
var target_type = parseInt(getRadioState(thefrm, 'target_type', ['1', '2']));
1
+ − 795
if(isNaN(target_type))
+ − 796
{
218
+ − 797
alert($lang.get('acl_err_pleaseselect_targettype'));
1
+ − 798
return false;
+ − 799
}
+ − 800
target_id = ( target_type == 1 ) ? parseInt(thefrm.group_id.value) : thefrm.username.value;
+ − 801
+ − 802
obj = { 'mode' : mode, 'target_type' : target_type, 'target_id' : target_id };
+ − 803
+ − 804
thispage = strToPageID(title);
+ − 805
do_scopesel = ( thispage[0] == aclDataCache.page_id && thispage[1] == aclDataCache.namespace );
+ − 806
+ − 807
if(do_scopesel)
+ − 808
{
535
+ − 809
scope = getRadioState(thefrm, 'scope', ['page', 'group', 'global']);
1
+ − 810
if(scope == 'page')
+ − 811
{
+ − 812
pageid = strToPageID(title);
+ − 813
obj['page_id'] = pageid[0];
+ − 814
obj['namespace'] = pageid[1];
+ − 815
}
+ − 816
else if(scope == 'global')
+ − 817
{
+ − 818
obj['page_id'] = false;
+ − 819
obj['namespace'] = false;
+ − 820
}
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
diff
changeset
+ − 821
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
diff
changeset
+ − 822
{
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
diff
changeset
+ − 823
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
diff
changeset
+ − 824
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
diff
changeset
+ − 825
}
1
+ − 826
else
+ − 827
{
+ − 828
alert('Invalid scope');
+ − 829
return false;
+ − 830
}
+ − 831
}
+ − 832
else
+ − 833
{
+ − 834
obj['page_id'] = aclDataCache.page_id;
+ − 835
obj['namespace'] = aclDataCache.namespace;
+ − 836
}
+ − 837
if(target_id == '')
+ − 838
{
218
+ − 839
alert($lang.get('acl_err_pleaseselect_username'));
1
+ − 840
return false;
+ − 841
}
+ − 842
__aclJSONSubmitAjaxHandler(obj);
+ − 843
break;
+ − 844
case 'save_edit':
+ − 845
case 'save_new':
+ − 846
var form = document.forms[aclManagerID + '_formobj'];
+ − 847
selections = new Object();
40
+ − 848
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
diff
changeset
+ − 849
var warned_everyone = false;
1
+ − 850
for(var i in aclPermList)
+ − 851
{
40
+ − 852
selections[aclPermList[i]] = getRadioState(form, aclPermList[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
diff
changeset
+ − 853
// 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
diff
changeset
+ − 854
// 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
diff
changeset
+ − 855
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
diff
changeset
+ − 856
{
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
diff
changeset
+ − 857
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
diff
changeset
+ − 858
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
diff
changeset
+ − 859
{
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
diff
changeset
+ − 860
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
diff
changeset
+ − 861
}
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
diff
changeset
+ − 862
}
40
+ − 863
dbg += aclPermList[i] + ': ' + selections[aclPermList[i]] + "\n";
+ − 864
if(!selections[aclPermList[i]])
1
+ − 865
{
40
+ − 866
alert("Invalid return from getRadioState: "+i+": "+selections[i]+" ("+typeof(selections[i])+")");
+ − 867
return false;
1
+ − 868
}
+ − 869
}
+ − 870
obj = new Object();
+ − 871
obj['perms'] = selections;
+ − 872
obj['mode'] = mode;
+ − 873
obj['target_type'] = aclDataCache.target_type;
+ − 874
obj['target_id'] = aclDataCache.target_id;
+ − 875
obj['target_name'] = aclDataCache.target_name;
+ − 876
obj['page_id'] = aclDataCache.page_id;
+ − 877
obj['namespace'] = aclDataCache.namespace;
+ − 878
__aclJSONSubmitAjaxHandler(obj);
+ − 879
break;
+ − 880
default:
+ − 881
alert("JSON form submit: invalid mode string "+mode+", stopping execution");
+ − 882
return false;
+ − 883
break;
+ − 884
}
+ − 885
}
+ − 886
40
+ − 887
function getRadioState(form, name, valArray)
1
+ − 888
{
40
+ − 889
// Konqueror/Safari fix
+ − 890
if ( form[name] )
+ − 891
{
+ − 892
var formitem = form[name];
+ − 893
if ( String(formitem) == '[object DOMNamedNodesCollection]' || is_Safari )
+ − 894
{
+ − 895
var i = 0;
+ − 896
var radios = new Array();
+ − 897
var radioids = new Array();
+ − 898
while(true)
+ − 899
{
+ − 900
var elem = formitem[i];
+ − 901
if ( !elem )
+ − 902
break;
+ − 903
radios.push(elem);
+ − 904
if ( !elem.id )
+ − 905
{
+ − 906
elem.id = 'autoRadioBtn_' + Math.floor(Math.random() * 1000000);
+ − 907
}
+ − 908
radioids.push(elem.id);
+ − 909
i++;
+ − 910
}
+ − 911
var cr;
+ − 912
for ( var i = 0; i < radios.length; i++ )
+ − 913
{
+ − 914
cr = document.getElementById(radioids[i]);
+ − 915
if ( cr.value == 'on' || cr.checked == true )
+ − 916
{
+ − 917
try {
+ − 918
return ( typeof ( valArray[i] ) != 'undefined' ) ? valArray[i] : false;
+ − 919
} catch(e) {
+ − 920
// alert('Didn\'t get value for index: ' + i);
+ − 921
return false;
+ − 922
}
+ − 923
}
+ − 924
}
+ − 925
return false;
+ − 926
}
+ − 927
}
1
+ − 928
inputs = form.getElementsByTagName('input');
+ − 929
radios = new Array();
+ − 930
for(var i in inputs)
+ − 931
{
+ − 932
if(inputs[i]) if(inputs[i].type == 'radio')
+ − 933
radios.push(inputs[i]);
+ − 934
}
+ − 935
for(var i in radios)
+ − 936
{
+ − 937
if(radios[i].checked && radios[i].name == name)
+ − 938
return radios[i].value;
+ − 939
}
+ − 940
return false;
+ − 941
}
+ − 942
40
+ − 943
function __aclSetAllRadios(val, valArray)
1
+ − 944
{
40
+ − 945
val = String(val);
+ − 946
var form = document.forms[aclManagerID + '_formobj'];
1
+ − 947
if (!form)
40
+ − 948
{
1
+ − 949
return false;
40
+ − 950
}
+ − 951
var inputs = form.getElementsByTagName('input');
+ − 952
var radios = new Array();
+ − 953
var dbg = '';
+ − 954
for(var i = 0; i < inputs.length; i++)
1
+ − 955
{
40
+ − 956
dbg += String(inputs[i]) + "\n";
1
+ − 957
if(inputs[i].type == 'radio')
+ − 958
radios.push(inputs[i]);
+ − 959
}
+ − 960
for(var i in radios)
+ − 961
{
+ − 962
if(radios[i].value == val)
+ − 963
radios[i].checked = true;
+ − 964
else
+ − 965
radios[i].checked = false;
+ − 966
}
+ − 967
}
+ − 968
+ − 969
function __aclDeleteRule()
+ − 970
{
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
diff
changeset
+ − 971
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
diff
changeset
+ − 972
{
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
diff
changeset
+ − 973
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
diff
changeset
+ − 974
{
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
diff
changeset
+ − 975
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
diff
changeset
+ − 976
}
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
diff
changeset
+ − 977
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
diff
changeset
+ − 978
}
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
diff
changeset
+ − 979
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
diff
changeset
+ − 980
{
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
diff
changeset
+ − 981
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
diff
changeset
+ − 982
{
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
diff
changeset
+ − 983
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
diff
changeset
+ − 984
}
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
diff
changeset
+ − 985
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
diff
changeset
+ − 986
}
1
+ − 987
parms = {
+ − 988
'target_type' : aclDataCache.target_type,
+ − 989
'target_id' : aclDataCache.target_id,
+ − 990
'target_name' : aclDataCache.target_name,
+ − 991
'page_id' : aclDataCache.page_id,
+ − 992
'namespace' : aclDataCache.namespace,
+ − 993
'mode' : 'delete'
+ − 994
};
+ − 995
__aclJSONSubmitAjaxHandler(parms);
+ − 996
}
+ − 997
513
+ − 998
function aclSetViewListExisting()
+ − 999
{
+ − 1000
if ( !document.getElementById(aclManagerID) )
+ − 1001
{
+ − 1002
return false;
+ − 1003
}
+ − 1004
+ − 1005
var main = document.getElementById(aclManagerID + '_main');
+ − 1006
main.innerHTML = '';
+ − 1007
main.style.backgroundImage = 'url(' + scriptPath + '/images/loading-big.gif)';
+ − 1008
main.style.backgroundRepeat = 'no-repeat';
+ − 1009
main.style.backgroundPosition = 'center center';
+ − 1010
+ − 1011
var parms = {
+ − 1012
'mode' : 'list_existing'
+ − 1013
};
+ − 1014
__aclJSONSubmitAjaxHandler(parms);
+ − 1015
}
+ − 1016
+ − 1017
function aclSetViewListExistingRespond(data)
+ − 1018
{
+ − 1019
var main = document.getElementById(aclManagerID + '_main');
+ − 1020
main.style.padding = '10px';
+ − 1021
main.innerHTML = '';
+ − 1022
+ − 1023
var heading = document.createElement('h3');
+ − 1024
heading.appendChild(document.createTextNode($lang.get('acl_msg_scale_intro_title')));
+ − 1025
main.appendChild(heading);
+ − 1026
+ − 1027
var p = document.createElement('p');
+ − 1028
p.appendChild(document.createTextNode($lang.get('acl_msg_scale_intro_body')));
+ − 1029
main.appendChild(p);
+ − 1030
+ − 1031
+ − 1032
main.innerHTML += data.key;
+ − 1033
main.style.backgroundImage = 'none';
+ − 1034
+ − 1035
document.getElementById(aclManagerID + '_back').style.display = 'inline';
+ − 1036
document.getElementById(aclManagerID + '_next').style.display = 'none';
+ − 1037
+ − 1038
for ( var i = 0; i < data.rules.length; i++ )
+ − 1039
{
+ − 1040
var rule = data.rules[i];
+ − 1041
// build the rule, this is just more boring DOM crap.
+ − 1042
var div = document.createElement('div');
+ − 1043
div.style.padding = '5px 3px';
+ − 1044
div.style.backgroundColor = '#' + rule.color;
+ − 1045
div.style.cursor = 'pointer';
+ − 1046
div.rule_id = rule.rule_id;
+ − 1047
div.onclick = function()
+ − 1048
{
+ − 1049
var main = document.getElementById(aclManagerID + '_main');
+ − 1050
main.innerHTML = '';
+ − 1051
main.style.backgroundImage = 'url(' + scriptPath + '/images/loading-big.gif)';
+ − 1052
ajaxOpenDirectACLRule(parseInt(this.rule_id));
+ − 1053
}
+ − 1054
div.innerHTML = rule.score_string;
+ − 1055
main.appendChild(div);
+ − 1056
}
+ − 1057
}
+ − 1058
1
+ − 1059
function array_keys(obj)
+ − 1060
{
+ − 1061
keys = new Array();
+ − 1062
for(var i in obj)
+ − 1063
keys.push(i);
+ − 1064
return keys;
+ − 1065
}
+ − 1066
+ − 1067
function form_fetch_field(form, name)
+ − 1068
{
+ − 1069
var fields = form.getElementsByTagName('input');
+ − 1070
if ( fields.length < 1 )
+ − 1071
return false;
+ − 1072
for ( var i = 0; i < fields.length; i++ )
+ − 1073
{
+ − 1074
var field = fields[i];
+ − 1075
if ( field.name == name )
+ − 1076
return field;
+ − 1077
}
+ − 1078
return false;
+ − 1079
}
+ − 1080