本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4:
static final function _prepareCloneSelection($a_ref_ids, $new_type)
{
return parent::_prepareCloneSelection($a_ref_ids, $new_type);
}