/**
  * Export all pages
  */
 function exportHTMLPages()
 {
     global $tpl, $ilBench, $ilLocator;
     require_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
     $pages = ilPortfolioPage::getAllPages($this->object->getId());
     $this->tabs = array();
     foreach ($pages as $page) {
         // substitute blog id with title
         if ($page["type"] == ilPortfolioPage::TYPE_BLOG) {
             include_once "Modules/Blog/classes/class.ilObjBlog.php";
             $page["title"] = ilObjBlog::_lookupTitle((int) $page["title"]);
         }
         $this->tabs[$page["id"]] = $page["title"];
     }
     // for sub-pages, e.g. blog postings
     $tpl_callback = array($this, "buildExportTemplate");
     include_once "./Services/COPage/classes/class.ilPageContentUsage.php";
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
     include_once "./Modules/Portfolio/classes/class.ilPortfolioPage.php";
     $has_index = false;
     foreach ($pages as $page) {
         if (ilPortfolioPage::_exists("prtf", $page["id"])) {
             $this->active_tab = "user_page_" . $page["id"];
             if ($page["type"] == ilPortfolioPage::TYPE_BLOG) {
                 $link_template = "prtf_" . $page["id"] . "_bl{TYPE}_{ID}.html";
                 include_once "Modules/Blog/classes/class.ilObjBlogGUI.php";
                 $blog = new ilObjBlogGUI((int) $page["title"], ilObject2GUI::WORKSPACE_OBJECT_ID);
                 $blog->exportHTMLPages($this->export_dir . "/", $link_template, $tpl_callback, $this->co_page_html_export, "prtf_" . $page["id"] . ".html");
             } else {
                 $this->exportPageHTML($page["id"]);
                 $this->co_page_html_export->collectPageElements("prtf:pg", $page["id"]);
             }
             if (!$has_index) {
                 copy($this->export_dir . "/prtf_" . $page["id"] . ".html", $this->export_dir . "/index.html");
                 $has_index = true;
             }
         }
     }
     $this->co_page_html_export->exportPageElements();
 }