public static function GetRecentlyModified($root, $path = "") { $aryDirs = FileSystemHelper::GetAllDirectories($root, $path); $aryPages = array(); foreach ($aryDirs as $d) { if (Page::isPage($d)) { $aryPages[$d] = filemtime(getXMLPath($d)); } } arSort($aryPages, SORT_NUMERIC); return $aryPages; }
public static function create($page, $type) { // copy default XML $strTemplatePath = getContentTypePath($type) . "/default-content.xml"; $strPath = getXMLPath($page); mkdir(dirname($strPath)); file_put_contents($strPath, file_get_contents($strTemplatePath)); // create php file $level = ".." . preg_replace("/[^\\/]+/", "..", $page); $strPath = getPath($page) . "/index.php"; file_put_contents($strPath, "<?php require \"" . $level . "/index.php\";?>"); // set page content type $objPage = new Page($page); $objPage->setContentType($type); $objPage->save(); // set page order $objOrder = new PageOrder(listDeleteAt($page, listLen($page, "/"), "/")); if ($objOrder->getIndex($objPage->getName()) < 0) { $objOrder->add($objPage->getName()); } $objOrder->save(); return $objPage; }