本文整理汇总了PHP中ilObject::hasAutoRating方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::hasAutoRating方法的具体用法?PHP ilObject::hasAutoRating怎么用?PHP ilObject::hasAutoRating使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObject
的用法示例。
在下文中一共展示了ilObject::hasAutoRating方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleAutoRating
/**
* Activate rating automatically if parent container setting
*
* @param ilObject $a_new_obj
*/
protected function handleAutoRating(ilObject $a_new_obj)
{
if (ilObject::hasAutoRating($a_new_obj->getType(), $a_new_obj->getRefId()) && method_exists($a_new_obj, "setRating")) {
$a_new_obj->setRating(true);
$a_new_obj->update();
}
}
示例2: getSettingsFormValues
function getSettingsFormValues($a_mode = "edit")
{
global $lng, $ilUser;
// set values
if ($a_mode == "create") {
//$values["startpage"] = $lng->txt("wiki_main_page");
$values["rating_new"] = true;
$values["rating_overall"] = ilObject::hasAutoRating("wiki", $_GET["ref_id"]);
$this->form_gui->setValuesByArray($values);
} else {
$values["online"] = $this->object->getOnline();
$values["title"] = $this->object->getTitle();
//$values["startpage"] = $this->object->getStartPage();
$values["startpage_id"] = ilWikiPage::_getPageIdForWikiTitle($this->object->getId(), $this->object->getStartPage());
$values["shorttitle"] = $this->object->getShortTitle();
$values["description"] = $this->object->getLongDescription();
$values["rating_overall"] = $this->object->getRatingOverall();
$values["rating"] = $this->object->getRating();
// $values["rating_side"] = $this->object->getRatingAsBlock();
$values["rating_new"] = $this->object->getRatingForNewPages();
$values["rating_ext"] = $this->object->getRatingCategories();
$values["public_notes"] = $this->object->getPublicNotes();
$values["intro"] = $this->object->getIntroduction();
// $values["imp_pages"] = $this->object->getImportantPages();
$values["page_toc"] = $this->object->getPageToc();
// only set given values (because of adv. metadata)
$this->form_gui->setValuesByArray($values, true);
}
}