4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
31 public function __construct($a_parent_obj, $a_parent_cmd, $a_user_id = null)
35 $this->lng = $DIC->language();
36 $this->
user = $DIC->user();
37 $this->ctrl = $DIC->ctrl();
38 $this->tpl = $DIC[
"tpl"];
39 $lng = $DIC->language();
48 $this->
setId(
"bdgprs");
50 parent::__construct($a_parent_obj, $a_parent_cmd);
65 $tpl->addJavascript(
"https://backpack.openbadges.org/issuer.js",
false);
67 $tpl->addJavascript(
"Services/Badge/js/ilBadge.js");
68 $tpl->addOnLoadCode(
'il.Badge.setUrl("' .
69 $ilCtrl->getLinkTarget($this->getParentObject(),
"addtoBackpack",
"",
true,
false) .
93 $this->filter[
"title"] =
$title->getValue();
95 $lng->loadLanguageModule(
"search");
98 "" =>
$lng->txt(
"search_any"),
99 "-1" =>
$lng->txt(
"none")
104 $obj->setOptions(
$options + $a_parents);
105 $this->filter[
"obj"] = $obj->getValue();
114 include_once
"Services/Badge/classes/class.ilBadge.php";
115 include_once
"Services/Badge/classes/class.ilBadgeAssignment.php";
116 include_once
"Services/Badge/classes/class.ilBadgeRenderer.php";
118 $badge =
new ilBadge($ass->getBadgeId());
121 if ($badge->getParentId()) {
123 if ($parent[
"type"] ==
"bdga") {
126 $filter_parent[$parent[
"id"]] =
127 "(" .
$lng->txt($parent[
"type"]) .
") " . $parent[
"title"];
132 "id" => $badge->getId(),
133 "title" => $badge->getTitle(),
134 "image" => $badge->getImagePath(),
135 "issued_on" => $ass->getTimestamp(),
136 "parent_title" => $parent ? $parent[
"title"] : null,
138 "active" => (bool) $ass->getPosition(),
145 if ($this->filter[
"title"]) {
147 if (!stristr(
$row[
"title"], $this->filter[
"title"])) {
153 if ($this->filter[
"obj"]) {
155 if ($this->filter[
"obj"] > 0) {
156 if (!
$row[
"parent"] ||
$row[
"parent"][
"id"] != $this->filter[
"obj"]) {
160 if (
$row[
"parent"]) {
175 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
176 $this->tpl->setVariable(
"PREVIEW", $a_set[
"renderer"]->
getHTML());
177 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
179 $this->tpl->setVariable(
"TXT_ACTIVE", $a_set[
"active"]
183 if ($a_set[
"parent"]) {
184 $this->tpl->setVariable(
"TXT_PARENT", $a_set[
"parent_title"]);
185 $this->tpl->setVariable(
191 include_once
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
193 $actions->setListTitle(
"");
200 $actions->addItem(
$lng->txt(!$a_set[
"active"]
201 ?
"badge_add_to_profile" 202 :
"badge_remove_from_profile"),
"",
$url);
206 $lng->txt(
"badge_add_to_backpack"),
214 "il.Badge.publish(" . $a_set[
"id"] .
");" 218 $this->tpl->setVariable(
"ACTIONS", $actions->getHTML());
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.
initFilters(array $a_parents)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
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.
__construct($a_parent_obj, $a_parent_cmd, $a_user_id=null)
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
TableGUI class for user badge listing.
Create styles array
The data for the language used.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
static getInstancesByUserId($a_user_id)
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
static getInstance()
Constructor.