[FEATURE] Use Wiki as Page Module 09/15609/1
authorBastian Bringenberg <mail@bastian-bringenberg.de>
Sun, 14 Oct 2012 13:31:31 +0000 (15:31 +0200)
committerBastian Bringenberg <mail@bastian-bringenberg.de>
Sun, 14 Oct 2012 13:31:31 +0000 (15:31 +0200)
Added Language Strings; Added Icon; Added Flexforms;

Change-Id: Iaf840f3b36d9254c647eede4cd2430eb46196124
Fixes: #41401 @0h30

Configuration/FlexForms/flexform_typo3wiki.xml [new file with mode: 0644]
Resources/Private/Language/locallang_db.xlf
Resources/Private/Php/class.typo3wiki_wizicon.php [new file with mode: 0644]
Resources/Public/Icons/ce_wiz.gif [new file with mode: 0644]
ext_tables.php

diff --git a/Configuration/FlexForms/flexform_typo3wiki.xml b/Configuration/FlexForms/flexform_typo3wiki.xml
new file mode 100644 (file)
index 0000000..bd21d72
--- /dev/null
@@ -0,0 +1,28 @@
+<T3DataStructure>
+    <sheets>
+        <sDEF>
+            <ROOT>
+                <TCEforms>
+                    <sheetTitle>LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_plugin_title</sheetTitle>
+                </TCEforms>
+                <type>array</type>
+                <el>
+                    <switchableControllerActions>
+                        <TCEforms>
+                            <label>LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_plugin_switchable_controller_action</label>
+                            <config>
+                                <type>select</type>
+                                <items type="array">
+                                    <numIndex index="0" type="array">
+                                        <numIndex index="0">LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_plugin_use_main</numIndex>
+                                        <numIndex index="1">Page->index;Page->show;Page->unknownPage;Page->edit;Page->update',</numIndex>
+                                    </numIndex>
+                                </items>
+                            </config>
+                        </TCEforms>
+                    </switchableControllerActions>
+                </el>
+            </ROOT>
+        </sDEF>
+    </sheets>
+</T3DataStructure>
\ No newline at end of file
index 78c6c61..e888d4f 100755 (executable)
@@ -4,6 +4,19 @@
                <header/>
                <body>
 
+
+                       <trans-unit id="tx_typo3wiki_plugin_title">
+                               <source>TYPO3 Wiki</source>
+                       </trans-unit>
+                       <trans-unit id="tx_typo3wiki_plugin_desc">
+               <source>The TYPO3 Wiki Main Plugins Configuration</source>
+            </trans-unit>
+                       <trans-unit id="tx_typo3wiki_plugin_switchable_controller_action">
+               <source>Select Action</source>
+            </trans-unit>
+            <trans-unit id="tx_typo3wiki_plugin_use_main">
+               <source>Default View</source>
+            </trans-unit>
                        <trans-unit id="tx_typo3wiki_domain_model_page">
                                <source>Page</source>
                        </trans-unit>
diff --git a/Resources/Private/Php/class.typo3wiki_wizicon.php b/Resources/Private/Php/class.typo3wiki_wizicon.php
new file mode 100644 (file)
index 0000000..4ed3a9a
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Bastian Bringenberg <typo3@bastian-bringenberg.de>, Bastian Bringenberg
+ *
+ *  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 3 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!
+ ***************************************************************/
+
+/**
+ * Add news extension to the wizard in page module
+ *
+ * @package TYPO3
+ * @subpackage tx_typo3wiki
+ */
+class typo3wiki_typo3wiki_wizicon {
+
+               const KEY = 'typo3wiki';
+
+               /**
+                * Processing the wizard items array
+                *
+                * @param array $wizardItems The wizard items
+                * @return Modified array with wizard items
+                */
+               public function proc($wizardItems) {
+                       $wizardItems['plugins_tx_' . self::KEY] = array(
+                               'icon' => t3lib_extMgm::extRelPath(self::KEY) . 'Resources/Public/Icons/ce_wiz.gif',
+                               'title' => $GLOBALS['LANG']->sL('LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_plugin_title'),
+                               'description' => $GLOBALS['LANG']->sL('LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_plugin_desc'),
+                               'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=' . self::KEY . '_typo3wiki'
+                       );
+
+                       return $wizardItems;
+               }
+       }
+
+       if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/typo3wiki/Resources/Private/Php/class.typo3wiki_wizicon.php']) {
+               include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/typo3wiki/Resources/Private/Php/class.typo3wiki_wizicon.php']);
+       }
\ No newline at end of file
diff --git a/Resources/Public/Icons/ce_wiz.gif b/Resources/Public/Icons/ce_wiz.gif
new file mode 100644 (file)
index 0000000..1a832d4
Binary files /dev/null and b/Resources/Public/Icons/ce_wiz.gif differ
index fe54d2d..f12b079 100755 (executable)
@@ -101,4 +101,12 @@ $TCA['fe_users']['columns'][$TCA['fe_users']['ctrl']['type']]['config']['items']
 
 $TCA['fe_users']['types']['Tx_Typo3wiki_User']['showitem'] = $TCA['fe_users']['types']['Tx_Extbase_Domain_Model_FrontendUser']['showitem'];
 $TCA['fe_users']['types']['Tx_Typo3wiki_User']['showitem'] .= ',--div--;LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_domain_model_user,';
-$TCA['fe_users']['types']['Tx_Typo3wiki_User']['showitem'] .= '';
\ No newline at end of file
+$TCA['fe_users']['types']['Tx_Typo3wiki_User']['showitem'] .= '';
+
+$pluginSignature = str_replace('_','',$_EXTKEY) . '_typo3wiki';
+$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
+t3lib_extMgm::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_typo3wiki.xml');
+
+if (TYPO3_MODE == 'BE') {
+       $TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'][$pluginSignature . '_wizicon'] = t3lib_extMgm::extPath($_EXTKEY) . 'Resources/Private/Php/class.' . $_EXTKEY . '_wizicon.php';
+}
\ No newline at end of file