Subversion Repositories oidplus

Rev

Rev 277 | Rev 328 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 277 Rev 281
Line 22... Line 22...
22
        public static function nonjs_menu() {
22
        public static function nonjs_menu() {
23
                $json = array();
23
                $json = array();
24
 
24
 
25
                $static_node_id = isset($_REQUEST['goto']) ? $_REQUEST['goto'] : 'oidplus:system';
25
                $static_node_id = isset($_REQUEST['goto']) ? $_REQUEST['goto'] : 'oidplus:system';
26
 
26
 
27
                foreach (OIDplus::getPagePlugins('public') as $plugin) {
27
                foreach (OIDplus::getPagePlugins() as $plugin) {
-
 
28
                        if (is_subclass_of($plugin, OIDplusPagePluginPublic::class)) {
28
                        $plugin->tree($json, null, true, $static_node_id);
29
                                $plugin->tree($json, null, true, $static_node_id);
29
                }
30
                        }
-
 
31
                }
30
 
32
 
31
                foreach ($json as $x) {
33
                foreach ($json as $x) {
32
                        if ($static_node_id == $x['id']) echo '<b>';
34
                        if ($static_node_id == $x['id']) echo '<b>';
33
                        if (isset($x['indent'])) echo str_repeat('&nbsp', $x['indent']*5);
35
                        if (isset($x['indent'])) echo str_repeat('&nbsp', $x['indent']*5);
34
                        echo '<a href="?goto='.urlencode($x['id']).'">';
36
                        echo '<a href="?goto='.urlencode($x['id']).'">';
Line 43... Line 45...
43
        // req_goto comes from the user (GET argument)
45
        // req_goto comes from the user (GET argument)
44
        public static function json_tree($req_id, $req_goto) {
46
        public static function json_tree($req_id, $req_goto) {
45
                $json = array();
47
                $json = array();
46
 
48
 
47
                if (!isset($req_id) || ($req_id == '#')) {
49
                if (!isset($req_id) || ($req_id == '#')) {
48
                        // 'ra' and 'admin' pages will not be iterated, because they usually have no tree icon, or an icon underneath the login section
-
 
49
                        foreach (OIDplus::getPagePlugins('public') as $plugin) {
50
                        foreach (OIDplus::getPagePlugins() as $plugin) {
-
 
51
                                if (is_subclass_of($plugin, OIDplusPagePluginPublic::class)) {
50
                                $plugin->tree($json, null, false, $req_goto);
52
                                        $plugin->tree($json, null, false, $req_goto);
51
                        }
53
                                }
-
 
54
                        }
52
                } else {
55
                } else {
53
                        $json = self::tree_populate($req_id);
56
                        $json = self::tree_populate($req_id);
54
                }
57
                }
55
 
58
 
56
                return json_encode($json);
59
                return json_encode($json);
Line 62... Line 65...
62
                $parentObj = OIDplusObject::parse($parent);
65
                $parentObj = OIDplusObject::parse($parent);
63
 
66
 
64
                @list($namespace, $oid) = explode(':', $parent, 2);
67
                @list($namespace, $oid) = explode(':', $parent, 2);
65
                if ($namespace == 'oid') $oid = substr($oid, 1); // führenden Punkt entfernen
68
                if ($namespace == 'oid') $oid = substr($oid, 1); // führenden Punkt entfernen
66
 
69
 
67
                if (!is_null($goto_path)) array_shift($goto_path);
70
                if (is_array($goto_path)) array_shift($goto_path);
68
 
71
               
69
                $confidential_oids = array();
72
                $confidential_oids = array();
70
 
73
 
71
                $res = OIDplus::db()->query("select id from ###objects where confidential = '1'");
74
                $res = OIDplus::db()->query("select id from ###objects where confidential = '1'");
72
                while ($row = $res->fetch_array()) {
75
                while ($row = $res->fetch_array()) {
Line 96... Line 99...
96
 
99
 
97
                        // Icon bestimmen
100
                        // Icon bestimmen
98
                        $child['icon'] = $obj->getIcon($row);
101
                        $child['icon'] = $obj->getIcon($row);
99
 
102
 
100
                        // Feststellen, ob es weitere Unter-OIDs gibt
103
                        // Feststellen, ob es weitere Unter-OIDs gibt
-
 
104
                        if ($goto_path === true) {
-
 
105
                                $child['children'] = self::tree_populate($row['id'], $goto_path);
-
 
106
                                $child['state'] = array("opened" => true);
101
                        if (!is_null($goto_path) && (count($goto_path) > 0) && ($goto_path[0] === $row['id'])) {
107
                        } else if (!is_null($goto_path) && (count($goto_path) > 0) && ($goto_path[0] === $row['id'])) {
102
                                $child['children'] = self::tree_populate($row['id'], $goto_path);
108
                                $child['children'] = self::tree_populate($row['id'], $goto_path);
103
                                $child['state'] = array("opened" => true);
109
                                $child['state'] = array("opened" => true);
104
                        } else {
110
                        } else {
105
                                $obj_children = $obj->getChildren();
111
                                $obj_children = $obj->getChildren();
106
 
112