2 /***************************************************************
5 * (c) 1999-2003 Kasper Skaarhoj (kasper@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 ***************************************************************/
32 * @author Kasper Skaarhoj <kasper@typo3.com>
35 * [CLASS/FUNCTION INDEX of SCRIPT]
39 * 89: class localPageTree extends t3lib_pageTree
40 * 96: function wrapIcon($icon,$row)
43 * 118: class ext_posMap_pages extends t3lib_positionMap
44 * 125: function onClickEvent($pid)
45 * 134: function linkPageTitle($str,$rec)
46 * 144: function boldTitle($t_code,$dat,$id)
49 * 167: class ext_posMap_tt_content extends t3lib_positionMap
50 * 175: function linkPageTitle($str,$rec)
51 * 185: function wrapRecordTitle($str,$row)
54 * 209: class SC_move_el
55 * 223: function init()
56 * 255: function main()
57 * 339: function printContent()
60 * (This index is automatically created/updated by the extension "extdeveval")
67 require ('template.php');
68 include ('sysext/lang/locallang_misc.php');
69 require_once (PATH_t3lib
.'class.t3lib_page.php');
70 require_once (PATH_t3lib
.'class.t3lib_positionmap.php');
71 require_once (PATH_t3lib
.'class.t3lib_pagetree.php');
83 * Local extension of the page tree class
85 * @author Kasper Skaarhoj <kasper@typo3.com>
89 class localPageTree
extends t3lib_pageTree
{
92 * @param [type] $icon: ...
93 * @param [type] $row: ...
96 function wrapIcon($icon,$row) {
97 return substr($icon,0,-1).' title="id='.htmlspecialchars($row['uid']).'">';
112 * Extension of position map for pages
114 * @author Kasper Skaarhoj <kasper@typo3.com>
118 class ext_posMap_pages
extends t3lib_positionMap
{
119 var $l_insertNewPageHere = "movePageToHere";
122 * @param [type] $pid: ...
125 function onClickEvent($pid) {
126 return 'document.location=\'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().'\';return false;';
130 * @param [type] $str: ...
131 * @param [type] $rec: ...
134 function linkPageTitle($str,$rec) {
135 return '<a href="'.t3lib_div
::linkThisScript(array("uid"=>intval($rec["uid"]),"moveUid"=>$GLOBALS["SOBE"]->moveUid
)).'">'.$str.'</a>';
139 * @param [type] $t_code: ...
140 * @param [type] $dat: ...
141 * @param [type] $id: ...
144 function boldTitle($t_code,$dat,$id) {
145 return parent
::boldTitle($t_code,$dat,$GLOBALS["SOBE"]->moveUid
);
161 * Extension of position map for content elements
163 * @author Kasper Skaarhoj <kasper@typo3.com>
167 class ext_posMap_tt_content
extends t3lib_positionMap
{
168 var $dontPrintPageInsertIcons = 1;
171 * @param [type] $str: ...
172 * @param [type] $rec: ...
175 function linkPageTitle($str,$rec) {
176 $str = '<a href="'.t3lib_div
::linkThisScript(array("uid"=>intval($rec["uid"]),"moveUid"=>$GLOBALS["SOBE"]->moveUid
)).'">'.$str.'</a>';
181 * @param [type] $str: ...
182 * @param [type] $row: ...
185 function wrapRecordTitle($str,$row) {
186 if ($GLOBALS["SOBE"]->moveUid
==$row["uid"]) $str = '<b>'.$str.'</b>';
187 return parent
::wrapRecordTitle($str,$row);
205 * @author Kasper Skaarhoj <kasper@typo3.com>
224 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
225 //debug($HTTP_GET_VARS);
226 $this->sys_language
= intval(t3lib_div
::GPvar("sys_language"));
227 $this->perms_clause
= $BE_USER->getPagePermsClause(1);
230 $this->doc
= t3lib_div
::makeInstance("mediumDoc");
231 $this->doc
->backPath
= $BACK_PATH;
232 $this->doc
->JScode
='';
235 // ***************************
237 // ***************************
239 $this->content
.=$this->doc
->startPage($LANG->getLL("movingElement"));
240 $this->content
.=$this->doc
->header($LANG->getLL("movingElement"));
241 $this->content
.=$this->doc
->spacer(5);
244 $this->page_id
=intval(t3lib_div
::GPvar("uid"));
245 $this->table
=t3lib_div
::GPvar("table");
246 $this->R_URI
=t3lib_div
::GPvar("returnUrl");
247 $this->moveUid
= t3lib_div
::GPvar("moveUid") ? t3lib_div
::GPvar("moveUid") : $this->page_id
;
251 * [Describe function...]
256 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
258 if ($this->page_id
) {
260 $elRow = t3lib_BEfunc
::getRecord($this->table
,$this->moveUid
);
261 $hline = t3lib_iconWorks
::getIconImage($this->table
,$elRow,$BACK_PATH,t3lib_BEfunc
::titleAttrib(t3lib_BEfunc
::getRecordIconAltText($elRow,$this->table
),1).' align=top');
262 $hline.= t3lib_BEfunc
::getRecordTitle($this->table
,$elRow,1);
263 $hline.= '<BR><input type="hidden" name="makeCopy" value="0"><input type="checkbox" name="makeCopy" value="1"'.(t3lib_div
::GPvar("makeCopy")?
" CHECKED":"").' onClick="document.location=\''.t3lib_div
::linkThisScript(array("makeCopy"=>!t3lib_div
::GPvar("makeCopy"))).'\'">'.$LANG->getLL("makeCopy");
265 $this->content
.=$this->doc
->section($LANG->getLL("moveElement").":",$hline,0,1);
266 $this->content
.=$this->doc
->spacer(20);
270 if ((string)$this->table
=="pages") {
271 $pageinfo = t3lib_BEfunc
::readPageAccess($this->page_id
,$this->perms_clause
);
272 if (is_array($pageinfo)) {
275 $posMap = t3lib_div
::makeInstance("ext_posMap_pages");
276 $posMap->moveOrCopy
= t3lib_div
::GPvar("makeCopy")?
"copy":"move";
279 // $code.="<BR><strong>".$LANG->getLL("selectPositionOfElement").":</strong><BR><BR>";
280 if ($pageinfo["pid"]) {
281 $pidPageInfo = t3lib_BEfunc
::readPageAccess($pageinfo["pid"],$this->perms_clause
);
282 if (is_array($pidPageInfo)) {
283 $code.='<a href="'.t3lib_div
::linkThisScript(array("uid"=>intval($pageinfo["pid"]),"moveUid"=>$this->moveUid
)).'"><img src="gfx/i/pages_up.gif" width="18" height="16" border="0" align=top>'.t3lib_BEfunc
::getRecordTitle("pages",$pidPageInfo).'</a><BR>';
286 $code.= $posMap->positionTree($this->page_id
,$pageinfo,$this->perms_clause
,$this->R_URI
);
290 if ((string)$this->table
=="tt_content") {
291 $tt_content_rec = t3lib_BEfunc
::getRecord("tt_content",$this->moveUid
);
292 if (!t3lib_div
::GPvar("moveUid")) $this->page_id
= $tt_content_rec["pid"];
294 // debug($tt_content_rec["uid"]);
297 $pageinfo = t3lib_BEfunc
::readPageAccess($this->page_id
,$this->perms_clause
);
298 if (is_array($pageinfo)) {
299 $posMap = t3lib_div
::makeInstance("ext_posMap_tt_content");
300 $posMap->moveOrCopy
= t3lib_div
::GPvar("makeCopy")?
"copy":"move";
301 $posMap->cur_sys_language
= $this->sys_language
;
305 $hline = t3lib_iconWorks
::getIconImage("pages",$pageinfo,$BACK_PATH,t3lib_BEfunc
::titleAttrib(t3lib_BEfunc
::getRecordIconAltText($pageinfo,"pages"),1).' align=top');
306 $hline.= t3lib_BEfunc
::getRecordTitle("pages",$pageinfo,1);
309 $modTSconfig_SHARED = t3lib_BEfunc
::getModTSconfig($this->page_id
,"mod.SHARED"); // SHARED page-TSconfig settings.
310 $colPosList = strcmp(trim($modTSconfig_SHARED["properties"]["colPos_list"]),"") ?
trim($modTSconfig_SHARED["properties"]["colPos_list"]) : "1,0,2,3";
313 $code.=$posMap->printContentElementColumns($this->page_id
,$this->moveUid
,$colPosList,1,$this->R_URI
);
317 if ($pageinfo["pid"]) {
318 $pidPageInfo = t3lib_BEfunc
::readPageAccess($pageinfo["pid"],$this->perms_clause
);
319 if (is_array($pidPageInfo)) {
320 $code.='<a href="'.t3lib_div
::linkThisScript(array("uid"=>intval($pageinfo["pid"]),"moveUid"=>$this->moveUid
)).'"><img src="gfx/i/pages_up.gif" width="18" height="16" border="0" align=top>'.t3lib_BEfunc
::getRecordTitle("pages",$pidPageInfo).'</a><BR>';
323 $code.= $posMap->positionTree($this->page_id
,$pageinfo,$this->perms_clause
,$this->R_URI
);
328 $code.='<BR><BR><a href="'.$this->R_URI
.'" class="typo3-goBack"><img src="gfx/goback.gif" width="14" height="14" hspace="2" border="0" align="top"><strong>'.$LANG->getLL("goBack").'</strong></a>';
330 $this->content
.=$this->doc
->section($LANG->getLL("selectPositionOfElement").":",$code,0,1);
335 * [Describe function...]
339 function printContent() {
341 $this->content
.= $this->doc
->middle();
342 $this->content
.= $this->doc
->endPage();
347 // Include extension?
348 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['typo3/move_el.php']) {
349 include_once($TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['typo3/move_el.php']);
364 $SOBE = t3lib_div
::makeInstance('SC_move_el');
367 $SOBE->printContent();