Fixed bug #14202: htmlArea RTE: Tables may get lost when using remove format feature
[Packages/TYPO3.CMS.git] / typo3 / class.browse_links.php
index c6d7122..5584435 100644 (file)
@@ -238,6 +238,12 @@ class TBE_browser_recordList extends localRecordList {
 class localPageTree extends t3lib_browseTree {
 
        /**
+        * whether the page ID should be shown next to the title, activate through userTSconfig (options.pageTree.showPageIdWithTitle)
+        * @boolean
+        */
+       public $ext_showPageId = FALSE;
+
+       /**
         * Constructor. Just calling init()
         *
         * @return      void
@@ -355,8 +361,12 @@ class localPageTree extends t3lib_browseTree {
         * @param       array           The row for the current element
         * @return      string          The processed icon input value.
         */
-       function wrapIcon($icon,$row)   {
-               return $this->addTagAttributes($icon,' title="id='.$row['uid'].'"');
+       function wrapIcon($icon, $row) {
+               $content = $this->addTagAttributes($icon, ' title="id=' . $row['uid'] . '"');
+               if ($this->ext_showPageId) {
+                       $content .= '[' . $row['uid'] . '] ';
+               }
+               return $content;
        }
 }
 
@@ -804,7 +814,7 @@ class browse_links {
 
                        // CurrentUrl - the current link url must be passed around if it exists
                if ($this->mode == 'wizard')    {
-                       $currentLinkParts = t3lib_div::trimExplode(' ',$this->P['currentValue']);
+                       $currentLinkParts = t3lib_div::unQuoteFilenames($this->P['currentValue'], TRUE);
                        $initialCurUrlArray = array (
                                'href'   => $currentLinkParts[0],
                                'target' => $currentLinkParts[1],
@@ -968,6 +978,14 @@ class browse_links {
                                                if (cur_title == "" && cur_class == "-") {
                                                        cur_class = "";
                                                }
+                                               cur_class = cur_class.replace(/[\'\"]/g, "");
+                                               if (cur_class.indexOf(" ") != -1) {
+                                                       cur_class = "\"" + cur_class + "\"";
+                                               }
+                                               cur_title = cur_title.replace(/(^\")|(\"$)/g, "");
+                                               if (cur_title.indexOf(" ") != -1) {
+                                                       cur_title = "\"" + cur_title + "\"";
+                                               }
                                                input = input + " " + cur_target + " " + cur_class + " " + cur_title;
                                                field.value = input;
                                                '.$update.'
@@ -1403,8 +1421,24 @@ class browse_links {
                        case 'page':
                                $pagetree = t3lib_div::makeInstance('rtePageTree');
                                $pagetree->thisScript = $this->thisScript;
+                               $pagetree->ext_showPageId = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPageIdWithTitle');
                                $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.= '
 
                        <!--
@@ -1412,7 +1446,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>
@@ -1550,6 +1584,7 @@ class browse_links {
                $pagetree->thisScript=$this->thisScript;
                $pagetree->ext_pArrPages = !strcmp($pArr[3],'pages')?1:0;
                $pagetree->ext_showNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle');
+               $pagetree->ext_showPageId = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPageIdWithTitle');
                $pagetree->addField('nav_title');
                $tree=$pagetree->getBrowsableTree();
 
@@ -2065,6 +2100,7 @@ class browse_links {
        function TBE_expandFolder($expandFolder=0,$extensionList='',$noThumbs=0)        {
                global $LANG;
 
+               $extensionList = ($extensionList == '*') ? '' : $extensionList;
                $expandFolder = $expandFolder ? $expandFolder : $this->expandFolder;
                $out='';
                if ($expandFolder && $this->checkFolder($expandFolder)) {
@@ -2333,6 +2369,7 @@ class browse_links {
        function TBE_dragNDrop($expandFolder=0,$extensionList='')       {
                global $BACK_PATH;
 
+               $extensionList = ($extensionList == '*') ? '' : $extensionList;
                $expandFolder = $expandFolder ? $expandFolder : $this->expandFolder;
                $out='';
                if ($expandFolder && $this->checkFolder($expandFolder)) {