/** * Replace all substring occurences by another one in every keys on node and sub nodes. * @param {Integer} $id node index * @param {String} $old old substring value to replace * @param {String} $new new substring value */ static function setKeys($id, $old, $new) { $keys = model::keys($id); foreach ($keys as $key => $value) { model::setKey($id, $key, str_replace($old, $new, $value)); } $children = model::children($id); for ($i = 0; $i < sizeof($children); $i++) { model::setKeys($children[$i], $old, $new); } return true; }
/** * Get the links id of a node * @param {Integer} $id node id * @return {array} links */ static function rlink($id) { $result = model::rlinks($id); for ($i = 0; $i < sizeof($result); $i++) { $childcount = model::countChildren($id); $result[$i]["childcount"] = $childcount; $result[$i]["rlinks"] = model::countRLinks($result[$i]["id"]); $result[$i]["tags"] = model::tags($result[$i]["id"]); $result[$i]["keys"] = model::keys($result[$i]["id"]); } return $result; }