includes/clientside/static/acl.js
changeset 749 ea3045a3bcbd
parent 730 b09cb1dab505
child 763 a03406756fdd
equal deleted inserted replaced
748:e39454295bbb 749:ea3045a3bcbd
  1383       editlink.href = 'javascript:ajaxOpenDirectACLRule(' + perm.rule_id + ');';
  1383       editlink.href = 'javascript:ajaxOpenDirectACLRule(' + perm.rule_id + ');';
  1384       editlink.appendChild(document.createTextNode($lang.get('acl_btn_edit_rule')));
  1384       editlink.appendChild(document.createTextNode($lang.get('acl_btn_edit_rule')));
  1385       sm.appendChild(editlink);
  1385       sm.appendChild(editlink);
  1386       sm.innerHTML += ']';
  1386       sm.innerHTML += ']';
  1387     }
  1387     }
       
  1388     
       
  1389     if ( perm.bad_deps.length > 0 )
       
  1390     {
       
  1391       var bd = document.createElement('span');
       
  1392       $(bd).addClass('acl_failed_deps');
       
  1393       var failed_deps = '';
       
  1394       for ( var i = 0; i < perm.bad_deps.length; i++ )
       
  1395       {
       
  1396         if ( i > 0 )
       
  1397           failed_deps += ', ';
       
  1398         failed_deps += data.perms[perm.bad_deps[i]].perm_name;
       
  1399       }
       
  1400       var title = document.createElement('span');
       
  1401       $(title).addClass('title');
       
  1402       title.appendChild(document.createTextNode($lang.get('acl_msg_failed_deps')));
       
  1403       bd.appendChild(title);
       
  1404       bd.appendChild(document.createTextNode(failed_deps));
       
  1405       
       
  1406       item.appendChild(document.createElement('br'));
       
  1407       item.appendChild(bd);
       
  1408     }
  1388   }
  1409   }
  1389   
  1410   
  1390   // var ret = wrapper.cloneNode(true);
  1411   // var ret = wrapper.cloneNode(true);
  1391   // body.removeChild(wrapper);
  1412   // body.removeChild(wrapper);
  1392   // wrapper = false;
  1413   // wrapper = false;
  1416       };
  1437       };
  1417     }
  1438     }
  1418     groupdata[perm['rule_id']]['rules'][i] = perm;
  1439     groupdata[perm['rule_id']]['rules'][i] = perm;
  1419   }
  1440   }
  1420   
  1441   
  1421   console.debug('draw by rule - group data: ', groupdata);
       
  1422   
       
  1423   for ( var i in groupdata )
  1442   for ( var i in groupdata )
  1424   {
  1443   {
  1425     var group = groupdata[i];
  1444     var group = groupdata[i];
  1426     var grp = document.createElement('div');
  1445     var grp = document.createElement('div');
  1427     var head = document.createElement('div');
  1446     var head = document.createElement('div');
  1449       rulediv.innerHTML += rule.perm_name + ': ';
  1468       rulediv.innerHTML += rule.perm_name + ': ';
  1450       var b = document.createElement('strong');
  1469       var b = document.createElement('strong');
  1451       b.appendChild(document.createTextNode(rule.perm_value));
  1470       b.appendChild(document.createTextNode(rule.perm_value));
  1452       rulediv.appendChild(b);
  1471       rulediv.appendChild(b);
  1453       grp.appendChild(rulediv);
  1472       grp.appendChild(rulediv);
       
  1473       
       
  1474       if ( rule.bad_deps.length > 0 )
       
  1475       {
       
  1476         var bd = document.createElement('span');
       
  1477         $(bd).addClass('acl_failed_deps');
       
  1478         var failed_deps = '';
       
  1479         for ( var i = 0; i < rule.bad_deps.length; i++ )
       
  1480         {
       
  1481           if ( i > 0 )
       
  1482             failed_deps += ', ';
       
  1483           failed_deps += data.perms[rule.bad_deps[i]].perm_name;
       
  1484         }
       
  1485         var title = document.createElement('span');
       
  1486         $(title).addClass('title');
       
  1487         title.appendChild(document.createTextNode($lang.get('acl_msg_failed_deps')));
       
  1488         bd.appendChild(title);
       
  1489         bd.appendChild(document.createTextNode(failed_deps));
       
  1490         
       
  1491         rulediv.appendChild(document.createElement('br'));
       
  1492         rulediv.appendChild(bd);
       
  1493       }
  1454     }
  1494     }
  1455     wrapper.appendChild(grp);
  1495     wrapper.appendChild(grp);
  1456   }
  1496   }
  1457   
  1497   
  1458   return wrapper;
  1498   return wrapper;