本文整理汇总了PHP中ilLMObject::_isPagePublic方法的典型用法代码示例。如果您正苦于以下问题:PHP ilLMObject::_isPagePublic方法的具体用法?PHP ilLMObject::_isPagePublic怎么用?PHP ilLMObject::_isPagePublic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilLMObject
的用法示例。
在下文中一共展示了ilLMObject::_isPagePublic方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isClickable
/**
* check if links for certain object type are activated
*
* @param string $a_type object type
*
* @return boolean true if linking is activated
*/
function isClickable($a_type, $a_obj_id = 0)
{
global $ilUser;
// in this standard implementation
// only the type determines, wether an object should be clickable or not
// but this method can be overwritten and make use of the ref id
// (this happens e.g. in class ilRepositoryExplorerGUI)
if ($this->is_clickable[$a_type] == "n") {
return false;
}
// check public access
include_once 'Services/Payment/classes/class.ilPaymentObject.php';
if (($ilUser->getId() == ANONYMOUS_USER_ID || ilPaymentObject::_requiresPurchaseToAccess((int) $this->lm_obj->getRefId())) && !ilLMObject::_isPagePublic($a_obj_id, true)) {
return false;
}
return true;
}
示例2: isClickable
function isClickable($a_type, $a_node_id)
{
global $ilUser;
$orig_node_id = $a_node_id;
if ($a_type == "st") {
if (!$this->offlineMode()) {
$a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg");
$a_node_id = $a_node["child"];
if ($a_node_id == 0) {
return false;
}
} else {
// get next activated page
$found = false;
while (!$found) {
$a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg");
$a_node_id = $a_node["child"];
include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
$active = ilLMPage::_lookupActive($a_node_id, $this->lm_obj->getType(), $this->lm_set->get("time_scheduled_page_activation"));
if ($a_node_id > 0 && !$active) {
$found = false;
} else {
$found = true;
}
}
if ($a_node_id <= 0) {
return false;
} else {
$path = $this->tree->getPathId($a_node_id);
if (!in_array($orig_node_id, $path)) {
return false;
}
}
}
}
if ($a_type == "pg") {
// check public area mode
include_once "./Modules/LearningModule/classes/class.ilLMObject.php";
include_once 'Services/Payment/classes/class.ilPaymentObject.php';
if (($ilUser->getId() == ANONYMOUS_USER_ID || ilPaymentObject::_requiresPurchaseToAccess((int) $this->lm_obj->getRefId())) && !ilLMObject::_isPagePublic($a_node_id, true)) {
return false;
}
}
return true;
}
示例3: showPrintView
//.........这里部分代码省略.........
$nodes[] = array("obj_id" => $k, "type" => "pg", "free" => true);
}
}
}
} else {
ilUtil::sendFailure($lng->txt("cont_print_no_page_selected"), true);
$ilCtrl->redirect($this, "showPrintViewSelection");
}
foreach ($nodes as $node_key => $node) {
// check page activation
$active = ilLMPage::_lookupActive($node["obj_id"], $this->lm->getType(), $this->lm_set->get("time_scheduled_page_activation"));
if ($node["type"] == "pg" && !$active) {
continue;
}
// print all subchapters/subpages if higher chapter
// has been selected
if ($node["depth"] <= $act_level) {
if (is_array($_POST["obj_id"]) && in_array($node["obj_id"], $_POST["obj_id"])) {
$act_level = $node["depth"];
$activated = true;
} else {
$act_level = 99999;
$activated = false;
}
}
if ($activated && ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $node["obj_id"])) {
// output learning module header
if ($node["type"] == "du") {
$output_header = true;
}
// output chapter title
if ($node["type"] == "st") {
if (($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && $this->lm_gui->object->getPublicAccessMode() == "selected") {
if (!ilLMObject::_isPagePublic($node["obj_id"])) {
continue;
}
}
$chap = new ilStructureObject($this->lm, $node["obj_id"]);
$this->tpl->setCurrentBlock("print_chapter");
$chapter_title = $chap->_getPresentationTitle($node["obj_id"], $this->lm->isActiveNumbering(), $this->lm_set->get("time_scheduled_page_activation"), 0, $this->lang);
$this->tpl->setVariable("CHAP_TITLE", $chapter_title);
if ($this->lm->getPageHeader() == IL_CHAPTER_TITLE) {
if ($nodes[$node_key + 1]["type"] == "pg") {
$this->tpl->setVariable("CHAP_HEADER", $header_page_content);
$did_chap_page_header = true;
}
}
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("print_block");
$this->tpl->parseCurrentBlock();
}
// output page
if ($node["type"] == "pg") {
if (($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && $this->lm_gui->object->getPublicAccessMode() == "selected") {
if (!ilLMObject::_isPagePublic($node["obj_id"])) {
continue;
}
}
$this->tpl->setCurrentBlock("print_item");
// get page
$page_id = $node["obj_id"];
$page_object_gui = $this->getLMPageGUI($page_id);
$page_object = $page_object_gui->getPageObject();
include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
$page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->lm->getStyleSheetId(), "lm"));
// get lm page
示例4: formatObject
/**
* Creates output
* recursive method
* @access private
* @param integer
* @param array
* @return string
*/
function formatObject(&$tpl, $a_node_id, $a_option, $a_obj_id = 0)
{
global $lng;
if (!isset($a_node_id) or !is_array($a_option)) {
$this->ilias->raiseError(get_class($this) . "::formatObject(): Missing parameter or wrong datatype! " . "node_id: " . $a_node_id . " options:" . var_dump($a_option), $this->ilias->error_obj->WARNING);
}
if ($this->output_icons) {
$tpl->setCurrentBlock("icon");
$tpl->setVariable("ICON_IMAGE", ilUtil::getImagePath("icon_" . $a_option["type"] . ".png"));
$tpl->setVariable("PAGE_ID", $a_node_id);
//$this->iconList[] = "iconid_".$a_node_id;
$tpl->setVariable("TXT_ALT_IMG", $lng->txt($a_option["desc"]));
$tpl->parseCurrentBlock();
}
if (!$a_option["container"]) {
$tpl->setCurrentBlock("checkbox");
$tpl->setVariable("PAGE_ID", $a_node_id);
if (ilLMObject::_isPagePublic($a_node_id)) {
$tpl->setVariable("CHECKED", "checked=\"checked\"");
}
$tpl->parseCurrentBlock();
} else {
$childs = $this->tree->getChilds($a_node_id);
foreach ($childs as $node) {
if ($node["type"] == "pg") {
$pages[] = $node["child"];
}
}
$js_pages = ilUtil::array_php2js($pages);
$tpl->setVariable("ONCLICK", " onclick=\"alterCheckboxes('PublicSelector','page_',{$js_pages}); return false;\"");
}
$tpl->setCurrentBlock("text");
$tpl->setVariable("PAGE_ID", $a_node_id);
$tpl->setVariable("OBJ_TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("element");
$tpl->parseCurrentBlock();
//$this->output[] = $tpl->get();
}
示例5: isClickable
public function isClickable($a_type, $a_node_id)
{
global $ilUser;
if ($a_type == 'st') {
$a_node = $this->tree->fetchSuccessorNode($a_node_id, 'pg');
$a_node_id = $a_node['child'];
if ($a_node_id == 0) {
return false;
}
}
if ($a_type == 'pg') {
// check public area mode
include_once './Modules/LearningModule/classes/class.ilLMObject.php';
if ($this->lm_obj->getPublicAccessMode() == 'selected' && !ilLMObject::_isPagePublic($a_node_id)) {
return false;
}
}
return true;
}
示例6: isNodeClickable
/**
* Is node clickable
*
* @param array $a_node node array
* @return bool clickable?
*/
function isNodeClickable($a_node)
{
global $ilUser;
$orig_node_id = $a_node["child"];
// if navigation is restricted based on correct answered questions
// check if we have preceeding pages including unsanswered/incorrect answered questions
if (!$this->getOfflineMode()) {
if ($this->lm->getRestrictForwardNavigation()) {
if ($this->getTracker()->hasPredIncorrectAnswers($orig_node_id)) {
return false;
}
}
}
if ($a_node["type"] == "st") {
if (!$this->getOfflineMode()) {
if ($this->lm->getTOCMode() != "pages") {
$a_node = $this->getTree()->fetchSuccessorNode($a_node["child"], "pg");
} else {
// faster, but needs pages to be in explorer
$a_node = $this->getSuccessorNode($a_node["child"], "pg");
}
if ($a_node["child"] == 0) {
return false;
}
} else {
// get next activated page
$found = false;
while (!$found) {
if ($this->lm->getTOCMode() != "pages") {
$a_node = $this->getTree()->fetchSuccessorNode($a_node["child"], "pg");
} else {
$a_node = $this->getSuccessorNode($a_node["child"], "pg");
}
include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
$active = ilLMPage::_lookupActive($a_node["child"], $this->lm->getType(), $this->lm_set->get("time_scheduled_page_activation"));
if ($a_node["child"] > 0 && !$active) {
$found = false;
} else {
$found = true;
}
}
if ($a_node["child"] <= 0) {
return false;
} else {
$path = $this->getTree()->getPathId($a_node["child"]);
if (!in_array($orig_node_id, $path)) {
return false;
}
}
}
}
if ($a_node["type"] == "pg") {
// check public area mode
include_once "./Modules/LearningModule/classes/class.ilLMObject.php";
include_once 'Services/Payment/classes/class.ilPaymentObject.php';
if (($ilUser->getId() == ANONYMOUS_USER_ID || ilPaymentObject::_requiresPurchaseToAccess((int) $this->lm->getRefId())) && !ilLMObject::_isPagePublic($a_node["child"], true)) {
return false;
}
}
return true;
}