[TASK] Show felogin title in page module
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 19 Sep 2012 18:12:48 +0000 (20:12 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Thu, 20 Sep 2012 18:48:11 +0000 (20:48 +0200)
Currently, the content element in page module is empty.
At least the title of the plugin should be displayed

Change-Id: I2663295139c5c2743351eb256f622660d19d1bed
Resolves: #41076
Releases: 6.0
Reviewed-on: http://review.typo3.org/14739
Reviewed-by: Mattias Nilsson
Tested-by: Mattias Nilsson
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/felogin/Classes/Hooks/CmsLayout.php [new file with mode: 0644]
typo3/sysext/felogin/ext_localconf.php

diff --git a/typo3/sysext/felogin/Classes/Hooks/CmsLayout.php b/typo3/sysext/felogin/Classes/Hooks/CmsLayout.php
new file mode 100644 (file)
index 0000000..a9f4a53
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+namespace TYPO3\CMS\Felogin\Hooks;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Georg Ringer <typo3@ringerge.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Hook to display verbose information about the felogin plugin
+ *
+ * @package TYPO3
+ * @subpackage felogin
+ */
+class CmsLayout implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface {
+
+       /**
+        * Preprocesses the preview rendering of a content element.
+        *
+        * @param \TYPO3\CMS\Backend\View\PageLayoutView $parentObject Calling parent object
+        * @param boolean $drawItem Whether to draw the item using the default functionalities
+        * @param string $headerContent Header content
+        * @param string $itemContent Item content
+        * @param array $row Record row of tt_content
+        * @return void
+        */
+       public function preProcess(\TYPO3\CMS\Backend\View\PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row) {
+               if ($row['CType'] === 'login') {
+                       $drawItem = FALSE;
+                       $itemContent .= '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang_db_new_content_el.xml:forms_login_title', TRUE) . '</strong>';
+               }
+       }
+
+}
+
+?>
\ No newline at end of file
index e802af3..18dc412 100644 (file)
@@ -42,4 +42,10 @@ if (\TYPO3\CMS\Core\Extension\ExtensionManager::isLoaded('kb_md5fepw') && TYPO3_
        $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['loginFormOnSubmitFuncs'][] = 'tx_kbmd5fepw_newloginbox->loginFormOnSubmit';
        require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('kb_md5fepw') . 'pi1/class.tx_kbmd5fepw_newloginbox.php';
 }
+
+
+// Page module hook
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'][$_EXTKEY] =
+       'EXT:' . $_EXTKEY . '/Classes/Hooks/CmsLayout.php:TYPO3\CMS\Felogin\Hooks\CmsLayout';
+
 ?>
\ No newline at end of file