Subversion Repositories oidplus

Rev

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

Rev 362 Rev 366
Line 73... Line 73...
73
                                $class = 'lng_flag';
73
                                $class = 'lng_flag';
74
                        } else {
74
                        } else {
75
                                $class = 'lng_flag picture_ghost';
75
                                $class = 'lng_flag picture_ghost';
76
                        }
76
                        }
77
                        $add = (!is_null($goto)) ? '&goto='.urlencode($goto) : '';
77
                        $add = (!is_null($goto)) ? '&goto='.urlencode($goto) : '';
78
                        $langbox_entries[] = '<a '.($useJs ? 'onclick="setLanguage(\''.$code.'\'); return false" )' : '').'href="?lang='.$code.$add.'"><img src="'.OIDplus::getSystemUrl(true).'/plugins/language/'.$code.'/'.$flag.'" alt="'.$pluginManifest->getName().'" title="'.$pluginManifest->getName().'" class="'.$class.'" id="lng_flag_'.$code.'" height="20"></a> ';
78
                        $langbox_entries[] = '<a '.($useJs ? 'onclick="setLanguage(\''.$code.'\'); return false" ' : '').'href="?lang='.$code.$add.'"><img src="'.OIDplus::getSystemUrl(true).'/plugins/language/'.$code.'/'.$flag.'" alt="'.$pluginManifest->getName().'" title="'.$pluginManifest->getName().'" class="'.$class.'" id="lng_flag_'.$code.'" height="20"></a> ';
79
                }
79
                }
80
                if ($non_default_languages > 0) {
80
                if ($non_default_languages > 0) {
81
                        echo implode("\n\t\t",$langbox_entries);
81
                        echo implode("\n\t\t",$langbox_entries);
82
                }
82
                }
83
                echo '</div>';
83
                echo '</div>';
84
        }
84
        }
-
 
85
 
-
 
86
        public static function html_exception_handler($exception) {
-
 
87
                if ($exception instanceof OIDplusConfigInitializationException) {
-
 
88
                        echo '<h1>'._L('OIDplus initialization error').'</h1>';
-
 
89
                        echo '<p>'.htmlentities($exception->getMessage(), ENT_SUBSTITUTE).'</p>';
-
 
90
                        echo '<p>'._L('Please check the file %1','<b>userdata/baseconfig/config.inc.php</b>');
-
 
91
                        if (is_dir(__DIR__ . '/../../setup')) {
-
 
92
                                echo ' '._L('or run <a href="%1">setup</a> again',OIDplus::getSystemUrl().'setup/');
-
 
93
                        }
-
 
94
                        echo '</p>';
-
 
95
                } else {
-
 
96
                        echo '<h1>'._L('OIDplus error').'</h1>';
-
 
97
                        // ENT_SUBSTITUTE because ODBC drivers might return ANSI instead of UTF-8 stuff
-
 
98
                        echo '<p>'.htmlentities($exception->getMessage(), ENT_SUBSTITUTE).'</p>';
-
 
99
                        echo '<p><b>'._L('Technical information about the problem').':</b></p>';
-
 
100
                        echo '<pre>';
-
 
101
                        echo get_class($exception)."\n";
-
 
102
                        var_dump($exception->getFile());
-
 
103
                        var_dump($exception->getLine());
-
 
104
                        echo _L('at file %1 (line %2)',$exception->getFile(),"".$exception->getLine())."\n";
-
 
105
                        echo _L('Stacktrace').":\n";
-
 
106
                        echo $exception->getTraceAsString();
-
 
107
                        echo '</pre>';
-
 
108
                }
-
 
109
        }
85
}
110
}
86
111