public static function edit()
 {
     $id = JCommentsInput::getVar('cid', 0);
     if (is_array($id)) {
         $id = $id[0];
     }
     $db = JCommentsFactory::getDBO();
     $row = new JCommentsTableCustomBBCode($db);
     if ($id) {
         $row->load($id);
     }
     require_once JCOMMENTS_HELPERS . '/user.php';
     $groups = JCommentsUserHelper::getUserGroups();
     $assignedGroups = explode(",", $row->button_acl);
     $lists['groups'] = array();
     for ($i = 0, $n = count($groups); $i < $n; $i++) {
         $groups[$i]->enabled = (int) in_array($groups[$i]->id, $assignedGroups);
     }
     $lists['groups'] = $groups;
     HTML_JCommentsACustomBBCodes::edit($row, $lists);
 }
 function edit()
 {
     $id = JCommentsInput::getVar('cid', 0);
     if (is_array($id)) {
         $id = $id[0];
     }
     $db =& JCommentsFactory::getDBO();
     $row = new JCommentsCustomBBCodeDB($db);
     if ($id) {
         $row->load($id);
     }
     $groups = JCommentsAdmin::getAllGroups();
     $exclude = JCommentsAdmin::getHigherGroups();
     if (count($exclude)) {
         // remove users 'above' me
         $i = 0;
         while ($i < count($groups)) {
             if (in_array($groups[$i]->group_id, $exclude)) {
                 array_splice($groups, $i, 1);
             } else {
                 $i++;
             }
         }
     }
     $userGroups = explode(",", $row->button_acl);
     $lists['groups'] = array();
     foreach ($groups as $group) {
         $lists['groups'][$group->text] = (int) in_array($group->text, $userGroups);
     }
     HTML_JCommentsACustomBBCodes::edit($row, $lists);
 }