2 /***************************************************************
5 * (c) 1999-2003 Kasper Skårhøj (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 ***************************************************************/
30 * @author Kasper Skårhøj <kasper@typo3.com>
39 require ("template.php");
40 include ("sysext/lang/locallang_misc.php");
41 require_once (PATH_t3lib
."class.t3lib_page.php");
42 require_once (PATH_t3lib
."class.t3lib_positionmap.php");
43 require_once (PATH_t3lib
."class.t3lib_pagetree.php");
48 // ***************************
50 // ***************************
51 class localPageTree
extends t3lib_pageTree
{
52 function wrapIcon($icon,$row) {
53 return substr($icon,0,-1).' title="id='.htmlspecialchars($row["uid"]).'">';
56 class ext_posMap_pages
extends t3lib_positionMap
{
57 var $l_insertNewPageHere = "movePageToHere";
59 function onClickEvent($pid) {
60 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;';
62 function linkPageTitle($str,$rec) {
63 return '<a href="'.t3lib_div
::linkThisScript(array("uid"=>intval($rec["uid"]),"moveUid"=>$GLOBALS["SOBE"]->moveUid
)).'">'.$str.'</a>';
65 function boldTitle($t_code,$dat,$id) {
66 return parent
::boldTitle($t_code,$dat,$GLOBALS["SOBE"]->moveUid
);
69 class ext_posMap_tt_content
extends t3lib_positionMap
{
70 var $dontPrintPageInsertIcons = 1;
72 function linkPageTitle($str,$rec) {
73 $str = '<a href="'.t3lib_div
::linkThisScript(array("uid"=>intval($rec["uid"]),"moveUid"=>$GLOBALS["SOBE"]->moveUid
)).'">'.$str.'</a>';
77 function wrapRecordTitle($str,$row) {
78 if ($GLOBALS["SOBE"]->moveUid
==$row["uid"]) $str = '<b>'.$str.'</b>';
79 return parent
::wrapRecordTitle($str,$row);
94 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
95 //debug($HTTP_GET_VARS);
96 $this->sys_language
= intval(t3lib_div
::GPvar("sys_language"));
97 $this->perms_clause
= $BE_USER->getPagePermsClause(1);
100 $this->doc
= t3lib_div
::makeInstance("mediumDoc");
101 $this->doc
->backPath
= $BACK_PATH;
102 $this->doc
->JScode
='';
105 // ***************************
107 // ***************************
109 $this->content
.=$this->doc
->startPage($LANG->getLL("movingElement"));
110 $this->content
.=$this->doc
->header($LANG->getLL("movingElement"));
111 $this->content
.=$this->doc
->spacer(5);
114 $this->page_id
=intval(t3lib_div
::GPvar("uid"));
115 $this->table
=t3lib_div
::GPvar("table");
116 $this->R_URI
=t3lib_div
::GPvar("returnUrl");
117 $this->moveUid
= t3lib_div
::GPvar("moveUid") ? t3lib_div
::GPvar("moveUid") : $this->page_id
;
120 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
122 if ($this->page_id
) {
124 $elRow = t3lib_BEfunc
::getRecord($this->table
,$this->moveUid
);
125 $hline = t3lib_iconWorks
::getIconImage($this->table
,$elRow,$BACK_PATH,t3lib_BEfunc
::titleAttrib(t3lib_BEfunc
::getRecordIconAltText($elRow,$this->table
),1).' align=top');
126 $hline.= t3lib_BEfunc
::getRecordTitle($this->table
,$elRow,1);
127 $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");
129 $this->content
.=$this->doc
->section($LANG->getLL("moveElement").":",$hline,0,1);
130 $this->content
.=$this->doc
->spacer(20);
134 if ((string)$this->table
=="pages") {
135 $pageinfo = t3lib_BEfunc
::readPageAccess($this->page_id
,$this->perms_clause
);
136 if (is_array($pageinfo)) {
139 $posMap = t3lib_div
::makeInstance("ext_posMap_pages");
140 $posMap->moveOrCopy
= t3lib_div
::GPvar("makeCopy")?
"copy":"move";
143 // $code.="<BR><strong>".$LANG->getLL("selectPositionOfElement").":</strong><BR><BR>";
144 if ($pageinfo["pid"]) {
145 $pidPageInfo = t3lib_BEfunc
::readPageAccess($pageinfo["pid"],$this->perms_clause
);
146 if (is_array($pidPageInfo)) {
147 $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>';
150 $code.= $posMap->positionTree($this->page_id
,$pageinfo,$this->perms_clause
,$this->R_URI
);
154 if ((string)$this->table
=="tt_content") {
155 $tt_content_rec = t3lib_BEfunc
::getRecord("tt_content",$this->moveUid
);
156 if (!t3lib_div
::GPvar("moveUid")) $this->page_id
= $tt_content_rec["pid"];
158 // debug($tt_content_rec["uid"]);
161 $pageinfo = t3lib_BEfunc
::readPageAccess($this->page_id
,$this->perms_clause
);
162 if (is_array($pageinfo)) {
163 $posMap = t3lib_div
::makeInstance("ext_posMap_tt_content");
164 $posMap->moveOrCopy
= t3lib_div
::GPvar("makeCopy")?
"copy":"move";
165 $posMap->cur_sys_language
= $this->sys_language
;
169 $hline = t3lib_iconWorks
::getIconImage("pages",$pageinfo,$BACK_PATH,t3lib_BEfunc
::titleAttrib(t3lib_BEfunc
::getRecordIconAltText($pageinfo,"pages"),1).' align=top');
170 $hline.= t3lib_BEfunc
::getRecordTitle("pages",$pageinfo,1);
173 $modTSconfig_SHARED = t3lib_BEfunc
::getModTSconfig($this->page_id
,"mod.SHARED"); // SHARED page-TSconfig settings.
174 $colPosList = strcmp(trim($modTSconfig_SHARED["properties"]["colPos_list"]),"") ?
trim($modTSconfig_SHARED["properties"]["colPos_list"]) : "1,0,2,3";
177 $code.=$posMap->printContentElementColumns($this->page_id
,$this->moveUid
,$colPosList,1,$this->R_URI
);
181 if ($pageinfo["pid"]) {
182 $pidPageInfo = t3lib_BEfunc
::readPageAccess($pageinfo["pid"],$this->perms_clause
);
183 if (is_array($pidPageInfo)) {
184 $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>';
187 $code.= $posMap->positionTree($this->page_id
,$pageinfo,$this->perms_clause
,$this->R_URI
);
192 $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>';
194 $this->content
.=$this->doc
->section($LANG->getLL("selectPositionOfElement").":",$code,0,1);
197 function printContent() {
199 $this->content
.= $this->doc
->middle();
200 $this->content
.= $this->doc
->endPage();
205 // Include extension?
206 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE
]["XCLASS"]["typo3/move_el.php"]) {
207 include_once($TYPO3_CONF_VARS[TYPO3_MODE
]["XCLASS"]["typo3/move_el.php"]);
222 $SOBE = t3lib_div
::makeInstance("SC_move_el");
225 $SOBE->printContent();