/**
  * add repository item
  *
  * @param	int		$a_ref_id	current ref id (optional);
  *								if empty $_GET["ref_id"] is used
  */
 function addRepositoryItems($a_ref_id = 0)
 {
     global $tree, $ilCtrl;
     if ($a_ref_id == 0) {
         $a_ref_id = $_GET["ref_id"];
     }
     include_once './Services/Container/classes/class.ilMemberViewSettings.php';
     if (ilMemberViewSettings::getInstance()->isActive() and $a_ref_id != ROOT_FOLDER_ID) {
         $a_start = ilMemberViewSettings::getInstance()->getContainer();
     } else {
         $a_start = ROOT_FOLDER_ID;
     }
     if ($a_ref_id > 0) {
         $path = $tree->getPathFull($a_ref_id, $a_start);
         // add item for each node on path
         foreach ((array) $path as $key => $row) {
             if (!in_array($row["type"], array("root", "cat", "crs", "fold", "grp", "icrs"))) {
                 continue;
             }
             if ($row["title"] == "ILIAS" && $row["type"] == "root") {
                 $row["title"] = $this->lng->txt("repository");
             }
             $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $row["child"]);
             $this->addItem($row["title"], $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"), ilFrameTargetInfo::_getFrame("MainContent"), $row["child"]);
             $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
         }
     }
 }
 /**
  * Get command target frame
  *
  * @param	string		$a_cmd			command
  *
  * @return	string		command target frame
  */
 function getCommandFrame($a_cmd)
 {
     if (IS_PAYMENT_ENABLED) {
         include_once 'Services/Payment/classes/class.ilPaymentObject.php';
         if (ilPaymentObject::_isBuyable($this->ref_id) && !ilPaymentObject::_hasAccess($this->ref_id)) {
             return '';
         }
     }
     $frame = "";
     switch ($a_cmd) {
         // BEGIN WebDAV: View inline objects in a blank window
         case 'sendfile':
             require_once 'Modules/File/classes/class.ilObjFileAccess.php';
             if (ilObjFileAccess::_isFileInline($this->title)) {
                 $frame = '_blank';
             }
             break;
             // END WebDAV View inline objects in a blank window
         // END WebDAV View inline objects in a blank window
         case "":
             $frame = ilFrameTargetInfo::_getFrame("RepositoryContent");
             break;
         default:
     }
     return $frame;
 }
 /**
  * Get command target frame
  *
  * @param	string		$a_cmd			command
  *
  * @return	string		command target frame
  */
 function getCommandFrame($a_cmd)
 {
     switch ($a_cmd) {
         default:
             $frame = ilFrameTargetInfo::_getFrame("MainContent");
             break;
     }
     return $frame;
 }
 /**
  * Get command target frame
  *
  * @param	string		$a_cmd			command
  *
  * @return	string		command target frame
  */
 function getCommandFrame($a_cmd)
 {
     switch ($a_cmd) {
         case "":
         case "questions":
             include_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
             $frame = ilFrameTargetInfo::_getFrame("MainContent");
             break;
         default:
     }
     return $frame;
 }
 /**
  * Get command target frame
  *
  * @param	string		$a_cmd			command
  *
  * @return	string		command target frame
  */
 function getCommandFrame($a_cmd)
 {
     switch ($a_cmd) {
         case "":
             if (ilObjLinkResourceAccess::_checkDirectLink($this->obj_id)) {
                 $frame = '_blank';
             } else {
                 $frame = ilFrameTargetInfo::_getFrame("RepositoryContent");
             }
             break;
         default:
     }
     return $frame;
 }
 /**
  * @param ilTabsGUI $tabs_gui
  */
 public function getAdminTabs(ilTabsGUI $tabs_gui)
 {
     /**
      * @var $tree ilTree
      */
     global $tree;
     if (isset($_GET['admin_mode']) && $_GET['admin_mode'] == 'repository') {
         $this->ctrl->setParameterByClass('iladministrationgui', 'admin_mode', 'settings');
         $tabs_gui->setBackTarget($this->lng->txt('administration'), $this->ctrl->getLinkTargetByClass('iladministrationgui', 'frameset'), ilFrameTargetInfo::_getFrame('MainContent'));
         $this->ctrl->setParameterByClass('iladministrationgui', 'admin_mode', 'repository');
     }
     if ($tree->getSavedNodeData($this->object->getRefId())) {
         $tabs_gui->addTarget('trash', $this->ctrl->getLinkTarget($this, 'trash'), 'trash', get_class($this));
     }
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl, $tpl;
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd();
     switch ($next_class) {
         case "ilscorm2004pagegui":
             $tpl->getStandardTemplate();
             $this->setContentStyle();
             $this->setLocator();
             // Determine whether the view of a learning resource should
             // be shown in the frameset of ilias, or in a separate window.
             //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
             $showViewInFrameset = true;
             $ilCtrl->setReturn($this, "edit");
             include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php";
             $page_gui =& new ilSCORM2004PageGUI($this->slm_object->getType(), $this->node_object->getId(), 0, $this->getParentGUI()->object->getId(), $this->slm_object->getAssignedGlossary());
             $page_gui->setEditPreview(true);
             $page_gui->setPresentationTitle($this->node_object->getTitle());
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->slm_object->getStyleSheetId(), "sahs"));
             if ($this->node_object->tree->getParentId($this->node_object->getId()) > 0) {
                 $sco = new ilSCORM2004Sco($this->node_object->getSLMObject(), $this->node_object->tree->getParentId($this->node_object->getId()));
                 if (count($sco->getGlossaryTermIds()) > 1) {
                     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ScoGUI.php";
                     $page_gui->setGlossaryOverviewInfo(ilSCORM2004ScoGUI::getGlossaryOverviewId(), $sco);
                 }
             }
             $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui", "active_node", $_GET["obj_id"]);
             $page_gui->setExplorerUpdater("tree", "tree_div", $ilCtrl->getLinkTargetByClass("ilobjscorm2004learningmodulegui", "showTree", "", true));
             $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui", "active_node", "");
             // set page view link
             $view_frame = ilFrameTargetInfo::_getFrame("MainContent");
             $page_gui->setLinkParams("ref_id=" . $this->slm_object->getRefId());
             $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg_b.png"));
             $page_gui->activateMetaDataEditor($this->slm_object->getID(), $this->node_object->getId(), $this->node_object->getType(), $this->node_object, 'MDUpdateListener');
             $ret = $ilCtrl->forwardCommand($page_gui);
             $this->setTabs();
             $tpl->setContent($ret);
             break;
         default:
             $ret =& $this->{$cmd}();
             break;
     }
     return $ret;
 }
 /**
  * Get command target frame
  *
  * @param	string		$a_cmd			command
  *
  * @return	string		command target frame
  */
 function getCommandFrame($a_cmd)
 {
     global $ilias;
     switch ($a_cmd) {
         case "view":
             //$showViewInFrameset = $ilias->ini->readVariable("layout","view_target") == "frame";
             $showViewInFrameset = true;
             include_once 'Services/Payment/classes/class.ilPaymentObject.php';
             $isBuyable = ilPaymentObject::_isBuyable($this->ref_id);
             if ($isBuyable && ilPaymentObject::_hasAccess($this->ref_id) == false || $showViewInFrameset) {
                 $frame = ilFrameTargetInfo::_getFrame("MainContent");
             } else {
                 $frame = ilFrameTargetInfo::_getFrame("MainContent");
                 //$frame = "ilContObj".$this->obj_id;
             }
             break;
         case "edit":
             $frame = ilFrameTargetInfo::_getFrame("MainContent");
             break;
         default:
             $frame = "";
             break;
     }
     return $frame;
 }
 /**
  * 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() == 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']));
         $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 != LP_MODE_DEACTIVATED && $mode != 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 ($this->isAnonymized($a_set)) {
             $this->tpl->setVariable("ANONYMIZED", $this->lng->txt('trac_anonymized_info_short'));
         }
     }
     // 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();
     }
 }
 /**
  * @param string $a_cmd
  * @return string
  */
 public function getCommandFrame($a_cmd)
 {
     return ilFrameTargetInfo::_getFrame('MainContent');
 }
 /**
  *
  * STATIC, do not use $this inside!
  *
  * Note: this is used by course interface !?
  */
 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
 {
     global $ilias;
     switch ($a_type) {
         case "cat":
             $t_frame = ilFrameTargetInfo::_getFrame("RepositoryContent", "cat");
             return $t_frame;
         case "catr":
             $t_frame = ilFrameTargetInfo::_getFrame("RepositoryContent", "catr");
             return $t_frame;
         case "grp":
             $t_frame = ilFrameTargetInfo::_getFrame("RepositoryContent", "grp");
             return $t_frame;
         case "crs":
             $t_frame = ilFrameTargetInfo::_getFrame("RepositoryContent", "crs");
             return $t_frame;
         case "crsr":
             $t_frame = ilFrameTargetInfo::_getFrame("RepositoryContent", "crsr");
             return $t_frame;
         case 'rcrs':
             $t_frame = ilFrameTargetInfo::_getFrame("RepositoryContent", 'rcrs');
             return $t_frame;
         default:
             return "_top";
     }
 }
示例#12
0
 /**
  * should be overwritten to add object specific items
  * (repository items are preloaded)
  */
 function addAdminLocatorItems()
 {
     global $ilLocator;
     if ($_GET["admin_mode"] == "settings" && $_GET["ref_id"] == ROLE_FOLDER_ID) {
         $ilLocator->addItem($this->lng->txt("administration"), $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"), ilFrameTargetInfo::_getFrame("MainContent"));
         $ilLocator->addItem($this->lng->txt("obj_" . ilObject::_lookupType(ilObject::_lookupObjId($_GET["ref_id"]))), $this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", "view"));
         if ($_GET["obj_id"] > 0) {
             $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "view"));
         }
     } else {
         // ?
     }
 }
示例#13
0
 /**
  * Add standar container subtabs for view, manage, oderdering and text/media editor link
  */
 function addStandardContainerSubTabs($a_include_view = true)
 {
     global $ilTabs, $ilAccess, $lng, $ilCtrl, $ilUser, $ilSetting;
     if (!is_object($this->object)) {
         return;
     }
     if ($a_include_view && $ilAccess->checkAccess("read", "", $this->object->getRefId())) {
         if (!$this->isActiveAdministrationPanel()) {
             $ilTabs->addSubTab("view_content", $lng->txt("view"), $ilCtrl->getLinkTarget($this, ""));
         } else {
             $ilTabs->addSubTab("view_content", $lng->txt("view"), $ilCtrl->getLinkTarget($this, "disableAdministrationPanel"));
         }
     }
     if ($ilUser->getId() != ANONYMOUS_USER_ID && ($this->adminCommands || is_object($this->object) && $ilAccess->checkAccess("write", "", $this->object->getRefId()) || is_object($this->object) && $this->object->getHiddenFilesFound() || $_SESSION["clipboard"])) {
         if ($this->isActiveAdministrationPanel()) {
             $ilTabs->addSubTab("manage", $lng->txt("cntr_manage"), $ilCtrl->getLinkTarget($this, ""));
         } else {
             $ilTabs->addSubTab("manage", $lng->txt("cntr_manage"), $ilCtrl->getLinkTarget($this, "enableAdministrationPanel"));
         }
     }
     if ($ilUser->getId() != ANONYMOUS_USER_ID && is_object($this->object) && $ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         $ilTabs->addSubTab("ordering", $lng->txt("cntr_ordering"), $ilCtrl->getLinkTarget($this, "editOrder"));
     }
     if ($ilUser->getId() != ANONYMOUS_USER_ID && is_object($this->object) && $ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         if ($ilSetting->get("enable_cat_page_edit")) {
             $ilTabs->addSubTab("page_editor", $lng->txt("cntr_text_media_editor"), $ilCtrl->getLinkTarget($this, "editPageFrame"), ilFrameTargetInfo::_getFrame("MainContent"));
         }
     }
 }
 /**
  * Get command target frame
  *
  * @param	string		$a_cmd			command
  *
  * @return	string		command target frame
  */
 function getCommandFrame($a_cmd)
 {
     return ilFrameTargetInfo::_getFrame("MainContent");
 }
 function editTimings()
 {
     global $ilAccess, $ilErr;
     include_once 'Services/MetaData/classes/class.ilMDEducational.php';
     include_once './Services/Link/classes/class.ilLink.php';
     $this->lng->loadLanguageModule('meta');
     if (!$ilAccess->checkAccess('write', '', $this->container_obj->getRefId())) {
         $ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->WARNING);
     }
     $this->__showTimingsPanel();
     $this->tabs_gui->setSubTabActive('timings_timings');
     include_once 'Services/Object/classes/class.ilObjectActivation.php';
     $this->cont_arr = ilObjectActivation::getTimingsAdministrationItems($this->container_obj->getRefId());
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.crs_edit_items.html', 'Modules/Course');
     $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $this->tpl->setVariable("HEADER_IMG", ilUtil::getImagePath('icon_crs.png'));
     $this->tpl->setVariable("HEADER_ALT", $this->lng->txt('crs_materials'));
     $this->tpl->setVariable("BLOCK_HEADER_CONTENT", $this->lng->txt('edit_timings_list'));
     $this->tpl->setVariable("TXT_TITLE", $this->lng->txt('title'));
     $this->tpl->setVariable("TXT_DURATION", $this->lng->txt('crs_timings_time_frame'));
     $this->tpl->setVariable("TXT_INFO_DURATION", $this->lng->txt('crs_timings_in_days'));
     $this->tpl->setVariable("TXT_START_END", $this->lng->txt('crs_timings_short_start_end'));
     $this->tpl->setVariable("TXT_INFO_START_END", $this->lng->txt('crs_timings_start_end_info'));
     $this->tpl->setVariable("TXT_CHANGEABLE", $this->lng->txt('crs_timings_short_changeable'));
     $this->tpl->setVariable("TXT_INFO_LIMIT", $this->lng->txt('crs_timings_from_until'));
     $this->tpl->setVariable("TXT_LIMIT", $this->lng->txt('crs_timings_short_limit_start_end'));
     $this->tpl->setVariable("TXT_ACTIVE", $this->lng->txt('crs_timings_short_active'));
     $this->tpl->setVariable("TXT_INFO_ACTIVE", $this->lng->txt('crs_timings_info_active'));
     $counter = 0;
     foreach ($this->cont_arr as $item) {
         if ($item['type'] == 'itgr') {
             continue;
         }
         $item = $this->__loadFromPost($item);
         $item_prefix = "item[{$item['ref_id']}]";
         $item_change_prefix = "item_change[{$item['ref_id']}]";
         $item_active_prefix = "item_active[{$item['ref_id']}]";
         if ($item['type'] == 'grp' or $item['type'] == 'fold') {
             $this->tpl->setVariable("TITLE_LINK", ilLink::_getLink($item['ref_id'], $item['type']));
             $this->tpl->setVariable("TITLE_FRAME", ilFrameTargetInfo::_getFrame('MainContent', $item['type']));
             $this->tpl->setVariable("TITLE_LINK_NAME", $item['title']);
         } else {
             $this->tpl->setVariable("TITLE", $item['title']);
         }
         if (strlen($item['description'])) {
             $this->tpl->setCurrentBlock("item_description");
             $this->tpl->setVariable("DESC", $item['description']);
             $this->tpl->parseCurrentBlock();
         }
         if ($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id'])) {
             $this->tpl->setCurrentBlock("tlt");
             $this->tpl->setVariable("TXT_TLT", $this->lng->txt('meta_typical_learning_time'));
             $this->tpl->setVariable("TLT_VAL", ilFormat::_secondsToString($tlt));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("container_standard_row");
         // Suggested
         if (is_array($_POST['item']["{$item['ref_id']}"]['sug_start'])) {
             $start = $this->__toUnix($_POST['item']["{$item['ref_id']}"]['sug_start']);
         } else {
             $start = $item['suggestion_start'];
         }
         $end = $item['suggestion_end'];
         $date = $this->__prepareDateSelect($start);
         $this->tpl->setVariable("SUG_START", ilUtil::makeDateSelect($item_prefix . "[sug_start]", $date['y'], $date['m'], $date['d'], date('Y', time()), false));
         $this->tpl->setVariable("NAME_DURATION_A", $item_prefix . "[duration_a]");
         if (isset($_POST['item']["{$item['ref_id']}"]['duration_a'])) {
             $this->tpl->setVariable("VAL_DURATION_A", abs($_POST['item']["{$item['ref_id']}"]['duration_a']));
         } else {
             $this->tpl->setVariable("VAL_DURATION_A", intval(($end - $start) / (60 * 60 * 24)));
         }
         $this->tpl->setVariable('SUG_END', ilDatePresentation::formatDate(new ilDate($item['suggestion_end'], IL_CAL_UNIX)));
         // Limit
         if (is_array($_POST['item']["{$item['ref_id']}"]['lim_end'])) {
             $end = $this->__toUnix($_POST['item']["{$item['ref_id']}"]['lim_end']);
         } else {
             $end = $item['latest_end'];
         }
         $date = $this->__prepareDateSelect($end);
         $this->tpl->setVariable("LIM_END", ilUtil::makeDateSelect($item_prefix . "[lim_end]", $date['y'], $date['m'], $date['d'], date('Y', time()), false));
         $this->tpl->setVariable("NAME_CHANGE", $item_change_prefix . "[change]");
         $this->tpl->setVariable("NAME_ACTIVE", $item_active_prefix . "[active]");
         if (isset($_POST['item'])) {
             $change = $_POST['item_change']["{$item['ref_id']}"]['change'];
             $active = $_POST['item_active']["{$item['ref_id']}"]['active'];
         } else {
             $change = $item['changeable'];
             $active = $item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING;
         }
         $this->tpl->setVariable("CHECKED_ACTIVE", $active ? 'checked="checked"' : '');
         $this->tpl->setVariable("CHECKED_CHANGE", $change ? 'checked="checked"' : '');
         if (isset($this->failed["{$item['ref_id']}"])) {
             $this->tpl->setVariable("ROWCLASS", 'tblrowmarked');
         } else {
             $this->tpl->setVariable("ROWCLASS", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
         }
         $this->tpl->parseCurrentBlock();
     }
     // Select all
     $this->tpl->setVariable("CHECKCLASS", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
     $this->tpl->setVariable("SELECT_ALL", $this->lng->txt('select_all'));
     $this->tpl->setVariable("BTN_SAVE", $this->lng->txt('save'));
     $this->tpl->setVariable("BTN_CANCEL", $this->lng->txt('cancel'));
 }
示例#16
0
 /**
  * Fill side icons (upper icon, tree icon, webfolder icon)
  */
 function fillSideIcons()
 {
     global $lng, $ilSetting;
     if ($this->upper_icon == "" && $this->tree_flat_link == "" && $this->mount_webfolder == "") {
         return;
     }
     // upper icon
     // deprecated
     if ($this->upper_icon != "") {
         /*if ($this->upper_icon_frame != "")
         			{
         				$this->setCurrentBlock("target_top");
         				$this->setVariable("TARGET_TOP", $this->upper_icon_frame);
         				$this->parseCurrentBlock();
         			}
         	
         			$this->setCurrentBlock("alt_top");
         			$this->setVariable("ALT_TOP", $lng->txt("up"));
         			$this->parseCurrentBlock();
         	
         			$this->setCurrentBlock("top");
         			$this->setVariable("LINK_TOP", $this->upper_icon);
         			$this->parseCurrentBlock();*/
     }
     // tree/flat icon
     if ($this->tree_flat_link != "") {
         if ($this->left_nav_content != "") {
             $this->touchBlock("tree_lns");
         }
         $this->setCurrentBlock("tree_mode");
         $this->setVariable("LINK_MODE", $this->tree_flat_link);
         if ($ilSetting->get("tree_frame") == "right") {
             if ($this->tree_flat_mode == "tree") {
                 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
                 $this->setVariable("RIGHT", "Right");
             } else {
                 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
                 $this->setVariable("RIGHT", "Right");
             }
         } else {
             if ($this->tree_flat_mode == "tree") {
                 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
             } else {
                 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
             }
         }
         $this->setVariable("ALT_TREE", $lng->txt($this->tree_flat_mode . "view"));
         $this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
         include_once "./Services/Accessibility/classes/class.ilAccessKeyGUI.php";
         $this->setVariable("TREE_ACC_KEY", ilAccessKeyGUI::getAttribute($this->tree_flat_mode == "tree" ? ilAccessKey::TREE_ON : ilAccessKey::TREE_OFF));
         $this->parseCurrentBlock();
     }
     // mount webfolder
     if ($this->mount_webfolder != "") {
         require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
         $davServer = new ilDAVServer();
         $a_ref_id = $this->mount_webfolder;
         $a_link = $davServer->getMountURI($a_ref_id);
         $a_folder = $davServer->getFolderURI($a_ref_id);
         $this->setCurrentBlock("mount_webfolder");
         $this->setVariable("LINK_MOUNT_WEBFOLDER", $a_link);
         $this->setVariable("FOLDER_MOUNT_WEBFOLDER", $a_folder);
         $this->setVariable("IMG_MOUNT_WEBFOLDER", ilUtil::getImagePath("ic_mount_webfolder.png"));
         $this->setVariable("ALT_MOUNT_WEBFOLDER", $lng->txt("mount_webfolder"));
         $this->setVariable("TARGET_MOUNT_WEBFOLDER", '_blank');
         $this->parseCurrentBlock();
     }
     $this->setCurrentBlock("tree_icons");
     $this->parseCurrentBlock();
 }
 /**
  * Set the locator for admin mode
  * (called from prepareOutput in parent class)
  */
 function addAdminLocatorItems()
 {
     global $ilLocator, $tpl;
     $ilLocator->addItem($this->lng->txt("administration"), $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"), ilFrameTargetInfo::_getFrame("MainContent"));
     $ilLocator->addItem($this->lng->txt("languages"), $this->ctrl->getLinkTargetByClass("ilobjlanguagefoldergui", ""));
     $ilLocator->addItem($this->lng->txt("meta_l_" . $this->object->getTitle()), $this->ctrl->getLinkTarget($this, "view"));
 }
 /**
  * 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();
     }
 }
示例#19
0
 public static function infoPanel($a_keep = true)
 {
     global $tpl, $ilias, $lng;
     if (!empty($_SESSION["infopanel"]) and is_array($_SESSION["infopanel"])) {
         $tpl->addBlockFile("INFOPANEL", "infopanel", "tpl.infopanel.html", "Services/Utilities");
         $tpl->setCurrentBlock("infopanel");
         if (!empty($_SESSION["infopanel"]["text"])) {
             $link = "<a href=\"" . $dir . $_SESSION["infopanel"]["link"] . "\" target=\"" . ilFrameTargetInfo::_getFrame("MainContent") . "\">";
             $link .= $lng->txt($_SESSION["infopanel"]["text"]);
             $link .= "</a>";
         }
         // deactivated
         if (!empty($_SESSION["infopanel"]["img"])) {
             $link .= "<td><a href=\"" . $_SESSION["infopanel"]["link"] . "\" target=\"" . ilFrameTargetInfo::_getFrame("MainContent") . "\">";
             $link .= "<img src=\"" . $ilias->tplPath . $ilias->account->prefs["skin"] . "/images/" . $_SESSION["infopanel"]["img"] . "\" border=\"0\" vspace=\"0\"/>";
             $link .= "</a></td>";
         }
         $tpl->setVariable("INFO_ICONS", $link);
         $tpl->parseCurrentBlock();
     }
     //if (!$a_keep)
     //{
     ilSession::clear("infopanel");
     //}
 }
 /**
  * get frame target (may be overwritten by derived classes)
  */
 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
 {
     if ($_GET["admin_mode"] == "settings" && $a_child == ROOT_FOLDER_ID) {
         return ilFrameTargetInfo::_getFrame("MainContent");
     } else {
         return $this->frame_target;
     }
 }
 /**
  * Init upload form.
  */
 public function initUploadForm()
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // type selection
     $options = array("scorm2004" => $lng->txt("lm_type_scorm2004"), "scorm" => $lng->txt("lm_type_scorm"), "aicc" => $lng->txt("lm_type_aicc"), "hacp" => $lng->txt("lm_type_hacp"));
     $si = new ilSelectInputGUI($this->lng->txt("type"), "sub_type");
     $si->setOptions($options);
     $this->form->addItem($si);
     // input file
     $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
     $fi->setRequired(true);
     $this->form->addItem($fi);
     // todo "uploaded file"
     // todo wysiwyg editor removement
     include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
     if (ilUploadFiles::_getUploadDirectory()) {
         $options = array();
         $fi->setRequired(false);
         $files = ilUploadFiles::_getUploadFiles();
         $options[""] = $this->lng->txt("cont_select_from_upload_dir");
         foreach ($files as $file) {
             $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
             $options[$file] = $file;
         }
         //
         $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
         $si->setOptions($options);
         $this->form->addItem($si);
     }
     // validate file
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate");
     $cb->setValue("y");
     //$cb->setChecked(true);
     $this->form->addItem($cb);
     // import for editing
     $cb = new ilCheckboxInputGUI($this->lng->txt("sahs_authoring_mode"), "editable");
     $cb->setValue("y");
     $cb->setInfo($this->lng->txt("sahs_authoring_mode_info"));
     $this->form->addItem($cb);
     //
     $radg = new ilRadioGroupInputGUI($lng->txt("sahs_sequencing"), "import_sequencing");
     $radg->setValue(0);
     $op1 = new ilRadioOption($lng->txt("sahs_std_sequencing"), 0, $lng->txt("sahs_std_sequencing_info"));
     $radg->addOption($op1);
     $op1 = new ilRadioOption($lng->txt("sahs_import_sequencing"), 1, $lng->txt("sahs_import_sequencing_info"));
     $radg->addOption($op1);
     $cb->addSubItem($radg);
     $this->form->addCommandButton("upload", $lng->txt("import"));
     $this->form->addCommandButton("cancel", $lng->txt("cancel"));
     $this->form->setTitle($lng->txt("import_sahs"));
     $this->form->setFormAction($ilCtrl->getFormAction($this, "upload"));
     $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
 }
 /**
  * get target frame
  */
 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
 {
     // Determine whether the view of a learning resource should
     // be shown in the frameset of ilias, or in a separate window.
     //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
     $showViewInFrameset = true;
     if ($this->offlineMode() && $this->export_format == "scorm") {
         return "";
     }
     if ($showViewInFrameset && !$this->offlineMode()) {
         return ilFrameTargetInfo::_getFrame("MainContent");
     } else {
         return "_top";
     }
 }
 /**
  * get link targets
  */
 function getLinkXML($a_int_links)
 {
     if ($a_layoutframes == "") {
         $a_layoutframes = array();
     }
     $link_info = "<IntLinkInfos>";
     foreach ($a_int_links as $int_link) {
         //echo "<br>+".$int_link["Type"]."+".$int_link["TargetFrame"]."+".$int_link["Target"]."+";
         $target = $int_link["Target"];
         if (substr($target, 0, 4) == "il__") {
             $target_arr = explode("_", $target);
             $target_id = $target_arr[count($target_arr) - 1];
             $type = $int_link["Type"];
             $targetframe = $int_link["TargetFrame"] != "" ? $int_link["TargetFrame"] : "None";
             // anchor
             $anc = $anc_add = "";
             if ($int_link["Anchor"] != "") {
                 $anc = $int_link["Anchor"];
                 $anc_add = "_" . rawurlencode($int_link["Anchor"]);
             }
             if ($targetframe == "New") {
                 $ltarget = "_blank";
             } else {
                 $ltarget = "";
             }
             switch ($type) {
                 case "PageObject":
                 case "StructureObject":
                     $lm_id = ilLMObject::_lookupContObjID($target_id);
                     $cont_obj =& $this->content_object;
                     if ($type == "PageObject") {
                         $href = "./goto.php?target=pg_" . $target_id . $anc_add;
                     } else {
                         $href = "./goto.php?target=st_" . $target_id;
                     }
                     //$ltarget = "ilContObj".$lm_id;
                     break;
                 case "GlossaryItem":
                     if (ilGlossaryTerm::_lookGlossaryID($target_id) == $this->glossary->getId()) {
                         if ($this->offlineMode()) {
                             $href = "term_" . $target_id . ".html";
                         } else {
                             $this->ctrl->setParameter($this, "term_id", $target_id);
                             $href = $this->ctrl->getLinkTarget($this, "listDefinitions");
                             $href = str_replace("&", "&amp;", $href);
                         }
                     } else {
                         $href = "./goto.php?target=git_" . $target_id;
                     }
                     break;
                 case "MediaObject":
                     if ($this->offlineMode()) {
                         $href = "media_" . $target_id . ".html";
                     } else {
                         $this->ctrl->setParameter($this, "obj_type", $type);
                         $this->ctrl->setParameter($this, "mob_id", $target_id);
                         $href = $this->ctrl->getLinkTarget($this, "media");
                         $href = str_replace("&", "&amp;", $href);
                     }
                     break;
                 case "RepositoryItem":
                     $obj_type = ilObject::_lookupType($target_id, true);
                     $obj_id = ilObject::_lookupObjId($target_id);
                     $href = "./goto.php?target=" . $obj_type . "_" . $target_id;
                     $t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
                     $ltarget = $t_frame;
                     break;
             }
             $anc_par = 'Anchor="' . $anc . '"';
             $link_info .= "<IntLinkInfo Target=\"{$target}\" Type=\"{$type}\" " . "TargetFrame=\"{$targetframe}\" LinkHref=\"{$href}\" LinkTarget=\"{$ltarget}\" {$anc_par}/>";
             $this->ctrl->clearParameters($this);
         }
     }
     $link_info .= "</IntLinkInfos>";
     return $link_info;
 }
 /**
  * get link targets
  */
 function getLinkXML($a_int_links)
 {
     if ($a_layoutframes == "") {
         $a_layoutframes = array();
     }
     $link_info = "<IntLinkInfos>";
     foreach ($a_int_links as $int_link) {
         $target = $int_link["Target"];
         if (substr($target, 0, 4) == "il__") {
             $target_arr = explode("_", $target);
             $target_id = $target_arr[count($target_arr) - 1];
             $type = $int_link["Type"];
             $targetframe = $int_link["TargetFrame"] != "" ? $int_link["TargetFrame"] : "None";
             // anchor
             $anc = $anc_add = "";
             if ($int_link["Anchor"] != "") {
                 $anc = $int_link["Anchor"];
                 $anc_add = "_" . rawurlencode($int_link["Anchor"]);
             }
             switch ($type) {
                 case "PageObject":
                 case "StructureObject":
                     $lm_id = ilLMObject::_lookupContObjID($target_id);
                     $cont_obj =& $this->content_object;
                     if ($lm_id == $cont_obj->getId()) {
                         $ltarget = "";
                         if ($type == "PageObject") {
                             $this->ctrl->setParameter($this, "obj_id", $target_id);
                             $href = $this->ctrl->getLinkTargetByClass(get_class($this), "edit");
                         } else {
                             $this->ctrl->setParameterByClass("ilstructureobjectgui", "obj_id", $target_id);
                             $href = $this->ctrl->getLinkTargetByClass("ilstructureobjectgui", "view");
                         }
                         $href = str_replace("&", "&amp;", $href);
                         $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
                     } else {
                         if ($type == "PageObject") {
                             $href = "goto.php?target=pg_" . $target_id . $anc_add;
                         } else {
                             $href = "goto.php?target=st_" . $target_id;
                         }
                         $ltarget = "ilContObj" . $lm_id;
                     }
                     break;
                 case "GlossaryItem":
                     $ltarget = $nframe = "_blank";
                     $href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;" . "obj_type={$type}&amp;cmd=glossary&amp;ref_id=" . $_GET["ref_id"] . "&amp;obj_id=" . $target_id . "&amp;frame={$nframe}";
                     break;
                 case "MediaObject":
                     $ltarget = $nframe = "_blank";
                     $href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;obj_type={$type}&amp;cmd=media&amp;ref_id=" . $_GET["ref_id"] . "&amp;mob_id=" . $target_id . "&amp;frame={$nframe}";
                     break;
                 case "RepositoryItem":
                     $obj_type = ilObject::_lookupType($target_id, true);
                     $obj_id = ilObject::_lookupObjId($target_id);
                     $href = "./goto.php?target=" . $obj_type . "_" . $target_id;
                     $t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
                     $ltarget = $t_frame;
                     break;
             }
             $anc_par = 'Anchor="' . $anc . '"';
             $link_info .= "<IntLinkInfo Target=\"{$target}\" Type=\"{$type}\" " . "TargetFrame=\"{$targetframe}\" LinkHref=\"{$href}\" LinkTarget=\"{$ltarget}\" {$anc_par}/>";
         }
     }
     $link_info .= "</IntLinkInfos>";
     //echo ":".htmlentities($link_info).":";
     return $link_info;
 }
 protected function addAdminLocatorItems()
 {
     $path = $this->tree->getPathFull($_GET["ref_id"], ilObjOrgUnit::getRootOrgRefId());
     // add item for each node on path
     foreach ((array) $path as $key => $row) {
         if ($row["title"] == "__OrgUnitAdministration") {
             $row["title"] = $this->lng->txt("objs_orgu");
         }
         $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $row["child"]);
         $this->ilLocator->addItem($row["title"], $this->ctrl->getLinkTargetByClass("ilobjorgunitgui", "view"), ilFrameTargetInfo::_getFrame("MainContent"), $row["child"]);
         $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $_GET["ref_id"]);
     }
 }
示例#26
0
 /**
  * Detail view of a mail
  */
 public function showMail()
 {
     /**
      * @var $ilUser ilObjUser
      * @var $ilToolbar ilToolbarGUI
      * @var $ilTabs ilTabsGUI
      */
     global $ilUser, $ilToolbar, $ilTabs;
     if ($_SESSION['mail_id']) {
         $_GET['mail_id'] = $_SESSION['mail_id'];
         $_SESSION['mail_id'] = '';
     }
     $ilTabs->clearTargets();
     $ilTabs->setBackTarget($this->lng->txt('back_to_folder'), $this->ctrl->getFormAction($this, 'showFolder'));
     $this->umail->markRead(array((int) $_GET['mail_id']));
     $mailData = $this->umail->getMail((int) $_GET['mail_id']);
     $this->tpl->setTitle($this->lng->txt('mail_mails_of'));
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setPreventDoubleSubmission(false);
     $form->setTableWidth('100%');
     $this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
     $form->setFormAction($this->ctrl->getFormAction($this, 'showMail'));
     $this->ctrl->clearParameters($this);
     $form->setTitle($this->lng->txt('mail_mails_of'));
     if ('tree' == ilSession::get(ilMailGUI::VIEWMODE_SESSION_KEY)) {
         $this->tpl->setVariable('FORM_TARGET', ilFrameTargetInfo::_getFrame('MainContent'));
     }
     include_once 'Services/Accessibility/classes/class.ilAccessKeyGUI.php';
     /**
      * @var $sender ilObjUser
      */
     $sender = ilObjectFactory::getInstanceByObjId($mailData['sender_id'], false);
     if ($sender && $sender->getId() && $sender->getId() != ANONYMOUS_USER_ID) {
         $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $_GET['mail_id']);
         $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'reply');
         $this->ctrl->clearParametersByClass('iliasmailformgui');
         $ilToolbar->addButton($this->lng->txt('reply'), $this->ctrl->getLinkTargetByClass('ilmailformgui'), '', ilAccessKey::REPLY);
         $this->ctrl->clearParameters($this);
     }
     $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $_GET['mail_id']);
     $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'forward');
     $this->ctrl->clearParametersByClass('iliasmailformgui');
     $ilToolbar->addButton($this->lng->txt('forward'), $this->ctrl->getLinkTargetByClass('ilmailformgui'), '', ilAccessKey::FORWARD_MAIL);
     $this->ctrl->clearParameters($this);
     $this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
     $ilToolbar->addButton($this->lng->txt('print'), $this->ctrl->getLinkTarget($this, 'printMail'), '_blank');
     $this->ctrl->clearParameters($this);
     $this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
     $this->ctrl->setParameter($this, 'selected_cmd', 'deleteMails');
     $ilToolbar->addButton($this->lng->txt('delete'), $this->ctrl->getLinkTarget($this), '', ilAccessKey::DELETE);
     $this->ctrl->clearParameters($this);
     if ($sender && $sender->getId() && $sender->getId() != ANONYMOUS_USER_ID) {
         $linked_fullname = $sender->getPublicName();
         $picture = ilUtil::img($sender->getPersonalPicturePath('xsmall'), $sender->getPublicName());
         $add_to_addb_button = '';
         if (in_array(ilObjUser::_lookupPref($sender->getId(), 'public_profile'), array('y', 'g'))) {
             $this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
             $this->ctrl->setParameter($this, 'user', $sender->getId());
             $linked_fullname = '<br /><a href="' . $this->ctrl->getLinkTarget($this, 'showUser') . '" title="' . $linked_fullname . '">' . $linked_fullname . '</a>';
             $this->ctrl->clearParameters($this);
         }
         if ($sender->getId() != $ilUser->getId()) {
             require_once 'Services/Contact/classes/class.ilAddressbook.php';
             $abook = new ilAddressbook($ilUser->getId());
             if ($abook->checkEntryByLogin($sender->getLogin()) == 0) {
                 $tplbtn = new ilTemplate('tpl.buttons.html', true, true);
                 $tplbtn->setCurrentBlock('btn_cell');
                 $this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
                 $tplbtn->setVariable('BTN_LINK', $this->ctrl->getLinkTarget($this, 'add'));
                 $this->ctrl->clearParameters($this);
                 $tplbtn->setVariable('BTN_TXT', $this->lng->txt('mail_add_to_addressbook'));
                 $tplbtn->parseCurrentBlock();
                 $add_to_addb_button = '<br />' . $tplbtn->get();
             }
         }
         $from = new ilCustomInputGUI($this->lng->txt('from'));
         $from->setHtml($picture . ' ' . $linked_fullname . $add_to_addb_button);
         $form->addItem($from);
     } else {
         if (!$sender || !$sender->getId()) {
             $from = new ilCustomInputGUI($this->lng->txt('from'));
             $from->setHtml($mailData['import_name'] . ' (' . $this->lng->txt('user_deleted') . ')');
             $form->addItem($from);
         } else {
             $from = new ilCustomInputGUI($this->lng->txt('from'));
             $from->setHtml(ilUtil::img(ilUtil::getImagePath('HeaderIconAvatar.svg'), ilMail::_getIliasMailerName()) . '<br />' . ilMail::_getIliasMailerName());
             $form->addItem($from);
         }
     }
     $to = new ilCustomInputGUI($this->lng->txt('mail_to'));
     $to->setHtml(ilUtil::htmlencodePlainString($this->umail->formatNamesForOutput($mailData['rcp_to']), false));
     $form->addItem($to);
     if ($mailData['rcp_cc']) {
         $cc = new ilCustomInputGUI($this->lng->txt('cc'));
         $cc->setHtml(ilUtil::htmlencodePlainString($this->umail->formatNamesForOutput($mailData['rcp_cc']), false));
         $form->addItem($cc);
     }
     if ($mailData['rcp_bcc']) {
         $bcc = new ilCustomInputGUI($this->lng->txt('bc'));
         $bcc->setHtml(ilUtil::htmlencodePlainString($this->umail->formatNamesForOutput($mailData['rcp_bcc']), false));
         $form->addItem($bcc);
     }
     $subject = new ilCustomInputGUI($this->lng->txt('subject'));
     $subject->setHtml(ilUtil::htmlencodePlainString($mailData['m_subject'], true));
     $form->addItem($subject);
     $date = new ilCustomInputGUI($this->lng->txt('date'));
     $date->setHtml(ilDatePresentation::formatDate(new ilDateTime($mailData['send_time'], IL_CAL_DATETIME)));
     $form->addItem($date);
     $message = new ilCustomInputGUI($this->lng->txt('message'));
     $message->setHtml(ilUtil::htmlencodePlainString($mailData['m_message'], true));
     $form->addItem($message);
     if ($mailData['attachments']) {
         $att = new ilCustomInputGUI($this->lng->txt('attachments'));
         $radiog = new ilRadioGroupInputGUI('', 'filename');
         foreach ($mailData['attachments'] as $file) {
             $radiog->addOption(new ilRadioOption($file, md5($file)));
         }
         $att->setHtml($radiog->render());
         $form->addCommandButton('deliverFile', $this->lng->txt('download'));
         $form->addItem($att);
     }
     $isTrashFolder = false;
     if ($this->mbox->getTrashFolder() == $_GET['mobj_id']) {
         $isTrashFolder = true;
     }
     $current_folder_data = $this->mbox->getFolderData((int) $_GET['mobj_id']);
     $selectOptions = array();
     $actions = $this->mbox->getActions((int) $_GET["mobj_id"]);
     foreach ($actions as $key => $action) {
         if ($key == 'moveMails') {
             $folders = $this->mbox->getSubFolders();
             foreach ($folders as $folder) {
                 if (($folder["type"] != 'trash' || !$isTrashFolder) && $folder['obj_id'] != $current_folder_data['obj_id']) {
                     $optionText = '';
                     if ($folder['type'] != 'user_folder') {
                         $optionText = $action . ' ' . $this->lng->txt('mail_' . $folder['title']) . ($folder['type'] == 'trash' ? ' (' . $this->lng->txt('delete') . ')' : '');
                     } else {
                         $optionText = $action . ' ' . $folder['title'];
                     }
                     $selectOptions[$folder['obj_id']] = $optionText;
                 }
             }
         }
     }
     if ($current_folder_data['type'] == 'user_folder') {
         $txt_folder = $current_folder_data['title'];
     } else {
         $txt_folder = $this->lng->txt('mail_' . $current_folder_data['title']);
     }
     $ilToolbar->addSeparator();
     $ilToolbar->addText(sprintf($this->lng->txt('current_folder'), $txt_folder));
     if (is_array($selectOptions) && count($selectOptions)) {
         include_once 'Services/Form/classes/class.ilSelectInputGUI.php';
         $actions = new ilSelectInputGUI('', 'selected_cmd');
         $actions->setOptions($selectOptions);
         $this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
         $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 'showMail'));
         $ilToolbar->addInputItem($actions);
         $ilToolbar->addFormButton($this->lng->txt('submit'), 'changeFolder');
     }
     // Navigation
     $prevMail = $this->umail->getPreviousMail((int) $_GET['mail_id']);
     $nextMail = $this->umail->getNextMail((int) $_GET['mail_id']);
     if (is_array($prevMail) || is_array($nextMail)) {
         $ilToolbar->addSeparator();
         if ($prevMail['mail_id']) {
             $this->ctrl->setParameter($this, 'mail_id', $prevMail['mail_id']);
             $ilToolbar->addButton($this->lng->txt('previous'), $this->ctrl->getLinkTarget($this, 'showMail'));
             $this->ctrl->clearParameters($this);
         }
         if ($nextMail['mail_id']) {
             $this->ctrl->setParameter($this, 'mail_id', $nextMail['mail_id']);
             $ilToolbar->addButton($this->lng->txt('next'), $this->ctrl->getLinkTarget($this, 'showMail'));
             $this->ctrl->clearParameters($this);
         }
     }
     $this->tpl->setContent($form->getHTML());
     $this->tpl->show();
 }
 /**
  * display locator
  *
  * @param	boolean		$a_omit_obj_id	set to true, if obj id is not page id (e.g. permission gui)
  */
 function addLocations($a_omit_obj_id = false)
 {
     global $lng, $tree, $ilLocator, $ilCtrl;
     $par_id = $tree->getParentId($_GET["ref_id"]);
     $parent_title = ilObject::_lookupTitle(ilObject::_lookupObjId($par_id));
     // parent is not root folder, "shorten" locator
     if ($par_id != ROOT_FOLDER_ID) {
         $this->ctrl->addLocation("...", "");
     } else {
         // if parent is root folder and has no custom title
         // we adapt it [see $ilLocator->addRepositoryItems()]
         if ($parent_title == "ILIAS") {
             $parent_title = $lng->txt("repository");
         }
     }
     $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $par_id);
     $this->ctrl->addLocation($parent_title, $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"), ilFrameTargetInfo::_getFrame("MainContent"), $par_id);
     $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
     if (!$a_omit_obj_id) {
         $obj_id = $_GET["obj_id"];
     }
     $lmtree =& $this->object->getTree();
     if ($obj_id != 0 && $lmtree->isInTree($obj_id)) {
         $path = $lmtree->getPathFull($obj_id);
     } else {
         $path = $lmtree->getPathFull($lmtree->getRootId());
         if ($obj_id != 0) {
             $path[] = array("type" => "pg", "child" => $this->obj_id, "title" => ilLMPageObject::_getPresentationTitle($this->obj_id));
         }
     }
     $modifier = 1;
     foreach ($path as $key => $row) {
         if ($row["child"] == 1) {
             $this->ctrl->setParameter($this, "obj_id", "");
             $this->ctrl->addLocation($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "chapters"), "", $_GET["ref_id"]);
         } else {
             $title = $row["title"];
             switch ($row["type"]) {
                 case "st":
                     $this->ctrl->setParameterByClass("ilstructureobjectgui", "obj_id", $row["child"]);
                     $this->ctrl->addLocation($title, $this->ctrl->getLinkTargetByClass("ilstructureobjectgui", "view"));
                     break;
                 case "pg":
                     $this->ctrl->setParameterByClass("illmpageobjectgui", "obj_id", $row["child"]);
                     $this->ctrl->addLocation($title, $this->ctrl->getLinkTargetByClass("illmpageobjectgui", "edit"));
                     break;
             }
         }
     }
     if (!$a_omit_obj_id) {
         $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
     }
 }
 /**
  * inserts sequential learning module navigation
  * at template variable LMNAVIGATION_CONTENT
  */
 function ilLMNavigation()
 {
     global $ilUser;
     include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
     include_once "./Services/Accessibility/classes/class.ilAccessKeyGUI.php";
     $page_id = $this->getCurrentPageId();
     if (empty($page_id)) {
         return;
     }
     // process navigation for free page
     if (!$this->lm_tree->isInTree($page_id)) {
         if ($this->offlineMode() || $_GET["back_pg"] == "") {
             return;
         }
         $limpos = strpos($_GET["back_pg"], ":");
         if ($limpos > 0) {
             $back_pg = substr($_GET["back_pg"], 0, $limpos);
         } else {
             $back_pg = $_GET["back_pg"];
         }
         if (!$this->lm->cleanFrames()) {
             $back_href = $this->getLink($this->lm->getRefId(), "layout", $back_pg, $_GET["frame"], "", "reduce");
             $back_target = "";
         } else {
             $back_href = $this->getLink($this->lm->getRefId(), "layout", $back_pg, "", "", "reduce");
             $back_target = 'target="' . ilFrameTargetInfo::_getFrame("MainContent") . '" ';
         }
         $back_img = ilUtil::getImagePath("nav_arr2_L.png", false, "output", $this->offlineMode());
         $this->tpl->setCurrentBlock("ilLMNavigation_Prev");
         $this->tpl->setVariable("IMG_PREV", $back_img);
         $this->tpl->setVariable("HREF_PREV", $back_href);
         $this->tpl->setVariable("FRAME_PREV", $back_target);
         $this->tpl->setVariable("TXT_PREV", $this->lng->txt("back"));
         $this->tpl->setVariable("ALT_PREV", $this->lng->txt("back"));
         $this->tpl->setVariable("PREV_ACC_KEY", ilAccessKeyGUI::getAttribute(ilAccessKey::PREVIOUS));
         $this->tpl->setVariable("SPACER_PREV", $this->offlineMode() ? "images/spacer.png" : ilUtil::getImagePath("spacer.png"));
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("ilLMNavigation_Prev2");
         $this->tpl->setVariable("IMG_PREV2", $back_img);
         $this->tpl->setVariable("HREF_PREV2", $back_href);
         $this->tpl->setVariable("FRAME_PREV2", $back_target);
         $this->tpl->setVariable("TXT_PREV2", $this->lng->txt("back"));
         $this->tpl->setVariable("ALT_PREV2", $this->lng->txt("back"));
         $this->tpl->setVariable("SPACER_PREV2", $this->offlineMode() ? "images/spacer.png" : ilUtil::getImagePath("spacer.png"));
         $this->tpl->parseCurrentBlock();
         return;
     }
     // determine successor page_id
     $found = false;
     // empty chapter
     if ($this->chapter_has_no_active_page && ilLMObject::_lookupType($_GET["obj_id"]) == "st") {
         $c_id = $_GET["obj_id"];
     } else {
         if ($this->deactivated_page) {
             $c_id = $_GET["obj_id"];
         } else {
             $c_id = $page_id;
         }
     }
     while (!$found) {
         $succ_node = $this->lm_tree->fetchSuccessorNode($c_id, "pg");
         $c_id = $succ_node["obj_id"];
         $active = ilLMPage::_lookupActive($c_id, $this->lm->getType(), $this->lm_set->get("time_scheduled_page_activation"));
         if ($succ_node["obj_id"] > 0 && ($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && ($this->lm->getPublicAccessMode() == "selected" && !ilLMObject::_isPagePublic($succ_node["obj_id"]))) {
             $found = false;
         } else {
             if ($succ_node["obj_id"] > 0 && !$active) {
                 // look, whether activation data should be shown
                 $act_data = ilLMPage::_lookupActivationData((int) $succ_node["obj_id"], $this->lm->getType());
                 if ($act_data["show_activation_info"] && ilUtil::now() < $act_data["activation_start"]) {
                     $found = true;
                 } else {
                     $found = false;
                 }
             } else {
                 $found = true;
             }
         }
     }
     $succ_str = $succ_node !== false ? " -> " . $succ_node["obj_id"] . "_" . $succ_node["type"] : "";
     // determine predecessor page id
     $found = false;
     if ($this->deactivated_page) {
         $c_id = $_GET["obj_id"];
     } else {
         $c_id = $page_id;
     }
     while (!$found) {
         $pre_node = $this->lm_tree->fetchPredecessorNode($c_id, "pg");
         $c_id = $pre_node["obj_id"];
         $active = ilLMPage::_lookupActive($c_id, $this->lm->getType(), $this->lm_set->get("time_scheduled_page_activation"));
         if ($pre_node["obj_id"] > 0 && ($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && ($this->lm->getPublicAccessMode() == "selected" && !ilLMObject::_isPagePublic($pre_node["obj_id"]))) {
             $found = false;
         } else {
             if ($pre_node["obj_id"] > 0 && !$active) {
                 // look, whether activation data should be shown
                 $act_data = ilLMPage::_lookupActivationData((int) $pre_node["obj_id"], $this->lm->getType());
                 if ($act_data["show_activation_info"] && ilUtil::now() < $act_data["activation_start"]) {
                     $found = true;
                 } else {
                     $found = false;
                 }
             } else {
                 $found = true;
             }
         }
     }
     $pre_str = $pre_node !== false ? $pre_node["obj_id"] . "_" . $pre_node["type"] . " -> " : "";
     // determine target frame
     $framestr = !empty($_GET["frame"]) ? "frame=" . $_GET["frame"] . "&" : "";
     // Determine whether the view of a learning resource should
     // be shown in the frameset of ilias, or in a separate window.
     $showViewInFrameset = true;
     if ($pre_node != "") {
         // get presentation title
         $prev_title = ilLMPageObject::_getPresentationTitle($pre_node["obj_id"], $this->lm->getPageHeader(), $this->lm->isActiveNumbering(), $this->lm_set->get("time_scheduled_page_activation"), false, 0, $this->lang);
         $prev_title = ilUtil::shortenText($prev_title, 50, true);
         $prev_img = ilUtil::getImagePath("nav_arr_L.png", false, "output", $this->offlineMode());
         if (!$this->lm->cleanFrames()) {
             $prev_href = $this->getLink($this->lm->getRefId(), "layout", $pre_node["obj_id"], $_GET["frame"]);
             $prev_target = "";
         } else {
             if ($showViewInFrameset && !$this->offlineMode()) {
                 $prev_href = $this->getLink($this->lm->getRefId(), "layout", $pre_node["obj_id"]);
                 $prev_target = 'target="' . ilFrameTargetInfo::_getFrame("MainContent") . '" ';
             } else {
                 $prev_href = $this->getLink($this->lm->getRefId(), "layout", $pre_node["obj_id"]);
                 $prev_target = 'target="_top" ';
             }
         }
         if (($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && ($this->lm->getPublicAccessMode() == 'selected' && !ilLMObject::_isPagePublic($pre_node["obj_id"]))) {
             $output = $this->lng->txt("msg_page_not_public");
         }
         $this->tpl->setCurrentBlock("ilLMNavigation_Prev");
         $this->tpl->setVariable("IMG_PREV", $prev_img);
         $this->tpl->setVariable("HREF_PREV", $prev_href);
         $this->tpl->setVariable("FRAME_PREV", $prev_target);
         $this->tpl->setVariable("TXT_PREV", $prev_title);
         $this->tpl->setVariable("ALT_PREV", $this->lng->txt("previous"));
         $this->tpl->setVariable("SPACER_PREV", $this->offlineMode() ? "images/spacer.png" : ilUtil::getImagePath("spacer.png"));
         $this->tpl->setVariable("PREV_ACC_KEY", ilAccessKeyGUI::getAttribute(ilAccessKey::PREVIOUS));
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("ilLMNavigation_Prev2");
         $this->tpl->setVariable("IMG_PREV2", $prev_img);
         $this->tpl->setVariable("HREF_PREV2", $prev_href);
         $this->tpl->setVariable("FRAME_PREV2", $prev_target);
         $this->tpl->setVariable("TXT_PREV2", $prev_title);
         $this->tpl->setVariable("ALT_PREV2", $this->lng->txt("previous"));
         $this->tpl->setVariable("SPACER_PREV2", $this->offlineMode() ? "images/spacer.png" : ilUtil::getImagePath("spacer.png"));
         $this->tpl->parseCurrentBlock();
     }
     if ($succ_node != "") {
         // get presentation title
         $succ_title = ilLMPageObject::_getPresentationTitle($succ_node["obj_id"], $this->lm->getPageHeader(), $this->lm->isActiveNumbering(), $this->lm_set->get("time_scheduled_page_activation"), false, 0, $this->lang);
         $succ_title = ilUtil::shortenText($succ_title, 50, true);
         $succ_img = ilUtil::getImagePath("nav_arr_R.png", false, "output", $this->offlineMode());
         if (!$this->lm->cleanFrames()) {
             $succ_href = $this->getLink($this->lm->getRefId(), "layout", $succ_node["obj_id"], $_GET["frame"]);
             $succ_target = "";
         } else {
             if ($showViewInFrameset && !$this->offlineMode()) {
                 $succ_href = $this->getLink($this->lm->getRefId(), "layout", $succ_node["obj_id"]);
                 $succ_target = ' target="' . ilFrameTargetInfo::_getFrame("MainContent") . '" ';
             } else {
                 $succ_href = $this->getLink($this->lm->getRefId(), "layout", $succ_node["obj_id"]);
                 $succ_target = ' target="_top" ';
             }
         }
         if (($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && ($this->lm->getPublicAccessMode() == 'selected' && !ilLMObject::_isPagePublic($pre_node["obj_id"]))) {
             $output = $this->lng->txt("msg_page_not_public");
         }
         $this->tpl->setCurrentBlock("ilLMNavigation_Next");
         $this->tpl->setVariable("IMG_SUCC", $succ_img);
         $this->tpl->setVariable("HREF_SUCC", $succ_href);
         $this->tpl->setVariable("FRAME_SUCC", $succ_target);
         $this->tpl->setVariable("TXT_SUCC", $succ_title);
         $this->tpl->setVariable("ALT_SUCC", $this->lng->txt("next"));
         $this->tpl->setVariable("SPACER_SUCC", $this->offlineMode() ? "images/spacer.png" : ilUtil::getImagePath("spacer.png"));
         $this->tpl->setVariable("NEXT_ACC_KEY", ilAccessKeyGUI::getAttribute(ilAccessKey::NEXT));
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("ilLMNavigation_Next2");
         $this->tpl->setVariable("IMG_SUCC2", $succ_img);
         $this->tpl->setVariable("HREF_SUCC2", $succ_href);
         $this->tpl->setVariable("FRAME_SUCC2", $succ_target);
         $this->tpl->setVariable("TXT_SUCC2", $succ_title);
         $this->tpl->setVariable("ALT_SUCC2", $this->lng->txt("next"));
         $this->tpl->setVariable("SPACER_SUCC2", $this->offlineMode() ? "images/spacer.png" : ilUtil::getImagePath("spacer.png"));
         $this->tpl->parseCurrentBlock();
         // check if successor page is not restricted
         if (!$this->offlineMode()) {
             if ($this->lm->getRestrictForwardNavigation()) {
                 if ($this->getTracker()->hasPredIncorrectAnswers($succ_node["obj_id"])) {
                     $this->tpl->addOnLoadCode("\$('.ilc_page_rnav_RightNavigation').addClass('ilNoDisplay');");
                 }
             }
         }
     }
 }
 public function fillRow($a_data)
 {
     global $lng, $ilCtrl, $ilUser;
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $current_selection_list = new ilAdvancedSelectionListGUI();
     $current_selection_list->setListTitle($this->lng->txt("actions"));
     $current_selection_list->setId("act_" . $a_data['obj_id']);
     $this->tpl->setVariable("VAL_ID", $a_data["obj_id"]);
     // edit link
     $edit_link = '';
     $delete_link = '';
     $sendmail_link = '';
     $export_link = '';
     if ($a_data["type"] != "parent") {
         $hash = $ilUser->prefs["screen_reader_optimization"] ? "bookmark_top" : "";
         $ilCtrl->setParameter($this->parent_obj, "bmf_id", $this->parent_obj->id);
         $ilCtrl->setParameter($this->parent_obj, "obj_id", $a_data["obj_id"]);
         $edit_link = $a_data["type"] == "bmf" ? $ilCtrl->getLinkTarget($this->parent_obj, "editFormBookmarkFolder", $hash) : $ilCtrl->getLinkTarget($this->parent_obj, "editFormBookmark", $hash);
         $ilCtrl->clearParameters($this->parent_obj);
         $ilCtrl->setParameter($this->parent_obj, "bm_id", $a_data['obj_id']);
         $delete_link = $ilCtrl->getLinkTarget($this->parent_obj, 'delete', $hash);
         $sendmail_link = $ilCtrl->getLinkTarget($this->parent_obj, 'sendmail', $hash);
         $export_link = $ilCtrl->getLinkTarget($this->parent_obj, 'export', $hash);
     }
     if ($edit_link) {
         $current_selection_list->addItem($this->lng->txt('edit'), '', $edit_link);
     }
     if ($delete_link) {
         $current_selection_list->addItem($this->lng->txt('delete'), '', $delete_link);
     }
     if ($export_link) {
         $current_selection_list->addItem($this->lng->txt('export'), '', $export_link);
     }
     if ($sendmail_link) {
         $current_selection_list->addItem($this->lng->txt('bkm_sendmail'), '', $sendmail_link);
     }
     $this->tpl->setVariable("COMMAND_SELECTION_LIST", $current_selection_list->getHTML());
     // icon
     $img_type = $a_data["type"] == "bmf" || $a_data["type"] == "parent" ? "bmf" : $a_data["type"];
     // #10556
     $val = ilUtil::getImagePath("icon_" . $img_type . ".svg");
     $this->tpl->setVariable("VAL_ICON", $val);
     $this->tpl->setVariable("VAL_ICON_ALT", $lng->txt("icon") . " " . $lng->txt($a_data["type"]));
     // folder links
     if ($a_data["type"] == "bmf" || $a_data["type"] == "parent") {
         $this->tpl->setVariable("VAL_BMF_TITLE", $a_data["title"]);
         $ilCtrl->setParameter($this->parent_obj, "bmf_id", $a_data["obj_id"]);
         $this->tpl->setVariable("VAL_BMF_TARGET", $ilCtrl->getLinkTarget($this->parent_obj));
         //$this->tpl->setVariable("FRAME_TARGET_BMF", ilFrameTargetInfo::_getFrame("MainContent"));
     } else {
         $this->tpl->setVariable("VAL_BM_TITLE", $a_data["title"]);
         $this->tpl->setVariable("VAL_BM_TARGET", htmlentities($a_data["target"]));
         $this->tpl->setVariable("VAL_BM_DESCRIPTION", $a_data["description"]);
         $this->tpl->setVariable("FRAME_TARGET_BM", ilFrameTargetInfo::_getFrame("ExternalContent"));
     }
     $ilCtrl->clearParameters($this->parent_obj);
 }
 /**
  * upload new version of module
  */
 function newModuleVersion()
 {
     $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
     $type = ilObjSAHSLearningModule::_lookupSubType($obj_id);
     // display import form
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.scorm_new_version_import.html", "Modules/ScormAicc");
     $this->tpl->setVariable("TYPE_IMG", ilUtil::getImagePath('icon_slm.png'));
     $this->tpl->setVariable("ALT_IMG", $this->lng->txt("obj_sahs"));
     $this->ctrl->setParameter($this, "new_type", "sahs");
     $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $this->tpl->setVariable("BTN_NAME", "newModuleVersionUpload");
     $this->tpl->setVariable("TARGET", ' target="' . ilFrameTargetInfo::_getFrame("MainContent") . '" ');
     $this->tpl->setVariable("TXT_SELECT_LMTYPE", $this->lng->txt("type"));
     if ($type == "scorm2004") {
         $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("lm_type_scorm2004"));
     } else {
         $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("lm_type_scorm"));
     }
     include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
     if (ilUploadFiles::_getUploadDirectory()) {
         $files = ilUploadFiles::_getUploadFiles();
         foreach ($files as $file) {
             $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
             $this->tpl->setCurrentBlock("option_uploaded_file");
             $this->tpl->setVariable("UPLOADED_FILENAME", $file);
             $this->tpl->setVariable("TXT_UPLOADED_FILENAME", $file);
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("select_uploaded_file");
         $this->tpl->setVariable("TXT_SELECT_FROM_UPLOAD_DIR", $this->lng->txt("cont_select_from_upload_dir"));
         $this->tpl->setVariable("TXT_UPLOADED_FILE", $this->lng->txt("cont_uploaded_file"));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable("TXT_UPLOAD", $this->lng->txt("upload"));
     $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
     $this->tpl->setVariable("TXT_IMPORT_LM", $this->lng->txt("import_sahs"));
     $this->tpl->setVariable("TXT_SELECT_FILE", $this->lng->txt("select_file"));
     // gives out the limit as a little notice
     $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice") . " " . $this->getMaxFileSize());
 }