Subversion Repositories oidplus

Rev

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

Rev 277 Rev 360
Line 33... Line 33...
33
                if ($namespace !== 'guid') return false;
33
                if ($namespace !== 'guid') return false;
34
                return new self($guid);
34
                return new self($guid);
35
        }
35
        }
36
 
36
 
37
        public static function objectTypeTitle() {
37
        public static function objectTypeTitle() {
38
                return "Globally Unique Identifier (GUID)";
38
                return _L('Globally Unique Identifier (GUID)');
39
        }
39
        }
40
 
40
 
41
        public static function objectTypeTitleShort() {
41
        public static function objectTypeTitleShort() {
42
                return "GUID";
42
                return _L('GUID');
43
        }
43
        }
44
 
44
 
45
        public static function ns() {
45
        public static function ns() {
46
                return 'guid';
46
                return 'guid';
47
        }
47
        }
Line 96... Line 96...
96
                if ($this->isRoot()) {
96
                if ($this->isRoot()) {
97
                        $title = OIDplusGuid::objectTypeTitle();
97
                        $title = OIDplusGuid::objectTypeTitle();
98
 
98
 
99
                        $res = OIDplus::db()->query("select * from ###objects where parent = ?", array(self::root()));
99
                        $res = OIDplus::db()->query("select * from ###objects where parent = ?", array(self::root()));
100
                        if ($res->num_rows() > 0) {
100
                        if ($res->num_rows() > 0) {
101
                                $content  = 'Please select a GUID in the tree view at the left to show its contents.';
101
                                $content  = _L('Please select a GUID in the tree view at the left to show its contents.');
102
                        } else {
102
                        } else {
103
                                $content  = 'Currently, no GUID is registered in the system.';
103
                                $content  = _L('Currently, no GUID is registered in the system.');
104
                        }
104
                        }
105
 
105
 
106
                        if (!$this->isLeafNode()) {
106
                        if (!$this->isLeafNode()) {
107
                                if (OIDplus::authUtils()::isAdminLoggedIn()) {
107
                                if (OIDplus::authUtils()::isAdminLoggedIn()) {
108
                                        $content .= '<h2>Manage root objects / categories</h2>';
108
                                        $content .= '<h2>'._L('Manage root objects / categories').'</h2>';
109
                                } else {
109
                                } else {
110
                                        $content .= '<h2>Available objects / categories</h2>';
110
                                        $content .= '<h2>'._L('Available objects / categories').'</h2>';
111
                                }
111
                                }
112
                                $content .= '%%CRUD%%';
112
                                $content .= '%%CRUD%%';
113
                        }
113
                        }
114
                } else {
114
                } else {
115
                        $title = $this->getTitle();
115
                        $title = $this->getTitle();
Line 119... Line 119...
119
                                uuid_info($this->guid);
119
                                uuid_info($this->guid);
120
                                $info = ob_get_contents();
120
                                $info = ob_get_contents();
121
                                ob_end_clean();
121
                                ob_end_clean();
122
                                $info = preg_replace('@:\s*(.+)\n@ismU', ": <code>\\1</code><br>", $info);
122
                                $info = preg_replace('@:\s*(.+)\n@ismU', ": <code>\\1</code><br>", $info);
123
 
123
 
-
 
124
                                $content = '<h2>'._L('Technical information').'</h2>' .
124
                                $content = "<h2>Technical information</h2><p>UUID: <code>" . uuid_canonize($this->guid) . "</code><br>" .
125
                                       '<p>'._L('UUID').': <code>' . uuid_canonize($this->guid) . '</code><br>' .
125
                                       "C++ notation: <code>" . uuid_c_syntax($this->guid) . "</code><br>" .
126
                                       ''._L('C++ notation').': <code>' . uuid_c_syntax($this->guid) . '</code><br>' .
126
                                       "$info";
127
                                       "$info";
127
                                //      "<a href=\"https://misc.daniel-marschall.de/tools/uuid_mac_decoder/interprete_uuid.php?uuid=".urlencode($this->guid)."\">More technical information</a></p>";
128
                                //      "<a href=\"https://misc.daniel-marschall.de/tools/uuid_mac_decoder/interprete_uuid.php?uuid=".urlencode($this->guid)."\">More technical information</a></p>";
128
                        } else {
129
                        } else {
129
                                $content = '';
130
                                $content = '';
130
                        }
131
                        }
131
 
132
 
132
                        $content .= '<h2>Description</h2>%%DESC%%';
133
                        $content .= '<h2>'._L('Description').'</h2>%%DESC%%';
133
 
134
 
134
                        if (!$this->isLeafNode()) {
135
                        if (!$this->isLeafNode()) {
135
                                if ($this->userHasWriteRights()) {
136
                                if ($this->userHasWriteRights()) {
136
                                        $content .= '<h2>Create or change subsequent objects / categories</h2>';
137
                                        $content .= '<h2>'._L('Create or change subsequent objects / categories').'</h2>';
137
                                } else {
138
                                } else {
138
                                        $content .= '<h2>Subsequent objects / categories</h2>';
139
                                        $content .= '<h2>'._L('Subsequent objects / categories').'</h2>';
139
                                }
140
                                }
140
                                $content .= '%%CRUD%%';
141
                                $content .= '%%CRUD%%';
141
                        }
142
                        }
142
                }
143
                }
143
        }
144
        }
Line 163... Line 164...
163
 
164
 
164
        public function getAltIds() {
165
        public function getAltIds() {
165
                if ($this->isRoot()) return array();
166
                if ($this->isRoot()) return array();
166
                if (!$this->isLeafNode()) return array();
167
                if (!$this->isLeafNode()) return array();
167
                $ids = parent::getAltIds();
168
                $ids = parent::getAltIds();
168
                $ids[] = new OIDplusAltId('oid', uuid_to_oid($this->guid), 'OID representation of UUID');
169
                $ids[] = new OIDplusAltId('oid', uuid_to_oid($this->guid), _L('OID representation of UUID'));
169
                return $ids;
170
                return $ids;
170
        }
171
        }
171
}
172
}