本文整理汇总了PHP中ilObject::_lookupTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::_lookupTitle方法的具体用法?PHP ilObject::_lookupTitle怎么用?PHP ilObject::_lookupTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObject
的用法示例。
在下文中一共展示了ilObject::_lookupTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListByObject
/**
* Get list of roles assigned to an object
* @return
* @param object $result
*/
public static function getListByObject($a_str)
{
global $rbacreview, $ilDB;
include_once './Services/JSON/classes/class.ilJsonUtil.php';
$result = array();
if (strpos($a_str, '@') !== 0) {
return ilJsonUtil::encode($result);
}
$a_str = substr($a_str, 1);
$ilDB->setLimit(100);
$query = "SELECT ref_id, title FROM object_data ode " . "JOIN object_reference ore ON ode.obj_id = ore.obj_id " . "WHERE " . $ilDB->like('title', 'text', $a_str . '%') . ' ' . 'ORDER BY title';
$res = $ilDB->query($query);
$counter = 0;
while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
$rolf = $rbacreview->getRoleFolderIdOfObject($row->ref_id);
if ($rolf) {
foreach ($rbacreview->getRolesOfRoleFolder($rolf, false) as $rol_id) {
$role = ilObject::_lookupTitle($rol_id);
$result[$counter] = new stdClass();
$result[$counter]->value = $role;
$result[$counter]->label = $role . " (" . $row->title . ")";
++$counter;
}
}
}
return ilJsonUtil::encode($result);
}
示例2: fillRow
/**
* Fill table row
*/
protected function fillRow($a_set)
{
global $lng;
$this->tpl->setVariable("REF_ID", $a_set["ref_id"]);
$this->tpl->setVariable("SUBSTYLE", $a_set["substyle"]);
$this->tpl->setVariable("CATEGORY", ilObject::_lookupTitle(ilObject::_lookupObjId($a_set["ref_id"])));
}
示例3: handleCode
/**
* 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));
}
}
示例4: __construct
/**
* Constructor
*
* @access public
* @param
* @return
*/
public function __construct($a_parent_obj, $a_parent_cmd, $a_pool_ref_id)
{
global $lng, $ilCtrl;
$this->setId("cont_qpl");
$this->pool_ref_id = $a_pool_ref_id;
$this->pool_obj_id = ilObject::_lookupObjId($a_pool_ref_id);
parent::__construct($a_parent_obj, $a_parent_cmd);
$this->setTitle(ilObject::_lookupTitle($this->pool_obj_id));
// $qplSetting = new ilSetting("qpl");
$this->setFormName('sa_quest_browser');
// $this->addColumn('','f','1%');
$this->addColumn($this->lng->txt("title"), 'title', '');
$this->addColumn($this->lng->txt("cont_question_type"), 'ttype', '');
$this->addColumn($this->lng->txt("actions"), '', '');
// $this->setPrefix('q_id');
// $this->setSelectAllCheckbox('q_id');
$this->setRowTemplate("tpl.copy_sa_quest_row.html", "Services/COPage");
$this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
$this->setDefaultOrderField("title");
$this->setDefaultOrderDirection("asc");
// $this->setFilterCommand('filterQuestionBrowser');
// $this->setResetCommand('resetQuestionBrowser');
$this->initFilter();
$this->getQuestions();
}
示例5: parseObjectIds
/**
* Parse object data
* @return
* @param object $a_ids
*/
public function parseObjectIds($a_ids)
{
foreach ($a_ids as $object_id) {
$row = array();
$type = ilObject::_lookupType($object_id);
$row['title'] = ilObject::_lookupTitle($object_id);
$row['desc'] = ilObject::_lookupDescription($object_id);
$row['id'] = $object_id;
switch ($type) {
case 'crs':
case 'grp':
include_once './Services/Membership/classes/class.ilParticipants.php';
if (ilParticipants::hasParticipantListAccess($object_id)) {
$row['member'] = count(ilParticipants::getInstanceByObjId($object_id)->getParticipants());
} else {
$row['member'] = 0;
}
break;
case 'role':
global $rbacreview;
include_once './Services/User/classes/class.ilUserFilter.php';
$row['member'] = count(ilUserFilter::getInstance()->filter($rbacreview->assignedUsers($object_id)));
break;
}
$data[] = $row;
}
$this->setData($data ? $data : array());
}
示例6: fillRow
/**
* Fill table row
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl, $ilUser;
include_once "./Services/Skill/classes/class.ilPersonalSkill.php";
$mat = ilPersonalSkill::getAssignedMaterial($ilUser->getId(), $this->tref_id, $a_set["id"]);
$ilCtrl->setParameter($this->parent_obj, "level_id", $a_set["id"]);
foreach ($mat as $m) {
$this->tpl->setCurrentBlock("mat");
$obj_id = $this->ws_tree->lookupObjectId($m["wsp_id"]);
$this->tpl->setVariable("MAT_TITLE", ilObject::_lookupTitle($obj_id));
$this->tpl->setVariable("MAT_IMG", ilUtil::img(ilUtil::getImagePath("icon_" . ilObject::_lookupType($obj_id) . ".svg")));
$this->tpl->setVariable("TXT_REMOVE", $lng->txt("remove"));
$ilCtrl->setParameter($this->parent_obj, "wsp_id", $m["wsp_id"]);
$this->tpl->setVariable("HREF_REMOVE", $ilCtrl->getLinkTarget($this->parent_obj, "removeMaterial"));
$obj_id = $this->ws_tree->lookupObjectId($m["wsp_id"]);
$url = $this->ws_access->getGotoLink($m["wsp_id"], $obj_id);
$this->tpl->setVariable("HREF_MAT", $url);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("cmd");
$this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj, "assignMaterial"));
$this->tpl->setVariable("TXT_CMD", $lng->txt("skmg_assign_materials"));
$this->tpl->parseCurrentBlock();
$ilCtrl->setParameter($this->parent_obj, "level_id", "");
$this->tpl->setVariable("LEVEL_ID", $a_set["id"]);
$this->tpl->setVariable("SKILL_ID", $this->basic_skill_id);
$this->tpl->setVariable("TXT_SKILL", $a_set["title"]);
$this->tpl->setVariable("TXT_SKILL_DESC", $a_set["description"]);
}
示例7: getItems
protected function getItems($a_content_obj, $a_group_obj)
{
global $ilUser, $tree;
$counter = 0;
$items = ilUtil::_getObjectsByOperations($this->type, 'write', $ilUser->getId(), -1);
$items_obj_id = array();
$items_ids = array();
foreach ($items as $ref_id) {
$obj_id = ilObject::_lookupObjId($ref_id);
$items_ids[$obj_id] = $ref_id;
$items_obj_id[] = $obj_id;
}
$items_obj_id = ilUtil::_sortIds($items_obj_id, 'object_data', 'title', 'obj_id');
$assigned_ids = array();
$assigned = $a_group_obj->getAssignedItems();
if ($assigned) {
foreach ($assigned as $item) {
$assigned_ids[] = $item['target_ref_id'];
}
}
$data = array();
foreach ($items_obj_id as $obj_id) {
$item_id = $items_ids[$obj_id];
if ($tree->checkForParentType($item_id, 'adm')) {
continue;
}
$obj_id = ilObject::_lookupObjId($item_id);
$data[] = array('id' => $item_id, 'title' => ilObject::_lookupTitle($obj_id), 'description' => ilObject::_lookupDescription($obj_id), 'path' => $this->__formatPath($tree->getPathFull($item_id)), 'assigned' => in_array($item_id, $assigned_ids));
}
$this->setData($data);
}
示例8: fillRow
/**
* Fill table row
*/
protected function fillRow($a_set)
{
global $lng;
$this->tpl->setVariable("TXT_DEP_OBJ", $lng->txt("obj_" . ilObject::_lookupType($a_set["dep_obj"])) . ": " . ilObject::_lookupTitle($a_set["dep_obj"]));
$this->tpl->setVariable("TXT_DEL_OBJ", $lng->txt("obj_" . ilObject::_lookupType($a_set["del_obj"])) . ": " . ilObject::_lookupTitle($a_set["del_obj"]));
$this->tpl->setVariable("TXT_MESS", $a_set["message"]);
}
示例9: getLuceneList
/**
* Performs better than standard like search on huge installations
*/
public static function getLuceneList($a_str)
{
include_once './Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
$qp = new ilLuceneQueryParser('title:' . $a_str . '*');
$qp->parse();
include_once './Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
$searcher = ilLuceneSearcher::getInstance($qp);
$searcher->setType(ilLuceneSearcher::TYPE_STANDARD);
$searcher->search();
$res = $searcher->getResult()->getCandidates();
$max_entries = ilSearchSettings::getInstance()->getAutoCompleteLength() ? ilSearchSettings::getInstance()->getAutoCompleteLength() : 10;
$list = array();
$num_entries = 0;
foreach ($res as $res_obj_id) {
if (self::checkObjectPermission($res_obj_id)) {
$list[] = ilObject::_lookupTitle($res_obj_id, true);
$num_entries++;
}
if ($num_entries >= $max_entries) {
break;
}
}
$i = 0;
$result = array();
foreach ($list as $entry) {
$result[$i] = new stdClass();
$result[$i]->value = '"' . $entry . '"';
$i++;
}
include_once './Services/JSON/classes/class.ilJsonUtil.php';
return ilJsonUtil::encode($result);
}
示例10: __construct
public function __construct($a_parent_obj, $a_parent_cmd, array &$a_data, $a_view, $a_by_location = false)
{
global $ilCtrl, $tree, $ilUser;
$this->setId("pdmng");
parent::__construct($a_parent_obj, $a_parent_cmd);
$this->addColumn('', '', '5%');
$this->addColumn($this->lng->txt("type"), 'type_caption', '1%');
$this->addColumn($this->lng->txt("title"), 'title', '44%');
$this->addColumn($this->lng->txt("container"), 'container', '50%');
$this->setDefaultOrderField("title");
$this->setRowTemplate("tpl.pd_manage_row.html", "Services/PersonalDesktop");
$this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
if ($a_view == ilPDSelectedItemsBlockGUI::VIEW_MY_OFFERS) {
$this->setTitle($this->lng->txt("pd_my_offers"));
$this->addMultiCommand('confirmRemove', $this->lng->txt('unsubscribe'));
} else {
$this->setTitle($this->lng->txt("pd_my_memberships"));
$this->addMultiCommand('confirmRemove', $this->lng->txt('crs_unsubscribe'));
}
$this->addCommandButton("getHTML", $this->lng->txt("cancel"));
// root node caption
$root = $tree->getNodeData(ROOT_FOLDER_ID);
$root = $root["title"];
if ($root == "ILIAS") {
$root = $this->lng->txt("repository");
}
foreach ($a_data as $idx => $item) {
if (!$item["parent_ref"]) {
unset($a_data[$idx]);
continue;
}
if ($a_view == ilPDSelectedItemsBlockGUI::VIEW_MY_MEMBERSHIPS) {
$a_data[$idx]["last_admin"] = false;
switch ($item["type"]) {
case "crs":
// see ilObjCourseGUI:performUnsubscribeObject()
include_once "Modules/Course/classes/class.ilCourseParticipants.php";
$members = new ilCourseParticipants($item["obj_id"]);
break;
case "grp":
include_once "Modules/Group/classes/class.ilGroupParticipants.php";
$members = new ilGroupParticipants($item["obj_id"]);
break;
default:
// do nothing?
continue;
}
$a_data[$idx]["last_admin"] = $members->isLastAdmin($ilUser->getId());
}
$a_data[$idx]["type_caption"] = $this->lng->txt("obj_" . $item["type"]);
// parent
if ($tree->getRootId() != $item["parent_ref"]) {
$a_data[$idx]["container"] = ilObject::_lookupTitle(ilObject::_lookupObjId($item["parent_ref"]));
} else {
$a_data[$idx]["container"] = $root;
}
}
$this->setData($a_data);
}
示例11: manifestWriterBegin
/**
* Write container manifest
* @return
*/
protected function manifestWriterBegin($a_type, $a_id, $a_target_release)
{
$GLOBALS['ilLog']->write(__METHOD__ . ': wrinting manifest');
include_once "./Services/Xml/classes/class.ilXmlWriter.php";
$this->cont_manifest_writer = new ilXmlWriter();
$this->cont_manifest_writer->xmlHeader();
$this->cont_manifest_writer->xmlStartTag('Manifest', array("MainEntity" => $a_type, "Title" => ilObject::_lookupTitle($a_id), "TargetRelease" => $a_target_release, "InstallationId" => IL_INST_ID, "InstallationUrl" => ILIAS_HTTP_PATH));
}
示例12: getNodeContent
/**
* Get content of node
*
* @param
* @return
*/
function getNodeContent($a_node)
{
$rn = $this->getRootNode();
if ($rn["child"] == $a_node["child"]) {
return ilObject::_lookupTitle($this->tax_tree->getTreeId());
} else {
return $a_node["title"];
}
}
示例13: fillRow
/**
* Fill table row
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl;
$ilCtrl->setParameter($this->parent_obj, "glo_id", $a_set["glo_id"]);
$this->tpl->setCurrentBlock("cmd");
$this->tpl->setVariable("CMD_HREF", $ilCtrl->getLinkTarget($this->parent_obj, "removeLMGlossary"));
$this->tpl->setVariable("CMD_TXT", $lng->txt("remove"));
$this->tpl->parseCurrentBlock();
$this->tpl->setVariable("TITLE", ilObject::_lookupTitle($a_set["glo_id"]));
}
示例14: fillRow
/**
* Standard Version of Fill Row. Most likely to
* be overwritten by derived class.
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl, $ilAccess;
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
// user
if ($a_set["user_id"] > 0) {
$this->tpl->setCurrentBlock("user_info");
$user_obj = new ilObjUser($a_set["user_id"]);
$this->tpl->setVariable("VAL_AUTHOR", $user_obj->getLogin());
$this->tpl->setVariable("TXT_AUTHOR", $lng->txt("author"));
$this->tpl->parseCurrentBlock();
}
// access
if ($enable_internal_rss) {
$this->tpl->setCurrentBlock("access");
$this->tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility"));
if ($a_set["visibility"] == NEWS_PUBLIC || $a_set["priority"] == 0 && ilBlockSetting::_lookup("news", "public_notifications", 0, $a_set["context_obj_id"])) {
$this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public"));
} else {
$this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users"));
}
$this->tpl->parseCurrentBlock();
}
// last update
if ($a_set["creation_date"] != $a_set["update_date"]) {
$this->tpl->setCurrentBlock("ni_update");
$this->tpl->setVariable("TXT_LAST_UPDATE", $lng->txt("last_update"));
$this->tpl->setVariable("VAL_LAST_UPDATE", ilDatePresentation::formatDate(new ilDateTime($a_set["update_date"], IL_CAL_DATETIME)));
$this->tpl->parseCurrentBlock();
}
// creation date
$this->tpl->setVariable("VAL_CREATION_DATE", ilDatePresentation::formatDate(new ilDateTime($a_set["creation_date"], IL_CAL_DATETIME)));
$this->tpl->setVariable("TXT_CREATED", $lng->txt("created"));
// title
$this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
// content
if ($a_set["content"] != "") {
$this->tpl->setCurrentBlock("content");
$this->tpl->setVariable("VAL_CONTENT", ilUtil::shortenText($a_set["content"], 80, true, true), true);
$this->tpl->parseCurrentBlock();
}
$perm_ref_id = $this->perm_ref_id > 0 ? $this->perm_ref_id : $a_set["ref_id"];
if ($ilAccess->checkAccess("write", "", $perm_ref_id)) {
$this->tpl->setCurrentBlock("edit");
$this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
$ilCtrl->setParameterByClass("ilnewsitemgui", "news_item_id", $a_set["id"]);
$this->tpl->setVariable("CMD_EDIT", $ilCtrl->getLinkTargetByClass("ilnewsitemgui", "editNewsItem"));
$this->tpl->parseCurrentBlock();
}
// context
$this->tpl->setVariable("CONTEXT", $lng->txt("obj_" . $a_set["context_obj_type"]) . ":<br />" . ilObject::_lookupTitle($a_set["context_obj_id"]));
$this->tpl->setVariable("VAL_ID", $a_set["id"]);
}
示例15: getLinkHTML
public function getLinkHTML($link_name = NULL)
{
$value = $this->getValue();
$link = ilLink::_getStaticLink($value);
$id = ilObject::_lookupObjId($value);
if ($link_name) {
$html = "<a href='" . $link . "'>" . $link_name . "</a>";
} else {
$html = "<a href='" . $link . "'>" . ilObject::_lookupTitle($id) . "</a>";
}
return $html;
}