當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilObject::collectDeletionDependencies方法代碼示例

本文整理匯總了PHP中ilObject::collectDeletionDependencies方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilObject::collectDeletionDependencies方法的具體用法?PHP ilObject::collectDeletionDependencies怎麽用?PHP ilObject::collectDeletionDependencies使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilObject的用法示例。


在下文中一共展示了ilObject::collectDeletionDependencies方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: showDeleteConfirmation

 /**
  * Show delete confirmation table
  */
 function showDeleteConfirmation($a_ids, $a_supress_message = false)
 {
     global $lng, $ilSetting, $ilCtrl, $tpl, $objDefinition;
     if (!is_array($a_ids) || count($a_ids) == 0) {
         ilUtil::sendFailure($lng->txt("no_checkbox"), true);
         return false;
     }
     // Remove duplicate entries
     $a_ids = array_unique((array) $a_ids);
     include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
     $cgui = new ilConfirmationGUI();
     if (!$a_supress_message) {
         $msg = $lng->txt("info_delete_sure");
         if (!$ilSetting->get('enable_trash')) {
             $msg .= "<br/>" . $lng->txt("info_delete_warning_no_trash");
         }
         $cgui->setHeaderText($msg);
     }
     $cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
     $cgui->setCancel($lng->txt("cancel"), "cancelDelete");
     $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
     $form_name = "cgui_" . md5(uniqid());
     $cgui->setFormName($form_name);
     $deps = array();
     foreach ($a_ids as $ref_id) {
         $obj_id = ilObject::_lookupObjId($ref_id);
         $type = ilObject::_lookupType($obj_id);
         $title = call_user_func(array(ilObjectFactory::getClassByType($type), '_lookupTitle'), $obj_id);
         $alt = $objDefinition->isPlugin($type) ? $lng->txt("icon") . " " . ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type) : $lng->txt("icon") . " " . $lng->txt("obj_" . $type);
         $title .= $this->handleMultiReferences($obj_id, $ref_id, $form_name);
         $cgui->addItem("id[]", $ref_id, $title, ilObject::_getIcon($obj_id, "small", $type), $alt);
         ilObject::collectDeletionDependencies($deps, $ref_id, $obj_id, $type);
     }
     $deps_html = "";
     if (is_array($deps) && count($deps) > 0) {
         include_once "./Services/Repository/classes/class.ilRepDependenciesTableGUI.php";
         $tab = new ilRepDependenciesTableGUI($deps);
         $deps_html = "<br/><br/>" . $tab->getHTML();
     }
     $tpl->setContent($cgui->getHTML() . $deps_html);
     return true;
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:45,代碼來源:class.ilRepUtilGUI.php

示例2: collectDeletionDependencies

 /**
  * Collect deletion dependencies. E.g. 
  *
  * @param
  * @return
  */
 static final function collectDeletionDependencies(&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth = 0)
 {
     global $objDefinition, $tree;
     if ($a_depth == 0) {
         $deps["dep"] = array();
     }
     $deps["del_ids"][$a_obj_id] = $a_obj_id;
     if (!$objDefinition->isPlugin($type)) {
         $class_name = "ilObj" . $objDefinition->getClassName($a_type);
         $location = $objDefinition->getLocation($a_type);
         include_once $location . "/class." . $class_name . ".php";
         $odeps = call_user_func(array($class_name, "getDeletionDependencies"), $a_obj_id);
         if (is_array($odeps)) {
             foreach ($odeps as $id => $message) {
                 $deps["dep"][$id][$a_obj_id][] = $message;
             }
         }
         // get deletion dependency of childs
         foreach ($tree->getChilds($a_ref_id) as $c) {
             ilObject::collectDeletionDependencies($deps, $c["child"], $c["obj_id"], $c["type"], $a_depth + 1);
         }
     }
     // delete all dependencies to objects that will be deleted, too
     if ($a_depth == 0) {
         foreach ($deps["del_ids"] as $obj_id) {
             unset($deps["dep"][$obj_id]);
         }
         $deps = $deps["dep"];
     }
 }
開發者ID:khanhnnvn,項目名稱:ilias_E-learning,代碼行數:36,代碼來源:class.ilObject.php


注:本文中的ilObject::collectDeletionDependencies方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。