本文整理汇总了PHP中ilObject::_lookUpType方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::_lookUpType方法的具体用法?PHP ilObject::_lookUpType怎么用?PHP ilObject::_lookUpType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObject
的用法示例。
在下文中一共展示了ilObject::_lookUpType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: userDataArrayForExport
function userDataArrayForExport($user, $b_allowExportPrivacy = false)
{
$userArray = array();
if ($b_allowExportPrivacy == false) {
$userArray["user"] = $user;
} else {
global $ilUser;
$userArray["login"] = "";
$userArray["user"] = "";
$userArray["email"] = "";
$userArray["department"] = "";
if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
$e_user = new ilObjUser($user);
$userArray["login"] = $e_user->getLogin();
$userArray["user"] = $e_user->getLastname() . ', ' . $e_user->getFirstname();
$userArray["email"] = "" . $e_user->getEmail();
$userArray["department"] = "" . $e_user->getDepartment();
}
}
return $userArray;
}
示例2: parse
public function parse($userSelected, $report, $reports)
{
global $ilCtrl, $lng;
$lng->loadLanguageModule("scormtrac");
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($ilCtrl->getFormAction($this->parent_obj));
$options = array("all" => $lng->txt("all"));
include_once "Services/Tracking/classes/class.ilTrQuery.php";
$users = ilTrQuery::getParticipantsForObject($this->parent_obj->object->ref_id);
include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
$privacy = ilPrivacySettings::_getInstance();
$allowExportPrivacy = $privacy->enabledExportSCORM();
//$users = $this->parent_obj->object->getTrackedUsers("");
foreach ($users as $user) {
if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
if ($allowExportPrivacy == true) {
$e_user = new ilObjUser($user);
$options[$user] = $e_user->getLastname() . ", " . $e_user->getFirstname();
} else {
$options[$user] = 'User Id: ' . $user;
}
}
}
$si = new ilSelectInputGUI($lng->txt("user"), "userSelected");
$si->setOptions($options);
$si->setValue($userSelected);
$this->form->addItem($si);
$options = array("choose" => $lng->txt("please_choose"));
for ($i = 0; $i < count($reports); $i++) {
$options[$reports[$i]] = $lng->txt(strtolower($reports[$i]));
}
$si = new ilSelectInputGUI($lng->txt("report"), "report");
$si->setOptions($options);
$si->setValue($report);
$this->form->addItem($si);
$this->form->addCommandButton($this->parent_cmd, $lng->txt("apply_filter"));
}
示例3: deleteTrackingForUser
/**
* display deletion confirmation screen
*/
function deleteTrackingForUser()
{
if (!isset($_POST["user"])) {
$this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
}
// display confirmation message
include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setHeaderText($this->lng->txt("info_delete_sure"));
$cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteTracking");
$cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeleteTracking");
foreach ($_POST["user"] as $id) {
if (ilObject::_exists($id) && ilObject::_lookUpType($id) == "usr") {
$user = new ilObjUser($id);
$caption = ilUtil::getImageTagByType("sahs", $this->tpl->tplPath) . " " . $this->lng->txt("cont_tracking_data") . ": " . $user->getLastname() . ", " . $user->getFirstname();
$cgui->addItem("user[]", $id, $caption);
}
}
$this->tpl->setContent($cgui->getHTML());
}
示例4: exportSelected
function exportSelected($a_exportall = 0, $a_user = array())
{
global $ilDB, $ilUser;
$scos = array();
//get all SCO's of this object
$query = 'SELECT cp_node.cp_node_id ' . 'FROM cp_node, cp_resource, cp_item ' . 'WHERE cp_item.cp_node_id = cp_node.cp_node_id ' . 'AND cp_item.resourceid = cp_resource.id AND scormtype = %s ' . 'AND nodename = %s AND cp_node.slm_id = %s';
$res = $ilDB->queryF($query, array('text', 'text', 'integer'), array('sco', 'item', $this->getId()));
while ($row = $ilDB->fetchAssoc($res)) {
$scos[] = $row['cp_node_id'];
}
$csv = null;
//a module is completed when all SCO's are completed
$user_array = array();
if ($a_exportall == 1) {
$query = 'SELECT user_id ' . 'FROM cmi_node, cp_node ' . 'WHERE cmi_node.cp_node_id = cp_node.cp_node_id AND cp_node.slm_id = %s ' . 'GROUP BY user_id';
$res = $ilDB->queryF($query, array('integer'), array($this->getId()));
while ($row = $ilDB->fetchAssoc($res)) {
$user_array[] = $row['user_id'];
}
} else {
$user_array = $a_user;
}
foreach ($user_array as $user) {
$scos_c = $scos;
//copy SCO_array
//check if all SCO's are completed
for ($i = 0; $i < count($scos); $i++) {
$query = 'SELECT * FROM cmi_node ' . 'WHERE user_id = %s AND cp_node_id = %s ' . 'AND completion_status = %s OR success_status = %s';
$res = $ilDB->queryF($query, array('integer', 'integer', 'text', 'text'), array($user, $scos[$i], 'completed', 'passed'));
$data = $ilDB->fetchAssoc($res);
if (is_array($data) && count($data)) {
//delete from array
$key = array_search($scos[$i], $scos_c);
unset($scos_c[$key]);
}
}
//check for completion
if (count($scos_c) == 0) {
$completion = 1;
} else {
$completion = 0;
}
//write export entry
if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
$e_user = new ilObjUser($user);
$login = $e_user->getLogin();
$firstname = $e_user->getFirstname();
$lastname = $e_user->getLastname();
$email = $e_user->getEmail();
$department = $e_user->getDepartment();
$query = 'SELECT user_id, MAX(c_timestamp) exp_date ' . 'FROM cmi_node, cp_node ' . 'WHERE cmi_node.cp_node_id = cp_node.cp_node_id ' . 'AND cp_node.slm_id = %s ' . 'GROUP BY user_id';
$res = $ilDB->queryF($query, array('integer'), array($this->getId()));
$data = $ilDB->fetchAssoc($res);
if (is_array($data) && count($data)) {
$validDate = false;
$datetime = explode(' ', $data['exp_date']);
if (count($datetime) == 2) {
$date = explode('-', $datetime[0]);
if (count($date) == 3 && checkdate($date[1], $date[2], $date[0])) {
$validDate = true;
}
}
if ($validDate) {
$date = date('d.m.Y', strtotime($data['exp_date']));
} else {
$date = '';
}
} else {
$date = '';
}
$csv = $csv . "{$department};{$login};{$lastname};{$firstname};{$email};{$date};{$completion}\n";
}
}
$header = "Department;Login;Lastname;Firstname;Email;Date;Status\n";
$this->sendExportFile($header, $csv);
}
示例5: stopUserOfflineMode
/**
* Stop offline mode for selected users
*/
protected function stopUserOfflineMode()
{
if (!count((array) $_POST['user'])) {
ilUtil::sendFailure($this->lng->txt('select_one'), true);
$this->ctrl->redirect($this, 'offlineModeManager');
}
// display confirmation message
include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setHeaderText($this->lng->txt("info_stop_offline_mode_sure"));
$cgui->setCancel($this->lng->txt("cancel"), "cancelStopUserOfflineMode");
$cgui->setConfirm($this->lng->txt("confirm"), "confirmedStopUserOfflineMode");
foreach ($_POST["user"] as $id) {
if (ilObject::_exists($id) && ilObject::_lookUpType($id) == "usr") {
$user = new ilObjUser($id);
$caption = ilUtil::getImageTagByType("sahs_offline", $this->tpl->tplPath) . " " . $this->lng->txt("stop_user_offline_mode_for_user") . ": " . $user->getLastname() . ", " . $user->getFirstname();
$cgui->addItem("user[]", $id, $caption);
}
}
$this->tpl->setContent($cgui->getHTML());
}
示例6: showTrackingItems
function showTrackingItems()
{
global $ilTabs;
ilObjSCORMLearningModuleGUI::setSubTabs();
$ilTabs->setTabActive('cont_tracking_data');
$ilTabs->setSubTabActive('cont_tracking_byuser');
$reports = array('exportSelectedSuccess', 'exportSelectedCore', 'exportSelectedInteractions', 'exportSelectedObjectives', 'exportObjGlobalToSystem');
$userSelected = "all";
if (isset($_GET["userSelected"])) {
$userSelected = ilUtil::stripSlashes($_GET["userSelected"]);
}
if (isset($_POST["userSelected"])) {
$userSelected = ilUtil::stripSlashes($_POST["userSelected"]);
}
$this->ctrl->setParameter($this, 'userSelected', $userSelected);
$report = "choose";
if (isset($_GET["report"])) {
$report = ilUtil::stripSlashes($_GET["report"]);
}
if (isset($_POST["report"])) {
$report = ilUtil::stripSlashes($_POST["report"]);
}
$this->ctrl->setParameter($this, 'report', $report);
include_once './Modules/Scorm2004/classes/class.ilSCORM2004TrackingItemsPerUserFilterGUI.php';
$filter = new ilSCORM2004TrackingItemsPerUserFilterGUI($this, 'showTrackingItems');
$filter->parse($userSelected, $report, $reports);
if ($report == "choose") {
$this->tpl->setContent($filter->form->getHTML());
} else {
$usersSelected = array();
if ($userSelected != "all") {
$usersSelected[] = $userSelected;
} else {
include_once "Services/Tracking/classes/class.ilTrQuery.php";
$users = ilTrQuery::getParticipantsForObject($this->ref_id);
foreach ($users as $user) {
if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
$usersSelected[] = $user;
}
}
}
$scosSelected = array();
$tmpscos = $this->object->getTrackedItems();
for ($i = 0; $i < count($tmpscos); $i++) {
$scosSelected[] = $tmpscos[$i]["id"];
}
//with check for course ...
// include_once "Services/Tracking/classes/class.ilTrQuery.php";
// $a_users=ilTrQuery::getParticipantsForObject($this->ref_id);
// var_dump($this->object->getTrackedUsers(""));
include_once './Modules/Scorm2004/classes/class.ilSCORM2004TrackingItemsTableGUI.php';
$tbl = new ilSCORM2004TrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItems', $usersSelected, $scosSelected, $report);
$this->tpl->setContent($filter->form->getHTML() . $tbl->getHTML());
}
return true;
}