summaryrefslogtreecommitdiffstats
path: root/lib/api/kolab_group_types_actions.php
blob: 8789a57b63bdb483ab681e72c45295a610fb9571 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php

/**
 *
 */
class kolab_group_types_actions extends kolab_api_service
{
    public function capabilities($domain)
    {
        return array(
            'list' => 'r',
        );
    }

    public function group_types_list($get, $post)
    {
        $result = query("SELECT * FROM group_types");
        $group_types = Array();

        while ($row = mysql_fetch_assoc($result)) {
            $group_types[$row['id']] = array();

            foreach ($row as $key => $value) {
                if ($key != "id") {
                    if ($key == "attributes") {
                        $group_types[$row['id']][$key] = json_decode(unserialize($value), true);
                    }
                    else {
                        $group_types[$row['id']][$key] = $value;
                    }
                }
            }
        }

        return $group_types;
    }
}