/**
  * @param array $row
  * @return array
  */
 protected function prepareRow(array &$row)
 {
     if ((int) $row['user_id']) {
         $this->ctrl->setParameter($this->parent_obj, 'usr_id', '');
         if ($row['user_id'] == $this->parent_obj->object->getOwner()) {
             $row['checkbox'] = ilUtil::formCheckbox(false, 'usr_id[]', $row['user_id'], true);
         } else {
             $row['checkbox'] = ilUtil::formCheckbox(false, 'usr_id[]', $row['user_id'], (int) $row['user_id'] ? false : true);
         }
     } else {
         $row['checkbox'] = '';
     }
     $user_name = '';
     if (strlen($row['lastname']) > 0) {
         $user_name .= $row['lastname'] . ', ';
     }
     if (strlen($row['firstname']) > 0) {
         $user_name .= $row['firstname'];
     }
     $row['user_name'] = $user_name;
     if ($row['xavc_status']) {
         $xavc_options = array("host" => $this->parent_obj->pluginObj->txt("presenter"), "mini-host" => $this->parent_obj->pluginObj->txt("moderator"), "view" => $this->parent_obj->pluginObj->txt("participant"), "denied" => $this->parent_obj->pluginObj->txt("denied"));
         if ($row['xavc_status']) {
             if ($row['user_id'] == $this->parent_obj->object->getOwner()) {
                 $row['xavc_status'] = $this->lng->txt("owner");
             } else {
                 $row['xavc_status'] = ilUtil::formSelect($row['xavc_status'], 'xavc_status[' . $row['user_id'] . ']', $xavc_options);
             }
         } else {
             $row['xavc_status'] = $this->parent_obj->pluginObj->txt('user_only_exists_at_ac_server');
         }
     }
 }
 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng;
     $this->nr++;
     if (!$a_set["default"] && $a_set["lang"] != $this->master_lang) {
         $this->tpl->setCurrentBlock("cb");
         $this->tpl->setVariable("CB_NR", $this->nr);
         $this->tpl->parseCurrentBlock();
     }
     if ($this->master_lang == "") {
         $this->tpl->setCurrentBlock("rb");
         $this->tpl->setVariable("RB_NR", $this->nr);
         if ($a_set["default"]) {
             $this->tpl->setVariable("DEF_CHECKED", "checked=\"checked\"");
         }
         $this->tpl->parseCurrentBlock();
     } else {
         if ($a_set["lang"] == $this->master_lang) {
             $this->tpl->setVariable("MASTER_LANG", $lng->txt("obj_master_lang"));
         }
     }
     if ($this->incl_desc) {
         $this->tpl->setCurrentBlock("desc_row");
         $this->tpl->setVariable("VAL_DESC", ilUtil::prepareFormOutput($a_set["desc"]));
         $this->tpl->setVariable("DNR", $this->nr);
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable("NR", $this->nr);
     // lang selection
     include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
     $languages = ilMDLanguageItem::_getLanguages();
     $this->tpl->setVariable("LANG_SELECT", ilUtil::formSelect($a_set["lang"], "lang[" . $this->nr . "]", $languages, false, true));
     $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"]));
 }
 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl;
     if ($this->getParentObject()->checkStyleSelection()) {
         $this->tpl->setCurrentBlock("class_sel");
         $sel = $a_set["class"] == "" ? "FileListItem" : $a_set["class"];
         $this->tpl->setVariable("CLASS_SEL", ilUtil::formSelect($sel, "class[" . $a_set["hier_id"] . ":" . $a_set["pc_id"] . "]", $this->getParentObject()->getCharacteristics(), false, true));
         $this->tpl->parseCurrentBlock();
     }
     $this->pos += 10;
     $this->tpl->setVariable("POS", $this->pos);
     $this->tpl->setVariable("FID", $a_set["hier_id"] . ":" . $a_set["pc_id"]);
     $this->tpl->setVariable("TXT_FILE", ilObject::_lookupTitle($a_set["id"]));
 }
 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng;
     if ($a_set["page_id"] > 0) {
         $this->tpl->setCurrentBlock("cb");
         $this->tpl->setVariable("PAGE_ID", $a_set["page_id"]);
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("ord");
         $this->tpl->setVariable("PAGE_ID_ORD", $a_set["page_id"]);
         $this->tpl->setVariable("VAL_ORD", $a_set["ord"]);
         $this->tpl->parseCurrentBlock();
         $this->tpl->setVariable("PAGE_TITLE", ilWikiPage::lookupTitle($a_set["page_id"]));
         $this->tpl->setVariable("SEL_INDENT", ilUtil::formSelect($a_set["indent"], "indent[" . $a_set["page_id"] . "]", array(0 => "0", 1 => "1", 2 => "2"), false, true));
     } else {
         $this->tpl->setVariable("PAGE_TITLE", $lng->txt("wiki_start_page"));
     }
 }
 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilAccess;
     $i = $a_set["Nr"];
     $this->tpl->setVariable("CHECKBOX", ilUtil::formCheckBox("", "area[]", $i));
     $this->tpl->setVariable("VAR_NAME", "name_" . $i);
     $this->tpl->setVariable("VAL_NAME", $a_set["Link"]["Title"]);
     $this->tpl->setVariable("VAL_SHAPE", $a_set["Shape"]);
     $this->tpl->setVariable("VAL_HIGHL_MODE", ilUtil::formSelect($a_set["HighlightMode"], "hl_mode_" . $i, $this->highl_modes, false, true));
     $this->tpl->setVariable("VAL_HIGHL_CLASS", ilUtil::formSelect($a_set["HighlightClass"], "hl_class_" . $i, $this->highl_classes, false, true));
     $this->tpl->setVariable("VAL_COORDS", implode(explode(",", $a_set["Coords"]), ", "));
     switch ($a_set["Link"]["LinkType"]) {
         case "ExtLink":
             $this->tpl->setVariable("VAL_LINK", $a_set["Link"]["Href"]);
             break;
         case "IntLink":
             $link_str = $this->parent_obj->getMapAreaLinkString($a_set["Link"]["Target"], $a_set["Link"]["Type"], $a_set["Link"]["TargetFrame"]);
             $this->tpl->setVariable("VAL_LINK", $link_str);
             break;
     }
 }
 /**
  * @param array $row
  * @return array
  */
 protected function prepareRow(array &$row)
 {
     if ((int) $row['user_id']) {
         //			$action = new ilAdvancedSelectionListGUI();
         //			$action->setId('asl_' . $row['user_id']);
         //			$action->setListTitle($this->lng->txt('actions'));
         //			$this->ctrl->setParameter($this->parent_obj, 'user_id', $row['user_id']);
         $this->ctrl->setParameter($this->parent_obj, 'usr_id', '');
         //			$row['actions']  = $action->getHtml();
         if ($row['user_id'] == $this->parent_obj->object->getOwner()) {
             $row['checkbox'] = ilUtil::formCheckbox(false, 'usr_id[]', $row['user_id'], true);
         } else {
             $row['checkbox'] = ilUtil::formCheckbox(false, 'usr_id[]', $row['user_id'], (int) $row['user_id'] ? false : true);
         }
     } else {
         //			$row['actions'] = '';
         $row['checkbox'] = '';
     }
     $user_name = '';
     if (strlen($row['lastname']) > 0) {
         $user_name .= $row['lastname'] . ', ';
     }
     if (strlen($row['firstname']) > 0) {
         $user_name .= $row['firstname'];
     }
     $row['user_name'] = $user_name;
     if ($row['xavc_status']) {
         $xavc_options = array("host" => $this->parent_obj->pluginObj->txt("presenter"), "mini-host" => $this->parent_obj->pluginObj->txt("moderator"), "view" => $this->parent_obj->pluginObj->txt("participant"), "denied" => $this->parent_obj->pluginObj->txt("denied"));
         //			$user_status = ilXAVCMembers::_lookupStatus($row['user_id'], $this->parent_obj->object->getRefId());
         if ($row['xavc_status']) {
             if ($row['user_id'] == $this->parent_obj->object->getOwner()) {
                 $row['xavc_status'] = $this->lng->txt("owner");
             } else {
                 $row['xavc_status'] = ilUtil::formSelect($row['xavc_status'], 'xavc_status[' . $row['user_id'] . ']', $xavc_options);
             }
         } else {
             $row['xavc_status'] = $this->parent_obj->pluginObj->txt('user_only_exists_at_ac_server');
         }
     }
 }
 function _getPurposeSelect($a_selected, $a_name, $prepend = array(), $a_options_only = false)
 {
     global $lng;
     $items = array('Discipline', 'Idea', 'Prerequisite', 'EducationalObjective', 'AccessibilityRestrictions', 'EducationalLevel', 'SkillLevel', 'SecurityLevel', 'Competency');
     foreach ($prepend as $value => $translation) {
         $options[$value] = $translation;
     }
     foreach ($items as $item) {
         $options[$item] = $item;
     }
     // BEGIN PATCH Lucene search
     return $a_options_only ? $options : ilUtil::formSelect($a_selected, $a_name, $options, false, true);
     // END PATCH Lucene Search
     return ilUtil::formSelect($a_selected, $a_name, $options, false, true);
 }
 /**
  * The disk quota report list shows user accounts, their disk quota and their
  * disk usage, as well as the last time a reminder was sent.
  */
 public function viewDiskQuotaReport()
 {
     global $rbacsystem, $ilErr, $ilSetting, $lng;
     if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
         $ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING);
     }
     $this->tabs_gui->setTabActive('disk_quota');
     $this->addDiskQuotaSubtabs('disk_quota_report');
     // nothing to do if disk quota is not active
     require_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
     if (!ilDiskQuotaActivationChecker::_isActive()) {
         return;
     }
     // get the form
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.disk_quota_report.html', "Services/WebDAV");
     // get the date of the last update
     require_once "./Services/WebDAV/classes/class.ilDiskQuotaChecker.php";
     $last_update = ilDiskQuotaChecker::_lookupDiskUsageReportLastUpdate();
     if ($last_update == null) {
         // nothing to do if disk usage report has not been run
         $this->tpl->setVariable('LAST_UPDATE_TEXT', $lng->txt('disk_quota_report_not_run_yet'));
         return;
     } else {
         $this->tpl->setVariable('LAST_UPDATE_TEXT', $lng->txt('last_update') . ': ' . ilFormat::formatDate($last_update, 'datetime', true));
     }
     // Filter
     $_SESSION['quota_usage_filter'] = isset($_POST['usage_filter']) ? $_POST['usage_filter'] : $_SESSION['quota_usage_filter'];
     if ($_SESSION['quota_usage_filter'] == 0) {
         $_SESSION['quota_usage_filter'] = 4;
     }
     $_SESSION['quota_access_filter'] = isset($_POST['access_filter']) ? $_POST['access_filter'] : $_SESSION['quota_access_filter'];
     if ($_SESSION['quota_access_filter'] == 0) {
         $_SESSION['quota_access_filter'] = 1;
     }
     $usage_action[1] = $lng->txt('all_users');
     $usage_action[2] = $lng->txt('filter_users_without_disk_usage');
     $usage_action[3] = $lng->txt('filter_users_with_disk_usage');
     $usage_action[4] = $lng->txt('filter_users_with_exceeded_disk_quota');
     $access_action[1] = $lng->txt('all_users');
     $access_action[2] = $lng->txt('filter_users_with_access');
     $access_action[3] = $lng->txt('filter_users_without_access');
     $select_usage_filter = ilUtil::formSelect($_SESSION['quota_usage_filter'], "usage_filter", $usage_action, false, true);
     $select_access_filter = ilUtil::formSelect($_SESSION['quota_access_filter'], "access_filter", $access_action, false, true);
     $this->tpl->setCurrentBlock("filter");
     $this->tpl->setVariable("FILTER_TXT_FILTER", $lng->txt('filter'));
     $this->tpl->setVariable("SELECT_USAGE_FILTER", $select_usage_filter);
     $this->tpl->setVariable("SELECT_ACCESS_FILTER", $select_access_filter);
     $this->tpl->setVariable("FILTER_ACTION", $this->ctrl->getLinkTarget($this, 'viewDiskQuotaReport'));
     $this->tpl->setVariable("FILTER_NAME", 'view');
     $this->tpl->setVariable("FILTER_VALUE", $lng->txt('apply_filter'));
     $this->tpl->parseCurrentBlock();
     // load templates for table
     $a_tpl = new ilTemplate('tpl.table.html', true, true);
     $a_tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
     // create table
     require_once './Services/Table/classes/class.ilTableGUI.php';
     $tbl = new ilTableGUI(0, false);
     // title & header columns
     $header_vars = array('login', 'firstname', 'lastname', 'email', 'access_until', 'last_login', 'disk_quota', 'disk_usage', 'last_reminder');
     $tbl->setHeaderNames(array($lng->txt('login'), $lng->txt('firstname'), $lng->txt('lastname'), $lng->txt('email'), $lng->txt('access_until'), $lng->txt('last_login'), $lng->txt('disk_quota'), $lng->txt('disk_usage'), $lng->txt('last_reminder')));
     $tbl->setHeaderVars($header_vars, $this->ctrl->getParameterArray($this, 'viewDiskQuotaReport', false));
     $tbl->enable("numinfo_header");
     $tbl->setFormName("cmd");
     $tbl->setSelectAllCheckbox("id");
     // sorting
     $tbl->setOrderColumn($_GET["sort_by"]);
     $tbl->setOrderDirection($_GET["sort_order"]);
     // fetch the data
     $data = ilDiskQuotaChecker::_fetchDiskQuotaReport($_SESSION['quota_usage_filter'], $_SESSION['quota_access_filter'], $header_vars[$tbl->getOrderColumn()], $tbl->getOrderDirection());
     // paging
     $tbl->setLimit($_GET["limit"]);
     $tbl->setOffset($_GET["offset"]);
     $tbl->setMaxCount(count($data));
     // footer
     $tbl->setFooter("tblfooter", $lng->txt("previous"), $lng->txt("next"));
     // render table
     $tbl->setTemplate($a_tpl);
     // render rows
     $count = 0;
     for ($i = $tbl->getOffset(); $i < count($data) && $i < $tbl->getOffset() + $tbl->getLimit(); $i++) {
         $row = $data[$i];
         // build columns
         foreach ($header_vars as $key) {
             switch ($key) {
                 case 'login':
                     //build link
                     $this->ctrl->setParameterByClass("ilobjusergui", "ref_id", "7");
                     $this->ctrl->setParameterByClass("ilobjusergui", "obj_id", $row["usr_id"]);
                     $link = $this->ctrl->getLinkTargetByClass("ilobjusergui", "view");
                     $tbl_content_cell = '<a href="' . $link . '">' . htmlspecialchars($row[$key]) . '</a>';
                     break;
                 case 'disk_quota':
                     if ($row['role_id'] == SYSTEM_ROLE_ID) {
                         $tbl_content_cell = "<span class=\"smallgreen\">" . $lng->txt('access_unlimited') . '</span>';
                     } else {
                         $tbl_content_cell = ilFormat::formatSize($row[$key], 'short');
                     }
                     break;
                 case 'disk_usage':
                     if ($row['last_update'] == null) {
                         $tbl_content_cell = $lng->txt('unknown');
                     } else {
                         if ($row['disk_usage'] > $row['disk_quota']) {
                             $tbl_content_cell = "<span class=\"smallred\">" . ilFormat::formatSize($row[$key], 'short') . '</span>';
                         } else {
                             $tbl_content_cell = ilFormat::formatSize($row[$key], 'short');
                         }
                     }
                     break;
                 case 'access_until':
                     if (!$row['active']) {
                         $tbl_content_cell = "<span class=\"smallred\">" . $lng->txt('inactive') . '</span>';
                     } else {
                         if ($row['time_limit_unlimited']) {
                             $tbl_content_cell = "<span class=\"smallgreen\">" . $lng->txt('access_unlimited') . '</span>';
                         } else {
                             if ($row['expired']) {
                                 $tbl_content_cell = "<span class=\"smallred\">" . $lng->txt('access_expired') . '</span>';
                             } else {
                                 $tbl_content_cell = ilFormat::formatDate($row[$key]);
                             }
                         }
                     }
                     break;
                 case 'last_login':
                 case 'last_reminder':
                     if ($row[$key] == null) {
                         $tbl_content_cell = $lng->txt('no_date');
                     } else {
                         $tbl_content_cell = ilFormat::formatDate($row[$key]);
                     }
                     break;
                 default:
                     $tbl_content_cell = htmlspecialchars($row[$key]);
             }
             /*
             				if (is_array($tbl_content_cell))
             				{
             					$tbl->tpl->setCurrentBlock("tbl_cell_subtitle");
             					$tbl->tpl->setVariable("TBL_CELL_SUBTITLE",$tbl_content_cell[1]);
             					$tbl->tpl->parseCurrentBlock();
             					$tbl_content_cell = "<b>".$tbl_content_cell[0]."</b>";
             				}*/
             $tbl->tpl->setCurrentBlock("tbl_content_cell");
             $tbl->tpl->setVariable("TBL_CONTENT_CELL", $tbl_content_cell);
             $tbl->tpl->parseCurrentBlock();
         }
         $tbl->tpl->setCurrentBlock("tbl_content_row");
         $rowcolor = ilUtil::switchColor($count, "tblrow1", "tblrow2");
         $tbl->tpl->setVariable("ROWCOLOR", $rowcolor);
         $tbl->tpl->parseCurrentBlock();
         $count++;
     }
     $tbl->render();
     // Add table to page
     $this->tpl->setVariable("USER_TABLE", $a_tpl->get());
 }
 function selectArchiveLanguage()
 {
     global $ilAccess;
     // MINIMUM ACCESS LEVEL = 'write'
     if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) {
         $ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->MESSAGE);
     }
     foreach ($this->lng->getInstalledLanguages() as $lang_code) {
         $actions["{$lang_code}"] = $this->lng->txt('lang_' . $lang_code);
         if ($this->lng->getLangKey() == $lang_code) {
             $selected = $lang_code;
         }
     }
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_selectLanguage.html", 'Modules/Course');
     $this->tpl->setVariable("LANGUAGE_SELECTION", $this->lng->txt('crs_archive_language_selection'));
     $this->tpl->setVariable("LANGUAGE", $this->lng->txt('obj_lng'));
     $this->tpl->setVariable("INFO_TXT", $this->lng->txt('crs_select_archive_language'));
     $this->tpl->setVariable("SELECT_FORMACTION", $this->ctrl->getFormAction($this));
     $this->tpl->setVariable("LANG_SELECTOR", ilUtil::formSelect($selected, 'lang', $actions, false, true));
     $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt('cancel'));
     $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt('crs_add_html_archive'));
     return true;
 }
 /**
  * display edit form
  * 
  * @access	public
  */
 function editObject()
 {
     global $rbacsystem, $rbacreview;
     if (!$rbacsystem->checkAccess("edit_permission", $_GET["ref_id"])) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     //prepare objectlist
     $this->data = array();
     $this->data["data"] = array();
     $this->data["ctrl"] = array();
     $this->data["cols"] = array("type", "operation", "description", "status");
     $ops_valid = $rbacreview->getOperationsOnType($this->obj_id);
     if ($ops_arr = ilRbacReview::_getOperationList('', $a_order, $a_direction)) {
         $options = array("e" => "enabled", "d" => "disabled");
         foreach ($ops_arr as $key => $ops) {
             // BEGIN ROW
             if (in_array($ops["ops_id"], $ops_valid)) {
                 $ops_status = 'e';
             } else {
                 $ops_status = 'd';
             }
             $obj = $ops["ops_id"];
             $ops_options = ilUtil::formSelect($ops_status, "id[{$obj}]", $options);
             //visible data part
             $this->data["data"][] = array("type" => "perm", "operation" => $ops["operation"], "description" => $ops["desc"], "status" => $ops_status, "status_html" => $ops_options, "obj_id" => $val["ops_id"]);
         }
     }
     //if typedata
     $this->maxcount = count($this->data["data"]);
     // sorting array
     $this->data["data"] = ilUtil::sortArray($this->data["data"], $_GET["sort_by"], $_GET["sort_order"]);
     // now compute control information
     foreach ($this->data["data"] as $key => $val) {
         $this->data["ctrl"][$key] = array("obj_id" => $val["obj_id"], "type" => $val["type"]);
         unset($this->data["data"][$key]["obj_id"]);
         $this->data["data"][$key]["status"] = $this->data["data"][$key]["status_html"];
         unset($this->data["data"][$key]["status_html"]);
     }
     // build table
     include_once "./Services/Table/classes/class.ilTableGUI.php";
     // load template for table
     $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
     // load template for table content data
     $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
     $num = 0;
     $obj_str = $this->call_by_reference ? "" : "&obj_id=" . $this->obj_id;
     $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=" . $this->ref_id . "{$obj_str}&cmd=save");
     // create table
     $tbl = new ilTableGUI();
     // title & header columns
     $tbl->setTitle($this->lng->txt("edit_operations") . " " . strtolower($this->lng->txt("of")) . " '" . $this->object->getTitle() . "'", "icon_" . $this->object->getType() . "_b.png", $this->lng->txt("obj_" . $this->object->getType()));
     $tbl->setHelp("tbl_help.php", "icon_help.png", $this->lng->txt("help"));
     foreach ($this->data["cols"] as $val) {
         $header_names[] = $this->lng->txt($val);
     }
     $tbl->setHeaderNames($header_names);
     $header_params = array("ref_id" => $this->ref_id, "obj_id" => $this->id, "cmd" => "edit");
     $tbl->setHeaderVars($this->data["cols"], $header_params);
     // control
     $tbl->setOrderColumn($_GET["sort_by"]);
     $tbl->setOrderDirection($_GET["sort_order"]);
     $tbl->setLimit(0);
     $tbl->setOffset(0);
     $tbl->setMaxCount($this->maxcount);
     // SHOW VALID ACTIONS
     $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.png"));
     $this->tpl->setVariable("COLUMN_COUNTS", count($this->data["cols"]));
     // footer
     $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
     //$tbl->disable("footer");
     // render table
     $tbl->render();
     if (is_array($this->data["data"][0])) {
         //table cell
         for ($i = 0; $i < count($this->data["data"]); $i++) {
             $data = $this->data["data"][$i];
             $ctrl = $this->data["ctrl"][$i];
             // color changing
             $css_row = ilUtil::switchColor($i + 1, "tblrow1", "tblrow2");
             $this->tpl->setCurrentBlock("table_cell");
             $this->tpl->setVariable("CELLSTYLE", "tblrow1");
             $this->tpl->parseCurrentBlock();
             foreach ($data as $key => $val) {
                 $this->tpl->setCurrentBlock("text");
                 if ($key == "type") {
                     $val = ilUtil::getImageTagByType($val, $this->tpl->tplPath);
                 }
                 $this->tpl->setVariable("TEXT_CONTENT", $val);
                 $this->tpl->parseCurrentBlock();
                 $this->tpl->setCurrentBlock("table_cell");
                 $this->tpl->parseCurrentBlock();
             }
             //foreach
             $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("save"));
             $this->tpl->setCurrentBlock("tbl_content");
             $this->tpl->setVariable("CSS_ROW", $css_row);
             $this->tpl->parseCurrentBlock();
         }
         //for
     }
     //if is_array
 }
 /**
  * Show the edit screen
  */
 function viewObject()
 {
     global $ilUser;
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lang_edit_items.html", "Services/Language");
     // set the language to compare with
     $compare = $this->getPar('compare', $this->lng->getDefaultLanguage());
     // get the default values if the compare language is the same
     if ($compare == $this->object->key) {
         $compare_object = $this->object->getGlobalLanguageFile();
         $compare_content = $compare_object->getAllValues();
         $compare_comments = $compare_object->getAllComments();
         $compare_note = " " . $this->lng->txt("language_default_entries");
     }
     // get the remarks in database
     $remarks = $this->object->getAllRemarks();
     // page translation mode:
     // - the table is filtered by a list of modules and topics
     // - all found entries are shown on the same page
     if ($this->_isPageTranslation()) {
         $offset = 0;
         $limit = 0;
         $modules = $this->getPar("page_modules", array());
         $topics = $this->getPar("page_topics", array());
         if (!isset($compare_content)) {
             $compare_content = ilObjLanguageExt::_getValues($compare, $modules, $topics);
             $compare_comments = ilObjLanguageExt::_getRemarks($compare);
         }
         $translations = ilObjLanguageExt::_getValues($this->object->key, $modules, $topics);
     } else {
         $offset = $this->getPar('offset', '0');
         $limit = $ilUser->getPref("hits_per_page");
         $filter_mode = $this->getPar('filter_mode', 'all');
         $filter_pattern = $this->getPar('filter_pattern', '');
         $filter_module = $this->getPar('filter_module', 'administration');
         $filter_modules = $filter_module ? array($filter_module) : array();
         if (!isset($compare_content)) {
             $compare_content = ilObjLanguageExt::_getValues($compare, $filter_modules);
             $compare_comments = ilObjLanguageExt::_getRemarks($compare);
         }
         switch ($filter_mode) {
             case "changed":
                 $translations = $this->object->getChangedValues($filter_modules, $filter_pattern);
                 break;
             case "added":
                 //langmode only
                 $translations = $this->object->getAddedValues($filter_modules, $filter_pattern);
                 break;
             case "unchanged":
                 $translations = $this->object->getUnchangedValues($filter_modules, $filter_pattern);
                 break;
             case "commented":
                 $translations = $this->object->getCommentedValues($filter_modules, $filter_pattern);
                 break;
             case "dbremarks":
                 $translations = $this->object->getAllValues($filter_modules, $filter_pattern);
                 $translations = array_intersect_key($translations, $remarks);
                 break;
             case "equal":
                 $translations = $this->object->getAllValues($filter_modules, $filter_pattern);
                 $translations = array_intersect_assoc($translations, $compare_content);
                 break;
             case "different":
                 $translations = $this->object->getAllValues($filter_modules, $filter_pattern);
                 $translations = array_diff_assoc($translations, $compare_content);
                 break;
             case "conflicts":
                 $former_file = $this->object->getCustLangPath() . '/ilias_' . $this->object->key . '.lang';
                 if (!is_readable($former_file)) {
                     ilUtil::sendFailure(sprintf($this->lng->txt("language_former_file_missing"), $former_file) . '<br />' . $this->lng->txt("language_former_file_description"), false);
                     $translations = array();
                     break;
                 }
                 $global_file_obj = $this->object->getGlobalLanguageFile();
                 $former_file_obj = new ilLanguageFile($former_file);
                 $former_file_obj->read();
                 $global_changes = array_diff_assoc($global_file_obj->getAllValues(), $former_file_obj->getAllValues());
                 if (!count($global_changes)) {
                     ilUtil::sendInfo(sprintf($this->lng->txt("language_former_file_equal"), $former_file) . '<br />' . $this->lng->txt("language_former_file_description"), false);
                     $translations = array();
                     break;
                 }
                 $translations = $this->object->getChangedValues($filter_modules, $filter_pattern);
                 $translations = array_intersect_key($translations, $global_changes);
                 break;
             case "all":
             default:
                 $translations = $this->object->getAllValues($filter_modules, $filter_pattern);
         }
         // show the filter section
         $this->tpl->setCurrentBlock("filter");
         // filter by language module
         $options = array();
         $options[""] = $this->lng->txt("language_all_modules");
         $modules = ilObjLanguageExt::_getModules($this->object->key);
         foreach ($modules as $mod) {
             $options[$mod] = $mod;
         }
         $this->tpl->setVariable("SELECT_MODULE", ilUtil::formSelect($filter_module, "filter_module", $options, false, true));
         // filter by mode
         $options = array();
         $options["all"] = $this->lng->txt("language_scope_global");
         $options["changed"] = $this->lng->txt("language_scope_local");
         if ($this->langmode) {
             $options["added"] = $this->lng->txt("language_scope_added");
         }
         $options["unchanged"] = $this->lng->txt("language_scope_unchanged");
         $options["equal"] = $this->lng->txt("language_scope_equal");
         $options["different"] = $this->lng->txt("language_scope_different");
         $options["commented"] = $this->lng->txt("language_scope_commented");
         if ($this->langmode) {
             $options["dbremarks"] = $this->lng->txt("language_scope_dbremarks");
         }
         $options["conflicts"] = $this->lng->txt("language_scope_conflicts");
         $this->tpl->setVariable("SELECT_MODE", ilUtil::formSelect($filter_mode, "filter_mode", $options, false, true));
         // filter by pattern
         $this->tpl->setVariable("PATTERN_NAME", "filter_pattern");
         $this->tpl->setVariable("PATTERN_VALUE", ilUtil::prepareFormOutput($filter_pattern));
         // and general filter variables
         $this->tpl->setVariable("FILTER_ACTION", $this->ctrl->getFormAction($this));
         $this->tpl->setVariable("TXT_FILTER", $this->lng->txt("filter"));
         $this->tpl->setVariable("OFFSET_NAME", "offset");
         $this->tpl->setVariable("OFFSET_VALUE", "0");
         $this->tpl->setVariable("TXT_APPLY_FILTER", $this->lng->txt("apply_filter"));
         $this->tpl->setVariable("CMD_FILTER", "view");
         $this->tpl->parseCurrentBlock();
     }
     // show the compare section
     $this->tpl->setCurrentBlock("compare");
     $this->tpl->setVariable("COMPARE_ACTION", $this->ctrl->getFormAction($this));
     $this->tpl->setVariable("TXT_COMPARE", $this->lng->txt("language_compare"));
     $this->tpl->setVariable("TXT_CHANGE", $this->lng->txt("change"));
     $options = array();
     $langlist = $this->lng->getInstalledLanguages();
     foreach ($langlist as $lang_key) {
         $options[$lang_key] = $this->lng->txt("meta_l_" . $lang_key);
     }
     $this->tpl->setVariable("SELECT_COMPARE", ilUtil::formSelect($compare, "compare", $options, false, true, 1));
     $this->tpl->setVariable("CMD_COMPARE", "view");
     $this->tpl->parseCurrentBlock();
     // prepare the dataset for the output table
     $sort_by = $this->getPar('sort_by', 'translation');
     $sort_order = $this->getPar('sort_order', 'asc');
     $list = array();
     foreach ($translations as $name => $translation) {
         $keys = explode($this->lng->separator, $name);
         $data = array();
         $data["module"] = $keys[0];
         $data["topic"] = $keys[1];
         $data["name"] = $name;
         $data["translation"] = $translation;
         $data["default"] = $compare_content[$name];
         $data["default_comment"] = $compare_comments[$name];
         $list[] = $data;
     }
     $list = ilUtil::sortArray($list, $sort_by, $sort_order);
     if ($limit > 0) {
         $list = array_slice($list, $offset, $limit);
     }
     // create and configure the table object
     include_once 'Services/Table/classes/class.ilTableGUI.php';
     $tbl = new ilTableGUI();
     $tbl->disable('title');
     $tbl->setHeaderNames(array($this->lng->txt("module"), $this->lng->txt("identifier"), $this->lng->txt("meta_l_" . $this->object->key), $this->lng->txt("meta_l_" . $compare) . $compare_note));
     $tbl->setHeaderVars(array("module", "topic", "translation", "default"), $this->ctrl->getParameterArray($this));
     $tbl->setColumnWidth(array("10%", "20%", "40%", "30%"));
     $tbl->setOrderColumn($sort_by);
     $tbl->setOrderDirection($sort_order);
     $tbl->setLimit($limit);
     $tbl->setOffset($offset);
     $tbl->setMaxCount(count($translations));
     // prepare the table template
     $tpl =& new ilTemplate("tpl.table.html", true, true);
     $tpl->setCurrentBlock("tbl_form_header");
     $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("tbl_action_btn");
     $tpl->setVariable("BTN_NAME", 'save');
     $tpl->setVariable("BTN_VALUE", $this->lng->txt('save'));
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("tbl_action_row");
     $tpl->setVariable("COLUMN_COUNTS", "4");
     $tpl->parseCurrentBlock();
     // render the table rows
     $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.lang_items_row.html", "Services/Language");
     foreach ($list as $data) {
         if ($this->langmode) {
             $tpl->setCurrentBlock('comment');
             $tpl->setVariable("COM_ID", ilUtil::prepareFormOutput($data["name"] . $this->lng->separator . "comment"));
             $tpl->setVariable("COM_NAME", ilUtil::prepareFormOutput($data["name"] . $this->lng->separator . "comment"));
             $tpl->setVariable("COM_VALUE", ilUtil::prepareFormOutput($remarks[$data["name"]]));
             $tpl->setVariable("COM_SIZE", $this->commentsize);
             $tpl->setVariable("COM_MAX", 250);
             $tpl->setVariable("TXT_COMMENT", $this->lng->txt('comment'));
             $tpl->parseCurrentBlock();
         } else {
             $tpl->setCurrentBlock('hidden_comment');
             $tpl->setVariable("COM_NAME", ilUtil::prepareFormOutput($data["name"] . $this->lng->separator . "comment"));
             $tpl->setVariable("COM_VALUE", ilUtil::prepareFormOutput($remarks[$data["name"]]));
             $tpl->parseCurrentBlock();
         }
         $tpl->setCurrentBlock("row");
         $tpl->setVariable("T_ROWS", ceil(strlen($data["translation"]) / $this->inputsize));
         $tpl->setVariable("T_SIZE", $this->inputsize);
         $tpl->setVariable("T_NAME", ilUtil::prepareFormOutput($data["name"]));
         $tpl->setVariable("T_USER_VALUE", ilUtil::prepareFormOutput($data["translation"]));
         $tpl->setVariable("MODULE", ilUtil::prepareFormOutput($data["module"]));
         $tpl->setVariable("TOPIC", ilUtil::prepareFormOutput($data["topic"]));
         $tpl->setVariable("DEFAULT_VALUE", ilUtil::prepareFormOutput($data["default"]));
         $tpl->setVariable("COMMENT", ilUtil::prepareFormOutput($data["default_comment"]));
         $tpl->parseCurrentBlock();
     }
     // render and show the table
     $tbl->setTemplate($tpl);
     $tbl->render();
     $this->tpl->setVariable("TRANSLATION_TABLE", $tpl->get());
     //		$this->tpl->show();
 }
 /**
  * displays form in which the member-status can be changed
  * @access public
  */
 function changeMemberObject()
 {
     global $rbacreview, $ilUser;
     $this->__setSubTabs('members');
     $member_ids = array();
     if (isset($_POST['user_id'])) {
         $member_ids = $_POST['user_id'];
     } else {
         if (isset($_GET['mem_id'])) {
             $member_ids[0] = $_GET['mem_id'];
         } else {
             if (isset($_GET['mem_id_arr'])) {
                 $member_ids = explode(',', $_GET['mem_id_arr']);
             }
         }
     }
     if (empty($member_ids[0])) {
         $this->ilErr->raiseError($this->lng->txt('no_checkbox'), $this->ilErr->MESSAGE);
     }
     if (!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) && !in_array($ilUser->getId(), $this->object->getAdminIds())) {
         $this->ilErr->raiseError($this->lng->txt('grp_err_no_permission'), $this->ilErr->MESSAGE);
     }
     $stati = array_flip($this->object->getLocalRoles(true));
     // fetch docent or student assignment form all coursemembers from iLinc server
     $docent_ids = $this->object->getiLincMemberIds(true);
     $student_ids = $this->object->getiLincMemberIds(false);
     $data = array();
     //build data structure
     foreach ($member_ids as $member_id) {
         $member = ilObjectFactory::getInstanceByObjId($member_id);
         $mem_status = $this->object->getMemberRoles($member_id);
         include_once 'Modules/ILinc/classes/class.ilObjiLincUser.php';
         $ilinc_user = new ilObjiLincUser($member);
         $ilinc_status = $this->object->checkiLincMemberStatus($ilinc_user->id, $docent_ids, $student_ids);
         $docent = 0;
         $student = 0;
         if ($ilinc_status == ILINC_MEMBER_DOCENT) {
             $docent = 1;
         } else {
             if ($ilinc_status == ILINC_MEMBER_STUDENT) {
                 $student = 1;
             }
         }
         $radio1 = ilUtil::formRadioButton($docent, 'ilinc_member_status_select[' . $member->getId() . '][' . $ilinc_user->id . ']', ILINC_MEMBER_DOCENT);
         $radio2 = ilUtil::formRadioButton($student, 'ilinc_member_status_select[' . $member->getId() . '][' . $ilinc_user->id . ']', ILINC_MEMBER_STUDENT);
         $data[$member->getId()] = array('login' => $member->getLogin(), 'firstname' => $member->getFirstname(), 'lastname' => $member->getLastname(), 'attending_as' => $radio1 . ' ' . $this->lng->txt('ilinc_docent') . '<br />' . $radio2 . ' ' . $this->lng->txt('ilinc_student'), 'grp_role' => ilUtil::formSelect($mem_status, 'member_status_select[' . $member->getId() . '][]', $stati, true, true, 3));
     }
     unset($member);
     unset($ilinc_user);
     include_once 'Modules/ILinc/classes/class.iliLinkMembersTableGUI.php';
     $this->ctrl->setParameter($this, 'mem_id_arr', implode(',', $member_ids));
     $oTable = new iliLinkMembersTableGUI($this, $data, 'change', 'changeMember', 'changeMember');
     $oTable->setTitle($this->lng->txt('grp_mem_change_status'), 'icon_usr_b.png', $this->lng->txt('grp_mem_change_status'));
     return $this->tpl->setContent($oTable->getHTML());
 }
 /**
  * Fill template row
  * @param array $a_set
  */
 protected function fillRow($a_set)
 {
     global $objDefinition;
     include_once './Services/Link/classes/class.ilLink.php';
     $this->tpl->setCurrentBlock('item_row');
     $this->tpl->setVariable('ITEM_ID', $a_set['id']);
     $this->tpl->setVariable('COLL_TITLE', $a_set['title']);
     $this->tpl->setVariable('COLL_DESC', $a_set['description']);
     if ($this->getMode() == ilLPObjSettings::LP_MODE_SCORM) {
         $this->tpl->setVariable('TYPE_IMG', ilUtil::getImagePath('icon_sco_s.png'));
         $this->tpl->setVariable('ALT_IMG', $this->lng->txt('obj_sco'));
     } else {
         if ($objDefinition->isPluginTypeName($a_set["type"])) {
             $alt = ilPlugin::lookupTxt("rep_robj", $a_set['type'], "obj_" . $a_set['type']);
         } else {
             $alt = $this->lng->txt('obj_' . $a_set['type']);
         }
         $this->tpl->setVariable('ALT_IMG', $alt);
         $this->tpl->setVariable('TYPE_IMG', ilObject::_getIcon("", "tiny", $a_set['type']));
         if ($this->getMode() != ilLPObjSettings::LP_MODE_COLLECTION_MANUAL && $this->getMode() != ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
             $this->tpl->setVariable('COLL_LINK', ilLink::_getLink($a_set['ref_id'], $a_set['type']));
             $this->tpl->setVariable('COLL_FRAME', ilFrameTargetInfo::_getFrame('MainContent', $a_set['type']));
             include_once './Services/Tree/classes/class.ilPathGUI.php';
             $path = new ilPathGUI();
             $this->tpl->setVariable('COLL_PATH', $this->lng->txt('path') . ': ' . $path->getPath($this->getNode(), $a_set['ref_id']));
             $mode = $a_set['mode_id'];
             if ($mode != ilLPObjSettings::LP_MODE_DEACTIVATED && $mode != ilLPObjSettings::LP_MODE_UNDEFINED) {
                 $this->tpl->setVariable("COLL_MODE", $a_set['mode']);
             } else {
                 $this->tpl->setVariable("COLL_MODE", "");
                 $this->tpl->setVariable("COLL_MODE_DEACTIVATED", $a_set['mode']);
             }
             if ($a_set["anonymized"]) {
                 $this->tpl->setVariable("ANONYMIZED", $this->lng->txt('trac_anonymized_info_short'));
             }
         } else {
             if ($this->getMode() == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
                 // handle tlt settings
                 $this->tpl->setCurrentBlock("tlt");
                 $this->tpl->setVariable("TXT_MONTH", $this->lng->txt('md_months'));
                 $this->tpl->setVariable("TXT_DAYS", $this->lng->txt('md_days'));
                 $this->tpl->setVariable("TXT_TIME", $this->lng->txt('md_time'));
                 $this->tpl->setVariable("TLT_HINT", '(hh:mm)');
                 // seconds to units
                 $mon = floor($a_set["tlt"] / (60 * 60 * 24 * 30));
                 $tlt = $a_set["tlt"] % (60 * 60 * 24 * 30);
                 $day = floor($tlt / (60 * 60 * 24));
                 $tlt = $tlt % (60 * 60 * 24);
                 $hr = floor($tlt / (60 * 60));
                 $tlt = $tlt % (60 * 60);
                 $min = floor($tlt / 60);
                 $options = array();
                 for ($i = 0; $i <= 24; $i++) {
                     $options[$i] = sprintf('%02d', $i);
                 }
                 $this->tpl->setVariable("SEL_MONTHS", ilUtil::formSelect($mon, 'tlt[' . $a_set['id'] . '][mo]', $options, false, true));
                 for ($i = 0; $i <= 31; $i++) {
                     $options[$i] = sprintf('%02d', $i);
                 }
                 $this->tpl->setVariable("SEL_DAYS", ilUtil::formSelect($day, 'tlt[' . $a_set['id'] . '][d]', $options, false, true));
                 $this->tpl->setVariable("SEL_TLT", ilUtil::makeTimeSelect('tlt[' . $a_set['id'] . ']', true, $hr, $min, null, false));
                 $this->tpl->parseCurrentBlock();
             }
         }
     }
     // Assigned ?
     $this->tpl->setVariable("ASSIGNED_IMG_OK", $a_set['status'] ? ilUtil::getImagePath('icon_ok.png') : ilUtil::getImagePath('icon_not_ok.png'));
     $this->tpl->setVariable("ASSIGNED_STATUS", $a_set['status'] ? $this->lng->txt('trac_assigned') : $this->lng->txt('trac_not_assigned'));
     $this->tpl->parseCurrentBlock();
     // Parse grouped items
     foreach ((array) $a_set['grouped'] as $item) {
         $this->fillRow($item);
     }
     // show num obligatory info
     if (count($a_set['grouped'])) {
         $this->tpl->setCurrentBlock('num_passed_items');
         $this->tpl->setVariable('MIN_PASSED_TXT', $this->lng->txt('trac_min_passed'));
         $this->tpl->setVariable('NUM_OBLIGATORY', $a_set['num_obligatory']);
         $this->tpl->setVariable('GRP_ID', $a_set['grouping_id']);
         $this->tpl->parseCurrentBlock();
     }
 }
 function showEntrySelector()
 {
     global $ilTabs, $ilCtrl;
     $this->setTabs();
     $ilTabs->setTabActive("settings");
     $this->setSubTabs("cont_lm_menu");
     $ilCtrl->saveParameter($this, array("menu_entry"));
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_menu_object_selector.html", "Modules/LearningModule");
     ilUtil::sendInfo($this->lng->txt("lm_menu_select_object_to_add"));
     require_once "./Modules/LearningModule/classes/class.ilLMMenuObjectSelector.php";
     $exp = new ilLMMenuObjectSelector($this->ctrl->getLinkTarget($this, 'test'), $this);
     $exp->setExpand($_GET["lm_menu_expand"] ? $_GET["lm_menu_expand"] : $this->tree->readRootId());
     $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'showEntrySelector'));
     $exp->setTargetGet("ref_id");
     $exp->setRefId($this->cur_ref_id);
     $sel_types = array('mcst', 'mep', 'cat', 'lm', 'dbk', 'glo', 'frm', 'exc', 'tst', 'svy', 'chat', 'wiki', 'sahs', "crs", "grp", "book", "tst", "file");
     $exp->setSelectableTypes($sel_types);
     //$exp->setTargetGet("obj_id");
     // build html-output
     $exp->setOutput(0);
     $output = $exp->getOutput();
     // get page ids
     foreach ($exp->format_options as $node) {
         if (!$node["container"]) {
             $pages[] = $node["child"];
         }
     }
     //$this->tpl->setCurrentBlock("content");
     //var_dump($this->object->getPublicAccessMode());
     // access mode selector
     $this->tpl->setVariable("TXT_SET_PUBLIC_MODE", $this->lng->txt("set_public_mode"));
     $this->tpl->setVariable("TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt("choose_public_mode"));
     $modes = array("complete" => $this->lng->txt("all_pages"), "selected" => $this->lng->txt("selected_pages_only"));
     $select_public_mode = ilUtil::formSelect($this->object->getPublicAccessMode(), "lm_public_mode", $modes, false, true);
     $this->tpl->setVariable("SELECT_PUBLIC_MODE", $select_public_mode);
     $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("choose_public_pages"));
     $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
     $this->tpl->setVariable("EXPLORER", $output);
     $this->tpl->setVariable("ONCLICK", $js_pages);
     $this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
     $this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
     $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
     $this->tpl->setVariable("FORMACTION", $this->ctrl->getLinkTarget($this, "savePublicSection"));
     //$this->tpl->parseCurrentBlock();
 }
 /**
  * Show link help list
  */
 function showLinkHelp()
 {
     global $ilUser, $ilCtrl;
     // filter link types
     if (!$this->filter_white_list) {
         foreach ($this->filter_link_types as $link_type) {
             unset($this->ltypes[$link_type]);
         }
     } else {
         $ltypes = array();
         foreach ($this->ltypes as $k => $l) {
             if (in_array($k, $this->filter_link_types)) {
                 $ltypes[$k] = $l;
             }
         }
         $this->ltypes = $ltypes;
     }
     // determine link type and target
     $this->determineLinkType();
     $ltype = $this->link_target != "" ? $this->link_type . "_" . $this->link_target : $this->link_type;
     $def_type = ilObject::_lookupType($this->default_obj, true);
     // determine content object id
     switch ($this->link_type) {
         case "PageObject":
         case "StructureObject":
             if (empty($_SESSION["il_link_cont_obj"]) && ($def_type != "mep" && $def_type != "glo")) {
                 $_SESSION["il_link_cont_obj"] = $this->default_obj;
             }
             break;
         case "GlossaryItem":
             if (empty($_SESSION["il_link_glossary"]) && $def_type == "glo") {
                 $_SESSION["il_link_glossary"] = $this->default_obj;
             }
             break;
         case "Media":
             if (empty($_SESSION["il_link_mep"]) && $def_type == "mep") {
                 $_SESSION["il_link_mep"] = $this->default_obj;
             }
             break;
     }
     /*
     		$target_str = ($link_target == "")
     			? ""
     			: " target=\"".$link_target."\" ";*/
     $target_str = $this->link_target == "" ? "" : " target=\"" . $this->link_target . "\"";
     //echo "-".$this->link_type."-";
     if ($this->link_type == "GlossaryItem" && (empty($_SESSION["il_link_glossary"]) || !in_array(ilObject::_lookupType($_SESSION["il_link_glossary"], true), array("glo")))) {
         $this->changeTargetObject("glo");
     }
     if (($this->link_type == "PageObject" || $this->link_type == "StructureObject") && (empty($_SESSION["il_link_cont_obj"]) || !in_array(ilObject::_lookupType($_SESSION["il_link_cont_obj"], true), array("lm", "dbk")))) {
         $this->changeTargetObject("cont_obj");
     }
     if ($ilCtrl->isAsynch()) {
         $tpl = new ilTemplate("tpl.link_help_asynch.html", true, true, "Modules/LearningModule");
     } else {
         $tpl =& new ilTemplate("tpl.link_help.html", true, true, "Modules/LearningModule");
         $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     }
     switch ($this->link_type) {
         case "GlossaryItem":
             $this->ctrl->setParameter($this, "target_type", "glo");
             break;
         case "PageObject":
         case "StructureObject":
             $this->ctrl->setParameter($this, "target_type", "cont_obj");
             break;
         case "Media":
             $this->ctrl->setParameter($this, "target_type", "mep");
             break;
         default:
             break;
     }
     //echo "<br><br>:".$this->ctrl->getFormAction($this).":";
     //echo "<br>link_type:".$this->link_type;
     //echo "<br>cont_obj:".$_SESSION["il_link_cont_obj"];
     //echo "<br>link_mep".$_SESSION["il_link_mep"];
     //echo $this->ctrl->getFormAction($this, "", "", true);
     $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "changeLinkType", "", true));
     $tpl->setVariable("FORMACTION2", $this->ctrl->getFormAction($this));
     $tpl->setVariable("TXT_HELP_HEADER", $this->lng->txt("cont_link_select"));
     $tpl->setVariable("TXT_TYPE", $this->lng->txt("cont_link_type"));
     //echo "<br><br>".$ltype;
     $select_ltype = ilUtil::formSelect($ltype, "ltype", $this->ltypes, false, true, "0", "", array("id" => "ilIntLinkTypeSelector"));
     $tpl->setVariable("SELECT_TYPE", $select_ltype);
     $tpl->setVariable("CMD_CHANGETYPE", "changeLinkType");
     $tpl->setVariable("BTN_CHANGETYPE", $this->lng->txt("cont_change_type"));
     /*		if ($this->isEnabledJavaScript())
     		{
     			$tpl->setVariable("BTN_CLOSE_JS", $this->lng->txt("close"));
     		}
     		else 
     		{*/
     $tpl->setVariable("CMD_CLOSE", "closeLinkHelp");
     $tpl->setVariable("BTN_CLOSE", $this->lng->txt("close"));
     //		}
     $chapterRowBlock = "chapter_row";
     $anchor_row_block = "anchor_link";
     if ($this->isEnabledJavaScript()) {
         $chapterRowBlock .= "_js";
         $anchor_row_block .= "_js";
     }
     $obj_id = ilObject::_lookupObjId($_SESSION["il_link_cont_obj"]);
     $type = ilObject::_lookupType($obj_id);
     // switch link type
     switch ($this->link_type) {
         // page link
         case "PageObject":
             require_once "./Modules/LearningModule/classes/class.ilObjLearningModule.php";
             include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
             $cont_obj = new ilObjLearningModule($_SESSION["il_link_cont_obj"], true);
             // get all chapters
             $ctree = $cont_obj->getLMTree();
             $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
             $tpl->setCurrentBlock("chapter_list");
             $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("cont_content_obj"));
             $tpl->setVariable("TXT_CONT_TITLE", $cont_obj->getTitle());
             $tpl->setCurrentBlock("change_cont_obj");
             $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
             $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
             $tpl->parseCurrentBlock();
             foreach ($nodes as $node) {
                 if ($node["type"] == "st") {
                     $tpl->setCurrentBlock("chapter_row");
                     $tpl->setVariable("TXT_CHAPTER", $node["title"]);
                     $tpl->setVariable("ROWCLASS", "tblrow1");
                     //$tpl->setVariable("LINK_CHAPTER",
                     //	"[iln chap=\"".$node["obj_id"]."\"".$target_str."] [/iln]");
                     $tpl->parseCurrentBlock();
                     $tpl->setCurrentBlock("row");
                     $tpl->parseCurrentBlock();
                 }
                 if ($node["type"] == "pg") {
                     include_once "./Services/COPage/classes/class.ilPCParagraph.php";
                     $this->renderLink($tpl, $node["title"], $node["obj_id"], "PageObject", "pg", "page", ilPCParagraph::_readAnchors($type, $node["obj_id"], ""));
                 }
             }
             // get all free pages
             $pages = ilLMPageObject::getPageList($cont_obj->getId());
             $free_pages = array();
             foreach ($pages as $page) {
                 if (!$ctree->isInTree($page["obj_id"])) {
                     $free_pages[] = $page;
                 }
             }
             if (count($free_pages) > 0) {
                 $tpl->setCurrentBlock(str_replace("_js", "", $chapterRowBlock));
                 $tpl->setVariable("TXT_CHAPTER", $this->lng->txt("cont_free_pages"));
                 $tpl->setVariable("ROWCLASS", "tblrow1");
                 $tpl->parseCurrentBlock();
                 foreach ($free_pages as $node) {
                     include_once "./Services/COPage/classes/class.ilPCParagraph.php";
                     $this->renderLink($tpl, $node["title"], $node["obj_id"], "PageObject", "pg", "page", ilPCParagraph::_readAnchors($type, $node["obj_id"], ""));
                 }
             }
             $tpl->setCurrentBlock("chapter_list");
             $tpl->parseCurrentBlock();
             break;
             // chapter link
         // chapter link
         case "StructureObject":
             // check whether current object matchs to type
             if (!in_array(ilObject::_lookupType($_SESSION["il_link_cont_obj"], true), array("lm", "dbk"))) {
                 $this->changeTargetObject("lm");
             }
             if ($type == "lm") {
                 require_once "./Modules/LearningModule/classes/class.ilObjLearningModule.php";
                 $cont_obj = new ilObjLearningModule($_SESSION["il_link_cont_obj"], true);
             } else {
                 if ($type == "dbk") {
                     require_once "./Modules/LearningModule/classes/class.ilObjDlBook.php";
                     $cont_obj = new ilObjDlBook($_SESSION["il_link_cont_obj"], true);
                 }
             }
             // get all chapters
             $ctree =& $cont_obj->getLMTree();
             $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
             $tpl->setCurrentBlock("chapter_list");
             $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("cont_content_obj"));
             $tpl->setVariable("TXT_CONT_TITLE", $cont_obj->getTitle());
             $tpl->setCurrentBlock("change_cont_obj");
             $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
             $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
             $tpl->parseCurrentBlock();
             foreach ($nodes as $node) {
                 if ($node["type"] == "st") {
                     $this->renderLink($tpl, $node["title"], $node["obj_id"], "StructureObject", "st", "chap");
                 }
             }
             $tpl->setCurrentBlock("chapter_list");
             $tpl->parseCurrentBlock();
             break;
             // glossary item link
         // glossary item link
         case "GlossaryItem":
             require_once "./Modules/Glossary/classes/class.ilObjGlossary.php";
             $glossary =& new ilObjGlossary($_SESSION["il_link_glossary"], true);
             // get all glossary items
             $terms = $glossary->getTermList();
             $tpl->setCurrentBlock("chapter_list");
             $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("glossary"));
             $tpl->setVariable("TXT_CONT_TITLE", $glossary->getTitle());
             $tpl->setCurrentBlock("change_cont_obj");
             $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
             $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
             $tpl->parseCurrentBlock();
             foreach ($terms as $term) {
                 $this->renderLink($tpl, $term["term"], $term["id"], "GlossaryItem", "git", "term");
             }
             $tpl->setCurrentBlock("chapter_list");
             $tpl->parseCurrentBlock();
             break;
             // media object
         // media object
         case "Media":
             include_once "./Modules/MediaPool/classes/class.ilMediaPoolItem.php";
             //$tpl->setVariable("TARGET2", " target=\"content\" ");
             // content object id = 0 --> get clipboard objects
             if ($_SESSION["il_link_mep"] == 0) {
                 $tpl->setCurrentBlock("change_cont_obj");
                 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
                 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
                 $tpl->parseCurrentBlock();
                 $mobjs = $this->ilias->account->getClipboardObjects("mob");
                 // sort by name
                 $objs = array();
                 foreach ($mobjs as $obj) {
                     $objs[$obj["title"] . ":" . $obj["id"]] = $obj;
                 }
                 ksort($objs);
                 $tpl->setCurrentBlock("chapter_list");
                 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("cont_media_source"));
                 $tpl->setVariable("TXT_CONT_TITLE", $this->lng->txt("cont_personal_clipboard"));
                 $tpl->setVariable("COLSPAN", "2");
                 foreach ($objs as $obj) {
                     $this->renderLink($tpl, $obj["title"], $obj["id"], "MediaObject", "mob", "media");
                 }
                 $tpl->setCurrentBlock("chapter_list");
                 $tpl->parseCurrentBlock();
             } else {
                 require_once "./Modules/MediaPool/classes/class.ilObjMediaPool.php";
                 $med_pool =& new ilObjMediaPool($_SESSION["il_link_mep"], true);
                 // get current folders
                 $fobjs = $med_pool->getChilds($_SESSION["il_link_mep_obj"], "fold");
                 $f2objs = array();
                 foreach ($fobjs as $obj) {
                     $f2objs[$obj["title"] . ":" . $obj["child"]] = $obj;
                 }
                 ksort($f2objs);
                 // get current media objects
                 $mobjs = $med_pool->getChilds($_SESSION["il_link_mep_obj"], "mob");
                 $m2objs = array();
                 foreach ($mobjs as $obj) {
                     $m2objs[$obj["title"] . ":" . $obj["child"]] = $obj;
                 }
                 ksort($m2objs);
                 // merge everything together
                 $objs = array_merge($f2objs, $m2objs);
                 $tpl->setCurrentBlock("chapter_list");
                 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("mep"));
                 $tpl->setVariable("TXT_CONT_TITLE", $med_pool->getTitle());
                 $tpl->setCurrentBlock("change_cont_obj");
                 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
                 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
                 $tpl->setVariable("COLSPAN", "2");
                 $tpl->parseCurrentBlock();
                 if ($parent_id = $med_pool->getParentId($_SESSION["il_link_mep_obj"])) {
                     $css_row = "tblrow1";
                     $tpl->setCurrentBlock("icon");
                     $tpl->setVariable("ICON_SRC", ilUtil::getImagePath("icon_fold.png"));
                     $tpl->parseCurrentBlock();
                     $tpl->setCurrentBlock("link_row");
                     $tpl->setVariable("ROWCLASS", $css_row);
                     $tpl->setVariable("TXT_CHAPTER", "..");
                     $this->ctrl->setParameter($this, "mep_fold", $parent_id);
                     if ($ilCtrl->isAsynch()) {
                         $tpl->setVariable("LINK", "#");
                         $tpl->setVariable("LR_ONCLICK", " onclick=\"return il.IntLink.setMepPoolFolder('" . $parent_id . "');\" ");
                     } else {
                         $tpl->setVariable("LINK", $this->ctrl->getLinkTarget($this, "setMedPoolFolder"));
                     }
                     $tpl->parseCurrentBlock();
                     $tpl->setCurrentBlock("row");
                     $tpl->parseCurrentBlock();
                 }
                 foreach ($objs as $obj) {
                     if ($obj["type"] == "fold") {
                         $css_row = $css_row == "tblrow2" ? "tblrow1" : "tblrow2";
                         $tpl->setCurrentBlock("icon");
                         $tpl->setVariable("ICON_SRC", ilUtil::getImagePath("icon_fold.png"));
                         $tpl->parseCurrentBlock();
                         $tpl->setCurrentBlock("link_row");
                         $tpl->setVariable("ROWCLASS", $css_row);
                         $tpl->setVariable("TXT_CHAPTER", $obj["title"]);
                         $this->ctrl->setParameter($this, "mep_fold", $obj["child"]);
                         if ($ilCtrl->isAsynch()) {
                             $tpl->setVariable("LINK", "#");
                             $tpl->setVariable("LR_ONCLICK", " onclick=\"return il.IntLink.setMepPoolFolder('" . $obj["child"] . "');\" ");
                         } else {
                             $tpl->setVariable("LINK", $this->ctrl->getLinkTarget($this, "setMedPoolFolder"));
                         }
                         $tpl->parseCurrentBlock();
                     } else {
                         $fid = ilMediaPoolItem::lookupForeignId($obj["child"]);
                         if (ilObject::_lookupType($fid) == "mob") {
                             $this->renderLink($tpl, $obj["title"], $fid, "MediaObject", "mob", "media");
                         }
                     }
                     $tpl->setCurrentBlock("row");
                     $tpl->parseCurrentBlock();
                 }
                 $tpl->setCurrentBlock("chapter_list");
                 $tpl->parseCurrentBlock();
             }
             break;
             // repository item
         // repository item
         case "RepositoryItem":
             $tpl->setVariable("LINK_HELP_CONTENT", $this->selectRepositoryItem());
             break;
             // file download link
         // file download link
         case "File":
             if (!is_object($this->uploaded_file)) {
                 $tpl->setVariable("LINK_HELP_CONTENT", $this->getFileLinkHTML());
             } else {
                 echo $this->getFileLinkHTML();
                 exit;
             }
             break;
     }
     if ($ilCtrl->isAsynch()) {
         echo $tpl->get();
         exit;
     }
     exit;
 }
 /**
  * Init style properties form
  */
 function initStylePropertiesForm()
 {
     global $ilCtrl, $lng, $ilTabs, $ilSetting;
     $lng->loadLanguageModule("style");
     $this->setSubTabs("settings", "style");
     $ilTabs->setTabActive("settings");
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $fixed_style = $ilSetting->get("fixed_content_style_id");
     $style_id = $this->object->getStyleSheetId();
     if ($fixed_style > 0) {
         $st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
         $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")");
         $this->form->addItem($st);
     } else {
         $st_styles = ilObjStyleSheet::_getStandardStyles(true, false, $_GET["ref_id"]);
         $st_styles[0] = $this->lng->txt("default");
         ksort($st_styles);
         if ($style_id > 0) {
             // individual style
             if (!ilObjStyleSheet::_lookupStandard($style_id)) {
                 $st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
                 $st->setValue(ilObject::_lookupTitle($style_id));
                 $this->form->addItem($st);
                 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit"));
                 // delete command
                 $this->form->addCommandButton("editStyle", $lng->txt("cont_edit_style"));
                 $this->form->addCommandButton("deleteStyle", $lng->txt("cont_delete_style"));
                 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete"));
             }
         }
         if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) {
             $style_sel = ilUtil::formSelect($style_id, "style_id", $st_styles, false, true);
             $style_sel = new ilSelectInputGUI($lng->txt("cont_current_style"), "style_id");
             $style_sel->setOptions($st_styles);
             $style_sel->setValue($style_id);
             $this->form->addItem($style_sel);
             //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create"));
             $this->form->addCommandButton("saveStyleSettings", $lng->txt("save"));
             $this->form->addCommandButton("createStyle", $lng->txt("sty_create_ind_style"));
         }
     }
     $this->form->setTitle($lng->txt("cont_style"));
     $this->form->setFormAction($ilCtrl->getFormAction($this));
 }
 private function showCourseDefinedFields()
 {
     global $ilUser;
     include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
     include_once 'Modules/Course/classes/Export/class.ilCourseUserData.php';
     if (!count($cdf_fields = ilCourseDefinedFieldDefinition::_getFields($this->obj_id))) {
         return true;
     }
     foreach ($cdf_fields as $field_obj) {
         $course_user_data = new ilCourseUserData($ilUser->getId(), $field_obj->getId());
         switch ($field_obj->getType()) {
             case IL_CDF_TYPE_SELECT:
                 $this->tpl->setCurrentBlock('sel_row');
                 // Workaround for mantis 9868
                 $options[0] = $this->lng->txt('links_select_one');
                 foreach ($field_obj->getValues() as $value) {
                     $options[$field_obj->getId() . '_' . $value] = $value;
                 }
                 $this->tpl->setVariable('SEL_SELECT', ilUtil::formSelect($field_obj->getId() . '_' . $course_user_data->getValue(), 'cdf[' . $field_obj->getId() . ']', $options, false, true));
                 break;
             case IL_CDF_TYPE_TEXT:
                 $this->tpl->setCurrentBlock('txt_row');
                 $this->tpl->setVariable('TXT_ROW_NAME', $field_obj->getId());
                 $this->tpl->setVariable('TXT_ROW_VALUE', $course_user_data->getValue());
                 break;
         }
         if ($field_obj->isRequired()) {
             $this->show_required_info = true;
             $this->tpl->touchBlock('cdf_required');
         }
         $this->tpl->setCurrentBlock('cdf_row');
         $this->tpl->setVariable('CDF_FIELD_NAME', $field_obj->getName());
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setCurrentBlock('cdf');
     $this->tpl->setVariable('CDF_TXT', $this->lng->txt($this->type . '_ps_cdf_info'));
     $this->tpl->parseCurrentBlock();
 }
 /**
  * scorm module properties
  */
 function properties()
 {
     global $rbacsystem, $tree, $tpl;
     // edit button
     $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
     // view link
     $this->tpl->setCurrentBlock("btn_cell");
     $this->tpl->setVariable("BTN_LINK", "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->object->getRefID());
     $this->tpl->setVariable("BTN_TARGET", " target=\"ilContObj" . $this->object->getID() . "\" ");
     $this->tpl->setVariable("BTN_TXT", $this->lng->txt("view"));
     $this->tpl->parseCurrentBlock();
     if (ilObjSAHSLearningModule::_lookupSubType($this->object->getID()) == "scorm") {
         // upload new version
         $this->tpl->setCurrentBlock("btn_cell");
         $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "newModuleVersion"));
         $this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_sc_new_version"));
         $this->tpl->parseCurrentBlock();
     }
     // scorm lm properties
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.sahs_properties.html", "Modules/ScormAicc");
     $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $this->tpl->setVariable("TXT_PROPERTIES", $this->lng->txt("cont_lm_properties"));
     // online
     $this->tpl->setVariable("TXT_ONLINE", $this->lng->txt("cont_online"));
     $this->tpl->setVariable("CBOX_ONLINE", "cobj_online");
     $this->tpl->setVariable("VAL_ONLINE", "y");
     if ($this->object->getOnline()) {
         $this->tpl->setVariable("CHK_ONLINE", "checked");
     }
     //open
     $this->tpl->setVariable("TXT_OPEN", $this->lng->txt("cont_open"));
     $open_modes = array("0" => $this->lng->txt("cont_open_normal"), "1" => $this->lng->txt("cont_open_iframe_max"), "2" => $this->lng->txt("cont_open_iframe_defined"), "5" => $this->lng->txt("cont_open_window_undefined"), "6" => $this->lng->txt("cont_open_window_defined"));
     $sel_open = ilUtil::formSelect($this->object->getOpenMode(), "open_mode", $open_modes, false, true);
     $this->tpl->setVariable("SEL_OPEN", $sel_open);
     //width
     $this->tpl->setVariable("TXT_WIDTH", $this->lng->txt("cont_open_width"));
     $this->tpl->setVariable("VAL_WIDTH", $this->object->getWidth());
     //heigth
     $this->tpl->setVariable("TXT_HEIGHT", $this->lng->txt("cont_open_heigth"));
     $this->tpl->setVariable("VAL_HEIGHT", $this->object->getHeight());
     // api adapter name
     $this->tpl->setVariable("TXT_API_ADAPTER", $this->lng->txt("cont_api_adapter"));
     $this->tpl->setVariable("VAL_API_ADAPTER", $this->object->getAPIAdapterName());
     // api functions prefix
     $this->tpl->setVariable("TXT_API_PREFIX", $this->lng->txt("cont_api_func_prefix"));
     $this->tpl->setVariable("VAL_API_PREFIX", $this->object->getAPIFunctionsPrefix());
     // default lesson mode
     $this->tpl->setVariable("TXT_LESSON_MODE", $this->lng->txt("cont_def_lesson_mode"));
     $lesson_modes = array("normal" => $this->lng->txt("cont_sc_less_mode_normal"), "browse" => $this->lng->txt("cont_sc_less_mode_browse"));
     $sel_lesson = ilUtil::formSelect($this->object->getDefaultLessonMode(), "lesson_mode", $lesson_modes, false, true);
     $this->tpl->setVariable("SEL_LESSON_MODE", $sel_lesson);
     // credit mode
     $this->tpl->setVariable("TXT_CREDIT_MODE", $this->lng->txt("cont_credit_mode"));
     $credit_modes = array("credit" => $this->lng->txt("cont_credit_on"), "no_credit" => $this->lng->txt("cont_credit_off"));
     $sel_credit = ilUtil::formSelect($this->object->getCreditMode(), "credit_mode", $credit_modes, false, true);
     $this->tpl->setVariable("SEL_CREDIT_MODE", $sel_credit);
     // auto review mode
     $this->tpl->setVariable("TXT_AUTO_REVIEW", $this->lng->txt("cont_sc_auto_review"));
     $this->tpl->setVariable("CBOX_AUTO_REVIEW", "auto_review");
     $this->tpl->setVariable("VAL_AUTO_REVIEW", "y");
     if ($this->object->getAutoReview()) {
         $this->tpl->setVariable("CHK_AUTO_REVIEW", "checked");
     }
     // max attempts
     $this->tpl->setVariable("MAX_ATTEMPTS", $this->lng->txt("cont_sc_max_attempt"));
     $this->tpl->setVariable("VAL_MAX_ATTEMPT", $this->object->getMaxAttempt());
     // version
     $this->tpl->setVariable("TXT_VERSION", $this->lng->txt("cont_sc_version"));
     $this->tpl->setVariable("VAL_VERSION", $this->object->getModuleVersion());
     //unlimited session
     $this->tpl->setVariable("TXT_SESSION", $this->lng->txt("cont_sc_usession"));
     $this->tpl->setVariable("CBOX_SESSION", "cobj_session");
     $this->tpl->setVariable("VAL_SESSION", "y");
     if ($this->object->getSession()) {
         $this->tpl->setVariable("CHK_SESSION", "checked");
     }
     // auto continue
     $this->tpl->setVariable("TXT_AUTO_CONTINUE", $this->lng->txt("cont_sc_auto_continue"));
     $this->tpl->setVariable("CBOX_AUTO_CONTINUE", "auto_continue");
     $this->tpl->setVariable("VAL_AUTO_CONTINUE", "y");
     if ($this->object->getAutoContinue()) {
         $this->tpl->setVariable("CHK_AUTO_CONTINUE", "checked");
     }
     //enable auto navigation to last visited item
     $this->tpl->setVariable("TXT_AUTO_LAST_VISITED", $this->lng->txt("cont_auto_last_visited"));
     $this->tpl->setVariable("CBOX_AUTO_LAST_VISITED", "cobj_auto_last_visited");
     $this->tpl->setVariable("VAL_AUTO_LAST_VISITED", "y");
     if ($this->object->getAuto_last_visited()) {
         $this->tpl->setVariable("CHK_AUTO_LAST_VISITED", "checked");
     }
     //check_values
     $this->tpl->setVariable("TXT_CHECK_VALUES", $this->lng->txt("cont_check_values"));
     $this->tpl->setVariable("CBOX_CHECK_VALUES", "cobj_check_values");
     $this->tpl->setVariable("VAL_CHECK_VALUES", "y");
     if ($this->object->getCheck_values()) {
         $this->tpl->setVariable("CHK_CHECK_VALUES", "checked");
     }
     //debug
     $this->tpl->setVariable("TXT_DEBUG", $this->lng->txt("cont_debug"));
     $this->tpl->setVariable("CBOX_DEBUG", "cobj_debug");
     $this->tpl->setVariable("VAL_DEBUG", "y");
     if ($this->object->getDebug()) {
         $this->tpl->setVariable("CHK_DEBUG", "checked");
     }
     //debugActivated
     if ($this->object->getDebugActivated() == false) {
         $this->tpl->setVariable("CHK_ACTIVATED", "disabled");
         $this->tpl->setVariable("TXT_ACTIVATED", $this->lng->txt("cont_debug_deactivated"));
     } else {
         $this->tpl->setVariable("TXT_ACTIVATED", $this->lng->txt("cont_debug_deactivate"));
     }
     $this->tpl->setCurrentBlock("commands");
     $this->tpl->setVariable("BTN_NAME", "saveProperties");
     $this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
     $this->tpl->parseCurrentBlock();
 }
Esempio n. 19
0
 /**
  * display content of page
  */
 function showPage()
 {
     global $tree, $ilUser, $lng, $ilCtrl, $ilSetting, $ilTabs;
     // jquery and jquery ui are always provided for components
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     iljQueryUtil::initjQueryUI();
     //		$this->initSelfAssessmentRendering();
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
     ilObjMediaObjectGUI::includePresentationJS($GLOBALS["tpl"]);
     $GLOBALS["tpl"]->addJavaScript("./Services/COPage/js/ilCOPagePres.js");
     // needed for overlays in iim
     include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
     ilOverlayGUI::initJavascript();
     include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php";
     ilPlayerUtil::initMediaElementJs($GLOBALS["tpl"]);
     // init template
     //if($this->outputToTemplate())
     //{
     if ($this->getOutputMode() == "edit") {
         //echo ":".$this->getTemplateTargetVar().":";
         $tpl = new ilTemplate("tpl.page_edit_wysiwyg.html", true, true, "Services/COPage");
         //$this->tpl->addBlockFile($this->getTemplateTargetVar(), "adm_content", "tpl.page_edit_wysiwyg.html", "Services/COPage");
         // to do: status dependent class
         $tpl->setVariable("CLASS_PAGE_TD", "ilc_Page");
         // user comment
         if ($this->isEnabledChangeComments()) {
             $tpl->setCurrentBlock("change_comment");
             $tpl->setVariable("TXT_ADD_COMMENT", $this->lng->txt("cont_add_change_comment"));
             $tpl->parseCurrentBlock();
         }
         $tpl->setVariable("WYSIWYG_ACTION", $ilCtrl->getFormActionByClass("ilpageeditorgui", "", "", true));
         // determine media, html and javascript mode
         $sel_media_mode = $ilUser->getPref("ilPageEditor_MediaMode") == "disable" ? "disable" : "enable";
         $sel_html_mode = $ilUser->getPref("ilPageEditor_HTMLMode") == "disable" ? "disable" : "enable";
         $sel_js_mode = "disable";
         //if($ilSetting->get("enable_js_edit", 1))
         //{
         $sel_js_mode = ilPageEditorGUI::_doJSEditing() ? "enable" : "disable";
         //}
         // show prepending html
         $tpl->setVariable("PREPENDING_HTML", $this->getPrependingHtml());
         $tpl->setVariable("TXT_CONFIRM_DELETE", $lng->txt("cont_confirm_delete"));
         // presentation view
         if ($this->getViewPageLink() != "") {
             $ilTabs->addNonTabbedLink("pres_view", $this->lng->txt("cont_presentation_view"), $this->getViewPageLink(), $this->getViewPageTarget());
         }
         // show actions drop down
         $this->addActionsMenu($tpl, $sel_media_mode, $sel_html_mode, $sel_js_mode);
         // get js files for JS enabled editing
         if ($sel_js_mode == "enable") {
             $this->insertHelp($tpl);
             include_once "./Services/YUI/classes/class.ilYuiUtil.php";
             ilYuiUtil::initDragDrop();
             ilYuiUtil::initConnection();
             ilYuiUtil::initPanel(false);
             $GLOBALS["tpl"]->addJavaScript("./Services/COPage/js/ilcopagecallback.js");
             $GLOBALS["tpl"]->addJavascript("Services/COPage/js/page_editing.js");
             include_once './Services/Style/classes/class.ilObjStyleSheet.php';
             $GLOBALS["tpl"]->addOnloadCode("var preloader = new Image();\n\t\t\t\t\t\tpreloader.src = './templates/default/images/loader.svg';\n\t\t\t\t\t\tilCOPage.setContentCss('" . ilObjStyleSheet::getContentStylePath((int) $this->getStyleId()) . ", " . ilUtil::getStyleSheetLocation() . ", ./Services/COPage/css/tiny_extra.css" . "')");
             //$GLOBALS["tpl"]->addJavascript("Services/RTE/tiny_mce_3_3_9_2/il_tiny_mce_src.js");
             $GLOBALS["tpl"]->addJavascript("Services/COPage/tiny/4_1_5/tinymce.js");
             $tpl->touchBlock("init_dragging");
             $cfg = $this->getPageConfig();
             $tpl->setVariable("IL_TINY_MENU", self::getTinyMenu($this->getPageObject()->getParentType(), $cfg->getEnableInternalLinks(), $cfg->getEnableWikiLinks(), $cfg->getEnableKeywords(), $this->getStyleId(), true, true, $cfg->getEnableAnchors()));
             // add int link parts
             include_once "./Services/Link/classes/class.ilInternalLinkGUI.php";
             $tpl->setCurrentBlock("int_link_prep");
             $tpl->setVariable("INT_LINK_PREP", ilInternalLinkGUI::getInitHTML($ilCtrl->getLinkTargetByClass(array("ilpageeditorgui", "ilinternallinkgui"), "", false, true, false)));
             $tpl->parseCurrentBlock();
             include_once "./Services/YUI/classes/class.ilYuiUtil.php";
             ilYuiUtil::initConnection();
             $GLOBALS["tpl"]->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
         }
         // multiple actions
         $cnt_pcs = $this->getPageObject()->countPageContents();
         if ($cnt_pcs > 1 || $this->getPageObject()->getParentType() != "qpl" && $cnt_pcs > 0) {
             $tpl->setCurrentBlock("multi_actions");
             if ($sel_js_mode == "enable") {
                 $tpl->setVariable("ONCLICK_DE_ACTIVATE_SELECTED", 'onclick="return ilEditMultiAction(\'activateSelected\');"');
                 $tpl->setVariable("ONCLICK_DELETE_SELECTED", 'onclick="return ilEditMultiAction(\'deleteSelected\');"');
                 $tpl->setVariable("ONCLICK_ASSIGN_CHARACTERISTIC", 'onclick="return ilEditMultiAction(\'assignCharacteristicForm\');"');
                 $tpl->setVariable("ONCLICK_COPY_SELECTED", 'onclick="return ilEditMultiAction(\'copySelected\');"');
                 $tpl->setVariable("ONCLICK_CUT_SELECTED", 'onclick="return ilEditMultiAction(\'cutSelected\');"');
                 $tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
                 $tpl->setVariable("ONCLICK_SELECT_ALL", 'onclick="return ilEditMultiAction(\'selectAll\');"');
             }
             $tpl->setVariable("TXT_DE_ACTIVATE_SELECTED", $this->lng->txt("cont_ed_enable"));
             $tpl->setVariable("TXT_ASSIGN_CHARACTERISTIC", $this->lng->txt("cont_assign_characteristic"));
             $tpl->setVariable("TXT_DELETE_SELECTED", $this->lng->txt("cont_delete_selected"));
             $tpl->setVariable("TXT_COPY_SELECTED", $this->lng->txt("copy"));
             $tpl->setVariable("TXT_CUT_SELECTED", $this->lng->txt("cut"));
             $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
             $tpl->parseCurrentBlock();
         }
     } else {
         // presentation or preview here
         $tpl = new ilTemplate("tpl.page.html", true, true, "Services/COPage");
         if ($this->getEnabledPageFocus()) {
             $tpl->touchBlock("page_focus");
         }
         include_once "./Services/User/classes/class.ilUserUtil.php";
         // presentation
         if ($this->isPageContainerToBeRendered()) {
             $tpl->touchBlock("page_container_1");
             $tpl->touchBlock("page_container_2");
             $tpl->touchBlock("page_container_3");
         }
         // history
         $c_old_nr = $this->getPageObject()->old_nr;
         if ($c_old_nr > 0 || $this->getCompareMode() || $_GET["history_mode"] == 1) {
             $hist_info = $this->getPageObject()->getHistoryInfo($c_old_nr);
             if (!$this->getCompareMode()) {
                 $ilCtrl->setParameter($this, "history_mode", "1");
                 // previous revision
                 if (is_array($hist_info["previous"])) {
                     $tpl->setCurrentBlock("previous_rev");
                     $tpl->setVariable("TXT_PREV_REV", $lng->txt("cont_previous_rev"));
                     $ilCtrl->setParameter($this, "old_nr", $hist_info["previous"]["nr"]);
                     $tpl->setVariable("HREF_PREV", $ilCtrl->getLinkTarget($this, "preview"));
                     $tpl->parseCurrentBlock();
                 } else {
                     $tpl->setCurrentBlock("previous_rev_disabled");
                     $tpl->setVariable("TXT_PREV_REV", $lng->txt("cont_previous_rev"));
                     $tpl->parseCurrentBlock();
                 }
                 // next revision
                 if ($c_old_nr > 0) {
                     $tpl->setCurrentBlock("next_rev");
                     $tpl->setVariable("TXT_NEXT_REV", $lng->txt("cont_next_rev"));
                     $ilCtrl->setParameter($this, "old_nr", $hist_info["next"]["nr"]);
                     $tpl->setVariable("HREF_NEXT", $ilCtrl->getLinkTarget($this, "preview"));
                     $tpl->parseCurrentBlock();
                     // latest revision
                     $tpl->setCurrentBlock("latest_rev");
                     $tpl->setVariable("TXT_LATEST_REV", $lng->txt("cont_latest_rev"));
                     $ilCtrl->setParameter($this, "old_nr", "");
                     $tpl->setVariable("HREF_LATEST", $ilCtrl->getLinkTarget($this, "preview"));
                     $tpl->parseCurrentBlock();
                 }
                 $ilCtrl->setParameter($this, "history_mode", "");
                 // rollback
                 if ($c_old_nr > 0 && $ilUser->getId() != ANONYMOUS_USER_ID) {
                     $tpl->setCurrentBlock("rollback");
                     $ilCtrl->setParameter($this, "old_nr", $c_old_nr);
                     $tpl->setVariable("HREF_ROLLBACK", $ilCtrl->getLinkTarget($this, "rollbackConfirmation"));
                     $ilCtrl->setParameter($this, "old_nr", "");
                     $tpl->setVariable("TXT_ROLLBACK", $lng->txt("cont_rollback"));
                     $tpl->parseCurrentBlock();
                 }
             }
             $tpl->setCurrentBlock("hist_nav");
             $tpl->setVariable("TXT_REVISION", $lng->txt("cont_revision"));
             $tpl->setVariable("VAL_REVISION_DATE", ilDatePresentation::formatDate(new ilDateTime($hist_info["current"]["hdate"], IL_CAL_DATETIME)));
             $tpl->setVariable("VAL_REV_USER", ilUserUtil::getNamePresentation($hist_info["current"]["user_id"]));
             $tpl->parseCurrentBlock();
         }
     }
     if ($this->getOutputMode() != IL_PAGE_PRESENTATION && $this->getOutputMode() != IL_PAGE_OFFLINE && $this->getOutputMode() != IL_PAGE_PREVIEW && $this->getOutputMode() != IL_PAGE_PRINT) {
         $tpl->setVariable("FORMACTION", $this->ctrl->getFormActionByClass("ilpageeditorgui"));
     }
     // output media object edit list (of media links)
     if ($this->getOutputMode() == "edit") {
         $links = ilInternalLink::_getTargetsOfSource($this->obj->getParentType() . ":pg", $this->obj->getId(), $this->obj->getLanguage());
         $mob_links = array();
         foreach ($links as $link) {
             if ($link["type"] == "mob") {
                 if (ilObject::_exists($link["id"]) && ilObject::_lookupType($link["id"]) == "mob") {
                     $mob_links[$link["id"]] = ilObject::_lookupTitle($link["id"]) . " [" . $link["id"] . "]";
                 }
             }
         }
         // linked media objects
         if (count($mob_links) > 0) {
             $tpl->setCurrentBlock("med_link");
             $tpl->setVariable("TXT_LINKED_MOBS", $this->lng->txt("cont_linked_mobs"));
             $tpl->setVariable("SEL_MED_LINKS", ilUtil::formSelect(0, "mob_id", $mob_links, false, true));
             $tpl->setVariable("TXT_EDIT_MEDIA", $this->lng->txt("cont_edit_mob"));
             $tpl->setVariable("TXT_COPY_TO_CLIPBOARD", $this->lng->txt("cont_copy_to_clipboard"));
             //$this->tpl->setVariable("TXT_COPY_TO_POOL", $this->lng->txt("cont_copy_to_mediapool"));
             $tpl->parseCurrentBlock();
         }
         // content snippets used
         include_once "./Services/COPage/classes/class.ilPCContentInclude.php";
         $snippets = ilPCContentInclude::collectContentIncludes($this->getPageObject(), $this->getPageObject()->getDomDoc());
         if (count($snippets) > 0) {
             foreach ($snippets as $s) {
                 include_once "./Modules/MediaPool/classes/class.ilMediaPoolPage.php";
                 $sn_arr[$s["id"]] = ilMediaPoolPage::lookupTitle($s["id"]);
             }
             $tpl->setCurrentBlock("med_link");
             $tpl->setVariable("TXT_CONTENT_SNIPPETS_USED", $this->lng->txt("cont_snippets_used"));
             $tpl->setVariable("SEL_SNIPPETS", ilUtil::formSelect(0, "ci_id", $sn_arr, false, true));
             $tpl->setVariable("TXT_SHOW_INFO", $this->lng->txt("cont_show_info"));
             $tpl->parseCurrentBlock();
         }
         // scheduled activation?
         if (!$this->getPageObject()->getActive() && $this->getPageObject()->getActivationStart() != "" && $this->getPageConfig()->getEnableScheduledActivation()) {
             $tpl->setCurrentBlock("activation_txt");
             $tpl->setVariable("TXT_SCHEDULED_ACTIVATION", $lng->txt("cont_scheduled_activation"));
             $tpl->setVariable("SA_FROM", ilDatePresentation::formatDate(new ilDateTime($this->getPageObject()->getActivationStart(), IL_CAL_DATETIME)));
             $tpl->setVariable("SA_TO", ilDatePresentation::formatDate(new ilDateTime($this->getPageObject()->getActivationEnd(), IL_CAL_DATETIME)));
             $tpl->parseCurrentBlock();
         }
     }
     if ($_GET["reloadTree"] == "y") {
         $tpl->setCurrentBlock("reload_tree");
         if ($this->obj->getParentType() == "dbk") {
             $tpl->setVariable("LINK_TREE", $this->ctrl->getLinkTargetByClass("ilobjdlbookgui", "explorer", "", false, false));
         } else {
             $tpl->setVariable("LINK_TREE", $this->ctrl->getLinkTargetByClass("ilobjlearningmodulegui", "explorer", "", false, false));
         }
         $tpl->parseCurrentBlock();
     }
     //		}
     // get content
     $builded = $this->obj->buildDom();
     // manage hierarchical ids
     if ($this->getOutputMode() == "edit") {
         // add pc ids, if necessary
         if (!$this->obj->checkPCIds()) {
             $this->obj->insertPCIds();
             $this->obj->update(true, true);
         }
         $this->obj->addFileSizes();
         $this->obj->addHierIDs();
         $hids = $this->obj->getHierIds();
         $row1_ids = $this->obj->getFirstRowIds();
         $col1_ids = $this->obj->getFirstColumnIds();
         $litem_ids = $this->obj->getListItemIds();
         $fitem_ids = $this->obj->getFileItemIds();
         // standard menues
         $hids = $this->obj->getHierIds();
         foreach ($hids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_" . $hid);
             $tpl->parseCurrentBlock();
         }
         // column menues for tables
         foreach ($col1_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_r" . $hid);
             $tpl->parseCurrentBlock();
         }
         // row menues for tables
         foreach ($row1_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_c" . $hid);
             $tpl->parseCurrentBlock();
         }
         // list item menues
         foreach ($litem_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_i" . $hid);
             $tpl->parseCurrentBlock();
         }
         // file item menues
         foreach ($fitem_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_i" . $hid);
             $tpl->parseCurrentBlock();
         }
     } else {
         $this->obj->addFileSizes();
     }
     //echo "<br>-".htmlentities($this->obj->getXMLContent())."-<br><br>";
     //echo "<br>-".htmlentities($this->getLinkXML())."-";
     // set default link xml, if nothing was set yet
     if (!$this->link_xml_set) {
         $this->setDefaultLinkXml();
     }
     //$content = $this->obj->getXMLFromDom(false, true, true,
     //	$this->getLinkXML().$this->getQuestionXML().$this->getComponentPluginsXML());
     $link_xml = $this->getLinkXML();
     // disable/enable auto margins
     if ($this->getStyleId() > 0) {
         if (ilObject::_lookupType($this->getStyleId()) == "sty") {
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $style = new ilObjStyleSheet($this->getStyleId());
             $template_xml = $style->getTemplateXML();
             $disable_auto_margins = "n";
             if ($style->lookupStyleSetting("disable_auto_margins")) {
                 $disable_auto_margins = "y";
             }
         }
     }
     if ($this->getAbstractOnly()) {
         $content = "<dummy><PageObject><PageContent><Paragraph>" . $this->obj->getFirstParagraphText() . $link_xml . "</Paragraph></PageContent></PageObject></dummy>";
     } else {
         $content = $this->obj->getXMLFromDom(false, true, true, $link_xml . $this->getQuestionXML() . $template_xml . $this->getComponentPluginsXML());
     }
     // check validation errors
     if ($builded !== true) {
         $this->displayValidationError($builded);
     } else {
         $this->displayValidationError($_SESSION["il_pg_error"]);
     }
     unset($_SESSION["il_pg_error"]);
     if (isset($_SESSION["citation_error"])) {
         ilUtil::sendFailure($this->lng->txt("cont_citation_selection_not_valid"));
         ilSession::clear("citation_error");
     }
     // get title
     $pg_title = $this->getPresentationTitle();
     $col_path = ilUtil::getImagePath("col.svg");
     $row_path = ilUtil::getImagePath("row.svg");
     $item_path = ilUtil::getImagePath("item.svg");
     if ($this->getOutputMode() != "offline") {
         $enlarge_path = ilUtil::getImagePath("enlarge.svg");
         $wb_path = ilUtil::getWebspaceDir("output") . "/";
     } else {
         $enlarge_path = "images/enlarge.svg";
         $wb_path = "";
     }
     $pg_title_class = $this->getOutputMode() == "print" ? "ilc_PrintPageTitle" : "";
     // page splitting only for learning modules and
     // digital books
     $enable_split_new = $this->obj->getParentType() == "lm" || $this->obj->getParentType() == "dbk" ? "y" : "n";
     // page splitting to next page only for learning modules and
     // digital books if next page exists in tree
     if (($this->obj->getParentType() == "lm" || $this->obj->getParentType() == "dbk") && ilObjContentObject::hasSuccessorPage($this->obj->getParentId(), $this->obj->getId())) {
         $enable_split_next = "y";
     } else {
         $enable_split_next = "n";
     }
     $img_path = ilUtil::getImagePath("", false, $this->getOutputMode(), $this->getOutputMode() == "offline");
     if ($this->getPageConfig()->getEnablePCType("Tabs")) {
         //include_once("./Services/YUI/classes/class.ilYuiUtil.php");
         //ilYuiUtil::initTabView();
         include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
         ilAccordionGUI::addJavaScript();
         ilAccordionGUI::addCss();
     }
     $file_download_link = $this->determineFileDownloadLink();
     $fullscreen_link = $this->determineFullscreenLink();
     $this->sourcecode_download_script = $this->determineSourcecodeDownloadScript();
     // default values for various parameters (should be used by
     // all instances in the future)
     $media_mode = $this->getOutputMode() == "edit" ? $ilUser->getPref("ilPageEditor_MediaMode") : "enable";
     include_once "./Modules/LearningModule/classes/class.ilEditClipboard.php";
     $paste = ilEditClipboard::getAction() == "copy" && $this->getOutputMode() == "edit";
     include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php";
     $flv_video_player = $this->getOutputMode() != "offline" ? ilPlayerUtil::getFlashVideoPlayerFilename(true) : ilPlayerUtil::getFlashVideoPlayerFilename(true);
     $cfg = $this->getPageConfig();
     // added UTF-8 encoding otherwise umlaute are converted too
     include_once "./Services/Maps/classes/class.ilMapUtil.php";
     $params = array('mode' => $this->getOutputMode(), 'pg_title' => htmlentities($pg_title, ENT_QUOTES, "UTF-8"), 'enable_placeholder' => $cfg->getEnablePCType("PlaceHolder") ? "y" : "n", 'pg_id' => $this->obj->getId(), 'pg_title_class' => $pg_title_class, 'webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path, 'img_col' => $col_path, 'img_row' => $row_path, 'img_item' => $item_path, 'enable_split_new' => $enable_split_new, 'enable_split_next' => $enable_split_next, 'link_params' => $this->link_params, 'file_download_link' => $file_download_link, 'fullscreen_link' => $fullscreen_link, 'img_path' => $img_path, 'parent_id' => $this->obj->getParentId(), 'download_script' => $this->sourcecode_download_script, 'encoded_download_script' => urlencode($this->sourcecode_download_script), 'bib_id' => $this->getBibId(), 'citation' => (int) $this->isEnabledCitation(), 'pagebreak' => $this->lng->txt('dgl_pagebreak'), 'page' => $this->lng->txt('page'), 'citate_page' => $this->lng->txt('citate_page'), 'citate_from' => $this->lng->txt('citate_from'), 'citate_to' => $this->lng->txt('citate_to'), 'citate' => $this->lng->txt('citate'), 'enable_rep_objects' => $cfg->getEnablePCType("Resources") ? "y" : "n", 'enable_login_page' => $cfg->getEnablePCType("LoginPageElement") ? "y" : "n", 'enable_map' => $cfg->getEnablePCType("Map") && ilMapUtil::isActivated() ? "y" : "n", 'enable_tabs' => $cfg->getEnablePCType("Tabs") ? "y" : "n", 'enable_sa_qst' => $cfg->getEnableSelfAssessment() ? "y" : "n", 'enable_file_list' => $cfg->getEnablePCType("FileList") ? "y" : "n", 'enable_content_includes' => $cfg->getEnablePCType("ContentInclude") ? "y" : "n", 'enable_content_templates' => count($this->getPageObject()->getContentTemplates()) > 0 ? "y" : "n", 'paste' => $paste ? "y" : "n", 'media_mode' => $media_mode, 'javascript' => $sel_js_mode, 'paragraph_plugins' => $paragraph_plugin_string, 'disable_auto_margins' => $disable_auto_margins, 'page_toc' => $cfg->getEnablePageToc() ? "y" : "n", 'enable_profile' => $cfg->getEnablePCType("Profile") ? "y" : "n", 'enable_verification' => $cfg->getEnablePCType("Verification") ? "y" : "n", 'enable_blog' => $cfg->getEnablePCType("Blog") ? "y" : "n", 'enable_skills' => $cfg->getEnablePCType("Skills") ? "y" : "n", 'enable_qover' => $cfg->getEnablePCType("QuestionOverview") ? "y" : "n", 'enable_consultation_hours' => $cfg->getEnablePCType("ConsultationHours") ? "y" : "n", 'enable_my_courses' => $cfg->getEnablePCType("MyCourses") ? "y" : "n", 'enable_amd_page_list' => $cfg->getEnablePCType("AMDPageList") ? "y" : "n", 'flv_video_player' => $flv_video_player);
     if ($this->link_frame != "") {
         // todo other link types
         $params["pg_frame"] = $this->link_frame;
     }
     //$content = str_replace("&nbsp;", "", $content);
     // this ensures that cache is emptied with every update
     $params["version"] = ILIAS_VERSION;
     // ensure no cache hit, if included files/media objects have been changed
     $params["incl_elements_date"] = $this->obj->getLastUpdateOfIncludedElements();
     // run xslt
     $md5 = md5(serialize($params) . $link_xml . $template_xml);
     //$a = microtime();
     // check cache (same parameters, non-edit mode and rendered time
     // > last change
     if (($this->getOutputMode() == "preview" || $this->getOutputMode() == "presentation") && !$this->getCompareMode() && !$this->getAbstractOnly() && $md5 == $this->obj->getRenderMd5() && $this->obj->getLastChange() < $this->obj->getRenderedTime() && $this->obj->getRenderedTime() != "" && $this->obj->old_nr == 0) {
         // cache hit
         $output = $this->obj->getRenderedContent();
     } else {
         $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
         $args = array('/_xml' => $content, '/_xsl' => $xsl);
         $xh = xslt_create();
         //		echo "<b>XSLT</b>:".htmlentities($xsl).":<br>";
         //		echo "mode:".$this->getOutputMode().":<br>";
         $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
         if (($this->getOutputMode() == "presentation" || $this->getOutputMode() == "preview") && !$this->getAbstractOnly() && $this->obj->old_nr == 0) {
             //echo "writerenderedcontent";
             $this->obj->writeRenderedContent($output, $md5);
         }
         //echo xslt_error($xh);
         xslt_free($xh);
     }
     //$b = microtime();
     //echo "$a - $b";
     //echo "<pre>".htmlentities($output)."</pre>";
     // unmask user html
     if (($this->getOutputMode() != "edit" || $ilUser->getPref("ilPageEditor_HTMLMode") != "disable") && !$this->getPageConfig()->getPreventHTMLUnmasking()) {
         $output = str_replace("&lt;", "<", $output);
         $output = str_replace("&gt;", ">", $output);
     }
     $output = str_replace("&amp;", "&", $output);
     $output = ilUtil::insertLatexImages($output);
     // insert page snippets
     $output = $this->insertContentIncludes($output);
     // insert resource blocks
     $output = $this->insertResources($output);
     // insert page toc
     if ($this->getPageConfig()->getEnablePageToc()) {
         $output = $this->insertPageToc($output);
     }
     // insert advanced output trigger
     $output = $this->insertAdvTrigger($output);
     // workaround for preventing template engine
     // from hiding paragraph text that is enclosed
     // in curly brackets (e.g. "{a}", see ilLMEditorGUI::executeCommand())
     $output = $this->replaceCurlyBrackets($output);
     // remove all newlines (important for code / pre output)
     $output = str_replace("\n", "", $output);
     //echo htmlentities($output);
     $output = $this->postOutputProcessing($output);
     //echo htmlentities($output);
     if ($this->getOutputMode() == "edit" && !$this->getPageObject()->getActive($this->getPageConfig()->getEnableScheduledActivation())) {
         $output = '<div class="il_editarea_disabled">' . $output . '</div>';
     }
     // for all page components...
     include_once "./Services/COPage/classes/class.ilCOPagePCDef.php";
     $defs = ilCOPagePCDef::getPCDefinitions();
     foreach ($defs as $def) {
         ilCOPagePCDef::requirePCClassByName($def["name"]);
         $pc_class = $def["pc_class"];
         $pc_obj = new $pc_class($this->getPageObject());
         // post xsl page content modification by pc elements
         $output = $pc_obj->modifyPageContentPostXsl($output, $this->getOutputMode());
         // javascript files
         $js_files = $pc_obj->getJavascriptFiles($this->getOutputMode());
         foreach ($js_files as $js) {
             $GLOBALS["tpl"]->addJavascript($js);
         }
         // css files
         $css_files = $pc_obj->getCssFiles($this->getOutputMode());
         foreach ($css_files as $css) {
             $GLOBALS["tpl"]->addCss($css);
         }
         // onload code
         $onload_code = $pc_obj->getOnloadCode($this->getOutputMode());
         foreach ($onload_code as $code) {
             $GLOBALS["tpl"]->addOnloadCode($code);
         }
     }
     //		$output = $this->selfAssessmentRendering($output);
     // output
     if ($ilCtrl->isAsynch() && !$this->getRawPageContent() && $this->getOutputMode() == "edit") {
         // e.g. ###3:110dad8bad6df8620071a0a693a2d328###
         if ($_GET["updated_pc_id_str"] != "") {
             echo $_GET["updated_pc_id_str"];
         }
         $tpl->setVariable($this->getTemplateOutputVar(), $output);
         $tpl->setCurrentBlock("edit_page");
         $tpl->parseCurrentBlock();
         echo $tpl->get("edit_page");
         exit;
     }
     if ($this->outputToTemplate()) {
         $tpl->setVariable($this->getTemplateOutputVar(), $output);
         $this->tpl->setVariable($this->getTemplateTargetVar(), $tpl->get());
         return $output;
     } else {
         if ($this->getRawPageContent()) {
             return $output;
         } else {
             $tpl->setVariable($this->getTemplateOutputVar(), $output);
             return $tpl->get();
         }
     }
 }
 function __showUserDefinedFields()
 {
     global $ilUser;
     $user_defined_data = $ilUser->getUserDefinedData();
     foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
         if ($definition['field_type'] == UDF_TYPE_TEXT) {
             $this->tpl->setCurrentBlock("field_text");
             $this->tpl->setVariable("FIELD_VALUE", ilUtil::prepareFormOutput($user_defined_data[$field_id]));
             if (!$definition['changeable']) {
                 $this->tpl->setVariable("DISABLED_FIELD", 'disabled=\\"disabled\\"');
                 $this->tpl->setVariable("FIELD_NAME", 'udf[' . $definition['field_id'] . ']');
             } else {
                 $this->tpl->setVariable("FIELD_NAME", 'udf[' . $definition['field_id'] . ']');
             }
             $this->tpl->parseCurrentBlock();
         } else {
             if ($definition['changeable']) {
                 $name = 'udf[' . $definition['field_id'] . ']';
                 $disabled = false;
             } else {
                 $name = '';
                 $disabled = true;
             }
             $this->tpl->setCurrentBlock("field_select");
             $this->tpl->setVariable("SELECT_BOX", ilUtil::formSelect($user_defined_data[$field_id], $name, $this->user_defined_fields->fieldValuesToSelectArray($definition['field_values']), false, true, 0, '', '', $disabled));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("user_defined");
         if ($definition['required']) {
             $name = $definition['field_name'] . "<span class=\"asterisk\">*</span>";
         } else {
             $name = $definition['field_name'];
         }
         $this->tpl->setVariable("TXT_FIELD_NAME", $name);
         $this->tpl->parseCurrentBlock();
     }
     return true;
 }
 /**
  * Fill row
  *
  * @access public
  * @param array row data
  * 
  */
 public function fillRow($a_set)
 {
     global $ilCtrl;
     $this->tpl->setVariable('S_ID', $this->getServer()->getServerId());
     $this->tpl->setVariable('M_ID', $a_set['mid']);
     $this->tpl->setVariable('VAL_ID', $this->getServer()->getServerId() . '_' . $a_set['mid']);
     $this->tpl->setVariable('VAL_ORG', (string) $a_set['org']);
     $this->tpl->setVariable('VAL_CHECKED', $a_set['checked'] ? 'checked="checked"' : '');
     $this->tpl->setVariable('VAL_TITLE', $a_set['participants']);
     $this->tpl->setVariable('VAL_DESC', $a_set['description']);
     $this->tpl->setVariable('VAL_EMAIL', $a_set['email']);
     $this->tpl->setVariable('VAL_DNS', $a_set['dns']);
     $this->tpl->setVariable('VAL_ABR', $a_set['abr']);
     $this->tpl->setVariable('TXT_EMAIL', $this->lng->txt('ecs_email'));
     $this->tpl->setVariable('TXT_DNS', $this->lng->txt('ecs_dns'));
     $this->tpl->setVariable('TXT_ABR', $this->lng->txt('ecs_abr'));
     $this->tpl->setVariable('TXT_ID', $this->lng->txt('ecs_unique_id'));
     $this->tpl->setVariable('TXT_ORG', $this->lng->txt('organization'));
     include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
     $part = new ilECSParticipantSetting($this->getServer()->getServerId(), $a_set['mid']);
     if ($part->isExportEnabled()) {
         foreach ($part->getExportTypes() as $obj_type) {
             $this->tpl->setCurrentBlock('obj_erow');
             $this->tpl->setVariable('TXT_OBJ_EINFO', $this->lng->txt('objs_' . $obj_type));
             $this->tpl->parseCurrentBlock();
         }
     } else {
         $this->lng->loadLanguageModule('administration');
         $this->tpl->setVariable('TXT_OBJ_EINFO', $this->lng->txt('disabled'));
     }
     if ($part->isImportEnabled()) {
         foreach ($part->getImportTypes() as $obj_type) {
             $this->tpl->setCurrentBlock('obj_irow');
             $this->tpl->setVariable('TXT_OBJ_IINFO', $this->lng->txt('objs_' . $obj_type));
             $this->tpl->parseCurrentBlock();
         }
     } else {
         $this->lng->loadLanguageModule('administration');
         $this->tpl->setVariable('TXT_OBJ_IINFO', $this->lng->txt('disabled'));
     }
     // :TODO: what types are to be supported?
     $sel = ilUtil::formSelect($part->getImportType(), 'import_type[' . $this->getServer()->getServerId() . '][' . $a_set['mid'] . ']', array(ilECSParticipantSetting::IMPORT_RCRS => $this->lng->txt('obj_rcrs'), ilECSParticipantSetting::IMPORT_CRS => $this->lng->txt('obj_crs'), ilECSParticipantSetting::IMPORT_CMS => $this->lng->txt('ecs_import_cms')), false, true);
     $this->tpl->setVariable('IMPORT_SEL', $sel);
     include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
     $list = new ilAdvancedSelectionListGUI();
     $list->setItemLinkClass('small');
     $list->setSelectionHeaderClass('small');
     $list->setId('actl_' . $a_set['server_id'] . '_' . $a_set['mid']);
     $list->setListTitle($this->lng->txt('actions'));
     $ilCtrl->setParameter($this->getParentObject(), 'server_id', $this->getServer()->getServerId());
     $ilCtrl->setParameter($this->getParentObject(), 'mid', $a_set['mid']);
     $list->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTargetByClass('ilecsparticipantsettingsgui', 'settings'));
     switch ($part->getImportType()) {
         case ilECSParticipantSetting::IMPORT_RCRS:
             // Do nothing
             break;
         case ilECSParticipantSetting::IMPORT_CRS:
             // Possible action => Edit course allocation
             $ilCtrl->setParameter($this->getParentObject(), 'server_id', $this->getServer()->getServerId());
             $ilCtrl->setParameter($this->getParentObject(), 'mid', $a_set['mid']);
             $list->addItem($this->lng->txt('ecs_crs_alloc_set'), '', $ilCtrl->getLinkTargetByClass('ilecsmappingsettingsgui', 'cStart'));
             break;
         case ilECSParticipantSetting::IMPORT_CMS:
             $ilCtrl->setParameter($this->getParentObject(), 'server_id', $this->getServer()->getServerId());
             $ilCtrl->setParameter($this->getParentObject(), 'mid', $a_set['mid']);
             // Possible action => Edit course allocation, edit node mapping
             $list->addItem($this->lng->txt('ecs_dir_alloc_set'), '', $ilCtrl->getLinkTargetByClass('ilecsmappingsettingsgui', 'dStart'));
             $list->addItem($this->lng->txt('ecs_crs_alloc_set'), '', $ilCtrl->getLinkTargetByClass('ilecsmappingsettingsgui', 'cStart'));
             break;
     }
     $this->tpl->setVariable('ACTIONS', $list->getHTML());
 }
 /**
  * Fill Action Row.
  */
 function fillActionRow()
 {
     global $lng;
     // action row
     $action_row = false;
     $arrow = false;
     // add selection buttons
     if (count($this->sel_buttons) > 0) {
         foreach ($this->sel_buttons as $button) {
             $this->tpl->setCurrentBlock("sel_button");
             $this->tpl->setVariable("SBUTTON_SELECT", ilUtil::formSelect($button["selected"], $button["sel_var"], $button["options"], false, true));
             $this->tpl->setVariable("SBTN_NAME", $button["cmd"]);
             $this->tpl->setVariable("SBTN_VALUE", $button["text"]);
             $this->tpl->parseCurrentBlock();
             if ($this->getTopCommands()) {
                 $this->tpl->setCurrentBlock("sel_top_button");
                 $this->tpl->setVariable("SBUTTON_SELECT", ilUtil::formSelect($button["selected"], $button["sel_var"], $button["options"], false, true));
                 $this->tpl->setVariable("SBTN_NAME", $button["cmd"]);
                 $this->tpl->setVariable("SBTN_VALUE", $button["text"]);
                 $this->tpl->parseCurrentBlock();
             }
         }
         $buttons = true;
         $action_row = true;
     }
     $this->sel_buttons[] = array("options" => $a_options, "cmd" => $a_cmd, "text" => $a_text);
     // add buttons
     if (count($this->buttons) > 0) {
         foreach ($this->buttons as $button) {
             if (strlen($button['onclick'])) {
                 $this->tpl->setCurrentBlock('cmdonclick');
                 $this->tpl->setVariable('CMD_ONCLICK', $button['onclick']);
                 $this->tpl->parseCurrentBlock();
             }
             $this->tpl->setCurrentBlock("plain_button");
             if ($button["id"] != "") {
                 $this->tpl->setVariable("PBID", ' id="' . $button["id"] . '" ');
             }
             $this->tpl->setVariable("PBTN_NAME", $button["cmd"]);
             $this->tpl->setVariable("PBTN_VALUE", $button["text"]);
             $this->tpl->parseCurrentBlock();
             if ($this->getTopCommands()) {
                 if (strlen($button['onclick'])) {
                     $this->tpl->setCurrentBlock('top_cmdonclick');
                     $this->tpl->setVariable('CMD_ONCLICK', $button['onclick']);
                     $this->tpl->parseCurrentBlock();
                 }
                 $this->tpl->setCurrentBlock("plain_top_button");
                 $this->tpl->setVariable("PBTN_NAME", $button["cmd"]);
                 $this->tpl->setVariable("PBTN_VALUE", $button["text"]);
                 $this->tpl->parseCurrentBlock();
             }
         }
         $buttons = true;
         $action_row = true;
     }
     // multi selection
     if (count($this->mi_sel_buttons)) {
         foreach ($this->mi_sel_buttons as $button) {
             $this->tpl->setCurrentBlock("mi_sel_button");
             $this->tpl->setVariable("MI_BUTTON_SELECT", ilUtil::formSelect($button["selected"], $button["sel_var"], $button["options"], false, true));
             $this->tpl->setVariable("MI_BTN_NAME", $button["cmd"]);
             $this->tpl->setVariable("MI_BTN_VALUE", $button["text"]);
             $this->tpl->parseCurrentBlock();
             if ($this->getTopCommands()) {
                 $this->tpl->setCurrentBlock("mi_top_sel_button");
                 $this->tpl->setVariable("MI_BUTTON_SELECT", ilUtil::formSelect($button["selected"], $button["sel_var"] . "_2", $button["options"], false, true));
                 $this->tpl->setVariable("MI_BTN_NAME", $button["cmd"]);
                 $this->tpl->setVariable("MI_BTN_VALUE", $button["text"]);
                 $this->tpl->parseCurrentBlock();
             }
         }
         $arrow = true;
         $action_row = true;
     }
     if (count($this->multi) > 1 && $this->dataExists()) {
         if ($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit()) {
             $this->tpl->setCurrentBlock("tbl_cmd_select_all");
             $this->tpl->setVariable("TXT_SELECT_CMD_ALL", $lng->txt("all_objects"));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("tbl_cmd_select");
         $sel = array();
         foreach ($this->multi as $mc) {
             $sel[$mc["cmd"]] = $mc["text"];
         }
         $this->tpl->setVariable("SELECT_CMDS", ilUtil::formSelect("", "selected_cmd", $sel, false, true));
         $this->tpl->setVariable("TXT_EXECUTE", $lng->txt("execute"));
         $this->tpl->parseCurrentBlock();
         $arrow = true;
         $action_row = true;
         if ($this->getTopCommands()) {
             if ($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit()) {
                 $this->tpl->setCurrentBlock("tbl_top_cmd_select_all");
                 $this->tpl->setVariable("TXT_SELECT_CMD_ALL", $lng->txt("all_objects"));
                 $this->tpl->parseCurrentBlock();
             }
             $this->tpl->setCurrentBlock("tbl_top_cmd_select");
             $sel = array();
             foreach ($this->multi as $mc) {
                 $sel[$mc["cmd"]] = $mc["text"];
             }
             $this->tpl->setVariable("SELECT_CMDS", ilUtil::formSelect("", "selected_cmd2", $sel, false, true));
             $this->tpl->setVariable("TXT_EXECUTE", $lng->txt("execute"));
             $this->tpl->parseCurrentBlock();
         }
     } elseif (count($this->multi) == 1 && $this->dataExists()) {
         $this->tpl->setCurrentBlock("tbl_single_cmd");
         $sel = array();
         foreach ($this->multi as $mc) {
             $cmd = $mc['cmd'];
             $txt = $mc['text'];
         }
         $this->tpl->setVariable("TXT_SINGLE_CMD", $txt);
         $this->tpl->setVariable("SINGLE_CMD", $cmd);
         $this->tpl->parseCurrentBlock();
         $arrow = true;
         $action_row = true;
         if ($this->getTopCommands()) {
             $this->tpl->setCurrentBlock("tbl_top_single_cmd");
             $sel = array();
             foreach ($this->multi as $mc) {
                 $cmd = $mc['cmd'];
                 $txt = $mc['text'];
             }
             $this->tpl->setVariable("TXT_SINGLE_CMD", $txt);
             $this->tpl->setVariable("SINGLE_CMD", $cmd);
             $this->tpl->parseCurrentBlock();
         }
     }
     if ($arrow) {
         $this->tpl->setCurrentBlock("tbl_action_img_arrow");
         $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.png"));
         $this->tpl->setVariable("ALT_ARROW", $lng->txt("action"));
         $this->tpl->parseCurrentBlock();
         if ($this->getTopCommands()) {
             $this->tpl->setCurrentBlock("tbl_top_action_img_arrow");
             $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_upright.png"));
             $this->tpl->setVariable("ALT_ARROW", $lng->txt("action"));
             $this->tpl->parseCurrentBlock();
         }
     }
     if ($action_row) {
         $this->tpl->setCurrentBlock("tbl_action_row");
         $this->tpl->parseCurrentBlock();
         if ($this->getTopCommands()) {
             $this->tpl->setCurrentBlock("tbl_top_action_row");
             $this->tpl->parseCurrentBlock();
         }
     }
 }
 /**
  *	build select form to distinguish between active and non-active users
  */
 function __buildUserFilterSelect()
 {
     $action[-1] = $this->lng->txt('all_users');
     $action[1] = $this->lng->txt('usr_active_only');
     $action[0] = $this->lng->txt('usr_inactive_only');
     $action[2] = $this->lng->txt('usr_limited_access_only');
     $action[3] = $this->lng->txt('usr_without_courses');
     $action[4] = $this->lng->txt('usr_filter_lastlogin');
     $action[5] = $this->lng->txt("usr_filter_coursemember");
     $action[6] = $this->lng->txt("usr_filter_groupmember");
     $action[7] = $this->lng->txt("usr_filter_role");
     return ilUtil::formSelect($_SESSION['user_filter'], "user_filter", $action, false, true);
 }
 /**
  * displays system check menu
  *
  * @access	public
  */
 function checkObject()
 {
     global $rbacsystem, $ilias, $objDefinition, $ilSetting;
     $this->setSystemCheckSubTabs("system_check_sub");
     if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     //echo "1";
     if ($_POST['count_limit'] !== null || $_POST['age_limit'] !== null || $_POST['type_limit'] !== null) {
         $ilias->account->writePref('systemcheck_count_limit', is_numeric($_POST['count_limit']) && $_POST['count_limit'] > 0 ? $_POST['count_limit'] : '');
         $ilias->account->writePref('systemcheck_age_limit', is_numeric($_POST['age_limit']) && $_POST['age_limit'] > 0 ? $_POST['age_limit'] : '');
         $ilias->account->writePref('systemcheck_type_limit', trim($_POST['type_limit']));
     }
     if ($_POST["mode"]) {
         //echo "3";
         $this->writeCheckParams();
         $this->startValidator($_POST["mode"], $_POST["log_scan"]);
     } else {
         //echo "4";
         include_once "./Services/Repository/classes/class.ilValidator.php";
         $validator = new ilValidator();
         $hasScanLog = $validator->hasScanLog();
         $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.adm_check.html", "Modules/SystemFolder");
         if ($hasScanLog) {
             $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_last_log"));
         }
         $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
         $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("systemcheck"));
         $this->tpl->setVariable("COLSPAN", 3);
         $this->tpl->setVariable("TXT_ANALYZE_TITLE", $this->lng->txt("analyze_data"));
         $this->tpl->setVariable("TXT_ANALYSIS_OPTIONS", $this->lng->txt("analysis_options"));
         $this->tpl->setVariable("TXT_REPAIR_OPTIONS", $this->lng->txt("repair_options"));
         $this->tpl->setVariable("TXT_OUTPUT_OPTIONS", $this->lng->txt("output_options"));
         $this->tpl->setVariable("TXT_SCAN", $this->lng->txt("scan"));
         $this->tpl->setVariable("TXT_SCAN_DESC", $this->lng->txt("scan_desc"));
         $this->tpl->setVariable("TXT_DUMP_TREE", $this->lng->txt("dump_tree"));
         $this->tpl->setVariable("TXT_DUMP_TREE_DESC", $this->lng->txt("dump_tree_desc"));
         $this->tpl->setVariable("TXT_CLEAN", $this->lng->txt("clean"));
         $this->tpl->setVariable("TXT_CLEAN_DESC", $this->lng->txt("clean_desc"));
         $this->tpl->setVariable("TXT_RESTORE", $this->lng->txt("restore_missing"));
         $this->tpl->setVariable("TXT_RESTORE_DESC", $this->lng->txt("restore_missing_desc"));
         $this->tpl->setVariable("TXT_PURGE", $this->lng->txt("purge_missing"));
         $this->tpl->setVariable("TXT_PURGE_DESC", $this->lng->txt("purge_missing_desc"));
         $this->tpl->setVariable("TXT_RESTORE_TRASH", $this->lng->txt("restore_trash"));
         $this->tpl->setVariable("TXT_RESTORE_TRASH_DESC", $this->lng->txt("restore_trash_desc"));
         $this->tpl->setVariable("TXT_PURGE_TRASH", $this->lng->txt("purge_trash"));
         $this->tpl->setVariable("TXT_PURGE_TRASH_DESC", $this->lng->txt("purge_trash_desc"));
         $this->tpl->setVariable("TXT_COUNT_LIMIT", $this->lng->txt("purge_count_limit"));
         $this->tpl->setVariable("TXT_COUNT_LIMIT_DESC", $this->lng->txt("purge_count_limit_desc"));
         $this->tpl->setVariable("COUNT_LIMIT_VALUE", $ilias->account->getPref("systemcheck_count_limit"));
         $this->tpl->setVariable("TXT_AGE_LIMIT", $this->lng->txt("purge_age_limit"));
         $this->tpl->setVariable("TXT_AGE_LIMIT_DESC", $this->lng->txt("purge_age_limit_desc"));
         $this->tpl->setVariable("AGE_LIMIT_VALUE", $ilias->account->getPref("systemcheck_age_limit"));
         $this->tpl->setVariable("TXT_TYPE_LIMIT", $this->lng->txt("purge_type_limit"));
         $this->tpl->setVariable("TXT_TYPE_LIMIT_DESC", $this->lng->txt("purge_type_limit_desc"));
         if ($ilias->account->getPref('systemcheck_mode_scan')) {
             $this->tpl->touchBlock('mode_scan_checked');
         }
         if ($ilias->account->getPref('systemcheck_mode_dump_tree')) {
             $this->tpl->touchBlock('mode_dump_tree_checked');
         }
         if ($ilias->account->getPref('systemcheck_mode_clean')) {
             $this->tpl->touchBlock('mode_clean_checked');
         }
         if ($ilias->account->getPref('systemcheck_mode_restore')) {
             $this->tpl->touchBlock('mode_restore_checked');
             $this->tpl->touchBlock('mode_purge_disabled');
         } elseif ($ilias->account->getPref('systemcheck_mode_purge')) {
             $this->tpl->touchBlock('mode_purge_checked');
             $this->tpl->touchBlock('mode_restore_disabled');
         }
         if ($ilias->account->getPref('systemcheck_mode_restore_trash')) {
             $this->tpl->touchBlock('mode_restore_trash_checked');
             $this->tpl->touchBlock('mode_purge_trash_disabled');
         } elseif ($ilias->account->getPref('systemcheck_mode_purge_trash')) {
             $this->tpl->touchBlock('mode_purge_trash_checked');
             $this->tpl->touchBlock('mode_restore_trash_disabled');
         }
         if ($ilias->account->getPref('systemcheck_log_scan')) {
             $this->tpl->touchBlock('log_scan_checked');
         }
         // #9520 - restrict to types which can be found in tree
         $obj_types_in_tree = array();
         global $ilDB;
         $set = $ilDB->query('SELECT type FROM object_data od' . ' JOIN object_reference ref ON (od.obj_id = ref.obj_id)' . ' JOIN tree ON (tree.child = ref.ref_id)' . ' WHERE tree.tree < 1' . ' GROUP BY type');
         while ($row = $ilDB->fetchAssoc($set)) {
             $obj_types_in_tree[] = $row['type'];
         }
         $types = $objDefinition->getAllObjects();
         $ts = array("" => "");
         foreach ($types as $t) {
             if ($t != "" && !$objDefinition->isSystemObject($t) && $t != "root" && in_array($t, $obj_types_in_tree)) {
                 if ($objDefinition->isPlugin($t)) {
                     $ts[$t] = ilPlugin::lookupTxt("rep_robj", $t, "obj_" . $t);
                 } else {
                     $ts[$t] = $this->lng->txt("obj_" . $t);
                 }
             }
         }
         asort($ts);
         $this->tpl->setVariable("TYPE_LIMIT_CHOICE", ilUtil::formSelect($ilias->account->getPref("systemcheck_type_limit"), 'type_limit', $ts, false, true));
         $this->tpl->setVariable("TXT_LOG_SCAN", $this->lng->txt("log_scan"));
         $this->tpl->setVariable("TXT_LOG_SCAN_DESC", $this->lng->txt("log_scan_desc"));
         $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("start_scan"));
         $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_params_for_cron"));
         include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
         $cron_form = new ilPropertyFormGUI();
         $cron_form->setFormAction($this->ctrl->getFormAction($this));
         $cron_form->setTitle($this->lng->txt('systemcheck_cronform'));
         $radio_group = new ilRadioGroupInputGUI($this->lng->txt('systemcheck_cron'), 'cronjob');
         $radio_group->setValue($ilSetting->get('systemcheck_cron'));
         $radio_opt = new ilRadioOption($this->lng->txt('disabled'), 0);
         $radio_group->addOption($radio_opt);
         $radio_opt = new ilRadioOption($this->lng->txt('enabled'), 1);
         $radio_group->addOption($radio_opt);
         $cron_form->addItem($radio_group);
         $cron_form->addCommandButton('saveCheckCron', $this->lng->txt('save'));
         $this->tpl->setVariable('CRON_FORM', $cron_form->getHTML());
     }
 }
Esempio n. 25
0
 function showLearningProgress($a_tpl)
 {
     global $ilUser, $rbacsystem;
     if (!$rbacsystem->checkAccess('read', $this->gui_object->object->getRefId())) {
         return false;
     }
     if ($ilUser->getId() == ANONYMOUS_USER_ID) {
         return false;
     }
     include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
     if (!ilObjUserTracking::_enabledLearningProgress() and $ilUser->getId() != ANONYMOUS_USER_ID) {
         return false;
     }
     include_once './Services/Object/classes/class.ilObjectLP.php';
     $olp = ilObjectLP::getInstance($this->gui_object->object->getId());
     if ($olp->getCurrentMode() != ilLPObjSettings::LP_MODE_MANUAL) {
         return false;
     }
     include_once 'Services/Tracking/classes/class.ilLPMarks.php';
     $this->lng->loadLanguageModule('trac');
     // section header
     //		$a_tpl->setCurrentBlock("header_row");
     $a_tpl->setVariable("TXT_SECTION", $this->lng->txt('learning_progress'));
     $a_tpl->parseCurrentBlock();
     // $a_tpl->touchBlock("row");
     // status
     $i_tpl = new ilTemplate("tpl.lp_edit_manual_info_page.html", true, true, "Services/Tracking");
     $i_tpl->setVariable("INFO_EDITED", $this->lng->txt("trac_info_edited"));
     $i_tpl->setVariable("SELECT_STATUS", ilUtil::formSelect((int) ilLPMarks::_hasCompleted($ilUser->getId(), $this->gui_object->object->getId()), 'lp_edit', array(0 => $this->lng->txt('trac_not_completed'), 1 => $this->lng->txt('trac_completed')), false, true));
     $i_tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
     $a_tpl->setCurrentBlock("pv");
     $a_tpl->setVariable("TXT_PROPERTY_VALUE", $i_tpl->get());
     $a_tpl->parseCurrentBlock();
     $a_tpl->setCurrentBlock("property_row");
     $a_tpl->setVariable("TXT_PROPERTY", $this->lng->txt('trac_status'));
     $a_tpl->parseCurrentBlock();
     // $a_tpl->touchBlock("row");
     // More infos for lm's
     if ($this->gui_object->object->getType() == 'lm' || $this->gui_object->object->getType() == 'htlm') {
         $a_tpl->setCurrentBlock("pv");
         include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
         $progress = ilLearningProgress::_getProgress($ilUser->getId(), $this->gui_object->object->getId());
         if ($progress['access_time']) {
             $a_tpl->setVariable("TXT_PROPERTY_VALUE", ilDatePresentation::formatDate(new ilDateTime($progress['access_time'], IL_CAL_DATETIME)));
         } else {
             $a_tpl->setVariable("TXT_PROPERTY_VALUE", $this->lng->txt('trac_not_accessed'));
         }
         $a_tpl->parseCurrentBlock();
         $a_tpl->setCurrentBlock("property_row");
         $a_tpl->setVariable("TXT_PROPERTY", $this->lng->txt('trac_last_access'));
         $a_tpl->parseCurrentBlock();
         // $a_tpl->touchBlock("row");
         // tags of all users
         $a_tpl->setCurrentBlock("pv");
         $a_tpl->setVariable("TXT_PROPERTY_VALUE", (int) $progress['visits']);
         $a_tpl->parseCurrentBlock();
         $a_tpl->setCurrentBlock("property_row");
         $a_tpl->setVariable("TXT_PROPERTY", $this->lng->txt('trac_visits'));
         $a_tpl->parseCurrentBlock();
         // $a_tpl->touchBlock("row");
         if ($this->gui_object->object->getType() == 'lm') {
             // tags of all users
             $a_tpl->setCurrentBlock("pv");
             $a_tpl->setVariable("TXT_PROPERTY_VALUE", ilFormat::_secondsToString($progress['spent_seconds']));
             $a_tpl->parseCurrentBlock();
             $a_tpl->setCurrentBlock("property_row");
             $a_tpl->setVariable("TXT_PROPERTY", $this->lng->txt('trac_spent_time'));
             $a_tpl->parseCurrentBlock();
             // $a_tpl->touchBlock("row");
         }
     }
     // #10493
     $a_tpl->touchBlock("row");
 }
 /**
  * @see ilTable2GUI::fillRow()
  */
 protected function fillRow($a_set)
 {
     global $ilCtrl, $lng;
     if (!stristr($a_set['target'], '|')) {
         $this->tpl->setCurrentBlock('external');
         $this->tpl->setVariable('VAL_ID', $a_set['id']);
         $this->tpl->setVariable('VAL_TARGET', $a_set['target']);
         $this->tpl->parseCurrentBlock();
     } else {
         $ilCtrl->setParameterByClass('ilinternallinkgui', 'postvar', 'tar_' . $a_set['id']);
         $trigger_link = array(get_class($this->parent_obj), 'ilinternallinkgui');
         $trigger_link = $ilCtrl->getLinkTargetByClass($trigger_link, '', false, true, false);
         $ilCtrl->setParameterByClass('ilinternallinkgui', 'postvar', '');
         $this->tpl->setCurrentBlock('internal');
         $this->tpl->setVariable('VAL_ID', $a_set['id']);
         $this->tpl->setVariable('VAL_TRIGGER_INTERNAL', $trigger_link);
         $this->tpl->setVariable('TXT_TRIGGER_INTERNAL', $this->lng->txt('edit'));
         // info about current link
         if ($a_set['target']) {
             $parts = explode('|', $a_set['target']);
             $this->tpl->setVariable('VAL_INTERNAL_TYPE', $parts[0]);
             $this->tpl->setVariable('VAL_INTERNAL_ID', $parts[1]);
             $parts = ilLinkInputGUI::getTranslatedValue($a_set['target']);
             $this->tpl->setVariable('TXT_TRIGGER_INFO', $parts['type'] . ' "' . $parts['name'] . '"');
         }
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable('TXT_LAST_CHECK', $this->lng->txt('webr_last_check_table'));
     $this->tpl->setVariable('LAST_CHECK', $a_set['last_check'] ? ilDatePresentation::formatDate(new ilDateTime($a_set['last_check'], IL_CAL_UNIX)) : $this->lng->txt('no_date'));
     // Valid
     $this->tpl->setVariable('VAL_VALID', ilUtil::formCheckbox($a_set['valid'], 'links[' . $a_set['id'] . '][vali]', 1));
     // Active
     $this->tpl->setVariable('VAL_ACTIVE', ilUtil::formCheckbox($a_set['active'], 'links[' . $a_set['id'] . '][act]', 1));
     // Valid
     $this->tpl->setVariable('VAL_CHECK', ilUtil::formCheckbox($a_set['disable_check'], 'links[' . $a_set['id'] . '][che]', 1));
     // Dynamic parameters
     foreach ($a_set['params'] as $param_id => $param) {
         $this->tpl->setCurrentBlock('dyn_del_row');
         $this->tpl->setVariable('TXT_DYN_DEL', $this->lng->txt('delete'));
         $ilCtrl->setParameterByClass(get_class($this->getParentObject()), 'param_id', $param_id);
         $this->tpl->setVariable('DYN_DEL_LINK', $ilCtrl->getLinkTarget($this->getParentObject(), 'deleteParameter'));
         $this->tpl->setVariable('VAL_DYN', ilParameterAppender::parameterToInfo($param['name'], $param['value']));
         $this->tpl->parseCurrentBlock();
     }
     if ($a_set['params']) {
         $this->tpl->setCurrentBlock('dyn_del_rows');
         $this->tpl->setVariable('TXT_EXISTING', $this->lng->txt('links_existing_params'));
         $this->tpl->parseCurrentBlock();
     }
     if (ilParameterAppender::_isEnabled()) {
         $this->tpl->setCurrentBlock('dyn_add');
         $this->tpl->setVariable('TXT_DYN_ADD', $this->lng->txt('links_add_param'));
         $this->tpl->setVariable('TXT_DYN_NAME', $this->lng->txt('links_name'));
         $this->tpl->setVariable('TXT_DYN_VALUE', $this->lng->txt('links_value'));
         $this->tpl->setVariable('VAL_DYN_NAME', $a_set['name']);
         $this->tpl->setVariable('DYN_ID', $a_set['id']);
         $this->tpl->setVariable('SEL_DYN_VAL', ilUtil::formSelect($a_set['value'] ? $a_set['value'] : 0, 'links[' . $a_set['id'] . '][val]', ilParameterAppender::_getOptionSelect(), false, true));
         $this->tpl->parseCurrentBlock();
     }
     if (in_array($a_set['id'], $this->getInvalidLinks())) {
         $this->tpl->setVariable('CSS_ROW', 'warn');
     }
     // Check
     $this->tpl->setVariable('VAL_ID', $a_set['id']);
     $this->tpl->setVariable('VAL_CHECKBOX', ilUtil::formCheckbox(false, 'link_ids[]', $a_set['id']));
     // Column title
     $this->tpl->setVariable('TXT_TITLE', $this->lng->txt('title'));
     $this->tpl->setVariable('VAL_TITLE', ilUtil::prepareFormOutput($a_set['title']));
     $this->tpl->setVariable('TXT_DESC', $this->lng->txt('description'));
     $this->tpl->setVariable('VAL_DESC', ilUtil::prepareFormOutput($a_set['description']));
     // Column Target
     $this->tpl->setVariable('TXT_TARGET', $this->lng->txt('target'));
 }
Esempio n. 27
0
 /**
  * show possible subobjects (pulldown menu)
  *
  * @access	public
  */
 protected function showPossibleSubObjects()
 {
     if ($this->sub_objects == "") {
         $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
     } else {
         $d = $this->sub_objects;
     }
     $import = false;
     if (count($d) > 0) {
         foreach ($d as $row) {
             $count = 0;
             if ($row["max"] > 0) {
                 //how many elements are present?
                 for ($i = 0; $i < count($this->data["ctrl"]); $i++) {
                     if ($this->data["ctrl"][$i]["type"] == $row["name"]) {
                         $count++;
                     }
                 }
             }
             if ($row["max"] == "" || $count < $row["max"]) {
                 $subobj[] = $row["name"];
             }
         }
     }
     if (is_array($subobj)) {
         //build form
         $opts = ilUtil::formSelect(12, "new_type", $subobj);
         $this->tpl->setCurrentBlock("add_object");
         $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
         $this->tpl->setVariable("BTN_NAME", "create");
         $this->tpl->setVariable("TXT_ADD", $this->lng->txt("add"));
         $this->tpl->parseCurrentBlock();
     }
 }
 function subchap()
 {
     global $tree, $ilCtrl, $lng, $ilUser;
     $this->setTabs();
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.structure_edit.html", "Modules/LearningModule");
     $num = 0;
     $this->tpl->setCurrentBlock("form");
     $this->ctrl->setParameter($this, "backcmd", "subchap");
     $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $this->tpl->setVariable("HEADER_TEXT", $this->lng->txt("cont_subchapters"));
     $this->tpl->setVariable("CHECKBOX_TOP", IL_FIRST_NODE);
     $cnt = 0;
     $childs = $this->tree->getChilds($this->obj->getId());
     foreach ($childs as $child) {
         if ($child["type"] != "st") {
             continue;
         }
         $this->tpl->setCurrentBlock("table_row");
         // color changing
         $css_row = ilUtil::switchColor($cnt++, "tblrow1", "tblrow2");
         // checkbox
         $this->tpl->setVariable("CHECKBOX_ID", $child["obj_id"]);
         $this->tpl->setVariable("CSS_ROW", $css_row);
         $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_st.png"));
         // type
         $this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $child["obj_id"]);
         $link = $this->ctrl->getLinkTargetByClass("ilStructureObjectGUI", "view");
         $this->tpl->setVariable("LINK_TARGET", $link);
         // title
         $this->tpl->setVariable("TEXT_CONTENT", ilStructureObject::_getPresentationTitle($child["obj_id"], $this->content_object->isActiveNumbering()));
         $this->tpl->parseCurrentBlock();
     }
     if ($cnt == 0) {
         $this->tpl->setCurrentBlock("notfound");
         $this->tpl->setVariable("NUM_COLS", 3);
         $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
         $this->tpl->parseCurrentBlock();
     }
     //else
     //{
     // SHOW VALID ACTIONS
     $this->tpl->setVariable("NUM_COLS", 3);
     $acts = array("delete" => "delete", "cutChapter" => "cut", "copyChapter" => "copyChapter");
     if ($ilUser->clipboardHasObjectsOfType("st")) {
         $acts["pasteChapter"] = "pasteChapter";
     }
     $this->showActions($acts);
     //}
     // SHOW POSSIBLE SUB OBJECTS
     $this->tpl->setVariable("NUM_COLS", 3);
     //$this->showPossibleSubObjects("st");
     $subobj = array("st");
     $opts = ilUtil::formSelect(12, "new_type", $subobj);
     //$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.png"));
     $this->tpl->setCurrentBlock("add_object");
     $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
     //$this->tpl->setVariable("FORMACTION_OBJ_ADD", "adm_object.php?cmd=create&ref_id=".$_GET["ref_id"]);
     $this->tpl->setVariable("BTN_NAME", "create");
     $this->tpl->setVariable("TXT_ADD", $this->lng->txt("insert"));
     $this->tpl->parseCurrentBlock();
     //$this->tpl->setVariable("NUM_COLS", 2);
     //$this->showPossibleSubObjects("st");
     $this->tpl->setCurrentBlock("form");
     $this->tpl->parseCurrentBlock();
     $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
 }
Esempio n. 29
0
 function __getDateSelect($a_type, $a_selected)
 {
     switch ($a_type) {
         case "hour":
             for ($i = 0; $i < 24; $i++) {
                 $hours[$i] = $i < 10 ? "0" . $i : $i;
             }
             return ilUtil::formSelect($a_selected, "d_hour", $hours, false, true);
         case "minutes":
             for ($i = 0; $i < 60; $i++) {
                 $minutes[$i] = $i < 10 ? "0" . $i : $i;
             }
             return ilUtil::formSelect($a_selected, "d_minutes", $minutes, false, true);
         case "day":
             for ($i = 1; $i < 32; $i++) {
                 $days[$i] = $i < 10 ? "0" . $i : $i;
             }
             return ilUtil::formSelect($a_selected, "d_day", $days, false, true);
         case "month":
             for ($i = 1; $i < 13; $i++) {
                 $month[$i] = $i < 10 ? "0" . $i : $i;
             }
             return ilUtil::formSelect($a_selected, "d_month", $month, false, true);
         case "year":
             for ($i = date("Y", time()); $i < date("Y", time()) + 3; ++$i) {
                 $year[$i] = $i;
             }
             return ilUtil::formSelect($a_selected, "d_year", $year, false, true);
     }
 }
 private function prepareMappingSelect()
 {
     return ilUtil::formSelect($_POST['mapping_template'], 'mapping_template', array(0 => $this->lng->txt('ldap_mapping_template'), "inetOrgPerson" => 'inetOrgPerson', "organizationalPerson" => 'organizationalPerson', "person" => 'person', "ad_2003" => 'Active Directory (Win 2003)'), false, true);
 }