/** * show client list */ function showClientList() { global $tpl, $ilIliasIniFile, $ilCtrl; //echo "1"; if (!$ilIliasIniFile->readVariable("clients", "list")) { $this->processIndexPHP(); return; } //echo "2"; $tpl = new ilTemplate("tpl.main.html", true, true); $tpl->setAddFooter(false); // no client yet // to do: get standard style $tpl->setVariable("PAGETITLE", "Client List"); $tpl->setVariable("LOCATION_STYLESHEET", "./templates/default/delos.css"); // load client list template self::initStartUpTemplate("tpl.client_list.html"); // load template for table $tpl->addBlockfile("CLIENT_LIST", "client_list", "tpl.table.html"); // load template for table content data $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html"); // load table content data require_once "setup/classes/class.ilClientList.php"; require_once "setup/classes/class.ilClient.php"; require_once "setup/classes/class.ilDBConnections.php"; require_once "./Services/Table/classes/class.ilTableGUI.php"; $this->db_connections = new ilDBConnections(); $clientlist = new ilClientList($this->db_connections); $list = $clientlist->getClients(); if (count($list) == 0) { header("Location: ./setup/setup.php"); exit; } $hasPublicSection = false; foreach ($list as $key => $client) { $client->setDSN(); if ($client->checkDatabaseExists(true) and $client->ini->readVariable("client", "access") and $client->getSetting("setup_ok")) { $this->ctrl->setParameter($this, "client_id", $key); $tmp = array(); $tmp[] = $client->getName(); $tmp[] = "<a href=\"" . "login.php?cmd=force_login&client_id=" . urlencode($key) . "\">Login page</a>"; if ($client->getSetting('pub_section')) { $hasPublicSection = true; $tmp[] = "<a href=\"" . "ilias.php?baseClass=ilRepositoryGUI&client_id=" . urlencode($key) . "\">Start page</a>"; } else { $tmp[] = ''; } $data[] = $tmp; } } // create table $tbl = new ilTableGUI(); // title & header columns if ($hasPublicSection) { $tbl->setTitle("Available Clients"); $tbl->setHeaderNames(array("Installation Name", "Login", "Public Access")); $tbl->setHeaderVars(array("name", "index", "login")); $tbl->setColumnWidth(array("50%", "25%", "25%")); } else { $tbl->setTitle("Available Clients"); $tbl->setHeaderNames(array("Installation Name", "Login", '')); $tbl->setHeaderVars(array("name", "login", '')); $tbl->setColumnWidth(array("70%", "25%", '1px')); } // control $tbl->setOrderColumn($_GET["sort_by"], "name"); $tbl->setOrderDirection($_GET["sort_order"]); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); // content $tbl->setData($data); $tbl->disable("icon"); $tbl->disable("numinfo"); $tbl->disable("sort"); $tbl->disable("footer"); // render table $tbl->render(); $tpl->show("DEFAULT", true, true); }
/** * Print out statistics about the language */ function statisticsObject() { $modules = ilObjLanguageExt::_getModules($this->object->key); $data = array(); $total = array("", 0, 0, 0); foreach ($modules as $module) { $row = array(); $row[0] = $module; $row[1] = count($this->object->getAllValues(array($module))); $row[2] = count($this->object->getChangedValues(array($module))); $row[3] = $row[1] - $row[2]; $total[1] += $row[1]; $total[2] += $row[2]; $total[3] += $row[3]; $data[] = $row; } $total[0] = "<b>" . $this->lng->txt("language_all_modules") . "</b>"; $total[1] = "<b>" . $total[1] . "</b>"; $total[2] = "<b>" . $total[2] . "</b>"; $total[3] = "<b>" . $total[3] . "</b>"; $data[] = $total; // prepare the templates for output $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lang_statistics.html", "Services/Language"); $this->tpl->addBlockFile("TABLE_STATISTICS", "table_statistics", "tpl.table.html"); $this->tpl->addBlockFile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html"); // create and configure the table object include_once 'Services/Table/classes/class.ilTableGUI.php'; $tbl = new ilTableGUI(); $tbl->disable('title'); $tbl->disable('sort'); $tbl->disable('numinfo'); $tbl->setHeaderNames(array($this->lng->txt("module"), $this->lng->txt("language_scope_global"), $this->lng->txt("language_scope_local"), $this->lng->txt("language_scope_unchanged"))); $tbl->setColumnWidth(array("25%", "25%", "25%", "25%")); $tbl->setLimit(count($data)); $tbl->setData($data); // show the table $tbl->render(); // $this->tpl->show(); }
/** * Displays the settings page for test defaults * * @access public */ function defaultsObject() { global $ilUser; global $ilAccess; if (!$ilAccess->checkAccess("write", "", $this->ref_id)) { // allow only write access ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true); $this->ctrl->redirect($this, "infoScreen"); } $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_defaults.html", "Modules/Test"); $maxentries = $ilUser->getPref("hits_per_page"); if ($maxentries < 1) { $maxentries = 9999; } $offset = $_GET["offset"] ? $_GET["offset"] : 0; $sortby = $_GET["sort_by"] ? $_GET["sort_by"] : "name"; $sortorder = $_GET["sort_order"] ? $_GET["sort_order"] : "asc"; $defaults =& $this->object->getAvailableDefaults($sortby, $sortorder); if (count($defaults) > 0) { $tablerows = array(); foreach ($defaults as $row) { array_push($tablerows, array("checkbox" => "<input type=\"checkbox\" name=\"chb_defaults[]\" value=\"" . $row["test_defaults_id"] . "\"/>", "name" => $row["name"])); } $headervars = array("", "name"); include_once "./Services/Table/classes/class.ilTableGUI.php"; $tbl = new ilTableGUI(0, FALSE); $tbl->setTitle($this->lng->txt("tst_defaults_available")); $header_names = array("", $this->lng->txt("title")); $tbl->setHeaderNames($header_names); $tbl->disable("sort"); $tbl->disable("auto_sort"); $tbl->enable("title"); $tbl->enable("action"); $tbl->enable("select_all"); $tbl->setLimit($maxentries); $tbl->setOffset($offset); $tbl->setData($tablerows); $tbl->setMaxCount(count($tablerows)); $tbl->setOrderDirection($sortorder); $tbl->setSelectAllCheckbox("chb_defaults"); $tbl->setFormName("formDefaults"); $tbl->addActionButton("deleteDefaults", $this->lng->txt("delete")); $tbl->addActionButton("applyDefaults", $this->lng->txt("apply")); $header_params = $this->ctrl->getParameterArray($this, "defaults"); $tbl->setHeaderVars($headervars, $header_params); // footer $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next")); // render table $tableoutput = $tbl->render(); $this->tpl->setVariable("TEST_DEFAULTS_TABLE", $tableoutput); } else { $this->tpl->setVariable("TEST_DEFAULTS_TABLE", $this->lng->txt("tst_defaults_not_defined")); } $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "addDefaults")); $this->tpl->setVariable("BUTTON_ADD", $this->lng->txt("add")); $this->tpl->setVariable("TEXT_DEFAULTS_OF_TEST", $this->lng->txt("tst_defaults_defaults_of_test")); }