includes/clientside/static/acl.js
changeset 749 ea3045a3bcbd
parent 730 b09cb1dab505
child 763 a03406756fdd
--- a/includes/clientside/static/acl.js	Thu Nov 20 22:59:11 2008 -0500
+++ b/includes/clientside/static/acl.js	Thu Nov 20 22:59:25 2008 -0500
@@ -1385,6 +1385,27 @@
       sm.appendChild(editlink);
       sm.innerHTML += ']';
     }
+    
+    if ( perm.bad_deps.length > 0 )
+    {
+      var bd = document.createElement('span');
+      $(bd).addClass('acl_failed_deps');
+      var failed_deps = '';
+      for ( var i = 0; i < perm.bad_deps.length; i++ )
+      {
+        if ( i > 0 )
+          failed_deps += ', ';
+        failed_deps += data.perms[perm.bad_deps[i]].perm_name;
+      }
+      var title = document.createElement('span');
+      $(title).addClass('title');
+      title.appendChild(document.createTextNode($lang.get('acl_msg_failed_deps')));
+      bd.appendChild(title);
+      bd.appendChild(document.createTextNode(failed_deps));
+      
+      item.appendChild(document.createElement('br'));
+      item.appendChild(bd);
+    }
   }
   
   // var ret = wrapper.cloneNode(true);
@@ -1418,8 +1439,6 @@
     groupdata[perm['rule_id']]['rules'][i] = perm;
   }
   
-  console.debug('draw by rule - group data: ', groupdata);
-  
   for ( var i in groupdata )
   {
     var group = groupdata[i];
@@ -1451,6 +1470,27 @@
       b.appendChild(document.createTextNode(rule.perm_value));
       rulediv.appendChild(b);
       grp.appendChild(rulediv);
+      
+      if ( rule.bad_deps.length > 0 )
+      {
+        var bd = document.createElement('span');
+        $(bd).addClass('acl_failed_deps');
+        var failed_deps = '';
+        for ( var i = 0; i < rule.bad_deps.length; i++ )
+        {
+          if ( i > 0 )
+            failed_deps += ', ';
+          failed_deps += data.perms[rule.bad_deps[i]].perm_name;
+        }
+        var title = document.createElement('span');
+        $(title).addClass('title');
+        title.appendChild(document.createTextNode($lang.get('acl_msg_failed_deps')));
+        bd.appendChild(title);
+        bd.appendChild(document.createTextNode(failed_deps));
+        
+        rulediv.appendChild(document.createElement('br'));
+        rulediv.appendChild(bd);
+      }
     }
     wrapper.appendChild(grp);
   }