当前位置: 首页>>代码示例>>PHP>>正文


PHP ilTree类代码示例

本文整理汇总了PHP中ilTree的典型用法代码示例。如果您正苦于以下问题:PHP ilTree类的具体用法?PHP ilTree怎么用?PHP ilTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ilTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor
  */
 public function __construct($a_parent_obj, $a_parent_cmd, $a_slm)
 {
     global $ilUser;
     $this->slm = $a_slm;
     $tree = new ilTree($this->slm->getId());
     $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $tree->setTreeTablePK("slm_id");
     parent::__construct("scorm_ed_exp", $a_parent_obj, $a_parent_cmd, $tree);
     //$this->setTypeWhiteList(array("du", "chap", "page"));
     $this->setSkipRootNode(false);
     $this->setAjax(false);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:15,代码来源:class.ilSCORM2004EditorExplorerGUI.php

示例2: __construct

 /**
  * Constructor
  *
  * @param integer $a_tree_id tree id
  */
 private function __construct($a_tree_id)
 {
     parent::ilTree($a_tree_id);
     $this->setTableNames('lm_tree', 'lm_data');
     $this->setTreeTablePK("lm_id");
     $this->useCache(true);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:12,代码来源:class.ilLMTree.php

示例3: parentHasSeqTemplate

 public function parentHasSeqTemplate($a_slm_id)
 {
     require_once "./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php";
     global $ilDB, $ilLog;
     $has_template = false;
     $mtree = new ilTree($a_slm_id);
     $mtree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $mtree->setTreeTablePK("slm_id");
     //get all parents for current node
     $parents = $this->getParentsForNode($a_parents = array(), $this->id);
     for ($i = 0; $i < count($parents); $i++) {
         $template = ilSCORM2004SeqTemplate::templateForChapter($parents[$i]);
         if ($template) {
             $has_template = true;
             break;
         }
     }
     return $has_template;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:19,代码来源:class.ilSCORM2004Utilities.php

示例4: getPossibleItems

 public function getPossibleItems($a_ref_id)
 {
     if (!isset(self::$possible_items[$a_ref_id])) {
         $obj_id = ilObject::_lookupObjectId($a_ref_id);
         $items = array();
         // only top-level chapters
         include_once "Services/MetaData/classes/class.ilMDEducational.php";
         $tree = new ilTree($obj_id);
         $tree->setTableNames('lm_tree', 'lm_data');
         $tree->setTreeTablePK("lm_id");
         foreach ($tree->getChilds($tree->readRootId()) as $child) {
             if ($child["type"] == "st") {
                 $child["tlt"] = ilMDEducational::_getTypicalLearningTimeSeconds($obj_id, $child["obj_id"]);
                 $items[$child["obj_id"]] = $child;
             }
         }
         self::$possible_items[$a_ref_id] = $items;
     }
     return self::$possible_items[$a_ref_id];
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:20,代码来源:class.ilLPCollectionOfLMChapters.php

示例5: __construct

 public function __construct($a_tree_id, $a_root_id = 0)
 {
     parent::__construct($a_tree_id, $a_root_id);
     $this->setTableNames('tree_workspace', 'object_data', 'object_reference_ws');
     $this->setTreeTablePK('tree');
     $this->setObjectTablePK('obj_id');
     $this->setReferenceTablePK('wsp_id');
     // ilTree sets it to ROOT_FOLDER_ID if not given...
     if (!$a_root_id) {
         $this->readRootId();
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:12,代码来源:class.ilWorkspaceTree.php

示例6: __construct

 public function __construct($a_tree_id, $a_root_id = 0)
 {
     parent::__construct($a_tree_id, $a_root_id);
     $this->table_tree = 'tree_workspace';
     $this->table_obj_data = 'object_data';
     $this->table_obj_reference = 'object_reference_ws';
     $this->ref_pk = 'wsp_id';
     $this->obj_pk = 'obj_id';
     $this->tree_pk = 'tree';
     // ilTree sets it to ROOT_FOLDER_ID if not given...
     if (!$a_root_id) {
         $this->root_id = $this->readRootId();
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:14,代码来源:class.ilWorkspaceTree.php

示例7: prepareHTML

 /**
  * Call this before using getHTML()
  * @access	public
  * @return	ilMailFolderTableGUI
  * @final
  *
  */
 public final function prepareHTML()
 {
     global $ilUser;
     $this->addColumn('', '', '1px', true);
     $this->addColumn($this->lng->txt('personal_picture'), '', '10%');
     if ($this->isDraftFolder() || $this->isSentFolder()) {
         $this->addColumn($this->lng->txt('recipient'), 'rcp_to', '25%');
     } else {
         $this->addColumn($this->lng->txt('sender'), 'from', '25%');
     }
     $this->addColumn($this->lng->txt('subject'), 'm_subject', '40%');
     $this->addColumn($this->lng->txt('date'), 'send_time', '20%');
     // init folder data
     $mtree = new ilTree($ilUser->getId());
     $mtree->setTableNames('mail_tree', 'mail_obj_data');
     $this->_folderNode = $mtree->getNodeData($this->_currentFolderId);
     // command buttons
     $this->initCommandButtons();
     // mail actions
     $this->initMultiCommands($this->_parentObject->mbox->getActions($this->_currentFolderId));
     // fetch table data
     $this->fetchTableData();
     return $this;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:31,代码来源:class.ilMailFolderTableGUI.php

示例8: addAdminNode

 /**
  * Create new admin object node
  * 
  * @param string $a_id
  * @param string $a_title
  */
 public static function addAdminNode($a_obj_type, $a_title)
 {
     global $ilDB, $tree;
     if (self::getObjectTypeId($a_obj_type)) {
         return;
     }
     $obj_type_id = self::addNewType($a_obj_type, $a_title);
     $obj_id = $ilDB->nextId('object_data');
     $ilDB->manipulate("INSERT INTO object_data " . "(obj_id, type, title, description, owner, create_date, last_update) VALUES (" . $ilDB->quote($obj_id, "integer") . "," . $ilDB->quote($a_obj_type, "text") . "," . $ilDB->quote($a_title, "text") . "," . $ilDB->quote($a_title, "text") . "," . $ilDB->quote(-1, "integer") . "," . $ilDB->now() . "," . $ilDB->now() . ")");
     $ref_id = $ilDB->nextId('object_reference');
     $ilDB->manipulate("INSERT INTO object_reference " . "(obj_id, ref_id) VALUES (" . $ilDB->quote($obj_id, "integer") . "," . $ilDB->quote($ref_id, "integer") . ")");
     // put in tree
     $tree = new ilTree(ROOT_FOLDER_ID);
     $tree->insertNode($ref_id, SYSTEM_FOLDER_ID);
     $rbac_ops = array(self::RBAC_OP_EDIT_PERMISSIONS, self::RBAC_OP_VISIBLE, self::RBAC_OP_READ, self::RBAC_OP_WRITE);
     self::addRBACOperations($obj_type_id, $rbac_ops);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:23,代码来源:class.ilDBUpdateNewObjectType.php

示例9: purgeObjects

 /**
  * removes objects from system
  * 
  * @access	private
  * @param	array	list of objects
  * @return	boolean
  */
 function purgeObjects($a_nodes)
 {
     global $ilias, $ilLog;
     // Get purge limits
     $count_limit = $ilias->account->getPref("systemcheck_count_limit");
     if (!is_numeric($count_limit) || $count_limit < 0) {
         $count_limit = count($a_nodes);
     }
     $timestamp_limit = time();
     $age_limit = $ilias->account->getPref("systemcheck_age_limit");
     if (is_numeric($age_limit) && $age_limit > 0) {
         $timestamp_limit -= $age_limit * 60 * 60 * 24;
     }
     $type_limit = $ilias->account->getPref("systemcheck_type_limit");
     if ($type_limit) {
         $type_limit = trim($type_limit);
         if (strlen($type_limit) == 0) {
             $type_limit = null;
         }
     }
     // handle wrong input
     if (!is_array($a_nodes)) {
         $this->throwError(INVALID_PARAM, WARNING, DEBUG);
         return false;
     }
     // start delete process
     $this->writeScanLogLine("action\tref_id\tobj_id\ttype\telapsed\ttitle");
     $count = 0;
     foreach ($a_nodes as $node) {
         if ($type_limit && $node['type'] != $type_limit) {
             $this->writeScanLogLine("skip\t" . $node['child'] . "\t\t" . $node['type'] . "\t\t" . $node['title']);
             continue;
         }
         $count++;
         if ($count > $count_limit) {
             $this->writeScanLogLine("Stopped purging after " . ($count - 1) . " objects, because count limit was reached: " . $count_limit);
             break;
         }
         if ($node["deleted_timestamp"] > $timestamp_limit) {
             $this->writeScanLogLine("Stopped purging after " . ($count - 1) . " objects, because timestamp limit was reached: " . date("c", $timestamp_limit));
             continue;
         }
         $ref_id = $node["child"] ? $node["child"] : $node["ref_id"];
         $node_obj =& $ilias->obj_factory->getInstanceByRefId($ref_id, false);
         if ($node_obj === false) {
             $this->invalid_objects[] = $node;
             continue;
         }
         $message = sprintf('%s::purgeObjects(): Removing object (id:%s ref:%s)', get_class($this), $ref_id, $node_obj->getId());
         $ilLog->write($message, $ilLog->WARNING);
         $startTime = microtime(true);
         $node_obj->delete();
         ilTree::_removeEntry($node["tree"], $ref_id);
         $endTime = microtime(true);
         $this->writeScanLogLine("purged\t" . $ref_id . "\t" . $node_obj->getId() . "\t" . $node['type'] . "\t" . round($endTime - $startTime, 1) . "\t" . $node['title']);
     }
     $this->findInvalidChilds();
     $this->removeInvalidChilds();
     return true;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:67,代码来源:class.ilValidator.php

示例10: testAllOthers

 /**
  * get path ids (adjacenca and nested set)
  * @group IL_Init
  * @param
  * @return
  */
 public function testAllOthers()
 {
     $tree = new ilTree(ROOT_FOLDER_ID);
     $d = $tree->getDepth(24);
     $this->assertEquals($d, 4);
     $node = $tree->getNodeData(24);
     $this->assertEquals($node['title'], 'Public chat');
     $bool = $tree->isInTree(24);
     $this->assertEquals($bool, true);
     $bool = $tree->isInTree(24242424);
     $this->assertEquals($bool, false);
     /* ref_id 14 => obj_id 98 does not exist
     		$node = $tree->getParentNodeData(24);
     		$this->assertEquals($node['title'],'Chat-Server');
     		*/
     $bool = $tree->isGrandChild(9, 24);
     $this->assertEquals($bool, 1);
     /* see above
     		$node = $tree->getNodeDataByType('chac');
     		$this->assertEquals($node[0]['title'],'Chat-Server');
     		*/
     $bool = $tree->isDeleted(24);
     $this->assertEquals($bool, false);
     $id = $tree->getParentId(24);
     $this->assertEquals($id, 14);
     $lft = $tree->getLeftValue(24);
     $this->assertEquals($lft, 14);
     $seq = $tree->getChildSequenceNumber($tree->getNodeData(24));
     $this->assertEquals($seq, 1);
     $tree->getNodePath(9, 1);
     $max_depth = $tree->getMaximumDepth();
     // Round trip
     $tree = new ilTree(ROOT_FOLDER_ID);
     $suc = $tree->fetchSuccessorNode(16);
     // cals
     $cals = $tree->fetchPredecessorNode($suc['child']);
     $this->assertEquals($cals['child'], 16);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:44,代码来源:ilTreeTest.php

示例11: confirmedDelete

 /**
  * Delete chapters/scos/pages
  */
 function confirmedDelete($a_redirect = true)
 {
     global $ilCtrl;
     $tree = new ilTree($this->object->getId());
     $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $tree->setTreeTablePK("slm_id");
     // delete all selected objects
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004NodeFactory.php";
     foreach ($_POST["id"] as $id) {
         if ($id != IL_FIRST_NODE) {
             $obj = ilSCORM2004NodeFactory::getInstance($this->object, $id, false);
             $node_data = $tree->getNodeData($id);
             if (is_object($obj)) {
                 $obj->setSLMId($this->object->getId());
                 /*include_once("./Services/History/classes/class.ilHistory.php");
                 	 ilHistory::_createEntry($this->object->getId(), "delete_".$obj->getType(),
                 		array(ilLMObject::_lookupTitle($id), $id),
                 		$this->object->getType());*/
                 $obj->delete();
             }
             if ($tree->isInTree($id)) {
                 $tree->deleteTree($node_data);
             }
         }
     }
     // check the tree
     //		$this->object->checkTree();
     // feedback
     ilUtil::sendInfo($this->lng->txt("info_deleted"), true);
     if ($a_redirect) {
         $ilCtrl->redirect($this, "showOrganization");
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:36,代码来源:class.ilObjSCORM2004LearningModuleGUI.php

示例12: object_data

?>
<#2745>
<?php 
// media object and media pool settings
// register new object type 'mobs' for media pool and media object settings
$id = $ilDB->nextId("object_data");
$ilDB->manipulateF("INSERT INTO object_data (obj_id, type, title, description, owner, create_date, last_update) " . "VALUES (%s, %s, %s, %s, %s, %s, %s)", array("integer", "text", "text", "text", "integer", "timestamp", "timestamp"), array($id, "typ", "mobs", "Media Object/Pool settings", -1, ilUtil::now(), ilUtil::now()));
$typ_id = $id;
// create object data entry
$id = $ilDB->nextId("object_data");
$ilDB->manipulateF("INSERT INTO object_data (obj_id, type, title, description, owner, create_date, last_update) " . "VALUES (%s, %s, %s, %s, %s, %s, %s)", array("integer", "text", "text", "text", "integer", "timestamp", "timestamp"), array($id, "mobs", "__MediaObjectSettings", "Media Object/Pool Settings", -1, ilUtil::now(), ilUtil::now()));
// create object reference entry
$ref_id = $ilDB->nextId('object_reference');
$res = $ilDB->manipulateF("INSERT INTO object_reference (ref_id, obj_id) VALUES (%s, %s)", array("integer", "integer"), array($ref_id, $id));
// put in tree
$tree = new ilTree(ROOT_FOLDER_ID);
$tree->insertNode($ref_id, SYSTEM_FOLDER_ID);
// add rbac operations
// 1: edit_permissions, 2: visible, 3: read, 4:write
$ilDB->manipulateF("INSERT INTO rbac_ta (typ_id, ops_id) VALUES (%s, %s)", array("integer", "integer"), array($typ_id, 1));
$ilDB->manipulateF("INSERT INTO rbac_ta (typ_id, ops_id) VALUES (%s, %s)", array("integer", "integer"), array($typ_id, 2));
$ilDB->manipulateF("INSERT INTO rbac_ta (typ_id, ops_id) VALUES (%s, %s)", array("integer", "integer"), array($typ_id, 3));
$ilDB->manipulateF("INSERT INTO rbac_ta (typ_id, ops_id) VALUES (%s, %s)", array("integer", "integer"), array($typ_id, 4));
?>
<#2746>
<?php 
$ilCtrlStructureReader->getStructure();
?>
<#2747>
<?php 
$ilDB->createTable("mep_item", array('id' => array('type' => 'integer', 'length' => 4, 'notnull' => true), 'type' => array('type' => 'text', 'length' => 10, 'notnull' => false), 'title' => array('type' => 'text', 'length' => 128, 'notnull' => false), 'foreign_id' => array('type' => 'integer', 'length' => 4, 'notnull' => false)));
开发者ID:arlendotcn,项目名称:ilias,代码行数:31,代码来源:dbupdate_02.php

示例13: confirmedDelete

 /**
  * delete page object or structure objects
  *
  * @param	int		$a_parent_subobj_id		id of parent object (structure object)
  *											of the objects, that should be deleted
  *											(or no parent object id for top level)
  */
 function confirmedDelete($a_parent_subobj_id = 0)
 {
     $tree = new ilTree($this->object->getId());
     $tree->setTableNames('lm_tree', 'lm_data');
     $tree->setTreeTablePK("lm_id");
     // check number of objects
     if (!$_POST["id"]) {
         $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
     }
     // delete all selected objects
     foreach ($_POST["id"] as $id) {
         if ($id != IL_FIRST_NODE) {
             $obj =& ilLMObjectFactory::getInstance($this->object, $id, false);
             $node_data = $tree->getNodeData($id);
             if (is_object($obj)) {
                 $obj->setLMId($this->object->getId());
                 include_once "./Services/History/classes/class.ilHistory.php";
                 ilHistory::_createEntry($this->object->getId(), "delete_" . $obj->getType(), array(ilLMObject::_lookupTitle($id), $id), $this->object->getType());
                 $obj->delete();
             }
             if ($tree->isInTree($id)) {
                 $tree->deleteTree($node_data);
             }
         }
     }
     // check the tree
     $this->object->checkTree();
     // feedback
     ilUtil::sendSuccess($this->lng->txt("info_deleted"), true);
     if ($a_parent_subobj_id == 0) {
         $this->ctrl->redirect($this, $_GET["backcmd"]);
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:40,代码来源:class.ilObjContentObjectGUI.php

示例14: _splitPageNext

 /**
  * split page to next page at hierarchical id
  *
  * the main reason for this method being static is that a lm page
  * object is not available within ilPageContentGUI where this method
  * is called
  */
 function _splitPageNext($a_page_id, $a_pg_parent_type, $a_hier_id)
 {
     // get content object (learning module / digilib book)
     $lm_id = ilLMObject::_lookupContObjID($a_page_id);
     $type = ilObject::_lookupType($lm_id, false);
     switch ($type) {
         case "lm":
             include_once "./Modules/LearningModule/classes/class.ilObjLearningModule.php";
             $cont_obj = new ilObjLearningModule($lm_id, false);
             break;
         case "dbk":
             include_once "./Modules/LearningModule/classes/class.ilObjDlBook.php";
             $cont_obj = new ilObjDlBook($lm_id, false);
             break;
     }
     $tree = new ilTree($cont_obj->getId());
     $tree->setTableNames('lm_tree', 'lm_data');
     $tree->setTreeTablePK("lm_id");
     $source_lm_page =& new ilLMPageObject($cont_obj, $a_page_id);
     $source_page =& $source_lm_page->getPageObject();
     // get next page
     $succ = $tree->fetchSuccessorNode($a_page_id, "pg");
     if ($succ["child"] > 0) {
         $target_lm_page =& new ilLMPageObject($cont_obj, $succ["child"]);
         $target_page =& $target_lm_page->getPageObject();
         $target_page->buildDom();
         $target_page->addHierIds();
         // move nodes to target page
         $source_page->buildDom();
         $source_page->addHierIds();
         ilLMPage::_moveContentAfterHierId($source_page, $target_page, $a_hier_id);
         //$source_page->deleteContentFromHierId($a_hier_id);
         return $succ["child"];
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:42,代码来源:class.ilLMPageObject.php

示例15: switchTree

 public function switchTree()
 {
     $set = new ilSetting('common');
     $type = $set->get('main_tree_impl', 'ns') == 'ns' ? 'ns' : 'mp';
     if ($type == 'ns' and $_POST['tree_impl_type'] == 'mp') {
         // To mp
         include_once './Services/Tree/classes/class.ilMaterializedPathTree.php';
         ilMaterializedPathTree::createFromParentReleation();
         $set->set('main_tree_impl', 'mp');
     } elseif ($type == 'mp' and $_POST['tree_impl_type'] == 'ns') {
         include_once './Services/Tree/classes/class.ilTree.php';
         $GLOBALS['ilSetting'] = $set;
         $tree = new ilTree(1);
         $tree->renumber(1);
         $set->set('main_tree_impl', 'ns');
     }
     ilUtil::sendInfo($this->lng->txt("tree_implementation_switched"), true);
     $this->displayTools();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:19,代码来源:class.ilSetupGUI.php


注:本文中的ilTree类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。