4require_once(
"Services/Table/classes/class.ilTableGUI.php");
 
  115    public function __construct($a_parent_obj, $a_parent_cmd = 
"", $a_template_context = 
"")
 
  119        $this->lng = 
$DIC->language();
 
  120        $this->ctrl = 
$DIC->ctrl();
 
  123        parent::__construct(0, 
false);
 
  124        $this->unique_id = md5(uniqid());
 
  125        $this->parent_obj = $a_parent_obj;
 
  126        $this->parent_cmd = $a_parent_cmd;
 
  127        $this->buttons = array();
 
  128        $this->header_commands = array();
 
  129        $this->multi = array();
 
  130        $this->hidden_inputs = array();
 
  132        $this->tpl = 
new ilTemplate(
"tpl.table2.html", 
true, 
true, 
"Services/Table");
 
  134        $lng->loadLanguageModule(
'tbl');
 
  136        if (!$a_template_context) {
 
  137            $a_template_context = $this->
getId();
 
  142        if (isset(
$_GET[$this->prefix . 
"_xpt"])) {
 
  143            $this->export_mode = (int) 
$_GET[$this->prefix . 
"_xpt"];
 
  147        if (isset(
$_GET[$this->prefix . 
"_tpl"])) {
 
  164        $this->open_form_tag = $a_val;
 
  184        $this->close_form_tag = $a_val;
 
  205        if (isset(
$DIC[
"ilUser"])) {
 
  209        if ($this->limit_determined) {
 
  214        if (isset(
$_GET[$this->prefix . 
"_trows"])) {
 
  234        $this->limit_determined = 
true;
 
  252        if ($this->columns_determined) {
 
  259        if ($old_sel != 
"") {
 
  261                @unserialize($old_sel);
 
  264        if (!is_array($sel_fields)) {
 
  266            $sel_fields = array();
 
  269        $this->selected_columns = array();
 
  272            $this->selected_column[$k] = 
false;
 
  274            $new_column = ($sel_fields[$k] === 
null);
 
  279                    $this->selected_column[$k] = 
true;
 
  281            } elseif ($stored && !$new_column) {        
 
  282                $this->selected_column[$k] = $sel_fields[$k];
 
  288                    $this->selected_column[$k] = 
true;
 
  293        if ($old_sel != serialize($this->selected_column) && $set) {
 
  294            $this->
storeProperty(
"selfields", serialize($this->selected_column));
 
  297        $this->columns_determined = 
true;
 
  308        return $this->selected_column[$a_col];
 
  320        foreach ($this->selected_column as $k => $v) {
 
  335        $next_class = 
$ilCtrl->getNextClass($this);
 
  338        switch ($next_class) {
 
  339            case 'ilformpropertydispatchgui':
 
  340                include_once 
'./Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
 
  344                $form_prop_dispatch->setItem($item);
 
  345                return $ilCtrl->forwardCommand($form_prop_dispatch);
 
  357        if (!$this->nav_determined && !$a_in_determination) {
 
  403        $this->top_anchor = $a_val;
 
  423        $this->noentriestext = $a_text;
 
  433        return $this->noentriestext;
 
  443        $this->datatable = $a_val;
 
  453        return $this->datatable;
 
  463        $this->enabled[
"title"] = $a_enabletitle;
 
  473        return $this->enabled[
"title"];
 
  483        $this->enabled[
"header"] = $a_enableheader;
 
  493        return $this->enabled[
"header"];
 
  503        $this->num_info = $a_val;
 
  513        return $this->num_info;
 
  519    final public function setTitle($a_title, $a_icon = 0, $a_icon_alt = 0)
 
  521        parent::setTitle($a_title, $a_icon, $a_icon_alt);
 
  531        $this->description = $a_val;
 
  551        $this->order_field = $a_order_field;
 
  556        return $this->order_field;
 
  562        if (
defined(
'DEVMODE') && DEVMODE &&
 
  563            $this->enabled[
"header"] && $this->enabled[
"sort"] &&
 
  564            $this->columns_determined && is_array($this->column) &&
 
  567            $check = array_keys(array_shift($check));
 
  568            foreach ($this->column as $col) {
 
  569                if ($col[
"sort_field"] && !in_array($col[
"sort_field"], $check)) {
 
  570                    $invalid[] = $col[
"sort_field"];
 
  585        $this->row_data = $a_data;
 
  586        if (!is_array($this->row_data)) {
 
  587            $this->row_data = [];
 
  593        return $this->row_data;
 
  598        if (is_array($this->row_data)) {
 
  599            if (count($this->row_data) > 0) {
 
  608        $this->prefix = $a_prefix;
 
  622        $a_input_item->setParent($this);
 
  624            $this->filters[] = $a_input_item;
 
  626            $this->optional_filters[] = $a_input_item;
 
  630        if ($this->restore_filter) {
 
  631            if (array_key_exists($a_input_item->getFieldId(), $this->restore_filter_values)) {
 
  632                $this->setFilterValue($a_input_item, $this->restore_filter_values[$a_input_item->getFieldId()]);
 
  634                $this->setFilterValue($a_input_item, 
null); 
 
  658        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  666                include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  671                include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
 
  676                include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
 
  678                $item->setMaxLength(64);
 
  684                $lng->loadLanguageModule(
"meta");
 
  685                include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  688                foreach (
$lng->getInstalledLanguages() as $lang_key) {
 
  695                include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
 
  696                include_once(
"./Services/Form/classes/class.ilNumberInputGUI.php");
 
  699                $item->addCombinationItem(
"from", $combi_item, 
$lng->txt(
"from"));
 
  701                $item->addCombinationItem(
"to", $combi_item, 
$lng->txt(
"to"));
 
  703                $item->setMaxLength(7);
 
  708                include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
 
  709                include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
 
  712                $item->addCombinationItem(
"from", $combi_item, 
$lng->txt(
"from"));
 
  714                $item->addCombinationItem(
"to", $combi_item, 
$lng->txt(
"to"));
 
  719                include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
 
  720                include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
 
  723                $combi_item->setShowTime(
true);
 
  724                $item->addCombinationItem(
"from", $combi_item, 
$lng->txt(
"from"));
 
  726                $combi_item->setShowTime(
true);
 
  727                $item->addCombinationItem(
"to", $combi_item, 
$lng->txt(
"to"));
 
  732                $lng->loadLanguageModule(
"form");
 
  733                include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
 
  734                include_once(
"./Services/Form/classes/class.ilDurationInputGUI.php");
 
  737                $combi_item->setShowMonths(
false);
 
  738                $combi_item->setShowDays(
true);
 
  739                $combi_item->setShowSeconds(
true);
 
  740                $item->addCombinationItem(
"from", $combi_item, 
$lng->txt(
"from"));
 
  742                $combi_item->setShowMonths(
false);
 
  743                $combi_item->setShowDays(
true);
 
  744                $combi_item->setShowSeconds(
true);
 
  745                $item->addCombinationItem(
"to", $combi_item, 
$lng->txt(
"to"));
 
  754        $item->readFromSession();
 
  772            if ($item->getPostVar() == $a_post_var) {
 
  777            if ($item->getPostVar() == $a_post_var) {
 
  791        $this->filter_cols = $a_val;
 
  811        $this->disable_filter_hiding = $a_val;
 
  832        return $this->selected_filter[$a_col];
 
  844        foreach ($this->selected_filter as $k => $v) {
 
  860        if ($this->filters_determined) {
 
  866        if ($old_sel != 
"") {
 
  868                @unserialize($old_sel);
 
  871        if (!is_array($sel_filters)) {
 
  873            $sel_filters = array();
 
  876        $this->selected_filter = array();
 
  879            $k = $item->getPostVar();
 
  881            $this->selected_filter[$k] = 
false;
 
  886                    $this->selected_filter[$k] = 
true;
 
  888                    $item->setValue(
null);
 
  889                    $item->writeToSession();
 
  892                $this->selected_filter[$k] = $sel_filters[$k];
 
  896        if ($old_sel != serialize($this->selected_filter) && $set) {
 
  897            $this->
storeProperty(
"selfilters", serialize($this->selected_filter));
 
  900        $this->filters_determined = 
true;
 
  908        $this->custom_prev_next = 
true;
 
  909        $this->custom_prev = $a_prev_link;
 
  910        $this->custom_next = $a_next_link;
 
  921        $this->form_action = $a_form_action;
 
  922        $this->form_multipart = (bool) $a_multipart;
 
  932        return $this->form_action;
 
  942        $this->formname = $a_formname;
 
  952        return $this->formname;
 
  985        $this->display_as_block = $a_val;
 
  995        return $this->display_as_block;
 
 1015        $this->select_all_checkbox = $a_select_all_checkbox;
 
 1025        $this->ext_sort = $a_val;
 
 1046        $this->filter_cmd = $a_val;
 
 1047        $this->filter_cmd_txt = $a_caption;
 
 1068        $this->reset_cmd = $a_val;
 
 1069        $this->reset_cmd_txt = $a_caption;
 
 1089        $this->ext_seg = $a_val;
 
 1110        $this->row_template = $a_template;
 
 1111        $this->row_template_dir = $a_template_dir;
 
 1121        $this->defaultorderfield = $a_defaultorderfield;
 
 1131        return $this->defaultorderfield;
 
 1141        $this->defaultorderdirection = $a_defaultorderdirection;
 
 1151        return $this->defaultorderdirection;
 
 1160        $this->default_filter_visibility = $a_status;
 
 1179        $this->buttons = array();
 
 1188    public function addCommandButton($a_cmd, $a_text, $a_onclick = 
'', $a_id = 
"", $a_class = 
null)
 
 1190        $this->buttons[] = array(
"cmd" => $a_cmd, 
"text" => $a_text, 
'onclick' => $a_onclick,
 
 1191            "id" => $a_id, 
"class" => $a_class);
 
 1201        $this->buttons[] = $a_button;
 
 1216        echo 
"ilTabl2GUI->addSelectionButton() has been deprecated with 4.2. Please try to move the drop-down to ilToolbarGUI.";
 
 1231        $this->mi_sel_buttons[] = array(
"sel_var" => $a_sel_var, 
"options" => $a_options, 
"selected" => $a_default_selection, 
"cmd" => $a_cmd, 
"text" => $a_text);
 
 1245        $this->close_command = $a_link;
 
 1256        $this->multi[] = array(
"cmd" => $a_cmd, 
"text" => $a_text);
 
 1267        $this->hidden_inputs[] = array(
"name" => $a_name, 
"value" => $a_value);
 
 1278        $this->header_commands[] = array(
"href" => $a_href, 
"text" => $a_text,
 
 1279            "target" => $a_target, 
"img" => $a_img);
 
 1289        $this->top_commands = $a_val;
 
 1313        $a_is_checkbox_action_column = 
false,
 
 1316        $a_tooltip_with_html = 
false 
 1318        $this->column[] = array(
 
 1320            "sort_field" => $a_sort_field,
 
 1321            "width" => $a_width,
 
 1322            "is_checkbox_action_column" => $a_is_checkbox_action_column,
 
 1323            "class" => $a_class,
 
 1324            "tooltip" => $a_tooltip,
 
 1325            "tooltip_html" => (
bool) $a_tooltip_with_html
 
 1327        if ($a_sort_field != 
"") {
 
 1328            $this->sortable_fields[] = $a_sort_field;
 
 1330        $this->column_count = count($this->column);
 
 1336        return $this->prefix . 
"_table_nav";
 
 1348        if (is_object(
$ilUser) && 
$ilUser->getPref(
"screen_reader_optimization")) {
 
 1358            $sort_field . 
":" . $order_dir . 
":" . $this->offset
 
 1360        $this->tpl->setVariable(
 
 1362            $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd) . $hash
 
 1377        $allcolumnswithwidth = 
true;
 
 1378        foreach ((array) $this->column as $idx => 
$column) {
 
 1379            if (!strlen(
$column[
"width"])) {
 
 1380                $allcolumnswithwidth = 
false;
 
 1381            } elseif (
$column[
"width"] == 
"1") {
 
 1383                $this->column[$idx][
"width"] = 
"1%";
 
 1386        if ($allcolumnswithwidth) {
 
 1387            foreach ((array) $this->column as 
$column) {
 
 1388                $this->tpl->setCurrentBlock(
"tbl_colgroup_column");
 
 1389                $this->tpl->setVariable(
"COLGROUP_COLUMN_WIDTH", 
$column[
"width"]);
 
 1390                $this->tpl->parseCurrentBlock();
 
 1394        foreach ((array) $this->column as 
$column) {
 
 1397            if (
$column[
"tooltip"] != 
"") {
 
 1398                include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
 
 1400                    "thc_" . $this->
getId() . 
"_" . $ccnt,
 
 1408            if (!$this->enabled[
"sort"] || 
$column[
"sort_field"] == 
"" || 
$column[
"is_checkbox_action_column"]) {
 
 1409                $this->tpl->setCurrentBlock(
"tbl_header_no_link");
 
 1411                    $this->tpl->setVariable(
"TBL_COLUMN_WIDTH_NO_LINK", 
" width=\"" . 
$column[
"width"] . 
"\"");
 
 1414                    $this->tpl->setVariable(
"TBL_COLUMN_CLASS_NO_LINK", 
" class=\"" . 
$column[
"class"] . 
"\"");
 
 1416                if (!
$column[
"is_checkbox_action_column"]) {
 
 1417                    $this->tpl->setVariable(
 
 1418                        "TBL_HEADER_CELL_NO_LINK",
 
 1422                    $this->tpl->setVariable(
 
 1423                        "TBL_HEADER_CELL_NO_LINK",
 
 1427                $this->tpl->setVariable(
"HEAD_CELL_NL_ID", 
"thc_" . $this->
getId() . 
"_" . $ccnt);
 
 1429                    $this->tpl->setVariable(
"TBL_HEADER_CLASS", 
" " . 
$column[
"class"]);
 
 1431                $this->tpl->parseCurrentBlock();
 
 1432                $this->tpl->touchBlock(
"tbl_header_th");
 
 1435            if ((
$column[
"sort_field"] == $this->order_field) && ($this->order_direction != 
"")) {
 
 1436                $this->tpl->setCurrentBlock(
"tbl_order_image");
 
 1437                if ($this->order_direction == 
"asc") {
 
 1438                    $this->tpl->setVariable(
"ORDER_CLASS", 
"glyphicon glyphicon-arrow-up");
 
 1440                    $this->tpl->setVariable(
"ORDER_CLASS", 
"glyphicon glyphicon-arrow-down");
 
 1442                $this->tpl->setVariable(
"IMG_ORDER_ALT", $this->lng->txt(
"change_sort_direction"));
 
 1443                $this->tpl->parseCurrentBlock();
 
 1446            $this->tpl->setCurrentBlock(
"tbl_header_cell");
 
 1447            $this->tpl->setVariable(
"TBL_HEADER_CELL", 
$column[
"text"]);
 
 1448            $this->tpl->setVariable(
"HEAD_CELL_ID", 
"thc_" . $this->
getId() . 
"_" . $ccnt);
 
 1452                $this->tpl->setVariable(
"TBL_COLUMN_WIDTH", 
" width=\"" . 
$column[
"width"] . 
"\"");
 
 1455                $this->tpl->setVariable(
"TBL_COLUMN_CLASS", 
" class=\"" . 
$column[
"class"] . 
"\"");
 
 1458            $lng_sort_column = $this->lng->txt(
"sort_by_this_column");
 
 1459            $this->tpl->setVariable(
"TBL_ORDER_ALT", $lng_sort_column);
 
 1463            if (
$column[
"sort_field"] == $this->order_field) {
 
 1464                $order_dir = $this->sort_order;
 
 1466                $lng_change_sort = $this->lng->txt(
"change_sort_direction");
 
 1467                $this->tpl->setVariable(
"TBL_ORDER_ALT", $lng_change_sort);
 
 1471                $this->tpl->setVariable(
"TBL_HEADER_CLASS", 
" " . 
$column[
"class"]);
 
 1473            $this->
setOrderLink($column[
"sort_field"], $order_dir);
 
 1474            $this->tpl->parseCurrentBlock();
 
 1475            $this->tpl->touchBlock(
"tbl_header_th");
 
 1478        $this->tpl->setCurrentBlock(
"tbl_header");
 
 1479        $this->tpl->parseCurrentBlock();
 
 1498        if (isset(
$DIC[
"ilUser"])) {
 
 1502        if ($this->nav_determined) {
 
 1518        if ($this->nav_value == 
"" && $this->
getId() != 
"" && 
$ilUser->getId() != ANONYMOUS_USER_ID) {
 
 1520            if (in_array($order, $this->sortable_fields)) {
 
 1531        $nav = explode(
":", $this->nav_value);
 
 1537        if (!$a_omit_offset) {
 
 1548        if (!$a_omit_offset) {
 
 1549            $this->nav_determined = 
true;
 
 1576        if (isset(
$DIC[
"ilUser"])) {
 
 1598                if (is_object(
$ilUser) && 
$ilUser->getPref(
"screen_reader_optimization")) {
 
 1602                if ((
bool) $this->form_multipart) {
 
 1603                    $this->tpl->touchBlock(
"form_multipart_bl");
 
 1607                    $this->tpl->touchBlock(
"pdfs");
 
 1610                $this->tpl->setCurrentBlock(
"tbl_form_header");
 
 1611                $this->tpl->setVariable(
"FORMACTION", $this->
getFormAction() . $hash);
 
 1612                $this->tpl->setVariable(
"FORMNAME", $this->
getFormName());
 
 1613                $this->tpl->parseCurrentBlock();
 
 1617                $this->tpl->touchBlock(
"tbl_form_footer");
 
 1621        if (!$this->enabled[
'content']) {
 
 1631        $this->
setFooter(
"tblfooter", $this->lng->txt(
"previous"), $this->lng->txt(
"next"));
 
 1657            $this->tpl->addBlockFile(
 
 1660                $this->row_template,
 
 1661                $this->row_template_dir
 
 1664            foreach (
$data as $set) {
 
 1665                $this->tpl->setCurrentBlock(
"tbl_content");
 
 1666                $this->css_row = ($this->css_row != 
"tblrow1")
 
 1669                $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
 
 1672                $this->tpl->setCurrentBlock(
"tbl_content");
 
 1673                $this->tpl->parseCurrentBlock();
 
 1679                : 
$lng->txt(
"no_items");
 
 1681            $this->css_row = ($this->css_row != 
"tblrow1")
 
 1685            $this->tpl->setCurrentBlock(
"tbl_no_entries");
 
 1686            $this->tpl->setVariable(
'TBL_NO_ENTRY_CSS_ROW', $this->css_row);
 
 1687            $this->tpl->setVariable(
'TBL_NO_ENTRY_COLUMN_COUNT', $this->column_count);
 
 1688            $this->tpl->setVariable(
'TBL_NO_ENTRY_TEXT', trim($no_items_text));
 
 1689            $this->tpl->parseCurrentBlock();
 
 1725        $this->tpl->setVariable(
"CSS_TABLE", $this->
getStyle(
"table"));
 
 1726        $this->tpl->setVariable(
"DATA_TABLE", (
int) $this->
getIsDataTable());
 
 1727        if ($this->
getId() != 
"") {
 
 1728            $this->tpl->setVariable(
"ID", 
'id="' . $this->
getId() . 
'"');
 
 1733            $this->tpl->setCurrentBlock(
"tbl_header_description");
 
 1734            $this->tpl->setVariable(
"TBL_DESCRIPTION", $this->
getDescription());
 
 1735            $this->tpl->parseCurrentBlock();
 
 1743            $this->tpl->touchBlock(
"outer_start_1");
 
 1744            $this->tpl->touchBlock(
"outer_end_1");
 
 1746            $this->tpl->touchBlock(
"outer_start_2");
 
 1747            $this->tpl->touchBlock(
"outer_end_2");
 
 1751        if ($this->enabled[
"title"] && ($this->title != 
"" 
 1752            || $this->icon != 
"" || count($this->header_commands) > 0 ||
 
 1753            $this->headerHTML != 
"" || $this->close_command != 
"")) {
 
 1754            if ($this->enabled[
"icon"]) {
 
 1755                $this->tpl->setCurrentBlock(
"tbl_header_title_icon");
 
 1757                $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT", $this->icon_alt);
 
 1758                $this->tpl->parseCurrentBlock();
 
 1762                foreach ($this->header_commands as $command) {
 
 1763                    if ($command[
"img"] != 
"") {
 
 1764                        $this->tpl->setCurrentBlock(
"tbl_header_img_link");
 
 1765                        if ($command[
"target"] != 
"") {
 
 1766                            $this->tpl->setVariable(
 
 1768                                'target="' . $command[
"target"] . 
'"' 
 1771                        $this->tpl->setVariable(
"ALT_IMG_LINK", $command[
"text"]);
 
 1772                        $this->tpl->setVariable(
"HREF_IMG_LINK", $command[
"href"]);
 
 1773                        $this->tpl->setVariable(
 
 1777                        $this->tpl->parseCurrentBlock();
 
 1779                        $this->tpl->setCurrentBlock(
"head_cmd");
 
 1780                        $this->tpl->setVariable(
"TXT_HEAD_CMD", $command[
"text"]);
 
 1781                        $this->tpl->setVariable(
"HREF_HEAD_CMD", $command[
"href"]);
 
 1782                        $this->tpl->parseCurrentBlock();
 
 1787            if (isset($this->headerHTML)) {
 
 1788                $this->tpl->setCurrentBlock(
"tbl_header_html");
 
 1789                $this->tpl->setVariable(
"HEADER_HTML", $this->headerHTML);
 
 1790                $this->tpl->parseCurrentBlock();
 
 1794            if ($this->close_command != 
"") {
 
 1795                $this->tpl->setCurrentBlock(
"tbl_header_img_link");
 
 1796                $this->tpl->setVariable(
"ALT_IMG_LINK", 
$lng->txt(
"close"));
 
 1797                $this->tpl->setVariable(
"HREF_IMG_LINK", $this->close_command);
 
 1798                $this->tpl->parseCurrentBlock();
 
 1801            $this->tpl->setCurrentBlock(
"tbl_header_title");
 
 1802            $this->tpl->setVariable(
"TBL_TITLE", $this->title);
 
 1803            $this->tpl->setVariable(
"TOP_ANCHOR", $this->
getTopAnchor());
 
 1805                $this->tpl->setVariable(
"BLK_CLASS", 
"Block");
 
 1807            $this->tpl->parseCurrentBlock();
 
 1811        if ($this->enabled[
"header"]) {
 
 1815        $this->tpl->touchBlock(
"tbl_table_end");
 
 1817        return $this->tpl->get();
 
 1828        $main_tpl = 
$DIC[
"tpl"];
 
 1833        $main_tpl->addJavascript(
"./Services/Table/js/ServiceTable.js");
 
 1835        if (count($filter) == 0 && count($opt_filter) == 0) {
 
 1839        include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
 
 1845        if (count($filter) > 0) {
 
 1846            foreach ($filter as $item) {
 
 1848                    $this->tpl->setCurrentBlock(
"filter_row");
 
 1849                    $this->tpl->parseCurrentBlock();
 
 1852                $this->tpl->setCurrentBlock(
"filter_item");
 
 1853                $this->tpl->setVariable(
 
 1857                $this->tpl->setVariable(
 
 1861                $this->tpl->setVariable(
 
 1863                    $item->getTableFilterHTML()
 
 1865                $this->tpl->parseCurrentBlock();
 
 1871        if (count($opt_filter) > 0) {
 
 1874            foreach ($opt_filter as $item) {
 
 1877                        $this->tpl->setCurrentBlock(
"filter_row");
 
 1878                        $this->tpl->parseCurrentBlock();
 
 1881                    $this->tpl->setCurrentBlock(
"filter_item");
 
 1882                    $this->tpl->setVariable(
 
 1886                    $this->tpl->setVariable(
 
 1890                    $this->tpl->setVariable(
 
 1892                        $item->getTableFilterHTML()
 
 1894                    $this->tpl->parseCurrentBlock();
 
 1901            foreach ($opt_filter as $item) {
 
 1902                $k = $item->getPostVar();
 
 1903                $items[$k] = array(
"txt" => $item->getTitle(),
 
 1904                    "selected" => $this->isFilterSelected($k));
 
 1907            include_once(
"./Services/UIComponent/CheckboxListOverlay/classes/class.ilCheckboxListOverlayGUI.php");
 
 1909            $cb_over->setLinkTitle(
$lng->txt(
"optional_filters"));
 
 1910            $cb_over->setItems($items);
 
 1913            $cb_over->setFieldVar(
"tblff" . $this->
getId());
 
 1914            $cb_over->setHiddenVar(
"tblfsf" . $this->
getId());
 
 1916            $cb_over->setSelectionHeaderClass(
"ilTableMenuItem");
 
 1917            $this->tpl->setCurrentBlock(
"filter_select");
 
 1920            $this->tpl->setVariable(
"HIDDEN_CMD_APPLY", $this->filter_cmd);
 
 1922            $this->tpl->setVariable(
"FILTER_SELECTOR", $cb_over->getHTML());
 
 1923            $this->tpl->parseCurrentBlock();
 
 1927        if ($ccnt > 0 || count($opt_filter) > 0) {
 
 1928            $this->tpl->setVariable(
"TXT_FILTER", 
$lng->txt(
"filter"));
 
 1933                        $this->tpl->touchBlock(
"filter_empty_cell");
 
 1936                $this->tpl->setCurrentBlock(
"filter_row");
 
 1937                $this->tpl->parseCurrentBlock();
 
 1939                $this->tpl->setCurrentBlock(
"filter_buttons");
 
 1940                $this->tpl->setVariable(
"CMD_APPLY", $this->filter_cmd);
 
 1941                $this->tpl->setVariable(
"TXT_APPLY", $this->filter_cmd_txt
 
 1942                    ? $this->filter_cmd_txt
 
 1943                    : 
$lng->txt(
"apply_filter"));
 
 1944                $this->tpl->setVariable(
"CMD_RESET", $this->reset_cmd);
 
 1945                $this->tpl->setVariable(
"TXT_RESET", $this->reset_cmd_txt
 
 1946                    ? $this->reset_cmd_txt
 
 1947                    : 
$lng->txt(
"reset_filter"));
 
 1948            } elseif (count($opt_filter) > 0) {
 
 1949                $this->tpl->setCurrentBlock(
"optional_filter_hint");
 
 1950                $this->tpl->setVariable(
'TXT_OPT_HINT', 
$lng->txt(
'optional_filter_hint'));
 
 1951                $this->tpl->parseCurrentBlock();
 
 1954            $this->tpl->setCurrentBlock(
"filter_section");
 
 1955            $this->tpl->setVariable(
"FIL_ID", $this->
getId());
 
 1956            $this->tpl->parseCurrentBlock();
 
 1961                    $this->tpl->setCurrentBlock(
"filter_hidden");
 
 1962                    $this->tpl->setVariable(
"FI_ID", $this->
getId());
 
 1963                    $this->tpl->parseCurrentBlock();
 
 1976        if ($prop === 
'0' || $prop === 
'1') {
 
 1977            return (
bool) $prop;
 
 1992            if ($item === $a_element) {
 
 2004        $advmd_record_gui = 
null;
 
 2005        if (method_exists($this, 
"getAdvMDRecordGUI")) {
 
 2006            $advmd_record_gui = $this->getAdvMDRecordGUI();
 
 2010            if ($advmd_record_gui &&
 
 2015            if ($item->checkInput()) {
 
 2016                $item->setValueByArray(
$_POST);
 
 2017                $item->writeToSession();
 
 2021            if ($advmd_record_gui &&
 
 2026            if ($item->checkInput()) {
 
 2027                $item->setValueByArray(
$_POST);
 
 2028                $item->writeToSession();
 
 2032        if ($advmd_record_gui) {
 
 2033            $advmd_record_gui->importFilter();
 
 2037        unset($_REQUEST[
"tbltplcrt"]);
 
 2038        unset($_REQUEST[
"tbltpldel"]);
 
 2051        foreach ($filter as $item) {
 
 2052            if ($item->checkInput()) {
 
 2053                $item->setValueByArray(
$_POST);
 
 2054                $item->clearFromSession();
 
 2057        foreach ($opt_filter as $item) {
 
 2058            if ($item->checkInput()) {
 
 2059                $item->setValueByArray(
$_POST);
 
 2060                $item->clearFromSession();
 
 2065        unset($_REQUEST[
"tbltplcrt"]);
 
 2066        unset($_REQUEST[
"tbltpldel"]);
 
 2077        foreach ($a_set as 
$key => $value) {
 
 2078            $this->tpl->setVariable(
"VAL_" . strtoupper(
$key), $value);
 
 2090        if (isset(
$DIC[
"ilUser"])) {
 
 2101            $this->tpl->setCurrentBlock(
"select_all_checkbox");
 
 2102            $this->tpl->setVariable(
"SELECT_ALL_TXT_SELECT_ALL", 
$lng->txt(
"select_all"));
 
 2104            $this->tpl->setVariable(
"SELECT_ALL_FORM_NAME", $this->
getFormName());
 
 2105            $this->tpl->setVariable(
"CHECKBOXNAME", 
"chb_select_all_" . $this->unique_id);
 
 2106            $this->tpl->parseCurrentBlock();
 
 2110        if ($this->enabled[
"numinfo"] && $this->enabled[
"footer"]) {
 
 2111            $start = $this->offset + 1;                         
 
 2117            if (
$end > $this->max_count or $this->limit == 0) {
 
 2121            if ($this->max_count > 0) {
 
 2122                if ($this->lang_support) {
 
 2123                    $numinfo = 
"(" . $start . 
" - " . 
$end . 
" " . strtolower($this->lng->txt(
"of")) . 
" " . $this->max_count . 
")";
 
 2125                    $numinfo = 
"(" . $start . 
" - " . 
$end . 
" of " . $this->max_count . 
")";
 
 2128            if ($this->max_count > 0) {
 
 2130                    $this->tpl->setCurrentBlock(
"tbl_footer_numinfo");
 
 2131                    $this->tpl->setVariable(
"NUMINFO", $numinfo);
 
 2132                    $this->tpl->parseCurrentBlock();
 
 2139        if ($this->enabled[
"linkbar"] && $this->enabled[
"footer"] && $this->limit  != 0
 
 2140             && $this->max_count > 0) {
 
 2142                            "link"      => $this->footer_style,
 
 2143                            "prev"      => $this->footer_previous,
 
 2144                            "next"      => $this->footer_next,
 
 2149            $this->tpl->setCurrentBlock(
"tbl_footer_linkbar");
 
 2150            $this->tpl->setVariable(
"LINKBAR", $linkbar);
 
 2151            $this->tpl->parseCurrentBlock();
 
 2161                $items[$k] = array(
"txt" => $c[
"txt"],
 
 2164            include_once(
"./Services/UIComponent/CheckboxListOverlay/classes/class.ilCheckboxListOverlayGUI.php");
 
 2166            $cb_over->setLinkTitle(
$lng->txt(
"columns"));
 
 2167            $cb_over->setItems($items);
 
 2171            $cb_over->setFieldVar(
"tblfs" . $this->
getId());
 
 2172            $cb_over->setHiddenVar(
"tblfsh" . $this->
getId());
 
 2173            $cb_over->setSelectionHeaderClass(
"ilTableMenuItem");
 
 2174            $column_selector = $cb_over->getHTML();
 
 2180            if (isset($_REQUEST[
"tbltplcrt"]) && $_REQUEST[
"tbltplcrt"]) {
 
 2184            } elseif (isset($_REQUEST[
"tbltpldel"]) && $_REQUEST[
"tbltpldel"]) {
 
 2190            $create_id = 
"template_create_overlay_" . $this->
getId();
 
 2191            $delete_id = 
"template_delete_overlay_" . $this->
getId();
 
 2192            $list_id = 
"template_stg_" . $this->
getId();
 
 2194            include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
 
 2198            include_once(
"./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
 
 2201            if (
sizeof($templates)) {
 
 2203                $overlay->setTrigger($list_id . 
"_delete");
 
 2204                $overlay->setAnchor(
"ilAdvSelListAnchorElement_" . $list_id);
 
 2205                $overlay->setAutoHide(
false);
 
 2208                $lng->loadLanguageModule(
"form");
 
 2209                $this->tpl->setCurrentBlock(
"template_editor_delete_item");
 
 2210                $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION_VALUE", 
"");
 
 2211                $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION", 
"- " . 
$lng->txt(
"form_please_select") . 
" -");
 
 2212                $this->tpl->parseCurrentBlock();
 
 2213                foreach ($templates as 
$name) {
 
 2214                    $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION_VALUE", 
$name);
 
 2215                    $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION", 
$name);
 
 2216                    $this->tpl->parseCurrentBlock();
 
 2219                $this->tpl->setCurrentBlock(
"template_editor_delete");
 
 2220                $this->tpl->setVariable(
"TEMPLATE_DELETE_ID", $delete_id);
 
 2221                $this->tpl->setVariable(
"TXT_TEMPLATE_DELETE", 
$lng->txt(
"tbl_template_delete"));
 
 2222                $this->tpl->setVariable(
"TXT_TEMPLATE_DELETE_SUBMIT", 
$lng->txt(
"delete"));
 
 2223                $this->tpl->setVariable(
"TEMPLATE_DELETE_CMD", $this->parent_cmd);
 
 2224                $this->tpl->parseCurrentBlock();
 
 2230            $overlay->setTrigger($list_id . 
"_create");
 
 2231            $overlay->setAnchor(
"ilAdvSelListAnchorElement_" . $list_id);
 
 2232            $overlay->setAutoHide(
false);
 
 2235            $this->tpl->setCurrentBlock(
"template_editor");
 
 2236            $this->tpl->setVariable(
"TEMPLATE_CREATE_ID", $create_id);
 
 2237            $this->tpl->setVariable(
"TXT_TEMPLATE_CREATE", 
$lng->txt(
"tbl_template_create"));
 
 2238            $this->tpl->setVariable(
"TXT_TEMPLATE_CREATE_SUBMIT", 
$lng->txt(
"save"));
 
 2239            $this->tpl->setVariable(
"TEMPLATE_CREATE_CMD", $this->parent_cmd);
 
 2240            $this->tpl->parseCurrentBlock();
 
 2243            include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
 
 2245            $alist->setId($list_id);
 
 2246            $alist->addItem(
$lng->txt(
"tbl_template_create"), 
"create", 
"#");
 
 2247            if (
sizeof($templates)) {
 
 2248                $alist->addItem(
$lng->txt(
"tbl_template_delete"), 
"delete", 
"#");
 
 2249                foreach ($templates as 
$name) {
 
 2250                    $ilCtrl->setParameter($this->parent_obj, $this->prefix . 
"_tpl", urlencode(
$name));
 
 2251                    $alist->addItem(
$name, 
$name, 
$ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
 
 2252                    $ilCtrl->setParameter($this->parent_obj, $this->prefix . 
"_tpl", 
"");
 
 2255            $alist->setListTitle(
$lng->txt(
"tbl_templates"));
 
 2257            $this->tpl->setVariable(
"TEMPLATE_SELECTOR", 
" " . $alist->getHTML());
 
 2261            $this->tpl->setCurrentBlock(
"tbl_footer");
 
 2262            $this->tpl->setVariable(
"COLUMN_COUNT", $this->
getColumnCount());
 
 2264                $this->tpl->setVariable(
"BLK_CLASS", 
"Block");
 
 2266            $this->tpl->parseCurrentBlock();
 
 2269            if ($numinfo != 
"" || $linkbar != 
"" || $column_selector != 
"" ||
 
 2270                count($this->filters) > 0 || count($this->optional_filters) > 0) {
 
 2271                if (is_object(
$ilUser) && (count($this->filters) || count($this->optional_filters))) {
 
 2272                    $this->tpl->setCurrentBlock(
"filter_activation");
 
 2273                    $this->tpl->setVariable(
"TXT_ACTIVATE_FILTER", 
$lng->txt(
"show_filter"));
 
 2274                    $this->tpl->setVariable(
"FILA_ID", $this->
getId());
 
 2275                    if ($this->
getId() != 
"") {
 
 2276                        $this->tpl->setVariable(
"SAVE_URLA", 
"./ilias.php?baseClass=ilTablePropertiesStorage&table_id=" .
 
 2277                            $this->
getId() . 
"&cmd=showFilter&user_id=" . 
$ilUser->getId());
 
 2279                    $this->tpl->parseCurrentBlock();
 
 2283                        $this->tpl->setCurrentBlock(
"filter_deactivation");
 
 2284                        $this->tpl->setVariable(
"TXT_HIDE", 
$lng->txt(
"hide_filter"));
 
 2285                        if ($this->
getId() != 
"") {
 
 2286                            $this->tpl->setVariable(
"SAVE_URL", 
"./ilias.php?baseClass=ilTablePropertiesStorage&table_id=" .
 
 2287                                $this->
getId() . 
"&cmd=hideFilter&user_id=" . 
$ilUser->getId());
 
 2288                            $this->tpl->setVariable(
"FILD_ID", $this->
getId());
 
 2290                        $this->tpl->parseCurrentBlock();
 
 2295                    $this->tpl->setCurrentBlock(
"top_numinfo");
 
 2296                    $this->tpl->setVariable(
"NUMINFO", $numinfo);
 
 2297                    $this->tpl->parseCurrentBlock();
 
 2301                    $this->tpl->setCurrentBlock(
"top_linkbar");
 
 2302                    $this->tpl->setVariable(
"LINKBAR", $linkbar);
 
 2303                    $this->tpl->parseCurrentBlock();
 
 2307                $this->tpl->setVariable(
"COLUMN_SELECTOR", $column_selector);
 
 2313                    !$this->rows_selector_off) { 
 
 2314                    include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
 
 2317                    $alist->setId(
"sellst_rows_" . $this->
getId());
 
 2318                    $hpp = (
$ilUser->getPref(
"hits_per_page") != 9999)
 
 2319                        ? 
$ilUser->getPref(
"hits_per_page")
 
 2320                        : 
$lng->txt(
"no_limit");
 
 2322                    $options = array(0 => 
$lng->txt(
"default") . 
" (" . $hpp . 
")",5 => 5, 10 => 10, 15 => 15, 20 => 20,
 
 2323                                     30 => 30, 40 => 40, 50 => 50,
 
 2324                                     100 => 100, 200 => 200, 400 => 400, 800 => 800);
 
 2326                        $ilCtrl->setParameter($this->parent_obj, $this->prefix . 
"_trows", $k);
 
 2327                        $alist->addItem($v, $k, 
$ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
 
 2328                        $ilCtrl->setParameter($this->parent_obj, $this->prefix . 
"_trows", 
"");
 
 2331                    $this->tpl->setVariable(
"ROW_SELECTOR", $alist->getHTML());
 
 2335                if (
sizeof($this->export_formats) && $this->
dataExists()) {
 
 2336                    include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
 
 2339                    $alist->setId(
"sellst_xpt");
 
 2340                    foreach ($this->export_formats as 
$format => $caption_lng_id) {
 
 2341                        $ilCtrl->setParameter($this->parent_obj, $this->prefix . 
"_xpt", 
$format);
 
 2342                        $url = 
$ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd);
 
 2343                        $ilCtrl->setParameter($this->parent_obj, $this->prefix . 
"_xpt", 
"");
 
 2346                    $alist->setListTitle(
$lng->txt(
"export"));
 
 2347                    $this->tpl->setVariable(
"EXPORT_SELECTOR", 
" " . $alist->getHTML());
 
 2350                $this->tpl->setCurrentBlock(
"top_navigation");
 
 2351                $this->tpl->setVariable(
"COLUMN_COUNT", $this->
getColumnCount());
 
 2353                    $this->tpl->setVariable(
"BLK_CLASS", 
"Block");
 
 2355                $this->tpl->parseCurrentBlock();
 
 2377        if (is_object(
$ilUser) && 
$ilUser->getPref(
"screen_reader_optimization")) {
 
 2381        $link = 
$ilCtrl->getLinkTargetByClass(get_class($this->parent_obj), $this->parent_cmd) .
 
 2386        $layout_prev = 
$lng->txt(
"previous");
 
 2387        $layout_next = 
$lng->txt(
"next");
 
 2390        if ($this->max_count > $this->
getLimit() || $this->custom_prev_next) {
 
 2391            $sep = 
"<span>  |  </span>";
 
 2394            $pages = intval($this->max_count / $this->
getLimit());
 
 2397            if (($this->max_count % $this->
getLimit())) {
 
 2402            $offset_arr = array();
 
 2403            for (
$i = 1 ;
$i <= $pages ; 
$i++) {
 
 2407                $offset_arr[$nav_value] = 
$i;
 
 2410            $sep = 
"<span>    </span>";
 
 2413            if ($this->custom_prev_next && $this->custom_prev != 
"") {
 
 2414                if ($LinkBar != 
"") {
 
 2417                $LinkBar .= 
"<a href=\"" . $this->custom_prev . $hash . 
"\">" . $layout_prev . 
"</a>";
 
 2418            } elseif ($this->
getOffset() >= 1 && !$this->custom_prev_next) {
 
 2419                if ($LinkBar != 
"") {
 
 2423                $LinkBar .= 
"<a href=\"" . $link . $prevoffset . $hash . 
"\">" . $layout_prev . 
"</a>";
 
 2425                if ($LinkBar != 
"") {
 
 2428                $LinkBar .= 
'<span class="ilTableFootLight">' . $layout_prev . 
"</span>";
 
 2432            if ($a_num == 
"1") {
 
 2433                $LinkBar .= 
'<input type="hidden" name="' . $this->
getNavParameter() .
 
 2437            $sep = 
"<span>  |  </span>";
 
 2440            if ($this->custom_prev_next && $this->custom_next != 
"") {
 
 2441                if ($LinkBar != 
"") {
 
 2444                $LinkBar .= 
"<a href=\"" . $this->custom_next . $hash . 
"\">" . $layout_next . 
"</a>";
 
 2445            } elseif (!(($this->
getOffset() / $this->
getLimit())==($pages-1)) && ($pages!=1) &&
 
 2446                !$this->custom_prev_next) {
 
 2447                if ($LinkBar != 
"") {
 
 2451                $LinkBar .= 
"<a href=\"" . $link . $newoffset . $hash . 
"\">" . $layout_next . 
"</a>";
 
 2453                if ($LinkBar != 
"") {
 
 2456                $LinkBar .= 
'<span class="ilTableFootLight">' . $layout_next . 
"</span>";
 
 2459            $sep = 
"<span>    </span>";
 
 2461            if (count($offset_arr) && !$this->
getDisplayAsBlock() && !$this->custom_prev_next) {
 
 2462                if ($LinkBar != 
"") {
 
 2466                    '<label for="tab_page_sel_' . $a_num . 
'">' . 
$lng->txt(
"page") . 
'</label> ' .
 
 2475                        array(
"id" => 
"tab_page_sel_" . $a_num,
 
 2476                        "onchange" => 
"ilTablePageSelection(this, 'cmd[" . $this->parent_cmd . 
"]')")
 
 2490        $hidden_row = 
false;
 
 2491        if (count($this->hidden_inputs)) {
 
 2492            foreach ($this->hidden_inputs as $hidden_input) {
 
 2493                $this->tpl->setCurrentBlock(
"tbl_hidden_field");
 
 2494                $this->tpl->setVariable(
"FIELD_NAME", $hidden_input[
"name"]);
 
 2495                $this->tpl->setVariable(
"FIELD_VALUE", $hidden_input[
"value"]);
 
 2496                $this->tpl->parseCurrentBlock();
 
 2499            $this->tpl->setCurrentBlock(
"tbl_hidden_row");
 
 2500            $this->tpl->parseCurrentBlock();
 
 2512        $action_row = 
false;
 
 2516        if (count($this->sel_buttons) > 0) {
 
 2517            foreach ($this->sel_buttons as $button) {
 
 2518                $this->tpl->setCurrentBlock(
"sel_button");
 
 2519                $this->tpl->setVariable(
 
 2522                        $button[
"selected"],
 
 2529                $this->tpl->setVariable(
"SBTN_NAME", $button[
"cmd"]);
 
 2530                $this->tpl->setVariable(
"SBTN_VALUE", $button[
"text"]);
 
 2531                $this->tpl->parseCurrentBlock();
 
 2534                    $this->tpl->setCurrentBlock(
"sel_top_button");
 
 2535                    $this->tpl->setVariable(
 
 2538                            $button[
"selected"],
 
 2545                    $this->tpl->setVariable(
"SBTN_NAME", $button[
"cmd"]);
 
 2546                    $this->tpl->setVariable(
"SBTN_VALUE", $button[
"text"]);
 
 2547                    $this->tpl->parseCurrentBlock();
 
 2553        $this->sel_buttons[] = array(
"options" => $a_options, 
"cmd" => $a_cmd, 
"text" => $a_text);
 
 2556        if (count($this->buttons) > 0) {
 
 2557            foreach ($this->buttons as $button) {
 
 2558                if (!is_array($button)) {
 
 2560                        $this->tpl->setVariable(
'BUTTON_OBJ', $button->render());
 
 2563                        $button = clone $button;
 
 2565                        $this->tpl->setVariable(
'BUTTON_TOP_OBJ', $button->render());
 
 2570                if (strlen($button[
'onclick'])) {
 
 2571                    $this->tpl->setCurrentBlock(
'cmdonclick');
 
 2572                    $this->tpl->setVariable(
'CMD_ONCLICK', $button[
'onclick']);
 
 2573                    $this->tpl->parseCurrentBlock();
 
 2575                $this->tpl->setCurrentBlock(
"plain_button");
 
 2576                if ($button[
"id"] != 
"") {
 
 2577                    $this->tpl->setVariable(
"PBID", 
' id="' . $button[
"id"] . 
'" ');
 
 2579                if ($button[
"class"] != 
"") {
 
 2580                    $this->tpl->setVariable(
"PBBT_CLASS", 
' ' . $button[
"class"]);
 
 2582                $this->tpl->setVariable(
"PBTN_NAME", $button[
"cmd"]);
 
 2583                $this->tpl->setVariable(
"PBTN_VALUE", $button[
"text"]);
 
 2584                $this->tpl->parseCurrentBlock();
 
 2587                    if (strlen($button[
'onclick'])) {
 
 2588                        $this->tpl->setCurrentBlock(
'top_cmdonclick');
 
 2589                        $this->tpl->setVariable(
'CMD_ONCLICK', $button[
'onclick']);
 
 2590                        $this->tpl->parseCurrentBlock();
 
 2592                    $this->tpl->setCurrentBlock(
"plain_top_button");
 
 2593                    $this->tpl->setVariable(
"PBTN_NAME", $button[
"cmd"]);
 
 2594                    $this->tpl->setVariable(
"PBTN_VALUE", $button[
"text"]);
 
 2595                    if ($button[
"class"] != 
"") {
 
 2596                        $this->tpl->setVariable(
"PBBT_CLASS", 
' ' . $button[
"class"]);
 
 2598                    $this->tpl->parseCurrentBlock();
 
 2607        if (count($this->mi_sel_buttons)) {
 
 2608            foreach ($this->mi_sel_buttons as $button) {
 
 2609                $this->tpl->setCurrentBlock(
"mi_sel_button");
 
 2610                $this->tpl->setVariable(
 
 2613                        $button[
"selected"],
 
 2620                $this->tpl->setVariable(
"MI_BTN_NAME", $button[
"cmd"]);
 
 2621                $this->tpl->setVariable(
"MI_BTN_VALUE", $button[
"text"]);
 
 2622                $this->tpl->parseCurrentBlock();
 
 2625                    $this->tpl->setCurrentBlock(
"mi_top_sel_button");
 
 2626                    $this->tpl->setVariable(
 
 2629                            $button[
"selected"],
 
 2630                            $button[
"sel_var"] . 
"_2",
 
 2636                    $this->tpl->setVariable(
"MI_BTN_NAME", $button[
"cmd"]);
 
 2637                    $this->tpl->setVariable(
"MI_BTN_VALUE", $button[
"text"]);
 
 2638                    $this->tpl->parseCurrentBlock();
 
 2646        if (count($this->multi) > 1 && $this->
dataExists()) {
 
 2647            if ($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit()) {
 
 2648                $this->tpl->setCurrentBlock(
"tbl_cmd_select_all");
 
 2649                $this->tpl->setVariable(
"TXT_SELECT_CMD_ALL", 
$lng->txt(
"all_objects"));
 
 2650                $this->tpl->parseCurrentBlock();
 
 2653            $this->tpl->setCurrentBlock(
"tbl_cmd_select");
 
 2655            foreach ($this->multi as $mc) {
 
 2656                $sel[$mc[
"cmd"]] = $mc[
"text"];
 
 2658            $this->tpl->setVariable(
 
 2662            $this->tpl->setVariable(
"TXT_EXECUTE", 
$lng->txt(
"execute"));
 
 2663            $this->tpl->parseCurrentBlock();
 
 2668                if ($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit()) {
 
 2669                    $this->tpl->setCurrentBlock(
"tbl_top_cmd_select_all");
 
 2670                    $this->tpl->setVariable(
"TXT_SELECT_CMD_ALL", 
$lng->txt(
"all_objects"));
 
 2671                    $this->tpl->parseCurrentBlock();
 
 2674                $this->tpl->setCurrentBlock(
"tbl_top_cmd_select");
 
 2676                foreach ($this->multi as $mc) {
 
 2677                    $sel[$mc[
"cmd"]] = $mc[
"text"];
 
 2679                $this->tpl->setVariable(
 
 2683                $this->tpl->setVariable(
"TXT_EXECUTE", 
$lng->txt(
"execute"));
 
 2684                $this->tpl->parseCurrentBlock();
 
 2686        } elseif (count($this->multi) == 1  && $this->
dataExists()) {
 
 2687            $this->tpl->setCurrentBlock(
"tbl_single_cmd");
 
 2689            foreach ($this->multi as $mc) {
 
 2693            $this->tpl->setVariable(
"TXT_SINGLE_CMD", 
$txt);
 
 2694            $this->tpl->setVariable(
"SINGLE_CMD", $cmd);
 
 2695            $this->tpl->parseCurrentBlock();
 
 2700                $this->tpl->setCurrentBlock(
"tbl_top_single_cmd");
 
 2702                foreach ($this->multi as $mc) {
 
 2706                $this->tpl->setVariable(
"TXT_SINGLE_CMD", 
$txt);
 
 2707                $this->tpl->setVariable(
"SINGLE_CMD", $cmd);
 
 2708                $this->tpl->parseCurrentBlock();
 
 2713            $this->tpl->setCurrentBlock(
"tbl_action_img_arrow");
 
 2715            $this->tpl->setVariable(
"ALT_ARROW", 
$lng->txt(
"action"));
 
 2716            $this->tpl->parseCurrentBlock();
 
 2719                $this->tpl->setCurrentBlock(
"tbl_top_action_img_arrow");
 
 2721                $this->tpl->setVariable(
"ALT_ARROW", 
$lng->txt(
"action"));
 
 2722                $this->tpl->parseCurrentBlock();
 
 2727            $this->tpl->setCurrentBlock(
"tbl_action_row");
 
 2728            $this->tpl->parseCurrentBlock();
 
 2730                $this->tpl->setCurrentBlock(
"tbl_top_action_row");
 
 2731                $this->tpl->parseCurrentBlock();
 
 2743        $this->headerHTML = 
$html;
 
 2757        if (isset(
$DIC[
"ilUser"])) {
 
 2762            include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
 
 2780        if (isset(
$DIC[
"ilUser"])) {
 
 2785            include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
 
 2819        if ($this->filters) {
 
 2820            foreach ($this->filters as $item) {
 
 2824        if ($this->optional_filters && 
$result[
"selfilters"]) {
 
 2825            foreach ($this->optional_filters as $item) {
 
 2826                if (in_array($item->getFieldId(), 
$result[
"selfilters"])) {
 
 2843        if (method_exists($a_item, 
"getChecked")) {
 
 2844            return $a_item->getChecked();
 
 2845        } elseif (method_exists($a_item, 
"getValue")) {
 
 2846            return $a_item->getValue();
 
 2847        } elseif (method_exists($a_item, 
"getDate")) {
 
 2860        if (method_exists($a_item, 
"setChecked")) {
 
 2861            $a_item->setChecked($a_value);
 
 2862        } elseif (method_exists($a_item, 
"setValue")) {
 
 2863            $a_item->setValue($a_value);
 
 2864        } elseif (method_exists($a_item, 
"setDate")) {
 
 2878            $this->context = 
$id;
 
 2899        $this->show_rows_selector = (bool) $a_value;
 
 2919        $this->show_templates = (bool) $a_value;
 
 2947            include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
 
 2951            if (is_array(
$data)) {
 
 2952                foreach (
$data as $property => $value) {
 
 2957            $data[
"filter_values"] = unserialize(
$data[
"filter_values"]);
 
 2958            if (
$data[
"filter_values"]) {
 
 2959                $this->restore_filter_values = 
$data[
"filter_values"];
 
 2962            $this->restore_filter = 
true;
 
 2984            include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
 
 2988            $state[
"filter_values"] = serialize(
$state[
"filter_values"]);
 
 2990            $state[
"selfilters"] = serialize(
$state[
"selfilters"]);
 
 3013            include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
 
 3029        return parent::getLimit();
 
 3040        return parent::getOffset();
 
 3050        $this->export_formats = array();
 
 3053        $valid = array(self::EXPORT_EXCEL => 
"tbl_export_excel",
 
 3054            self::EXPORT_CSV => 
"tbl_export_csv");
 
 3069        $this->print_mode = (bool) $a_value;
 
 3115                    include_once 
"./Services/Excel/classes/class.ilExcel.php";
 
 3117                    $excel->addSheet($this->title
 
 3119                        : $this->lng->txt(
"export"));
 
 3132                    foreach ($this->row_data as $set) {
 
 3146                    include_once 
"./Services/Utilities/classes/class.ilCSVWriter.php";
 
 3148                    $csv->setSeparator(
";");
 
 3153                    foreach ($this->row_data as $set) {
 
 3160                        header(
"Content-type: text/comma-separated-values");
 
 3161                        header(
"Content-Disposition: attachment; filename=\"" . 
$filename . 
"\"");
 
 3162                        header(
"Expires: 0");
 
 3163                        header(
"Cache-Control: must-revalidate, post-check=0,pre-check=0");
 
 3164                        header(
"Pragma: public");
 
 3165                        echo $csv->getCSVString();
 
 3167                        file_put_contents(
$filename, $csv->getCSVString());
 
 3199        foreach ($this->column as 
$column) {
 
 3219        foreach ($a_set as $value) {
 
 3220            if (is_array($value)) {
 
 3221                $value = implode(
', ', $value);
 
 3223            $a_excel->
setCell($a_row, $col++, $value);
 
 3245        foreach ($this->column as 
$column) {
 
 3248                $a_csv->addColumn(
$title);
 
 3263        foreach ($a_set as 
$key => $value) {
 
 3264            if (is_array($value)) {
 
 3265                $value = implode(
', ', $value);
 
 3267            $a_csv->addColumn(strip_tags($value));
 
 3279        $this->enable_command_for_all = (bool) $a_value;
 
 3291        $ilClientIniFile = 
$DIC[
"ilClientIniFile"];
 
 3293        $limit = $ilClientIniFile->readVariable(
"system", 
"TABLE_ACTION_ALL_LIMIT");
 
 3325        $this->prevent_double_submission = $a_val;
 
 3338    public function setLimit($a_limit = 0, $a_default_limit = 0)
 
 3340        parent::setLimit($a_limit, $a_default_limit);
 
 3343        if ($a_limit == 9999 &&
 
 3344            $this->limit_determined) {
 
 3345            $this->rows_selector_off = 
true;
 
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
An exception for terminatinating execution or to throw for unit testing.
getFilterElements($a_only_non_empty=true)
Get SQL conditions for current filter value(s)
User interface class for advanced drop-down selection lists.
Helper class to generate CSV files.
User interface class for a checkbox list overlay.
static setUseRelativeDates($a_status)
set use relative dates
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
setBold($a_coords)
Set cell(s) to bold.
getColumnCoord($a_col)
Get column "name" from number.
This is a utility class for the yui overlays.
getParentCmd()
Get parent command.
getExportMode()
Was export activated?
addHiddenInput($a_name, $a_value)
Add Hidden Input field.
getDescription()
Get description.
getSelectedColumns()
Get selected columns.
getOpenFormTag()
Get open form tag.
fillHeaderCSV($a_csv)
CSV Version of Fill Header.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
getFormName()
Get Form name.
prepareOutput()
Anything that must be done before HTML is generated.
getEnableHeader()
Get Enable Header.
saveTemplate($a_name)
Save current state as template.
fillHeaderExcel(ilExcel $a_excel, &$a_row)
Excel Version of Fill Header.
restoreTemplate($a_name)
Restore state from template.
addSelectionButton($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
Add Selection List + Command button.
getDefaultFilterVisibility()
Get default filter visibility.
setEnableHeader($a_enableheader)
Set Enable Header.
determineSelectedColumns()
Determine selected columns.
fillMetaCSV($a_csv)
Add meta information to csv export.
getFilterValue(ilFormPropertyGUI $a_item)
Get current filter value.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
getLinkbar($a_num)
Get previous/next linkbar.
setExternalSorting($a_val)
Set external sorting.
isAdvMDFilter(ilAdvancedMDRecordGUI $a_gui, $a_element)
Check if filter element is based on adv md.
getShowTemplates()
Get template state.
setDisplayAsBlock($a_val)
Set display as block.
getNoEntriesText()
Get text for an empty table.
setCloseFormTag($a_val)
Set close form tag.
getEnableTitle()
Get Enable Title.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setExportFormats(array $formats)
Set available export formats.
getParentObject()
Get parent object.
setPrintMode($a_value=false)
Toogle print mode.
setDefaultFilterVisiblity($a_status)
Set default filter visiblity.
setPrefix($a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
fillRow($a_set)
Standard Version of Fill Row.
setNoEntriesText($a_text)
Set text for an empty table.
getFormAction()
Get Form action parameter.
SetFilterValue(ilFormPropertyGUI $a_item, $a_value)
Set current filter value.
exportData($format, $send=false)
Export and optionally send current table data.
getFilterItems($a_optionals=false)
Get filter items.
setIsDataTable($a_val)
Set is data table.
render()
render table @access public
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
getFilterCols()
Get filter columns.
getShowRowsSelector()
Get rows-per-page selector state.
fillRowCSV($a_csv, $a_set)
CSV Version of Fill Row.
setRowSelectorLabel($row_selector_label)
fillRowExcel(ilExcel $a_excel, &$a_row, $a_set)
Excel Version of Fill Row.
setEnableAllCommand($a_value)
Enable actions for all entries in current result.
setData($a_data)
set table data @access public
setHeaderHTML($html)
set header html
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
ilTable2GUI constructor.
getExternalSorting()
Get external sorting.
setEnableTitle($a_enabletitle)
Set Enable Title.
setEnableNumInfo($a_val)
Set enable num info.
$prevent_double_submission
getDefaultOrderDirection()
Get Default order direction.
getDisableFilterHiding()
Get disable filter hiding.
renderFilter()
Render Filter section.
getDisplayAsBlock()
Get display as block.
isFilterVisible()
Check if filter is visible: manually shown (session, db) or default value set.
setPreventDoubleSubmission($a_val)
Set prevent double submission.
addCommandButtonInstance(ilButtonBase $a_button)
Add Command button instance.
storeProperty($type, $value)
Store table property.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setTopAnchor($a_val)
Set top anchor.
resetOffset($a_in_determination=false)
Reset offset.
loadProperty($type)
Load table property.
setLimit($a_limit=0, $a_default_limit=0)
set max.
getFilterItemByPostVar($a_post_var)
addMultiCommand($a_cmd, $a_text)
Add Command button.
getCurrentState()
get current settings for order, limit, columns and filter
getSelectableColumns()
Get selectable columns.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
getEnableNumInfo()
Get enable num info.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
fillFooter()
Fill footer row.
static getAllCommandLimit()
Get maximum number of entries to enable actions for all.
getExternalSegmentation()
Get external segmentation.
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.
setCustomPreviousNext($a_prev_link, $a_next_link)
Set custom previous/next links.
setContext($id)
Set context.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
getPrintMode()
Get print mode.
getSelectedFilters()
Get selected filters.
getCloseFormTag()
Get close form tag.
getTopAnchor()
Get top anchor.
getFilterCommand()
Get filter command.
const FILTER_DURATION_RANGE
setExternalSegmentation($a_val)
Set external segmentation.
resetFilter()
Reset filter.
getTopCommands()
Get top commands (display command buttons on top of table, too)
$default_filter_visibility
writeFilterToSession()
Write filter values to session.
setDescription($a_val)
Set description.
setOrderField($a_order_field)
set order column
setFormName($a_formname="")
Set Form name.
setFilterCols($a_val)
Set filter columns.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
getIsDataTable()
Get is data table.
const FILTER_NUMBER_RANGE
addMultiItemSelectionButton($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
Add Selection List + Command button for selected items.
determineLimit()
Determine the limit.
isFilterSelected($a_col)
Is given filter selected?
deleteTemplate($a_name)
Delete template.
fillMetaExcel(ilExcel $a_excel, &$a_row)
Add meta information to excel export.
fillActionRow()
Fill Action Row.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
executeCommand()
Execute command.
setOrderLink($sort_field, $order_dir)
getResetCommand()
Get reset filter command.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
getDefaultOrderField()
Get Default order field.
setCloseCommand($a_link)
Add command for closing table.
setOpenFormTag($a_val)
Set open form tag.
isColumnSelected($a_col)
Is given column selected?
numericOrdering($a_field)
Should this field be sorted numeric?
getSelectAllCheckbox()
Get the name of the checkbox that should be toggled with a select all button.
getPreventDoubleSubmission()
Get prevent double submission.
addHeaderCommand($a_href, $a_text, $a_target="", $a_img="")
Add Header Command (Link) (Image needed for now)
setShowTemplates($a_value)
Toggle templates.
const FILTER_DATETIME_RANGE
determineSelectedFilters()
Determine selected filters.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
getOrderDirection()
Get order direction.
setMaxCount($a_max_count)
set max.
setOrderDirection($a_order_direction)
set order direction @access public
getColumnCount()
Returns the column count based on the number of the header row columns @access public.
setFooter($a_style, $a_previous=0, $a_next=0)
set order direction @access public
setOffset($a_offset)
set dataset offset @access public
Saves (mostly asynchronously) user properties of tables (e.g.
Saves (mostly asynchronously) user properties of tables (e.g.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
static initConnection(ilTemplate $a_main_tpl=null)
Init YUI Connection module.
if(!array_key_exists('StateId', $_REQUEST)) $id
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'