本文整理汇总了PHP中ilUtil::getTypeIconPath方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::getTypeIconPath方法的具体用法?PHP ilUtil::getTypeIconPath怎么用?PHP ilUtil::getTypeIconPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUtil
的用法示例。
在下文中一共展示了ilUtil::getTypeIconPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Show delete confirmation
*/
public function delete()
{
global $tpl, $ilSetting, $ilErr;
$this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
$to_delete = array();
if ((int) $_GET['item_ref_id']) {
$to_delete = array((int) $_GET['item_ref_id']);
}
if (isset($_POST['id']) and is_array($_POST['id'])) {
$to_delete = $_POST['id'];
}
if (!$to_delete) {
$ilErr->raiseError($this->lng->txt('no_checkbox'), $ilErr->MESSAGE);
}
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirm = new ilConfirmationGUI();
$confirm->setFormAction($this->ctrl->getFormActionByClass(get_class($this->getContainer()), 'cancel'));
$confirm->setHeaderText('');
$confirm->setCancel($this->lng->txt('cancel'), 'cancelDelete');
$confirm->setConfirm($this->lng->txt('delete'), 'performDelete');
foreach ($to_delete as $delete) {
$obj_id = ilObject::_lookupObjId($delete);
$type = ilObject::_lookupType($obj_id);
$confirm->addItem('id[]', $delete, call_user_func(array(ilObjectFactory::getClassByType($type), '_lookupTitle'), $obj_id), ilUtil::getTypeIconPath($type, $obj_id));
}
$msg = $this->lng->txt("info_delete_sure");
if (!$ilSetting->get('enable_trash')) {
$msg .= "<br/>" . $this->lng->txt("info_delete_warning_no_trash");
}
ilUtil::sendQuestion($msg);
$tpl->setContent($confirm->getHTML());
}
示例2: fillRow
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']));
}
示例3: fillRow
public function fillRow($a_set)
{
if ($a_set["last_admin"]) {
$this->tpl->setCurrentBlock("warning_bl");
$this->tpl->setVariable("TXT_WARNING", $this->lng->txt('pd_min_one_admin'));
$this->tpl->parseCurrentBlock();
$this->tpl->setVariable("CHK_DISABLED", ' disabled="disabled"');
}
$this->tpl->setVariable("VAL_REF_ID", $a_set["ref_id"]);
$this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
$this->tpl->setVariable("TXT_DESCRIPTION", $a_set["desc"]);
$this->tpl->setVariable("URL_ICON", ilUtil::getTypeIconPath($a_set["type"], $a_set["obj_id"]));
$this->tpl->setVariable("TXT_TYPE", $this->lng->txt("icon") . " " . $a_set["type_caption"]);
$this->tpl->setVariable("TXT_CONTAINER", $a_set["container"]);
}
示例4: importData
/**
* Import data from DB
*/
protected function importData()
{
include_once "./Services/User/classes/class.ilUserUtil.php";
$data = array();
foreach ($this->handler->getPermissions($this->node_id) as $obj_id) {
switch ($obj_id) {
case ilWorkspaceAccessGUI::PERMISSION_REGISTERED:
$title = $icon_alt = $this->lng->txt("wsp_set_permission_registered");
$type = "registered";
$icon = "";
break;
case ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD:
$title = $icon_alt = $this->lng->txt("wsp_set_permission_all_password");
$type = "all_password";
$icon = "";
break;
case ilWorkspaceAccessGUI::PERMISSION_ALL:
$title = $icon_alt = $this->lng->txt("wsp_set_permission_all");
$type = "all_password";
$icon = "";
break;
default:
$type = ilObject::_lookupType($obj_id);
$icon = ilUtil::getTypeIconPath($type, null, "tiny");
$icon_alt = $this->lng->txt("obj_" . $type);
if ($type != "usr") {
$title = ilObject::_lookupTitle($obj_id);
} else {
$title = ilUserUtil::getNamePresentation($obj_id, true, true);
}
break;
}
$data[] = array("id" => $obj_id, "title" => $title, "type" => $type, "icon" => $icon, "icon_alt" => $icon_alt);
}
$this->setData($data);
}
示例5: initSettingsForm
protected function initSettingsForm($a_mode = 'create')
{
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setTableWidth('600');
if ($a_mode == 'create') {
$this->form_gui->setTitle($this->lng->txt('icla_add'));
} else {
$this->form_gui->setTitle($this->lng->txt('icla_edit'));
}
$this->form_gui->setTitleIcon(ilUtil::getTypeIconPath('icla', 0));
// Title
$text_input = new ilTextInputGUI($this->lng->txt('title'), 'title');
$text_input->setRequired(true);
$this->form_gui->addItem($text_input);
// Description
$text_area = new ilTextAreaInputGUI($this->lng->txt('desc'), 'desc');
$this->form_gui->addItem($text_area);
// Docentselection
$sel = new ilSelectInputGUI($this->lng->txt(ILINC_MEMBER_DOCENT), 'instructoruserid');
$docentlist = $this->object->getDocentList();
$docent_options = array();
$docent_options[0] = $this->lng->txt('please_choose');
foreach ((array) $docentlist as $id => $data) {
$docent_options[$id] = $data['fullname'];
}
$sel->setOptions($docent_options);
$this->form_gui->addItem($sel);
// Open
$rg = new ilRadioGroupInputGUI($this->lng->txt('access'), 'alwaysopen');
$rg->setValue(0);
$ro = new ilRadioOption($this->lng->txt('ilinc_classroom_open'), 1);
$rg->addOption($ro);
$ro = new ilRadioOption($this->lng->txt('ilinc_classroom_closed'), 0);
$rg->addOption($ro);
$this->form_gui->addItem($rg);
// Display akclassvalues
if ($this->ilias->getSetting('ilinc_akclassvalues_active')) {
$text_input = new ilTextInputGUI($this->lng->txt('akclassvalue1'), 'akclassvalue1');
$text_input->setDisabled(true);
$this->form_gui->addItem($text_input);
$text_input = new ilTextInputGUI($this->lng->txt('akclassvalue2'), 'akclassvalue2');
$text_input->setDisabled(true);
$this->form_gui->addItem($text_input);
}
// save and cancel commands
if ($a_mode == 'create') {
$this->ctrl->setParameter($this, 'mode', 'create');
$this->ctrl->setParameter($this, 'new_type', 'icla');
$this->form_gui->addCommandButton('save', $this->lng->txt('icla_add'));
$this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
} else {
$this->ctrl->setParameter($this, 'class_id', $this->object->id);
$this->form_gui->addCommandButton('updateClassroom', $this->lng->txt('save'));
$this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'updateClassroom'));
}
}
示例6: fillRow
/**
* Fill row
*
* @access public
* @param array row data
*
*/
public function fillRow($a_set)
{
global $tree;
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', ilDatePresentation::formatDate(new ilDateTime($a_set['last_update'], IL_CAL_DATETIME)));
// Links
foreach (ilObject::_getAllReferences($a_set['obj_id']) as $ref_id) {
$parent = $tree->getParentId($ref_id);
$p_obj_id = ilObject::_lookupObjId($parent);
$p_title = ilObject::_lookupTitle($p_obj_id);
$p_type = ilObject::_lookupType($p_obj_id);
$this->tpl->setCurrentBlock('link');
$this->tpl->setVariable('LINK_IMG', ilUtil::getTypeIconPath($p_type, $p_obj_id, 'tiny'));
$this->tpl->setVariable('LINK_CONTAINER', $p_title);
$this->tpl->setVariable('LINK_LINK', ilLink::_getLink($parent, $p_type));
$this->tpl->parseCurrentBlock();
}
$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'));
include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
$settings = ilECSDataMappingSettings::getInstanceByServerId($a_set['sid']);
include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php';
$values = ilAdvancedMDValues::_getValuesByObjId($a_set['obj_id']);
if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'lecturer')) {
$this->tpl->setVariable('VAL_LECTURER', isset($values[$field]) ? $values[$field] : '--');
}
if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'term')) {
$this->tpl->setVariable('VAL_TERM', isset($values[$field]) ? $values[$field] : '--');
}
if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'courseID')) {
$this->tpl->setVariable('VAL_CRS_ID', isset($values[$field]) ? $values[$field] : '--');
}
if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'courseType')) {
$this->tpl->setVariable('VAL_CRS_TYPE', isset($values[$field]) ? $values[$field] : '--');
}
if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'credits')) {
$this->tpl->setVariable('VAL_CREDITS', isset($values[$field]) ? $values[$field] : '--');
}
if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'semester_hours')) {
$this->tpl->setVariable('VAL_SWS', isset($values[$field]) ? $values[$field] : '--');
}
if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'room')) {
$this->tpl->setVariable('VAL_ROOM', isset($values[$field]) ? $values[$field] : '--');
}
if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'cycle')) {
$this->tpl->setVariable('VAL_CYCLE', isset($values[$field]) ? $values[$field] : '--');
}
if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'begin')) {
$this->tpl->setVariable('VAL_START', isset($values[$field]) ? ilDatePresentation::formatDate(new ilDateTime($values[$field], IL_CAL_UNIX)) : '--');
}
if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'end')) {
$this->tpl->setVariable('VAL_END', isset($values[$field]) ? ilDatePresentation::formatDate(new ilDateTime($values[$field], IL_CAL_UNIX)) : '--');
}
}
示例7: fillRow
/**
* Fill table row
*
* @param array $a_set data array
*/
protected function fillRow($node)
{
global $ilCtrl, $lng;
$this->tpl->setVariable("LASTNAME", $node["lastname"]);
$this->tpl->setVariable("FIRSTNAME", $node["firstname"]);
$this->tpl->setVariable("LOGIN", $node["login"]);
$this->tpl->setVariable("TITLE", $node["title"]);
if (!$this->portfolio_mode) {
$this->tpl->setVariable("TYPE", $node["obj_type"]);
$this->tpl->setVariable("ICON_ALT", $node["obj_type"]);
$this->tpl->setVariable("ICON", ilObject::_getIcon("", "tiny", $node["type"]));
$url = $this->handler->getGotoLink($node["wsp_id"], $node["obj_id"]);
} else {
$url = ilLink::_getStaticLink($node["obj_id"], "prtf", true);
}
$this->tpl->setVariable("URL_TITLE", $url);
$this->tpl->setVariable("ACL_DATE", ilDatePresentation::formatDate(new ilDateTime($node["acl_date"], IL_CAL_UNIX)));
asort($node["acl_type"]);
foreach ($node["acl_type"] as $obj_id) {
// see ilWorkspaceAccessTableGUI
switch ($obj_id) {
case ilWorkspaceAccessGUI::PERMISSION_REGISTERED:
$title = $icon_alt = $this->lng->txt("wsp_set_permission_registered");
$type = "registered";
$icon = "";
break;
case ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD:
$title = $icon_alt = $this->lng->txt("wsp_set_permission_all_password");
$type = "all_password";
$icon = "";
break;
case ilWorkspaceAccessGUI::PERMISSION_ALL:
$title = $icon_alt = $this->lng->txt("wsp_set_permission_all");
$type = "all_password";
$icon = "";
break;
default:
$type = ilObject::_lookupType($obj_id);
$icon = ilUtil::getTypeIconPath($type, null, "tiny");
$icon_alt = $this->lng->txt("obj_" . $type);
if ($type != "usr") {
$title = ilObject::_lookupTitle($obj_id);
} else {
$title = ilUserUtil::getNamePresentation($obj_id, true, true);
}
break;
}
if ($icon) {
$this->tpl->setCurrentBlock("acl_type_icon_bl");
$this->tpl->setVariable("ACL_ICON", $icon);
$this->tpl->setVariable("ACL_ICON_ALT", $icon_alt);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("acl_type_bl");
$this->tpl->setVariable("ACL_TYPE", $title);
$this->tpl->parseCurrentBlock();
}
if (!$this->portfolio_mode) {
// files may be copied to own workspace
if ($node["type"] == "file") {
$ilCtrl->setParameter($this->parent_obj, "wsp_id", $this->parent_node_id);
$ilCtrl->setParameter($this->parent_obj, "item_ref_id", $node["wsp_id"]);
$url = $ilCtrl->getLinkTarget($this->parent_obj, "copyshared");
$this->tpl->setCurrentBlock("action_bl");
$this->tpl->setVariable("URL_ACTION", $url);
$this->tpl->setVariable("ACTION", $lng->txt("copy"));
$this->tpl->parseCurrentBlock();
}
}
}
示例8: confirmDeleteExportFileObject
/**
* confirmation screen for export file deletion
*/
function confirmDeleteExportFileObject()
{
if (!isset($_POST["file"])) {
$this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
}
// display confirmation message
include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setHeaderText($this->lng->txt("info_delete_sure"));
$cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteExportFile");
$cgui->setConfirm($this->lng->txt("confirm"), "deleteExportFile");
// BEGIN TABLE DATA
foreach ($_POST["file"] as $file) {
$cgui->addItem("file[]", $file, $file, ilUtil::getTypeIconPath("usrf"), $this->lng->txt("obj_usrf"));
}
$this->tpl->setContent($cgui->getHTML());
}
示例9: __showOtherResources
function __showOtherResources()
{
global $ilias, $rbacsystem, $ilObjDataCache, $objDefinition;
if (!count($ors = $this->__getOtherResources())) {
return false;
}
$this->tpl->addBlockfile('RESOURCES_BLOCK', 'resources_block', 'tpl.crs_objectives_view_or_table.html', 'Modules/Course');
$this->tpl->setVariable("TBL_TITLE_OR", $this->lng->txt('crs_other_resources'));
$this->__showHideLinks('or');
if (isset($_SESSION['crs_hide_or'])) {
return true;
}
$this->tpl->setCurrentBlock("tbl_header_columns_or");
$this->tpl->setVariable("TBL_HEADER_WIDTH_OR", "5%");
$this->tpl->setVariable("TBL_HEADER_NAME_OR", $this->lng->txt('type'));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("tbl_header_columns_or");
$this->tpl->setVariable("TBL_HEADER_WIDTH_OR", "75%");
$this->tpl->setVariable("TBL_HEADER_NAME_OR", $this->lng->txt('description'));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("tbl_header_columns_or");
$this->tpl->setVariable("TBL_HEADER_WIDTH_OR", "20%");
$this->tpl->setVariable("TBL_HEADER_NAME_OR", '');
$this->tpl->parseCurrentBlock();
$counter = 1;
foreach ($ors as $or_id) {
$obj_id = $ilObjDataCache->lookupObjId($or_id);
$obj_type = $ilObjDataCache->lookupType($obj_id);
// do not show side block items
if ($objDefinition->isSideBlock($obj_type)) {
continue;
}
$conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget($or_id, $obj_id);
$obj_link = ilRepositoryExplorer::buildLinkTarget($or_id, $obj_type);
$obj_frame = ilRepositoryExplorer::buildFrameTarget($obj_type, $or_id, $obj_id);
$obj_frame = $obj_frame ? $obj_frame : '';
if (ilRepositoryExplorer::isClickable($obj_type, $or_id, $obj_id)) {
$this->tpl->setCurrentBlock("or_read");
$this->tpl->setVariable("READ_TITLE_OR", $ilObjDataCache->lookupTitle($obj_id));
$this->tpl->setVariable("READ_TARGET_OR", $obj_frame);
$this->tpl->setVariable("READ_LINK_OR", $obj_link);
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock("or_visible");
$this->tpl->setVariable("VISIBLE_LINK_OR", $ilObjDataCache->lookupTitle($obj_id));
$this->tpl->parseCurrentBlock();
}
// add to desktop link
if (!$ilias->account->isDesktopItem($or_id, $obj_type) and $this->course_obj->getAboStatus() == $this->course_obj->ABO_ENABLED) {
if ($rbacsystem->checkAccess('read', $or_id)) {
$this->tpl->setCurrentBlock("or_desklink");
$this->ctrl->setParameterByClass(get_class($this->container_gui), 'item_ref_id', $or_id);
$this->ctrl->setParameterByClass(get_class($this->container_gui), 'item_id', $or_id);
$this->ctrl->setParameterByClass(get_class($this->container_gui), 'type', $obj_type);
$this->tpl->setVariable("DESK_LINK_OR", $this->ctrl->getLinkTarget($this->container_gui, 'addToDesk'));
$this->tpl->setVariable("TXT_DESK_OR", $this->lng->txt("to_desktop"));
$this->tpl->parseCurrentBlock();
}
}
$this->tpl->setCurrentBlock("or_row");
$this->tpl->setVariable("OBJ_TITLE_OR", $ilObjDataCache->lookupTitle($obj_id));
$this->tpl->setVariable('IMG_TYPE_OR', ilUtil::getTypeIconPath($obj_type, $obj_id, 'small'));
$this->tpl->setVariable("TXT_IMG_OR", $this->lng->txt('obj_' . $obj_type));
$this->tpl->setVariable("OBJ_CLASS_CENTER_OR", 'option_value_center');
$this->tpl->setVariable("OBJ_CLASS_OR", 'option_value');
$this->tpl->parseCurrentBlock();
++$counter;
}
}
示例10: renderMyCourses
protected function renderMyCourses($a_user_id, $a_default_sorting)
{
global $ilAccess, $ilUser, $ilCtrl;
if ($this->getOutputMode() == "preview") {
return $this->renderMyCoursesTeaser($a_user_id, $a_default_sorting);
}
if (!$this->isMyCoursesActive()) {
return;
}
$img_path = null;
if ($this->getOutputMode() == "offline") {
$this->export_material["images"][] = "./templates/default/images/icon_crs.svg";
$this->export_material["images"][] = "./templates/default/images/icon_lobj.svg";
$this->export_material["images"][] = "./templates/default/images/scorm/complete.svg";
$this->export_material["images"][] = "./templates/default/images/scorm/not_attempted.svg";
$this->export_material["images"][] = "./templates/default/images/scorm/failed.svg";
$this->export_material["images"][] = "./templates/default/images/scorm/incomplete.svg";
$img_path = "images/";
}
$user_id = $this->getPageContentUserId($a_user_id);
// sorting pref
if ($_POST["srt"] && in_array($_POST["srt"], array("alpha", "loc"))) {
$ilUser->writePref("prtf_mcrs_sort", $_POST["srt"]);
}
$sorting = $ilUser->getPref("prtf_mcrs_sort");
if (!$sorting) {
$sorting = $a_default_sorting;
}
$data = $this->getCoursesOfUser($user_id, $sorting == "loc");
if (sizeof($data)) {
if ($sorting != "loc") {
$data = ilUtil::sortArray($data, "title", "ASC");
} else {
$data = ilUtil::sortArray($data, "path_sort", "ASC");
}
$tpl = new ilTemplate("tpl.pc_my_courses.html", true, true, "Modules/Portfolio");
$tpl->setVariable("TITLE", $this->lng->txt("prtf_page_element_my_courses_title"));
$tpl->setVariable("INFO", $this->lng->txt("prtf_page_element_my_courses_info"));
// #14464
include_once "./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php";
$this->lng->loadLanguageModule("trac");
$this->lng->loadLanguageModule("crs");
include_once "./Services/Container/classes/class.ilContainerObjectiveGUI.php";
include_once "./Services/Link/classes/class.ilLink.php";
// sorting
$options = array("alpha" => $this->lng->txt("cont_mycourses_sortorder_alphabetical"), "loc" => $this->lng->txt("cont_mycourses_sortorder_location"));
$tpl->setVariable("SORT_SELECT", ilUtil::formSelect($sorting, "srt", $options, false, true, 0, "", array("onchange" => "form.submit()")));
$tpl->setVariable("SORT_FORM", $ilCtrl->getFormActionByClass("ilobjportfoliogui", "preview"));
$old_path = null;
foreach ($data as $course) {
if ($sorting == "loc") {
if ($course["path"] != $old_path) {
$tpl->setCurrentBlock("path_bl");
$tpl->setVariable("PATH", $course["path"]);
$tpl->parseCurrentBlock();
$old_path = $course["path"];
}
}
if (isset($course["lp_status"])) {
$lp_icon = ilLearningProgressBaseGUI::_getImagePathForStatus($course["lp_status"]);
$lp_alt = ilLearningProgressBaseGUI::_getStatusText($course["lp_status"]);
if ($img_path) {
$lp_icon = $img_path . basename($lp_icon);
}
$tpl->setCurrentBlock("lp_bl");
$tpl->setVariable("LP_ICON_URL", $lp_icon);
$tpl->setVariable("LP_ICON_ALT", $lp_alt);
$tpl->parseCurrentBlock();
}
$do_links = false;
if ($ilUser->getId() != ANONYMOUS_USER_ID) {
$do_links = $ilAccess->checkAccessOfUser($ilUser->getId(), "read", "", $course["ref_id"], "crs") || $ilAccess->checkAccessOfUser($ilUser->getId(), "visible", "", $course["ref_id"], "crs") && $ilAccess->checkAccessOfUser($ilUser->getId(), "join", "", $course["ref_id"], "crs");
}
if (isset($course["objectives"])) {
include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
$loc_settings = ilLOSettings::getInstanceByObjId($course["obj_id"]);
$has_initial_test = (bool) $loc_settings->getInitialTest();
foreach ($course["objectives"] as $objtv) {
if ($do_links) {
$params = array("oobj" => $objtv["id"]);
$url = ilLink::_getLink($course["ref_id"], "crs", $params);
// #15510
$url .= "#objtv_acc_" . $objtv["id"];
$tpl->setCurrentBlock("objective_link_bl");
if (trim($objtv["desc"])) {
$desc = nl2br($objtv["desc"]);
$tt_id = "objtvtt_" . $objtv["id"] . "_" . (int) self::$initialized;
include_once "Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php";
ilToolTipGUI::addTooltip($tt_id, $desc, "", "bottom center", "top center", false);
$tpl->setVariable("OBJECTIVE_LINK_ID", $tt_id);
}
$tpl->setVariable("OBJECTIVE_LINK_URL", $url);
$tpl->setVariable("OBJECTIVE_LINK_TITLE", $objtv["title"]);
$tpl->parseCurrentBlock();
} else {
$tpl->setCurrentBlock("objective_nolink_bl");
$tpl->setVariable("OBJECTIVE_NOLINK_TITLE", $objtv["title"]);
$tpl->parseCurrentBlock();
}
$objtv_icon = ilUtil::getTypeIconPath("lobj", $objtv["id"]);
//.........这里部分代码省略.........
示例11: fillMembershipLimitation
/**
* Show membership limitations
*
* @access protected
* @return
*/
protected function fillMembershipLimitation()
{
global $ilAccess, $ilCtrl;
include_once 'Modules/Course/classes/class.ilObjCourseGrouping.php';
if (!($items = ilObjCourseGrouping::_getGroupingItems($this->container))) {
return true;
}
$mem = new ilCustomInputGUI($this->lng->txt('groupings'));
$tpl = new ilTemplate('tpl.membership_limitation_form.html', true, true, 'Services/Membership');
$tpl->setVariable('LIMIT_INTRO', $this->lng->txt($this->type . '_grp_info_reg'));
foreach ($items as $ref_id) {
$obj_id = ilObject::_lookupObjId($ref_id);
$type = ilObject::_lookupType($obj_id);
$title = ilObject::_lookupTitle($obj_id);
if ($ilAccess->checkAccess('visible', '', $ref_id, $type)) {
include_once './Services/Link/classes/class.ilLink.php';
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
$tpl->setVariable('LINK_ITEM', $ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
$tpl->setVariable('ITEM_LINKED_TITLE', $title);
} else {
$tpl->setVariable('ITEM_TITLE');
}
$tpl->setCurrentBlock('items');
$tpl->setVariable('TYPE_ICON', ilUtil::getTypeIconPath($type, $obj_id, 'tiny'));
$tpl->setVariable('ALT_ICON', $this->lng->txt('obj_' . $type));
$tpl->parseCurrentBlock();
}
$mem->setHtml($tpl->get());
if (!ilObjCourseGrouping::_checkGroupingDependencies($this->container)) {
$mem->setAlert($this->container->getMessage());
$this->enableRegistration(false);
}
$this->form->addItem($mem);
}
示例12: __renderItem
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);
}
}
示例13: fillRow
/**
* fill row
*
* @access protected
* @param array row data
* @return
*/
protected function fillRow($a_set)
{
foreach ($a_set['sub'] as $sub_data) {
// Indentation
for ($i = $sub_data['depth']; $i > 1; $i--) {
$this->tpl->touchBlock('begin_depth');
$this->tpl->touchBlock('end_depth');
}
$this->tpl->setCurrentBlock('chapter');
include_once 'Modules/LearningModule/classes/class.ilLMObject.php';
if ($this->objective_lm->isChapterAssigned($a_set['id'], $sub_data['id'])) {
$this->tpl->setVariable('CHAP_CHECKED', 'checked="checked"');
}
$this->tpl->setVariable('CHAPTER_TITLE', ilLMObject::_lookupTitle($sub_data['id']));
$this->tpl->setVariable('CHAP_ID', $a_set['id'] . '_' . $sub_data['id']);
$this->tpl->setVariable('CHAP_TYPE_IMG', ilUtil::getTypeIconPath($sub_data['type'], $sub_data['id'], 'tiny'));
$this->tpl->setVariable('CHAP_TYPE_ALT', $this->lng->txt('obj_' . $sub_data['type']));
$this->tpl->parseCurrentBlock();
}
if (count($a_set['sub'])) {
$this->tpl->setVariable('TXT_CHAPTER', $this->lng->txt('objs_st'));
}
$this->tpl->setVariable('VAL_ID', $a_set['id']);
if ($this->objective_lm->isAssigned($a_set['id'])) {
$this->tpl->setVariable('VAL_CHECKED', 'checked="checked"');
}
$this->tpl->setVariable('ROW_TYPE_IMG', ilUtil::getTypeIconPath($a_set['type'], $a_set['obj_id'], 'tiny'));
$this->tpl->setVariable('ROW_TYPE_ALT', $this->lng->txt('obj_' . $a_set['type']));
$this->tpl->setVariable('VAL_TITLE', $a_set['title']);
if (strlen($a_set['description'])) {
$this->tpl->setVariable('VAL_DESC', $a_set['description']);
}
}
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:40,代码来源:class.ilCourseObjectiveMaterialAssignmentTableGUI.php
示例14: renderMyCourses
protected function renderMyCourses($a_user_id)
{
global $ilAccess, $ilUser;
if ($this->getOutputMode() == "preview") {
return $this->renderMyCoursesTeaser($a_user_id);
}
if (!$this->isMyCoursesActive()) {
return;
}
$img_path = null;
if ($this->getOutputMode() == "offline") {
$this->export_material["images"][] = "./templates/default/images/icon_crs.svg";
$this->export_material["images"][] = "./templates/default/images/icon_lobj.svg";
$this->export_material["images"][] = "./templates/default/images/scorm/complete.svg";
$this->export_material["images"][] = "./templates/default/images/scorm/not_attempted.svg";
$this->export_material["images"][] = "./templates/default/images/scorm/failed.svg";
$this->export_material["images"][] = "./templates/default/images/scorm/incomplete.svg";
$img_path = "images/";
}
$user_id = $this->getPageContentUserId($a_user_id);
$data = $this->getCoursesOfUser($user_id);
if (sizeof($data)) {
$tpl = new ilTemplate("tpl.pc_my_courses.html", true, true, "Modules/Portfolio");
$tpl->setVariable("TITLE", $this->lng->txt("prtf_page_element_my_courses_title"));
$tpl->setVariable("INFO", $this->lng->txt("prtf_page_element_my_courses_info"));
// #14464
include_once "./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php";
$this->lng->loadLanguageModule("trac");
$this->lng->loadLanguageModule("crs");
include_once "./Services/Container/classes/class.ilContainerObjectiveGUI.php";
include_once "./Services/Link/classes/class.ilLink.php";
foreach ($data as $course) {
if (isset($course["lp_status"])) {
$lp_icon = ilLearningProgressBaseGUI::_getImagePathForStatus($course["lp_status"]);
$lp_alt = ilLearningProgressBaseGUI::_getStatusText($course["lp_status"]);
if ($img_path) {
$lp_icon = $img_path . basename($lp_icon);
}
$tpl->setCurrentBlock("lp_bl");
$tpl->setVariable("LP_ICON_URL", $lp_icon);
$tpl->setVariable("LP_ICON_ALT", $lp_alt);
$tpl->parseCurrentBlock();
}
if (isset($course["objectives"])) {
include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
$loc_settings = ilLOSettings::getInstanceByObjId($course["obj_id"]);
$has_initial_test = (bool) $loc_settings->getInitialTest();
foreach ($course["objectives"] as $objtv) {
$objtv_icon = ilUtil::getTypeIconPath("lobj", $objtv["id"]);
if ($img_path) {
$objtv_icon = $img_path . basename($objtv_icon);
}
$tpl->setCurrentBlock("objective_bl");
$tpl->setVariable("OBJECTIVE_TITLE", $objtv["title"]);
$tpl->setVariable("OBJTV_ICON_URL", $objtv_icon);
$tpl->setVariable("OBJTV_ICON_ALT", $this->lng->txt("crs_objectives"));
if ($objtv["type"]) {
$tpl->setVariable("LP_OBJTV_PROGRESS", ilContainerObjectiveGUI::buildObjectiveProgressBar($has_initial_test, $objtv["id"], $objtv, true));
}
$tpl->parseCurrentBlock();
}
}
// always check against current user
if ($ilAccess->checkAccessOfUser($ilUser->getId(), "read", "", $course["ref_id"], "crs") || $ilAccess->checkAccessOfUser($ilUser->getId(), "visible", "", $course["ref_id"], "crs") && $ilAccess->checkAccessOfUser($ilUser->getId(), "join", "", $course["ref_id"], "crs")) {
$tpl->setCurrentBlock("course_link_bl");
$tpl->setVariable("COURSE_LINK_TITLE", $course["title"]);
$tpl->setVariable("COURSE_LINK_URL", ilLink::_getLink($course["ref_id"]));
$tpl->parseCurrentBlock();
} else {
$tpl->setCurrentBlock("course_nolink_bl");
$tpl->setVariable("COURSE_NOLINK_TITLE", $course["title"]);
$tpl->parseCurrentBlock();
}
$crs_icon = ilUtil::getTypeIconPath("crs", $course["obj_id"]);
if ($img_path) {
$crs_icon = $img_path . basename($crs_icon);
}
$tpl->setCurrentBlock("course_bl");
$tpl->setVariable("CRS_ICON_URL", $crs_icon);
$tpl->setVariable("CRS_ICON_ALT", $this->lng->txt("obj_crs"));
$tpl->parseCurrentBlock();
}
return $tpl->get();
}
}
示例15: fillRow
/**
* fill row
*
* @access protected
* @param array row data
* @return
*/
protected function fillRow($a_set)
{
foreach ($a_set['sub'] as $sub_data) {
if ($a_set['random']) {
break;
}
if ($sub_data['description']) {
$this->tpl->setVariable('QST_DESCRIPTION', $sub_data['description']);
}
$this->tpl->setCurrentBlock('qst');
$this->tpl->setVariable('QST_TITLE', $sub_data['title']);
$this->tpl->setVariable('QST_ID', $a_set['id'] . '_' . $sub_data['id']);
switch ($this->mode) {
case ilCourseObjectiveQuestion::TYPE_SELF_ASSESSMENT:
if ($this->objective_qst_obj->isSelfAssessmentQuestion($sub_data['id'])) {
$this->tpl->setVariable('QST_CHECKED', 'checked="checked"');
}
break;
case ilCourseObjectiveQuestion::TYPE_FINAL_TEST:
if ($this->objective_qst_obj->isFinalTestQuestion($sub_data['id'])) {
$this->tpl->setVariable('QST_CHECKED', 'checked="checked"');
}
break;
}
$this->tpl->parseCurrentBlock();
}
if (count($a_set['sub']) and !$a_set['random']) {
$this->tpl->setVariable('TXT_QUESTIONS', $this->lng->txt('objs_qst'));
}
if ($a_set['random']) {
$this->tpl->setVariable('VAL_WARN', $this->lng->txt('crs_objective_random_warn'));
}
$this->tpl->setVariable('VAL_ID', $a_set['id']);
$this->tpl->setVariable('ROW_TYPE_IMG', ilUtil::getTypeIconPath($a_set['type'], $a_set['obj_id'], 'tiny'));
$this->tpl->setVariable('ROW_TYPE_ALT', $this->lng->txt('obj_' . $a_set['type']));
$this->tpl->setVariable('VAL_TITLE', $a_set['title']);
if (strlen($a_set['description'])) {
$this->tpl->setVariable('VAL_DESC', $a_set['description']);
}
}