[TASK] Rebuild extension translation list in lang module
[Packages/TYPO3.CMS.git] / typo3 / move_el.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
6 * All rights reserved
7 *
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.
13 *
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.
18 *
19 *
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.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Move element wizard:
29 * Moving pages or content elements (tt_content) around in the system via a page tree navigation.
30 *
31 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
32 * XHTML compatible.
33 *
34 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
35 */
36 $BACK_PATH = '';
37 require 'init.php';
38 // Include local language labels:
39 $LANG->includeLLFile('EXT:lang/locallang_misc.xml');
40 /**
41 * Local extension of the page tree class
42 *
43 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
44 * @package TYPO3
45 * @subpackage core
46 */
47 class localPageTree extends \TYPO3\CMS\Backend\Tree\View\PageTreeView {
48
49 /**
50 * Inserting uid-information in title-text for an icon
51 *
52 * @param string $icon Icon image
53 * @param array $row Item row
54 * @return string Wrapping icon image.
55 * @todo Define visibility
56 */
57 public function wrapIcon($icon, $row) {
58 return $this->addTagAttributes($icon, ' title="id=' . htmlspecialchars($row['uid']) . '"');
59 }
60
61 }
62
63 /**
64 * Extension of position map for pages
65 *
66 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
67 * @package TYPO3
68 * @subpackage core
69 */
70 class ext_posMap_pages extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
71
72 /**
73 * @todo Define visibility
74 */
75 public $l_insertNewPageHere = 'movePageToHere';
76
77 /**
78 * Creates the onclick event for the insert-icons.
79 *
80 * @param integer $pid The pid.
81 * @param integer $newPagePID New page id.
82 * @return string Onclick attribute content
83 * @todo Define visibility
84 */
85 public function onClickEvent($pid, $newPagePID) {
86 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;';
87 }
88
89 /**
90 * Wrapping page title.
91 *
92 * @param string $str Page title.
93 * @param array $rec Page record (?)
94 * @return string Wrapped title.
95 * @todo Define visibility
96 */
97 public function linkPageTitle($str, $rec) {
98 $url = \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('uid' => intval($rec['uid']), 'moveUid' => $GLOBALS['SOBE']->moveUid));
99 return '<a href="' . htmlspecialchars($url) . '">' . $str . '</a>';
100 }
101
102 /**
103 * Wrap $t_code in bold IF the $dat uid matches $id
104 *
105 * @param string $t_code Title string
106 * @param array $dat Infomation array with record array inside.
107 * @param integer $id The current id.
108 * @return string The title string.
109 * @todo Define visibility
110 */
111 public function boldTitle($t_code, $dat, $id) {
112 return parent::boldTitle($t_code, $dat, $GLOBALS['SOBE']->moveUid);
113 }
114
115 }
116
117 /**
118 * Extension of position map for content elements
119 *
120 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
121 * @package TYPO3
122 * @subpackage core
123 */
124 class ext_posMap_tt_content extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
125
126 /**
127 * @todo Define visibility
128 */
129 public $dontPrintPageInsertIcons = 1;
130
131 /**
132 * Wrapping page title.
133 *
134 * @param string $str Page title.
135 * @param array $rec Page record (?)
136 * @return string Wrapped title.
137 * @todo Define visibility
138 */
139 public function linkPageTitle($str, $rec) {
140 $url = \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('uid' => intval($rec['uid']), 'moveUid' => $GLOBALS['SOBE']->moveUid));
141 return '<a href="' . htmlspecialchars($url) . '">' . $str . '</a>';
142 }
143
144 /**
145 * Wrapping the title of the record.
146 *
147 * @param string $str The title value.
148 * @param array $row The record row.
149 * @return string Wrapped title string.
150 * @todo Define visibility
151 */
152 public function wrapRecordTitle($str, $row) {
153 if ($GLOBALS['SOBE']->moveUid == $row['uid']) {
154 $str = '<strong>' . $str . '</strong>';
155 }
156 return parent::wrapRecordTitle($str, $row);
157 }
158
159 }
160
161 /*
162 * @deprecated since 6.0, the classname SC_move_el and this file is obsolete
163 * and will be removed by 7.0. The class was renamed and is now located at:
164 * typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php
165 */
166 require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('backend') . 'Classes/Controller/ContentElement/MoveElementController.php';
167 // Make instance:
168 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\MoveElementController');
169 $SOBE->init();
170 $SOBE->main();
171 $SOBE->printContent();
172 ?>