2 /***************************************************************
5 * (c) 1999-2013 Kasper Skårhøj (kasperYYYY@typo3.com)
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
28 * Move element wizard:
29 * Moving pages or content elements (tt_content) around in the system via a page tree navigation.
31 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
34 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
38 // Include local language labels:
39 $LANG->includeLLFile('EXT:lang/locallang_misc.xlf');
41 * Local extension of the page tree class
43 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
45 class localPageTree
extends \TYPO3\CMS\Backend\Tree\View\PageTreeView
{
48 * Inserting uid-information in title-text for an icon
50 * @param string $icon Icon image
51 * @param array $row Item row
52 * @return string Wrapping icon image.
53 * @todo Define visibility
55 public function wrapIcon($icon, $row) {
56 return $this->addTagAttributes($icon, ' title="id=' . htmlspecialchars($row['uid']) . '"');
62 * Extension of position map for pages
64 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
66 class ext_posMap_pages
extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap
{
69 * @todo Define visibility
71 public $l_insertNewPageHere = 'movePageToHere';
74 * Creates the onclick event for the insert-icons.
76 * @param integer $pid The pid.
77 * @param integer $newPagePID New page id.
78 * @return string Onclick attribute content
79 * @todo Define visibility
81 public function onClickEvent($pid, $newPagePID) {
82 return 'window.location.href=\'tce_db.php?cmd[pages][' . $GLOBALS['SOBE']->moveUid
. '][' . $this->moveOrCopy
. ']=' . $pid . '&redirect=' . rawurlencode($this->R_URI
) . '&prErr=1&uPT=1&vC=' . $GLOBALS['BE_USER']->veriCode() . \TYPO3\CMS\Backend\Utility\BackendUtility
::getUrlToken('tceAction') . '\';return false;';
86 * Wrapping page title.
88 * @param string $str Page title.
89 * @param array $rec Page record (?)
90 * @return string Wrapped title.
91 * @todo Define visibility
93 public function linkPageTitle($str, $rec) {
94 $url = \TYPO3\CMS\Core\Utility\GeneralUtility
::linkThisScript(array('uid' => intval($rec['uid']), 'moveUid' => $GLOBALS['SOBE']->moveUid
));
95 return '<a href="' . htmlspecialchars($url) . '">' . $str . '</a>';
99 * Wrap $t_code in bold IF the $dat uid matches $id
101 * @param string $t_code Title string
102 * @param array $dat Infomation array with record array inside.
103 * @param integer $id The current id.
104 * @return string The title string.
105 * @todo Define visibility
107 public function boldTitle($t_code, $dat, $id) {
108 return parent
::boldTitle($t_code, $dat, $GLOBALS['SOBE']->moveUid
);
114 * Extension of position map for content elements
116 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
118 class ext_posMap_tt_content
extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap
{
121 * @todo Define visibility
123 public $dontPrintPageInsertIcons = 1;
126 * Wrapping page title.
128 * @param string $str Page title.
129 * @param array $rec Page record (?)
130 * @return string Wrapped title.
131 * @todo Define visibility
133 public function linkPageTitle($str, $rec) {
134 $url = \TYPO3\CMS\Core\Utility\GeneralUtility
::linkThisScript(array('uid' => intval($rec['uid']), 'moveUid' => $GLOBALS['SOBE']->moveUid
));
135 return '<a href="' . htmlspecialchars($url) . '">' . $str . '</a>';
139 * Wrapping the title of the record.
141 * @param string $str The title value.
142 * @param array $row The record row.
143 * @return string Wrapped title string.
144 * @todo Define visibility
146 public function wrapRecordTitle($str, $row) {
147 if ($GLOBALS['SOBE']->moveUid
== $row['uid']) {
148 $str = '<strong>' . $str . '</strong>';
150 return parent
::wrapRecordTitle($str, $row);
156 * @deprecated since 6.0, the classname SC_move_el and this file is obsolete
157 * and will be removed with 6.2. The class was renamed and is now located at:
158 * typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php
160 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::extPath('backend') . 'Classes/Controller/ContentElement/MoveElementController.php';
162 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility
::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\MoveElementController');
165 $SOBE->printContent();