2require_once(
'./Customizing/global/plugins/Libraries/ActiveRecord/class.srModelObjectTableGUI.php');
 
    3require_once(
'./Customizing/global/plugins/Libraries/ActiveRecord/class.ActiveRecordList.php');
 
    4require_once(
'./Customizing/global/plugins/Libraries/ActiveRecord/Views/Index/class.arIndexTableField.php');
 
    5require_once(
'./Customizing/global/plugins/Libraries/ActiveRecord/Views/Index/class.arIndexTableFields.php');
 
    6require_once(
'./Customizing/global/plugins/Libraries/ActiveRecord/Views/Index/class.arIndexTableAction.php');
 
    7require_once(
'./Customizing/global/plugins/Libraries/ActiveRecord/Views/Index/class.arIndexTableActions.php');
 
   66                global 
$ilCtrl, $ilTabs, $ilAccess;
 
   68                $this->tabs = $ilTabs;
 
   69                $this->access = $ilAccess;
 
   71                $this->parent_obj = $a_parent_obj;
 
   75                $this->
setId(strtolower(get_class($this->active_record_list->getAR()) . 
"_index"));
 
   79                parent::__construct($a_parent_obj, $a_parent_cmd);
 
   98                $this->initTableFilter();
 
  102                $this->initTableColumns();
 
  103                $this->initTableData();
 
  115                $this->
fields->sortFields();
 
  142                $this->actions->addAction($action);
 
  147                $this->
setFormAction($this->ctrl->getFormAction($this->parent_obj));
 
  168                return $this->
txt(
"add_item");
 
  183                return $this->
txt(
"delete", 
false);
 
  194                $this->multi_item_actions->addAction($action);
 
  200                        $this->
addMultiItemSelectionButton(
"index_table_multi_action", $this->multi_item_actions->getActionsAsKeyTextArray(), 
"multiAction", $this->txt(
'execute', 
false));
 
  212                return $this->
getFields()->getSelectableColumns($this);
 
  219        protected function initTableFilter() {
 
  230                        if ($field->getHasFilter()) {
 
  265        protected function addFilterItemToForm(
ilFormPropertyGUI $item, $optional = 
false) {
 
  271                $this->filter_array[$item->
getPostVar()] = $item->getValue();
 
  285                $this->
setRowTemplate(
'tpl.record_row.html', 
'./Customizing/global/plugins/Libraries/ActiveRecord/');
 
  292        protected function initTableColumns() {
 
  300                                if ($field->getSortable()) {
 
  301                                        $this->
addColumn($this->
txt($field->getTxt()), $field->getName());
 
  330        protected function initTableData() {
 
  331                $this->active_record_list->getArWhereCollection()->setStatements(NULL);
 
  332                $this->active_record_list->getArJoinCollection()->setStatements(NULL);
 
  333                $this->active_record_list->getArLimitCollection()->setStatements(NULL);
 
  334                $this->active_record_list->getArOrderCollection()->setStatements(NULL);
 
  336                $this->filterTableData();
 
  339                $ar_data = $this->active_record_list->getArray();
 
  342                foreach ($ar_data as $key => $item) {
 
  343                        $data[$key] = array();
 
  344                        foreach ($this->
getFields()->getFieldsForDisplay() as $field) {
 
  348                                if (array_key_exists($field->getName(), $item)) {
 
  349                                        if (!$item[$field->getName()]) {
 
  351                                        } elseif ($field->getIsCreatedByField()) {
 
  353                                        } elseif ($field->getIsModifiedByField()) {
 
  356                                                $data[$key][$field->getName()] = $this->
setArFieldData($field, $item, $item[$field->getName()]);
 
  367        protected function filterTableData() {
 
  374                                $this->
addFilterWhere($filter, $filter->getPostVar(), $filter->getValue());
 
  387                switch (get_class($filter)) {
 
  388                        case 'ilTextInputGUI':
 
  392                        case 'ilCombinationInputGUI':
 
  393                                if (is_object($value[
"from"]) || is_object($value[
"to"])) {
 
  394                                        if (get_class($value[
"from"]) == 
"ilDateTime" || get_class($value[
"to"]) == 
"ilDateTime") {
 
  399                                        if (get_class($value[
"from"]) == 
"ilDate" || get_class($value[
"to"]) == 
"ilDate") {
 
  426                if ($value[
"from"] != 
"" OR $value[
"to"] != 
"") {
 
  427                        if ($value[
"from"] == 
"") {
 
  430                        if ($value[
"to"] == 
"") {
 
  431                                $value[
"to"] = PHP_INT_MAX;
 
  433                        $this->active_record_list->where($this->active_record_list->getAR()->getConnectorContainerName() . 
"." . $name . 
" >= " . $value[
"from"]
 
  434                                . 
" AND " . $this->active_record_list->getAR()->getConnectorContainerName() . 
"." . $name . 
" <= " . $value[
"to"]);
 
  445                $this->active_record_list->where($this->active_record_list->getAR()->getConnectorContainerName() . 
"." . $name . 
" like '%" . $value . 
"%'");
 
  455                if ($value[
"from"] != NULL OR $value[
"to"] != NULL) {
 
  456                        if ($value[
"from"] == NULL) {
 
  459                        if ($value[
"to"] == NULL) {
 
  462                        $this->active_record_list->where($this->active_record_list->getAR()->getConnectorContainerName() . 
"." . $name . 
" BETWEEN '" 
  474                if ($value[
"from"] != NULL OR $value[
"to"] != NULL) {
 
  475                        if ($value[
"from"] == NULL) {
 
  478                        if ($value[
"to"] == NULL) {
 
  481                        $this->active_record_list->where($this->active_record_list->getAR()->getConnectorContainerName() . 
"." . $name . 
" BETWEEN '" 
  499                        $this->
setDefaultOrderField($this->active_record_list->getAR()->getArFieldList()->getPrimaryField()->getName());
 
  503                $this->
setMaxCount($this->active_record_list->count());
 
  530                return $user->getPublicName();
 
  544                return $user->getPublicName();
 
  593                return "CUSTOM-OVERRIDE: setCustomFieldData";
 
  607                $this->addActionsToRow($a_set);
 
  615                $this->ctrl->setParameterByClass(get_class($this->parent_obj), 
'ar_id', self::domid_encode($a_set[$this->
getFields()->getPrimaryField()
 
  625                        $this->tpl->setVariable(
'ID', self::domid_encode($a_set[$this->
getFields()->getPrimaryField()->getName()]));
 
  634                foreach ($a_set as $key => $value) {
 
  648                $this->tpl->setCurrentBlock(
'entry');
 
  649                $this->tpl->setVariable(
'ENTRY_CONTENT', $value);
 
  650                $this->tpl->parseCurrentBlock(
'entry');
 
  657        protected function addActionsToRow($a_set) {
 
  660                        $alist->setId(self::domid_encode($a_set[$this->
getFields()->getPrimaryField()->getName()]));
 
  661                        $alist->setListTitle($this->
txt(
'actions', 
false));
 
  668                                if ($action->getAccess()) {
 
  669                                        $access = $this->access->checkAccess($action->getAccess(), 
'', 
$_GET[
'ref_id']);
 
  672                                        $alist->addItem($action->getTitle(), $action->getId(), $this->ctrl->getLinkTargetByClass($action->getTargetClass(), $action->getTargetCmd()));
 
  676                        $this->tpl->setVariable(
'ACTION', $alist->getHTML());
 
  686                $index_table_tpl = 
new ilTemplate(
"tpl.index_table.html", 
true, 
true, 
"./Customizing/global/plugins/Libraries/ActiveRecord/");
 
  691                $index_table_tpl->setVariable(
"TABLE", parent::render());
 
  693                return $index_table_tpl->get();
 
  703        public function txt(
$txt, $plugin_txt = 
true) {
 
  704                return $this->parent_obj->txt(
$txt, $plugin_txt);
 
  711                $this->initTableData();
 
  716                parent::resetFilter();
 
  718                $this->initTableData();
 
  731                if (!empty($id_to_encode)) {
 
  732                        $encoded_id = preg_replace_callback(
'/([^a-zA-Z0-9])/', 
function ($matches) {
 
  733                                return "__idstart_" . strtolower(dechex(ord($matches[0]))) . 
"_idend__";
 
  749                if (!empty($id_to_decode)) {
 
  750                        $decoded_id = preg_replace_callback(
'/__idstart_(.{2})_idend__/', 
function ($matches) {
 
  751                                return chr(hexdec($matches[1]));
 
  789                return $this->
getFields()->getField($field_name);
 
  853                return $this->actions->getActions();
 
GUI-Class arIndexTableAction.
GUI-Class arIndexTableActions.
GUI-Class arIndexTableField.
GUI-Class arIndexTableFields.
GUI-Class arIndexTableGUI.
$fields
arIndexTableFields
setArFieldData(arIndexTableField $field, $item, $value)
setOrderAndSegmentation()
addFilterWhere(ilFormPropertyGUI $filter, $name, $value)
addMultiItemActionCheckboxToRow($a_set)
setMultiItemActions($multi_item_actions)
initMultiItemActionsButton()
getSelectableColumns()
Get selectable columns.
initAfterParentConstructor()
addAction(arIndexTableAction $action)
parseEntry(arIndexTableField $field, $value)
addFilterTextWhere(ilTextInputGUI $filter, $name, $value)
setCustomFieldData(arIndexTableField $field, $item)
setDateFieldData(arIndexTableField $field, $item, $value)
addFilterDateTimeWhere(ilCombinationInputGUI $filter, $name, $value)
setTableTitle($table_title)
setEmptyFieldData(arIndexTableField $field, $item)
static domid_decode($id_to_decode)
addMultipleSelectionColumn()
setArModifiedByField(arIndexTableField $field, $item, $value)
resetFilter()
Reset filter.
setCtrlParametersForRow($a_set)
setFields(arIndexTableFields $fields)
customizeFields()
@description To be overridden
__construct(arGUI $a_parent_obj, $a_parent_cmd, ActiveRecordList $active_record_list)
setArCreatedByField(arIndexTableField $field, $item, $value)
addFilterNumericWhere(ilCombinationInputGUI $filter, $name, $value)
txt($txt, $plugin_txt=true)
checkColumnVisibile(arIndexTableField $field)
addField(arIndexTableField $field)
addFilterField(arIndexTableField $field)
addMutliItemAction(arIndexTableAction $action)
initBeforeParentConstructor()
getMultiItemActionsAsArray()
static domid_encode($id_to_encode)
addFilterDateWhere(ilCombinationInputGUI $filter, $name, $value)
User interface class for advanced drop-down selection lists.
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
setExternalSorting($a_val)
Set external sorting.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
getFilterItems($a_optionals=false)
Get filter items.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
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.
resetOffset($a_in_determination=false)
Reset offset.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
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.
setExternalSegmentation($a_val)
Set external segmentation.
writeFilterToSession()
Write filter values to session.
setFilterCols($a_val)
Set filter columns.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
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.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
getDefaultOrderField()
Get Default order field.
isColumnSelected($a_col)
Is given column selected?
getOrderDirection()
Get order direction.
setMaxCount($a_max_count)
set max.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.