本文整理汇总了PHP中ilObjStyleSheet::_lookupActive方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjStyleSheet::_lookupActive方法的具体用法?PHP ilObjStyleSheet::_lookupActive怎么用?PHP ilObjStyleSheet::_lookupActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjStyleSheet
的用法示例。
在下文中一共展示了ilObjStyleSheet::_lookupActive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editContentStylesObject
/**
* view list of styles
*/
function editContentStylesObject()
{
global $rbacsystem, $ilias, $tpl, $ilToolbar, $ilCtrl, $lng;
if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
$this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
}
// this may not be cool, if styles are organised as (independent) Service
include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php";
include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
$from_styles = $to_styles = $data = array();
$styles = $this->object->getStyles();
foreach ($styles as $style) {
$style["active"] = ilObjStyleSheet::_lookupActive($style["id"]);
$style["lm_nr"] = ilObjContentObject::_getNrOfAssignedLMs($style["id"]);
$data[$style["title"] . ":" . $style["id"]] = $style;
if ($style["lm_nr"] > 0) {
$from_styles[$style["id"]] = $style["title"];
}
if ($style["active"] > 0) {
$to_styles[$style["id"]] = $style["title"];
}
}
// number of individual styles
if ($fixed_style <= 0) {
$data[-1] = array("title" => $this->lng->txt("sty_individual_styles"), "id" => 0, "lm_nr" => ilObjContentObject::_getNrLMsIndividualStyles());
$from_styles[-1] = $this->lng->txt("sty_individual_styles");
}
// number of default style (fallback default style)
if ($default_style <= 0 && $fixed_style <= 0) {
$data[0] = array("title" => $this->lng->txt("sty_default_style"), "id" => 0, "lm_nr" => ilObjContentObject::_getNrLMsNoStyle());
$from_styles[0] = $this->lng->txt("sty_default_style");
$to_styles[0] = $this->lng->txt("sty_default_style");
}
if ($rbacsystem->checkAccess("write", $this->object->getRefId())) {
$ilToolbar->addButton($lng->txt("sty_add_content_style"), $ilCtrl->getLinkTarget($this, "createStyle"));
$ilToolbar->addSeparator();
include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
// from styles selector
$si = new ilSelectInputGUI($lng->txt("sty_move_lm_styles") . ": " . $lng->txt("sty_from"), "from_style");
$si->setOptions($from_styles);
$ilToolbar->addInputItem($si, true);
// from styles selector
$si = new ilSelectInputGUI($lng->txt("sty_to"), "to_style");
$si->setOptions($to_styles);
$ilToolbar->addInputItem($si, true);
$ilToolbar->addFormButton($lng->txt("sty_move_style"), "moveLMStyles");
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
}
include_once "./Services/Style/classes/class.ilContentStylesTableGUI.php";
$table = new ilContentStylesTableGUI($this, "editContentStyles", $data, $this->object);
$tpl->setContent($table->getHTML());
}