コード例 #1
0
 /**
  * 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'));
 }
コード例 #2
0
 /**
  * get html 
  * @return
  */
 public function getHTML()
 {
     global $lng, $ilUser;
     $lng->loadLanguageModule('content');
     foreach ($this->getSubItemIds(true) as $sub_item) {
         if (is_object($this->getHighlighter()) and strlen($this->getHighlighter()->getContent($this->getObjId(), $sub_item))) {
             $this->tpl->setCurrentBlock('sea_fragment');
             $this->tpl->setVariable('TXT_FRAGMENT', $this->getHighlighter()->getContent($this->getObjId(), $sub_item));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock('subitem');
         $this->tpl->setVariable('SUBITEM_TYPE', $lng->txt('cont_term'));
         $this->tpl->setVariable('SEPERATOR', ':');
         #$this->getItemListGUI()->setChildId($sub_item);
         include_once './Services/Search/classes/class.ilUserSearchCache.php';
         $src_string = ilUserSearchCache::_getInstance($ilUser->getId())->getUrlEncodedQuery();
         $this->tpl->setVariable('LINK', ilLink::_getLink($this->getRefId(), 'git', array('target' => 'git_' . $sub_item . '_' . $this->getRefId(), 'srcstring' => 1)));
         $this->tpl->setVariable('TARGET', $this->getItemListGUI()->getCommandFrame(''));
         $this->tpl->setVariable('TITLE', ilGlossaryTerm::_lookGlossaryTerm($sub_item));
         // begin-patch mime_filter
         if (count($this->getSubItemIds(true)) > 1) {
             $this->parseRelevance($sub_item);
         }
         // end-patch mime_filter
         $this->tpl->parseCurrentBlock();
     }
     $this->showDetailsLink();
     return $this->tpl->get();
 }
コード例 #3
0
 /**
  * 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));
     }
 }
 /**
  * get html 
  * @return
  */
 public function getHTML()
 {
     global $lng;
     $lng->loadLanguageModule('content');
     foreach ($this->getSubItemIds(true) as $sub_item) {
         if (is_object($this->getHighlighter()) and strlen($this->getHighlighter()->getContent($this->getObjId(), $sub_item))) {
             $this->tpl->setCurrentBlock('sea_fragment');
             $this->tpl->setVariable('TXT_FRAGMENT', $this->getHighlighter()->getContent($this->getObjId(), $sub_item));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock('subitem');
         $this->tpl->setVariable('SEPERATOR', ':');
         include_once './Modules/MediaPool/classes/class.ilMediaPoolItem.php';
         switch (ilMediaPoolItem::lookupType($sub_item)) {
             case 'fold':
                 $this->tpl->setVariable('LINK', ilLink::_getLink($this->getRefId(), 'mep', array(), '_' . $sub_item));
                 $this->tpl->setVariable('TARGET', $this->getItemListGUI()->getCommandFrame(''));
                 break;
             case 'mob':
                 $this->tpl->setVariable('LINK', $this->getItemListGUI()->getCommandLink('allMedia') . '&force_filter=' . $sub_item);
                 $this->tpl->setVariable('TARGET', $this->getItemListGUI()->getCommandFrame(''));
                 break;
             default:
         }
         $this->tpl->setVariable('SUBITEM_TYPE', $lng->txt('obj_' . ilMediaPoolItem::lookupType($sub_item)));
         $this->tpl->setVariable('TITLE', ilMediaPoolItem::lookupTitle($sub_item));
         $this->tpl->parseCurrentBlock();
     }
     $this->showDetailsLink();
     return $this->tpl->get();
 }
コード例 #5
0
 /**
  * Fill a single data row.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl;
     if ($a_set["img"] == ilObjectPermissionStatusGUI::IMG_OK) {
         $img_path = ilUtil::getImagePath("icon_ok.svg");
         $img_info = $lng->txt("info_assigned");
     } else {
         $img_path = ilUtil::getImagePath("icon_not_ok.svg");
         $img_info = $lng->txt("info_not_assigned");
     }
     $this->tpl->setVariable("IMG_PATH", $img_path);
     $this->tpl->setVariable("IMG_INFO", $img_info);
     $link = $ilCtrl->getLinkTargetByClass(array(ilpermissiongui), 'perm', '', true);
     $this->tpl->setVariable("ROLE_LINK", $link);
     $this->tpl->setVariable("TXT_ROLE", $a_set["role"]);
     if ($a_set["effective_from"] != "") {
         $this->tpl->setCurrentBlock("effective_from");
         $this->tpl->setVariable("EFFECTIVE_FROM_LINK", ilLink::_getLink($a_set["effective_from_ref_id"]));
         $this->tpl->setVariable("TXT_EFFECTIVE_FROM", $a_set["effective_from"]);
         $this->tpl->parseCurrentBlock();
     }
     if ($a_set["original_position_ref_id"] !== false) {
         $this->tpl->setCurrentBlock("original_position_with_link");
         $this->tpl->setVariable("TXT_ORIGINAL_POSITION_WITH_LINK", $a_set["original_position"]);
         $this->tpl->setVariable("ORIGINAL_POSITION_LINK", ilLink::_getLink($a_set["original_position_ref_id"]));
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setVariable("TXT_ORIGINAL_POSITION", $a_set["original_position"]);
     }
 }
コード例 #6
0
 public function fillRow($set)
 {
     include_once './Services/Link/classes/class.ilLink.php';
     $this->tpl->setVariable('OBJ_LINK', ilLink::_getLink($set['ref_id'], $set['type']));
     $this->tpl->setVariable('OBJ_LINKED_TITLE', $set['title']);
     $this->tpl->setVariable('TYPE_IMG', ilUtil::getTypeIconPath($set['type'], $set['obj_id']));
     $this->tpl->setVariable('TYPE_STR', $this->lng->txt('obj_' . $set['type']));
 }
コード例 #7
0
 /**
  * Fill row
  *
  * @access public
  * @param array row data
  * 
  */
 public function fillRow($a_set)
 {
     include_once './Services/Link/classes/class.ilLink.php';
     $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
     $this->tpl->setVariable('VAL_LINK', ilLink::_getLink($a_set['ref_id'], 'rcrs'));
     $this->tpl->setVariable('VAL_DESC', $a_set['desc']);
     $this->tpl->setVariable('VAL_REMOTE', $a_set['from']);
     $this->tpl->setVariable('VAL_REMOTE_INFO', $a_set['from_info']);
     $this->tpl->setVariable('TXT_EMAIL', $this->lng->txt('ecs_email'));
     $this->tpl->setVariable('TXT_DNS', $this->lng->txt('ecs_dns'));
     $this->tpl->setVariable('TXT_ABR', $this->lng->txt('ecs_abr'));
     $this->tpl->setVariable('VAL_LAST_UPDATE', $a_set['last_update']);
     $this->tpl->setVariable('TXT_TERM', $this->lng->txt('ecs_field_term'));
     $this->tpl->setVariable('TXT_CRS_TYPE', $this->lng->txt('ecs_field_courseType'));
     $this->tpl->setVariable('TXT_CRS_ID', $this->lng->txt('ecs_field_courseID'));
     $this->tpl->setVariable('TXT_CREDITS', $this->lng->txt('ecs_field_credits'));
     $this->tpl->setVariable('TXT_ROOM', $this->lng->txt('ecs_field_room'));
     $this->tpl->setVariable('TXT_CYCLE', $this->lng->txt('ecs_field_cycle'));
     $this->tpl->setVariable('TXT_SWS', $this->lng->txt('ecs_field_semester_hours'));
     $this->tpl->setVariable('TXT_START', $this->lng->txt('ecs_field_begin'));
     $this->tpl->setVariable('TXT_END', $this->lng->txt('ecs_field_end'));
     $this->tpl->setVariable('TXT_LECTURER', $this->lng->txt('ecs_field_lecturer'));
     $sid = array_pop($a_set['sids']);
     include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
     $settings = ilECSDataMappingSettings::getInstanceByServerId($sid);
     include_once "Services/WebServices/ECS/classes/class.ilECSUtils.php";
     $values = ilECSUtils::getAdvancedMDValuesForObjId($a_set['obj_id']);
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'lecturer')) {
         $this->tpl->setVariable('VAL_LECTURER', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'term')) {
         $this->tpl->setVariable('VAL_TERM', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'courseID')) {
         $this->tpl->setVariable('VAL_CRS_ID', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'courseType')) {
         $this->tpl->setVariable('VAL_CRS_TYPE', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'credits')) {
         $this->tpl->setVariable('VAL_CREDITS', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'semester_hours')) {
         $this->tpl->setVariable('VAL_SWS', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'room')) {
         $this->tpl->setVariable('VAL_ROOM', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'cycle')) {
         $this->tpl->setVariable('VAL_CYCLE', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'begin')) {
         $this->tpl->setVariable('VAL_START', isset($values[$field]) ? ilDatePresentation::formatDate(new ilDateTime($values[$field], IL_CAL_UNIX)) : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'end')) {
         $this->tpl->setVariable('VAL_END', isset($values[$field]) ? ilDatePresentation::formatDate(new ilDateTime($values[$field], IL_CAL_UNIX)) : '--');
     }
 }
コード例 #8
0
 /**
  * Create a course mail signature
  * @return 
  */
 protected function createMailSignature()
 {
     $GLOBALS['lng']->loadLanguageModule($this->getCurrentObject()->object->getType());
     $link = chr(13) . chr(10) . chr(13) . chr(10);
     $link .= $this->lng->txt($this->getCurrentObject()->object->getType() . '_mail_permanent_link');
     $link .= chr(13) . chr(10) . chr(13) . chr(10);
     include_once 'Services/Link/classes/class.ilLink.php';
     $link .= ilLink::_getLink($this->getCurrentObject()->object->getRefId());
     return rawurlencode(base64_encode($link));
 }
コード例 #9
0
 function modifyGUI($a_comp, $a_part, $a_par = array())
 {
     global $ilSetting;
     if (!$ilSetting->get('enable_trash')) {
         return "";
     }
     if ($a_part == "tabs") {
         // $a_par["tabs"] is ilTabsGUI object
         global $ilias, $tree, $lng, $ilCtrl, $ilUser;
         if ($ilUser->login == 'anonymous') {
             return "";
         }
         $ref_id = (int) $_GET['ref_id'];
         if ($ref_id == 0) {
             return "";
         }
         if ($_GET['baseClass'] == 'ilMailGUI' and (int) $_GET['mail_id'] != 0 or $_GET['cmd'] == 'mailUser' or $_GET['cmdClass'] == 'ilmailformgui' or $_GET['ref'] == 'mail') {
             //we are in emails
             return "";
         }
         if ($_GET['baseClass'] == 'ilPersonalDesktopGUI' and (int) $_GET['wsp_id'] != 0) {
             //we are in arbeitsraum
             return "";
         }
         global $rbacsystem;
         //if($rbacsystem->checkAccess('edit_permission',$ref_id)){
         try {
             if ($rbacsystem->checkAccess('create_file', $ref_id)) {
                 $objects = $tree->getSavedNodeData($ref_id);
                 if (count($objects) > 0) {
                     include_once 'Services/Link/classes/class.ilLink.php';
                     $link = ilLink::_getLink($ref_id, 'trash', array(), '');
                     //$object=$ilias->obj_factory->getInstanceByRefId($ref_id);
                     global $objDefinition;
                     $obj_type = $ilCtrl->context_obj_type;
                     $class_name = $objDefinition->getClassName($obj_type);
                     $next_class = strtolower("ilObj" . $class_name . "GUI");
                     try {
                         if ($next_class == 'ilobjgui') {
                             return;
                         }
                         $objectgui = new $next_class("", $ref_id, true, false);
                         if ($objectgui != null) {
                             $a_par["tabs"]->addTarget("trash", $objectgui->ctrl->getLinkTarget($objectgui, "trash"), "trash", get_class($objectgui));
                         }
                     } catch (Exception $e) {
                     }
                 }
             }
         } catch (Exception $e) {
         }
     }
 }
コード例 #10
0
 /**
  * Handle target parameter
  * @param object $a_target
  * @return 
  */
 public static function handleCode($a_ref_id, $a_type, $a_code)
 {
     include_once './Services/Link/classes/class.ilLink.php';
     try {
         self::useCode($a_code, $a_ref_id);
         ilUtil::redirect(ilLink::_getLink($a_ref_id, ilObject::_lookupType(ilObject::_lookupObjId($a_ref_id))));
     } catch (Exception $e) {
         $GLOBALS['ilLog']->logStack();
         $GLOBALS['ilLog']->write($e->getMessage());
         ilUtil::redirect(ilLink::_getLink($e->getCode(), ilObject::_lookupType(ilObject::_lookupObjId($e->getCode()))));
     }
 }
 protected function initItems()
 {
     $data = array();
     include_once "Services/Link/classes/class.ilLink.php";
     foreach ($this->obj->getRepositoryTaxonomies() as $tax_id => $objs) {
         foreach ($objs as $obj_id => $obj) {
             $idx = $tax_id . "_" . $obj_id;
             if (!isset($data[$idx])) {
                 $data[$idx] = array("tax_title" => $obj["tax_title"], "obj_title" => $obj["obj_title"], "tax_status" => $obj["tax_status"], "references" => array());
             }
             $path = $obj["path"];
             array_pop($path);
             $path = implode(" › ", $path);
             $data[$idx]["references"][$obj["ref_id"]] = array("path" => $path, "url" => ilLink::_getLink($obj["ref_id"]));
         }
     }
     $this->setData($data);
 }
コード例 #12
0
ファイル: class.ilLink.php プロジェクト: arlendotcn/ilias
 /**
  * Get static link
  *
  * @access public
  * @static
  *
  * @param int reference id
  * @param string object type
  * @param bool fallback to goto.php if robots are disabled
  * @return string goto.html or goto.php link
  */
 public static function _getStaticLink($a_ref_id, $a_type = '', $a_fallback_goto = true, $append = "")
 {
     global $ilObjDataCache;
     if (!strlen($a_type)) {
         $a_type = $ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($a_ref_id));
     }
     include_once 'Services/PrivacySecurity/classes/class.ilRobotSettings.php';
     $robot_settings = ilRobotSettings::_getInstance();
     if (!$robot_settings->robotSupportEnabled()) {
         if ($a_fallback_goto) {
             return ilLink::_getLink($a_ref_id, $a_type, array(), $append);
         } else {
             return false;
         }
     }
     // urlencode for append is needed e.g. to process "/" in wiki page names correctly
     return ILIAS_HTTP_PATH . '/goto_' . urlencode(CLIENT_ID) . '_' . $a_type . '_' . $a_ref_id . urlencode($append) . '.html';
 }
コード例 #13
0
 function modifyGUI($a_comp, $a_part, $a_par = array())
 {
     if ($a_part == "tabs") {
         // $a_par["tabs"] is ilTabsGUI object
         global $ilias, $tree, $lng, $ilTabs;
         $ref_id = (int) $_GET['ref_id'];
         if ($_GET['baseClass'] == 'ilMailGUI' and (int) $_GET['mail_id'] != 0 or $_GET['cmd'] == 'mailUser' or $_GET['cmdClass'] == 'ilmailformgui' or $_GET['ref'] == 'mail') {
             //we are in emails
             $a_par["tabs"]->setBackTarget($lng->txt("back"), 'ilias.php?cmdClass=ilmailfoldergui&baseClass=ilMailGUI');
             return "";
         }
         if ($_GET['baseClass'] == 'ilPersonalDesktopGUI' and (int) $_GET['wsp_id'] != 0) {
             //we are in arbeitsraum
             return "";
         }
         //print $tree->table_tree;
         if ($ref_id == 0) {
             return "";
         }
         //$obj_type=$a_par["tabs"]->tpl->header_action_ref_id->ctrl->context_obj_type;
         //$parent_id = $a_par["tabs"]->tpl->header_action_ref_id->tree->getParentId($ref_id);
         $parent_id = $tree->getParentId($ref_id);
         $object = $ilias->obj_factory->getInstanceByRefId($ref_id);
         $obj_type = $object->getType();
         $obj_types_with_backlinks = array('cat', 'fold', 'crs', 'grp', 'file', 'wiki', 'frm', 'webr', 'mcst', 'glo', 'exc', 'tst', 'mep', 'qpl', 'book', 'htlm', 'sahs', 'dbk', 'dcl', 'xstr');
         //print_r($_GET['ref_id']);exit;
         //print '-'.$obj_type.'-'.count($a_par["tabs"]->target);
         if (count($a_par["tabs"]->target) > 0 and in_array($obj_type, $obj_types_with_backlinks)) {
             // This function only works with a hslu-patch
             if (method_exists($ilTabs, 'hasBackTarget')) {
                 if ($ilTabs->hasBackTarget()) {
                     return "";
                 }
             }
             $parentobject = $ilias->obj_factory->getInstanceByRefId($parent_id);
             include_once 'Services/Link/classes/class.ilLink.php';
             $link = ilLink::_getLink($parent_id, $parentobject->getType(), array(), '');
             $a_par["tabs"]->setBackTarget($lng->txt("back"), $link);
         }
     }
 }
コード例 #14
0
 public function getTableGUIData($a_parent_ref_id)
 {
     $data = array();
     $parent_type = ilObject::_lookupType($a_parent_ref_id, true);
     include_once './Services/Link/classes/class.ilLink.php';
     foreach ($this->getPossibleItems($a_parent_ref_id) as $item) {
         $tmp = array();
         $tmp['id'] = $item['obj_id'];
         $tmp['ref_id'] = 0;
         $tmp['title'] = $item['title'];
         $tmp['type'] = $item['type'];
         $tmp['status'] = $this->isAssignedEntry($item['obj_id']);
         // #12158
         $tmp['url'] = ilLink::_getLink($a_parent_ref_id, $parent_type, null, "_" . $tmp['id']);
         if ($this->mode == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
             $tmp['tlt'] = $item['tlt'];
         }
         $data[] = $tmp;
     }
     return $data;
 }
コード例 #15
0
 public function send()
 {
     include_once './Services/Link/classes/class.ilLink.php';
     $obj = new ilObjectFactory();
     $instance = $obj->getInstanceByRefId($_GET['ref_id']);
     $link = ilLink::_getLink($_GET['ref_id'], $instance->getType(), array(), '');
     global $lng;
     foreach ($this->getRecipients() as $rcp) {
         $this->initLanguage($rcp);
         $this->initMail();
         $this->setSubject(sprintf($lng->txt('rubric_exercise_graded') . ' ' . ilObject::_lookupTitle($this->getObjId()) . ' ' . $lng->txt('rubric_is_now_available'), $this->getObjectTitle(true)));
         $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
         $this->appendBody("\n\n");
         $this->appendBody($lng->txt('rubric_exercise_graded') . ' ' . ilObject::_lookupTitle($this->getObjId()) . ' ' . $lng->txt('rubric_is_now_available'));
         $this->appendBody("\n");
         $this->appendBody($this->getLanguageText('obj_exc') . ": " . $this->getObjectTitle(true));
         $this->appendBody("\n");
         $this->appendBody("\n\n");
         $this->appendBody($link);
         $this->getMail()->appendInstallationSignature(true);
         $this->sendMail(array($rcp), array('system'));
     }
 }
コード例 #16
0
 /**
  * Clone single (not container object)
  * Method is overwritten in ilContainerGUI
  *
  * @access public
  */
 public function cloneAllObject()
 {
     include_once './Services/Link/classes/class.ilLink.php';
     include_once 'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
     global $ilErr, $ilUser;
     $new_type = $_REQUEST['new_type'];
     if (!$this->checkPermissionBool("create", "", $new_type)) {
         $ilErr->raiseError($this->lng->txt('permission_denied'));
     }
     if (!(int) $_REQUEST['clone_source']) {
         ilUtil::sendFailure($this->lng->txt('select_one'));
         $this->createObject();
         return false;
     }
     if (!$this->checkPermissionBool("write", "", $new_type, (int) $_REQUEST['clone_source'])) {
         $ilErr->raiseError($this->lng->txt('permission_denied'));
     }
     // Save wizard options
     $copy_id = ilCopyWizardOptions::_allocateCopyId();
     $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
     $wizard_options->saveOwner($ilUser->getId());
     $wizard_options->saveRoot((int) $_REQUEST['clone_source']);
     $options = $_POST['cp_options'] ? $_POST['cp_options'] : array();
     foreach ($options as $source_id => $option) {
         $wizard_options->addEntry($source_id, $option);
     }
     $wizard_options->read();
     $orig = ilObjectFactory::getInstanceByRefId((int) $_REQUEST['clone_source']);
     $new_obj = $orig->cloneObject((int) $_GET['ref_id'], $copy_id);
     // Delete wizard options
     $wizard_options->deleteAll();
     ilUtil::sendSuccess($this->lng->txt("object_duplicated"), true);
     ilUtil::redirect(ilLink::_getLink($new_obj->getRefId()));
 }
コード例 #17
0
 public function mailMembersObject()
 {
     global $rbacreview, $ilObjDataCache;
     include_once 'Services/AccessControl/classes/class.ilObjRole.php';
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_members.html', 'Services/Contact');
     $this->__setSubTabs('members');
     include_once "./Services/Link/classes/class.ilLink.php";
     $link_to_seminar = ilLink::_getLink($this->object->getRefId());
     include_once 'Services/Mail/classes/class.ilMail.php';
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     $this->tpl->setVariable("MAILACTION", ilMailFormCall::getLinkTarget($this, 'mailMembers', array(), array('type' => 'role')));
     $this->tpl->setVariable('ADDITIONAL_MESSAGE_TEXT', $link_to_seminar);
     $this->tpl->setVariable('IMG_ARROW', ilUtil::getImagePath('arrow_downright.png'));
     $this->tpl->setVariable('OK', $this->lng->txt('ok'));
     $role_folder = $rbacreview->getRoleFolderOfObject($this->object->getRefId());
     $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder['ref_id'], false);
     foreach ($role_ids as $role_id) {
         $this->tpl->setCurrentBlock('mailbox_row');
         $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
         $this->tpl->setVariable('CHECK_MAILBOX', ilUtil::formCheckbox(1, 'roles[]', htmlspecialchars($role_addr)));
         if (ilMail::_usePearMail()) {
             // if pear mail is enabled, mailbox addresses are already localized in the language of the user
             $this->tpl->setVariable('MAILBOX', $role_addr);
         } else {
             // if pear mail is not enabled, we need to localize mailbox addresses in the language of the user
             $this->tpl->setVariable('MAILBOX', ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)) . ' (' . $role_addr . ')');
         }
         $this->tpl->parseCurrentBlock();
     }
 }
コード例 #18
0
 public static function getAvailablePortfolioLinksForUserIds(array $a_owner_ids, $a_back_url = null)
 {
     $res = array();
     include_once "Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php";
     $access_handler = new ilPortfolioAccessHandler();
     $params = null;
     if ($a_back_url) {
         $params = array("back_url" => rawurlencode($a_back_url));
     }
     include_once "Services/Link/classes/class.ilLink.php";
     foreach ($access_handler->getShardObjectsDataForUserIds($a_owner_ids) as $owner_id => $items) {
         foreach ($items as $id => $title) {
             $url = ilLink::_getLink($id, 'prtf', $params);
             $res[$owner_id][$url] = $title;
         }
     }
     return $res;
 }
コード例 #19
0
 /**
  * @param ilTabsGUI $ilTabs
  */
 protected function addBackTab(ilTabsGUI $ilTabs)
 {
     if ($_GET["calling_test"] > 0 || $_GET["test_ref_id"] > 0) {
         $ref_id = $_GET["calling_test"];
         if (strlen($ref_id) == 0) {
             $ref_id = $_GET["test_ref_id"];
         }
         if (!$_GET['test_express_mode'] && !$GLOBALS['___test_express_mode']) {
             $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), "ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id={$ref_id}");
         } else {
             $link = ilTestExpressPage::getReturnToPageLink();
             $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), $link);
         }
     } else {
         if (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) {
             $ref_id = (int) $_GET['calling_consumer'];
             $consumer = ilObjectFactory::getInstanceByRefId($ref_id);
             if ($consumer instanceof ilQuestionEditingFormConsumer) {
                 $ilTabs->setBackTarget($consumer->getQuestionEditingFormBackTargetLabel(), $consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
             } else {
                 require_once 'Services/Link/classes/class.ilLink.php';
                 $ilTabs->setBackTarget($this->lng->txt("qpl"), ilLink::_getLink($ref_id));
             }
         } else {
             $ilTabs->setBackTarget($this->lng->txt("qpl"), $this->ctrl->getLinkTargetByClass("ilobjquestionpoolgui", "questions"));
         }
     }
 }
コード例 #20
0
ファイル: class.ilWikiUtil.php プロジェクト: arlendotcn/ilias
 static function sendNotification($a_action, $a_type, $a_wiki_ref_id, $a_page_id, $a_comment = null)
 {
     global $ilUser, $ilObjDataCache, $ilAccess;
     include_once "./Services/Notification/classes/class.ilNotification.php";
     include_once "./Modules/Wiki/classes/class.ilObjWiki.php";
     include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
     $wiki_id = $ilObjDataCache->lookupObjId($a_wiki_ref_id);
     $wiki = new ilObjWiki($a_wiki_ref_id, true);
     $page = new ilWikiPage($a_page_id);
     // #11138
     $ignore_threshold = $a_action == "comment";
     // 1st update will be converted to new - see below
     if ($a_action == "new") {
         return;
     }
     if ($a_type == ilNotification::TYPE_WIKI_PAGE) {
         $users = ilNotification::getNotificationsForObject($a_type, $a_page_id, null, $ignore_threshold);
         $wiki_users = ilNotification::getNotificationsForObject(ilNotification::TYPE_WIKI, $wiki_id, $a_page_id, $ignore_threshold);
         $users = array_merge($users, $wiki_users);
         if (!sizeof($users)) {
             return;
         }
         ilNotification::updateNotificationTime(ilNotification::TYPE_WIKI_PAGE, $a_page_id, $users);
     } else {
         $users = ilNotification::getNotificationsForObject(ilNotification::TYPE_WIKI, $wiki_id, $a_page_id, $ignore_threshold);
         if (!sizeof($users)) {
             return;
         }
     }
     ilNotification::updateNotificationTime(ilNotification::TYPE_WIKI, $wiki_id, $users, $a_page_id);
     // #15192 - should always be present
     if ($a_page_id) {
         include_once "./Modules/Wiki/classes/class.ilObjWikiGUI.php";
         $link = ILIAS_HTTP_PATH . "/" . ilObjWikiGui::getGotoLink($a_wiki_ref_id, $page->getTitle());
     } else {
         include_once "./Services/Link/classes/class.ilLink.php";
         $link = ilLink::_getLink($a_wiki_ref_id);
     }
     include_once "./Services/Mail/classes/class.ilMail.php";
     include_once "./Services/User/classes/class.ilObjUser.php";
     include_once "./Services/Language/classes/class.ilLanguageFactory.php";
     include_once "./Services/User/classes/class.ilUserUtil.php";
     // see ilBlogPostingGUI::getSnippet()
     // see ilBlogPosting::getNotificationAbstract()
     include_once "Modules/Wiki/classes/class.ilWikiPageGUI.php";
     $pgui = new ilWikiPageGUI($page->getId());
     $pgui->setRawPageContent(true);
     $pgui->setAbstractOnly(true);
     $pgui->setFileDownloadLink(".");
     $pgui->setFullscreenLink(".");
     $pgui->setSourcecodeDownloadScript(".");
     $snippet = $pgui->showPage();
     $snippet = ilPageObject::truncateHTML($snippet, 500, "...");
     // making things more readable
     $snippet = str_replace('<br/>', "\n", $snippet);
     $snippet = str_replace('<br />', "\n", $snippet);
     $snippet = str_replace('</p>', "\n", $snippet);
     $snippet = str_replace('</div>', "\n", $snippet);
     $snippet = trim(strip_tags($snippet));
     // "fake" new (to enable snippet - if any)
     $current_version = array_shift($page->getHistoryEntries());
     $current_version = $current_version["nr"];
     if (!$current_version) {
         $a_type = ilNotification::TYPE_WIKI;
         $a_action = "new";
     }
     foreach (array_unique($users) as $idx => $user_id) {
         if ($user_id != $ilUser->getId() && $ilAccess->checkAccessOfUser($user_id, 'read', '', $a_wiki_ref_id)) {
             // use language of recipient to compose message
             $ulng = ilLanguageFactory::_getLanguageOfUser($user_id);
             $ulng->loadLanguageModule('wiki');
             $subject = sprintf($ulng->txt('wiki_change_notification_subject'), $wiki->getTitle(), $page->getTitle());
             $message = sprintf($ulng->txt('wiki_change_notification_salutation'), ilObjUser::_lookupFullname($user_id)) . "\n\n";
             if ($a_type == ilNotification::TYPE_WIKI_PAGE) {
                 // update/delete
                 $message .= $ulng->txt('wiki_change_notification_page_body_' . $a_action) . ":\n\n";
                 $message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
                 $message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
                 $message .= $ulng->txt('wiki_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n";
                 if ($snippet) {
                     $message .= "\n" . $ulng->txt('content') . "\n" . "----------------------------------------\n" . $snippet . "\n" . "----------------------------------------\n";
                 }
                 // include comment/note text
                 if ($a_comment) {
                     $message .= "\n" . $ulng->txt('comment') . ":\n\"" . trim($a_comment) . "\"\n";
                 }
                 $message .= "\n" . $ulng->txt('wiki_change_notification_page_link') . ": " . $link;
             } else {
                 // new
                 $message .= $ulng->txt('wiki_change_notification_body_' . $a_action) . ":\n\n";
                 $message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
                 $message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
                 $message .= $ulng->txt('wiki_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n\n";
                 if ($snippet) {
                     $message .= $ulng->txt('content') . "\n" . "----------------------------------------\n" . $snippet . "\n" . "----------------------------------------\n\n";
                 }
                 $message .= $ulng->txt('wiki_change_notification_link') . ": " . $link;
             }
             $mail_obj = new ilMail(ANONYMOUS_USER_ID);
             $mail_obj->appendInstallationSignature(true);
             $mail_obj->sendMail(ilObjUser::_lookupLogin($user_id), "", "", $subject, $message, array(), array("system"));
         } else {
             unset($users[$idx]);
         }
     }
 }
コード例 #21
0
 protected function initMemberView()
 {
     global $lng;
     include_once './Services/Link/classes/class.ilLink.php';
     $url = ilLink::_getLink((int) $_GET['ref_id'], ilObject::_lookupType(ilObject::_lookupObjId((int) $_GET['ref_id'])), array('mv' => 0));
     $this->setMode(self::MODE_TOPBAR_MEMBERVIEW);
     $this->setTopBarBack($url, $lng->txt('mem_view_close'));
 }
コード例 #22
0
 /**
  * Render suggested resources
  *
  * @param
  * @return
  */
 function renderSuggestedResources($a_tpl, $a_levels, $a_base_skill, $a_tref_id)
 {
     global $lng;
     if ($this->getProfileId() == 0) {
         return;
     }
     $profile = new ilSkillProfile($this->getProfileId());
     $profile_levels = $profile->getSkillLevels();
     $too_low = true;
     $current_target_level = 0;
     foreach ($a_levels as $k => $v) {
         foreach ($this->profile_levels as $pl) {
             if ($pl["level_id"] == $v["id"] && $pl["base_skill_id"] == $v["skill_id"]) {
                 $too_low = true;
                 $current_target_level = $v["id"];
             }
         }
         if ($this->actual_levels[$v["skill_id"]][0] == $v["id"]) {
             $too_low = false;
         }
     }
     // suggested resources
     if ($too_low) {
         include_once "./Services/Skill/classes/class.ilSkillResources.php";
         $skill_res = new ilSkillResources($a_base_skill, $a_tref_id);
         $res = $skill_res->getResources();
         $imp_resources = array();
         foreach ($res as $level) {
             foreach ($level as $r) {
                 if ($r["imparting"] == true && $current_target_level == $r["level_id"]) {
                     $imp_resources[] = $r;
                 }
             }
         }
         foreach ($imp_resources as $r) {
             $ref_id = $r["rep_ref_id"];
             $obj_id = ilObject::_lookupObjId($ref_id);
             $title = ilObject::_lookupTitle($obj_id);
             include_once "./Services/Link/classes/class.ilLink.php";
             $a_tpl->setCurrentBlock("resource_item");
             $a_tpl->setVariable("TXT_RES", $title);
             $a_tpl->setVariable("HREF_RES", ilLink::_getLink($ref_id));
             $a_tpl->parseCurrentBlock();
         }
         if (count($imp_resources) > 0) {
             $a_tpl->touchBlock("resources_list");
             $a_tpl->setCurrentBlock("resources");
             $a_tpl->setVariable("SUGGESTED_MAT_MESS", $lng->txt("skmg_skill_needs_impr_res"));
             $a_tpl->parseCurrentBlock();
         } else {
             $a_tpl->setCurrentBlock("resources");
             $a_tpl->setVariable("SUGGESTED_MAT_MESS", $lng->txt("skmg_skill_needs_impr_no_res"));
             $a_tpl->parseCurrentBlock();
         }
     } else {
         $a_tpl->setCurrentBlock("resources");
         $a_tpl->setVariable("SUGGESTED_MAT_MESS", $lng->txt("skmg_skill_no_needs_impr"));
         $a_tpl->parseCurrentBlock();
     }
 }
コード例 #23
0
 /**
  * creates a permanent link
  * @param $a_obj_id
  * @param $a_usr_id
  * @param $a_obj_type
  * @return string goto link
  */
 protected function createPermanentLink($a_obj_id, $a_usr_id, $a_obj_type)
 {
     global $ilAccess;
     $ref_ids = ilObject::_getAllReferences($a_obj_id);
     $ref_id = null;
     foreach ((array) $ref_ids as $id) {
         if ($ilAccess->checkAccessOfUser($a_usr_id, "read", "", $id, $a_obj_type, $a_obj_id)) {
             $ref_id = $id;
         }
     }
     if ($ref_id === null) {
         return false;
     }
     include_once './Services/Link/classes/class.ilLink.php';
     return ilLink::_getLink($ref_id, $a_obj_type);
 }
コード例 #24
0
 protected function getMemberViewHTML()
 {
     global $lng;
     $this->tpl = new ilTemplate('tpl.member_view_main_menu.html', true, true, 'Services/MainMenu');
     $this->tpl->setVariable('TXT_MM_HEADER', $lng->txt('mem_view_long'));
     $this->tpl->setVariable('TXT_MM_CLOSE_PREVIEW', $lng->txt('mem_view_close'));
     $this->tpl->setVariable('MM_CLOSE_IMG', ilUtil::getImagePath('cancel.png'));
     include_once './Services/Link/classes/class.ilLink.php';
     $this->tpl->setVariable('HREF_CLOSE_MM', ilLink::_getLink((int) $_GET['ref_id'], ilObject::_lookupType(ilObject::_lookupObjId((int) $_GET['ref_id'])), array('mv' => 0)));
     return $this->tpl->get();
 }
コード例 #25
0
 /**
  * Goto item group
  */
 function gotoParent()
 {
     global $ilAccess, $ilErr, $lng, $tree;
     $ref_id = $this->object->getRefId();
     $par_id = $tree->getParentId($ref_id);
     if ($ilAccess->checkAccess("read", "", $par_id)) {
         include_once "./Services/Link/classes/class.ilLink.php";
         ilUtil::redirect(ilLink::_getLink($par_id));
         exit;
     }
 }
コード例 #26
0
 public function sendUserResultsMail($a_active_id, $a_recipient)
 {
     global $ilUser;
     $finished = $this->object->getSurveyParticipants(array($a_active_id));
     $finished = array_pop($finished);
     $finished = ilDatePresentation::formatDate(new ilDateTime($finished["finished_tstamp"], IL_CAL_UNIX));
     require_once "Services/Mail/classes/class.ilMail.php";
     require_once "Services/Link/classes/class.ilLink.php";
     $body = ilMail::getSalutation($ilUser->getId()) . "\n\n";
     $body .= $this->lng->txt("svy_mail_own_results_body") . "\n";
     $body .= "\n" . $this->lng->txt("obj_svy") . ": " . $this->object->getTitle() . "\n";
     $body .= ilLink::_getLink($this->object->getRefId(), "svy") . "\n";
     $body .= "\n" . $this->lng->txt("survey_results_finished") . ": " . $finished . "\n\n";
     $body .= $this->getUserResultsPlain($a_active_id);
     // $body .= ilMail::_getAutoGeneratedMessageString($this->lng);
     $body .= ilMail::_getInstallationSignature();
     require_once "Services/Mail/classes/class.ilMail.php";
     $mail = new ilMail(ANONYMOUS_USER_ID);
     $mail->sendMimeMail($a_recipient, null, null, sprintf($this->lng->txt("svy_mail_own_results_subject"), $this->object->getTitle()), $body, null, true);
 }
コード例 #27
0
 /**
  * list questions of question pool
  */
 function questionsObject()
 {
     global $rbacsystem, $ilUser, $ilCtrl, $ilDB, $lng, $ilPluginAdmin;
     if (get_class($this->object) == "ilObjTest") {
         if ($_GET["calling_test"] > 0) {
             $ref_id = $_GET["calling_test"];
             $q_id = $_GET["q_id"];
             if ($_REQUEST['test_express_mode']) {
                 if ($q_id) {
                     ilUtil::redirect("ilias.php?ref_id=" . $ref_id . "&q_id=" . $q_id . "&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
                 } else {
                     ilUtil::redirect("ilias.php?ref_id=" . $ref_id . "&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
                 }
             } else {
                 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&ref_id=" . $ref_id . "&cmd=questions");
             }
         }
     } else {
         if (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) {
             $ref_id = (int) $_GET['calling_consumer'];
             $consumer = ilObjectFactory::getInstanceByRefId($ref_id);
             if ($consumer instanceof ilQuestionEditingFormConsumer) {
                 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
             }
             require_once 'Services/Link/classes/class.ilLink.php';
             ilUtil::redirect(ilLink::_getLink($ref_id));
         }
     }
     $this->object->purgeQuestions();
     // reset test_id SESSION variable
     $_SESSION["test_id"] = "";
     require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
     $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
     $table_gui = $this->buildQuestionBrowserTableGUI($taxIds);
     $table_gui->setPreventDoubleSubmission(false);
     if ($rbacsystem->checkAccess('write', $_GET['ref_id'])) {
         $toolbar = new ilToolbarGUI();
         $toolbar->addButton($this->lng->txt("ass_create_question"), $this->ctrl->getLinkTarget($this, 'createQuestionForm'));
         $this->tpl->setContent($this->ctrl->getHTML($toolbar) . $this->ctrl->getHTML($table_gui));
     } else {
         $this->tpl->setContent($this->ctrl->getHTML($table_gui));
     }
     if ($this->object->getShowTaxonomies()) {
         $this->lng->loadLanguageModule('tax');
         require_once 'Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php';
         foreach ($taxIds as $taxId) {
             if ($taxId != $this->object->getNavTaxonomyId()) {
                 continue;
             }
             $taxExp = new ilTaxonomyExplorerGUI($this, 'showNavTaxonomy', $taxId, 'ilobjquestionpoolgui', 'questions');
             if (!$taxExp->handleCommand()) {
                 $this->tpl->setLeftContent($taxExp->getHTML() . "&nbsp;");
             }
             break;
         }
     }
 }
コード例 #28
0
 function __renderItem($item, $level)
 {
     global $ilUser, $ilAccess;
     include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
     include_once './Services/Link/classes/class.ilLink.php';
     include_once './Services/MetaData/classes/class.ilMDEducational.php';
     if (!$ilAccess->checkAccess('visible', '', $item['ref_id'])) {
         return false;
     }
     $this->lng->loadLanguageModule('meta');
     $usr_planed = new ilTimingPlaned($item['ref_id'], $ilUser->getId());
     for ($i = 0; $i < $level; $i++) {
         $this->tpl->touchBlock('start_indent');
         $this->tpl->touchBlock('end_indent');
     }
     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();
     }
     if ($ilAccess->checkAccess('read', '', $item['ref_id'])) {
         $this->tpl->setCurrentBlock("title_as_link");
         $this->tpl->setVariable("TITLE_LINK", ilLink::_getLink($item['ref_id'], $item['type']));
         $this->tpl->setVariable("TITLE_NAME", $item['title']);
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setCurrentBlock("title_plain");
         $this->tpl->setVariable("TITLE", $item['title']);
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setCurrentBlock("container_standard_row");
     if (isset($this->invalid["{$item['ref_id']}"])) {
         $this->tpl->setVariable("ROWCLASS", 'tblrowmarked');
     } else {
         $this->tpl->setVariable("ROWCLASS", ilUtil::switchColor($this->counter++, 'tblrow1', 'tblrow2'));
     }
     #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.png'));
     $this->tpl->setVariable('TYPE_IMG', ilUtil::getTypeIconPath($item['type'], $item['obj_id'], 'small'));
     $this->tpl->setVariable("TYPE_ALT_IMG", $this->lng->txt('obj_' . $item['type']));
     if ($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) {
         $this->tpl->setVariable('SUG_START', ilDatePresentation::formatDate(new ilDate($item['suggestion_start'], IL_CAL_UNIX)));
         $this->tpl->setVariable('SUG_END', ilDatePresentation::formatDate(new ilDate($item['suggestion_end'], IL_CAL_UNIX)));
     }
     if ($item['changeable']) {
         $item_prefix = "item[" . $item['ref_id'] . ']';
         if (is_array($_POST['item']["{$item['ref_id']}"]['own_start'])) {
             #echo "Start post<br>";
             $start = $this->__toUnix($_POST['item']["{$item['ref_id']}"]['own_start']);
         } elseif ($usr_planed->getPlanedStartingTime()) {
             #echo "Own start<br>";
             $start = $usr_planed->getPlanedStartingTime();
         } else {
             #echo "Empfehlung start<br>";
             $start = $item['suggestion_start'];
         }
         $date = $this->__prepareDateSelect($start);
         $this->tpl->setVariable("OWN_START", ilUtil::makeDateSelect($item_prefix . "[own_start]", $date['y'], $date['m'], $date['d'], date('Y', time()), false));
         if ($usr_planed->getPlanedEndingTime()) {
             #echo "Own End<br>";
             $end = $usr_planed->getPlanedEndingTime();
         } else {
             #echo "Empfehlung end<br>";
             $end = $item['suggestion_end'];
         }
         $this->tpl->setVariable('OWN_END', ilDatePresentation::formatDate(new ilDate($end, IL_CAL_UNIX)));
         $this->tpl->setVariable("NAME_DURATION", $item_prefix . "[duration]");
         // Duration
         if (isset($_POST['item']["{$item['ref_id']}"]['duration'])) {
             $this->tpl->setVariable("VAL_DURATION", $_POST['item']["{$item['ref_id']}"]['duration']);
         } else {
             $this->tpl->setVariable("VAL_DURATION", intval(($end - $start) / (60 * 60 * 24)));
         }
         $this->tpl->setVariable('LIM_START', ilDatePresentation::formatDate(new ilDate($item['earliest_start'], IL_CAL_UNIX)));
         $this->tpl->setVariable('LIM_END', ilDatePresentation::formatDate(new ilDate($item['latest_end'], IL_CAL_UNIX)));
     }
     $this->tpl->parseCurrentBlock();
     if (!$_SESSION['crs_timings_user_hidden']) {
         return true;
     }
     foreach (ilObjectActivation::getTimingsItems($item['ref_id']) as $item_data) {
         $this->__renderItem($item_data, $level + 1);
     }
 }
コード例 #29
0
 /**
  * Show links to references
  * @param int $a_obj_id $obj_id
  * @return
  */
 protected function addReferenceLinks($a_obj_id)
 {
     global $tree;
     $tpl = new ilTemplate('tpl.cal_reference_links.html', true, true, 'Services/Calendar');
     foreach (ilObject::_getAllReferences($a_obj_id) as $ref_id => $ref_id) {
         include_once './Services/Link/classes/class.ilLink.php';
         $parent_ref_id = $tree->getParentId($ref_id);
         $parent_obj_id = ilObject::_lookupObjId($parent_ref_id);
         $parent_type = ilObject::_lookupType($parent_obj_id);
         $parent_title = ilObject::_lookupTitle($parent_obj_id);
         $type = ilObject::_lookupType($a_obj_id);
         $title = ilObject::_lookupTitle($a_obj_id);
         $tpl->setCurrentBlock('reference');
         $tpl->setVariable('PIMG_SRC', ilUtil::getTypeIconPath($parent_type, $parent_obj_id, 'tiny'));
         $tpl->setVariable('PIMG_ALT', $this->lng->txt('obj_' . $parent_type));
         $tpl->setVariable('PARENT_TITLE', $parent_title);
         $tpl->setVariable('PARENT_HREF', ilLink::_getLink($parent_ref_id));
         $tpl->setVariable('SRC', ilUtil::getTypeIconPath($type, $a_obj_id, 'tiny'));
         $tpl->setVariable('ALT', $this->lng->txt('obj_' . $type));
         $tpl->setVariable('TITLE', $title);
         $tpl->setVariable('HREF', ilLink::_getLink($ref_id));
         $tpl->parseCurrentBlock();
     }
     return $tpl->get();
 }
コード例 #30
0
 /**
  * Build url from calendar entry
  * @param ilCalendarEntry $entry
  * @return string
  */
 protected function buildAppointmentUrl(ilCalendarEntry $entry)
 {
     $cat = ilCalendarCategory::getInstanceByCategoryId(current((array) ilCalendarCategoryAssignments::_lookupCategories($entry->getEntryId())));
     if ($cat->getType() != ilCalendarCategory::TYPE_OBJ) {
         $this->writer->addLine('URL;VALUE=URI:' . ILIAS_HTTP_PATH);
     } else {
         $refs = ilObject::_getAllReferences($cat->getObjId());
         include_once './Services/Link/classes/class.ilLink.php';
         $this->writer->addLine('URL;VALUE=URI:' . ilLink::_getLink(current((array) $refs)));
     }
 }