4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
5 include_once(
"./Services/Badge/classes/class.ilBadge.php");
20 function __construct($a_parent_obj, $a_parent_cmd =
"", $a_parent_obj_id, $a_has_write =
false)
24 $this->
setId(
"bdgbdg");
25 $this->has_write = (bool)$a_has_write;
28 parent::__construct($a_parent_obj, $a_parent_cmd);
32 $this->
setTitle($lng->txt(
"obj_bdga"));
39 $this->
addColumn($lng->txt(
"title"),
"title");
40 $this->
addColumn($lng->txt(
"type"),
"type");
41 $this->
addColumn($lng->txt(
"active"),
"active");
45 $this->
addColumn($lng->txt(
"action"),
"");
47 $lng->loadLanguageModule(
"content");
48 $this->
addMultiCommand(
"copyBadges", $lng->txt(
"cont_copy_to_clipboard"));
72 $this->filter[
"title"] =
$title->getValue();
75 $valid_types = $handler->getAvailableTypesForObjType($this->parent_type);
77 sizeof($valid_types) > 1)
79 $lng->loadLanguageModule(
"search");
82 foreach($valid_types as $id => $type)
90 $this->filter[
"type"] = $type->getValue();
98 include_once
"Services/Badge/classes/class.ilBadgeRenderer.php";
103 "id" => $badge->getId(),
104 "title" => $badge->getTitle(),
105 "active" => $badge->isActive(),
106 "type" => ($this->parent_type !=
"bdga")
108 : $badge->getTypeInstance()->getCaption(),
109 "manual" => (!$badge->getTypeInstance() instanceof
ilBadgeAuto),
123 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
126 $this->tpl->setVariable(
"PREVIEW", $a_set[
"renderer"]->
getHTML());
127 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
128 $this->tpl->setVariable(
"TXT_TYPE", $a_set[
"type"]);
129 $this->tpl->setVariable(
"TXT_ACTIVE", $a_set[
"active"]
135 include_once
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
137 $actions->setListTitle($lng->txt(
"actions"));
139 if($a_set[
"manual"] &&
147 $actions->addItem($lng->txt(
"badge_award_badge"),
"",
$url);
153 $actions->addItem($lng->txt(
"edit"),
"",
$url);
155 $this->tpl->setVariable(
"ACTIONS", $actions->getHTML());
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static getInstancesByParentId($a_parent_id, array $a_filter=null)
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
if(!is_array($argv)) $options
static getExtendedTypeCaption(ilBadgeType $a_type)
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
TableGUI class for badge listing.
__construct($a_parent_obj, $a_parent_cmd="", $a_parent_obj_id, $a_has_write=false)
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setLimit($a_limit=0, $a_default_limit=0)
getItems($a_parent_obj_id)
static getInstance()
Constructor.
setFilterCommand($a_val, $a_caption=null)
Set filter command.