]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Renderer.php
Merge pull request #11015 from MrPetovan/task/10979-frio-time-tooltip
[friendica.git] / src / Core / Renderer.php
index ad1717ae83f422495425179620632d673ed867b7..608c707434ca539c295b68425c943c99c757da88 100644 (file)
@@ -23,7 +23,7 @@ namespace Friendica\Core;
 
 use Exception;
 use Friendica\DI;
-use Friendica\Network\HTTPException\InternalServerErrorException;
+use Friendica\Network\HTTPException\ServiceUnavailableException;
 use Friendica\Render\TemplateEngine;
 
 /**
@@ -69,7 +69,7 @@ class Renderer
         * @param string $template
         * @param array  $vars
         * @return string
-        * @throws InternalServerErrorException
+        * @throws ServiceUnavailableException
         */
        public static function replaceMacros(string $template, array $vars = [])
        {
@@ -84,10 +84,10 @@ class Renderer
                        $output = $t->replaceMacros($template, $vars);
                } catch (Exception $e) {
                        DI::logger()->critical($e->getMessage(), ['template' => $template, 'vars' => $vars]);
-                       $message = is_site_admin() ?
+                       $message = DI::app()->isSiteAdmin() ?
                                $e->getMessage() :
                                DI::l10n()->t('Friendica can\'t display this page at the moment, please contact the administrator.');
-                       throw new InternalServerErrorException($message);
+                       throw new ServiceUnavailableException($message);
                }
 
                DI::profiler()->stopRecording();
@@ -102,7 +102,7 @@ class Renderer
         * @param string $subDir Subdirectory (Optional)
         *
         * @return string template.
-        * @throws InternalServerErrorException
+        * @throws ServiceUnavailableException
         */
        public static function getMarkupTemplate($file, $subDir = '')
        {
@@ -113,10 +113,10 @@ class Renderer
                        $template = $t->getTemplateFile($file, $subDir);
                } catch (Exception $e) {
                        DI::logger()->critical($e->getMessage(), ['file' => $file, 'subDir' => $subDir]);
-                       $message = is_site_admin() ?
+                       $message = DI::app()->isSiteAdmin() ?
                                $e->getMessage() :
                                DI::l10n()->t('Friendica can\'t display this page at the moment, please contact the administrator.');
-                       throw new InternalServerErrorException($message);
+                       throw new ServiceUnavailableException($message);
                }
 
                DI::profiler()->stopRecording();
@@ -128,7 +128,7 @@ class Renderer
         * Register template engine class
         *
         * @param string $class
-        * @throws InternalServerErrorException
+        * @throws ServiceUnavailableException
         */
        public static function registerTemplateEngine($class)
        {
@@ -140,10 +140,10 @@ class Renderer
                } else {
                        $admin_message = DI::l10n()->t('template engine cannot be registered without a name.');
                        DI::logger()->critical($admin_message, ['class' => $class]);
-                       $message = is_site_admin() ?
+                       $message = DI::app()->isSiteAdmin() ?
                                $admin_message :
                                DI::l10n()->t('Friendica can\'t display this page at the moment, please contact the administrator.');
-                       throw new InternalServerErrorException($message);
+                       throw new ServiceUnavailableException($message);
                }
        }
 
@@ -154,7 +154,7 @@ class Renderer
         * or default
         *
         * @return TemplateEngine Template Engine instance
-        * @throws InternalServerErrorException
+        * @throws ServiceUnavailableException
         */
        public static function getTemplateEngine()
        {
@@ -174,10 +174,10 @@ class Renderer
 
                $admin_message = DI::l10n()->t('template engine is not registered!');
                DI::logger()->critical($admin_message, ['template_engine' => $template_engine]);
-               $message = is_site_admin() ?
+               $message = DI::app()->isSiteAdmin() ?
                        $admin_message :
                        DI::l10n()->t('Friendica can\'t display this page at the moment, please contact the administrator.');
-               throw new InternalServerErrorException($message);
+               throw new ServiceUnavailableException($message);
        }
 
        /**