本文整理汇总了PHP中ilTree::moveTree方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTree::moveTree方法的具体用法?PHP ilTree::moveTree怎么用?PHP ilTree::moveTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTree
的用法示例。
在下文中一共展示了ilTree::moveTree方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ilSetting
?>
<#3462>
<?php
$ilDB->setLimit(1);
$query = "SELECT object_data.obj_id, object_reference.ref_id FROM object_data INNER JOIN object_reference on object_data.obj_id = object_reference.obj_id WHERE type = 'chta'";
$rset = $ilDB->query($query);
$row = $ilDB->fetchAssoc($rset);
$chatfolder_obj_id = $row['obj_id'];
$chatfolder_ref_id = $row['ref_id'];
$settings = new ilSetting('chatroom');
$public_room_ref_id = $settings->get('public_room_ref', 0);
if ($public_room_ref_id) {
$tree = new ilTree(ROOT_FOLDER_ID);
$pid = $tree->getParentId($public_room_ref_id);
if ($pid != $chatfolder_ref_id) {
$tree->moveTree($public_room_ref_id, $chatfolder_ref_id);
}
}
?>
<#3463>
<?php
$ilCtrlStructureReader->getStructure();
?>
<#3464>
<?php
if (!$ilDB->tableExists('note_settings')) {
$fields = array('rep_obj_id' => array('type' => 'integer', 'length' => 4, 'notnull' => true, 'default' => 0), 'obj_id' => array('type' => 'integer', 'length' => 4, 'notnull' => true, 'default' => 0), 'obj_type' => array('type' => 'text', 'notnull' => true, 'length' => 10, 'default' => "-"), 'activated' => array('type' => 'integer', 'length' => 1, 'notnull' => true, 'default' => 0));
$ilDB->createTable('note_settings', $fields);
$ilDB->addPrimaryKey('note_settings', array('rep_obj_id', 'obj_id', 'obj_type'));
}
?>
示例2: confirmedMove
function confirmedMove()
{
global $ilUser;
$tgt = (int) $_REQUEST["bmfmv_id"];
$bm_ids = explode(";", $_REQUEST['bm_id_tgt']);
if (!$bm_ids || !$tgt) {
ilUtil::sendFailure($this->lng->txt("no_checkbox"));
return $this->view();
}
$tree = new ilTree($ilUser->getId());
$tree->setTableNames('bookmark_tree', 'bookmark_data');
$tgt_node = $tree->getNodeData($tgt);
// sanity check
foreach ($bm_ids as $node_id) {
if ($tree->isGrandChild($node_id, $tgt)) {
ilUtil::sendFailure($this->lng->txt("error"), true);
$this->ctrl->redirect($this, "view");
}
$node = $tree->getNodeData($node_id);
// already at correct position
if ($node["parent"] == $tgt) {
continue;
}
$tree->moveTree($node_id, $tgt);
}
ilUtil::sendSuccess($this->lng->txt("bookmark_moved_ok"), true);
$this->ctrl->setParameter($this, "bmf_id", $tgt);
$this->ctrl->redirect($this, "view");
}