本文整理匯總了PHP中tree::move方法的典型用法代碼示例。如果您正苦於以下問題:PHP tree::move方法的具體用法?PHP tree::move怎麽用?PHP tree::move使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tree
的用法示例。
在下文中一共展示了tree::move方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
echo "\n";
}
echo "\n]";
break;
case "delete":
$id = (int) str_replace("node_", "", $_REQUEST["id"]);
$tree->remove($id);
$db->query("DELETE FROM content WHERE id = " . $id);
echo "OK";
break;
case "create":
case "move":
$id = (int) str_replace("node_", "", $_REQUEST["id"]);
$ref_id = (int) str_replace("node_", "", $_REQUEST["ref_id"]);
$type = $_REQUEST["move_type"];
$result = $tree->move($id, $ref_id, $type);
if ($id == 0) {
foreach ($languages as $k => $lang) {
$db->query("INSERT INTO content (id,language,name,data) VALUES(" . $result . "," . $k . ",'New folder','')");
}
echo "node_" . $result;
}
break;
case "rename":
$sql = "UPDATE content SET name = '" . addslashes($_REQUEST["data"]) . "' WHERE id = " . (int) str_replace("node_", "", $_REQUEST["id"]) . " AND language = " . (int) $_REQUEST["lang"];
$db->query($sql);
echo $sql;
break;
case "loadfile":
$db->query("SELECT * FROM content WHERE id = " . (int) str_replace("node_", "", $_REQUEST["id"]) . " AND language = " . (int) $_REQUEST["lang"]);
$db->nextr();