本文整理匯總了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);
}
}