Displays the group header for this grouping column

The grouping header is displayed at the beginning of a group.

@param mixed $row a data object containing the data for the first row in
in the table store for this group.
972338
protected function displayGroupHeader($row)
    {
        $tr_tag = new SwatHtmlTag('tr');
        $tr_tag->class = 'swat-table-view-group';
        $tr_tag->open();

        $td_tag = new SwatHtmlTag('td', $this->getTdAttributes());
        $td_tag->colspan = $this->view->getXhtmlColspan();
        $td_tag->open();
        $this->displayRenderersInternal($row);
        $td_tag->close();

        $tr_tag->close();
    }
1316818
public function filterSubTable(Row $row)
    {
        if (!$this->enableRecursive) {
            return;
        }
        $subTable = $row->getSubtable();
        if ($subTable) {
            $this->filter($subTable);
        }
    }
318187
public function renderDataCellContent($row, $data)
	{
		if ($this->grid->json) {
			if ($this->value !== null) {
				$value = $this->evaluateExpression($this->value, array('data' => $data, 'row' => $row));
			} elseif ($this->name !== null) {
				$value = CHtml::value($data, $this->name);
			}
			$value = !isset($value)
				? $this->grid->nullDisplay
				: $this->grid->getFormatter()->format(
					$value,
					$this->type
				);

			return $value;
		}
		parent::renderDataCellContent($row, $data);
	}
1254181
public function withTargetRow(int $row): Notation
    {
        $notation = $this->getTargetColumn() . $row;

        return new self($notation);
    }
634207
public function listEntry($row)
	{
		if($row['date'] != null) $date = date('d.m.Y',$row['date']);
		else $date = date('d.m.Y',$row['start']) . ' - ' . date('d.m.Y',$row['end']);
		return '<div style="float:left">'. $row['name'] . '<span style="color:#b3b3b3;padding-left:3px">[' . $date . ']</span>' . "</div>\n";
	}
920556
protected function onInput($row)
    {
        $index = "";
        foreach ($this->groupColumns as $gColumn) {
            $index .= $row[$gColumn];
        }
        $index = strtolower($index) . md5($index);
        if (isset($this->gData[$index])) {
            $res = $this->gData[$index];
            $this->cData[$index]++;

            foreach ($this->sumColumns as $sumColumn) {
                $res[$sumColumn] += $row[$sumColumn];
            }
            foreach ($this->countColumns as $countColumn) {
                $res[$countColumn] = $this->cData[$index];
            }
            foreach ($this->minColumns as $minColumn) {
                if ($res[$minColumn] > $row[$minColumn]) {
                    $res[$minColumn] = $row[$minColumn];
                }
            }

            foreach ($this->maxColumns as $maxColumn) {
                if ($res[$maxColumn] < $row[$maxColumn]) {
                    $res[$maxColumn] = $row[$maxColumn];
                }
            }

            foreach ($this->avgColumns as $avgColumn) {
                $res[$avgColumn] = ($res[$avgColumn] * ($this->cData[$index] - 1) + $row[$avgColumn]) / $this->cData[$index];
            }

            $this->gData[$index] = $res;
        } else {
            $this->cData[$index] = 1;
            foreach ($this->countColumns as $countColumn) {
                $row[$countColumn] = 1;
            }
            $this->gData[$index] = $row;
        }
    }
265922
public function col_groups($row) {
        $groups = '';
        if ($usergrps = groups_get_all_groups($this->feedbackstructure->get_cm()->course, $row->userid, 0, 'name')) {
            foreach ($usergrps as $group) {
                $groups .= format_string($group->name). ' ';
            }
        }
        return trim($groups);
    }
1234733
protected function _groupResult($row)
    {
        $defaultAlias = $this->_defaultAlias;
        $results = $presentAliases = [];
        $options = [
            'useSetters' => false,
            'markClean' => true,
            'markNew' => false,
            'guard' => false
        ];

        foreach ($this->_matchingMapColumns as $alias => $keys) {
            $matching = $this->_matchingMap[$alias];
            $results['_matchingData'][$alias] = array_combine(
                $keys,
                array_intersect_key($row, $keys)
            );
            if ($this->_hydrate) {
                /* @var \Cake\ORM\Table $table */
                $table = $matching['instance'];
                $options['source'] = $table->getRegistryAlias();
                /* @var \Cake\Datasource\EntityInterface $entity */
                $entity = new $matching['entityClass']($results['_matchingData'][$alias], $options);
                $results['_matchingData'][$alias] = $entity;
            }
        }

        foreach ($this->_map as $table => $keys) {
            $results[$table] = array_combine($keys, array_intersect_key($row, $keys));
            $presentAliases[$table] = true;
        }

        // If the default table is not in the results, set
        // it to an empty array so that any contained
        // associations hydrate correctly.
        if (!isset($results[$defaultAlias])) {
            $results[$defaultAlias] = [];
        }

        unset($presentAliases[$defaultAlias]);

        foreach ($this->_containMap as $assoc) {
            $alias = $assoc['nestKey'];

            if ($assoc['canBeJoined'] && empty($this->_map[$alias])) {
                continue;
            }

            /* @var \Cake\ORM\Association $instance */
            $instance = $assoc['instance'];

            if (!$assoc['canBeJoined'] && !isset($row[$alias])) {
                $results = $instance->defaultRowValue($results, $assoc['canBeJoined']);
                continue;
            }

            if (!$assoc['canBeJoined']) {
                $results[$alias] = $row[$alias];
            }

            $target = $instance->getTarget();
            $options['source'] = $target->getRegistryAlias();
            unset($presentAliases[$alias]);

            if ($assoc['canBeJoined'] && $this->_autoFields !== false) {
                $hasData = false;
                foreach ($results[$alias] as $v) {
                    if ($v !== null && $v !== []) {
                        $hasData = true;
                        break;
                    }
                }

                if (!$hasData) {
                    $results[$alias] = null;
                }
            }

            if ($this->_hydrate && $results[$alias] !== null && $assoc['canBeJoined']) {
                $entity = new $assoc['entityClass']($results[$alias], $options);
                $results[$alias] = $entity;
            }

            $results = $instance->transformRow($results, $alias, $assoc['canBeJoined'], $assoc['targetProperty']);
        }

        foreach ($presentAliases as $alias => $present) {
            if (!isset($results[$alias])) {
                continue;
            }
            $results[$defaultAlias][$alias] = $results[$alias];
        }

        if (isset($results['_matchingData'])) {
            $results[$defaultAlias]['_matchingData'] = $results['_matchingData'];
        }

        $options['source'] = $this->_defaultTable->getRegistryAlias();
        if (isset($results[$defaultAlias])) {
            $results = $results[$defaultAlias];
        }
        if ($this->_hydrate && !($results instanceof EntityInterface)) {
            $results = new $this->_entityClass($results, $options);
        }

        return $results;
    }
431375
public function created_at($row)
    {
        if (is_object($row))
        {
            $row->created_at = date('Y-m-d H:i:s');
        }
        else
        {
            $row['created_at'] = date('Y-m-d H:i:s');
        }

        return $row;
    }
1334819
public function renderDataCell($row)
	{
		if ($this->grid->json) {
            $data = $this->grid->dataProvider->data[$row];
            $options = $this->htmlOptions;
            if ($this->cssClassExpression !== null) {
                $class = $this->evaluateExpression($this->cssClassExpression, array('row' => $row, 'data' => $data));
                if (!empty($class)) {
                    if (isset($options['class'])) {
                        $options['class'] .= ' ' . $class;
                    } else {
                        $options['class'] = $class;
                    }
                }
            }

            return array(
                'attrs' => CHtml::renderAttributes($options),
                'content' => $this->renderDataCellContent($row, $data),
            );
		}

		parent::renderDataCell($row);
	}
434205
public function renderTableRow($row)
	{
		$change = false;
		if ($this->_changes && array_key_exists($row, $this->_changes)) {
			$change = $this->_changes[$row];
			//if change in extracolumns --> put extra row
			$columnsInExtra = array_intersect(array_keys($change['columns']), $this->extraRowColumns);
			if (count($columnsInExtra) > 0) {
				$this->renderExtraRow($row, $change, $columnsInExtra);
			}
		}

		// original CGridView code
		$htmlOptions = array();
		if ($this->rowHtmlOptionsExpression !== null) {
			$data = $this->dataProvider->data[$row];
			$options = $this->evaluateExpression(
				$this->rowHtmlOptionsExpression,
				array('row' => $row, 'data' => $data)
			);
			if (is_array($options)) {
				$htmlOptions = $options;
			}
		}

		if ($this->rowCssClassExpression !== null) {
			$data = $this->dataProvider->data[$row];
			$class = $this->evaluateExpression($this->rowCssClassExpression, array('row' => $row, 'data' => $data));
		} elseif (is_array($this->rowCssClass) && ($n = count($this->rowCssClass)) > 0) {
			$class = $this->rowCssClass[$row % $n];
		}

		if (!empty($class)) {
			if (isset($htmlOptions['class'])) {
				$htmlOptions['class'] .= ' ' . $class;
			} else {
				$htmlOptions['class'] = $class;
			}
		}

		echo CHtml::openTag('tr', $htmlOptions);
		if (!$this->_changes) { //standart CGridview's render
			foreach ($this->columns as $column) {
				$column->renderDataCell($row);
			}
		} else { //for grouping
			foreach ($this->columns as $column) {
				$isGroupColumn = property_exists($column, 'name') && in_array($column->name, $this->mergeColumns);
				if (!$isGroupColumn) {
					$column->renderDataCell($row);
					continue;
				}

				$isChangedColumn = $change && array_key_exists($column->name, $change['columns']);

				//for rowspan show only changes (with rowspan)
				switch ($this->mergeType) {
					case self::MERGE_SIMPLE:
					case self::MERGE_NESTED:
						if ($isChangedColumn) {
							$options = $column->htmlOptions;
							$column->htmlOptions['rowspan'] = $change['columns'][$column->name]['count'];
							$column->htmlOptions['class'] = 'merge';
							$style = isset($column->htmlOptions['style']) ? $column->htmlOptions['style'] : '';
							$column->htmlOptions['style'] = $style . ';' . $this->mergeCellCss;
							$column->renderDataCell($row);
							$column->htmlOptions = $options;
						}
						break;

					case self::MERGE_FIRSTROW:
						if ($isChangedColumn) {
							$column->renderDataCell($row);
						} else {
							echo '<td></td>';
						}
						break;
				}

			}
		}

		echo "</tr>\n";
	}
170101
public function removeRow(GridRow $row)
    {
        if ($this->rows->contains($row)) {
            $this->rows->removeElement($row);
        }
    }
1115899
protected function renderDataCellContent($row, $data)
	{
		$tr = array();
		ob_start();
		foreach ($this->buttons as $id => $button) {
			$this->renderButton($id, $button, $row, $data);
			$tr['{' . $id . '}'] = ob_get_contents();
			ob_clean();
		}
		ob_end_clean();
		echo "<div class='btn-group'>" . strtr($this->template, $tr) . "</div>";
	}
1277628
public function seek($row = 1)
    {
        if (($row < $this->startRow) || ($row > $this->endRow)) {
            throw new PHPExcel_Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})");
        }
        $this->position = $row;

        return $this;
    }
995349
protected function init($group = 0) {

        $tablecolumns = array('userpic', 'fullname', 'groups');
        $tableheaders = array(
            get_string('userpic'),
            get_string('fullnameuser'),
            get_string('groups')
        );

        $extrafields = get_extra_user_fields($this->get_context());
        $ufields = user_picture::fields('u', $extrafields, $this->useridfield);
        $fields = 'c.id, c.timemodified as completed_timemodified, c.courseid, '.$ufields;
        $from = '{feedback_completed} c '
                . 'JOIN {user} u ON u.id = c.userid AND u.deleted = :notdeleted';
        $where = 'c.anonymous_response = :anon
                AND c.feedback = :instance';
        if ($this->feedbackstructure->get_courseid()) {
            $where .= ' AND c.courseid = :courseid';
        }

        if ($this->is_downloading()) {
            // When downloading data:
            // Remove 'userpic' from downloaded data.
            array_shift($tablecolumns);
            array_shift($tableheaders);

            // Add all identity fields as separate columns.
            foreach ($extrafields as $field) {
                $fields .= ", u.{$field}";
                $tablecolumns[] = $field;
                $tableheaders[] = get_user_field_name($field);
            }
        }

        if ($this->feedbackstructure->get_feedback()->course == SITEID && !$this->feedbackstructure->get_courseid()) {
            $tablecolumns[] = 'courseid';
            $tableheaders[] = get_string('course');
        }

        $tablecolumns[] = 'completed_timemodified';
        $tableheaders[] = get_string('date');

        $this->define_columns($tablecolumns);
        $this->define_headers($tableheaders);

        $this->sortable(true, 'lastname', SORT_ASC);
        $this->collapsible(true);
        $this->set_attribute('id', 'showentrytable');

        $params = array();
        $params['anon'] = FEEDBACK_ANONYMOUS_NO;
        $params['instance'] = $this->feedbackstructure->get_feedback()->id;
        $params['notdeleted'] = 0;
        $params['courseid'] = $this->feedbackstructure->get_courseid();

        $group = (empty($group)) ? groups_get_activity_group($this->feedbackstructure->get_cm(), true) : $group;
        if ($group) {
            $where .= ' AND c.userid IN (SELECT g.userid FROM {groups_members} g WHERE g.groupid = :group)';
            $params['group'] = $group;
        }

        $this->set_sql($fields, $from, $where, $params);
        $this->set_count_sql("SELECT COUNT(c.id) FROM $from WHERE $where", $params);
    }
919744
private function checkRowConsistency($row)
    {
        if ( $this->strict === false ) {
            return;
        }

        $current = count($row);

        if ( $this->rowConsistency === null ) {
            $this->rowConsistency = $current;
        }

        if ( $current !== $this->rowConsistency ) {
            throw new StrictViolationException();
        }

        $this->rowConsistency = $current;
    }
258564
public function setRow(TableRow $row = null)
    {
        $this->row = $row;

        if (null !== $row && !in_array($this, $row->getCells())) {
            $row->addCell($this);
        }

        return $this;
    }