[FEATURE] Implementation of Revision Changes 19/15619/1
authorBastian Bringenberg <mail@bastian-bringenberg.de>
Sun, 14 Oct 2012 19:55:31 +0000 (21:55 +0200)
committerBastian Bringenberg <mail@bastian-bringenberg.de>
Sun, 14 Oct 2012 19:55:31 +0000 (21:55 +0200)
Implemented Parameter; Implemented view and changed ordering in
TCA.

Change-Id: Id28ed6a27fb073deb8fc14e17346668281726bf7
Fixes: #41968 @0h30

Classes/Controller/PageController.php
Configuration/TCA/TextRevision.php
Resources/Private/Templates/Page/Edit.html

index d621f6f..f11853f 100755 (executable)
@@ -110,11 +110,16 @@ class Tx_Typo3wiki_Controller_PageController extends Tx_Extbase_MVC_Controller_A
         *
         * @param Tx_Typo3wiki_Domain_Model_Page $page
         * @dontvalidate $page
+     *
      * @param string $unrenderedText
      * @dontvalidate $unrenderedText
+     *
+     * @param string $changes
+     * @dontvalidate $changes
+     *
         * @return void
         */
-       public function editAction(Tx_Typo3wiki_Domain_Model_Page $page = NULL, $unrenderedText = NULL) {
+       public function editAction(Tx_Typo3wiki_Domain_Model_Page $page = NULL, $unrenderedText = NULL, $changes = NULL) {
                if($page === NULL) $page = $this->pageRepository->findOneByPageTitle($this->request->getArgument('page'));
                if($page === NULL){
                        $page = $this->objectManager->get('Tx_Typo3wiki_Domain_Model_Page');
@@ -132,7 +137,9 @@ class Tx_Typo3wiki_Controller_PageController extends Tx_Extbase_MVC_Controller_A
             $myUnrenderedText = $unrenderedText;
         }
         $this->view->assign('preview', $preview);
-               $this->view->assign('page', $page);
+        var_dump($changes, $_POST);
+        $this->view->assign('changes', $changes);
+        $this->view->assign('page', $page);
         $this->view->assign('unrenderedText', $myUnrenderedText);
        }
 
@@ -145,6 +152,7 @@ class Tx_Typo3wiki_Controller_PageController extends Tx_Extbase_MVC_Controller_A
        public function updateAction(Tx_Typo3wiki_Domain_Model_Page $page) {
                if($page === NULL) $page = $this->pageRepository->findOneByPageTitle($this->request->getArgument('page'));
                $text = $this->request->getArgument('text');
+        $changes = $this->request->getArgument('changes');
         try{
             $this->request->getArgument('preview');
             $preview = TRUE;
@@ -153,7 +161,7 @@ class Tx_Typo3wiki_Controller_PageController extends Tx_Extbase_MVC_Controller_A
         }
 
         if(isset($page) && $preview){
-            $this->forward('edit', NULL, NULL, array('page'=>$page, 'unrenderedText'=>$text));
+            $this->forward('edit', NULL, NULL, array('page' => $page, 'unrenderedText' => $text, 'changes' => $changes));
         }
 
 
@@ -161,6 +169,7 @@ class Tx_Typo3wiki_Controller_PageController extends Tx_Extbase_MVC_Controller_A
                $revision->setUnrenderedText($text);
                $revision->setWriteDate(new DateTime('NOW'));
                $revision->setRenderedText('');
+        $revision->setChanges($changes);
 
                $redirection = preg_match('/\[\[REDIRECT:(.*)\]\]/i', $text, $matches);
                if($redirection === 1){
index d22ca2b..8557723 100755 (executable)
@@ -6,10 +6,10 @@ if (!defined ('TYPO3_MODE')) {
 $TCA['tx_typo3wiki_domain_model_textrevision'] = array(
        'ctrl' => $TCA['tx_typo3wiki_domain_model_textrevision']['ctrl'],
        'interface' => array(
-               'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, write_date, unrendered_text, rendered_text, changes, owner',
+               'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, write_date, changes, unrendered_text, rendered_text, owner',
        ),
        'types' => array(
-               '1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, write_date, unrendered_text, rendered_text, changes, owner,--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,starttime, endtime'),
+               '1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, write_date, changes, unrendered_text, rendered_text, owner,--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,starttime, endtime'),
        ),
        'palettes' => array(
                '1' => array('showitem' => ''),
index ca43e3d..6390bc2 100755 (executable)
@@ -9,6 +9,10 @@
     <h2>{page.pageTitle}</h2>
     <f:form action="update" arguments="{page:page}">
         <f:form.textarea cols="20" rows="5" name="text" value="{unrenderedText}" />
+        <div>
+            <label for="tx_typo3wiki_typo3wiki[changes]">Changes</label>
+            <f:form.textfield name="changes" value="{changes}" />
+        </div>
         <f:form.submit name="command" value="Save" />
         <f:form.submit name="preview" value="Preview" />
     </f:form>