Subversion Repositories oidplus

Rev

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

Rev 1116 Rev 1130
Line 83... Line 83...
83
         * @param bool $useJs
83
         * @param bool $useJs
84
         * @return string
84
         * @return string
85
         * @throws OIDplusConfigInitializationException
85
         * @throws OIDplusConfigInitializationException
86
         * @throws OIDplusException
86
         * @throws OIDplusException
87
         */
87
         */
88
        public static function getLanguageBox(string $goto, bool $useJs) {
88
        public static function getLanguageBox(string $goto, bool $useJs): string {
89
                $out = '<div id="languageBox">';
89
                $out = '<div id="languageBox">';
90
                $langbox_entries = array();
90
                $langbox_entries = array();
91
                $non_default_languages = 0;
91
                $non_default_languages = 0;
92
                foreach (OIDplus::getAllPluginManifests('language') as $pluginManifest) {
92
                foreach (OIDplus::getAllPluginManifests('language') as $pluginManifest) {
93
                        $flag = $pluginManifest->getLanguageFlag();
93
                        $flag = $pluginManifest->getLanguageFlag();
Line 147... Line 147...
147
 
147
 
148
        /**
148
        /**
149
         * @param \Throwable $exception
149
         * @param \Throwable $exception
150
         * @return string
150
         * @return string
151
         */
151
         */
152
        private static function getExceptionTechInfo(\Throwable $exception) {
152
        private static function getExceptionTechInfo(\Throwable $exception): string {
153
                $out  = '<p><b>'.htmlentities(_L('Technical information about the problem')).':</b></p>';
153
                $out  = '<p><b>'.htmlentities(_L('Technical information about the problem')).':</b></p>';
154
                $out .= '<pre>';
154
                $out .= '<pre>';
155
                $out .= get_class($exception)."\n";
155
                $out .= get_class($exception)."\n";
156
                $out .= _L('at file %1 (line %2)',$exception->getFile(),"".$exception->getLine())."\n\n";
156
                $out .= _L('at file %1 (line %2)',$exception->getFile(),"".$exception->getLine())."\n\n";
157
                $out .= _L('Stacktrace').":\n";
157
                $out .= _L('Stacktrace').":\n";
Line 161... Line 161...
161
        }
161
        }
162
 
162
 
163
        /**
163
        /**
164
         * @return string
164
         * @return string
165
         */
165
         */
166
        public function tabBarStart() {
166
        public function tabBarStart(): string {
167
                return '<ul class="nav nav-tabs" id="myTab" role="tablist">';
167
                return '<ul class="nav nav-tabs" id="myTab" role="tablist">';
168
        }
168
        }
169
 
169
 
170
        /**
170
        /**
171
         * @return string
171
         * @return string
172
         */
172
         */
173
        public function tabBarEnd() {
173
        public function tabBarEnd(): string {
174
                return '</ul>';
174
                return '</ul>';
175
        }
175
        }
176
 
176
 
177
        /**
177
        /**
178
         * @param string $id
178
         * @param string $id
179
         * @param string $title
179
         * @param string $title
180
         * @param bool $active
180
         * @param bool $active
181
         * @return string
181
         * @return string
182
         */
182
         */
183
        public function tabBarElement(string $id, string $title, bool $active) {
183
        public function tabBarElement(string $id, string $title, bool $active): string {
184
                // data-bs-toggle is for Bootstrap 5
184
                // data-bs-toggle is for Bootstrap 5
185
                // data-toggle is for Bootstrap 4 (InternetExplorer compatibility)
185
                // data-toggle is for Bootstrap 4 (InternetExplorer compatibility)
186
                return '<li class="nav-item"><a class="nav-link'.($active ? ' active' : '').'" id="'.$id.'-tab" data-bs-toggle="tab" data-toggle="tab" href="#'.$id.'" role="tab" aria-controls="'.$id.'" aria-selected="'.($active ? 'true' : 'false').'">'.$title.'</a></li>';
186
                return '<li class="nav-item"><a class="nav-link'.($active ? ' active' : '').'" id="'.$id.'-tab" data-bs-toggle="tab" data-toggle="tab" href="#'.$id.'" role="tab" aria-controls="'.$id.'" aria-selected="'.($active ? 'true' : 'false').'">'.$title.'</a></li>';
187
        }
187
        }
188
 
188
 
189
        /**
189
        /**
190
         * @return string
190
         * @return string
191
         */
191
         */
192
        public function tabContentStart() {
192
        public function tabContentStart(): string {
193
                return '<div class="tab-content" id="myTabContent">';
193
                return '<div class="tab-content" id="myTabContent">';
194
        }
194
        }
195
 
195
 
196
        /**
196
        /**
197
         * @return string
197
         * @return string
198
         */
198
         */
199
        public function tabContentEnd() {
199
        public function tabContentEnd(): string {
200
                return '</div>';
200
                return '</div>';
201
        }
201
        }
202
 
202
 
203
        /**
203
        /**
204
         * @param string $id
204
         * @param string $id
205
         * @param string $content
205
         * @param string $content
206
         * @param bool $active
206
         * @param bool $active
207
         * @return string
207
         * @return string
208
         */
208
         */
209
        public function tabContentPage(string $id, string $content, bool $active) {
209
        public function tabContentPage(string $id, string $content, bool $active): string {
210
                return '<div class="tab-pane fade'.($active ? ' show active' : '').'" id="'.$id.'" role="tabpanel" aria-labelledby="'.$id.'-tab">'.$content.'</div>';
210
                return '<div class="tab-pane fade'.($active ? ' show active' : '').'" id="'.$id.'" role="tabpanel" aria-labelledby="'.$id.'-tab">'.$content.'</div>';
211
        }
211
        }
212
 
212
 
213
        /**
213
        /**
214
         * @param string $systemtitle
214
         * @param string $systemtitle
215
         * @param string $pagetitle
215
         * @param string $pagetitle
216
         * @return string
216
         * @return string
217
         */
217
         */
218
        public function combine_systemtitle_and_pagetitle(string $systemtitle, string $pagetitle) {
218
        public function combine_systemtitle_and_pagetitle(string $systemtitle, string $pagetitle): string {
219
                // Please also change the function in oidplus_base.js
219
                // Please also change the function in oidplus_base.js
220
                if ($systemtitle == $pagetitle) {
220
                if ($systemtitle == $pagetitle) {
221
                        return $systemtitle;
221
                        return $systemtitle;
222
                } else {
222
                } else {
223
                        return $pagetitle . ' - ' . $systemtitle;
223
                        return $pagetitle . ' - ' . $systemtitle;
Line 264... Line 264...
264
         * @param string $static_node_id
264
         * @param string $static_node_id
265
         * @return string
265
         * @return string
266
         * @throws OIDplusConfigInitializationException
266
         * @throws OIDplusConfigInitializationException
267
         * @throws OIDplusException
267
         * @throws OIDplusException
268
         */
268
         */
269
        public function showMainPage(string $page_title_1, string $page_title_2, string $static_icon, string $static_content, array $extra_head_tags=array(), string $static_node_id='') {
269
        public function showMainPage(string $page_title_1, string $page_title_2, string $static_icon, string $static_content, array $extra_head_tags=array(), string $static_node_id=''): string {
270
                $head_elems = $this->getCommonHeadElems($page_title_1);
270
                $head_elems = $this->getCommonHeadElems($page_title_1);
271
                $head_elems = array_merge($head_elems, $extra_head_tags);
271
                $head_elems = array_merge($head_elems, $extra_head_tags);
272
 
272
 
273
                $plugins = OIDplus::getAllPlugins();
273
                $plugins = OIDplus::getAllPlugins();
274
                foreach ($plugins as $plugin) {
274
                foreach ($plugins as $plugin) {
Line 358... Line 358...
358
         * @param string[] $extra_head_tags
358
         * @param string[] $extra_head_tags
359
         * @return string
359
         * @return string
360
         * @throws OIDplusConfigInitializationException
360
         * @throws OIDplusConfigInitializationException
361
         * @throws OIDplusException
361
         * @throws OIDplusException
362
         */
362
         */
363
        public function showSimplePage(string $page_title_1, string $page_title_2, string $static_icon, string $static_content, array $extra_head_tags=array()) {
363
        public function showSimplePage(string $page_title_1, string $page_title_2, string $static_icon, string $static_content, array $extra_head_tags=array()): string {
364
                $head_elems = $this->getCommonHeadElems($page_title_1);
364
                $head_elems = $this->getCommonHeadElems($page_title_1);
365
                $head_elems = array_merge($head_elems, $extra_head_tags);
365
                $head_elems = array_merge($head_elems, $extra_head_tags);
366
 
366
 
367
                # ---
367
                # ---
368
 
368