From 9e5cda6b7db4bd877ef6cefba6cf83956faf8bee Mon Sep 17 00:00:00 2001
From: linawolf <112@linawolf.de>
Date: Sun, 15 Jan 2023 05:09:45 +0000
Subject: [PATCH] [DOCS] Move adminpanel TypoScript into manual

Resolves: #99542
Releases: main, 11.5
Change-Id: Ifa05cc27825bc4c89dd9b08f66c03505270fd815
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77393
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../Documentation/Configuration/Index.rst     | 138 +++++++++++++++++-
 .../Documentation/Installation/Index.rst      |  59 +++++---
 .../adminpanel/Documentation/Settings.cfg     |   6 +
 3 files changed, 174 insertions(+), 29 deletions(-)

diff --git a/typo3/sysext/adminpanel/Documentation/Configuration/Index.rst b/typo3/sysext/adminpanel/Documentation/Configuration/Index.rst
index 7b6976637454..610d3ae6ba63 100644
--- a/typo3/sysext/adminpanel/Documentation/Configuration/Index.rst
+++ b/typo3/sysext/adminpanel/Documentation/Configuration/Index.rst
@@ -6,10 +6,136 @@
 Configuration
 =============
 
-When the `admPanel` property is set, the Admin Panel displays at the bottom of
-pages on the frontend. See the :ref:`admPanel section of the TypoScript
-Template Reference<t3tsref:setup-config-admpanel>` for more information.
+If the TypoScript property :t3-typoscript:`config.admPanel` is set,
+the admin panel is displayed at the bottom of pages in the frontend for
+logged-in backend users.
 
-You also need to set the User TSconfig to enable the panel for the user. See
-the :ref:`admPanel section of the TSconfig Reference<t3tsconfig:useradmpanel>`
-for more information.
+By default, the Admin Panel is displayed to logged-in admins only. This behaviour
+can be changed by setting :t3-user-tsconfig:`admPanel.enable` for certain
+backend users or groups.
+
+.. contents:: **Available settings**
+   :depth: 2
+   :local:
+
+
+TypoScript settings
+===================
+
+The following settings can be made in the project's TypoScript setup. See also
+:ref:`Using and setting TypoScript <t3tsref:using-and-setting>`.
+
+.. _typoscript-config-admpanel:
+
+config.admPanel
+---------------
+
+..  t3-typoscript:: config.admPanel
+
+    :Type: boolean
+    :Default: false
+
+    If set, the Admin Panel displays at the bottom of pages. This applies only
+    to logged-in admins or backend users with
+    :t3-user-tsconfig:`admPanel.enable` enabled.
+
+    ..  rubric:: Example
+
+    ..  code-block:: typoscript
+        :caption: EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
+
+        config.admPanel = 1
+
+User TSconfig settings
+======================
+
+The options below can be set in the user TSconfig of a backend backend user or
+group. See also
+:ref:`Using and setting user TSconfig <t3tsconfig:setting-user-tsconfig>`.
+
+admPanel.enable
+---------------
+
+..  t3-user-tsconfig:: admPanel.enable
+
+    :Type: array<string, boolean>
+    :Default: For admin users, `admPanel.enable.all = 1` is default.
+
+    Used to enable the various parts of the Admin Panel for users.
+    The keyword :typoscript:`all` can be used to enable all options
+    for the user:
+
+    ..  code-block:: typoscript
+        :caption: EXT:my_sitepackage/Configuration/user.tsconfig
+
+        admPanel.enable.all = 1
+
+    To enable or disable single parts of the Admin Panel, use the following
+    array keys:
+
+    ..  code-block:: typoscript
+        :caption: EXT:my_sitepackage/Configuration/user.tsconfig
+
+        admPanel.enable {
+          cache = 1
+          debug = 1
+          edit = 0
+          info = 1
+          preview = 1
+          publish = 0
+          tsdebug = 1
+        }
+
+admPanel.hide
+-------------
+
+..  t3-user-tsconfig:: admPanel.hide
+
+    :Type: boolean
+
+    If set, the Admin Panel will not be displayed at the bottom of the page.
+    This only has a visual effect.
+
+    ..  code-block:: typoscript
+        :caption: EXT:site_package/Configuration/user.tsconfig
+
+        admPanel.hide = 1
+
+
+admPanel.override
+-----------------
+
+..  t3-user-tsconfig:: admPanel.override
+
+    :Type: object
+
+    Override single Admin Panel settings:
+
+    ..  code-block:: typoscript
+        :caption: EXT:site_package/Configuration/user.tsconfig
+
+        admPanel.override.[modulename].[propertyname]
+
+    You have to activate a module first by setting
+
+    ..  code-block:: typoscript
+        :caption: EXT:site_package/Configuration/user.tsconfig
+
+        admPanel.override.[modulename] = 1
+
+    ..  rubric:: Most common options with example values
+
+    ..  code-block:: typoscript
+        :caption: EXT:site_package/Configuration/user.tsconfig
+
+        admPanel.override {
+            preview {
+                showFluidDebug = 1
+                showHiddenPages = 1
+                showHiddenRecords = 1
+                simulateDate = 1673688448
+                simulateUserGroup = 42
+            }
+            cache.noCache = 1
+            tsdebug.forceTemplateParsing = 1
+        }
diff --git a/typo3/sysext/adminpanel/Documentation/Installation/Index.rst b/typo3/sysext/adminpanel/Documentation/Installation/Index.rst
index 235c3c5a1212..9e653671f97c 100644
--- a/typo3/sysext/adminpanel/Documentation/Installation/Index.rst
+++ b/typo3/sysext/adminpanel/Documentation/Installation/Index.rst
@@ -6,44 +6,57 @@
 Installation
 ============
 
-This extension is part of the TYPO3 Core.
+This extension is part of the TYPO3 Core, but not installed by default.
 
-Installation with composer
+..  contents:: Table of contents
+    :local:
+
+Installation with Composer
 ==========================
 
-Check whether you are already using the extension with::
+Check whether you are already using the extension with:
 
-   composer show | grep adminpanel
+..  code-block:: bash
 
-This should either give you no result or something similar to::
+    composer show | grep adminpanel
 
-   typo3/cms-adminpanel v10.4.9
+This should either give you no result or something similar to:
 
-If it is not yet installed, use the ``composer require`` command to install
-the extension::
+..  code-block:: none
 
-   composer require typo3/cms-adminpanel
+    typo3/cms-adminpanel v11.5.9
 
-The given version depends on the version of the TYPO3 Core you are using.
+If it is not installed yet, use the ``composer require`` command to install
+the extension:
+
+..  code-block:: bash
 
-Once installed, you will need to activate the extension.
+    composer require typo3/cms-adminpanel
 
+The given version depends on the version of the TYPO3 Core you are using.
 
-Installation without composer
+Installation without Composer
 =============================
 
-In an installation without composer, the extension is already shipped. You
-just have to activate it.
+In an installation without Composer, the extension is already shipped but might
+not be activated yet. Activate it as follows:
+
+#.  In the backend, navigate to the :guilabel:`Admin Tools > Extensions`
+    module.
+#.  Click the :guilabel:`Activate` icon for the Admin Panel extension.
+
+..  figure:: ../Images/InstallActivate.png
+    :class: with-border
+    :alt: Extension manager showing Admin Panel extension
 
+    Extension manager showing Admin Panel extension
 
-Activate the extension
-======================
-#. In the backend, navigate to the :guilabel:`Admin Tools > Extensions`
-   module.
-#. Click the **Activate** icon for the Admin Panel extension.
+Next steps
+==========
 
-.. figure:: ../Images/InstallActivate.png
-   :class: with-border
-   :alt: Extension manager showing Admin Panel extension
+Configure the Admin Panel to be displayed to logged-in backend admins the
+TypoScript configuration :t3-typoscript:`config.admPanel = 1 <config.admPanel>`.
 
-   Extension manager showing Admin Panel extension
+By default the admin panel is displayed to logged-in admins only. This behaviour
+can be changed by setting :t3-user-tsconfig:`admPanel.enable` for certain
+backend users or groups.
diff --git a/typo3/sysext/adminpanel/Documentation/Settings.cfg b/typo3/sysext/adminpanel/Documentation/Settings.cfg
index 96243656b3a1..a6d394ba5f08 100644
--- a/typo3/sysext/adminpanel/Documentation/Settings.cfg
+++ b/typo3/sysext/adminpanel/Documentation/Settings.cfg
@@ -24,6 +24,12 @@ project_discussions  =
 
 use_opensearch       =
 
+
+[sphinx_object_types_to_add]
+
+t3-typoscript = t3-typoscript // t3-typoscript // TypoScript
+t3-user-tsconfig = t3-user-tsconfig // t3-user-tsconfig // User TSconfig
+
 [intersphinx_mapping]
 
 # Official TYPO3 manuals
-- 
GitLab