/**
  * Get user items
  */
 function getItems()
 {
     global $lng, $rbacreview, $ilObjDataCache;
     $this->determineOffsetAndOrder();
     include_once "./Services/User/classes/class.ilAccountCode.php";
     $codes_data = ilAccountCode::getCodesData(ilUtil::stripSlashes($this->getOrderField()), ilUtil::stripSlashes($this->getOrderDirection()), ilUtil::stripSlashes($this->getOffset()), ilUtil::stripSlashes($this->getLimit()), $this->filter["code"], $this->filter["valid_until"], $this->filter["generated"]);
     if (count($codes_data["set"]) == 0 && $this->getOffset() > 0) {
         $this->resetOffset();
         $codes_data = ilAccountCode::getCodesData(ilUtil::stripSlashes($this->getOrderField()), ilUtil::stripSlashes($this->getOrderDirection()), ilUtil::stripSlashes($this->getOffset()), ilUtil::stripSlashes($this->getLimit()), $this->filter["code"], $this->filter["valid_until"], $this->filter["generated"]);
     }
     $result = array();
     foreach ($codes_data["set"] as $k => $code) {
         $result[$k]["generated"] = ilDatePresentation::formatDate(new ilDateTime($code["generated"], IL_CAL_UNIX));
         if ($code["used"]) {
             $result[$k]["used"] = ilDatePresentation::formatDate(new ilDateTime($code["used"], IL_CAL_UNIX));
         } else {
             $result[$k]["used"] = "";
         }
         if ($code["valid_until"] === "0") {
             $valid = $lng->txt("user_account_code_valid_until_unlimited");
         } else {
             if (is_numeric($code["valid_until"])) {
                 $valid = $code["valid_until"] . " " . ($code["valid_until"] == 1 ? $lng->txt("day") : $lng->txt("days"));
             } else {
                 $valid = ilDatePresentation::formatDate(new ilDate($code["valid_until"], IL_CAL_DATE));
             }
         }
         $result[$k]["valid_until"] = $valid;
         $result[$k]["code"] = $code["code"];
         $result[$k]["code_id"] = $code["code_id"];
     }
     $this->setMaxCount($codes_data["cnt"]);
     $this->setData($result);
 }
 private function saveSkillThresholdsCmd()
 {
     require_once 'Modules/Test/classes/class.ilTestSkillLevelThreshold.php';
     if (is_array($_POST['threshold'])) {
         $threshold = $_POST['threshold'];
         $assignmentList = $this->buildSkillQuestionAssignmentList();
         $assignmentList->loadFromDb();
         foreach ($assignmentList->getUniqueAssignedSkills() as $data) {
             $skill = $data['skill'];
             $skillKey = $data['skill_base_id'] . ':' . $data['skill_tref_id'];
             $levels = $skill->getLevelData();
             foreach ($levels as $level) {
                 if (isset($threshold[$skillKey]) && isset($threshold[$skillKey][$level['id']])) {
                     $skillLevelThreshold = new ilTestSkillLevelThreshold($this->db);
                     $skillLevelThreshold->setTestId($this->testOBJ->getTestId());
                     $skillLevelThreshold->setSkillBaseId($data['skill_base_id']);
                     $skillLevelThreshold->setSkillTrefId($data['skill_tref_id']);
                     $skillLevelThreshold->setSkillLevelId($level['id']);
                     $skillLevelThreshold->setThreshold($threshold[$skillKey][$level['id']]);
                     $skillLevelThreshold->saveToDb();
                 }
             }
         }
     }
     ilUtil::sendSuccess($this->lng->txt('tst_msg_skl_lvl_thresholds_saved'), true);
     $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_THRESHOLDS);
 }
Пример #3
0
 /**
  * Build export file
  *
  * @param
  * @return
  */
 function buildExportFile()
 {
     global $ilias;
     // create export file
     include_once "./Services/Export/classes/class.ilExport.php";
     ilExport::_createExportDirectory($this->wiki->getId(), "html", "wiki");
     $exp_dir = ilExport::_getExportDirectory($this->wiki->getId(), "html", "wiki");
     $this->subdir = $this->wiki->getType() . "_" . $this->wiki->getId();
     $this->export_dir = $exp_dir . "/" . $this->subdir;
     // initialize temporary target directory
     ilUtil::delDir($this->export_dir);
     ilUtil::makeDir($this->export_dir);
     // system style html exporter
     include_once "./Services/Style/classes/class.ilSystemStyleHTMLExport.php";
     $this->sys_style_html_export = new ilSystemStyleHTMLExport($this->export_dir);
     $this->sys_style_html_export->addImage("icon_wiki.svg");
     $this->sys_style_html_export->export();
     // init co page html exporter
     include_once "./Services/COPage/classes/class.ilCOPageHTMLExport.php";
     $this->co_page_html_export = new ilCOPageHTMLExport($this->export_dir);
     $this->co_page_html_export->setContentStyleId($this->wiki->getStyleSheetId());
     $this->co_page_html_export->createDirectories();
     $this->co_page_html_export->exportStyles();
     $this->co_page_html_export->exportSupportScripts();
     // export pages
     $this->exportHTMLPages();
     // zip everything
     if (true) {
         // zip it all
         $date = time();
         $zip_file = ilExport::_getExportDirectory($this->wiki->getId(), "html", "wiki") . "/" . $date . "__" . IL_INST_ID . "__" . $this->wiki->getType() . "_" . $this->wiki->getId() . ".zip";
         ilUtil::zip($this->export_dir, $zip_file);
         ilUtil::delDir($this->export_dir);
     }
 }
Пример #4
0
 /**
  * test rbac_ua 
  */
 public function testRbacUA()
 {
     global $rbacreview, $rbacadmin;
     $obj = ilUtil::_getObjectsByOperations('crs', 'join');
     $rbacreview->assignedUsers(4);
     $rbacreview->assignedRoles(6);
 }
 public function doCreate()
 {
     global $ilLog;
     $message = "Standard fields cannot be written to DB";
     ilUtil::sendFailure($message);
     $ilLog->write("[ilDataCollectionStandardField] " . $message);
 }
 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilUser;
     include_once "./Services/Skill/classes/class.ilPersonalSkill.php";
     $mat = ilPersonalSkill::getAssignedMaterial($ilUser->getId(), $this->tref_id, $a_set["id"]);
     $ilCtrl->setParameter($this->parent_obj, "level_id", $a_set["id"]);
     foreach ($mat as $m) {
         $this->tpl->setCurrentBlock("mat");
         $obj_id = $this->ws_tree->lookupObjectId($m["wsp_id"]);
         $this->tpl->setVariable("MAT_TITLE", ilObject::_lookupTitle($obj_id));
         $this->tpl->setVariable("MAT_IMG", ilUtil::img(ilUtil::getImagePath("icon_" . ilObject::_lookupType($obj_id) . ".svg")));
         $this->tpl->setVariable("TXT_REMOVE", $lng->txt("remove"));
         $ilCtrl->setParameter($this->parent_obj, "wsp_id", $m["wsp_id"]);
         $this->tpl->setVariable("HREF_REMOVE", $ilCtrl->getLinkTarget($this->parent_obj, "removeMaterial"));
         $obj_id = $this->ws_tree->lookupObjectId($m["wsp_id"]);
         $url = $this->ws_access->getGotoLink($m["wsp_id"], $obj_id);
         $this->tpl->setVariable("HREF_MAT", $url);
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setCurrentBlock("cmd");
     $this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj, "assignMaterial"));
     $this->tpl->setVariable("TXT_CMD", $lng->txt("skmg_assign_materials"));
     $this->tpl->parseCurrentBlock();
     $ilCtrl->setParameter($this->parent_obj, "level_id", "");
     $this->tpl->setVariable("LEVEL_ID", $a_set["id"]);
     $this->tpl->setVariable("SKILL_ID", $this->basic_skill_id);
     $this->tpl->setVariable("TXT_SKILL", $a_set["title"]);
     $this->tpl->setVariable("TXT_SKILL_DESC", $a_set["description"]);
 }
 /**
  * fill row 
  *
  * @access public
  * @param
  * @return
  */
 public function fillRow($data)
 {
     if (strlen($data['description'])) {
         $this->tpl->setCurrentBlock('description');
         $this->tpl->setVariable("DESCRIPTION", ilUtil::prepareFormOutput($data['description']));
         $this->tpl->parseCurrentBlock();
     }
     if ($this->show_marker) {
         if ($data['marked']) {
             $this->tpl->setCurrentBlock('marked_img');
             $this->tpl->setVariable("ALT_MARKED", $this->lng->txt("tst_question_marked"));
             $this->tpl->setVariable("HREF_MARKED", ilUtil::getImagePath("marked.png"));
             $this->tpl->parseCurrentBlock();
         } else {
             $this->tpl->touchBlock('marker');
         }
     }
     // obligatory icon
     if ($data["obligatory"]) {
         $OBLIGATORY = "<img src=\"" . ilUtil::getImagePath("obligatory.gif", "Modules/Test") . "\" alt=\"" . $this->lng->txt("question_obligatory") . "\" title=\"" . $this->lng->txt("question_obligatory") . "\" />";
     } else {
         $OBLIGATORY = '';
     }
     $this->tpl->setVariable("QUESTION_OBLIGATORY", $OBLIGATORY);
     $this->tpl->setVariable("ORDER", $data['order']);
     $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($data['title']));
     $this->tpl->setVariable("HREF", $data['href']);
     $this->tpl->setVariable("POSTPONED", $data['postponed']);
 }
 function setTabs()
 {
     global $tpl, $lng;
     parent::setTabs();
     $tpl->setTitleIcon(ilUtil::getImagePath("icon_seqc_b.png"));
     $tpl->setTitle($lng->txt("sahs_chapter") . ": " . $this->node_object->getTitle());
 }
 protected function setTitleAndDescription()
 {
     global $tpl, $lng;
     $tpl->setTitle($lng->txt("wsp_personal_workspace"));
     $tpl->setTitleIcon(ilUtil::getImagePath("icon_wsrt_b.png"), $title);
     $tpl->setDescription($lng->txt("wsp_personal_workspace_description"));
 }
 /**
  * Handle target parameter
  * @param object $a_target
  * @return 
  */
 public static function handleCode($a_ref_id, $a_type, $a_code)
 {
     global $lng, $tree, $ilUser;
     include_once './Services/Link/classes/class.ilLink.php';
     $lng->loadLanguageModule($a_type);
     try {
         self::useCode($a_code, $a_ref_id);
         $title = ilObject::_lookupTitle(ilObject::_lookupObjectId($a_ref_id));
         ilUtil::sendSuccess(sprintf($lng->txt($a_type . "_admission_link_success_registration"), $title), true);
         ilUtil::redirect(ilLink::_getLink($a_ref_id));
     } catch (ilMembershipRegistrationException $e) {
         switch ($e->getCode()) {
             case 124:
                 //added to waiting list
                 ilUtil::sendSuccess($e->getMessage(), true);
                 break;
             case 123:
                 //object is full
                 ilUtil::sendFailure($lng->txt($a_type . "_admission_link_failure_membership_limited"), true);
                 break;
             case 789:
                 //out of registration period
                 ilUtil::sendFailure($lng->txt($a_type . "_admission_link_failure_registration_period"), true);
                 break;
             default:
                 ilUtil::sendFailure($e->getMessage(), true);
                 break;
         }
         $GLOBALS['ilLog']->logStack();
         $GLOBALS['ilLog']->write($e->getCode() . ': ' . $e->getMessage());
         $parent_id = $tree->getParentId($a_ref_id);
         ilUtil::redirect(ilLink::_getLink($parent_id));
     }
 }
Пример #11
0
 /**
  * output tabs
  */
 function setTabs()
 {
     global $ilTabs, $ilCtrl, $tpl, $lng;
     // subelements
     $ilTabs->addTarget("sahs_organization", $ilCtrl->getLinkTarget($this, 'showOrganization'), "showOrganization", get_class($this));
     // questions
     $ilTabs->addTarget("sahs_questions", $ilCtrl->getLinkTarget($this, 'sahs_questions'), "sahs_questions", get_class($this));
     // resources
     $ilTabs->addTarget("cont_files", $ilCtrl->getLinkTarget($this, 'sco_resources'), "sco_resources", get_class($this));
     // metadata
     $ilTabs->addTarget("meta_data", $ilCtrl->getLinkTargetByClass("ilmdeditorgui", ''), "", "ilmdeditorgui");
     // export
     /*
     		$ilTabs->addTarget("export",
     		$ilCtrl->getLinkTarget($this, "showExportList"), "showExportList",
     		get_class($this));
     
     		// import
     		$ilTabs->addTarget("import",
     		$ilCtrl->getLinkTarget($this, "import"), "import",
     		get_class($this));
     */
     // preview
     $ilTabs->addNonTabbedLink("preview", $lng->txt("cont_preview"), $ilCtrl->getLinkTarget($this, 'sco_preview'), "_blank");
     $tpl->setTitleIcon(ilUtil::getImagePath("icon_ass.svg"));
     $tpl->setTitle($lng->txt("obj_ass") . ": " . $this->node_object->getTitle());
 }
 /**
  *	Fill a table row.
  *
  *	This method is called internally by ilias to
  *	fill a table row according to the row template.
  *
  *	@param stdClass $item
  */
 protected function fillRow(stdClass $item)
 {
     /* Configure template rendering. */
     $this->tpl->setVariable('VAL_CHECKBOX', ilUtil::formCheckbox(false, 'test_ids[]', $item->ref_id));
     $this->tpl->setVariable('OBJECT_TITLE', $item->title);
     $this->tpl->setVariable('OBJECT_INFO', $this->getTestPath($item));
 }
 /**
  * Renders the specified object into images.
  * The images do not need to be of the preview image size.
  * 
  * @param ilObjFile $obj The object to create images from.
  * @return array An array of ilRenderedImage containing the absolute file paths to the images.
  */
 protected function renderImages($obj)
 {
     $numOfPreviews = $this->getMaximumNumberOfPreviews();
     // get file path
     $filepath = $obj->getFile();
     $inputFile = $this->prepareFileForExec($filepath);
     // create a temporary file name and remove its extension
     $output = str_replace(".tmp", "", ilUtil::ilTempnam());
     // use '#' instead of '%' as it gets replaced by 'escapeShellArg' on windows!
     $outputFile = $output . "_#02d.png";
     // create images with ghostscript (we use PNG here as it has better transparency quality)
     // gswin32c -dBATCH -dNOPAUSE -dSAFER -dFirstPage=1 -dLastPage=5 -sDEVICE=pngalpha -dEPSCrop -r72 -o $outputFile $inputFile
     // gswin32c -dBATCH -dNOPAUSE -dSAFER -dFirstPage=1 -dLastPage=5 -sDEVICE=jpeg -dJPEGQ=90 -r72 -o $outputFile $inputFile
     $args = sprintf("-dBATCH -dNOPAUSE -dSAFER -dFirstPage=1 -dLastPage=%d -sDEVICE=pngalpha -dEPSCrop -r72 -o %s %s", $numOfPreviews, str_replace("#", "%", ilUtil::escapeShellArg($outputFile)), ilUtil::escapeShellArg($inputFile));
     ilUtil::execQuoted(PATH_TO_GHOSTSCRIPT, $args);
     // was a temporary file created? then delete it
     if ($filepath != $inputFile) {
         @unlink($inputFile);
     }
     // check each file and add it
     $images = array();
     $outputFile = str_replace("#", "%", $outputFile);
     for ($i = 1; $i <= $numOfPreviews; $i++) {
         $imagePath = sprintf($outputFile, $i);
         if (!file_exists($imagePath)) {
             break;
         }
         $images[] = new ilRenderedImage($imagePath);
     }
     return $images;
 }
Пример #14
0
 /**
  * @param array $row
  */
 public function fillRow(array $row)
 {
     /**
      * @var $ilCtrl ilCtrl
      */
     global $ilCtrl;
     if ($this->getParentObject()->isCRUDContext()) {
         $row['chb'] = ilUtil::formCheckbox(false, 'unit_ids[]', $row['unit_id']);
         $sequence = new ilNumberInputGUI('', 'sequence[' . $row['unit_id'] . ']');
         $sequence->setValue($this->position++ * 10);
         $sequence->setMinValue(0);
         $sequence->setSize(3);
         $row['sequence'] = $sequence->render();
         $action = new ilAdvancedSelectionListGUI();
         $action->setId('asl_content_' . $row['unit_id']);
         $action->setAsynch(false);
         $action->setListTitle($this->lng->txt('actions'));
         $ilCtrl->setParameter($this->getParentObject(), 'unit_id', $row['unit_id']);
         $action->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitModificationForm'));
         $action->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteUnit'));
         $ilCtrl->setParameter($this->getParentObject(), 'unit_id', '');
         $row['actions'] = $action->getHtml();
     }
     if ($row['unit_id'] == $row['baseunit_id']) {
         $row['baseunit'] = '';
     }
     parent::fillRow($row);
 }
 private function save()
 {
     global $tpl, $ilCtrl;
     $form = $this->BuildForm();
     // Formular bauen
     // Eingaben prüfen (Abhängig von SetRequired)
     if ($form->CheckInput()) {
         $form->setValuesByPost();
         // Lade die Benutzereingaben
         $emails = $form->getInput('emails');
         // Speichere die E-Mails in eine Variable
         require_once "Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/UIExample/classes/class.ilEmailSubscriber.php";
         $subscriber = new ilEmailSubscriber($_GET['ref_id']);
         $emails = $subscriber->getEmailsFromString($emails);
         foreach ($emails as $email) {
             $subscriber->subscribeEmail($email);
         }
         //var_dump($subscriber->getEmailsFromString($emails));
         //exit;
         //$emails_untereinander = "";
         //$eintremails_untereinander = ;
         ilUtil::sendSuccess("Die Nutzer folgender E-Mail-Adressen sind jetzt Kursmitglieder: " . $this->werteuntereinander($subscriber->getEmailsFound()), true);
         ilUtil::sendInfo("Die Nutzer folgender E-Mail-Adressen konnten nicht gefunden werden: " . $this->werteuntereinander($subscriber->getEmailsNotFound()), true);
         $this->ctrl->redirect($this, 'show');
         /*
         $ausgabestr .= "Die Nutzer folgender E-Mail-Adressen sind jetzt Kursmitglieder: ".$this->werteuntereinander($subscriber->getEmailsFound());
         $ausgabestr .= "<br /><br /><br />Die Nutzer folgender E-Mail-Adressen konnten nicht gefunden werden: ".$this->werteuntereinander($subscriber->getEmailsNotFound());
         $this->tpl->setContent($ausgabestr);    //Zeige die E-Mails im Content an
         */
     } else {
         $this->tpl->setContent("Nicht Speichern");
     }
 }
 function show()
 {
     global $lng, $tree;
     $tpl = new ilTemplate("tpl.container_link_help.html", true, true, "Services/Container");
     $type_ordering = array("cat", "fold", "crs", "icrs", "icla", "grp", "chat", "frm", "lres", "glo", "webr", "file", "exc", "tst", "svy", "mep", "qpl", "spl");
     $childs = $tree->getChilds($_GET["ref_id"]);
     foreach ($childs as $child) {
         if (in_array($child["type"], array("lm", "dbk", "sahs", "htlm"))) {
             $cnt["lres"]++;
         } else {
             $cnt[$child["type"]]++;
         }
     }
     $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $tpl->setVariable("TXT_HELP_HEADER", $lng->txt("help"));
     foreach ($type_ordering as $type) {
         $tpl->setCurrentBlock("row");
         $tpl->setVariable("ROWCOL", "tblrow" . ($i++ % 2 + 1));
         if ($type != "lres") {
             $tpl->setVariable("TYPE", $lng->txt("objs_" . $type) . " (" . (int) $cnt[$type] . ")");
         } else {
             $tpl->setVariable("TYPE", $lng->txt("learning_resources") . " (" . (int) $cnt["lres"] . ")");
         }
         $tpl->setVariable("TXT_LINK", "[list-" . $type . "]");
         $tpl->parseCurrentBlock();
     }
     $tpl->show();
     exit;
 }
Пример #17
0
 public function storeFileForRest($content)
 {
     $tmpname = ilUtil::ilTempnam();
     $path = $this->getPath() . '/' . basename($tmpname);
     $this->writeToFile($content, $path);
     return basename($tmpname);
 }
 protected function getRequestParams()
 {
     $this->params = array();
     foreach ($_REQUEST as $name => $value) {
         $this->params[$name] = ilUtil::stripSlashes(urldecode($value));
     }
 }
Пример #19
0
 protected function prepareOutput()
 {
     $this->tpl->getStandardTemplate();
     $this->tpl->setTitleIcon(ilObject::_getIcon('', '', 'pays'), $this->lng->txt("shop"));
     $this->tpl->setTitle($this->lng->txt("shop"));
     ilUtil::infoPanel();
 }
Пример #20
0
 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng;
     $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
     $this->tpl->setVariable("PAGE_ID", $a_set["obj_id"]);
     $exp_id = ilLMPageObject::getExportId($this->parent_obj->object->getId(), $a_set["obj_id"], $a_set["type"]);
     if ($this->validation) {
         if (!preg_match("/^[a-zA-Z_]*\$/", trim($_POST["exportid"][$a_set["obj_id"]]))) {
             // @todo: move to style
             $this->tpl->setVariable("STYLE", " style='background-color: #FCEAEA;' ");
             $this->tpl->setVariable("ALERT_IMG", ilUtil::img(ilUtil::getImagePath("icon_alert.svg"), $lng->txt("alert")));
         }
         $this->tpl->setVariable("EXPORT_ID", ilUtil::prepareFormOutput(ilUtil::stripSlashes($_POST["exportid"][$a_set["obj_id"]])));
     } else {
         $this->tpl->setVariable("EXPORT_ID", ilUtil::prepareFormOutput($exp_id));
     }
     if ($this->cnt_exp_ids[$exp_id] > 1) {
         $this->tpl->setVariable("ITEM_ADD_TXT", $lng->txt("cont_exp_id_used_multiple"));
         $this->tpl->setVariable("ALERT_IMG", ilUtil::img(ilUtil::getImagePath("icon_alert.svg"), $lng->txt("alert")));
         if (!$this->dup_info_given) {
             ilUtil::sendInfo($lng->txt("content_some_export_ids_multiple_times"));
             $this->dup_info_given = true;
         }
     }
 }
 /**
  * Overwritten for qpl
  * @param string $a_obj_type
  * @param int $a_obj_id
  * @param string $a_export_type 
  */
 public static function lookupExportDirectory($a_obj_type, $a_obj_id, $a_export_type = 'xml', $a_entity = "")
 {
     if ($a_export_type == 'xml') {
         return ilUtil::getDataDir() . "/qpl_data" . "/qpl_" . $a_obj_id . "/export_zip";
     }
     return ilUtil::getDataDir() . "/qpl_data" . "/qpl_" . $a_obj_id . "/export_" . $a_export_type;
 }
 /**
  * Fill row template
  * @param array $a_row
  */
 public function fillRow($a_row)
 {
     global $ilCtrl;
     $this->tpl->setVariable('OBJ_SRC', $a_row['icon']);
     $this->tpl->setVariable('OBJ_ALT', $a_row['icon_alt']);
     $this->tpl->setVariable('OBJ_TITLE', $a_row['title']);
     include_once './Services/Link/classes/class.ilLink.php';
     $this->tpl->setVariable('OBJ_LINK', ilLink::_getLink($a_row['ref_id'], $a_row['type']));
     $this->tpl->setVariable('OBJ_DESCRIPTION', $a_row['description']);
     $this->tpl->setVariable('COND_ID', $a_row['id']);
     $this->tpl->setVariable('OBJ_CONDITION', $a_row['condition']);
     if (!$this->enable_editing) {
         $this->tpl->setCurrentBlock("obligatory_static");
         $this->tpl->setVariable('OBL_SRC', ilUtil::getImagePath($a_row['obligatory'] ? 'icon_ok.svg' : 'icon_not_ok.svg'));
         $this->tpl->setVariable('OBL_ALT', $this->lng->txt($a_row['obligatory'] ? 'precondition_obligatory_alt' : 'precondition_not_obligatory_alt'));
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setCurrentBlock("obligatory_edit");
         $this->tpl->setVariable('OBL_ID', $a_row['id']);
         $this->tpl->setVariable('OBL_STATUS', $a_row['obligatory'] ? ' checked="checked"' : '');
         $this->tpl->parseCurrentBlock();
     }
     $ilCtrl->setParameterByClass(get_class($this->getParentObject()), 'condition_id', $a_row['id']);
     $this->tpl->setVariable('EDIT_LINK', $ilCtrl->getLinkTargetByClass(get_class($this->getParentObject()), 'edit'));
     $this->tpl->setVariable('TXT_EDIT', $this->lng->txt('edit'));
 }
 public function deliver()
 {
     $file = $this->object->getFilePath();
     if ($file) {
         ilUtil::deliverFile($file, $this->object->getTitle() . ".pdf");
     }
 }
 /**
  * Get node icon
  *
  * @param array $a_node node array
  * @return string icon path
  */
 function getNodeIcon($a_node)
 {
     if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
         $icon = ilUtil::getImagePath("icon_lm.svg");
     } else {
         $a_name = "icon_" . $a_node["type"] . ".svg";
         if ($a_node["type"] == "pg") {
             include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
             $lm_set = new ilSetting("lm");
             $active = ilLMPage::_lookupActive($a_node["child"], $this->lm->getType(), $lm_set->get("time_scheduled_page_activation"));
             // is page scheduled?
             $img_sc = $lm_set->get("time_scheduled_page_activation") && ilLMPage::_isScheduledActivation($a_node["child"], $this->lm->getType()) ? "_sc" : "";
             $a_name = "icon_pg" . $img_sc . ".svg";
             if (!$active) {
                 $a_name = "icon_pg_d" . $img_sc . ".svg";
             } else {
                 include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
                 $contains_dis = ilLMPage::_lookupContainsDeactivatedElements($a_node["child"], $this->lm->getType());
                 if ($contains_dis) {
                     $a_name = "icon_pg_del" . $img_sc . ".svg";
                 }
             }
         }
         $icon = ilUtil::getImagePath($a_name);
     }
     return $icon;
 }
 protected function getItems($a_content_obj, $a_group_obj)
 {
     global $ilUser, $tree;
     $counter = 0;
     $items = ilUtil::_getObjectsByOperations($this->type, 'write', $ilUser->getId(), -1);
     $items_obj_id = array();
     $items_ids = array();
     foreach ($items as $ref_id) {
         $obj_id = ilObject::_lookupObjId($ref_id);
         $items_ids[$obj_id] = $ref_id;
         $items_obj_id[] = $obj_id;
     }
     $items_obj_id = ilUtil::_sortIds($items_obj_id, 'object_data', 'title', 'obj_id');
     $assigned_ids = array();
     $assigned = $a_group_obj->getAssignedItems();
     if ($assigned) {
         foreach ($assigned as $item) {
             $assigned_ids[] = $item['target_ref_id'];
         }
     }
     $data = array();
     foreach ($items_obj_id as $obj_id) {
         $item_id = $items_ids[$obj_id];
         if ($tree->checkForParentType($item_id, 'adm')) {
             continue;
         }
         $obj_id = ilObject::_lookupObjId($item_id);
         $data[] = array('id' => $item_id, 'title' => ilObject::_lookupTitle($obj_id), 'description' => ilObject::_lookupDescription($obj_id), 'path' => $this->__formatPath($tree->getPathFull($item_id)), 'assigned' => in_array($item_id, $assigned_ids));
     }
     $this->setData($data);
 }
 /**
  * Activate multi language (-> master language selection)
  */
 function activateMultilinguality()
 {
     global $tpl, $lng;
     ilUtil::sendInfo($lng->txt("cont_select_master_lang"));
     $form = $this->getMultiLangForm();
     $tpl->setContent($form->getHTML());
 }
 /**
  * init directory
  * overwritten method
  * @access	public
  * @static
  * @return string path
  */
 function _initDirectory()
 {
     if (!@file_exists($this->import_path)) {
         ilUtil::makeDir($this->import_path);
     }
     return true;
 }
 public function addAdministratorRole($a_usr_id)
 {
     /**
      * @var $rbacreview ilRbacReview
      * @var $rbacadmin 	ilRbacAdmin
      * @var $lng 		$lng
      */
     global $rbacreview, $rbacadmin, $lng;
     $role_list = $rbacreview->getRoleListByObject($this->getRefId());
     if (!$role_list) {
         ilUtil::sendFailure($lng->txt('missing_rolelist'));
         return false;
     }
     $a_rol_id = null;
     foreach ($role_list as $role) {
         if (strpos($role['title'], 'il_xavc_admin') !== false) {
             $a_rol_id = $role['obj_id'];
             break;
         }
     }
     if ((int) $a_rol_id) {
         $rbacadmin->assignUser($a_rol_id, $a_usr_id);
         return true;
     } else {
         return false;
     }
 }
 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng, $lng, $ilCtrl;
     switch ($a_set["type"]) {
         case ilPortfolioPage::TYPE_PAGE:
             $this->tpl->setCurrentBlock("title_field");
             $this->tpl->setVariable("ID", $a_set["id"]);
             $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"]));
             $this->tpl->parseCurrentBlock();
             $this->tpl->setCurrentBlock("action");
             $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit_page"));
             $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", $a_set["id"]);
             $this->tpl->setVariable("CMD_EDIT", $ilCtrl->getLinkTargetByClass("ilportfoliopagegui", "edit"));
             $this->tpl->parseCurrentBlock();
             break;
         case ilPortfolioPage::TYPE_BLOG:
             $this->tpl->setCurrentBlock("title_static");
             $this->tpl->setVariable("VAL_TITLE", $lng->txt("obj_blog") . ": " . ilObjBlog::_lookupTitle($a_set["title"]));
             $this->tpl->parseCurrentBlock();
             $obj_id = (int) $a_set["title"];
             if (isset($this->blogs[$obj_id])) {
                 $node_id = $this->blogs[$obj_id];
                 $link = ilWorkspaceAccessHandler::getGotoLink($node_id, $obj_id);
                 $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", $a_set["id"]);
                 $link = $ilCtrl->getLinkTargetByClass(array("ilportfoliopagegui", "ilobjbloggui"), "edit");
                 $this->tpl->setCurrentBlock("action");
                 $this->tpl->setVariable("TXT_EDIT", $lng->txt("blog_edit"));
                 $this->tpl->setVariable("CMD_EDIT", $link);
                 $this->tpl->parseCurrentBlock();
             }
             break;
     }
     $this->tpl->setVariable("ID", $a_set["id"]);
     $this->tpl->setVariable("VAL_ORDER_NR", $a_set["order_nr"]);
 }
 function check()
 {
     global $ilObjDataCache, $ilUser;
     include_once './Services/LinkChecker/classes/class.ilLinkChecker.php';
     foreach (ilUtil::_getObjectsByOperations('webr', 'write', $ilUser->getId(), -1) as $node) {
         if (!is_object($tmp_webr =& ilObjectFactory::getInstanceByRefId($node, false))) {
             continue;
         }
         $tmp_webr->initLinkResourceItemsObject();
         // Set all link to valid. After check invalid links will be set to invalid
         $link_checker =& new ilLinkChecker($this->db);
         $link_checker->setMailStatus(true);
         $link_checker->setCheckPeriod($this->__getCheckPeriod());
         $link_checker->setObjId($tmp_webr->getId());
         $tmp_webr->items_obj->updateValidByCheck($this->__getCheckPeriod());
         foreach ($link_checker->checkWebResourceLinks() as $invalid) {
             $tmp_webr->items_obj->readItem($invalid['page_id']);
             $tmp_webr->items_obj->setActiveStatus(false);
             $tmp_webr->items_obj->setValidStatus(false);
             $tmp_webr->items_obj->setDisableCheckStatus(true);
             $tmp_webr->items_obj->setLastCheckDate(time());
             $tmp_webr->items_obj->update(false);
         }
         $tmp_webr->items_obj->updateLastCheck($this->__getCheckPeriod());
         foreach ($link_checker->getLogMessages() as $message) {
             $this->log->write($message);
         }
     }
     return true;
 }