|
From: Jon O. <jon...@us...> - 2008-02-27 21:33:49
|
Update of /cvsroot/mxbb/mx_simpledoc/simpledoc/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28373/includes Modified Files: functions_node.php Log Message: Updated: Bugfix for releases New feature: Renaming folders and docs Index: functions_node.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/includes/functions_node.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions_node.php 17 Sep 2006 20:15:56 -0000 1.4 --- functions_node.php 27 Feb 2008 21:33:40 -0000 1.5 *************** *** 203,206 **** --- 203,218 ---- $this->saveSort($this->path, array_merge($sort, array($name))); } + function rename($name, $is_folder) { + if (!$this->id) { return trigger_error("Node.rename() failed, no id", E_USER_ERROR); } + if ($this->isFolder()) { + //die('isFolder: ' . $this->path . ' - ' . dirname($this->path). '/' . $name ); + IoFile::rename($this->path, dirname($this->path).'/' . $name); + $this->fixSort($this->currFolder); + } else { + //die('isDoc: ' . $this->path . ' - ' . dirname($this->path). '/' . $name ); + IoDir::rename($this->path, dirname($this->path).'/' . $name); + $this->fixSort($this->currFolder); + } + } function remove() { if (!$this->id) { return trigger_error("Node.remove() failed, this action cannot be executed for the root element", E_USER_ERROR); } |