本文整理汇总了PHP中ilUtil::yn2tf方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::yn2tf方法的具体用法?PHP ilUtil::yn2tf怎么用?PHP ilUtil::yn2tf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUtil
的用法示例。
在下文中一共展示了ilUtil::yn2tf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _lookupOnline
/**
* check wether learning module is online
*/
function _lookupOnline($a_id)
{
global $ilDB;
$set = $ilDB->queryF('SELECT * FROM sahs_lm WHERE id = %s', array('integer'), array($a_id));
$rec = $ilDB->fetchAssoc($set);
return ilUtil::yn2tf($rec["c_online"]);
}
示例2: fillRow
/**
* Fill table row
*/
protected function fillRow($entry)
{
global $lng, $ilCtrl;
$ilCtrl->setParameter($this->parent_obj, "menu_entry", $entry["id"]);
$this->tpl->setCurrentBlock("cmd");
$this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj, "editMenuEntry"));
$this->tpl->setVariable("CMD", $this->lng->txt("edit"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("cmd");
$this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj, "deleteMenuEntry"));
$this->tpl->setVariable("CMD", $this->lng->txt("delete"));
$this->tpl->parseCurrentBlock();
$ilCtrl->setParameter($this, "menu_entry", "");
$this->tpl->setVariable("LINK_ID", $entry["id"]);
if ($entry["type"] == "intern") {
$entry["link"] = ILIAS_HTTP_PATH . "/goto.php?target=" . $entry["link"];
}
// add http:// prefix if not exist
if (!strstr($entry["link"], '://') && !strstr($entry["link"], 'mailto:')) {
$entry["link"] = "http://" . $entry["link"];
}
$this->tpl->setVariable("HREF_LINK", $entry["link"]);
$this->tpl->setVariable("LINK", $entry["title"]);
if (ilUtil::yn2tf($entry["active"])) {
$this->tpl->setVariable("ACTIVE_CHECK", "checked=\"checked\"");
}
}
示例3: _lookupOnline
/**
* check wether learning module is online
*/
function _lookupOnline($a_id)
{
global $ilDB;
$q = "SELECT * FROM glossary WHERE id = " . $ilDB->quote($a_id, "integer");
$lm_set = $ilDB->query($q);
$lm_rec = $ilDB->fetchAssoc($lm_set);
return ilUtil::yn2tf($lm_rec["is_online"]);
}
示例4: _lookupOfflineModeAvailable
/**
* check wether learning module is online
*/
function _lookupOfflineModeAvailable($a_id)
{
global $ilDB;
$set = $ilDB->queryF('SELECT offline_mode FROM sahs_lm WHERE id = %s', array('integer'), array($a_id));
$rec = $ilDB->fetchAssoc($set);
return ilUtil::yn2tf($rec["offline_mode"]);
}
示例5: saveProperties
/**
* save properties
*/
function saveProperties()
{
$this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
$this->object->setOpenMode($_POST["open_mode"]);
$this->object->setWidth($_POST["width"]);
$this->object->setHeight($_POST["height"]);
$this->object->setAutoReview(ilUtil::yn2tf($_POST["auto_review"]));
$this->object->setAPIAdapterName($_POST["api_adapter"]);
$this->object->setAPIFunctionsPrefix($_POST["api_func_prefix"]);
$this->object->setCreditMode($_POST["credit_mode"]);
$this->object->setDefaultLessonMode($_POST["lesson_mode"]);
$this->object->setMaxAttempt($_POST["max_attempt"]);
$this->object->setSession(ilUtil::yn2tf($_POST["cobj_session"]));
$this->object->setDebug(ilUtil::yn2tf($_POST["cobj_debug"]));
$this->object->setAutoContinue(ilUtil::yn2tf($_POST["auto_continue"]));
$this->object->setAuto_last_visited(ilUtil::yn2tf($_POST["cobj_auto_last_visited"]));
$this->object->setCheck_values(ilUtil::yn2tf($_POST["cobj_check_values"]));
$this->object->update();
ilUtil::sendInfo($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, "properties");
}
示例6: saveProperties
/**
* Save properties form
*/
public function saveProperties()
{
global $tpl, $ilAccess, $ilTabs;
$this->initSettingsForm("");
if ($this->form->checkInput()) {
$this->object->setTitle($this->form->getInput("title"));
$this->object->setDescription($this->form->getInput("desc"));
$this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
$this->object->setShowBibliographicalData($this->form->getInput("bib"));
$lic = $this->form->getItemByPostVar("lic");
if ($lic && !$lic->getDisabled()) {
$this->object->setShowLicense($this->form->getInput("lic"));
}
$this->object->update();
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, "properties");
}
$ilTabs->activateTab("id_settings");
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}
示例7: updateSequencingSettings
function updateSequencingSettings()
{
include_once "./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Sequencing.php";
$control_settings = new ilSCORM2004Sequencing($this->getId(), true);
$control_settings->setChoice(ilUtil::yn2tf($_POST["choice"]));
$control_settings->setFlow(ilUtil::yn2tf($_POST["flow"]));
$control_settings->setForwardOnly(ilUtil::yn2tf($_POST["forwardonly"]));
$control_settings->insert();
return true;
}
示例8: sop2il
function sop2il()
{
// sleep(5);
global $ilDB, $ilUser;
$in = file_get_contents("php://input");
$GLOBALS['ilLog']->write($in);
$ret = array('msg' => array(), 'err' => array());
if (!$in || $in == "") {
$ret['err'][] = "no post data recieved";
print json_encode($ret);
exit;
}
$userId = $ilUser->getID();
$result = true;
if ($this->type == 'scorm2004') {
$lm_set = $ilDB->queryF('SELECT default_lesson_mode, interactions, objectives, comments FROM sahs_lm WHERE id = %s', array('integer'), array($this->obj_id));
while ($lm_rec = $ilDB->fetchAssoc($lm_set)) {
$defaultLessonMode = $lm_rec["default_lesson_mode"];
$interactions = ilUtil::yn2tf($lm_rec["interactions"]);
$objectives = ilUtil::yn2tf($lm_rec["objectives"]);
$comments = ilUtil::yn2tf($lm_rec["comments"]);
}
include_once './Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
$data = json_decode($in);
$GLOBALS['ilLog']->write('cmi_count=' . count($data->cmi));
for ($i = 0; $i < count($data->cmi); $i++) {
if ($result == true) {
//$a_r=array();
$cdata = $data->cmi[$i];
$a_r = ilSCORM2004StoreData::setCMIData($userId, $this->obj_id, $data->cmi[$i], $comments, $interactions, $objectives);
if (!is_array($a_r)) {
$result = false;
}
}
}
if ($result == true) {
$result = ilSCORM2004StoreData::syncGlobalStatus($userId, $this->obj_id, $data, $data->now_global_status);
}
} else {
include_once "./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php";
$data = json_decode($in);
$result = ilObjSCORMTracking::storeJsApiCmi($userId, $this->obj_id, $data);
if ($result == true) {
$result = ilObjSCORMTracking::syncGlobalStatus($userId, $this->obj_id, $data, $data->now_global_status);
}
}
if ($result == true) {
$result = self::scormPlayerUnloadForSOP2il($data);
}
if ($result == false) {
$ret['err'][] = "invalid post data recieved";
} else {
$ret['msg'][] = "post data recieved";
}
header('Content-Type: text/plain; charset=UTF-8');
print json_encode($ret);
}
示例9: isProtected
/**
* @todo refactor rolf => search calls
* @global ilDB $ilDB
* @param type $a_ref_id
* @param type $a_role_id
* @return type
* @todo refactor rolf => DONE
*/
public function isProtected($a_ref_id, $a_role_id)
{
global $ilDB;
$query = "SELECT protected FROM rbac_fa " . "WHERE rol_id = " . $ilDB->quote($a_role_id, 'integer') . " " . "AND parent = " . $ilDB->quote($a_ref_id, 'integer') . " ";
$res = $ilDB->query($query);
$row = $ilDB->fetchAssoc($res);
return ilUtil::yn2tf($row['protected']);
}
示例10: saveProperties
/**
* save properties
*/
function saveProperties()
{
global $tpl;
$this->initSettingsForm();
if ($this->form->checkInput()) {
$this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
$this->object->setVirtualMode($_POST["glo_mode"]);
// $this->object->setActiveGlossaryMenu(ilUtil::yn2tf($_POST["glo_act_menu"]));
$this->object->setActiveDownloads(ilUtil::yn2tf($_POST["glo_act_downloads"]));
$this->object->setPresentationMode($_POST["pres_mode"]);
$this->object->setSnippetLength($_POST["snippet_length"]);
$this->object->setShowTaxonomy($_POST["show_tax"]);
$this->object->update();
// set definition short texts dirty
include_once "./Modules/Glossary/classes/class.ilGlossaryDefinition.php";
ilGlossaryDefinition::setShortTextsDirty($this->object->getId());
// Update ecs export settings
include_once 'Modules/Glossary/classes/class.ilECSGlossarySettings.php';
$ecs = new ilECSGlossarySettings($this->object);
if ($ecs->handleSettingsUpdate()) {
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, "properties");
}
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHTML());
}
示例11: saveProperties
/**
* save scorm 2004 module properties
*/
function saveProperties()
{
global $ilSetting;
if ($this->object->editable != 1) {
//check if OfflineMode-Zip has to be created
$tmpOfflineMode = ilUtil::yn2tf($_POST["cobj_offline_mode"]);
$tmpSequencing = ilUtil::yn2tf($_POST["cobj_sequencing"]);
if ($tmpOfflineMode == true) {
$tmpSequencing = false;
//actually no sequencing for offline_mode
if ($this->object->getOfflineMode() == false) {
$this->object->zipLmForOfflineMode();
}
}
$this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
$this->object->setOpenMode($_POST["open_mode"]);
$this->object->setWidth($_POST["width"]);
$this->object->setHeight($_POST["height"]);
$this->object->setCreditMode($_POST["credit_mode"]);
$this->object->setMaxAttempt($_POST["max_attempt"]);
$this->object->setAutoReviewChar($_POST["auto_review"]);
$this->object->setDefaultLessonMode($_POST["lesson_mode"]);
$this->object->setSession(ilUtil::yn2tf($_POST["cobj_session"]));
$this->object->setNoMenu(ilUtil::yn2tf($_POST["cobj_nomenu"]));
$this->object->setHideNavig(ilUtil::yn2tf($_POST["cobj_hidenavig"]));
$this->object->setAuto_last_visited(ilUtil::yn2tf($_POST["cobj_auto_last_visited"]));
$this->object->setSequencing($tmpSequencing);
$this->object->setInteractions(ilUtil::yn2tf($_POST["cobj_interactions"]));
$this->object->setObjectives(ilUtil::yn2tf($_POST["cobj_objectives"]));
$this->object->setComments(ilUtil::yn2tf($_POST["cobj_comments"]));
$this->object->setTime_from_lms(ilUtil::yn2tf($_POST["cobj_time_from_lms"]));
$this->object->setCheck_values(ilUtil::yn2tf($_POST["cobj_check_values"]));
$this->object->setAutoSuspend(ilUtil::yn2tf($_POST["cobj_auto_suspend"]));
$this->object->setOfflineMode($tmpOfflineMode);
$this->object->setDebug(ilUtil::yn2tf($_POST["cobj_debug"]));
//$this->object->setDebugPw($_POST["debug_pw"]);
} else {
$this->initPropertiesEditableForm();
if ($this->form->checkInput()) {
$this->object->setTries($_POST["q_tries"]);
$this->object->setLocalization($_POST["localization"]);
if ($ilSetting->get("fixed_content_style_id") <= 0 && (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId()) || $this->object->getStyleSheetId() == 0)) {
$this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
}
}
}
$this->object->update();
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, "properties");
}
示例12: persistCMIData
public function persistCMIData()
{
global $ilLog, $ilDB, $ilUser;
$packageId = (int) $_GET['package_id'];
$lm_set = $ilDB->queryF('SELECT default_lesson_mode, interactions, objectives, comments FROM sahs_lm WHERE id = %s', array('integer'), array($packageId));
while ($lm_rec = $ilDB->fetchAssoc($lm_set)) {
$defaultLessonMode = $lm_rec["default_lesson_mode"];
$interactions = ilUtil::yn2tf($lm_rec["interactions"]);
$objectives = ilUtil::yn2tf($lm_rec["objectives"]);
$comments = ilUtil::yn2tf($lm_rec["comments"]);
}
$data = file_get_contents('php://input');
$ilUser->setId($data->p);
include_once './Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
ilSCORM2004StoreData::persistCMIData(null, $packageId, $defaultLessonMode, $comments, $interactions, $objectives, $data);
}
示例13: _isActivated
function _isActivated($a_course_obj_id)
{
global $ilDB, $ilias;
if (!$ilias->getSetting("ilinc_active")) {
return false;
}
$r = $ilDB->queryf('
SELECT activation_offline FROM ilinc_data WHERE obj_id = %s', array('integer'), array($a_course_obj_id));
$row = $r->fetchRow(DB_FETCHMODE_OBJECT);
return ilUtil::yn2tf($row->activation_offline);
}
示例14: _preloadData
/**
* Preload data
*
* @param array $a_obj_ids array of object ids
*/
function _preloadData($a_obj_ids, $a_ref_ids)
{
global $ilDB, $ilUser;
$q = "SELECT id, is_online, startfile FROM file_based_lm WHERE " . $ilDB->in("id", $a_obj_ids, false, "integer");
$lm_set = $ilDB->query($q);
while ($rec = $ilDB->fetchAssoc($lm_set)) {
self::$online[$rec["id"]] = ilUtil::yn2tf($rec["is_online"]);
self::$startfile[$rec["id"]] = $rec["startfile"] . "";
}
}
示例15: isProtected
/**
* @todo refactor rolf => search calls
* @global ilDB $ilDB
* @param type $a_ref_id
* @param type $a_role_id
* @return type
* @todo refactor rolf => DONE
*/
public function isProtected($a_ref_id, $a_role_id)
{
global $ilDB;
// ref_id not used yet. protected permission acts 'global' for each role,
$query = "SELECT protected FROM rbac_fa " . "WHERE rol_id = " . $ilDB->quote($a_role_id, 'integer') . " ";
$res = $ilDB->query($query);
$row = $ilDB->fetchAssoc($res);
return ilUtil::yn2tf($row['protected']);
}