本文整理汇总了PHP中ilUtil::switchColor方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::switchColor方法的具体用法?PHP ilUtil::switchColor怎么用?PHP ilUtil::switchColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUtil
的用法示例。
在下文中一共展示了ilUtil::switchColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showTrackingItem
/**
* show tracking data of item
*/
function showTrackingItem()
{
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.scorm2004_track_item.html", "Modules/Scorm2004");
$num = 2;
$this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=" . $this->ref_id . "{$obj_str}&cmd=gateway");
// create table
$tbl = new ilTableGUI();
include_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php";
$sc_item =& new ilSCORMItem($_GET["obj_id"]);
// title & header columns
$user = new ilObjUser($_GET["user_id"]);
$tbl->setTitle($user->getLastname() . ", " . $user->getFirstname());
$tbl->setHeaderNames(array($this->lng->txt("title"), $this->lng->txt("cont_status"), $this->lng->txt("cont_time"), $this->lng->txt("cont_score")));
$header_params = array("ref_id" => $this->ref_id, "cmd" => $_GET["cmd"], "cmdClass" => get_class($this), "obj_id" => $_GET["obj_id"], "baseClass" => "ilSAHSEditGUI", 'user_id' => $_GET["user_id"]);
$cols = array("title", "status", "time", "score");
$tbl->setHeaderVars($cols, $header_params);
//$tbl->setColumnWidth(array("25%",));
// control
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setMaxCount($this->maxcount);
//$this->tpl->setVariable("COLUMN_COUNTS",count($this->data["cols"]));
//$this->showActions(true);
// footer
$tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
#$tbl->disable("footer");
$tr_data = $this->object->getTrackingDataAgg($_GET["user_id"]);
//$objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]);
$tbl->setMaxCount(count($tr_data));
$tr_data = array_slice($tr_data, $_GET["offset"], $_GET["limit"]);
$tbl->render();
if (count($tr_data) > 0) {
foreach ($tr_data as $data) {
$this->tpl->setCurrentBlock("tbl_content");
$this->tpl->setVariable("VAL_TITLE", $data["title"]);
$this->ctrl->setParameter($this, "user_id", $_GET["user_id"]);
$this->ctrl->setParameter($this, "obj_id", $data["sco_id"]);
$this->tpl->setVariable("LINK_SCO", $this->ctrl->getLinkTarget($this, "showTrackingItemPerUser"));
$this->tpl->setVariable("VAL_TIME", $data["time"]);
$this->tpl->setVariable("VAL_STATUS", $data["status"]);
$this->tpl->setVariable("VAL_SCORE", $data["score"]);
$css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->parseCurrentBlock();
}
} else {
$this->tpl->setCurrentBlock("notfound");
$this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
$this->tpl->setVariable("NUM_COLS", $num);
$this->tpl->parseCurrentBlock();
}
}
示例2: pages
function pages()
{
global $tree, $tpl, $ilToolbar, $ilCtrl, $lng;
$this->setTabs();
$this->setContentSubTabs("pages");
if (!false) {
$ilCtrl->setParameter($this, "backcmd", "pages");
$ilCtrl->setParameterByClass("illmpageobjectgui", "new_type", "pg");
$ilToolbar->addButton($lng->txt("pg_add"), $ilCtrl->getLinkTargetByClass("illmpageobjectgui", "create"));
$ilCtrl->setParameterByClass("illmpageobjectgui", "new_type", "");
include_once "./Modules/LearningModule/classes/class.ilLMPagesTableGUI.php";
$t = new ilLMPagesTableGUI($this, "pages", $this->object);
$tpl->setContent($t->getHTML());
return;
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.all_pages.html", "Modules/LearningModule");
$num = 0;
$this->tpl->setCurrentBlock("form");
$this->ctrl->setParameter($this, "backcmd", "pages");
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("HEADER_TEXT", $this->lng->txt("cont_pages"));
$this->tpl->setVariable("CONTEXT", $this->lng->txt("cont_usage"));
$this->tpl->setVariable("CHECKBOX_TOP", IL_FIRST_NODE);
$cnt = 0;
$pages = ilLMPageObject::getPageList($this->object->getId());
foreach ($pages as $page) {
$this->tpl->setCurrentBlock("table_row");
// check activation
include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
$lm_set = new ilSetting("lm");
$active = ilLMPage::_lookupActive($page["obj_id"], $this->object->getType(), $lm_set->get("time_scheduled_page_activation"));
// is page scheduled?
$img_sc = $lm_set->get("time_scheduled_page_activation") && ilLMPage::_isScheduledActivation($page["obj_id"], $this->object->getType()) ? "_sc" : "";
if (!$active) {
$this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_pg_d" . $img_sc . ".png"));
$this->tpl->setVariable("IMG_ALT", $this->lng->txt("cont_page_deactivated"));
} else {
if (ilLMPage::_lookupContainsDeactivatedElements($page["obj_id"], $this->object->getType())) {
$this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_pg_del" . $img_sc . ".png"));
$this->tpl->setVariable("IMG_ALT", $this->lng->txt("cont_page_deactivated_elements"));
} else {
$this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_pg" . $img_sc . ".png"));
$this->tpl->setVariable("IMG_ALT", $this->lng->txt("pg"));
}
}
// color changing
$css_row = ilUtil::switchColor($cnt++, "tblrow1", "tblrow2");
// checkbox
$this->tpl->setVariable("CHECKBOX_ID", $page["obj_id"]);
$this->tpl->setVariable("CSS_ROW", $css_row);
// link
$this->ctrl->setParameter($this, "backcmd", "");
$this->ctrl->setParameterByClass("ilLMPageObjectGUI", "obj_id", $page["obj_id"]);
//echo "<br>:".$this->ctrl->getLinkTargetByClass("ilLMPageObjectGUI", "view").":";
$this->tpl->setVariable("LINK_TARGET", $this->ctrl->getLinkTargetByClass("ilLMPageObjectGUI", "edit"));
// title
$this->tpl->setVariable("TEXT_CONTENT", $page["title"]);
// context
if ($this->lm_tree->isInTree($page["obj_id"])) {
$path_str = $this->getContextPath($page["obj_id"]);
} else {
$path_str = "---";
}
// check whether page is header or footer
$add_str = "";
if ($page["obj_id"] == $this->object->getHeaderPage()) {
$add_str = " <b>(" . $this->lng->txt("cont_header") . ")</b>";
}
if ($page["obj_id"] == $this->object->getFooterPage()) {
$add_str = " <b>(" . $this->lng->txt("cont_footer") . ")</b>";
}
$this->tpl->setVariable("TEXT_CONTEXT", $path_str . $add_str);
$this->tpl->parseCurrentBlock();
}
if ($cnt == 0) {
$this->tpl->setCurrentBlock("notfound");
$this->tpl->setVariable("NUM_COLS", 4);
$this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
$this->tpl->parseCurrentBlock();
} else {
$acts = array("delete" => "delete", "movePage" => "movePage", "copyPage" => "copyPage", "selectHeader" => "selectHeader", "selectFooter" => "selectFooter", "activatePages" => "cont_de_activate");
if (ilEditClipboard::getContentObjectType() == "pg" && ilEditClipboard::getAction() == "copy") {
$acts["pastePage"] = "pastePage";
}
/*
if (ilEditClipboard::getContentObjectType() == "st")
{
$acts["pasteChapter"] = "pasteChapter";
}*/
$this->tpl->setVariable("NUM_COLS", 4);
$this->showActions($acts);
// SHOW VALID ACTIONS
/*
$this->tpl->setCurrentBlock("operation_btn");
$this->tpl->setVariable("BTN_NAME", "delete");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
$this->tpl->parseCurrentBlock();*/
}
// SHOW POSSIBLE SUB OBJECTS
$this->tpl->setVariable("NUM_COLS", 4);
//.........这里部分代码省略.........
示例3: editRoleAccessLimitations
function editRoleAccessLimitations()
{
global $lng, $ilAccess, $ilErr, $rbacreview;
if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
$ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
}
$this->__initRoleAccessLimitations();
$this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.reg_role_access_limitations.html', 'Services/Registration');
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_REG_ROLE_ACCESS_LIMITATIONS", $lng->txt('reg_role_access_limitations'));
$this->tpl->setVariable("TXT_ROLE", $lng->txt('obj_role'));
$this->tpl->setVariable("TXT_ACCESS_LIMITATION_MODE", $lng->txt('reg_access_limitation_mode'));
$this->tpl->setVariable("BTN_SAVE", $lng->txt('save'));
$this->tpl->setVariable("BTN_CANCEL", $lng->txt('cancel'));
$counter = 0;
include_once './Services/AccessControl/classes/class.ilObjRole.php';
foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
$this->tpl->setCurrentBlock("roles");
$this->tpl->setVariable("CSSROW", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow1'));
$this->tpl->setVariable("ROLE_ID", $role['id']);
$this->tpl->setVariable("ROLE_TITLE", $role['title']);
$this->tpl->setVariable("SEL_ACCESS_LIMITATION", $this->__buildAccessLimitationSelection($role['id']));
$this->tpl->setVariable("CSS_DISPLAY_ABSOLUTE", $this->access_limitations_obj->getMode($role['id']) == 'absolute' ? 'inline' : 'none');
$this->tpl->setVariable("CSS_DISPLAY_RELATIVE", $this->access_limitations_obj->getMode($role['id']) == 'relative' ? 'inline' : 'none');
$this->tpl->setVariable("CSS_DISPLAY_UNLIMITED", $this->access_limitations_obj->getMode($role['id']) == 'unlimited' ? 'inline' : 'none');
$this->tpl->setVariable("TXT_ACCESS_LIMITATION_UNLIMITED", $lng->txt('reg_access_limitation_none'));
$date = $this->__prepareDateSelect($this->access_limitations_obj->getAbsolute($role['id']));
$this->tpl->setVariable("SEL_ACCESS_LIMITATION_ABSOLUTE", ilUtil::makeDateSelect('access_limitation_absolute_' . $role['id'], $date['y'], $date['m'], $date['d'], '2007'));
$this->tpl->setVariable("TXT_DAYS", $lng->txt('days'));
$this->tpl->setVariable("TXT_MONTHS", $lng->txt('months'));
$this->tpl->setVariable("TXT_YEARS", $lng->txt('years'));
$this->tpl->setVariable("DAYS", $this->access_limitations_obj->getRelative($role['id'], 'd'));
$this->tpl->setVariable("MONTHS", $this->access_limitations_obj->getRelative($role['id'], 'm'));
$this->tpl->setVariable("YEARS", $this->access_limitations_obj->getRelative($role['id'], 'y'));
$this->tpl->parseCurrentBlock();
}
}
示例4: render
/**
* render table
* @access public
*/
function render()
{
if ($this->enabled['table']) {
$this->tpl->setVariable("CSS_TABLE", $this->getStyle("table"));
}
// table title icon
if ($this->enabled["icon"] && $this->enabled["title"]) {
$this->tpl->setCurrentBlock("tbl_header_title_icon");
$this->tpl->setVariable("TBL_TITLE_IMG", ilUtil::getImagePath($this->icon));
$this->tpl->setVariable("TBL_TITLE_IMG_ALT", $this->icon_alt);
$this->tpl->parseCurrentBlock();
}
// table title help
if ($this->enabled["help"] && $this->enabled["title"]) {
$this->tpl->setCurrentBlock("tbl_header_title_help");
$this->tpl->setVariable("TBL_HELP_IMG", ilUtil::getImagePath($this->help_icon));
$this->tpl->setVariable("TBL_HELP_LINK", $this->help_page);
$this->tpl->setVariable("TBL_HELP_IMG_ALT", $this->help_icon_alt);
$this->tpl->parseCurrentBlock();
}
// hits per page selector
if ($this->enabled["hits"] && $this->enabled["title"]) {
$this->tpl->setCurrentBlock("tbl_header_hits_page");
$this->tpl->setVariable("LIMIT", $_SESSION["tbl_limit"]);
$this->tpl->setVariable("HITS_PER_PAGE", $this->lng->txt("hits_per_page"));
$this->tpl->parseCurrentBlock();
}
// table title
if ($this->enabled["title"]) {
$this->tpl->setCurrentBlock("tbl_header_title");
$this->tpl->setVariable("COLUMN_COUNT", $this->column_count);
$this->tpl->setVariable("TBL_TITLE", $this->title);
$this->tpl->parseCurrentBlock();
}
// table header
if ($this->enabled["header"]) {
$this->renderHeader();
}
// table data
// the table content may be skipped to use an individual template blockfile
// To do so don't set $this->data and parse your table content by yourself
// The template block name for the blockfile MUST be 'TBL_CONTENT'
if ($this->enabled["content"] && is_array($this->data)) {
if ($this->enabled['auto_sort']) {
$this->setMaxCount(count($this->data));
$this->sortData();
}
$count = 0;
foreach ($this->data as $tbl_content_row) {
foreach ($tbl_content_row as $key => $tbl_content_cell) {
if (is_array($tbl_content_cell)) {
$this->tpl->setCurrentBlock("tbl_cell_subtitle");
$this->tpl->setVariable("TBL_CELL_SUBTITLE", $tbl_content_cell[1]);
$this->tpl->parseCurrentBlock();
$tbl_content_cell = "<b>" . $tbl_content_cell[0] . "</b>";
}
$this->tpl->setCurrentBlock("tbl_content_cell");
$this->tpl->setVariable("TBL_CONTENT_CELL", $tbl_content_cell);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("tbl_content_row");
$rowcolor = ilUtil::switchColor($count, "tblrow1", "tblrow2");
$this->tpl->setVariable("ROWCOLOR", $rowcolor);
$this->tpl->parseCurrentBlock();
$count++;
}
}
// select all checkbox
if ($this->enabled["select_all"]) {
if (strlen($this->getFormName()) && strlen($this->getSelectAllCheckbox())) {
$this->tpl->setVariable('SELECT_PREFIX', $this->prefix);
$this->tpl->setVariable("SELECT_ALL_TXT_SELECT_ALL", $this->lng->txt("select_all"));
$this->tpl->setVariable("SELECT_ALL_CHECKBOX_NAME", $this->getSelectAllCheckbox());
$this->tpl->setVariable("SELECT_ALL_FORM_NAME", $this->getFormName());
if (!($this->enabled["numinfo"] && $this->enabled["footer"])) {
$this->tpl->setVariable("COLUMN_COUNT", $this->getColumnCount());
}
}
}
// table header numinfo
if ($this->enabled["numinfo_header"]) {
$start = $this->offset + 1;
// compute num info
$end = $this->offset + $this->limit;
if ($end > $this->max_count or $this->limit == 0) {
$end = $this->max_count;
}
if ($this->lang_support) {
$numinfo = "(" . $this->lng->txt("dataset") . " " . $start . " - " . $end . " " . strtolower($this->lng->txt("of")) . " " . $this->max_count . ")";
} else {
$numinfo = "(Dataset " . $start . " - " . $end . " of " . $this->max_count . ")";
}
if ($this->max_count > 0) {
//$numinfo = $this->lng->txt("no_datasets");
$this->tpl->setCurrentBlock("tbl_header_numinfo");
$this->tpl->setVariable("NUMINFO_HEADER", $numinfo);
//.........这里部分代码省略.........
示例5: exportObject
/**
* Global user settings
*
* Allows to define global settings for user accounts
*
* Note: The Global user settings form allows to specify default values
* for some user preferences. To avoid redundant implementations,
* specification of default values can be done elsewhere in ILIAS
* are not supported by this form.
*/
function exportObject()
{
global $ilias, $ilCtrl;
if ($_POST["cmd"]["export"]) {
$this->object->buildExportFile($_POST["export_type"]);
$this->ctrl->redirectByClass("ilobjuserfoldergui", "export");
exit;
}
$this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.usr_export.html', 'Services/User');
$export_types = array("userfolder_export_excel_x86", "userfolder_export_csv", "userfolder_export_xml");
// create table
include_once "./Services/Table/classes/class.ilTableGUI.php";
$tbl = new ilTableGUI();
// load files templates
$this->tpl->addBlockfile("EXPORT_FILES", "export_files", "tpl.table.html");
// load template for table content data
$this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.usr_export_file_row.html", "Services/User");
$num = 0;
$tbl->setTitle($this->lng->txt("userfolder_export_files"));
$tbl->setHeaderNames(array("", $this->lng->txt("userfolder_export_file"), $this->lng->txt("userfolder_export_file_size"), $this->lng->txt("date")));
$tbl->setHeaderVars(array(), $ilCtrl->getParameterArray($this, "export"));
$tbl->enabled["sort"] = false;
$tbl->setColumnWidth(array("1%", "49%", "25%", "25%"));
// control
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setMaxCount($this->maxcount);
// ???
$this->tpl->setVariable("COLUMN_COUNTS", 4);
// delete button
$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.png"));
$this->tpl->setVariable("ALT_ARROW", $this->lng->txt("actions"));
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "confirmDeleteExportFile");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "downloadExportFile");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("download"));
$this->tpl->parseCurrentBlock();
// footer
$tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
//$tbl->disable("footer");
$export_files = $this->object->getExportFiles();
$tbl->setMaxCount(count($export_files));
$export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
$tbl->render();
if (count($export_files) > 0) {
$i = 0;
foreach ($export_files as $exp_file) {
$this->tpl->setCurrentBlock("tbl_content");
$this->tpl->setVariable("TXT_FILENAME", $exp_file["filename"]);
$css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->setVariable("TXT_SIZE", $exp_file["filesize"]);
$this->tpl->setVariable("CHECKBOX_ID", $exp_file["filename"]);
$file_arr = explode("__", $exp_file["filename"]);
$this->tpl->setVariable('TXT_DATE', ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("selectall");
$this->tpl->setVariable("SELECT_ALL", $this->lng->txt("select_all"));
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->parseCurrentBlock();
}
//if is_array
/*
else
{
$this->tpl->setCurrentBlock("notfound");
$this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
$this->tpl->setVariable("NUM_COLS", 3);
$this->tpl->parseCurrentBlock();
}
*/
$this->tpl->parseCurrentBlock();
foreach ($export_types as $export_type) {
$this->tpl->setCurrentBlock("option");
$this->tpl->setVariable("OPTION_VALUE", $export_type);
$this->tpl->setVariable("OPTION_TEXT", $this->lng->txt($export_type));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("EXPORT_BUTTON", $this->lng->txt("create_export_file"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
}
示例6: subchap
function subchap()
{
global $tree, $ilCtrl, $lng, $ilUser;
$this->setTabs();
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.structure_edit.html", "Modules/LearningModule");
$num = 0;
$this->tpl->setCurrentBlock("form");
$this->ctrl->setParameter($this, "backcmd", "subchap");
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("HEADER_TEXT", $this->lng->txt("cont_subchapters"));
$this->tpl->setVariable("CHECKBOX_TOP", IL_FIRST_NODE);
$cnt = 0;
$childs = $this->tree->getChilds($this->obj->getId());
foreach ($childs as $child) {
if ($child["type"] != "st") {
continue;
}
$this->tpl->setCurrentBlock("table_row");
// color changing
$css_row = ilUtil::switchColor($cnt++, "tblrow1", "tblrow2");
// checkbox
$this->tpl->setVariable("CHECKBOX_ID", $child["obj_id"]);
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_st.png"));
// type
$this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $child["obj_id"]);
$link = $this->ctrl->getLinkTargetByClass("ilStructureObjectGUI", "view");
$this->tpl->setVariable("LINK_TARGET", $link);
// title
$this->tpl->setVariable("TEXT_CONTENT", ilStructureObject::_getPresentationTitle($child["obj_id"], $this->content_object->isActiveNumbering()));
$this->tpl->parseCurrentBlock();
}
if ($cnt == 0) {
$this->tpl->setCurrentBlock("notfound");
$this->tpl->setVariable("NUM_COLS", 3);
$this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
$this->tpl->parseCurrentBlock();
}
//else
//{
// SHOW VALID ACTIONS
$this->tpl->setVariable("NUM_COLS", 3);
$acts = array("delete" => "delete", "cutChapter" => "cut", "copyChapter" => "copyChapter");
if ($ilUser->clipboardHasObjectsOfType("st")) {
$acts["pasteChapter"] = "pasteChapter";
}
$this->showActions($acts);
//}
// SHOW POSSIBLE SUB OBJECTS
$this->tpl->setVariable("NUM_COLS", 3);
//$this->showPossibleSubObjects("st");
$subobj = array("st");
$opts = ilUtil::formSelect(12, "new_type", $subobj);
//$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.png"));
$this->tpl->setCurrentBlock("add_object");
$this->tpl->setVariable("SELECT_OBJTYPE", $opts);
//$this->tpl->setVariable("FORMACTION_OBJ_ADD", "adm_object.php?cmd=create&ref_id=".$_GET["ref_id"]);
$this->tpl->setVariable("BTN_NAME", "create");
$this->tpl->setVariable("TXT_ADD", $this->lng->txt("insert"));
$this->tpl->parseCurrentBlock();
//$this->tpl->setVariable("NUM_COLS", 2);
//$this->showPossibleSubObjects("st");
$this->tpl->setCurrentBlock("form");
$this->tpl->parseCurrentBlock();
$ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
}
示例7: showDownloadList
/**
* show download list
*/
function showDownloadList()
{
global $ilBench, $ilAccess, $ilias, $lng, $ilTabs;
if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
$ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.glo_download_list.html", "Modules/Glossary");
$this->setTabs();
$ilTabs->activateTab("download");
// set title header
$this->tpl->setTitle($this->glossary->getTitle());
//$this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_glo_b.png"));
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo_b.png"));
// create table
require_once "./Services/Table/classes/class.ilTableGUI.php";
$tbl = new ilTableGUI();
// load files templates
$this->tpl->addBlockfile("DOWNLOAD_TABLE", "download_table", "tpl.table.html");
// load template for table content data
$this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.download_file_row.html", "Modules/Glossary");
$export_files = array();
$types = array("xml", "html");
foreach ($types as $type) {
if ($this->glossary->getPublicExportFile($type) != "") {
$dir = $this->glossary->getExportDirectory($type);
if (is_file($this->glossary->getExportDirectory($type) . "/" . $this->glossary->getPublicExportFile($type))) {
$size = filesize($this->glossary->getExportDirectory($type) . "/" . $this->glossary->getPublicExportFile($type));
$export_files[] = array("type" => $type, "file" => $this->glossary->getPublicExportFile($type), "size" => $size);
}
}
}
$num = 0;
$tbl->setTitle($this->lng->txt("download"));
$tbl->setHeaderNames(array($this->lng->txt("cont_format"), $this->lng->txt("cont_file"), $this->lng->txt("size"), $this->lng->txt("date"), ""));
$cols = array("format", "file", "size", "date", "download");
$header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"], "cmd" => "showDownloadList", "cmdClass" => strtolower(get_class($this)));
$tbl->setHeaderVars($cols, $header_params);
$tbl->setColumnWidth(array("10%", "30%", "20%", "20%", "20%"));
$tbl->disable("sort");
// control
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setMaxCount($this->maxcount);
// ???
$this->tpl->setVariable("COLUMN_COUNTS", 5);
// footer
//$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
$tbl->disable("footer");
$tbl->setMaxCount(count($export_files));
$export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
$tbl->render();
if (count($export_files) > 0) {
$i = 0;
foreach ($export_files as $exp_file) {
$this->tpl->setCurrentBlock("tbl_content");
$this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
$css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
$this->tpl->setVariable("TXT_FORMAT", strtoupper($exp_file["type"]));
$this->tpl->setVariable("CHECKBOX_ID", $exp_file["type"] . ":" . $exp_file["file"]);
$file_arr = explode("__", $exp_file["file"]);
$this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s", $file_arr[0]));
$this->tpl->setVariable("TXT_DOWNLOAD", $this->lng->txt("download"));
$this->ctrl->setParameter($this, "type", $exp_file["type"]);
$this->tpl->setVariable("LINK_DOWNLOAD", $this->ctrl->getLinkTarget($this, "downloadExportFile"));
$this->tpl->parseCurrentBlock();
}
} else {
$this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
$this->tpl->setVariable("NUM_COLS", 5);
$this->tpl->parseCurrentBlock();
}
//$this->tpl->show();
}
示例8: _importCategoriesForm
/**
* display form for category import (static, also called by RootFolderGUI)
*/
function _importCategoriesForm($a_ref_id, &$a_tpl)
{
global $lng, $rbacreview;
$a_tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.cat_import_form.html", "Modules/Category");
$a_tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$a_tpl->setVariable("TXT_IMPORT_CATEGORIES", $lng->txt("import_categories"));
$a_tpl->setVariable("TXT_HIERARCHY_OPTION", $lng->txt("import_cat_localrol"));
$a_tpl->setVariable("TXT_IMPORT_FILE", $lng->txt("import_file"));
$a_tpl->setVariable("TXT_IMPORT_TABLE", $lng->txt("import_cat_table"));
$a_tpl->setVariable("BTN_IMPORT", $lng->txt("import"));
$a_tpl->setVariable("BTN_CANCEL", $lng->txt("cancel"));
// NEED TO FILL ADOPT_PERMISSIONS HTML FORM....
$parent_role_ids = $rbacreview->getParentRoleIds($a_ref_id, true);
// sort output for correct color changing
ksort($parent_role_ids);
foreach ($parent_role_ids as $key => $par) {
if ($par["obj_id"] != SYSTEM_ROLE_ID) {
$check = ilUtil::formCheckbox(0, "adopt[]", $par["obj_id"], 1);
$output["adopt"][$key]["css_row_adopt"] = ilUtil::switchColor($key, "tblrow1", "tblrow2");
$output["adopt"][$key]["check_adopt"] = $check;
$output["adopt"][$key]["role_id"] = $par["obj_id"];
$output["adopt"][$key]["type"] = $par["type"] == 'role' ? 'Role' : 'Template';
$output["adopt"][$key]["role_name"] = $par["title"];
}
}
//var_dump($output);
// BEGIN ADOPT PERMISSIONS
foreach ($output["adopt"] as $key => $value) {
$a_tpl->setCurrentBlock("ADOPT_PERM_ROW");
$a_tpl->setVariable("CSS_ROW_ADOPT", $value["css_row_adopt"]);
$a_tpl->setVariable("CHECK_ADOPT", $value["check_adopt"]);
$a_tpl->setVariable("LABEL_ID", $value["role_id"]);
$a_tpl->setVariable("TYPE", $value["type"]);
$a_tpl->setVariable("ROLE_NAME", $value["role_name"]);
$a_tpl->parseCurrentBlock();
}
}
示例9: viewThreadObject
//.........这里部分代码省略.........
// download post attachments
$tmp_file_obj = new ilFileDataForum($forumObj->getId(), $node->getId());
if (count($tmp_file_obj->getFilesOfPost())) {
if ($node->getId() != $this->objCurrentPost->getId() || $_GET['action'] != 'showedit') {
foreach ($tmp_file_obj->getFilesOfPost() as $file) {
$tpl->setCurrentBlock('attachment_download_row');
$this->ctrl->setParameter($this, 'pos_pk', $node->getId());
$this->ctrl->setParameter($this, 'file', $file['md5']);
$tpl->setVariable('HREF_DOWNLOAD', $this->ctrl->getLinkTarget($this, 'viewThread'));
$tpl->setVariable('TXT_FILENAME', $file['name']);
$this->ctrl->clearParameters($this);
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock('attachments');
$tpl->setVariable('TXT_ATTACHMENTS_DOWNLOAD', $lng->txt('forums_attachments'));
include_once "./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
$tpl->setVariable('DOWNLOAD_IMG', ilGlyphGUI::get(ilGlyphGUI::ATTACHMENT, $lng->txt('forums_download_attachment')));
$tpl->parseCurrentBlock();
}
}
$tpl->setCurrentBlock('posts_row');
// anker for every post
$tpl->setVariable('POST_ANKER', $node->getId());
//permanent link for every post
// $tpl->setVariable('PERMA_LINK', ILIAS_HTTP_PATH."/goto.php?target="."frm"."_".$this->object->getRefId()."_".$node->getThreadId()."_".$node->getId()."&client_id=".CLIENT_ID);
$tpl->setVariable('TXT_PERMA_LINK', $lng->txt('perma_link'));
$tpl->setVariable('PERMA_TARGET', '_top');
if ($this->objProperties->getMarkModeratorPosts() == 1) {
if ($node->getIsAuthorModerator() === null && ($is_moderator = ilForum::_isModerator($_GET['ref_id'], $node->getPosAuthorId()))) {
$rowCol = 'ilModeratorPosting';
} elseif ($node->getIsAuthorModerator()) {
$rowCol = 'ilModeratorPosting';
} else {
$rowCol = ilUtil::switchColor($z, 'tblrow1', 'tblrow2');
}
} else {
$rowCol = ilUtil::switchColor($z, 'tblrow1', 'tblrow2');
}
if ($_GET['action'] != 'delete' && $_GET['action'] != 'censor' && !$this->displayConfirmPostActivation() || $this->objCurrentPost->getId() != $node->getId()) {
$tpl->setVariable('ROWCOL', ' ' . $rowCol);
} else {
// highlight censored posts
$rowCol = 'tblrowmarked';
}
// post is censored
if ($node->isCensored()) {
// display censorship advice
if ($_GET['action'] != 'censor') {
$tpl->setVariable('TXT_CENSORSHIP_ADVICE', $this->lng->txt('post_censored_comment_by_moderator'));
}
// highlight censored posts
$rowCol = 'tblrowmarked';
}
// set row color
$tpl->setVariable('ROWCOL', ' ' . $rowCol);
// if post is not activated display message for the owner
if (!$node->isActivated() && $node->isOwner($ilUser->getId())) {
$tpl->setVariable('POST_NOT_ACTIVATED_YET', $this->lng->txt('frm_post_not_activated_yet'));
}
// Author
$this->ctrl->setParameter($this, 'pos_pk', $node->getId());
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
$backurl = urlencode($this->ctrl->getLinkTarget($this, 'viewThread', $node->getId()));
$this->ctrl->clearParameters($this);
$this->ctrl->setParameter($this, 'backurl', $backurl);
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
示例10: quickList
/**
* quick term list
*/
function quickList()
{
global $ilUser, $tpl;
return;
include_once "./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php";
$tab = new ilTermQuickListTableGUI($this, "listTerms");
$tpl->setLeftContent($tab->getHTML());
$this->tpl->addBlockFile("CONTENT", "content", "tpl.glossary_short_list.html", "Modules/Glossary");
// $this->tpl->addBlockFile("EXPLORER_TOP", "exp_top", "tpl.explorer_top.html");
// $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false));
$this->tpl->setVariable("FORMACTION1", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("CMD_REFR", "quickList");
$this->tpl->setVariable("TXT_REFR", $this->lng->txt("refresh"));
$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_terms"));
include_once "./Services/Table/classes/class.ilTableGUI.php";
// glossary term list template
// load template for table
$this->tpl->addBlockfile("SHORT_LIST", "list", "tpl.table.html");
// load template for table content data
$this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.term_short_tbl_row.html", true);
$num = 0;
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
// create table
$tbl = new ilTableGUI();
// title & header columns
//$tbl->setTitle($this->lng->txt("cont_terms"));
//$tbl->setHelp("tbl_help.php","icon_help.png",$this->lng->txt("help"));
$tbl->setHeaderNames(array($this->lng->txt("cont_term")));
$cols = array("term");
$header_params = $this->ctrl->getParameterArrayByClass("ilobjglossarygui", "listTerms");
$header_params["cmd"] = "quickList";
$tbl->setHeaderVars($cols, $header_params);
$tbl->setColumnWidth(array("100%"));
$tbl->disable("title");
// control
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->disable("header");
$term_list = $this->object->getTermList();
$tbl->setMaxCount(count($term_list));
$this->tpl->setVariable("COLUMN_COUNT", 1);
// footer
$tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
// sorting array
$term_list = array_slice($term_list, $_GET["offset"], $_GET["limit"]);
// render table
$tbl->render();
if (count($term_list) > 0) {
$i = 1;
foreach ($term_list as $key => $term) {
$defs = ilGlossaryDefinition::getDefinitionList($term["id"]);
$sep = ": ";
for ($j = 0; $j < count($defs); $j++) {
$def = $defs[$j];
// edit
$this->tpl->setCurrentBlock("definition");
$this->tpl->setVariable("SEP", $sep);
$this->ctrl->setParameterByClass("ilglossarydefpagegui", "term_id", $term["id"]);
$this->ctrl->setParameterByClass("ilglossarydefpagegui", "def", $def["id"]);
$this->tpl->setVariable("LINK_EDIT_DEF", $this->ctrl->getLinkTargetByClass(array("ilglossarytermgui", "iltermdefinitioneditorgui", "ilglossarydefpagegui"), "edit"));
$this->tpl->setVariable("TEXT_DEF", $this->lng->txt("glo_definition_abbr") . ($j + 1));
$this->tpl->parseCurrentBlock();
$sep = ", ";
}
$this->tpl->setCurrentBlock("tbl_content");
$css_row = ilUtil::switchColor(++$i, "tblrow1", "tblrow2");
// edit term link
$this->tpl->setVariable("TEXT_TERM", $term["term"]);
$this->ctrl->setParameter($this, "term_id", $term["id"]);
$this->tpl->setVariable("LINK_EDIT_TERM", $this->ctrl->getLinkTargetByClass("ilglossarytermgui", "editTerm"));
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->parseCurrentBlock();
}
} else {
//$this->tpl->setCurrentBlock("notfound");
$this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
$this->tpl->setVariable("NUM_COLS", $num);
//$this->tpl->parseCurrentBlock();
}
}
示例11: showTrackingItems
/**
* show tracking data
*/
function showTrackingItems()
{
include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
$privacy = ilPrivacySettings::_getInstance();
if (!$privacy->enabledSahsProtocolData()) {
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
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.scorm_track_items.html", "Modules/ScormAicc");
$num = 1;
$this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=" . $this->ref_id . "{$obj_str}&cmd=gateway");
// create table
$tbl = new ilTableGUI();
// title & header columns
$tbl->setTitle($this->lng->txt("cont_tracking_items"));
$tbl->setHeaderNames(array($this->lng->txt("title")));
$header_params = array("ref_id" => $this->ref_id, "cmd" => $_GET["cmd"], "cmdClass" => get_class($this));
$cols = array("title");
$tbl->setHeaderVars($cols, $header_params);
$tbl->setColumnWidth(array("100%"));
// control
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setMaxCount($this->maxcount);
//$this->tpl->setVariable("COLUMN_COUNTS",count($this->data["cols"]));
//$this->showActions(true);
// footer
$tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
#$tbl->disable("footer");
//$items = $this->object->getTrackingItems();
$items = $this->object->getTrackedItems();
//$objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]);
$tbl->setMaxCount(count($items));
$items = array_slice($items, $_GET["offset"], $_GET["limit"]);
$tbl->render();
if (count($items) > 0) {
foreach ($items as $item) {
$this->tpl->setCurrentBlock("tbl_content");
$this->tpl->setVariable("TXT_ITEM_TITLE", $item->getTitle());
$this->ctrl->setParameter($this, "obj_id", $item->getId());
$this->tpl->setVariable("LINK_ITEM", $this->ctrl->getLinkTarget($this, "showTrackingItem"));
$css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->parseCurrentBlock();
}
} else {
$this->tpl->setCurrentBlock("notfound");
$this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
$this->tpl->setVariable("NUM_COLS", $num);
$this->tpl->parseCurrentBlock();
}
}
示例12: askDeleteObjective
function askDeleteObjective()
{
global $rbacsystem;
// MINIMUM ACCESS LEVEL = 'write'
if (!$rbacsystem->checkAccess("write", $this->course_obj->getRefId())) {
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilErr->MESSAGE);
}
if (!count($_POST['objective'])) {
ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'));
$this->listObjectives();
return true;
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives.html", 'Modules/Course');
ilUtil::sendQuestion($this->lng->txt('crs_delete_objectve_sure'));
$tpl =& new ilTemplate("tpl.table.html", true, true);
$tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_delete_row.html", 'Modules/Course');
$counter = 0;
foreach ($_POST['objective'] as $objective_id) {
$objective_obj = $this->__initObjectivesObject($objective_id);
$tpl->setCurrentBlock("tbl_content");
$tpl->setVariable("ROWCOL", ilUtil::switchColor(++$counter, "tblrow2", "tblrow1"));
$tpl->setVariable("TITLE", $objective_obj->getTitle());
$tpl->setVariable("DESCRIPTION", $objective_obj->getDescription());
$tpl->parseCurrentBlock();
}
$tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
// Show action row
$tpl->setCurrentBlock("tbl_action_btn");
$tpl->setVariable("BTN_NAME", 'deleteObjectives');
$tpl->setVariable("BTN_VALUE", $this->lng->txt('delete'));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_btn");
$tpl->setVariable("BTN_NAME", 'listObjectives');
$tpl->setVariable("BTN_VALUE", $this->lng->txt('cancel'));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_row");
$tpl->setVariable("COLUMN_COUNTS", 1);
$tpl->setVariable("IMG_ARROW", ilUtil::getImagePath('arrow_downright.png'));
$tpl->parseCurrentBlock();
// create table
$tbl = new ilTableGUI();
$tbl->setStyle('table', 'std');
// title & header columns
$tbl->setTitle($this->lng->txt("crs_objectives"), "icon_lobj.png", $this->lng->txt("crs_objectives"));
$tbl->setHeaderNames(array($this->lng->txt("title")));
$tbl->setHeaderVars(array("title"), array("ref_id" => $this->course_obj->getRefId(), "cmdClass" => "ilcourseobjectivesgui", "cmdNode" => $_GET["cmdNode"]));
$tbl->setColumnWidth(array("50%"));
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setMaxCount(count($_POST['objective']));
// footer
$tbl->disable("footer");
$tbl->disable('sort');
// render table
$tbl->setTemplate($tpl);
$tbl->render();
$this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get());
// Save marked objectives
$_SESSION['crs_delete_objectives'] = $_POST['objective'];
return true;
}
示例13: editFilesObject
//.........这里部分代码省略.........
$this->tpl->setVariable("FORMACTION1", $this->ctrl->getFormAction($this));
//echo "--".$this->getTargetScript().
//"&hier_id=".$_GET["hier_id"]."&cdir=".$cur_subdir."&cmd=post"."--<br>";
$this->tpl->setVariable("TXT_NEW_DIRECTORY", $this->lng->txt("cont_new_dir"));
$this->tpl->setVariable("TXT_NEW_FILE", $this->lng->txt("cont_new_file"));
$this->tpl->setVariable("CMD_NEW_DIR", "createDirectory");
$this->tpl->setVariable("CMD_NEW_FILE", "uploadFile");
$this->tpl->setVariable("BTN_NEW_DIR", $this->lng->txt("create"));
$this->tpl->setVariable("BTN_NEW_FILE", $this->lng->txt("upload"));
//
$this->tpl->addBlockfile("FILE_TABLE", "files", "tpl.table.html");
// load template for table content data
$this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.mob_file_row.html", "Services/MediaObjects");
$num = 0;
$obj_str = $this->call_by_reference ? "" : "&obj_id=" . $this->obj_id;
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$tbl->setTitle($this->lng->txt("cont_files") . " " . $cur_subdir);
//$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
$tbl->setHeaderNames(array("", "", $this->lng->txt("cont_dir_file"), $this->lng->txt("cont_size"), $this->lng->txt("cont_purpose")));
$cols = array("", "", "dir_file", "size", "purpose");
$header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"], "cmd" => "editFiles", "hier_id" => $_GET["hier_id"], "item_id" => $_GET["item_id"]);
$tbl->setHeaderVars($cols, $header_params);
$tbl->setColumnWidth(array("1%", "1%", "33%", "33%", "32%"));
// control
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setMaxCount($this->maxcount);
// ???
//$tbl->setMaxCount(30); // ???
$this->tpl->setVariable("COLUMN_COUNTS", 5);
// delete button
$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "deleteFile");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "assignStandard");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("cont_assign_std"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "assignFullscreen");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("cont_assign_full"));
$this->tpl->parseCurrentBlock();
// footer
$tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
//$tbl->disable("footer");
$entries = ilUtil::getDir($cur_dir);
//$objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]);
$tbl->setMaxCount(count($entries));
$entries = array_slice($entries, $_GET["offset"], $_GET["limit"]);
$tbl->render();
if (count($entries) > 0) {
$i = 0;
foreach ($entries as $entry) {
if ($entry["entry"] == "." || $entry["entry"] == ".." && empty($cur_subdir)) {
continue;
}
//$this->tpl->setVariable("ICON", $obj["title"]);
if ($entry["type"] == "dir") {
$this->tpl->setCurrentBlock("FileLink");
$this->ctrl->setParameter($this, "cdir", $cur_subdir);
$this->ctrl->setParameter($this, "newdir", rawurlencode($entry["entry"]));
$this->tpl->setVariable("LINK_FILENAME", $this->ctrl->getLinkTarget($this, "editFiles"));
$this->tpl->setVariable("TXT_FILENAME", $entry["entry"]);
$this->tpl->parseCurrentBlock();
$this->tpl->setVariable("ICON", "<img src=\"" . ilUtil::getImagePath("icon_cat.svg") . "\">");
} else {
$this->tpl->setCurrentBlock("File");
$this->tpl->setVariable("TXT_FILENAME2", $entry["entry"]);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("tbl_content");
$css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->setVariable("TXT_SIZE", $entry["size"]);
$this->tpl->setVariable("CHECKBOX_ID", $entry["entry"]);
$compare = !empty($cur_subdir) ? $cur_subdir . "/" . $entry["entry"] : $entry["entry"];
$purpose = array();
if ($std_item->getLocation() == $compare) {
$purpose[] = $this->lng->txt("cont_std_view");
}
if ($this->object->hasFullscreenItem()) {
if ($full_item->getLocation() == $compare) {
$purpose[] = $this->lng->txt("cont_fullscreen");
}
}
$this->tpl->setVariable("TXT_PURPOSE", implode($purpose, ", "));
$this->tpl->parseCurrentBlock();
}
} else {
$this->tpl->setCurrentBlock("notfound");
$this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
$this->tpl->setVariable("NUM_COLS", 4);
$this->tpl->parseCurrentBlock();
}
$this->tpl->parseCurrentBlock();
}
示例14: fillRow
/**
* fill row
*
* @access protected
* @param array row data
* @return
*/
protected function fillRow($a_set)
{
static $row_counter = 1;
$this->tpl->setVariable('VAL_TITLE', $a_set['title']);
if (strlen($a_set['description'])) {
$this->tpl->setVariable('VAL_DESC', $a_set['description']);
}
foreach ($a_set['self_tests'] as $tst) {
foreach ($tst['questions'] as $qst) {
$this->tpl->setCurrentBlock('self_qst');
$this->tpl->setVariable('SELF_QST_TITLE', $qst['title']);
if (strlen($qst['description'])) {
$this->tpl->setVariable('SELF_QST_DESCRIPTION', $qst['description']);
}
$this->tpl->setVariable('SELF_QST_POINTS', $qst['points']);
$this->tpl->setVariable('SELF_QST_TXT_POINTS', $this->lng->txt('crs_objective_points'));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('self_tst');
$this->tpl->setVariable('SELF_TST_TITLE', $tst['title']);
if (strlen($tst['description'])) {
$this->tpl->setVariable('SELF_TST_DESC', $tst['description']);
}
$this->tpl->setVariable('SELF_TYPE_IMG', ilUtil::getImagePath('icon_tst.svg'));
$this->tpl->setVariable('SELF_TYPE_ALT', $this->lng->txt('obj_tst'));
$this->tpl->parseCurrentBlock();
}
if (count($a_set['self_tests'])) {
$this->tpl->setVariable('SELF_TXT_ALL_POINTS', $this->lng->txt('crs_objective_all_points'));
$this->tpl->setVariable('SELF_TXT_POINTS', $this->lng->txt('crs_objective_points'));
$this->tpl->setVariable('SELF_TXT_REQ_POINTS', $this->lng->txt('crs_obj_required_points'));
$this->tpl->setVariable('SELF_POINTS', $a_set['self_max_points']);
$this->tpl->setVariable('SELF_ID', $a_set['id']);
$this->tpl->setVariable('SELF_LIMIT', $a_set['self_limit']);
}
foreach ($a_set['final_tests'] as $tst) {
foreach ($tst['questions'] as $qst) {
$this->tpl->setCurrentBlock('final_qst');
$this->tpl->setVariable('FINAL_QST_TITLE', $qst['title']);
if (strlen($qst['description'])) {
$this->tpl->setVariable('FINAL_QST_DESCRIPTION', $qst['description']);
}
$this->tpl->setVariable('FINAL_QST_POINTS', $qst['points']);
$this->tpl->setVariable('FINAL_QST_TXT_POINTS', $this->lng->txt('crs_objective_points'));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('final_tst');
$this->tpl->setVariable('FINAL_TST_TITLE', $tst['title']);
if (strlen($tst['description'])) {
$this->tpl->setVariable('FINAL_TST_DESC', $tst['description']);
}
$this->tpl->setVariable('FINAL_TYPE_IMG', ilUtil::getImagePath('icon_tst.svg'));
$this->tpl->setVariable('FINAL_TYPE_ALT', $this->lng->txt('obj_tst'));
$this->tpl->parseCurrentBlock();
}
if (count($a_set['final_tests'])) {
$this->tpl->setVariable('FINAL_TXT_ALL_POINTS', $this->lng->txt('crs_objective_all_points'));
$this->tpl->setVariable('FINAL_TXT_POINTS', $this->lng->txt('crs_objective_points'));
$this->tpl->setVariable('FINAL_TXT_REQ_POINTS', $this->lng->txt('crs_obj_required_points'));
$this->tpl->setVariable('FINAL_POINTS', $a_set['final_max_points']);
$this->tpl->setVariable('FINAL_ID', $a_set['id']);
$this->tpl->setVariable('FINAL_LIMIT', $a_set['final_limit']);
}
$this->tpl->setVariable('TST_CSS', ilUtil::switchColor($row_counter++, 'tblrow1', 'tblrow2'));
}
示例15: exportHTML
/**
* Export to HTML.
*
*/
function exportHTML()
{
global $lng, $tpl, $ilUser, $ilAccess, $ilias;
if (!$ilAccess->checkAccess('read,visible', '', $_GET['ref_id'])) {
$ilias->raiseError($lng->txt('permission_denied'), $ilias->error_obj->MESSAGE);
}
$tplEx = new ilTemplate('tpl.forums_export_html.html', true, true, 'Modules/Forum');
// threads
//for ($j = 0; $j < count($_POST['forum_id']); $j++)
for ($j = 0; $j < count($_POST['thread_ids']); $j++) {
//$objCurrentTopic = new ilForumTopic(addslashes($_POST['forum_id'][$j]), $ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']));
$objCurrentTopic = new ilForumTopic(addslashes($_POST['thread_ids'][$j]), $ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']));
// get forum- and thread-data
$this->frm->setMDB2WhereCondition('top_pk = %s ', array('integer'), array($objCurrentTopic->getForumId()));
if (is_array($frmData = $this->frm->getOneTopic())) {
$objFirstPostNode = $objCurrentTopic->getFirstPostNode();
$objCurrentTopic->setOrderField('frm_posts_tree.rgt');
$postTree = $objCurrentTopic->getPostTree($objFirstPostNode);
$posNum = count($postTree);
$z = 0;
foreach ($postTree as $post) {
$tplEx->setCurrentBlock('posts_row');
$rowCol = ilUtil::switchColor($z++, 'tblrow2', 'tblrow1');
$tplEx->setVariable('ROWCOL', $rowCol);
$authorinfo = new ilForumAuthorInformation($post->getUserId(), $post->getUserAlias(), $post->getImportName());
$tplEx->setVariable('AUTHOR', $authorinfo->getAuthorName());
if ($post->getUserId()) {
// get create- and update-dates
if ($post->getUpdateUserId()) {
$authorinfo = new ilForumAuthorInformation($post->getUpdateUserId(), '', '');
$tplEx->setVariable('POST_UPDATE', "<br />[" . $lng->txt('edited_on') . ": " . $this->frm->convertDate($post->getChangeDate()) . " - " . strtolower($lng->txt('from')) . " " . $authorinfo->getAuthorName() . "]");
}
if ($authorinfo->getAuthor()->getPref('public_profile') != 'n') {
$tplEx->setVariable('TXT_REGISTERED', $lng->txt('registered_since'));
$tplEx->setVariable('REGISTERED_SINCE', $this->frm->convertDate($authorinfo->getAuthor()->getCreateDate()));
}
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id'])) {
$numPosts = $this->frm->countUserArticles($post->getUserId());
} else {
$numPosts = $this->frm->countActiveUserArticles($post->getUserId());
}
$tplEx->setVariable('TXT_NUM_POSTS', $lng->txt('forums_posts'));
$tplEx->setVariable('NUM_POSTS', $numPosts);
}
$tplEx->setVariable('SUBJECT', $post->getSubject());
$tplEx->setVariable('TXT_CREATE_DATE', $lng->txt('forums_thread_create_date'));
$tplEx->setVariable('POST_DATE', $this->frm->convertDate($post->getCreateDate()));
$tplEx->setVariable('SPACER', "<hr noshade width=\"100%\" size=\"1\" align=\"center\" />");
if ($post->isCensored()) {
$tplEx->setVariable('POST', nl2br(stripslashes($post->getCensorshipComment())));
} else {
/** @todo mjansen: possible bugfix for mantis #8223 */
if ($post->getMessage() == strip_tags($post->getMessage())) {
// We can be sure, that there are not html tags
$post->setMessage(nl2br($post->getMessage()));
}
$tplEx->setVariable('POST', ilRTE::_replaceMediaObjectImageSrc($this->frm->prepareText($post->getMessage(), 0, '', 'export'), 1));
}
$tplEx->parseCurrentBlock('posts_row');
unset($author);
}
// foreach ($postTree as $post)
$tplEx->setCurrentBlock('posttable');
$tplEx->setVariable('TXT_AUTHOR', $lng->txt('author'));
$tplEx->setVariable('TXT_POST', $lng->txt('forums_thread') . ': ' . $objCurrentTopic->getSubject());
$tplEx->parseCurrentBlock('posttable');
// Thread Headline
$tplEx->setCurrentBlock('thread_headline');
$tplEx->setVariable('T_TITLE', $objCurrentTopic->getSubject());
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id'])) {
$tplEx->setVariable('T_NUM_POSTS', $objCurrentTopic->countPosts());
} else {
$tplEx->setVariable('T_NUM_POSTS', $objCurrentTopic->countActivePosts());
}
$tplEx->setVariable('T_NUM_VISITS', $objCurrentTopic->getVisits());
$tplEx->setVariable('T_FORUM', $frmData['top_name']);
$authorinfo = new ilForumAuthorInformation($objCurrentTopic->getUserId(), $objCurrentTopic->getUserAlias(), $objCurrentTopic->getImportName());
$tplEx->setVariable('T_AUTHOR', $authorinfo->getAuthorName());
$tplEx->setVariable('T_TXT_FORUM', $lng->txt('forum') . ': ');
$tplEx->setVariable('T_TXT_TOPIC', $lng->txt('forums_thread') . ': ');
$tplEx->setVariable('T_TXT_AUTHOR', $lng->txt('forums_thread_create_from') . ': ');
$tplEx->setVariable('T_TXT_NUM_POSTS', $lng->txt('forums_articles') . ': ');
$tplEx->setVariable('T_TXT_NUM_VISITS', $lng->txt('visits') . ': ');
$tplEx->parseCurrentBlock('thread_headline');
$tplEx->setCurrentBlock('thread_block');
$tplEx->parseCurrentBlock('thread_block');
$tplEx->setCurrentBlock('forum_block');
$tplEx->parseCurrentBlock('forum_block');
}
// if (is_array($frmData = $this->frm->getOneTopic()))
}
// for ($j = 0; $j < count($_POST["forum_id"]); $j++)
ilUtil::deliverData($tplEx->get(), 'forum_html_export_' . $_GET['ref_id'] . '.html');
exit;
}