From 5f14cb4d689464029ef58fa1d2db945045545563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Sun, 3 Oct 2021 23:42:41 +0300 Subject: [PATCH 1/4] Update TwigExtensions.php --- src/bb-library/Box/TwigExtensions.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/bb-library/Box/TwigExtensions.php b/src/bb-library/Box/TwigExtensions.php index 610033e32..b65900529 100644 --- a/src/bb-library/Box/TwigExtensions.php +++ b/src/bb-library/Box/TwigExtensions.php @@ -67,6 +67,8 @@ class Box_TwigExtensions extends Twig\Extension\AbstractExtension implements \Bo 'money_without_currency' => new Twig\TwigFilter('money_without_currency','twig_money_without_currency', array('needs_environment' => true, 'is_safe' => array('html'))), 'money_convert' => new Twig\TwigFilter('money_convert', 'twig_money_convert', array('needs_environment' => true, 'is_safe' => array('html'))), 'money_convert_without_currency' => new Twig\TwigFilter('money_convert_without_currency', array('needs_environment' => true, 'is_safe' => array('html'))), + + 'phpinfo' => new Twig\TwigFilter('phpinfo','twig_phpinfo'), ); } @@ -292,3 +294,20 @@ function twig_bbmd_filter(Twig\Environment $env, $value) $value = twig_markdown_filter($env, $value); return $value; } + +/** + * Returns phpinfo() without it's stylings; + * Solution from https://www.php.net/manual/en/function.phpinfo.php#87287 + */ +function twig_phpinfo($email, $size = 20) +{ + ob_start(); + phpinfo(); + $pinfo = ob_get_contents(); + ob_end_clean(); + + // the name attribute "module_Zend Optimizer" of an anker-tag is not xhtml valide, so replace it with "module_Zend_Optimizer" + $pinfo = (str_replace("module_Zend Optimizer", "module_Zend_Optimizer", preg_replace('%^.*(.*).*$%ms', '$1', $pinfo))); + + return $pinfo; +} From 00197ec8d770ec7c0e14ee03bcf3a7a167914279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Sun, 3 Oct 2021 23:43:30 +0300 Subject: [PATCH 2/4] Update mod_system_settings.phtml --- .../html_admin/mod_system_settings.phtml | 92 ++++++++++++++++++- 1 file changed, 87 insertions(+), 5 deletions(-) diff --git a/src/bb-modules/System/html_admin/mod_system_settings.phtml b/src/bb-modules/System/html_admin/mod_system_settings.phtml index 6eee8dd86..16b9f0cca 100644 --- a/src/bb-modules/System/html_admin/mod_system_settings.phtml +++ b/src/bb-modules/System/html_admin/mod_system_settings.phtml @@ -11,6 +11,79 @@ {% endblock %} +{% block head %} + + +{{ mf.bb_editor('.bb-textarea') }} +{% endblock %} + {% block content %} {% set new_params = admin.extension_config_get({"ext":"mod_system"}) %} @@ -23,6 +96,7 @@
  • {% trans 'FTP layer' %}
  • {% trans 'Countries' %}
  • {% trans 'Cache' %}
  • +
  • {% trans 'PHP Info' %}
  • @@ -466,20 +540,28 @@ ZW=Zimbabwe

    {% trans 'Cache control' %}

    -
    -
    +
    +
    -
    +
    +
    + + +
    +
    +

    {% trans 'PHP Info' %}

    +
    +
    + {{ x|phpinfo|raw }} +
    {% endblock %} - -{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %} From 826ab7603bbc431dda9d8fea0cc32ccb3bdae00a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Sun, 3 Oct 2021 23:45:18 +0300 Subject: [PATCH 3/4] Update TwigExtensions.php --- src/bb-library/Box/TwigExtensions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bb-library/Box/TwigExtensions.php b/src/bb-library/Box/TwigExtensions.php index b65900529..452220e2a 100644 --- a/src/bb-library/Box/TwigExtensions.php +++ b/src/bb-library/Box/TwigExtensions.php @@ -299,7 +299,7 @@ function twig_bbmd_filter(Twig\Environment $env, $value) * Returns phpinfo() without it's stylings; * Solution from https://www.php.net/manual/en/function.phpinfo.php#87287 */ -function twig_phpinfo($email, $size = 20) +function twig_phpinfo() { ob_start(); phpinfo(); From 2683842ea2e0e1138e11415ca8156c439e867bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Sun, 3 Oct 2021 23:50:14 +0300 Subject: [PATCH 4/4] Update mod_system_settings.phtml --- src/bb-modules/System/html_admin/mod_system_settings.phtml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/bb-modules/System/html_admin/mod_system_settings.phtml b/src/bb-modules/System/html_admin/mod_system_settings.phtml index 16b9f0cca..d8db563e0 100644 --- a/src/bb-modules/System/html_admin/mod_system_settings.phtml +++ b/src/bb-modules/System/html_admin/mod_system_settings.phtml @@ -553,10 +553,7 @@ ZW=Zimbabwe
    -
    -

    {% trans 'PHP Info' %}

    -
    -
    +
    {{ x|phpinfo|raw }}