本文整理匯總了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");
}