public function setName($name) { $strParentPath = listDeleteAt($this->path, listLen($this->path, "/"), "/"); $strOldName = $this->getName(); $strPath = listAppend($strParentPath, $name, "/"); rename(getPath($this->path), getPath($strPath)); PageOrder::rename($strParentPath, $strOldName, $name); $this->path = $strPath; }
function listLeft($list, $index, $delim = ",") { $arrList = split($delim, $list); $strNew = ""; foreach ($arrList as $i => $v) { if (i <= $index - 1) { $strNew = listAppend($strNew, $v, $delim); } } return $strNew; }