Пример #1
0
 function get_group_children($var_1 = null, $var_2 = null, $var_3 = null)
 {
     global $_CB_database;
     if (!$var_3) {
         $var_3 = 'NO_RECURSE';
     }
     if (checkJversion() == 2) {
         $query = 'SELECT g1.' . $_CB_database->NameQuote('id') . "\n FROM " . $_CB_database->NameQuote('#__usergroups') . " AS g1";
         if ($var_3 == 'RECURSE') {
             $query .= "\n LEFT JOIN " . $_CB_database->NameQuote('#__usergroups') . " AS g2" . ' ON g2.' . $_CB_database->NameQuote('lft') . ' < g1.' . $_CB_database->NameQuote('lft') . ' AND g2.' . $_CB_database->NameQuote('rgt') . ' > g1.' . $_CB_database->NameQuote('rgt') . "\n WHERE g2." . $_CB_database->NameQuote('id') . " = " . (int) $var_1;
         } else {
             $query .= "\n WHERE g1." . $_CB_database->NameQuote('parent_id') . " = " . (int) $var_1;
         }
         $query .= "\n ORDER BY g1." . $_CB_database->NameQuote('title');
         $_CB_database->setQuery($query);
         $return = $_CB_database->loadResultArray();
     } else {
         if (!$var_2) {
             $var_2 = 'ARO';
         }
         $return = $this->_acl->get_group_children($var_1, $var_2, $var_3);
     }
     return $return;
 }