[TYPO3-english] Copy page in fe plugin

Peter Russ peter.russ at 4many.net
Wed Feb 24 21:17:29 CET 2010


--- Original Nachricht ---
Absender:   Iban Cardona i Subiela
Datum:       24.02.2010 20:39:
> Hello,
> 
> I want to copy in recursive-mode a typo3 page in an other page.
> In my my fe plugin, I implemented this code but it only copy the page 
> and the contents. The "title", "doktype" and "tx_templavoila_flex 
> <http://proves.serialnet.net/phpmyadmin/sql.php?db=typo42&table=pages&sql_query=SELECT+%2A+FROM+%60pages%60+ORDER+BY+%60pages%60.%60tx_templavoila_flex%60+ASC&token=3845a719b645b3ec92950bb9b04d5476>" 
> are not copied. Could you help me? Thank you so much.
> 
> $new_BE_USER = t3lib_div::makeInstance("t3lib_beUserAuth");
> $new_BE_USER->OS = TYPO3_OS;
> $new_BE_USER->setBeUserByUid($this->uid_userAdmin_be);
> $new_BE_USER->fetchGroupData();
> $root_page_pid = $this->copyDummyPages($id_old_page, $new_BE_USER, 
> $folder_news_page);
> 
> function copyDummyPages($src_uid, $new_BE_USER, $dest_uid) {
>         $this->tce = t3lib_div::makeInstance("t3lib_TCEmain");
>         $this->tce->stripslashes_values = 0;
>         $this->tce->copyTree = 10;
>         $this->tce->neverHideAtCopy = 1;
> 
>         // setting the user to admin rights temporarily during copy. The 
> reason is that everything must be copied fully!
>         $new_BE_USER->user["admin"] = 1;
> 
>         // making copy-command
>         $cmd = array();
>         $cmd["pages"][$src_uid]["copy"] = $dest_uid;
>         $this->tce->start(array(),$cmd,$new_BE_USER);
>         $this->tce->process_cmdmap();
> 
>         // getting the new root page id.
>         $this->tce->clear_cacheCmd("temp_CACHED");
>         $root_page_pid = $this->tce->copyMappingArray["pages"][$src_uid];
> 
>         // unsetting the user.
>         unset($new_BE_USER);
> 
>         return $root_page_pid;
>     }
> 

Why don't you set the used BE_user as admin by default?
Is there any TSconfig setup that disable copying of title, doktype or 
templavailaflex?

Peter.

-- 
"Wer weiß, wie Gesetze und Würste zu Stande kommen, kann nachts nicht 
mehr ruhig schlafen." (Otto von Bismarck)

_____________________________
uon GbR
http://www.uon.li
http://www.xing.com/profile/Peter_Russ


More information about the TYPO3-english mailing list