summaryrefslogtreecommitdiffstats
path: root/lib/api/kolab_group_types_actions.php
blob: f72791b2da043df6fe120a3ee73953bafd6aa09a (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
38
<?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;

        }
    }

?>