[FEATURE] Implementation of Categories 04/15504/1
authorBastian Bringenberg <mail@bastian-bringenberg.de>
Wed, 10 Oct 2012 23:07:13 +0000 (01:07 +0200)
committerBastian Bringenberg <mail@bastian-bringenberg.de>
Wed, 10 Oct 2012 23:07:13 +0000 (01:07 +0200)
* Checking if Linktaget already checked implemented
* Categories implemented
* Related Pages cleaned up and implemented

Change-Id: I3664997e0b642f07cb8f463878dbce406f783538
Fixes: #41374 @1h00
Fixes: #41364 @4h00

Classes/Controller/PageController.php
Classes/Domain/Model/Category.php [deleted file]
Classes/Domain/Model/Page.php
Classes/Helper/RenderHelper.php
Configuration/TCA/Category.php [deleted file]
Configuration/TCA/Page.php
Resources/Private/Language/locallang_db.xlf
Resources/Private/Templates/Rendering/CategoryList.html [new file with mode: 0644]
Resources/Private/Templates/Rendering/PageCategories.html [new file with mode: 0644]
ext_tables.php
ext_tables.sql

index 29b2791..79a8791 100755 (executable)
@@ -84,7 +84,11 @@ class Tx_Typo3wiki_Controller_PageController extends Tx_Extbase_MVC_Controller_A
                }catch(Exception $e){}
                if($page->getRedirection() != NULL) $this->redirect('show', NULL, NULL, array('page' => $page->getRedirection(), 'redirection' => $page->getPageTitle()));
                if($page->getMainRevision()->getRenderedText() === ''){
+                       if($page->getIsCategory() === true){
+                               $page = $this->checkCategoryAssociation($page);
+                       }
                        $renderHelper = $this->createRenderHelper();
+                       $renderHelper->setRelatedPage($page);
                        $page->getMainRevision()->setRenderedText($renderHelper->renderText($page->getMainRevision()->getUnrenderedText()));
                }
                $this->view->assign('redirection', $redirection);
@@ -129,12 +133,11 @@ 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') ;
-               $renderHelper = $this->createRenderHelper();
 
                $revision = $this->objectManager->get('Tx_Typo3wiki_Domain_Model_TextRevision');
                $revision->setUnrenderedText($text);
                $revision->setWriteDate(new DateTime('NOW'));
-               $revision->setRenderedText($renderHelper->renderText($revision->getUnrenderedText()));
+               $revision->setRenderedText('');
 
                $redirection = preg_match('/\[\[REDIRECT:(.*)\]\]/i', $text, $matches);
                if($redirection === 1){
@@ -148,7 +151,16 @@ class Tx_Typo3wiki_Controller_PageController extends Tx_Extbase_MVC_Controller_A
                }else{
                        $page->removeRedirection();
                }
-               if($page->getMainRevision() === NULL) $renderHelper->renderRelatedPages($page);
+               /**
+                * Clear Cache of related Pages
+                * eg Link Generation
+                * eg Category Generation
+                */
+               $renderHelper = $this->createRenderHelper();
+               $renderHelper->setRelatedPage($page);
+               if($page->getMainRevision() === NULL) $renderHelper->renderRelatedPages($text);
+               $tmp = str_replace('{TOC}', '', $text);
+               if(preg_match('/{.*?}/', $tmp) === 1) $renderHelper->renderCategoryPages($text);
                $page->addRevision($revision);
                $page->setMainRevision($revision);
                $this->pageRepository->update($page);
@@ -171,4 +183,20 @@ class Tx_Typo3wiki_Controller_PageController extends Tx_Extbase_MVC_Controller_A
                return $renderHelper;
        }
 
+       /**
+        * Checks if the current Page is still a Category Page and removes unused Relations
+        *
+        * @param Tx_Typo3wiki_Domain_Model_Page $page The CategoryPage
+        * @return Tx_Typo3wiki_Domain_Model_Page
+        */
+       private function checkCategoryAssociation(Tx_Typo3wiki_Domain_Model_Page $page){
+               foreach($page->getCategoryPages() as $catPage){
+                       if($catPage->getMainRevision() !== NULL && FALSE === strpos($catPage->getMainRevision()->getUnrenderedText(),'{'.$page->getPageTitle().'}')){
+                               $page->removeCategoryPage($catPage);
+                       }
+               }
+               $page->setIsCategory(($page->getCategoryPages()->count() !== 0));
+               return $page;
+       }
+
 }
\ No newline at end of file
diff --git a/Classes/Domain/Model/Category.php b/Classes/Domain/Model/Category.php
deleted file mode 100755 (executable)
index c3cebdc..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-<?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!
- ***************************************************************/
-
-/**
- *
- *
- * @package typo3wiki
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
- *
- */
-class Tx_Typo3wiki_Domain_Model_Category extends Tx_Extbase_DomainObject_AbstractEntity {
-
-       /**
-        * title
-        *
-        * @var string
-        * @validate NotEmpty
-        */
-       protected $title;
-
-       /**
-        * pages
-        *
-        * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_Page>
-        * @lazy
-        */
-       protected $pages;
-
-       /**
-        * __construct
-        *
-        * @return void
-        */
-       public function __construct() {
-               //Do not remove the next line: It would break the functionality
-               $this->initStorageObjects();
-       }
-
-       /**
-        * Initializes all Tx_Extbase_Persistence_ObjectStorage properties.
-        *
-        * @return void
-        */
-       protected function initStorageObjects() {
-               /**
-                * Do not modify this method!
-                * It will be rewritten on each save in the extension builder
-                * You may modify the constructor of this class instead
-                */
-               $this->pages = new Tx_Extbase_Persistence_ObjectStorage();
-       }
-
-       /**
-        * Returns the title
-        *
-        * @return string $title
-        */
-       public function getTitle() {
-               return $this->title;
-       }
-
-       /**
-        * Sets the title
-        *
-        * @param string $title
-        * @return void
-        */
-       public function setTitle($title) {
-               $this->title = $title;
-       }
-
-       /**
-        * Adds a Page
-        *
-        * @param Tx_Typo3wiki_Domain_Model_Page $page
-        * @return void
-        */
-       public function addPage(Tx_Typo3wiki_Domain_Model_Page $page) {
-               $this->pages->attach($page);
-       }
-
-       /**
-        * Removes a Page
-        *
-        * @param Tx_Typo3wiki_Domain_Model_Page $pageToRemove The Page to be removed
-        * @return void
-        */
-       public function removePage(Tx_Typo3wiki_Domain_Model_Page $pageToRemove) {
-               $this->pages->detach($pageToRemove);
-       }
-
-       /**
-        * Returns the pages
-        *
-        * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_Page> $pages
-        */
-       public function getPages() {
-               return $this->pages;
-       }
-
-       /**
-        * Sets the pages
-        *
-        * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_Page> $pages
-        * @return void
-        */
-       public function setPages(Tx_Extbase_Persistence_ObjectStorage $pages) {
-               $this->pages = $pages;
-       }
-
-}
-?>
\ No newline at end of file
index d9a8ee2..ce67b7e 100755 (executable)
 <?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!
- ***************************************************************/
-
-/**
- *
- *
- * @package typo3wiki
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
- *
- */
-class Tx_Typo3wiki_Domain_Model_Page extends Tx_Extbase_DomainObject_AbstractEntity {
-
-       /**
-        * pageTitle
+       /***************************************************************
+        *  Copyright notice
         *
-        * @var string
-        * @validate NotEmpty
-        */
-       protected $pageTitle;
-
-       /**
-        * subscriber
+        *  (c) 2012 Bastian Bringenberg <typo3@bastian-bringenberg.de>, Bastian Bringenberg
         *
-        * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_User>
-        * @lazy
-        */
-       protected $subscriber;
-
-       /**
-        * revisions
+        *  All rights reserved
         *
-        * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_TextRevision>
-        * @lazy
-        */
-       protected $revisions;
-
-       /**
-        * mainRevision
+        *  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.
         *
-        * @var Tx_Typo3wiki_Domain_Model_TextRevision
-        * @lazy
-        */
-       protected $mainRevision;
-
-       /**
-        * relatedPages
+        *  The GNU General Public License can be found at
+        *  http://www.gnu.org/copyleft/gpl.html.
         *
-        * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_Page>
-        * @lazy
-        */
-       protected $relatedPages;
-
-       /**
-        * Redirections PageName
+        *  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.
         *
-        * @var Tx_Typo3wiki_Domain_Model_Page
-        */
-       protected $redirection;
+        *  This copyright notice MUST APPEAR in all copies of the script!
+        ***************************************************************/
 
        /**
-        * __construct
         *
-        * @return void
-        */
-       public function __construct() {
-               //Do not remove the next line: It would break the functionality
-               $this->initStorageObjects();
-       }
-
-       /**
-        * Initializes all Tx_Extbase_Persistence_ObjectStorage properties.
         *
-        * @return void
+        * @package typo3wiki
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
+        *
         */
-       protected function initStorageObjects() {
+       class Tx_Typo3wiki_Domain_Model_Page extends Tx_Extbase_DomainObject_AbstractEntity {
+
                /**
-                * Do not modify this method!
-                * It will be rewritten on each save in the extension builder
-                * You may modify the constructor of this class instead
+                * pageTitle
+                *
+                * @var string
+                * @validate NotEmpty
                 */
-               $this->subscriber = new Tx_Extbase_Persistence_ObjectStorage();
-               
-               $this->revisions = new Tx_Extbase_Persistence_ObjectStorage();
-               
-               $this->relatedPages = new Tx_Extbase_Persistence_ObjectStorage();
-       }
+               protected $pageTitle;
 
-       /**
-        * Returns the pageTitle
-        *
-        * @return string $pageTitle
-        */
-       public function getPageTitle() {
-               return $this->pageTitle;
-       }
+               /**
+                * subscriber
+                *
+                * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_User>
+                * @lazy
+                */
+               protected $subscriber;
 
-       /**
-        * Sets the pageTitle
-        *
-        * @param string $pageTitle
-        * @return void
-        */
-       public function setPageTitle($pageTitle) {
-               $this->pageTitle = $pageTitle;
-       }
+               /**
+                * revisions
+                *
+                * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_TextRevision>
+                * @lazy
+                */
+               protected $revisions;
 
-       /**
-        * Adds a User
-        *
-        * @param Tx_Typo3wiki_Domain_Model_User $subscriber
-        * @return void
-        */
-       public function addSubscriber(Tx_Typo3wiki_Domain_Model_User $subscriber) {
-               $this->subscriber->attach($subscriber);
-       }
+               /**
+                * mainRevision
+                *
+                * @var Tx_Typo3wiki_Domain_Model_TextRevision
+                * @lazy
+                */
+               protected $mainRevision;
 
-       /**
-        * Removes a User
-        *
-        * @param Tx_Typo3wiki_Domain_Model_User $subscriberToRemove The User to be removed
-        * @return void
-        */
-       public function removeSubscriber(Tx_Typo3wiki_Domain_Model_User $subscriberToRemove) {
-               $this->subscriber->detach($subscriberToRemove);
-       }
+               /**
+                * relatedPages
+                *
+                * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_Page>
+                * @lazy
+                */
+               protected $relatedPages;
 
-       /**
-        * Returns the subscriber
-        *
-        * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_User> $subscriber
-        */
-       public function getSubscriber() {
-               return $this->subscriber;
-       }
+               /**
+                * categoryPages
+                *
+                * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_Page>
+                * @lazy
+                */
+               protected $categoryPages;
 
-       /**
-        * Sets the subscriber
-        *
-        * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_User> $subscriber
-        * @return void
-        */
-       public function setSubscriber(Tx_Extbase_Persistence_ObjectStorage $subscriber) {
-               $this->subscriber = $subscriber;
-       }
+               /**
+                * isCategory
+                *
+                * @var boolean
+                */
+               protected $isCategory;
 
-       /**
-        * Adds a TextRevision
-        *
-        * @param Tx_Typo3wiki_Domain_Model_TextRevision $revision
-        * @return void
-        */
-       public function addRevision(Tx_Typo3wiki_Domain_Model_TextRevision $revision) {
-               $this->revisions->attach($revision);
-       }
+               /**
+                * Redirections PageName
+                *
+                * @var Tx_Typo3wiki_Domain_Model_Page
+                */
+               protected $redirection;
 
-       /**
-        * Removes a TextRevision
-        *
-        * @param Tx_Typo3wiki_Domain_Model_TextRevision $revisionToRemove The TextRevision to be removed
-        * @return void
-        */
-       public function removeRevision(Tx_Typo3wiki_Domain_Model_TextRevision $revisionToRemove) {
-               $this->revisions->detach($revisionToRemove);
-       }
+               /**
+                * __construct
+                *
+                * @return void
+                */
+               public function __construct() {
+                       $this->initStorageObjects();
+               }
 
-       /**
-        * Returns the revisions
-        *
-        * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_TextRevision> $revisions
-        */
-       public function getRevisions() {
-               return $this->revisions;
-       }
+               /**
+                * Initializes all Tx_Extbase_Persistence_ObjectStorage properties.
+                *
+                * @return void
+                */
+               protected function initStorageObjects() {
+                       $this->subscriber = new Tx_Extbase_Persistence_ObjectStorage();
+                       $this->revisions = new Tx_Extbase_Persistence_ObjectStorage();
+                       $this->relatedPages = new Tx_Extbase_Persistence_ObjectStorage();
+                       $this->categoryPages = new Tx_Extbase_Persistence_ObjectStorage();
+               }
 
-       /**
-        * Sets the revisions
-        *
-        * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_TextRevision> $revisions
-        * @return void
-        */
-       public function setRevisions(Tx_Extbase_Persistence_ObjectStorage $revisions) {
-               $this->revisions = $revisions;
-       }
+               /**
+                * Returns the pageTitle
+                *
+                * @return string $pageTitle
+                */
+               public function getPageTitle() {
+                       return $this->pageTitle;
+               }
 
-       /**
-        * Returns the mainRevision
-        *
-        * @return Tx_Typo3wiki_Domain_Model_TextRevision $mainRevision
-        */
-       public function getMainRevision() {
-               return $this->mainRevision;
-       }
+               /**
+                * Sets the pageTitle
+                *
+                * @param string $pageTitle
+                * @return void
+                */
+               public function setPageTitle($pageTitle) {
+                       $this->pageTitle = $pageTitle;
+               }
 
-       /**
-        * Sets the mainRevision
-        *
-        * @param Tx_Typo3wiki_Domain_Model_TextRevision $mainRevision
-        * @return void
-        */
-       public function setMainRevision(Tx_Typo3wiki_Domain_Model_TextRevision $mainRevision) {
-               $this->mainRevision = $mainRevision;
-       }
+               /**
+                * Adds a User
+                *
+                * @param Tx_Typo3wiki_Domain_Model_User $subscriber
+                * @return void
+                */
+               public function addSubscriber(Tx_Typo3wiki_Domain_Model_User $subscriber) {
+                       $this->subscriber->attach($subscriber);
+               }
 
-       /**
-        * Adds a Page
-        *
-        * @param Tx_Typo3wiki_Domain_Model_Page $relatedPage
-        * @return void
-        */
-       public function addRelatedPage(Tx_Typo3wiki_Domain_Model_Page $relatedPage) {
-               $this->relatedPages->attach($relatedPage);
-       }
+               /**
+                * Removes a User
+                *
+                * @param Tx_Typo3wiki_Domain_Model_User $subscriberToRemove The User to be removed
+                * @return void
+                */
+               public function removeSubscriber(Tx_Typo3wiki_Domain_Model_User $subscriberToRemove) {
+                       $this->subscriber->detach($subscriberToRemove);
+               }
 
-       /**
-        * Removes a Page
-        *
-        * @param Tx_Typo3wiki_Domain_Model_Page $relatedPageToRemove The Page to be removed
-        * @return void
-        */
-       public function removeRelatedPage(Tx_Typo3wiki_Domain_Model_Page $relatedPageToRemove) {
-               $this->relatedPages->detach($relatedPageToRemove);
-       }
+               /**
+                * Returns the subscriber
+                *
+                * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_User> $subscriber
+                */
+               public function getSubscriber() {
+                       return $this->subscriber;
+               }
 
-       /**
-        * Returns the relatedPages
-        *
-        * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_Page> $relatedPages
-        */
-       public function getRelatedPages() {
-               return $this->relatedPages;
-       }
+               /**
+                * Sets the subscriber
+                *
+                * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_User> $subscriber
+                * @return void
+                */
+               public function setSubscriber(Tx_Extbase_Persistence_ObjectStorage $subscriber) {
+                       $this->subscriber = $subscriber;
+               }
 
-       /**
-        * Sets the relatedPages
-        *
-        * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_Page> $relatedPages
-        * @return void
-        */
-       public function setRelatedPages(Tx_Extbase_Persistence_ObjectStorage $relatedPages) {
-               $this->relatedPages = $relatedPages;
-       }
+               /**
+                * Adds a TextRevision
+                *
+                * @param Tx_Typo3wiki_Domain_Model_TextRevision $revision
+                * @return void
+                */
+               public function addRevision(Tx_Typo3wiki_Domain_Model_TextRevision $revision) {
+                       $this->revisions->attach($revision);
+               }
 
-       /**
-        * Set Redirection
-        *
-        * @param Tx_Typo3wiki_Domain_Model_Page $redirection
-        */
-       public function setRedirection(Tx_Typo3wiki_Domain_Model_Page $redirection) {
-               $this->redirection = $redirection;
-       }
+               /**
+                * Removes a TextRevision
+                *
+                * @param Tx_Typo3wiki_Domain_Model_TextRevision $revisionToRemove The TextRevision to be removed
+                * @return void
+                */
+               public function removeRevision(Tx_Typo3wiki_Domain_Model_TextRevision $revisionToRemove) {
+                       $this->revisions->detach($revisionToRemove);
+               }
 
-       /**
-        * Get Redirection
-        *
-        * @return Tx_Typo3wiki_Domain_Model_Page
-        */
-       public function getRedirection() {
-               return $this->redirection;
-       }
+               /**
+                * Returns the revisions
+                *
+                * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_TextRevision> $revisions
+                */
+               public function getRevisions() {
+                       return $this->revisions;
+               }
 
-       /**
-        *  Remove the Redirection
-        */
-       public function removeRedirection() {
-               $this->redirection = NULL;
-       }
+               /**
+                * Sets the revisions
+                *
+                * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_TextRevision> $revisions
+                * @return void
+                */
+               public function setRevisions(Tx_Extbase_Persistence_ObjectStorage $revisions) {
+                       $this->revisions = $revisions;
+               }
 
+               /**
+                * Returns the mainRevision
+                *
+                * @return Tx_Typo3wiki_Domain_Model_TextRevision $mainRevision
+                */
+               public function getMainRevision() {
+                       return $this->mainRevision;
+               }
+
+               /**
+                * Sets the mainRevision
+                *
+                * @param Tx_Typo3wiki_Domain_Model_TextRevision $mainRevision
+                * @return void
+                */
+               public function setMainRevision(Tx_Typo3wiki_Domain_Model_TextRevision $mainRevision) {
+                       $this->mainRevision = $mainRevision;
+               }
+
+               /**
+                * Adds a Page
+                *
+                * @param Tx_Typo3wiki_Domain_Model_Page $relatedPage
+                * @return void
+                */
+               public function addRelatedPage(Tx_Typo3wiki_Domain_Model_Page $relatedPage) {
+                       $this->relatedPages->attach($relatedPage);
+               }
+
+               /**
+                * Removes a Page
+                *
+                * @param Tx_Typo3wiki_Domain_Model_Page $relatedPageToRemove The Page to be removed
+                * @return void
+                */
+               public function removeRelatedPage(Tx_Typo3wiki_Domain_Model_Page $relatedPageToRemove) {
+                       $this->relatedPages->detach($relatedPageToRemove);
+               }
+
+               /**
+                * Returns the relatedPages
+                *
+                * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_Page> $relatedPages
+                */
+               public function getRelatedPages() {
+                       return $this->relatedPages;
+               }
+
+               /**
+                * Sets the relatedPages
+                *
+                * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Typo3wiki_Domain_Model_Page> $relatedPages
+                * @return void
+                */
+               public function setRelatedPages(Tx_Extbase_Persistence_ObjectStorage $relatedPages) {
+                       $this->relatedPages = $relatedPages;
+               }
+
+               /**
+                * Set Redirection
+                *
+                * @param Tx_Typo3wiki_Domain_Model_Page $redirection
+                */
+               public function setRedirection(Tx_Typo3wiki_Domain_Model_Page $redirection) {
+                       $this->redirection = $redirection;
+               }
+
+               /**
+                * Get Redirection
+                *
+                * @return Tx_Typo3wiki_Domain_Model_Page
+                */
+               public function getRedirection() {
+                       return $this->redirection;
+               }
+
+               /**
+                *  Remove the Redirection
+                */
+               public function removeRedirection() {
+                       $this->redirection = NULL;
+               }
+
+               /**
+                * Adds a Page as Category
+                *
+                * @param Tx_Typo3wiki_Domain_Model_Page $relatedPage
+                * @return void
+                */
+               public function addCategoryPage(Tx_Typo3wiki_Domain_Model_Page $relatedPage) {
+                       $this->categoryPages->attach($relatedPage);
+               }
+
+               /**
+                * Removes a Page as Category
+                *
+                * @param Tx_Typo3wiki_Domain_Model_Page $relatedPageToRemove The Page to be removed
+                * @return void
+                */
+               public function removeCategoryPage(Tx_Typo3wiki_Domain_Model_Page $relatedPageToRemove) {
+                       $this->categoryPages->detach($relatedPageToRemove);
+               }
+
+               /**
+                * Set CategoryPages
+                *
+                * @param \Tx_Extbase_Persistence_ObjectStorage $categoryPages
+                */
+               public function setCategoryPages($categoryPages) {
+                       $this->categoryPages = $categoryPages;
+               }
+
+               /**
+                * Get CategoryPages
+                *
+                * @return \Tx_Extbase_Persistence_ObjectStorage
+                */
+               public function getCategoryPages() {
+                       return $this->categoryPages;
+               }
+
+               /**
+                * Set isCategory
+                *
+                * @param boolean $isCategory
+                */
+               public function setIsCategory($isCategory) {
+                       $this->isCategory = $isCategory;
+               }
+
+               /**
+                * Get isCategory
+                *
+                * @return boolean
+                */
+               public function getIsCategory() {
+                       return $this->isCategory;
+               }
+
+       }
 
-}
 ?>
\ No newline at end of file
index dac28f5..c9ba1ce 100644 (file)
         * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
         *
         */
+       // @todo order Methods
        require(__DIR__ . '/markdown.php');
        class Tx_Typo3wiki_Helper_RenderHelper extends MarkdownExtra_Parser {
+
+               /**
+                * Method for getting a PageObject by Title. If Object does not exists, it will be created.
+                *
+                * @param string $title
+                * @return Tx_Typo3wiki_Domain_Model_Page
+                */
+               private function createPageIfNotExists($title){
+                       $returnPage = $this->pageRepository->findOneByPageTitle($title);
+                       if($returnPage === NULL){
+                               $returnPage = $this->objectManager->get('Tx_Typo3wiki_Domain_Model_Page');
+                               $returnPage->setPageTitle($title);
+                               $this->pageRepository->add($returnPage);
+                               $persistenceManager = t3lib_div::makeInstance('Tx_Extbase_Persistence_Manager');
+                               $persistenceManager->persistAll();
+                       }
+                       return $returnPage;
+
+               }
+
                /**
                 * relatedPageSearch
                 *
                /**
                 * A Helper Variable should be NULL after each method.
                 *
-                * @var null
+                * @var $helper NULL
                 */
                protected $helper = NULL;
 
                /**
+                * The RelatedPage
+                *
+                * @var $relatedPage Tx_Typo3wiki_Domain_Model_Page
+                */
+               protected $relatedPage;
+
+               /**
                 * Rendering Method to render TextRevision
                 *
                 * @param string $text
                 */
                public function renderText($text) {
                        $text = $this->transform($text);
+                       $text = $this->_renderCategories($text);
+                       $text = $this->_renderCategoriesList($text);
                        $text = $this->_renderExternalLinks($text);
                        $text = $this->_renderInternalLinks($text);
                        $text = $this->_renderHeadlineLinks($text);
                }
 
                /**
-                * Render Related Pages, if current pages is new created
+                * Removes Cache of Related Categories; Fired on update
                 *
                 * @param Tx_Typo3wiki_Domain_Model_Page $page
+                * @param string $text
                 * @return void
                 */
-               public function renderRelatedPages(Tx_Typo3wiki_Domain_Model_Page $page) {
-                       foreach ($page->getRelatedPages() as $singlePage) {
-                               $singlePage->getMainRevision()->setRenderedText('');
-                               /*$text = $this->renderRelatedPagesHelper($text, $page);
-                               $singlePage->getMainRevision()->setRenderedText($text); */
-                               // @todo check is is saved
+               public function renderCategoryPages($text) {
+                       $text = str_replace('{TOC}', '', $text);
+                       $text = str_replace('{LOC}', '', $text);
+                       $this->helper = array();
+                       $text = preg_replace_callback('/{(.*?)}/', array( $this, '_renderCategoryPagesHelper'), $text);
+                       $this->helper = NULL;
+               }
+
+               /**
+                * Helper Method for: Removes Cache of Related Categories; Fired on update
+                * Adds this page to all relatedCategoryPages
+                *
+                * @param $cat PageMatching
+                * @return mixed
+                */
+               private function _renderCategoryPagesHelper($cat){
+                       $cat = $cat[1];
+                       if($cat === 'TOC') return '';
+                       if($cat === 'LOC') return '';
+                       if(!isset($this->helper[$cat])){
+                               $catPage = $this->createPageIfNotExists($cat);
+                               if(!$catPage->getCategoryPages()->contains($this->relatedPage)){
+                                       $catPage->addCategoryPage($this->relatedPage);
+                                       $catPage->setIsCategory(true);
+                               }
+                               $this->helper[$cat] = TRUE;
                        }
+                       return '';
                }
 
                /**
-                * Removes unused class out of anchors with current page as target
-                * @todo write RenderRelatedPagesHelper Method
+                * Removes Cache of Related Pages, if current pages is new created
+                *
                 *
-                * @param string $text
                 * @param Tx_Typo3wiki_Domain_Model_Page $page
                 * @return void
                 */
-               private function renderRelatedPagesHelper($text, Tx_Typo3wiki_Domain_Model_Page $page) {
-                       if ($this->relatedPageSearch === NULL || $this->relatedPageReplace === NULL) {
-                               $this->relatedPageSearch = '';
-                               $this->relatedPageReplace = '';
+               public function renderRelatedPages() {
+                       foreach($this->relatedPage->getRelatedPages() as $related){
+                               $related->getMainRevision()->setRenderedText('');
                        }
-                       return str_replace($this->relatedPageSearch, $this->relatedPageReplace, $text);
                }
 
+
                /**
                 * Adds the rendering of internalLinks to MarkUp
                 *
                 * @return string
                 */
                private function _renderInternalLinks($text) {
+                       $this->helper = array();
                        $tmp = array();
                        preg_match_all('#\[\[([^\]]*)\]\]#u', $text, $tmp);
                        foreach($tmp[1] as $linkTitle){
                                        $link = $this->uriBuilder->setArguments(array('tx_typo3wiki_typo3wiki[action]' => 'show', 'tx_typo3wiki_typo3wiki[page]' => $linkTitle[1]));
                                        $link = $link->build();
                                        $cssClass = 'internal exists';
-                                       $target = $this->pageRepository->findOneByPageTitle($linkTitle[1]);
-                                       if($target === NULL) $cssClass = 'internal nonexists';
+                                       if(!isset($this->helper[$linkTitle[1]])){
+                                               $target = $this->createPageIfNotExists($linkTitle[1]);
+                                               $this->helper[$linkTitle[1]] = $target;
+                                       }else{
+                                               $target = $this->helper[$linkTitle[1]];
+                                       }
+                                       if($target->getMainRevision() === NULL ) $cssClass = 'internal nonexists';
                                        $link = '<a href="'.$link.'" class="'.$cssClass.'">'.$linkTitle[0].'</a>';
                                        $text = str_replace('[['.$linkTitle[0].'|'.$linkTitle[1].']]', $link, $text);
                                }else{
                                        $link = $this->uriBuilder->setArguments(array('tx_typo3wiki_typo3wiki[action]' => 'show', 'tx_typo3wiki_typo3wiki[page]' => $linkTitle[0]));
                                        $link = $link->build();
                                        $cssClass = 'internal exists';
-                                       $target = $this->pageRepository->findOneByPageTitle($linkTitle[0]);
-                                       if($target === NULL) $cssClass = 'internal nonexists';
+                                       if(!isset($this->helper[$linkTitle[0]])){
+                                               $target = $this->createPageIfNotExists($linkTitle[0]);
+                                               $this->helper[$linkTitle[0]] = $target;
+                                       }else{
+                                               $target = $this->helper[$linkTitle[0]];
+                                       }
+                                       if( $target->getMainRevision() === NULL ) $cssClass = 'internal nonexists';
                                        $link = '<a href="'.$link.'" class="'.$cssClass.'">'.$linkTitle[0].'</a>';
                                        $text = str_replace('[['.$linkTitle[0].']]', $link, $text);
                                }
 
                        }
 
+                       foreach($this->helper as $relatedPage){
+                               if($relatedPage->getMainRevision() === NULL){
+                                       if(!$relatedPage->getRelatedPages()->contains($this->relatedPage)){
+                                               $relatedPage->addRelatedPage($this->relatedPage);
+                                       }
+                               }
+                       }
+                       $this->helper = NULL;
                        return $text;
                }
 
                private function _renderContentList($text) {
                        if(strpos($text, '{TOC}') === FALSE) return $text;
                        $stageList = $this->_getContentListStage($text, 1);
-                       $tocView = $this->objectManager->create('Tx_Fluid_View_StandaloneView');
-                       $tocView->setFormat('html');
-                       $tocView->setLayoutRootPath(t3lib_div::getFileAbsFileName($this->objectSettings['view']['layoutRootPath']));
-                       $tocView->setPartialRootPath(t3lib_div::getFileAbsFileName($this->objectSettings['view']['partialRootPath']));
-                       $tocView->setTemplatePathAndFilename(t3lib_div::getFileAbsFileName($this->objectSettings['view']['templateRootPath']).'Rendering/TableOfContents.html');
+                       $tocView = $this->createViewHelper('TableOfContents');
                        $tocView->assign('stageList', $stageList);
                        return str_replace('{TOC}', $tocView->render(), $text);
                }
                        return $returnArray;
                }
 
+               /**
+                * Renders HeadLines to Links
+                *
+                * @param string $text
+                * @return string
+                */
                private function _renderHeadlineLinks($text){
                        $this->helper = array();
                        $text = preg_replace_callback('/<h.>(.*)<\/h.>/', array( $this, '_renderHeadlineLinksCall'), $text);
                        return $text;
                }
 
+               /**
+                * Renders HeadLines to Links Call
+                *
+                * @param string $header
+                * @return string
+                */
                private function _renderHeadlineLinksCall($header){
                        preg_match('/<h(.)>/', $header[0], $match);
                        $level = $match[1];
                }
 
                /**
+                * Renders the Categories View
+                *
+                * @param string $text
+                * @return string
+                */
+               private function _renderCategories($text){
+                       $this->helper = array();
+                       $text = preg_replace_callback('/{(.*?)}/', array( $this, '_renderCategoriesHelper'), $text);
+                       $tocView = $this->createViewHelper('PageCategories');
+                       $tocView->assign('categories', $this->helper[1]);
+
+                       $helper = $tocView->render();
+                       $helper = $this->_renderInternalLinks($helper);
+                       $this->helper = NULL;
+                       return $text.$helper;
+               }
+
+               /**
+                * Renders the Categories View Helper
+                *
+                * @param string $cat
+                * @return string $cat
+                */
+               private function _renderCategoriesHelper($cat){
+                       if($cat[0] === '{TOC}') return $cat[0];
+                       if($cat[0] === '{LOC}') return $cat[0];
+                       $this->helper[1][] = $cat[1];
+                       $tmpPage = $this->createPageIfNotExists($cat[1]);
+                       if(!$tmpPage->getCategoryPages()->contains($this->relatedPage)) $tmpPage->addCategoryPage($this->relatedPage);
+                       if($tmpPage->getIsCategory() === FALSE)     $tmpPage->setIsCategory(TRUE);
+                       return '';
+               }
+
+               /**
+                * Renders the List of Pages related to this Category ( Page )
+                *
+                * @param string $text
+                * @return string $text
+                */
+               private function _renderCategoriesList($text){
+                       if(strpos($text, '{LOC}') !== FALSE){
+                               $tocView = $this->createViewHelper('CategoryList');
+                               $tocView->assign('pages', $this->relatedPage->getCategoryPages());
+                               $helper = $tocView->render();
+                               $text = str_replace('{LOC}', $helper, $text);
+                       }
+                       return $text;
+               }
+
+               /**
+                * Create Stand Alone Viewhelper
+                *
+                * @param string $templateName
+                * @return Tx_Fluid_View_StandaloneView
+                */
+               private function createViewHelper($templateName){
+                       $tocView = $this->objectManager->create('Tx_Fluid_View_StandaloneView');
+                       $tocView->setFormat('html');
+                       $tocView->setLayoutRootPath(t3lib_div::getFileAbsFileName($this->objectSettings['view']['layoutRootPath']));
+                       $tocView->setPartialRootPath(t3lib_div::getFileAbsFileName($this->objectSettings['view']['partialRootPath']));
+                       $tocView->setTemplatePathAndFilename(t3lib_div::getFileAbsFileName($this->objectSettings['view']['templateRootPath']).'Rendering/'.$templateName.'.html');
+                       return $tocView;
+               }
+
+               /**
                 *  Set Page Repository
                 *
                 * @param \Tx_Typo3wiki_Domain_Repository_PageRepository $pageRepository
                        return $this->objectManager;
                }
 
+               /**
+                * @param Tx_Typo3wiki_Domain_Model_Page $relatedPage
+                */
+               public function setRelatedPage($relatedPage) {
+                       $this->relatedPage = $relatedPage;
+               }
+
+               /**
+                * @return Tx_Typo3wiki_Domain_Model_Page
+                */
+               public function getRelatedPage() {
+                       return $this->relatedPage;
+               }
+
+
        }
diff --git a/Configuration/TCA/Category.php b/Configuration/TCA/Category.php
deleted file mode 100755 (executable)
index 77bbef0..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-if (!defined ('TYPO3_MODE')) {
-       die ('Access denied.');
-}
-
-$TCA['tx_typo3wiki_domain_model_category'] = array(
-       'ctrl' => $TCA['tx_typo3wiki_domain_model_category']['ctrl'],
-       'interface' => array(
-               'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, pages',
-       ),
-       'types' => array(
-               '1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, title, pages,--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,starttime, endtime'),
-       ),
-       'palettes' => array(
-               '1' => array('showitem' => ''),
-       ),
-       'columns' => array(
-               'sys_language_uid' => array(
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
-                       'config' => array(
-                               'type' => 'select',
-                               'foreign_table' => 'sys_language',
-                               'foreign_table_where' => 'ORDER BY sys_language.title',
-                               'items' => array(
-                                       array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1),
-                                       array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)
-                               ),
-                       ),
-               ),
-               'l10n_parent' => array(
-                       'displayCond' => 'FIELD:sys_language_uid:>:0',
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
-                       'config' => array(
-                               'type' => 'select',
-                               'items' => array(
-                                       array('', 0),
-                               ),
-                               'foreign_table' => 'tx_typo3wiki_domain_model_category',
-                               'foreign_table_where' => 'AND tx_typo3wiki_domain_model_category.pid=###CURRENT_PID### AND tx_typo3wiki_domain_model_category.sys_language_uid IN (-1,0)',
-                       ),
-               ),
-               'l10n_diffsource' => array(
-                       'config' => array(
-                               'type' => 'passthrough',
-                       ),
-               ),
-               't3ver_label' => array(
-                       'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
-                       'config' => array(
-                               'type' => 'input',
-                               'size' => 30,
-                               'max' => 255,
-                       )
-               ),
-               'hidden' => array(
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden',
-                       'config' => array(
-                               'type' => 'check',
-                       ),
-               ),
-               'starttime' => array(
-                       'exclude' => 1,
-                       'l10n_mode' => 'mergeIfNotBlank',
-                       'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime',
-                       'config' => array(
-                               'type' => 'input',
-                               'size' => 13,
-                               'max' => 20,
-                               'eval' => 'datetime',
-                               'checkbox' => 0,
-                               'default' => 0,
-                               'range' => array(
-                                       'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
-                               ),
-                       ),
-               ),
-               'endtime' => array(
-                       'exclude' => 1,
-                       'l10n_mode' => 'mergeIfNotBlank',
-                       'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime',
-                       'config' => array(
-                               'type' => 'input',
-                               'size' => 13,
-                               'max' => 20,
-                               'eval' => 'datetime',
-                               'checkbox' => 0,
-                               'default' => 0,
-                               'range' => array(
-                                       'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
-                               ),
-                       ),
-               ),
-               'title' => array(
-                       'exclude' => 0,
-                       'label' => 'LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_domain_model_category.title',
-                       'config' => array(
-                               'type' => 'input',
-                               'size' => 30,
-                               'eval' => 'trim,required'
-                       ),
-               ),
-               'pages' => array(
-                       'exclude' => 0,
-                       'label' => 'LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_domain_model_category.pages',
-                       'config' => array(
-                               'type' => 'select',
-                               'foreign_table' => 'tx_typo3wiki_domain_model_page',
-                               'MM' => 'tx_typo3wiki_category_page_mm',
-                               'size' => 10,
-                               'autoSizeMax' => 30,
-                               'maxitems' => 9999,
-                               'multiple' => 0,
-                               'wizards' => array(
-                                       '_PADDING' => 1,
-                                       '_VERTICAL' => 1,
-                                       'edit' => array(
-                                               'type' => 'popup',
-                                               'title' => 'Edit',
-                                               'script' => 'wizard_edit.php',
-                                               'icon' => 'edit2.gif',
-                                               'popup_onlyOpenIfSelected' => 1,
-                                               'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
-                                               ),
-                                       'add' => Array(
-                                               'type' => 'script',
-                                               'title' => 'Create new',
-                                               'icon' => 'add.gif',
-                                               'params' => array(
-                                                       'table' => 'tx_typo3wiki_domain_model_page',
-                                                       'pid' => '###CURRENT_PID###',
-                                                       'setValue' => 'prepend'
-                                                       ),
-                                               'script' => 'wizard_add.php',
-                                       ),
-                               ),
-                       ),
-               ),
-       ),
-);
-
-?>
\ No newline at end of file
index 5ae38d4..d5c9599 100755 (executable)
@@ -6,10 +6,10 @@ if (!defined ('TYPO3_MODE')) {
 $TCA['tx_typo3wiki_domain_model_page'] = array(
        'ctrl' => $TCA['tx_typo3wiki_domain_model_page']['ctrl'],
        'interface' => array(
-               'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, page_title, subscriber, redirection, related_pages, main_revision, revisions',
+               'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, page_title, subscriber, redirection, is_category, category_pages, related_pages, main_revision, revisions',
        ),
        'types' => array(
-               '1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, page_title, subscriber, redirection, related_pages, --div--;LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_domain_model_page.revisions, main_revision, revisions, --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, page_title, subscriber, redirection, is_category, category_pages, related_pages, --div--;LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_domain_model_page.revisions, main_revision, revisions, --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,starttime, endtime'),
        ),
        'palettes' => array(
                '1' => array('showitem' => ''),
@@ -203,25 +203,30 @@ $TCA['tx_typo3wiki_domain_model_page'] = array(
                                'wizards' => array(
                                        '_PADDING' => 1,
                                        '_VERTICAL' => 1,
-                                       'edit' => array(
-                                               'type' => 'popup',
-                                               'title' => 'Edit',
-                                               'script' => 'wizard_edit.php',
-                                               'icon' => 'edit2.gif',
-                                               'popup_onlyOpenIfSelected' => 1,
-                                               'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
-                                               ),
-                                       'add' => Array(
-                                               'type' => 'script',
-                                               'title' => 'Create new',
-                                               'icon' => 'add.gif',
-                                               'params' => array(
-                                                       'table' => 'tx_typo3wiki_domain_model_page',
-                                                       'pid' => '###CURRENT_PID###',
-                                                       'setValue' => 'prepend'
-                                                       ),
-                                               'script' => 'wizard_add.php',
-                                       ),
+                               ),
+                       ),
+               ),
+               'is_category' => array(
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_domain_model_page.is_category',
+                       'config' => array(
+                               'type' => 'check',
+                       ),
+               ),
+               'category_pages' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_domain_model_page.category_pages',
+                       'config' => array(
+                               'type' => 'select',
+                               'foreign_table' => 'tx_typo3wiki_domain_model_page',
+                               'MM' => 'tx_typo3wiki_category_page_mm',
+                               'size' => 10,
+                               'autoSizeMax' => 30,
+                               'maxitems' => 9999,
+                               'multiple' => 0,
+                               'wizards' => array(
+                                       '_PADDING' => 1,
+                                       '_VERTICAL' => 1,
                                ),
                        ),
                ),
index d6264d5..78c6c61 100755 (executable)
                        <trans-unit id="tx_typo3wiki_domain_model_page.redirection">
                <source>Redirection</source>
             </trans-unit>
+            <trans-unit id="tx_typo3wiki_domain_model_page.category_pages">
+               <source>Category Pages</source>
+            </trans-unit>
+            <trans-unit id="tx_typo3wiki_domain_model_page.is_category">
+               <source>Is Category</source>
+            </trans-unit>
 
                        <trans-unit id="tx_typo3wiki_domain_model_textrevision">
                                <source>Text Revision</source>
                        <trans-unit id="fe_users.tx_extbase_type.Tx_Typo3wiki_User">
                                <source>TYPO3 Wiki User</source>
                        </trans-unit>
-                       
-                       <trans-unit id="tx_typo3wiki_domain_model_category">
-                               <source>Category</source>
-                       </trans-unit>
-                       <trans-unit id="tx_typo3wiki_domain_model_category.title">
-                               <source>Title</source>
-                       </trans-unit>
-                       <trans-unit id="tx_typo3wiki_domain_model_category.pages">
-                               <source>Pages</source>
-                       </trans-unit>
-
 
                        <trans-unit id="tx_typo3wiki_backend.cacheMenu">
                                <source>Empty Wiki Cache</source>
diff --git a/Resources/Private/Templates/Rendering/CategoryList.html b/Resources/Private/Templates/Rendering/CategoryList.html
new file mode 100644 (file)
index 0000000..ebaebee
--- /dev/null
@@ -0,0 +1,18 @@
+<f:if condition="{pages}">
+    <f:then>
+        <div class="categoryPageList">
+            <ul>
+                <f:for each="{pages}" as="child" key="title">
+                    <f:if condition="{child}">
+                        <f:then>
+                            <li>[[{child.pageTitle}]]</li>
+                        </f:then>
+                    </f:if>
+                </f:for>
+            </ul>
+        </div>
+    </f:then>
+    <f:else>
+         No List Elements
+    </f:else>
+</f:if>
diff --git a/Resources/Private/Templates/Rendering/PageCategories.html b/Resources/Private/Templates/Rendering/PageCategories.html
new file mode 100644 (file)
index 0000000..1b549d9
--- /dev/null
@@ -0,0 +1,11 @@
+<f:if condition="{categories}">
+    <div class="categoriesList">
+        <f:for each="{categories}" as="child" key="title">
+                <f:if condition="{child}">
+                    <f:then>
+                       <span>[[{child}]]</span>
+                    </f:then>
+                </f:if>
+        </f:for>
+    </div>
+</f:if>
index b18c849..fe54d2d 100755 (executable)
@@ -101,33 +101,4 @@ $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'] .= '';
-
-t3lib_extMgm::addLLrefForTCAdescr('tx_typo3wiki_domain_model_category', 'EXT:typo3wiki/Resources/Private/Language/locallang_csh_tx_typo3wiki_domain_model_category.xlf');
-t3lib_extMgm::allowTableOnStandardPages('tx_typo3wiki_domain_model_category');
-$TCA['tx_typo3wiki_domain_model_category'] = array(
-       'ctrl' => array(
-               'title' => 'LLL:EXT:typo3wiki/Resources/Private/Language/locallang_db.xlf:tx_typo3wiki_domain_model_category',
-               'label' => 'title',
-               'tstamp' => 'tstamp',
-               'crdate' => 'crdate',
-               'cruser_id' => 'cruser_id',
-               'dividers2tabs' => TRUE,
-
-               'origUid' => 't3_origuid',
-               'languageField' => 'sys_language_uid',
-               'transOrigPointerField' => 'l10n_parent',
-               'transOrigDiffSourceField' => 'l10n_diffsource',
-               'delete' => 'deleted',
-               'enablecolumns' => array(
-                       'disabled' => 'hidden',
-                       'starttime' => 'starttime',
-                       'endtime' => 'endtime',
-               ),
-               'searchFields' => 'title,pages,',
-               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Category.php',
-               'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'Resources/Public/Icons/tx_typo3wiki_domain_model_category.gif'
-       ),
-);
-
-?>
\ No newline at end of file
+$TCA['fe_users']['types']['Tx_Typo3wiki_User']['showitem'] .= '';
\ No newline at end of file
index 77689d3..f81fc66 100755 (executable)
@@ -7,10 +7,12 @@ CREATE TABLE tx_typo3wiki_domain_model_page (
        pid int(11) DEFAULT '0' NOT NULL,
 
        page_title varchar(255) DEFAULT '' NOT NULL,
+       is_category tinyint(4) unsigned DEFAULT '0' NOT NULL,
        subscriber int(11) unsigned DEFAULT '0' NOT NULL,
        revisions int(11) unsigned DEFAULT '0' NOT NULL,
        main_revision int(11) unsigned DEFAULT '0',
        related_pages int(11) unsigned DEFAULT '0' NOT NULL,
+       category_pages int(11) unsigned DEFAULT '0' NOT NULL,
        redirection int(11) unsigned DEFAULT '0',
 
        tstamp int(11) unsigned DEFAULT '0' NOT NULL,
@@ -80,37 +82,6 @@ CREATE TABLE fe_users (
 );
 
 #
-# Table structure for table 'tx_typo3wiki_domain_model_category'
-#
-CREATE TABLE tx_typo3wiki_domain_model_category (
-
-       uid int(11) NOT NULL auto_increment,
-       pid int(11) DEFAULT '0' NOT NULL,
-
-       title varchar(255) DEFAULT '' NOT NULL,
-       pages int(11) unsigned DEFAULT '0' NOT NULL,
-
-       tstamp int(11) unsigned DEFAULT '0' NOT NULL,
-       crdate int(11) unsigned DEFAULT '0' NOT NULL,
-       cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
-       deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
-       hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
-       starttime int(11) unsigned DEFAULT '0' NOT NULL,
-       endtime int(11) unsigned DEFAULT '0' NOT NULL,
-
-       t3_origuid int(11) DEFAULT '0' NOT NULL,
-       sys_language_uid int(11) DEFAULT '0' NOT NULL,
-       l10n_parent int(11) DEFAULT '0' NOT NULL,
-       l10n_diffsource mediumblob,
-
-       PRIMARY KEY (uid),
-       KEY parent (pid),
-
-       KEY language (l10n_parent,sys_language_uid)
-
-);
-
-#
 # Table structure for table 'tx_typo3wiki_domain_model_textrevision'
 #
 CREATE TABLE tx_typo3wiki_domain_model_textrevision (