5require_once(
"Services/MetaData/classes/class.ilMDLanguageItem.php");
 
   47        $this->
user = $DIC->user();
 
   49        $this->db = 
$DIC->database();
 
   53        $this->
setLMId($a_content_obj->getId());
 
   73        include_once 
'Services/MetaData/classes/class.ilMD.php';
 
   80                $md_gen = $md->getGeneral();
 
   84                foreach ($md_gen->getDescriptionIds() as 
$id) {
 
   85                    $md_des = $md_gen->getDescription(
$id);
 
   92                include_once(
"./Services/Object/classes/class.ilObjectLP.php");
 
   95                    $obj_lp->getCurrentMode(),
 
   98                    include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  114        include_once 
'Services/MetaData/classes/class.ilMD.php';
 
  117        $md_gen = $md->getGeneral();
 
  118        if (is_object($md_gen)) {
 
  119            foreach ($md_gen->getIdentifierIds() as 
$id) {
 
  120                $md_id = $md_gen->getIdentifier(
$id);
 
  121                if ($md_id->getCatalog() == 
"ILIAS_NID") {
 
  122                    return $md_id->getEntry();
 
  136        include_once 
'Services/MetaData/classes/class.ilMDCreator.php';
 
  141        $md_creator->setTitle($this->
getTitle());
 
  142        $md_creator->setTitleLanguage(
$ilUser->getPref(
'language'));
 
  144        $md_creator->setDescriptionLanguage(
$ilUser->getPref(
'language'));
 
  145        $md_creator->setKeywordLanguage(
$ilUser->getPref(
'language'));
 
  146        $md_creator->setLanguage(
$ilUser->getPref(
'language'));
 
  147        $md_creator->create();
 
  157        include_once(
"Services/MetaData/classes/class.ilMD.php");
 
  158        include_once(
"Services/MetaData/classes/class.ilMDGeneral.php");
 
  159        include_once(
"Services/MetaData/classes/class.ilMDDescription.php");
 
  162        $md_gen = $md->getGeneral();
 
  163        $md_gen->setTitle($this->
getTitle());
 
  166        $md_des_ids = $md_gen->getDescriptionIds();
 
  167        if (count($md_des_ids) > 0) {
 
  168            $md_des = $md_gen->getDescription($md_des_ids[0]);
 
  182        include_once(
'Services/MetaData/classes/class.ilMD.php');
 
  194        $this->data_record = $a_record;
 
  201        if (!isset($this->data_record)) {
 
  202            $query = 
"SELECT * FROM lm_data WHERE obj_id = " .
 
  203                $ilDB->quote($this->
id, 
"integer");
 
  205            $this->data_record = 
$ilDB->fetchAssoc($obj_set);
 
  208        $this->type = $this->data_record[
"type"];
 
  209        $this->
setImportId($this->data_record[
"import_id"]);
 
  210        $this->
setTitle($this->data_record[
"title"]);
 
  212        $this->
setLayout($this->data_record[
"layout"]);
 
  229            "SELECT * FROM lm_data " .
 
  230            " WHERE lm_id = " . 
$ilDB->quote($a_lm_id, 
"integer")
 
  232        while ($rec = 
$ilDB->fetchAssoc($set)) {
 
  233            self::$data_records[$rec[
"obj_id"]] = $rec;
 
  235        return count(self::$data_records);
 
  246        $this->title = $a_title;
 
  266        $this->short_title = $a_title;
 
  285    protected static function _lookup($a_obj_id, $a_field)
 
  291        if (isset(self::$data_records[$a_obj_id])) {
 
  292            return self::$data_records[$a_obj_id][$a_field];
 
  295        $query = 
"SELECT " . $a_field . 
" FROM lm_data WHERE obj_id = " .
 
  296            $ilDB->quote($a_obj_id, 
"integer");
 
  298        $obj_rec = 
$ilDB->fetchAssoc($obj_set);
 
  300        return $obj_rec[$a_field];
 
  337        if (isset(self::$data_records[$a_obj_id])) {
 
  338            if ($a_lm_id == 0 || self::$data_records[$a_obj_id][
"lm_id"] == $a_lm_id) {
 
  339                return self::$data_records[$a_obj_id][
"type"];
 
  344            $and = 
' AND lm_id = ' . 
$ilDB->quote($a_lm_id, 
'integer');
 
  347        $query = 
"SELECT type FROM lm_data WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
"integer") . $and;
 
  349        $obj_rec = 
$ilDB->fetchAssoc($obj_set);
 
  351        return $obj_rec[
"type"];
 
  361        $query = 
"UPDATE lm_data SET " .
 
  362            " title = " . 
$ilDB->quote($a_title, 
"text") .
 
  363            " WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
"integer");
 
  370        $this->description = $a_description;
 
  390        $this->lm_id = $a_lm_id;
 
  400        $this->content_object = $a_content_obj;
 
  420        return $this->import_id;
 
  425        $this->import_id = $a_id;
 
  435        $this->layout = $a_val;
 
  461        $q = 
"UPDATE lm_data " .
 
  463            "import_id = " . 
$ilDB->quote($a_import_id, 
"text") . 
"," .
 
  464            "last_update = " . 
$ilDB->now() . 
" " .
 
  465            "WHERE obj_id = " . 
$ilDB->quote($a_id, 
"integer");
 
  467        $ilDB->manipulate($q);
 
  470    public function create($a_upload = 
false)
 
  476        $query = 
"INSERT INTO lm_data (obj_id, title, type, layout, lm_id, import_id, short_title, create_date) " .
 
  478            $ilDB->quote($this->
getId(), 
"integer") . 
"," .
 
  485            ", " . 
$ilDB->now() . 
")";
 
  489        include_once(
"./Services/History/classes/class.ilHistory.php");
 
  494            $this->content_object->getType() . 
":" . $this->getType()
 
  511        $query = 
"UPDATE lm_data SET " .
 
  512            " lm_id = " . 
$ilDB->quote($this->
getLMId(), 
"integer") .
 
  516            " WHERE obj_id = " . 
$ilDB->quote($this->
getId(), 
"integer");
 
  538        if (!is_array($a_pages)) {
 
  546        if (empty($a_cont_obj_id)) {
 
  547            $message = 
sprintf(
'ilLMObject::_writePublicAccessStatus(): Invalid parameter! $a_cont_obj_id is empty');
 
  554        $lm_tree = 
new ilTree($a_cont_obj_id);
 
  555        $lm_tree->setTableNames(
'lm_tree', 
'lm_data');
 
  556        $lm_tree->setTreeTablePK(
"lm_id");
 
  557        $lm_tree->readRootId();
 
  560        $q = 
"SELECT obj_id FROM lm_data " .
 
  561             "WHERE lm_id = " . 
$ilDB->quote($a_cont_obj_id, 
"integer") . 
" " .
 
  567            $childs = $lm_tree->getChilds(
$row[
"obj_id"]);
 
  569            foreach ($childs as $page) {
 
  570                if ($page[
"type"] == 
"pg" and in_array($page[
"obj_id"], $a_pages)) {
 
  571                    array_push($a_pages, 
$row[
"obj_id"]);
 
  578        $q = 
"UPDATE lm_data SET " .
 
  579             "public_access = CASE " .
 
  580             "WHEN " . 
$ilDB->in(
"obj_id", $a_pages, 
false, 
"integer") . 
" " .
 
  581             "THEN " . 
$ilDB->quote(
"y", 
"text") .
 
  582             "ELSE " . 
$ilDB->quote(
"n", 
"text") .
 
  584             "WHERE lm_id = " . 
$ilDB->quote($a_cont_obj_id, 
"integer") . 
" " .
 
  585             "AND " . 
$ilDB->in(
"type", array(
"pg", 
"st"), 
false, 
"text");
 
  586        $ilDB->manipulate($q);
 
  591    public static function _isPagePublic($a_node_id, $a_check_public_mode = 
false)
 
  598        if (empty($a_node_id)) {
 
  599            $message = 
sprintf(
'ilLMObject::_isPagePublic(): Invalid parameter! $a_node_id is empty');
 
  604        if ($a_check_public_mode === 
true) {
 
  605            $lm_id = ilLMObject::_lookupContObjId($a_node_id);
 
  607            $q = 
"SELECT public_access_mode FROM content_object WHERE id = " .
 
  612            if (
$row[
"public_access_mode"] == 
"complete") {
 
  617        $q = 
"SELECT public_access FROM lm_data WHERE obj_id=" .
 
  618            $ilDB->quote($a_node_id, 
"integer");
 
  628    public function delete($a_delete_meta_data = 
true)
 
  632        $query = 
"DELETE FROM lm_data WHERE obj_id = " .
 
  656        $q = 
"SELECT obj_id FROM lm_data WHERE import_id = " .
 
  657            $ilDB->quote($a_import_id, 
"text") . 
" " .
 
  658            " ORDER BY create_date DESC";
 
  659        $obj_set = 
$ilDB->query($q);
 
  660        while ($obj_rec = 
$ilDB->fetchAssoc($obj_set)) {
 
  664            include_once(
"./Services/Help/classes/class.ilObjHelpSettings.php");
 
  668                return $obj_rec[
"obj_id"];
 
  690        $where = ($a_in_lm > 0)
 
  691            ? 
" AND lm_id = " . 
$ilDB->quote($a_in_lm, 
"integer") . 
" " 
  694        $q = 
"SELECT * FROM lm_data WHERE import_id = " .
 
  695            $ilDB->quote($a_import_id, 
"text") . 
" " .
 
  697            " ORDER BY create_date DESC";
 
  698        $obj_set = 
$ilDB->query($q);
 
  701        while ($obj_rec = 
$ilDB->fetchAssoc($obj_set)) {
 
  724        include_once(
"./Services/Link/classes/class.ilInternalLink.php");
 
  725        if (is_int(strpos($a_id, 
"_"))) {
 
  729        $q = 
"SELECT * FROM lm_data WHERE obj_id = " .
 
  730            $ilDB->quote($a_id, 
"integer");
 
  731        $obj_set = 
$ilDB->query($q);
 
  732        if ($obj_rec = 
$ilDB->fetchAssoc($obj_set)) {
 
  748        $type_str = (
$type != 
"")
 
  749            ? 
"AND type = " . 
$ilDB->quote(
$type, 
"text") . 
" " 
  752        $query = 
"SELECT * FROM lm_data " .
 
  753            "WHERE lm_id= " . 
$ilDB->quote(
$lm_id, 
"integer") . 
" " .
 
  758        while ($obj_rec = 
$ilDB->fetchAssoc($obj_set)) {
 
  759            $obj_list[] = array(
"obj_id" => $obj_rec[
"obj_id"],
 
  760                                "title" => $obj_rec[
"title"],
 
  761                                "import_id" => $obj_rec[
"import_id"],
 
  762                                "type" => $obj_rec[
"type"]);
 
  777        $query = 
"SELECT * FROM lm_data " .
 
  778            "WHERE lm_id= " . 
$ilDB->quote($a_cobj->getId(), 
"integer");
 
  781        require_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
 
  782        while ($obj_rec = 
$ilDB->fetchAssoc($obj_set)) {
 
  785            if (is_object($lm_obj)) {
 
  786                $lm_obj->delete(
true);
 
  802        if (isset(self::$data_records[$a_id])) {
 
  803            return self::$data_records[$a_id][
"lm_id"];
 
  806        $query = 
"SELECT lm_id FROM lm_data WHERE obj_id = " .
 
  807            $ilDB->quote($a_id, 
"integer");
 
  809        $obj_rec = 
$ilDB->fetchAssoc($obj_set);
 
  811        return $obj_rec[
"lm_id"];
 
  817    public static function putInTree($a_obj, $a_parent_id = 
"", $a_target_node_id = 
"")
 
  823        $tree = 
new ilTree($a_obj->getContentObject()->getId());
 
  824        $tree->setTableNames(
'lm_tree', 
'lm_data');
 
  825        $tree->setTreeTablePK(
"lm_id");
 
  828        $parent_id = ($a_parent_id != 
"")
 
  830            : $tree->getRootId();
 
  833        if ($a_target_node_id != 
"") {
 
  837            if ($a_obj->getType() == 
"st") {
 
  838                $s_types = array(
"st", 
"pg");
 
  839                $childs = $tree->getChildsByTypeFilter($parent_id, $s_types);
 
  842                $childs = $tree->getChildsByType($parent_id, $s_types);
 
  845            if (count($childs) == 0) {
 
  848                $target = $childs[count($childs) - 1][
"obj_id"];
 
  852        if ($tree->isInTree($parent_id) && !$tree->isInTree($a_obj->getId())) {
 
  853            $ilLog->write(
"LMObject::putInTree: insertNode, ID: " . $a_obj->getId() .
 
  854                "Parent ID: " . $parent_id . 
", Target: " . 
$target);
 
  856            $tree->insertNode($a_obj->getId(), $parent_id, 
$target);
 
  867    public static function getTree($a_cont_obj_id)
 
  869        $tree = 
new ilTree($a_cont_obj_id);
 
  870        $tree->setTableNames(
'lm_tree', 
'lm_data');
 
  871        $tree->setTreeTablePK(
"lm_id");
 
  884        if (!is_array($a_ids)) {
 
  888            foreach ($a_ids as 
$id) {
 
  891                foreach (
$path as $path_id) {
 
  892                    if ($path_id != 
$id && in_array($path_id, $a_ids)) {
 
  907        foreach ($cut_ids as 
$id) {
 
  908            $curnode = $tree->getNodeData(
$id);
 
  909            if ($tree->isInTree(
$id)) {
 
  910                $tree->deleteTree($curnode);
 
  926        $ilUser->clipboardDeleteObjectsOfType(
"pg");
 
  927        $ilUser->clipboardDeleteObjectsOfType(
"st");
 
  932        foreach ($a_ids as 
$id) {
 
  934            if ($tree->isInTree(
$id)) {
 
  935                $curnode = $tree->getNodeData(
$id);
 
  936                $subnodes = $tree->getSubTree($curnode);
 
  937                foreach ($subnodes as $subnode) {
 
  938                    if ($subnode[
"child"] != 
$id) {
 
  950            $order = ($curnode[
"lft"] > 0)
 
  952                : (
int) ($order + 1);
 
  982        include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
 
  983        include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
  988        if ($item_type == 
"st") {
 
  990        } elseif ($item_type == 
"pg") {
 
  994        $ilLog->write(
"Getting from clipboard type " . $item_type . 
", " .
 
  995            "Item ID: " . $a_item_id . 
", of original LM: " . $item_lm_id);
 
  997        if ($item_lm_id != $a_target_lm->getId() && !$a_as_copy) {
 
 1001            include_once(
"Services/MetaData/classes/class.ilMD.php");
 
 1002            $md = 
new ilMD($item_lm_id, $item->getId(), $item->getType());
 
 1003            $new_md = $md->cloneMD($a_target_lm->getId(), $item->getId(), $item->getType());
 
 1006            $item->setLMId($a_target_lm->getId());
 
 1007            $item->setContentObject($a_target_lm);
 
 1013            if ($item_type == 
"pg") {
 
 1014                $page = $item->getPageObject();
 
 1016                $page->setParentId($a_target_lm->getId());
 
 1022            $target_item = $item->copy($a_target_lm);
 
 1023            $a_copied_nodes[$item->getId()] = $target_item->getId();
 
 1025            $target_item = $item;
 
 1028        $ilLog->write(
"Putting into tree type " . $target_item->getType() .
 
 1029            "Item ID: " . $target_item->getId() . 
", Parent: " . $a_parent_id . 
", " .
 
 1030            "Target: " . $a_target . 
", Item LM:" . $target_item->getContentObject()->getId());
 
 1034        if ($a_source_lm == 
null) {
 
 1035            $childs = 
$ilUser->getClipboardChilds($item->getId(), $a_insert_time);
 
 1037            $childs = $a_source_lm->lm_tree->getChilds($item->getId());
 
 1038            foreach ($childs as $k => $child) {
 
 1039                $childs[$k][
"id"] = $childs[$k][
"child"];
 
 1043        foreach ($childs as $child) {
 
 1047                $target_item->getId(),
 
 1056        return $target_item->getId();
 
 1065    public static function saveTitles($a_lm, $a_titles, $a_lang = 
"-")
 
 1067        include_once(
"./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
 
 1069        if ($a_lang == 
"") {
 
 1072        if (is_array($a_titles)) {
 
 1073            include_once(
"./Services/Form/classes/class.ilFormPropertyGUI.php");
 
 1074            include_once(
"./Services/MetaData/classes/class.ilMD.php");
 
 1078                if ($a_lang == 
"-") {
 
 1080                    if (is_object($lmobj)) {
 
 1082                        $md = 
new ilMD($a_lm->getId(), 
$id, $lmobj->getType());
 
 1083                        $md_gen = $md->getGeneral();
 
 1084                        if (is_object($md_gen)) {                       
 
 1085                            $md_gen->setTitle(
$title);
 
 1093                    $lmobjtrans->setTitle(
$title);
 
 1094                    $lmobjtrans->save();
 
 1105        $all_fixes = array();
 
 1106        foreach ($a_copied_nodes as $original_id => $copied_id) {
 
 1110            if ($copied_type == 
"pg") {
 
 1116                    include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
 
 1119                    $il = $tpg->getInternalLinks();
 
 1121                    foreach ($il as 
$l) {
 
 1127                    foreach ($targets as 
$target) {
 
 1131                            if ($a_copied_nodes[
$target[
"id"]] > 0) {
 
 1138                                if ($trg_lm != $copy_lm) {
 
 1142                                    foreach ($lm_data as $item) {
 
 1143                                        if (!$found && ($item[
"lm_id"] == $copy_lm)) {
 
 1144                                            $fix[
$target[
"id"]] = $item[
"obj_id"];
 
 1154                    if (count($fix) > 0) {
 
 1158                        if (is_array($all_fixes[
$t . 
":" . $copied_id])) {
 
 1159                            $all_fixes[
$t . 
":" . $copied_id] += $fix;
 
 1161                            $all_fixes[
$t . 
":" . $copied_id] = $fix;
 
 1167            if ($copied_type == 
"pg" ||
 
 1168                $copied_type == 
"st") {
 
 1180                if ($original_lm != $copy_lm) {
 
 1194                        "_" . $original_id);
 
 1197                    include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 1198                    foreach (
$mobs as $mob) {
 
 1207                        foreach ($usages as $usage) {
 
 1208                            if ($usage[
"type"] == 
"lm:pg" | $usage[
"type"] == 
"lm:st") {
 
 1209                                $sources[] = $usage;
 
 1214                    foreach ($sources as 
$source) {
 
 1215                        $stype = explode(
":", 
$source[
"type"]);
 
 1216                        $source_type = $stype[1];
 
 1218                        if ($source_type == 
"pg" || $source_type == 
"st") {
 
 1222                            if ($src_lm == $original_lm) {
 
 1226                                    "il__" . $source_type . 
"_" . 
$source[
"id"],
 
 1230                                foreach ($lm_data as $item) {
 
 1232                                        $fix[$item[
"obj_id"]][$original_id] = $copied_id;
 
 1240                    if (count($fix) > 0) {
 
 1241                        foreach ($fix as $page_id => $fix_array) {
 
 1243                            if (is_array($all_fixes[
$t . 
":" . $page_id])) {
 
 1244                                $all_fixes[
$t . 
":" . $page_id] += $fix_array;
 
 1246                                $all_fixes[
$t . 
":" . $page_id] = $fix_array;
 
 1254        foreach ($all_fixes as $pg => $fixes) {
 
 1255            $pg = explode(
":", $pg);
 
 1256            include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
 
 1259                if ($page->moveIntLinks($fixes)) {
 
 1260                    $page->update(
true, 
true);
 
 1272        if (is_array($a_items)) {
 
 1273            foreach ($a_items as $item) {
 
 1279        if (count($types) > 1) {
 
 1291    public static function writeLayout($a_obj_id, $a_layout, $a_lm = 
null)
 
 1300            $query = 
"UPDATE lm_data SET " .
 
 1301                " layout = " . 
$ilDB->quote($a_layout, 
"text") .
 
 1302                " WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
"integer");
 
 1304        } elseif (
$t == 
"st" && is_object($a_lm)) {
 
 1305            $node = $a_lm->getLMTree()->getNodeData($a_obj_id);
 
 1306            $child_nodes = $a_lm->getLMTree()->getSubTree($node);
 
 1307            if (is_array($child_nodes) && count($child_nodes) > 0) {
 
 1308                foreach ($child_nodes as $c) {
 
 1309                    if ($c[
"type"] == 
"pg") {
 
 1310                        $query = 
"UPDATE lm_data SET " .
 
 1311                            " layout = " . 
$ilDB->quote($a_layout, 
"text") .
 
 1312                            " WHERE obj_id = " . 
$ilDB->quote($c[
"child"], 
"integer");
 
 1331        $query = 
"SELECT layout FROM lm_data WHERE obj_id = " .
 
 1332            $ilDB->quote($a_obj_id, 
"integer");
 
 1334        $obj_rec = 
$ilDB->fetchAssoc($obj_set);
 
 1336        return $obj_rec[
"layout"];
 
 1348        $lm_tree = 
new ilTree($a_lm_id);
 
 1349        $lm_tree->setTableNames(
'lm_tree', 
'lm_data');
 
 1350        $lm_tree->setTreeTablePK(
"lm_id");
 
 1351        $lm_tree->readRootId();
 
 1353        $childs = $lm_tree->getChildsByType($a_chap_id, 
"pg");
 
 1374        $set = 
$ilDB->query(
"SELECT obj_id FROM lm_data " .
 
 1375            " WHERE lm_id = " . 
$ilDB->quote($a_lm_id, 
"integer") . $and);
 
 1377        while ($rec = 
$ilDB->fetchAssoc($set)) {
 
 1378            $obj_ids[] = $rec[
"obj_id"];
 
 1401        include_once(
"Services/MetaData/classes/class.ilMDIdentifier.php");
 
 1403        if (trim($a_exp_id) == 
"") {
 
 1411            foreach ($entries as 
$id => $e) {
 
 1412                if ($e[
"catalog"] == 
"ILIAS_NID") {
 
 1414                    $identifier->setMetaId(
$id);
 
 1415                    $identifier->delete();
 
 1427            foreach ($entries as 
$id => $e) {
 
 1428                if ($e[
"catalog"] == 
"ILIAS_NID") {
 
 1430                    $identifier->setMetaId(
$id);
 
 1431                    $identifier->read();
 
 1432                    $identifier->setEntry($a_exp_id);
 
 1433                    $identifier->update();
 
 1440                include_once(
"./Services/MetaData/classes/class.ilMD.php");
 
 1442                $md_gen = $md->getGeneral();
 
 1443                $identifier = $md_gen->addIdentifier();
 
 1444                $identifier->setEntry($a_exp_id);
 
 1445                $identifier->setCatalog(
"ILIAS_NID");
 
 1446                $identifier->save();
 
 1460        include_once(
"./Services/MetaData/classes/class.ilMDIdentifier.php");
 
 1467        foreach ($entries as $e) {
 
 1468            if ($e[
"catalog"] == 
"ILIAS_NID") {
 
 1482        include_once(
"./Services/MetaData/classes/class.ilMDIdentifier.php");
 
 1491        include_once(
"./Services/MetaData/classes/class.ilMDIdentifier.php");
 
 1494        foreach ($entries as $e) {
 
 1495            if ($e[
"catalog"] == 
"ILIAS_NID") {
 
 1497                    $res[trim($e[
"entry"])]++;
 
 1512        include_once(
"./Services/MetaData/classes/class.ilMDIdentifier.php");
 
 1526        $a_include_numbers = 
false,
 
 1527        $a_time_scheduled_activation = 
false,
 
 1528        $a_force_content = 
false,
 
 1532        if ($a_lang == 
"") {
 
 1536        if ($a_node[
"type"] == 
"st") {
 
 1537            include_once 
'./Modules/LearningModule/classes/class.ilStructureObject.php';
 
 1542                $a_time_scheduled_activation,
 
 1548            include_once 
'./Modules/LearningModule/classes/class.ilLMPageObject.php';
 
 1553                $a_time_scheduled_activation,
 
 1573        $title_data = array();
 
 1574        if ($a_lang == 
"-") {
 
 1575            $set = 
$db->query(
"SELECT t.child, d.obj_id, d.title, d.short_title FROM lm_data d LEFT JOIN lm_tree t ON (d.obj_id = t.child) WHERE d.lm_id = " .
 
 1576                $db->quote($a_lm_id, 
"integer") . 
" ORDER BY t.lft, d.title");
 
 1578            $set = 
$db->query(
"SELECT t.child, d.obj_id, tr.title, tr.short_title, d.title default_title, d.short_title default_short_title FROM lm_data d " .
 
 1579                " LEFT JOIN lm_tree t ON (d.obj_id = t.child) " .
 
 1580                " LEFT JOIN lm_data_transl tr ON (tr.id = d.obj_id AND tr.lang=" . 
$db->quote($a_lang, 
"text") . 
") WHERE d.lm_id = " .
 
 1581                $db->quote($a_lm_id, 
"integer") . 
" ORDER BY t.lft, d.title");
 
 1583        while ($rec = 
$db->fetchAssoc($set)) {
 
 1584            $title_data[] = $rec;
 
 1601        if ($a_lang != 
"-" && $a_lang != 
"") {
 
 1603            $trans->setShortTitle($a_short_title);
 
 1607                "UPDATE lm_data SET " .
 
 1608                " short_title = " . 
$db->quote($a_short_title, 
"text") .
 
 1609                " WHERE obj_id = " . 
$db->quote($a_id, 
"integer")
 
sprintf('%.4f', $callTime)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
static _createEntry( $a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
static _extractObjIdOfTarget($a_target)
Extract object id out of target.
static _extractTypeOfTarget($a_target)
Extract type out of target.
static _getSourcesOfTarget($a_target_type, $a_target_id, $a_target_inst)
get all sources of a link target
static _extractInstOfTarget($a_target)
Extract installation id out of target.
Translation information on lm object.
static getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
static getDuplicateExportIDs($a_lm_id, $a_type="pg")
Get duplicate export IDs (count export ID usages)
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
static getObjectList($lm_id, $type="")
static
static clipboardCopy($a_cont_obj_id, $a_ids)
Copy a set of chapters/pages into the clipboard.
static _getIdForImportId($a_import_id)
get current object id for import id (static)
setTitle($a_title)
set title of lm object
static _lookupShortTitle($a_obj_id)
Lookup short title.
static _lookup($a_obj_id, $a_field)
Lookup title.
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static clipboardCut($a_cont_obj_id, $a_ids)
Copy a set of chapters/pages into the clipboard.
existsExportID($a_lm_id, $a_exp_id, $a_type="pg")
Does export ID exist in lm?
setContentObject(&$a_content_obj)
static saveTitles($a_lm, $a_titles, $a_lang="-")
Save titles for lm objects.
static _isPagePublic($a_node_id, $a_check_public_mode=false)
getExportIDInfo($a_lm_id, $a_exp_id, $a_type="pg")
Does export ID exist in lm?
static saveExportId($a_lm_id, $a_lmobj_id, $a_exp_id, $a_type="pg")
Save export id.
static getPagesOfChapter($a_lm_id, $a_chap_id)
Get pages of chapter.
static uniqueTypesCheck($a_items)
Check for unique types (all pages or all chapters)
static preloadDataByLM($a_lm_id)
Preload data records by lm.
static _getAllLMObjectsOfLM($a_lm_id, $a_type="")
Get all objects of learning module.
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
deleteMetaData()
delete meta data entry
getTitle()
get title of lm object
setDataRecord($a_record)
this method should only be called by class ilLMObjectFactory
static _lookupTitle($a_obj_id)
Lookup title.
static _writePublicAccessStatus($a_pages, $a_cont_obj_id)
update public access flags in lm_data for all pages of a content object@access public
static lookupLayout($a_obj_id)
Lookup type.
setDescription($a_description)
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
static _getPresentationTitle( $a_node, $a_mode=IL_PAGE_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-")
Get affective title.
getShortTitle()
get short title of lm object
createMetaData()
create meta data entry
static _lookupNID($a_lm_id, $a_lm_obj_id, $a_type)
lookup named identifier (ILIAS_NID)
static _writeImportId($a_id, $a_import_id)
write import id to db (static)
static _deleteAllObjectData(&$a_cobj)
delete all objects of content object (digi book / learning module)
update()
update complete object
static _exists($a_id)
checks wether a lm content object with specified id exists or not
static _writeTitle($a_obj_id, $a_title)
static writeLayout($a_obj_id, $a_layout, $a_lm=null)
Write layout setting.
MDUpdateListener($a_element)
Meta data update listener.
static pasteTree( $a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
static getShortTitles($a_lm_id, $a_lang="-")
Get short titles.
setShortTitle($a_title)
set short title of lm object
static getTree($a_cont_obj_id)
Get learningmodule tree.
static writeShortTitle($a_id, $a_short_title, $a_lang="-")
Write short title.
setLayout($a_val)
Set layout.
updateMetaData()
update meta data entry
static _getAllObjectsForImportId($a_import_id, $a_in_lm=0)
Get all items for an import ID.
__construct($a_content_obj, $a_id=0)
static _getPresentationTitle( $a_pg_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
Extension of ilPageObject for learning modules.
const LP_MODE_COLLECTION_TLT
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static _getEntriesForRbacObj($a_rbac_id, $a_obj_type="")
Get IDs for an rbac object.
static _getEntriesForObj($a_rbac_id, $a_obj_id, $a_obj_type)
Get IDs for an object.
static existsIdInRbacObject($a_rbac_id, $a_obj_type, $a_catalog, $a_entry)
Does id entry exist in rbac object?
static readIdData($a_rbac_id, $a_obj_type, $a_catalog, $a_entry)
Does id entry exist in rbac object?
static _getMobsForTarget($a_type, $a_target)
Get areas for a certain target.
static isHelpLM($a_lm_id)
Check if LM is a help LM.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstance($a_obj_id)
static _getAllReferences($a_id)
get all reference ids of object
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
static lookupTranslations($a_parent_type, $a_id)
Lookup translations.
static _getPresentationTitle( $a_st_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
get presentation title
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static yn2tf($a_yn)
convert "y"/"n" to true/false
catch(Exception $e) $message
foreach($_POST as $key=> $value) $res