Fixed bug Bug #10224: Not possible to set links to pages underneath a page with activ...
authorSusanne Moog <typo3@susannemoog.de>
Fri, 30 Apr 2010 20:43:37 +0000 (20:43 +0000)
committerSusanne Moog <typo3@susannemoog.de>
Fri, 30 Apr 2010 20:43:37 +0000 (20:43 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7483 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_browsetree.php
t3lib/class.t3lib_treeview.php
typo3/browse_links.php
typo3/class.browse_links.php
typo3/sysext/rtehtmlarea/mod3/browse_links.php
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php

index d5a87d5..fae61f3 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@
        * Fixed bug #11811: Raise versions and states of sysexts (stable <-> 1.0.0) (thanks to Steffen Gebert)
        * Fixed bug #14179: TCA select doesn't show record titles whic start with <= (thanks to Georg Ringer)
        * Added feature #14247: Add a concatenator for CSS and JS (thanks to Steffen Gebert)
+       * Fixed bug Bug #10224: Not possible to set links to pages underneath a page with activated "temporary DB mount" (thanks to Georg Ringer)
 
 2010-04-30  Steffen Kamper  <info@sk-typo3.de>
 
index 62b74ea..e57e210 100644 (file)
@@ -31,7 +31,7 @@
  * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @coauthor   René Fritz <r.fritz@colorcube.de>
+ * @coauthor   René Fritz <r.fritz@colorcube.de>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
@@ -65,7 +65,7 @@
  * Extension class for the t3lib_treeView class, specially made for browsing pages
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @coauthor   René Fritz <r.fritz@colorcube.de>
+ * @coauthor   Ren Fritz <r.fritz@colorcube.de>
  * @see t3lib_treeView, t3lib_pageTree
  * @package TYPO3
  * @subpackage t3lib
@@ -167,6 +167,23 @@ class t3lib_browseTree extends t3lib_treeView {
                }
                return $title;
        }
+
+       /**
+        * Adds a red "+" to the input string, $str, if the field "php_tree_stop" in the $row (pages) is set
+        *
+        * @param       string          Input string, like a page title for the tree
+        * @param       array           record row with "php_tree_stop" field
+        * @return      string          Modified string
+        * @access private
+        */
+       function wrapStop($str, $row)   {
+               if ($row['php_tree_stop']) {
+                       $str .= '<span class="typo3-red">
+                                                               <a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => $row['uid']))).'" class="typo3-red">+</a>
+                                                       </span>';
+               }
+               return $str;
+       }               
 }
 
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_browsetree.php'])       {
index 8b6090a..e384234 100644 (file)
@@ -31,7 +31,7 @@
  * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @coauthor   René Fritz <r.fritz@colorcube.de>
+ * @coauthor   René Fritz <r.fritz@colorcube.de>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
  * Base class for creating a browsable array/page/folder tree in HTML
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @coauthor   René Fritz <r.fritz@colorcube.de>
+ * @coauthor   René Fritz <r.fritz@colorcube.de>
  * @package TYPO3
  * @subpackage t3lib
  * @see t3lib_browsetree, t3lib_pagetree, t3lib_foldertree
@@ -547,7 +547,7 @@ class t3lib_treeView {
         */
        function wrapStop($str,$row)    {
                if ($row['php_tree_stop'])      {
-                       $str.='<span class="typo3-red">+ </span>';
+                       $str .= '<span class="typo3-red"><a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => $row['uid']))) . '" class="typo3-red">+</a> </span>';
                }
                return $str;
        }
index 6c13a55..4a3bb18 100644 (file)
@@ -133,6 +133,23 @@ class SC_browse_links {
         */
        function main() {
 
+               // Clear temporary DB mounts
+               $tmpMount = t3lib_div::_GET('setTempDBmount');
+               if (isset($tmpMount)) {
+                       $GLOBALS['BE_USER']->setAndSaveSessionData('pageTree_temporaryMountPoint', intval($tmpMount));
+               }
+
+               // Set temporary DB mounts
+               $tempDBmount = intval($GLOBALS['BE_USER']->getSessionData('pageTree_temporaryMountPoint'));
+               if ($tempDBmount) {
+                       $altMountPoints = $tempDBmount;
+               }
+               
+               if ($altMountPoints) {
+                       $GLOBALS['BE_USER']->groupData['webmounts'] = implode(',', array_unique(t3lib_div::intExplode(',', $altMountPoints)));
+                       $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
+               }
+
                $this->content = '';
 
                        // look for alternativ mountpoints
index de9e160..cfa95a6 100644 (file)
@@ -1413,6 +1413,21 @@ class browse_links {
                                $pagetree->thisScript = $this->thisScript;
                                $tree=$pagetree->getBrowsableTree();
                                $cElements = $this->expandPage();
+
+                               // Outputting Temporary DB mount notice:
+                               if (intval($GLOBALS['BE_USER']->getSessionData('pageTree_temporaryMountPoint')))        {
+                                       $link = '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => 0))) . '">' .
+                                                                               $LANG->sl('LLL:EXT:lang/locallang_core.xml:labels.temporaryDBmount', 1) .
+                                                                       '</a>';
+                                       $flashMessage = t3lib_div::makeInstance(
+                                               't3lib_FlashMessage',
+                                               $link,
+                                               '',
+                                               t3lib_FlashMessage::INFO
+                                       );
+                                       $dbmount = $flashMessage->render();
+                               }
+
                                $content.= '
 
                        <!--
@@ -1420,7 +1435,7 @@ class browse_links {
                        -->
                                        <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkPages">
                                                <tr>
-                                                       <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('pageTree').':').$tree.'</td>
+                                                       <td class="c-wCell" valign="top">' . $this->barheader($GLOBALS['LANG']->getLL('pageTree') . ':') . $dbmount . $tree . '</td>
                                                        <td class="c-wCell" valign="top">'.$cElements.'</td>
                                                </tr>
                                        </table>
index 021c033..3f24733 100644 (file)
@@ -67,6 +67,19 @@ class tx_rtehtmlarea_SC_browse_links {
        function main() {
                        // Setting alternative web browsing mounts (ONLY local to browse_links.php this script so they stay "read-only")
                $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.altElementBrowserMountPoints'));
+
+               // Clear temporary DB mounts
+               $tmpMount = t3lib_div::_GET('setTempDBmount');
+               if (isset($tmpMount)) {
+                       $GLOBALS['BE_USER']->setAndSaveSessionData('pageTree_temporaryMountPoint', intval($tmpMount));
+               }
+
+               // Set temporary DB mounts
+               $tempDBmount = intval($GLOBALS['BE_USER']->getSessionData('pageTree_temporaryMountPoint'));
+               if ($tempDBmount) {
+                       $altMountPoints = $tempDBmount;
+               }
+
                if ($altMountPoints) {
                        $GLOBALS['BE_USER']->groupData['webmounts'] = implode(',', array_unique(t3lib_div::intExplode(',', $altMountPoints)));
                        $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
index 97e7406..0c1e7c8 100644 (file)
@@ -816,14 +816,30 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                                $pagetree->addField('nav_title');
                                $tree=$pagetree->getBrowsableTree();
                                $cElements = $this->expandPage();
-                               $content.= '
+
+
+                               // Outputting Temporary DB mount notice:
+                               if (intval($GLOBALS['BE_USER']->getSessionData('pageTree_temporaryMountPoint')))        {
+                                       $link = '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => 0))) . '">' .
+                                                                               $LANG->sl('LLL:EXT:lang/locallang_core.xml:labels.temporaryDBmount', 1) .
+                                                                       '</a>';
+                                       $flashMessage = t3lib_div::makeInstance(
+                                               't3lib_FlashMessage',
+                                               $link,
+                                               '',
+                                               t3lib_FlashMessage::INFO
+                                       );
+                                       $dbmount = $flashMessage->render();
+                               }
+                               
+                               $content .= '
                        <!--
                                Wrapper table for page tree / record list:
                        -->
                                        <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkPages">
                                                <tr>
-                                                       <td class="c-wCell" valign="top">'.$this->barheader($LANG->getLL('pageTree').':').$tree.'</td>
-                                                       <td class="c-wCell" valign="top">'.$cElements.'</td>
+                                                       <td class="c-wCell" valign="top">' . $this->barheader($LANG->getLL('pageTree') . ':') . $dbmount . $tree . '</td>
+                                                       <td class="c-wCell" valign="top">' . $cElements . '</td>
                                                </tr>
                                        </table>
                                        ';