function copyPage()
 {
     global $ilCtrl, $lng;
     $form = $this->initCopyPageForm();
     if ($form->checkInput()) {
         // existing
         if ($form->getInput("target") == "old") {
             $portfolio_id = $form->getInput("prtf");
             $portfolio = new ilObjPortfolio($portfolio_id, false);
         } else {
             $portfolio = new ilObjPortfolio();
             $portfolio->setTitle($form->getInput("title"));
             $portfolio->create();
             $portfolio_id = $portfolio->getId();
         }
         // copy page(s)
         include_once "Services/Portfolio/classes/class.ilPortfolioPage.php";
         foreach ($_POST["prtf_pages"] as $page_id) {
             $source = new ilPortfolioPage($portfolio_id, $page_id);
             $target = new ilPortfolioPage($portfolio_id);
             $target->setXMLContent($source->copyXmlContent());
             $target->setType($source->getType());
             $target->setTitle($source->getTitle());
             $target->create();
         }
         ilUtil::sendSuccess($lng->txt("prtf_pages_copied"), true);
         $ilCtrl->redirect($this, "pages");
     }
     $form->setValuesByPost();
     $this->copyPageForm($form);
 }