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


PHP ilObject::_prepareCloneSelection方法代碼示例

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


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

示例1: _getAvailableQuestionpools

 /**
  * Returns the available question pools for the active user
  *
  * @return array The available question pools
  * @access public
  */
 function _getAvailableQuestionpools($use_object_id = FALSE, $could_be_offline = FALSE, $showPath = FALSE, $permission = "read")
 {
     global $ilUser;
     global $ilDB;
     $result_array = array();
     $qpls = ilUtil::_getObjectsByOperations("spl", $permission, $ilUser->getId(), -1);
     $titles = ilObject::_prepareCloneSelection($qpls, "spl", $showPath);
     $allqpls = array();
     $result = $ilDB->query("SELECT obj_fi, isonline FROM svy_qpl");
     while ($row = $ilDB->fetchAssoc($result)) {
         $allqpls[$row['obj_fi']] = $row['isonline'];
     }
     foreach ($qpls as $ref_id) {
         $obj_id = ilObject::_lookupObjectId($ref_id);
         if ($could_be_offline || $allqpls[$obj_id] == 1) {
             if ($use_object_id) {
                 $result_array[$obj_id] = $titles[$ref_id];
             } else {
                 $result_array[$ref_id] = $titles[$ref_id];
             }
         }
     }
     return $result_array;
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:30,代碼來源:class.ilObjSurveyQuestionPool.php

示例2: array

 /**
 * Returns the available tests for the active user
 *
 * @return array The available tests
 * @access public
 */
 function &_getAvailableTests($use_object_id = FALSE)
 {
     global $ilUser;
     global $ilDB;
     $result_array = array();
     $tests = ilUtil::_getObjectsByOperations("tst", "write", $ilUser->getId(), -1);
     if (count($tests)) {
         $titles = ilObject::_prepareCloneSelection($tests, "tst");
         foreach ($tests as $ref_id) {
             if ($use_object_id) {
                 $obj_id = ilObject::_lookupObjId($ref_id);
                 $result_array[$obj_id] = $titles[$ref_id];
             } else {
                 $result_array[$ref_id] = $titles[$ref_id];
             }
         }
     }
     return $result_array;
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:25,代碼來源:class.ilObjTest.php

示例3: array

 /**
 * Returns the available question pools for the active user
 *
 * @return array The available question pools
 * @access public
 */
 function &_getAvailableQuestionpools($use_object_id = FALSE, $equal_points = FALSE, $could_be_offline = FALSE, $showPath = FALSE, $with_questioncount = FALSE, $permission = "read", $usr_id = "")
 {
     global $ilUser;
     global $ilDB;
     $result_array = array();
     $permission = strlen($permission) == 0 ? "read" : $permission;
     $qpls = ilUtil::_getObjectsByOperations("qpl", $permission, strlen($usr_id) ? $usr_id : $ilUser->getId(), -1);
     $obj_ids = array();
     foreach ($qpls as $ref_id) {
         $obj_id = ilObject::_lookupObjId($ref_id);
         $obj_ids[$ref_id] = $obj_id;
     }
     $titles = ilObject::_prepareCloneSelection($qpls, "qpl");
     if (count($obj_ids)) {
         $in = $ilDB->in('object_data.obj_id', $obj_ids, false, 'integer');
         if ($could_be_offline) {
             $result = $ilDB->query("SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE " . "qpl_questionpool.obj_fi = object_data.obj_id AND {$in} ORDER BY object_data.title");
         } else {
             $result = $ilDB->queryF("SELECT qpl_questionpool.*, object_data.title FROM qpl_questionpool, object_data WHERE " . "qpl_questionpool.obj_fi = object_data.obj_id AND {$in} AND qpl_questionpool.isonline = %s " . "ORDER BY object_data.title", array('text'), array(1));
         }
         while ($row = $ilDB->fetchAssoc($result)) {
             $add = TRUE;
             if ($equal_points) {
                 if (!ilObjQuestionPool::_hasEqualPoints($row["obj_fi"])) {
                     $add = FALSE;
                 }
             }
             if ($add) {
                 $ref_id = array_search($row["obj_fi"], $obj_ids);
                 $title = $showPath ? $titles[$ref_id] : $row["title"];
                 if ($with_questioncount) {
                     $title .= " [" . $row["questioncount"] . " " . ($row["questioncount"] == 1 ? $this->lng->txt("ass_question") : $this->lng->txt("assQuestions")) . "]";
                 }
                 if ($use_object_id) {
                     $result_array[$row["obj_fi"]] = array('qpl_id' => $row['obj_fi'], 'qpl_title' => $row['title'], "title" => $title, "count" => $row["questioncount"]);
                 } else {
                     $result_array[$ref_id] = array('qpl_id' => $row['obj_fi'], 'qpl_title' => $row['title'], "title" => $title, "count" => $row["questioncount"]);
                 }
             }
         }
     }
     return $result_array;
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:49,代碼來源:class.ilObjQuestionPool.php

示例4:

 static final function _prepareCloneSelection($a_ref_ids, $new_type)
 {
     return parent::_prepareCloneSelection($a_ref_ids, $new_type);
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:4,代碼來源:class.ilObject2.php


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