本文整理汇总了PHP中ilUtil::formSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::formSelect方法的具体用法?PHP ilUtil::formSelect怎么用?PHP ilUtil::formSelect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUtil
的用法示例。
在下文中一共展示了ilUtil::formSelect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareRow
/**
* @param array $row
* @return array
*/
protected function prepareRow(array &$row)
{
if ((int) $row['user_id']) {
$this->ctrl->setParameter($this->parent_obj, 'usr_id', '');
if ($row['user_id'] == $this->parent_obj->object->getOwner()) {
$row['checkbox'] = ilUtil::formCheckbox(false, 'usr_id[]', $row['user_id'], true);
} else {
$row['checkbox'] = ilUtil::formCheckbox(false, 'usr_id[]', $row['user_id'], (int) $row['user_id'] ? false : true);
}
} else {
$row['checkbox'] = '';
}
$user_name = '';
if (strlen($row['lastname']) > 0) {
$user_name .= $row['lastname'] . ', ';
}
if (strlen($row['firstname']) > 0) {
$user_name .= $row['firstname'];
}
$row['user_name'] = $user_name;
if ($row['xavc_status']) {
$xavc_options = array("host" => $this->parent_obj->pluginObj->txt("presenter"), "mini-host" => $this->parent_obj->pluginObj->txt("moderator"), "view" => $this->parent_obj->pluginObj->txt("participant"), "denied" => $this->parent_obj->pluginObj->txt("denied"));
if ($row['xavc_status']) {
if ($row['user_id'] == $this->parent_obj->object->getOwner()) {
$row['xavc_status'] = $this->lng->txt("owner");
} else {
$row['xavc_status'] = ilUtil::formSelect($row['xavc_status'], 'xavc_status[' . $row['user_id'] . ']', $xavc_options);
}
} else {
$row['xavc_status'] = $this->parent_obj->pluginObj->txt('user_only_exists_at_ac_server');
}
}
}
开发者ID:HochschuleLuzern,项目名称:ILIAS_AdobeConnectPlugin,代码行数:37,代码来源:class.ilXAVCParticipantsTableGUI.php
示例2: fillRow
/**
* Fill table row
*/
protected function fillRow($a_set)
{
global $lng;
$this->nr++;
if (!$a_set["default"] && $a_set["lang"] != $this->master_lang) {
$this->tpl->setCurrentBlock("cb");
$this->tpl->setVariable("CB_NR", $this->nr);
$this->tpl->parseCurrentBlock();
}
if ($this->master_lang == "") {
$this->tpl->setCurrentBlock("rb");
$this->tpl->setVariable("RB_NR", $this->nr);
if ($a_set["default"]) {
$this->tpl->setVariable("DEF_CHECKED", "checked=\"checked\"");
}
$this->tpl->parseCurrentBlock();
} else {
if ($a_set["lang"] == $this->master_lang) {
$this->tpl->setVariable("MASTER_LANG", $lng->txt("obj_master_lang"));
}
}
if ($this->incl_desc) {
$this->tpl->setCurrentBlock("desc_row");
$this->tpl->setVariable("VAL_DESC", ilUtil::prepareFormOutput($a_set["desc"]));
$this->tpl->setVariable("DNR", $this->nr);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("NR", $this->nr);
// lang selection
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$languages = ilMDLanguageItem::_getLanguages();
$this->tpl->setVariable("LANG_SELECT", ilUtil::formSelect($a_set["lang"], "lang[" . $this->nr . "]", $languages, false, true));
$this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"]));
}
示例3: fillRow
/**
* Standard Version of Fill Row. Most likely to
* be overwritten by derived class.
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl;
if ($this->getParentObject()->checkStyleSelection()) {
$this->tpl->setCurrentBlock("class_sel");
$sel = $a_set["class"] == "" ? "FileListItem" : $a_set["class"];
$this->tpl->setVariable("CLASS_SEL", ilUtil::formSelect($sel, "class[" . $a_set["hier_id"] . ":" . $a_set["pc_id"] . "]", $this->getParentObject()->getCharacteristics(), false, true));
$this->tpl->parseCurrentBlock();
}
$this->pos += 10;
$this->tpl->setVariable("POS", $this->pos);
$this->tpl->setVariable("FID", $a_set["hier_id"] . ":" . $a_set["pc_id"]);
$this->tpl->setVariable("TXT_FILE", ilObject::_lookupTitle($a_set["id"]));
}
示例4: fillRow
/**
* Fill table row
*/
protected function fillRow($a_set)
{
global $lng;
if ($a_set["page_id"] > 0) {
$this->tpl->setCurrentBlock("cb");
$this->tpl->setVariable("PAGE_ID", $a_set["page_id"]);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("ord");
$this->tpl->setVariable("PAGE_ID_ORD", $a_set["page_id"]);
$this->tpl->setVariable("VAL_ORD", $a_set["ord"]);
$this->tpl->parseCurrentBlock();
$this->tpl->setVariable("PAGE_TITLE", ilWikiPage::lookupTitle($a_set["page_id"]));
$this->tpl->setVariable("SEL_INDENT", ilUtil::formSelect($a_set["indent"], "indent[" . $a_set["page_id"] . "]", array(0 => "0", 1 => "1", 2 => "2"), false, true));
} else {
$this->tpl->setVariable("PAGE_TITLE", $lng->txt("wiki_start_page"));
}
}
示例5: fillRow
/**
* Standard Version of Fill Row. Most likely to
* be overwritten by derived class.
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl, $ilAccess;
$i = $a_set["Nr"];
$this->tpl->setVariable("CHECKBOX", ilUtil::formCheckBox("", "area[]", $i));
$this->tpl->setVariable("VAR_NAME", "name_" . $i);
$this->tpl->setVariable("VAL_NAME", $a_set["Link"]["Title"]);
$this->tpl->setVariable("VAL_SHAPE", $a_set["Shape"]);
$this->tpl->setVariable("VAL_HIGHL_MODE", ilUtil::formSelect($a_set["HighlightMode"], "hl_mode_" . $i, $this->highl_modes, false, true));
$this->tpl->setVariable("VAL_HIGHL_CLASS", ilUtil::formSelect($a_set["HighlightClass"], "hl_class_" . $i, $this->highl_classes, false, true));
$this->tpl->setVariable("VAL_COORDS", implode(explode(",", $a_set["Coords"]), ", "));
switch ($a_set["Link"]["LinkType"]) {
case "ExtLink":
$this->tpl->setVariable("VAL_LINK", $a_set["Link"]["Href"]);
break;
case "IntLink":
$link_str = $this->parent_obj->getMapAreaLinkString($a_set["Link"]["Target"], $a_set["Link"]["Type"], $a_set["Link"]["TargetFrame"]);
$this->tpl->setVariable("VAL_LINK", $link_str);
break;
}
}
示例6: _getPurposeSelect
function _getPurposeSelect($a_selected, $a_name, $prepend = array(), $a_options_only = false)
{
global $lng;
$items = array('Discipline', 'Idea', 'Prerequisite', 'EducationalObjective', 'AccessibilityRestrictions', 'EducationalLevel', 'SkillLevel', 'SecurityLevel', 'Competency');
foreach ($prepend as $value => $translation) {
$options[$value] = $translation;
}
foreach ($items as $item) {
$options[$item] = $item;
}
// BEGIN PATCH Lucene search
return $a_options_only ? $options : ilUtil::formSelect($a_selected, $a_name, $options, false, true);
// END PATCH Lucene Search
return ilUtil::formSelect($a_selected, $a_name, $options, false, true);
}
示例7: viewDiskQuotaReport
/**
* The disk quota report list shows user accounts, their disk quota and their
* disk usage, as well as the last time a reminder was sent.
*/
public function viewDiskQuotaReport()
{
global $rbacsystem, $ilErr, $ilSetting, $lng;
if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
$ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING);
}
$this->tabs_gui->setTabActive('disk_quota');
$this->addDiskQuotaSubtabs('disk_quota_report');
// nothing to do if disk quota is not active
require_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
if (!ilDiskQuotaActivationChecker::_isActive()) {
return;
}
// get the form
$this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.disk_quota_report.html', "Services/WebDAV");
// get the date of the last update
require_once "./Services/WebDAV/classes/class.ilDiskQuotaChecker.php";
$last_update = ilDiskQuotaChecker::_lookupDiskUsageReportLastUpdate();
if ($last_update == null) {
// nothing to do if disk usage report has not been run
$this->tpl->setVariable('LAST_UPDATE_TEXT', $lng->txt('disk_quota_report_not_run_yet'));
return;
} else {
$this->tpl->setVariable('LAST_UPDATE_TEXT', $lng->txt('last_update') . ': ' . ilFormat::formatDate($last_update, 'datetime', true));
}
// Filter
$_SESSION['quota_usage_filter'] = isset($_POST['usage_filter']) ? $_POST['usage_filter'] : $_SESSION['quota_usage_filter'];
if ($_SESSION['quota_usage_filter'] == 0) {
$_SESSION['quota_usage_filter'] = 4;
}
$_SESSION['quota_access_filter'] = isset($_POST['access_filter']) ? $_POST['access_filter'] : $_SESSION['quota_access_filter'];
if ($_SESSION['quota_access_filter'] == 0) {
$_SESSION['quota_access_filter'] = 1;
}
$usage_action[1] = $lng->txt('all_users');
$usage_action[2] = $lng->txt('filter_users_without_disk_usage');
$usage_action[3] = $lng->txt('filter_users_with_disk_usage');
$usage_action[4] = $lng->txt('filter_users_with_exceeded_disk_quota');
$access_action[1] = $lng->txt('all_users');
$access_action[2] = $lng->txt('filter_users_with_access');
$access_action[3] = $lng->txt('filter_users_without_access');
$select_usage_filter = ilUtil::formSelect($_SESSION['quota_usage_filter'], "usage_filter", $usage_action, false, true);
$select_access_filter = ilUtil::formSelect($_SESSION['quota_access_filter'], "access_filter", $access_action, false, true);
$this->tpl->setCurrentBlock("filter");
$this->tpl->setVariable("FILTER_TXT_FILTER", $lng->txt('filter'));
$this->tpl->setVariable("SELECT_USAGE_FILTER", $select_usage_filter);
$this->tpl->setVariable("SELECT_ACCESS_FILTER", $select_access_filter);
$this->tpl->setVariable("FILTER_ACTION", $this->ctrl->getLinkTarget($this, 'viewDiskQuotaReport'));
$this->tpl->setVariable("FILTER_NAME", 'view');
$this->tpl->setVariable("FILTER_VALUE", $lng->txt('apply_filter'));
$this->tpl->parseCurrentBlock();
// load templates for table
$a_tpl = new ilTemplate('tpl.table.html', true, true);
$a_tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
// create table
require_once './Services/Table/classes/class.ilTableGUI.php';
$tbl = new ilTableGUI(0, false);
// title & header columns
$header_vars = array('login', 'firstname', 'lastname', 'email', 'access_until', 'last_login', 'disk_quota', 'disk_usage', 'last_reminder');
$tbl->setHeaderNames(array($lng->txt('login'), $lng->txt('firstname'), $lng->txt('lastname'), $lng->txt('email'), $lng->txt('access_until'), $lng->txt('last_login'), $lng->txt('disk_quota'), $lng->txt('disk_usage'), $lng->txt('last_reminder')));
$tbl->setHeaderVars($header_vars, $this->ctrl->getParameterArray($this, 'viewDiskQuotaReport', false));
$tbl->enable("numinfo_header");
$tbl->setFormName("cmd");
$tbl->setSelectAllCheckbox("id");
// sorting
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
// fetch the data
$data = ilDiskQuotaChecker::_fetchDiskQuotaReport($_SESSION['quota_usage_filter'], $_SESSION['quota_access_filter'], $header_vars[$tbl->getOrderColumn()], $tbl->getOrderDirection());
// paging
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setMaxCount(count($data));
// footer
$tbl->setFooter("tblfooter", $lng->txt("previous"), $lng->txt("next"));
// render table
$tbl->setTemplate($a_tpl);
// render rows
$count = 0;
for ($i = $tbl->getOffset(); $i < count($data) && $i < $tbl->getOffset() + $tbl->getLimit(); $i++) {
$row = $data[$i];
// build columns
foreach ($header_vars as $key) {
switch ($key) {
case 'login':
//build link
$this->ctrl->setParameterByClass("ilobjusergui", "ref_id", "7");
$this->ctrl->setParameterByClass("ilobjusergui", "obj_id", $row["usr_id"]);
$link = $this->ctrl->getLinkTargetByClass("ilobjusergui", "view");
$tbl_content_cell = '<a href="' . $link . '">' . htmlspecialchars($row[$key]) . '</a>';
break;
case 'disk_quota':
if ($row['role_id'] == SYSTEM_ROLE_ID) {
$tbl_content_cell = "<span class=\"smallgreen\">" . $lng->txt('access_unlimited') . '</span>';
} else {
$tbl_content_cell = ilFormat::formatSize($row[$key], 'short');
//.........这里部分代码省略.........
示例8: selectArchiveLanguage
function selectArchiveLanguage()
{
global $ilAccess;
// MINIMUM ACCESS LEVEL = 'write'
if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) {
$ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->MESSAGE);
}
foreach ($this->lng->getInstalledLanguages() as $lang_code) {
$actions["{$lang_code}"] = $this->lng->txt('lang_' . $lang_code);
if ($this->lng->getLangKey() == $lang_code) {
$selected = $lang_code;
}
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_selectLanguage.html", 'Modules/Course');
$this->tpl->setVariable("LANGUAGE_SELECTION", $this->lng->txt('crs_archive_language_selection'));
$this->tpl->setVariable("LANGUAGE", $this->lng->txt('obj_lng'));
$this->tpl->setVariable("INFO_TXT", $this->lng->txt('crs_select_archive_language'));
$this->tpl->setVariable("SELECT_FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("LANG_SELECTOR", ilUtil::formSelect($selected, 'lang', $actions, false, true));
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt('cancel'));
$this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt('crs_add_html_archive'));
return true;
}
示例9: editObject
/**
* display edit form
*
* @access public
*/
function editObject()
{
global $rbacsystem, $rbacreview;
if (!$rbacsystem->checkAccess("edit_permission", $_GET["ref_id"])) {
$this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
}
//prepare objectlist
$this->data = array();
$this->data["data"] = array();
$this->data["ctrl"] = array();
$this->data["cols"] = array("type", "operation", "description", "status");
$ops_valid = $rbacreview->getOperationsOnType($this->obj_id);
if ($ops_arr = ilRbacReview::_getOperationList('', $a_order, $a_direction)) {
$options = array("e" => "enabled", "d" => "disabled");
foreach ($ops_arr as $key => $ops) {
// BEGIN ROW
if (in_array($ops["ops_id"], $ops_valid)) {
$ops_status = 'e';
} else {
$ops_status = 'd';
}
$obj = $ops["ops_id"];
$ops_options = ilUtil::formSelect($ops_status, "id[{$obj}]", $options);
//visible data part
$this->data["data"][] = array("type" => "perm", "operation" => $ops["operation"], "description" => $ops["desc"], "status" => $ops_status, "status_html" => $ops_options, "obj_id" => $val["ops_id"]);
}
}
//if typedata
$this->maxcount = count($this->data["data"]);
// sorting array
$this->data["data"] = ilUtil::sortArray($this->data["data"], $_GET["sort_by"], $_GET["sort_order"]);
// now compute control information
foreach ($this->data["data"] as $key => $val) {
$this->data["ctrl"][$key] = array("obj_id" => $val["obj_id"], "type" => $val["type"]);
unset($this->data["data"][$key]["obj_id"]);
$this->data["data"][$key]["status"] = $this->data["data"][$key]["status_html"];
unset($this->data["data"][$key]["status_html"]);
}
// build table
include_once "./Services/Table/classes/class.ilTableGUI.php";
// load template for table
$this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
// load template for table content data
$this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
$num = 0;
$obj_str = $this->call_by_reference ? "" : "&obj_id=" . $this->obj_id;
$this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=" . $this->ref_id . "{$obj_str}&cmd=save");
// create table
$tbl = new ilTableGUI();
// title & header columns
$tbl->setTitle($this->lng->txt("edit_operations") . " " . strtolower($this->lng->txt("of")) . " '" . $this->object->getTitle() . "'", "icon_" . $this->object->getType() . "_b.png", $this->lng->txt("obj_" . $this->object->getType()));
$tbl->setHelp("tbl_help.php", "icon_help.png", $this->lng->txt("help"));
foreach ($this->data["cols"] as $val) {
$header_names[] = $this->lng->txt($val);
}
$tbl->setHeaderNames($header_names);
$header_params = array("ref_id" => $this->ref_id, "obj_id" => $this->id, "cmd" => "edit");
$tbl->setHeaderVars($this->data["cols"], $header_params);
// control
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit(0);
$tbl->setOffset(0);
$tbl->setMaxCount($this->maxcount);
// SHOW VALID ACTIONS
$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.png"));
$this->tpl->setVariable("COLUMN_COUNTS", count($this->data["cols"]));
// footer
$tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
//$tbl->disable("footer");
// render table
$tbl->render();
if (is_array($this->data["data"][0])) {
//table cell
for ($i = 0; $i < count($this->data["data"]); $i++) {
$data = $this->data["data"][$i];
$ctrl = $this->data["ctrl"][$i];
// color changing
$css_row = ilUtil::switchColor($i + 1, "tblrow1", "tblrow2");
$this->tpl->setCurrentBlock("table_cell");
$this->tpl->setVariable("CELLSTYLE", "tblrow1");
$this->tpl->parseCurrentBlock();
foreach ($data as $key => $val) {
$this->tpl->setCurrentBlock("text");
if ($key == "type") {
$val = ilUtil::getImageTagByType($val, $this->tpl->tplPath);
}
$this->tpl->setVariable("TEXT_CONTENT", $val);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("table_cell");
$this->tpl->parseCurrentBlock();
}
//foreach
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("save"));
$this->tpl->setCurrentBlock("tbl_content");
//.........这里部分代码省略.........
示例10: viewObject
//.........这里部分代码省略.........
break;
case "conflicts":
$former_file = $this->object->getCustLangPath() . '/ilias_' . $this->object->key . '.lang';
if (!is_readable($former_file)) {
ilUtil::sendFailure(sprintf($this->lng->txt("language_former_file_missing"), $former_file) . '<br />' . $this->lng->txt("language_former_file_description"), false);
$translations = array();
break;
}
$global_file_obj = $this->object->getGlobalLanguageFile();
$former_file_obj = new ilLanguageFile($former_file);
$former_file_obj->read();
$global_changes = array_diff_assoc($global_file_obj->getAllValues(), $former_file_obj->getAllValues());
if (!count($global_changes)) {
ilUtil::sendInfo(sprintf($this->lng->txt("language_former_file_equal"), $former_file) . '<br />' . $this->lng->txt("language_former_file_description"), false);
$translations = array();
break;
}
$translations = $this->object->getChangedValues($filter_modules, $filter_pattern);
$translations = array_intersect_key($translations, $global_changes);
break;
case "all":
default:
$translations = $this->object->getAllValues($filter_modules, $filter_pattern);
}
// show the filter section
$this->tpl->setCurrentBlock("filter");
// filter by language module
$options = array();
$options[""] = $this->lng->txt("language_all_modules");
$modules = ilObjLanguageExt::_getModules($this->object->key);
foreach ($modules as $mod) {
$options[$mod] = $mod;
}
$this->tpl->setVariable("SELECT_MODULE", ilUtil::formSelect($filter_module, "filter_module", $options, false, true));
// filter by mode
$options = array();
$options["all"] = $this->lng->txt("language_scope_global");
$options["changed"] = $this->lng->txt("language_scope_local");
if ($this->langmode) {
$options["added"] = $this->lng->txt("language_scope_added");
}
$options["unchanged"] = $this->lng->txt("language_scope_unchanged");
$options["equal"] = $this->lng->txt("language_scope_equal");
$options["different"] = $this->lng->txt("language_scope_different");
$options["commented"] = $this->lng->txt("language_scope_commented");
if ($this->langmode) {
$options["dbremarks"] = $this->lng->txt("language_scope_dbremarks");
}
$options["conflicts"] = $this->lng->txt("language_scope_conflicts");
$this->tpl->setVariable("SELECT_MODE", ilUtil::formSelect($filter_mode, "filter_mode", $options, false, true));
// filter by pattern
$this->tpl->setVariable("PATTERN_NAME", "filter_pattern");
$this->tpl->setVariable("PATTERN_VALUE", ilUtil::prepareFormOutput($filter_pattern));
// and general filter variables
$this->tpl->setVariable("FILTER_ACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_FILTER", $this->lng->txt("filter"));
$this->tpl->setVariable("OFFSET_NAME", "offset");
$this->tpl->setVariable("OFFSET_VALUE", "0");
$this->tpl->setVariable("TXT_APPLY_FILTER", $this->lng->txt("apply_filter"));
$this->tpl->setVariable("CMD_FILTER", "view");
$this->tpl->parseCurrentBlock();
}
// show the compare section
$this->tpl->setCurrentBlock("compare");
$this->tpl->setVariable("COMPARE_ACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_COMPARE", $this->lng->txt("language_compare"));
示例11: changeMemberObject
/**
* displays form in which the member-status can be changed
* @access public
*/
function changeMemberObject()
{
global $rbacreview, $ilUser;
$this->__setSubTabs('members');
$member_ids = array();
if (isset($_POST['user_id'])) {
$member_ids = $_POST['user_id'];
} else {
if (isset($_GET['mem_id'])) {
$member_ids[0] = $_GET['mem_id'];
} else {
if (isset($_GET['mem_id_arr'])) {
$member_ids = explode(',', $_GET['mem_id_arr']);
}
}
}
if (empty($member_ids[0])) {
$this->ilErr->raiseError($this->lng->txt('no_checkbox'), $this->ilErr->MESSAGE);
}
if (!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) && !in_array($ilUser->getId(), $this->object->getAdminIds())) {
$this->ilErr->raiseError($this->lng->txt('grp_err_no_permission'), $this->ilErr->MESSAGE);
}
$stati = array_flip($this->object->getLocalRoles(true));
// fetch docent or student assignment form all coursemembers from iLinc server
$docent_ids = $this->object->getiLincMemberIds(true);
$student_ids = $this->object->getiLincMemberIds(false);
$data = array();
//build data structure
foreach ($member_ids as $member_id) {
$member = ilObjectFactory::getInstanceByObjId($member_id);
$mem_status = $this->object->getMemberRoles($member_id);
include_once 'Modules/ILinc/classes/class.ilObjiLincUser.php';
$ilinc_user = new ilObjiLincUser($member);
$ilinc_status = $this->object->checkiLincMemberStatus($ilinc_user->id, $docent_ids, $student_ids);
$docent = 0;
$student = 0;
if ($ilinc_status == ILINC_MEMBER_DOCENT) {
$docent = 1;
} else {
if ($ilinc_status == ILINC_MEMBER_STUDENT) {
$student = 1;
}
}
$radio1 = ilUtil::formRadioButton($docent, 'ilinc_member_status_select[' . $member->getId() . '][' . $ilinc_user->id . ']', ILINC_MEMBER_DOCENT);
$radio2 = ilUtil::formRadioButton($student, 'ilinc_member_status_select[' . $member->getId() . '][' . $ilinc_user->id . ']', ILINC_MEMBER_STUDENT);
$data[$member->getId()] = array('login' => $member->getLogin(), 'firstname' => $member->getFirstname(), 'lastname' => $member->getLastname(), 'attending_as' => $radio1 . ' ' . $this->lng->txt('ilinc_docent') . '<br />' . $radio2 . ' ' . $this->lng->txt('ilinc_student'), 'grp_role' => ilUtil::formSelect($mem_status, 'member_status_select[' . $member->getId() . '][]', $stati, true, true, 3));
}
unset($member);
unset($ilinc_user);
include_once 'Modules/ILinc/classes/class.iliLinkMembersTableGUI.php';
$this->ctrl->setParameter($this, 'mem_id_arr', implode(',', $member_ids));
$oTable = new iliLinkMembersTableGUI($this, $data, 'change', 'changeMember', 'changeMember');
$oTable->setTitle($this->lng->txt('grp_mem_change_status'), 'icon_usr_b.png', $this->lng->txt('grp_mem_change_status'));
return $this->tpl->setContent($oTable->getHTML());
}
示例12: fillRow
/**
* Fill template row
* @param array $a_set
*/
protected function fillRow($a_set)
{
global $objDefinition;
include_once './Services/Link/classes/class.ilLink.php';
$this->tpl->setCurrentBlock('item_row');
$this->tpl->setVariable('ITEM_ID', $a_set['id']);
$this->tpl->setVariable('COLL_TITLE', $a_set['title']);
$this->tpl->setVariable('COLL_DESC', $a_set['description']);
if ($this->getMode() == ilLPObjSettings::LP_MODE_SCORM) {
$this->tpl->setVariable('TYPE_IMG', ilUtil::getImagePath('icon_sco_s.png'));
$this->tpl->setVariable('ALT_IMG', $this->lng->txt('obj_sco'));
} else {
if ($objDefinition->isPluginTypeName($a_set["type"])) {
$alt = ilPlugin::lookupTxt("rep_robj", $a_set['type'], "obj_" . $a_set['type']);
} else {
$alt = $this->lng->txt('obj_' . $a_set['type']);
}
$this->tpl->setVariable('ALT_IMG', $alt);
$this->tpl->setVariable('TYPE_IMG', ilObject::_getIcon("", "tiny", $a_set['type']));
if ($this->getMode() != ilLPObjSettings::LP_MODE_COLLECTION_MANUAL && $this->getMode() != ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
$this->tpl->setVariable('COLL_LINK', ilLink::_getLink($a_set['ref_id'], $a_set['type']));
$this->tpl->setVariable('COLL_FRAME', ilFrameTargetInfo::_getFrame('MainContent', $a_set['type']));
include_once './Services/Tree/classes/class.ilPathGUI.php';
$path = new ilPathGUI();
$this->tpl->setVariable('COLL_PATH', $this->lng->txt('path') . ': ' . $path->getPath($this->getNode(), $a_set['ref_id']));
$mode = $a_set['mode_id'];
if ($mode != ilLPObjSettings::LP_MODE_DEACTIVATED && $mode != ilLPObjSettings::LP_MODE_UNDEFINED) {
$this->tpl->setVariable("COLL_MODE", $a_set['mode']);
} else {
$this->tpl->setVariable("COLL_MODE", "");
$this->tpl->setVariable("COLL_MODE_DEACTIVATED", $a_set['mode']);
}
if ($a_set["anonymized"]) {
$this->tpl->setVariable("ANONYMIZED", $this->lng->txt('trac_anonymized_info_short'));
}
} else {
if ($this->getMode() == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
// handle tlt settings
$this->tpl->setCurrentBlock("tlt");
$this->tpl->setVariable("TXT_MONTH", $this->lng->txt('md_months'));
$this->tpl->setVariable("TXT_DAYS", $this->lng->txt('md_days'));
$this->tpl->setVariable("TXT_TIME", $this->lng->txt('md_time'));
$this->tpl->setVariable("TLT_HINT", '(hh:mm)');
// seconds to units
$mon = floor($a_set["tlt"] / (60 * 60 * 24 * 30));
$tlt = $a_set["tlt"] % (60 * 60 * 24 * 30);
$day = floor($tlt / (60 * 60 * 24));
$tlt = $tlt % (60 * 60 * 24);
$hr = floor($tlt / (60 * 60));
$tlt = $tlt % (60 * 60);
$min = floor($tlt / 60);
$options = array();
for ($i = 0; $i <= 24; $i++) {
$options[$i] = sprintf('%02d', $i);
}
$this->tpl->setVariable("SEL_MONTHS", ilUtil::formSelect($mon, 'tlt[' . $a_set['id'] . '][mo]', $options, false, true));
for ($i = 0; $i <= 31; $i++) {
$options[$i] = sprintf('%02d', $i);
}
$this->tpl->setVariable("SEL_DAYS", ilUtil::formSelect($day, 'tlt[' . $a_set['id'] . '][d]', $options, false, true));
$this->tpl->setVariable("SEL_TLT", ilUtil::makeTimeSelect('tlt[' . $a_set['id'] . ']', true, $hr, $min, null, false));
$this->tpl->parseCurrentBlock();
}
}
}
// Assigned ?
$this->tpl->setVariable("ASSIGNED_IMG_OK", $a_set['status'] ? ilUtil::getImagePath('icon_ok.png') : ilUtil::getImagePath('icon_not_ok.png'));
$this->tpl->setVariable("ASSIGNED_STATUS", $a_set['status'] ? $this->lng->txt('trac_assigned') : $this->lng->txt('trac_not_assigned'));
$this->tpl->parseCurrentBlock();
// Parse grouped items
foreach ((array) $a_set['grouped'] as $item) {
$this->fillRow($item);
}
// show num obligatory info
if (count($a_set['grouped'])) {
$this->tpl->setCurrentBlock('num_passed_items');
$this->tpl->setVariable('MIN_PASSED_TXT', $this->lng->txt('trac_min_passed'));
$this->tpl->setVariable('NUM_OBLIGATORY', $a_set['num_obligatory']);
$this->tpl->setVariable('GRP_ID', $a_set['grouping_id']);
$this->tpl->parseCurrentBlock();
}
}
示例13: showEntrySelector
function showEntrySelector()
{
global $ilTabs, $ilCtrl;
$this->setTabs();
$ilTabs->setTabActive("settings");
$this->setSubTabs("cont_lm_menu");
$ilCtrl->saveParameter($this, array("menu_entry"));
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_menu_object_selector.html", "Modules/LearningModule");
ilUtil::sendInfo($this->lng->txt("lm_menu_select_object_to_add"));
require_once "./Modules/LearningModule/classes/class.ilLMMenuObjectSelector.php";
$exp = new ilLMMenuObjectSelector($this->ctrl->getLinkTarget($this, 'test'), $this);
$exp->setExpand($_GET["lm_menu_expand"] ? $_GET["lm_menu_expand"] : $this->tree->readRootId());
$exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'showEntrySelector'));
$exp->setTargetGet("ref_id");
$exp->setRefId($this->cur_ref_id);
$sel_types = array('mcst', 'mep', 'cat', 'lm', 'dbk', 'glo', 'frm', 'exc', 'tst', 'svy', 'chat', 'wiki', 'sahs', "crs", "grp", "book", "tst", "file");
$exp->setSelectableTypes($sel_types);
//$exp->setTargetGet("obj_id");
// build html-output
$exp->setOutput(0);
$output = $exp->getOutput();
// get page ids
foreach ($exp->format_options as $node) {
if (!$node["container"]) {
$pages[] = $node["child"];
}
}
//$this->tpl->setCurrentBlock("content");
//var_dump($this->object->getPublicAccessMode());
// access mode selector
$this->tpl->setVariable("TXT_SET_PUBLIC_MODE", $this->lng->txt("set_public_mode"));
$this->tpl->setVariable("TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt("choose_public_mode"));
$modes = array("complete" => $this->lng->txt("all_pages"), "selected" => $this->lng->txt("selected_pages_only"));
$select_public_mode = ilUtil::formSelect($this->object->getPublicAccessMode(), "lm_public_mode", $modes, false, true);
$this->tpl->setVariable("SELECT_PUBLIC_MODE", $select_public_mode);
$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("choose_public_pages"));
$this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
$this->tpl->setVariable("EXPLORER", $output);
$this->tpl->setVariable("ONCLICK", $js_pages);
$this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
$this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
$this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getLinkTarget($this, "savePublicSection"));
//$this->tpl->parseCurrentBlock();
}
示例14: showLinkHelp
/**
* Show link help list
*/
function showLinkHelp()
{
global $ilUser, $ilCtrl;
// filter link types
if (!$this->filter_white_list) {
foreach ($this->filter_link_types as $link_type) {
unset($this->ltypes[$link_type]);
}
} else {
$ltypes = array();
foreach ($this->ltypes as $k => $l) {
if (in_array($k, $this->filter_link_types)) {
$ltypes[$k] = $l;
}
}
$this->ltypes = $ltypes;
}
// determine link type and target
$this->determineLinkType();
$ltype = $this->link_target != "" ? $this->link_type . "_" . $this->link_target : $this->link_type;
$def_type = ilObject::_lookupType($this->default_obj, true);
// determine content object id
switch ($this->link_type) {
case "PageObject":
case "StructureObject":
if (empty($_SESSION["il_link_cont_obj"]) && ($def_type != "mep" && $def_type != "glo")) {
$_SESSION["il_link_cont_obj"] = $this->default_obj;
}
break;
case "GlossaryItem":
if (empty($_SESSION["il_link_glossary"]) && $def_type == "glo") {
$_SESSION["il_link_glossary"] = $this->default_obj;
}
break;
case "Media":
if (empty($_SESSION["il_link_mep"]) && $def_type == "mep") {
$_SESSION["il_link_mep"] = $this->default_obj;
}
break;
}
/*
$target_str = ($link_target == "")
? ""
: " target=\"".$link_target."\" ";*/
$target_str = $this->link_target == "" ? "" : " target=\"" . $this->link_target . "\"";
//echo "-".$this->link_type."-";
if ($this->link_type == "GlossaryItem" && (empty($_SESSION["il_link_glossary"]) || !in_array(ilObject::_lookupType($_SESSION["il_link_glossary"], true), array("glo")))) {
$this->changeTargetObject("glo");
}
if (($this->link_type == "PageObject" || $this->link_type == "StructureObject") && (empty($_SESSION["il_link_cont_obj"]) || !in_array(ilObject::_lookupType($_SESSION["il_link_cont_obj"], true), array("lm", "dbk")))) {
$this->changeTargetObject("cont_obj");
}
if ($ilCtrl->isAsynch()) {
$tpl = new ilTemplate("tpl.link_help_asynch.html", true, true, "Modules/LearningModule");
} else {
$tpl =& new ilTemplate("tpl.link_help.html", true, true, "Modules/LearningModule");
$tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
}
switch ($this->link_type) {
case "GlossaryItem":
$this->ctrl->setParameter($this, "target_type", "glo");
break;
case "PageObject":
case "StructureObject":
$this->ctrl->setParameter($this, "target_type", "cont_obj");
break;
case "Media":
$this->ctrl->setParameter($this, "target_type", "mep");
break;
default:
break;
}
//echo "<br><br>:".$this->ctrl->getFormAction($this).":";
//echo "<br>link_type:".$this->link_type;
//echo "<br>cont_obj:".$_SESSION["il_link_cont_obj"];
//echo "<br>link_mep".$_SESSION["il_link_mep"];
//echo $this->ctrl->getFormAction($this, "", "", true);
$tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "changeLinkType", "", true));
$tpl->setVariable("FORMACTION2", $this->ctrl->getFormAction($this));
$tpl->setVariable("TXT_HELP_HEADER", $this->lng->txt("cont_link_select"));
$tpl->setVariable("TXT_TYPE", $this->lng->txt("cont_link_type"));
//echo "<br><br>".$ltype;
$select_ltype = ilUtil::formSelect($ltype, "ltype", $this->ltypes, false, true, "0", "", array("id" => "ilIntLinkTypeSelector"));
$tpl->setVariable("SELECT_TYPE", $select_ltype);
$tpl->setVariable("CMD_CHANGETYPE", "changeLinkType");
$tpl->setVariable("BTN_CHANGETYPE", $this->lng->txt("cont_change_type"));
/* if ($this->isEnabledJavaScript())
{
$tpl->setVariable("BTN_CLOSE_JS", $this->lng->txt("close"));
}
else
{*/
$tpl->setVariable("CMD_CLOSE", "closeLinkHelp");
$tpl->setVariable("BTN_CLOSE", $this->lng->txt("close"));
// }
$chapterRowBlock = "chapter_row";
$anchor_row_block = "anchor_link";
//.........这里部分代码省略.........
示例15: initStylePropertiesForm
/**
* Init style properties form
*/
function initStylePropertiesForm()
{
global $ilCtrl, $lng, $ilTabs, $ilSetting;
$lng->loadLanguageModule("style");
$this->setSubTabs("settings", "style");
$ilTabs->setTabActive("settings");
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$fixed_style = $ilSetting->get("fixed_content_style_id");
$style_id = $this->object->getStyleSheetId();
if ($fixed_style > 0) {
$st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
$st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")");
$this->form->addItem($st);
} else {
$st_styles = ilObjStyleSheet::_getStandardStyles(true, false, $_GET["ref_id"]);
$st_styles[0] = $this->lng->txt("default");
ksort($st_styles);
if ($style_id > 0) {
// individual style
if (!ilObjStyleSheet::_lookupStandard($style_id)) {
$st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
$st->setValue(ilObject::_lookupTitle($style_id));
$this->form->addItem($st);
//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit"));
// delete command
$this->form->addCommandButton("editStyle", $lng->txt("cont_edit_style"));
$this->form->addCommandButton("deleteStyle", $lng->txt("cont_delete_style"));
//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete"));
}
}
if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) {
$style_sel = ilUtil::formSelect($style_id, "style_id", $st_styles, false, true);
$style_sel = new ilSelectInputGUI($lng->txt("cont_current_style"), "style_id");
$style_sel->setOptions($st_styles);
$style_sel->setValue($style_id);
$this->form->addItem($style_sel);
//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create"));
$this->form->addCommandButton("saveStyleSettings", $lng->txt("save"));
$this->form->addCommandButton("createStyle", $lng->txt("sty_create_ind_style"));
}
}
$this->form->setTitle($lng->txt("cont_style"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
}