20 public function __construct($a_parent_obj, $a_parent_cmd =
"", $a_parent_obj_id, $a_has_write =
false)
24 $this->ctrl =
$DIC->ctrl();
25 $this->lng =
$DIC->language();
26 $ilCtrl =
$DIC->ctrl();
29 $this->
setId(
"bdgbdg");
30 $this->has_write = (bool) $a_has_write;
39 if ($this->has_write) {
47 if ($this->has_write) {
50 $lng->loadLanguageModule(
"content");
78 $valid_types = $handler->getAvailableTypesForObjType($this->parent_type);
80 sizeof($valid_types) > 1) {
81 $lng->loadLanguageModule(
"search");
83 $options = array(
"" =>
$lng->txt(
"search_any"));
84 foreach ($valid_types as $id =>
$type) {
90 $type->setOptions($options);
101 "id" => $badge->getId(),
102 "title" => $badge->getTitle(),
103 "active" => $badge->isActive(),
104 "type" => ($this->parent_type !=
"bdga")
106 : $badge->getTypeInstance()->getCaption(),
107 "manual" => (!$badge->getTypeInstance() instanceof
ilBadgeAuto),
120 if ($this->has_write) {
121 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
124 $this->tpl->setVariable(
"PREVIEW", $a_set[
"renderer"]->
getHTML());
125 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
126 $this->tpl->setVariable(
"TXT_TYPE", $a_set[
"type"]);
127 $this->tpl->setVariable(
"TXT_ACTIVE", $a_set[
"active"]
131 if ($this->has_write) {
133 $actions->setListTitle(
$lng->txt(
"actions"));
135 if ($a_set[
"manual"] &&
142 $actions->addItem(
$lng->txt(
"badge_award_badge"),
"",
$url);
148 $actions->addItem(
$lng->txt(
"edit"),
"",
$url);
150 $this->tpl->setVariable(
"ACTIONS", $actions->getHTML());
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
static getInstance()
Constructor.
TableGUI class for badge listing.
__construct($a_parent_obj, $a_parent_cmd="", $a_parent_obj_id, $a_has_write=false)
fillRow($a_set)
Standard Version of Fill Row.
getItems($a_parent_obj_id)
static getInstancesByParentId($a_parent_id, array $a_filter=null)
static getExtendedTypeCaption(ilBadgeType $a_type)
static _lookupType($a_id, $a_reference=false)
lookup object type
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setData($a_data)
set table data @access public
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
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.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc