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


PHP ilLMObject::clipboardCopy方法代碼示例

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


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

示例1: copyItems

 /**
  * Copy items to clipboard
  */
 function copyItems()
 {
     global $ilCtrl, $lng;
     $items = ilUtil::stripSlashesArray($_POST["id"]);
     if (!is_array($items)) {
         ilUtil::sendFailure($lng->txt("no_checkbox"), true);
         $ilCtrl->redirect($this, "chapters");
     }
     $todel = array();
     // delete IDs < 0 (needed for non-js editing)
     foreach ($items as $k => $item) {
         if ($item < 0) {
             $todel[] = $k;
         }
     }
     foreach ($todel as $k) {
         unset($items[$k]);
     }
     ilLMObject::clipboardCopy($this->object->getId(), $items);
     ilEditClipboard::setAction("copy");
     ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_copied"), true);
     $ilCtrl->redirect($this, "chapters");
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:26,代碼來源:class.ilObjContentObjectGUI.php

示例2: clipboardCut

 /**
  * Copy a set of chapters/pages into the clipboard
  */
 function clipboardCut($a_cont_obj_id, $a_ids)
 {
     $tree = ilLMObject::getTree($a_cont_obj_id);
     if (!is_array($a_ids)) {
         return false;
     } else {
         // get all "top" ids, i.e. remove ids, that have a selected parent
         foreach ($a_ids as $id) {
             $path = $tree->getPathId($id);
             $take = true;
             foreach ($path as $path_id) {
                 if ($path_id != $id && in_array($path_id, $a_ids)) {
                     $take = false;
                 }
             }
             if ($take) {
                 $cut_ids[] = $id;
             }
         }
     }
     ilLMObject::clipboardCopy($a_cont_obj_id, $cut_ids);
     // remove the objects from the tree
     // note: we are getting chapters which are *not* in the tree
     // we do not delete any pages/chapters here
     foreach ($cut_ids as $id) {
         $curnode = $tree->getNodeData($id);
         if ($tree->isInTree($id)) {
             $tree->deleteTree($curnode);
         }
     }
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:34,代碼來源:class.ilLMObject.php

示例3: copyItems

 /**
  * Copy items to clipboard
  */
 function copyItems($a_return = "view")
 {
     global $ilCtrl, $lng;
     $items = ilUtil::stripSlashesArray($_POST["id"]);
     if (!is_array($items)) {
         ilUtil::sendFailure($lng->txt("no_checkbox"), true);
         $ilCtrl->redirect($this, "showHierarchy");
     }
     $todel = array();
     // delete IDs < 0 (needed for non-js editing)
     foreach ($items as $k => $item) {
         if ($item < 0) {
             $todel[] = $k;
         }
     }
     foreach ($todel as $k) {
         unset($items[$k]);
     }
     if (!ilLMObject::uniqueTypesCheck($items)) {
         ilUtil::sendFailure($lng->txt("cont_choose_pages_or_chapters_only"), true);
         $ilCtrl->redirect($this, "showHierarchy");
     }
     ilLMObject::clipboardCopy($this->content_object->getId(), $items);
     ilEditClipboard::setAction("copy");
     ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_copied"), true);
     $ilCtrl->redirect($this, $a_return);
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:30,代碼來源:class.ilStructureObjectGUI.php


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