4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
5 include_once(
"./Services/Badge/classes/class.ilBadge.php");
19 function __construct($a_parent_obj, $a_parent_cmd =
"", $a_has_write =
false)
23 $this->
setId(
"bdgobdg");
24 $this->has_write = (bool)$a_has_write;
26 parent::__construct($a_parent_obj, $a_parent_cmd);
30 $this->
setTitle($lng->txt(
"badge_object_badges"));
37 $this->
addColumn($lng->txt(
"title"),
"title");
38 $this->
addColumn($lng->txt(
"type"),
"type");
39 $this->
addColumn($lng->txt(
"object"),
"container");
40 $this->
addColumn($lng->txt(
"active"),
"active");
41 $this->
addColumn($lng->txt(
"action"),
"");
46 $this->
addMultiCommand(
"deactivateObjectBadges", $lng->txt(
"deactivate"));
47 $this->
addMultiCommand(
"confirmDeleteObjectBadges", $lng->txt(
"delete"));
52 $this->
setRowTemplate(
"tpl.object_badge_row.html",
"Services/Badge");
68 $this->filter[
"title"] =
$title->getValue();
71 $this->filter[
"object"] = $object->getValue();
73 $lng->loadLanguageModule(
"search");
76 "" => $lng->txt(
"search_any"),
81 if(!in_array(
"bdga", $type->getValidObjectTypes()))
90 $this->filter[
"type"] = $type->getValue();
95 global
$lng, $ilAccess;
101 include_once
"Services/Badge/classes/class.ilBadgeRenderer.php";
102 include_once
"Services/Link/classes/class.ilLink.php";
107 $container_url = null;
108 $container =
'<img src="'.
110 '" alt="'.$lng->txt(
"obj_".$badge_item[
"parent_type"]).
111 '" title="'.$lng->txt(
"obj_".$badge_item[
"parent_type"]).
'" /> '.
112 $badge_item[
"parent_title"];
114 if((
bool)$badge_item[
"deleted"])
116 $container .=
' <span class="il_ItemAlertProperty">'.$lng->txt(
"deleted").
'</span>';
121 if($ilAccess->checkAccess(
"read",
"",
$ref_id))
130 "id" => $badge_item[
"id"],
131 "active"=> $badge_item[
"active"],
132 "type" => $type_caption,
133 "title" => $badge_item[
"title"],
134 "container_meta" => $container,
135 "container_url" => $container_url,
136 "container_id" => $badge_item[
"parent_id"],
140 $filter_types[$badge_item[
"type_id"]] = $type_caption;
150 if($a_set[
"container_url"])
152 $this->tpl->setCurrentBlock(
"container_link_bl");
153 $this->tpl->setVariable(
"TXT_CONTAINER", $a_set[
"container_meta"]);
154 $this->tpl->setVariable(
"URL_CONTAINER", $a_set[
"container_url"]);
155 $this->tpl->parseCurrentBlock();
159 $this->tpl->setCurrentBlock(
"container_nolink_bl");
160 $this->tpl->setVariable(
"TXT_CONTAINER_STATIC", $a_set[
"container_meta"]);
161 $this->tpl->parseCurrentBlock();
166 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
169 $this->tpl->setVariable(
"PREVIEW", $a_set[
"renderer"]->
getHTML());
170 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
171 $this->tpl->setVariable(
"TXT_TYPE", $a_set[
"type"]);
172 $this->tpl->setVariable(
"TXT_ACTIVE", $a_set[
"active"]
178 $ilCtrl->setParameter($this->
getParentObject(),
"pid", $a_set[
"container_id"]);
184 $this->tpl->setVariable(
"TXT_LIST", $lng->txt(
"users"));
185 $this->tpl->setVariable(
"URL_LIST",
$url);
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
static getObjectInstances(array $a_filter=null)
getParentObject()
Get parent object.
static _getAllReferences($a_id)
get all reference ids of object
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
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.
__construct($a_parent_obj, $a_parent_cmd="", $a_has_write=false)
TableGUI class for badge listing.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
setLimit($a_limit=0, $a_default_limit=0)
static getInstance()
Constructor.
setFilterCommand($a_val, $a_caption=null)
Set filter command.