public function mygetPageContent($args) { $reg_exp = '#<body>(.*?)<\\/body>#si'; if (VBox::isExist('Page')) { $old_page = @VBox::get('Page'); } $pageId = (int) $args[0]; // var_dump($pageId); $page = new Page($pageId); // var_dump($page->checkHidden()); if ($page && !$page->checkHidden()) { $page->dropAllHeaders(); ob_start(); $agregator = new Agregator($pageId); $agregator->process(true); $content = ob_get_contents(); ob_clean(); if (!is_null($old_page)) { VBox::set('Page', $old_page); } if (!isset($args[1]) && preg_match($reg_exp, $content, $matches)) { return $matches[1]; } return $content; } }