/**
  * 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();
 }
 /**
  * get html 
  * @return
  */
 public function getHTML()
 {
     global $lng;
     $lng->loadLanguageModule('webr');
     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('webr'));
         $this->tpl->setVariable('SEPERATOR', ':');
         $link_data = ilLinkResourceItems::lookupItem($this->getObjId(), $sub_item);
         $link_data = ilParameterAppender::_append($link_data);
         // handle internal links (#10620)
         if (stristr($link_data["target"], "|")) {
             $parts = explode("|", $link_data["target"]);
             if ($parts[0] == "page") {
                 $parts[0] = "pg";
             }
             if ($parts[0] == "term") {
                 $parts[0] = "git";
             }
             $link_data["target"] = ilLink::_getStaticLink($parts[1], $parts[0]);
         }
         #$this->getItemListGUI()->setChildId($sub_item);
         $this->tpl->setVariable('LINK', $link_data['target']);
         $this->tpl->setVariable('TARGET', '_blank');
         $this->tpl->setVariable('TITLE', $link_data['title']);
         $this->tpl->parseCurrentBlock();
     }
     $this->showDetailsLink();
     return $this->tpl->get();
 }
 /**
  * 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();
 }
 /**
  * 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"]);
     }
 }
 /**
  * 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'));
 }
Exemplo n.º 7
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']));
 }
 /**
  * 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)) : '--');
     }
 }
 /**
  * @param array $row
  */
 public function fillRow(array $row)
 {
     /**
      * @var $ilAccess ilAccessHandler
      */
     global $ilAccess;
     $this->tpl->setVariable('USAGE_INSTANCE_TITLE', $row['title']);
     $this->tpl->setVariable('USAGE_AUTHOR', $row['author']);
     $this->tpl->setVariable('USAGE_PATH', $row['path']);
     if ($ilAccess->checkAccess('read', '', $row['ref_id']) && !$row['is_trashed']) {
         $link = new ilLink();
         $this->tpl->setVariable('USAGE_INSTANCE_LINKTED_TITLE', $row['title']);
         $this->tpl->setVariable('USAGE_INSTANCE_HREF', $link->_getStaticLink($row['ref_id'], 'tst'));
         $this->tpl->setCurrentBlock('linked_title_b');
         $this->tpl->touchBlock('linked_title_b');
         $this->tpl->parseCurrentBlock();
     }
 }
Exemplo n.º 10
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));
 }
 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) {
         }
     }
 }
 /**
  * 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()))));
     }
 }
 /**
  * Parse and send mail
  * @return 
  */
 public function send()
 {
     switch ($this->getType()) {
         case self::TYPE_NOTIFICATION_APPROVERS:
             foreach ($this->getRecipients() as $rcp) {
                 $this->initLanguage($rcp);
                 $this->initMail();
                 $this->setSubject($this->getLanguageText('reg_mail_new_user'));
                 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
                 $this->appendBody("\n\n");
                 $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
                 $this->appendBody("\n\n");
                 $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
                 $info = $this->getAdditionalInformation();
                 $this->appendBody("\n\n");
                 $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
                 $this->appendBody("\n\n");
                 $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
                 $this->getMail()->appendInstallationSignature(true);
                 $this->getMail()->enableSoap(false);
                 $this->sendMail(array($rcp), array('system'));
             }
             break;
         case self::TYPE_NOTIFICATION_CONFIRMATION:
             foreach ($this->getRecipients() as $rcp) {
                 $this->initLanguage($rcp);
                 $this->initMail();
                 $this->setSubject($this->getLanguageText('reg_mail_new_user_confirmation'));
                 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
                 $this->appendBody("\n\n");
                 $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
                 $this->appendBody("\n\n");
                 $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
                 $info = $this->getAdditionalInformation();
                 $this->appendBody("\n\n");
                 $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
                 $this->appendBody("\n\n");
                 $this->appendBody($this->getLanguageText('reg_mail_body_confirmation'));
                 $this->appendBody("\n");
                 // #4527
                 include_once "Services/Link/classes/class.ilLink.php";
                 $this->appendBody(ilLink::_getStaticLink($info['usr']->getId(), "usrf"));
                 $this->appendBody("\n\n");
                 $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
                 $this->getMail()->appendInstallationSignature(true);
                 $this->getMail()->enableSoap(false);
                 $this->sendMail(array($rcp), array('system'));
             }
             break;
     }
 }
Exemplo n.º 14
0
 /**
  * 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';
 }
 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);
 }
Exemplo n.º 16
0
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $lng, $ilAccess, $tpl, $ilNavigationHistory;
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     if ($next_class == "") {
         $this->ctrl->setCmdClass("ilobjwikigui");
         $next_class = $this->ctrl->getNextClass($this);
     }
     // add entry to navigation history
     if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
         $title = ilObject::_lookupTitle($obj_id);
         if ($_GET["page"] != "") {
             $page = $_GET["page"];
         } else {
             include_once "./Modules/Wiki/classes/class.ilObjWiki.php";
             $page = ilObjWiki::_lookupStartPage($obj_id);
         }
         include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
         if (ilWikiPage::exists($obj_id, $page)) {
             include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
             $add = "_" . rawurlencode($page);
             $page_id = ilWikiPage::getPageIdForTitle($obj_id, $page);
             $ptitle = ilWikiPage::lookupTitle($page_id);
             $title .= ": " . $ptitle;
             $append = $_GET["page"] != "" ? "_" . ilWikiUtil::makeUrlTitle($page) : "";
             include_once './Services/Link/classes/class.ilLink.php';
             $goto = ilLink::_getStaticLink($_GET["ref_id"], "wiki", true, $append);
             //var_dump($goto);
             $ilNavigationHistory->addItem($_GET["ref_id"], "./goto.php?target=wiki_" . $_GET["ref_id"] . $add, "wiki", $title, $page_id, $goto);
         }
     }
     switch ($next_class) {
         case 'ilobjwikigui':
             require_once "./Modules/Wiki/classes/class.ilObjWikiGUI.php";
             $mc_gui =& new ilObjWikiGUI("", (int) $_GET["ref_id"], true, false);
             $this->ctrl->forwardCommand($mc_gui);
             break;
     }
     $tpl->show();
 }
 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);
         }
     }
 }
 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;
 }
 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'));
     }
 }
 /**
  * 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();
 }
 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);
     }
 }
 /**
  * Get overview.
  */
 function getIntroduction()
 {
     global $ilUser, $lng, $ilCtrl, $tree;
     switch ((int) $this->view) {
         case self::VIEW_MY_MEMBERSHIPS:
             $tpl = new ilTemplate('tpl.pd_my_memberships_intro.html', true, true, 'Services/PersonalDesktop');
             $tpl->setVariable('IMG_PD_LARGE', ilUtil::getImagePath('icon_pd_xxl.png'));
             $tpl->setVariable('TXT_WELCOME', $lng->txt('pd_my_memberships_intro'));
             $tpl->setVariable('TXT_INTRO_1', $lng->txt('pd_my_memberships_intro2'));
             break;
         case self::VIEW_MY_OFFERS:
         default:
             // get repository link
             $nd = $tree->getNodeData(ROOT_FOLDER_ID);
             $title = $nd["title"];
             if ($title == "ILIAS") {
                 $title = $lng->txt("repository");
             }
             $tpl = new ilTemplate("tpl.pd_intro.html", true, true, "Services/PersonalDesktop");
             $tpl->setVariable("IMG_PD_LARGE", ilUtil::getImagePath("icon_pd_xxl.png"));
             $tpl->setVariable("TXT_WELCOME", $lng->txt("pdesk_intro"));
             $tpl->setVariable("TXT_INTRO_1", sprintf($lng->txt("pdesk_intro2"), $lng->txt("to_desktop")));
             include_once "./Services/Link/classes/class.ilLink.php";
             $tpl->setVariable("TXT_INTRO_2", sprintf($lng->txt("pdesk_intro3"), '<a href="' . ilLink::_getStaticLink(1, 'root', true) . '">' . $title . '</a>'));
             $tpl->setVariable("TXT_INTRO_3", $lng->txt("pdesk_intro4"));
             break;
     }
     return $tpl->get();
 }
Exemplo n.º 23
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()));
 }
Exemplo n.º 24
0
 /**
  * Build posting month list
  * 
  * @param array $items
  * @param string $a_month
  * @param string $a_cmd
  * @param bool $a_link_template
  * @param bool $a_show_inactive
  * @return string 
  */
 function renderList(array $items, $a_month, $a_cmd = "preview", $a_link_template = null, $a_show_inactive = false)
 {
     global $lng, $ilCtrl;
     include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
     $wtpl = new ilTemplate("tpl.blog_list.html", true, true, "Modules/Blog");
     // title according to current "filter"/navigation
     if ($this->keyword) {
         $title = $lng->txt("blog_keyword") . ": " . $this->keyword;
     } else {
         if ($this->author) {
             include_once "Services/User/classes/class.ilUserUtil.php";
             $title = $lng->txt("blog_author") . ": " . ilUserUtil::getNamePresentation($this->author);
         } else {
             include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
             $title = ilCalendarUtil::_numericMonthToString((int) substr($a_month, 5)) . " " . substr($a_month, 0, 4);
         }
     }
     $wtpl->setVariable("TXT_CURRENT_MONTH", $title);
     $can_approve = $this->object->hasApproval() && $this->checkPermissionBool("write");
     $can_deactivate = $this->checkPermissionBool("write");
     include_once "./Modules/Blog/classes/class.ilBlogPostingGUI.php";
     foreach ($items as $item) {
         // only published items
         $is_active = ilBlogPosting::_lookupActive($item["id"], "blp");
         if (!$is_active && !$a_show_inactive) {
             continue;
         }
         if (!$a_link_template) {
             $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
             $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $item["id"]);
             $preview = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_cmd);
         } else {
             $preview = $this->buildExportLink($a_link_template, "posting", $item["id"]);
         }
         // actions
         $item_contribute = $this->mayContribute($item["id"], $item["author"]);
         if (($item_contribute || $can_approve || $can_deactivate) && !$a_link_template && $a_cmd == "preview") {
             include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
             $alist = new ilAdvancedSelectionListGUI();
             $alist->setId($item["id"]);
             $alist->setListTitle($lng->txt("actions"));
             if ($is_active && $this->object->hasApproval() && !$item["approved"]) {
                 if ($can_approve) {
                     $ilCtrl->setParameter($this, "apid", $item["id"]);
                     $alist->addItem($lng->txt("blog_approve"), "approve", $ilCtrl->getLinkTarget($this, "approve"));
                     $ilCtrl->setParameter($this, "apid", "");
                 }
                 $wtpl->setVariable("APPROVAL", $lng->txt("blog_needs_approval"));
             }
             if ($item_contribute) {
                 $alist->addItem($lng->txt("edit_content"), "edit", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit"));
                 // #11858
                 if ($is_active) {
                     $alist->addItem($lng->txt("blog_toggle_draft"), "deactivate", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deactivatePageToList"));
                 } else {
                     $alist->addItem($lng->txt("blog_toggle_final"), "activate", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "activatePageToList"));
                 }
                 $alist->addItem($lng->txt("rename"), "rename", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edittitle"));
                 $alist->addItem($lng->txt("blog_edit_keywords"), "keywords", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords"));
                 $alist->addItem($lng->txt("blog_edit_date"), "editdate", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editdate"));
                 $alist->addItem($lng->txt("delete"), "delete", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen"));
             } else {
                 if ($can_deactivate) {
                     // #10513
                     if ($is_active) {
                         $ilCtrl->setParameter($this, "apid", $item["id"]);
                         $alist->addItem($lng->txt("blog_toggle_draft_admin"), "deactivate", $ilCtrl->getLinkTarget($this, "deactivateAdmin"));
                         $ilCtrl->setParameter($this, "apid", "");
                     }
                     $alist->addItem($lng->txt("delete"), "delete", $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen"));
                 }
             }
             $wtpl->setCurrentBlock("actions");
             $wtpl->setVariable("ACTION_SELECTOR", $alist->getHTML());
             $wtpl->parseCurrentBlock();
         }
         // comments
         if ($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes) {
             // count (public) notes
             include_once "Services/Notes/classes/class.ilNote.php";
             $count = sizeof(ilNote::_getNotesOfObject($this->obj_id, $item["id"], "blp", IL_NOTE_PUBLIC));
             if ($a_cmd != "preview") {
                 $wtpl->setCurrentBlock("comments");
                 $wtpl->setVariable("TEXT_COMMENTS", $lng->txt("blog_comments"));
                 $wtpl->setVariable("URL_COMMENTS", $preview);
                 $wtpl->setVariable("COUNT_COMMENTS", $count);
                 $wtpl->parseCurrentBlock();
             }
             /* we disabled comments in edit mode (should always be done via pagegui)
             			else
             			{
             				$hash = ilCommonActionDispatcherGUI::buildAjaxHash(ilCommonActionDispatcherGUI::TYPE_WORKSPACE, 
             					$this->node_id, "blog", $this->obj_id, "blp", $item["id"]);
             				$notes_link = "#\" onclick=\"".ilNoteGUI::getListCommentsJSCall($hash);
             			}
             			*/
         }
         // permanent link
         if ($a_cmd != "preview" && $a_cmd != "previewEmbedded") {
             if ($this->id_type == self::WORKSPACE_NODE_ID) {
                 $goto = $this->getAccessHandler()->getGotoLink($this->node_id, $this->obj_id, "_" . $item["id"]);
             } else {
                 include_once "Services/Link/classes/class.ilLink.php";
                 $goto = ilLink::_getStaticLink($this->node_id, $this->getType(), true, "_" . $item["id"]);
             }
             $wtpl->setCurrentBlock("permalink");
             $wtpl->setVariable("URL_PERMALINK", $goto);
             $wtpl->setVariable("TEXT_PERMALINK", $lng->txt("blog_permanent_link"));
             $wtpl->parseCurrentBlock();
         }
         $snippet = ilBlogPostingGUI::getSnippet($item["id"]);
         if ($snippet) {
             $wtpl->setCurrentBlock("more");
             $wtpl->setVariable("URL_MORE", $preview);
             $wtpl->setVariable("TEXT_MORE", $lng->txt("blog_list_more"));
             $wtpl->parseCurrentBlock();
         }
         $wtpl->setCurrentBlock("posting");
         if (!$is_active) {
             $wtpl->setVariable("DRAFT_CLASS", " ilBlogListItemDraft");
         }
         $author = "";
         if ($this->id_type == self::REPOSITORY_NODE_ID) {
             $author_id = $item["author"];
             if ($author_id) {
                 include_once "Services/User/classes/class.ilUserUtil.php";
                 $author = ilUserUtil::getNamePresentation($author_id) . " - ";
             }
         }
         // title
         $wtpl->setVariable("URL_TITLE", $preview);
         $wtpl->setVariable("TITLE", $item["title"]);
         $wtpl->setVariable("DATETIME", $author . ilDatePresentation::formatDate($item["created"], IL_CAL_DATE));
         // content
         $wtpl->setVariable("CONTENT", $snippet);
         $wtpl->parseCurrentBlock();
     }
     // notes
     /*
     if($a_cmd == "previewFullscreen" && $this->object->getNotesStatus())
     {
     	$wtpl->setVariable("NOTES", $this->getNotesHTML());
     }		 
     */
     // permalink
     if ($a_cmd == "previewFullscreen") {
         $wtpl->setVariable("PERMALINK", $this->getPermanentLinkWidget(null, true));
     }
     return $wtpl->get();
 }
 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilAccess;
     $usage = $a_set;
     //var_dump($usage);
     if (is_int(strpos($usage["type"], ":"))) {
         $us_arr = explode(":", $usage["type"]);
         $usage["type"] = $us_arr[1];
         $cont_type = $us_arr[0];
     }
     //var_dump($usage);
     include_once './Services/Link/classes/class.ilLink.php';
     switch ($usage["type"]) {
         case "pg":
             include_once "./Services/COPage/classes/class.ilPageObjectFactory.php";
             $page_obj = ilPageObjectFactory::getInstance($cont_type, $usage["id"]);
             $item = array();
             //$this->tpl->setVariable("TXT_OBJECT", $usage["type"].":".$usage["id"]);
             switch ($cont_type) {
                 case "lm":
                     require_once "./Modules/LearningModule/classes/class.ilObjContentObject.php";
                     require_once "./Modules/LearningModule/classes/class.ilObjLearningModule.php";
                     require_once "./Modules/LearningModule/classes/class.ilLMObject.php";
                     $lm_obj = new ilObjLearningModule($page_obj->getParentId(), false);
                     $item["obj_type_txt"] = $this->lng->txt("obj_" . $cont_type);
                     $item["obj_title"] = $lm_obj->getTitle();
                     $item["sub_txt"] = $this->lng->txt("pg");
                     $item["sub_title"] = ilLMObject::_lookupTitle($page_obj->getId());
                     $ref_id = $this->getFirstWritableRefId($lm_obj->getId());
                     if ($ref_id > 0) {
                         $item["obj_link"] = ilLink::_getStaticLink($page_obj->getId() . "_" . $ref_id, "pg");
                     }
                     break;
                 case "wpg":
                     require_once "./Modules/Wiki/classes/class.ilWikiPage.php";
                     $item["obj_type_txt"] = $this->lng->txt("obj_wiki");
                     $item["obj_title"] = ilObject::_lookupTitle($page_obj->getParentId());
                     $item["sub_txt"] = $this->lng->txt("pg");
                     $item["sub_title"] = ilWikiPage::lookupTitle($page_obj->getId());
                     $ref_id = $this->getFirstWritableRefId($page_obj->getParentId());
                     if ($ref_id > 0) {
                         $item["obj_link"] = ilLink::_getStaticLink($ref_id, "wiki");
                     }
                     break;
                 case "gdf":
                     require_once "./Modules/Glossary/classes/class.ilGlossaryTerm.php";
                     require_once "./Modules/Glossary/classes/class.ilGlossaryDefinition.php";
                     $term_id = ilGlossaryDefinition::_lookupTermId($page_obj->getId());
                     $glo_id = ilGlossaryTerm::_lookGlossaryId($term_id);
                     $item["obj_type_txt"] = $this->lng->txt("obj_glo");
                     $item["obj_title"] = ilObject::_lookupTitle($glo_id);
                     $item["sub_txt"] = $this->lng->txt("cont_term");
                     $item["sub_title"] = ilGlossaryTerm::_lookGlossaryTerm($term_id);
                     $ref_id = $this->getFirstWritableRefId($page_obj->getParentId());
                     if ($ref_id > 0) {
                         $item["obj_link"] = ilLink::_getStaticLink($ref_id, "glo");
                     }
                     break;
                 case "cont":
                     $item["obj_type_txt"] = $this->lng->txt("obj_" . $cont_type);
                     $item["obj_title"] = ilObject::_lookupTitle($page_obj->getId());
                     $ref_id = $this->getFirstWritableRefId($page_obj->getId());
                     if ($ref_id > 0) {
                         $item["obj_link"] = ilLink::_getStaticLink($ref_id, $cont_type);
                     }
                     break;
             }
             break;
         case "mep":
             $item["obj_type_txt"] = $this->lng->txt("obj_mep");
             $item["obj_title"] = ilObject::_lookupTitle($usage["id"]);
             $ref_id = $this->getFirstWritableRefId($usage["id"]);
             if ($ref_id > 0) {
                 $item["obj_link"] = ilLink::_getStaticLink($ref_id, "mep");
             }
             break;
         case "map":
             $item["obj_type_txt"] = $this->lng->txt("obj_mob");
             $item["obj_title"] = ilObject::_lookupTitle($usage["id"]);
             $item["sub_txt"] = $this->lng->txt("cont_link_area");
             break;
     }
     // show versions
     if (is_array($usage["hist_nr"]) && (count($usage["hist_nr"]) > 1 || $usage["hist_nr"][0] > 0)) {
         asort($usage["hist_nr"]);
         $ver = $sep = "";
         if ($usage["hist_nr"][0] == 0) {
             array_shift($usage["hist_nr"]);
             $usage["hist_nr"][] = 0;
         }
         if (count($usage["hist_nr"]) > 5) {
             $ver .= "..., ";
             $cnt = count($usage["hist_nr"]) - 5;
             for ($i = 0; $i < $cnt; $i++) {
                 unset($usage["hist_nr"][$i]);
             }
         }
         foreach ($usage["hist_nr"] as $nr) {
             if ($nr > 0) {
                 $ver .= $sep . $nr;
             } else {
                 $ver .= $sep . $this->lng->txt("cont_current_version");
             }
             $sep = ", ";
         }
         $this->tpl->setCurrentBlock("versions");
         $this->tpl->setVariable("TXT_VERSIONS", $this->lng->txt("cont_versions"));
         $this->tpl->setVariable("VAL_VERSIONS", $ver);
         $this->tpl->parseCurrentBlock();
     }
     if ($item["obj_type_txt"] != "") {
         $this->tpl->setCurrentBlock("type");
         $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("type"));
         $this->tpl->setVariable("VAL_TYPE", $item["obj_type_txt"]);
         $this->tpl->parseCurrentBlock();
     }
     if ($usage["type"] != "clip") {
         if ($item["obj_link"]) {
             $this->tpl->setCurrentBlock("linked_item");
             $this->tpl->setVariable("TXT_OBJECT", $item["obj_title"]);
             $this->tpl->setVariable("HREF_LINK", $item["obj_link"]);
             $this->tpl->parseCurrentBlock();
         } else {
             $this->tpl->setVariable("TXT_OBJECT_NO_LINK", $item["obj_title"]);
         }
         if ($item["sub_txt"] != "") {
             $this->tpl->setVariable("SEP", ", ");
             $this->tpl->setVariable("SUB_TXT", $item["sub_txt"]);
             if ($item["sub_title"] != "") {
                 $this->tpl->setVariable("SEP2", ": ");
                 $this->tpl->setVariable("SUB_TITLE", $item["sub_title"]);
             }
         }
     } else {
         $this->tpl->setVariable("TXT_OBJECT_NO_LINK", $this->lng->txt("cont_users_have_mob_in_clip1") . " " . $usage["cnt"] . " " . $this->lng->txt("cont_users_have_mob_in_clip2"));
     }
 }
 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();
     }
 }
Exemplo n.º 27
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;
 }
Exemplo n.º 28
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"));
         }
     }
 }
Exemplo n.º 29
0
 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]);
         }
     }
 }
Exemplo n.º 30
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'));
 }