Generate message title from database row (using title and uid)

@param   array $row Database row

@return  string
481905
protected function messageTitleFromRow(array $row)
    {
        $ret = array();

        if (!empty($row['title'])) {
            $ret[] = '"' . htmlspecialchars($row['title']) . '"';
        }

        if (!empty($row['uid'])) {
            $ret[] = '[UID #' . htmlspecialchars($row['uid']) . ']';
        }

        return implode(' ', $ret);
    }
2437
private function extractBookmarkFromRow(array $row): Bookmark
    {
        $bookmark = new Bookmark();
        $bookmark->id = (int)$row['id'];
        $bookmark->name = $row['name'];
        $bookmark->userId = (int)$row['user_id'];
        $bookmark->locationId = (int)$row['node_id'];

        return $bookmark;
    }
1036956
private function getJobFromRow(array $row)
    {
        $type = $row['type'];

        /** @var Job $job */
        $job = new $type($this->jsonDecode($row['data']));
        $job->setChannel($row['channel']);
        $job->setBatchId($row['batch_id']);
        $job->setQueue($this, (integer) $row['id']);

        return $job;
    }
421259
protected function col_name($row) {
        return html_writer::link(new moodle_url('/admin/tool/lp/plan.php', array('id' => $row->id)),
            format_string($row->name, true, array('context' => $this->context)));
    }
767004
protected function getHtmlBody(array $rows): string
  {
    $ret = '';
    $i   = 0;
    foreach ($rows as $row)
    {
      $class = static::$class;
      if ($class!==null) $class .= ' ';
      $class .= ($i % 2==0) ? 'even' : 'odd';

      $ret .= Html::generateTag('tr', ['class' => $class]);
      foreach ($this->columns as $column)
      {
        $ret .= $column->getHtmlCell($row);
      }
      $ret .= '</tr>';
      $i++;
    }

    return $ret;
  }
950971
protected function listBannerText($row)
    {
        //Banner Ziel per Page?
        if ($row['banner_jumpTo'] >0)
        {
            //url generieren
            $objBannerNextPage = \Database::getInstance()->prepare("SELECT id, alias FROM tl_page WHERE id=?")
                                                ->limit(1)
                                                ->execute($row['banner_jumpTo']);
            if ($objBannerNextPage->numRows)
            {
                $row['banner_url'] = $this->generateFrontendUrl($objBannerNextPage->fetchAssoc());
            }
        }
        
        $banner_url = ampersand(\Idna::decode($row['banner_url']));
        if (strlen($banner_url)>0)
        {
            $banner_url_text = $GLOBALS['TL_LANG']['tl_banner']['banner_url'][0].': ';
        }
        else
        {
            $banner_url_text = '';
        }
        //Output
        $output = '<div class="mod_banner_be">' .
                '<div class="name"><br />'.$row['banner_name'].'<br /><span style="font-weight:normal;">'.nl2br($row['banner_comment']).'<br /><br />'.$banner_url_text .(strlen($banner_url)<60 ? $banner_url : substr($banner_url, 0, 31)."[...]".substr($banner_url,-21,21) ).'</span></div>' .
                '<div class="right">' .
                '<div class="left">'.
                '<div class="published_head">'.$GLOBALS['TL_LANG']['tl_banner']['banner_published'][0].'</div>'.
                '<div class="published_data">'.($row['banner_published'] =='' ? $GLOBALS['TL_LANG']['tl_banner']['tl_be_no'] : $GLOBALS['TL_LANG']['tl_banner']['tl_be_yes']).' </div>'.
                '</div>'.
                '<div class="left">' .
                '<div class="date_head">'.$GLOBALS['TL_LANG']['tl_banner']['banner_type'][0].'</div>' .
                '<div class="date_data">'.$GLOBALS['TL_LANG']['tl_banner_type']['banner_text'].'</div>' .
                '</div>' .
                '<div style="clear:both;"></div>'.
                '<div class="left">' .
                '<div class="date_head">'.$GLOBALS['TL_LANG']['tl_banner']['tl_be_start'].'</div>' .
                '<div class="date_data">' . ($row['banner_start']=='' ? $GLOBALS['TL_LANG']['tl_banner']['tl_be_not_defined_start'] : date($GLOBALS['TL_CONFIG']['datimFormat'], $row['banner_start'])) . '</div>' .
                '</div>' .
                '<div class="left">' .
                '<div class="date_head">'.$GLOBALS['TL_LANG']['tl_banner']['tl_be_stop'].'</div>' .
                '<div class="date_data">' . ($row['banner_stop'] =='' ? $GLOBALS['TL_LANG']['tl_banner']['tl_be_not_defined_stop'] : date($GLOBALS['TL_CONFIG']['datimFormat'], $row['banner_stop'])) . '</div>' .
                '</div>' .
                '<div style="clear:both;"></div>'.
                '<div class="left">' .
                '<div class="date_head">'.$GLOBALS['TL_LANG']['tl_banner']['tl_be_max_views'].'</div>' .
                '<div class="date_data">' . ($row['banner_views_until']=='' ? $GLOBALS['TL_LANG']['tl_banner']['tl_be_not_defined_max'] : $row['banner_views_until']) . '</div>' .
                '</div>' .
                '<div class="left">' .
                '<div class="date_head">'.$GLOBALS['TL_LANG']['tl_banner']['tl_be_max_clicks'].'</div>' .
                '<div class="date_data">' . ($row['banner_clicks_until'] =='' ? $GLOBALS['TL_LANG']['tl_banner']['tl_be_not_defined_max'] : $row['banner_clicks_until']) . '</div>' .
                '</div>' .
                '<div style="clear:both;"></div>'.
                '</div>' .
                '</div>';
    
        $key = $row['banner_published'] ? 'published' : 'unpublished';
        $style = 'style="font-size:11px;margin-bottom:10px;"';
        $output_h = '<div class="cte_type ' . $key . '" ' . $style . '><strong>' . specialchars(ampersand($row['banner_name'])) . '</strong></div>';
        return $output_h . $output;
    }
196961
public function getSubmitMessage($row)
    {
        $message = '';
        if ($this->getFormField()->getFieldLabel()) {
            $message .= $this->getFormField()->getFieldLabel().': ';
        }

        $message .= $row->{$this->getFormField()->getName()};
        return $message;
    }
165871
public function format($row)
    {
        $data = $this->getArray($row);
        $data = $this->process($data);

        return json_encode($data, $this->encodeOptions);
    }
158929
public function getLinkReplaced(array $row)
    {
        $link = $this->getLink();

        // Replace placeholders
        if (strpos($this->getLink(), self::ROW_ID_PLACEHOLDER) !== false) {
            $id = '';
            if (isset($row['idConcated'])) {
                $id = $row['idConcated'];
            }
            $link = str_replace(self::ROW_ID_PLACEHOLDER, $id, $link);
        }

        foreach ($this->getLinkColumnPlaceholders() as $col) {
            $link = str_replace(':'.$col->getUniqueId().':', $row[$col->getUniqueId()], $link);
        }

        return $link;
    }
778220
public function encodeSegment(array $row): string
    {
        // init
        $str = '';
        $t = \count($row);

        foreach ($row as $i => &$iValue) {
            if (\is_array($iValue)) {
                if (\count($iValue) === 1
                    && \is_array(\reset($iValue))
                ) {
                    $iValue = \array_pop($iValue);
                }

                if (\is_array($iValue)) {
                    foreach ($iValue as &$temp) {
                        $temp = $this->escapeValue($temp);
                    }
                    unset($temp);
                }

                $elm = \implode($this->sepComp, $iValue);
            } else {
                $elm = $this->escapeValue($iValue);
            }

            $str .= $elm;
            if ($i == $t - 1) {
                break;
            }
            $str .= $this->sepData;
        }
        unset($iValue);

        $str .= $this->symbEnd;

        return $str;
    }
1050898
public function getDataCellContent($row)
	{
		$data=$this->grid->dataProvider->data[$row];
		if($this->urlExpression!==null)
			$url=$this->evaluateExpression($this->urlExpression,array('data'=>$data,'row'=>$row));
		else
			$url=$this->url;
		if($this->labelExpression!==null)
			$label=$this->evaluateExpression($this->labelExpression,array('data'=>$data,'row'=>$row));
		else
			$label=$this->label;
		$options=$this->linkHtmlOptions;
		if(is_string($this->imageUrl))
			return CHtml::link(CHtml::image($this->imageUrl,$label),$url,$options);
		else
			return CHtml::link($label,$url,$options);
	}
377418
public function render(Row $row)
	{
		if (!$this->shouldBeRendered($row)) {
			return null;
		}

		try {
			// Renderer function may be used
			return $this->useRenderer($row);
		} catch (DataGridColumnRendererException $e) {
			// Do not use renderer
		}

		$link = $this->createLink(
			$this->grid,
			$this->href,
			$this->getItemParams($row, $this->params) + $this->parameters
		);

		$a = Html::el('a')->href($link);

		$this->tryAddIcon($a, $this->getIcon($row), $this->getName());

		if (!empty($this->data_attributes)) {
			foreach ($this->data_attributes as $key => $value) {
				$a->data($key, $value);
			}
		}

		if (!empty($this->attributes)) {
			$a->addAttributes($this->attributes);
		}

		$a->addText($this->translate($this->getName()));

		if ($this->title) {
			$a->title($this->translate($this->getTitle($row)));
		}

		if ($this->class) {
			$a->class($this->getClass($row));
		}

		if ($confirm = $this->getConfirm($row)) {
			$a->data(static::$data_confirm_attribute_name, $confirm);
		}

		if ($this->open_in_new_tab) {
			$a->addAttributes(['target' => '_blank']);
		}

		return $a;
	}
502135
public function getValue($row, Table $table)
    {
        if (!$this->value)
            return $row->{$this->name};
        if (is_string($this->value)) {
            $res = '';
            eval("\$res = {$this->value};");
            return $res;
        } elseif (is_callable($this->value)) {
            return call_user_func($this->value, $row, $table);
        }
    }
926722
protected function row(Row $row, array $cells)
	{
		$html = '<tr';
		$this->addAttributes($html, $row->getAttributes());
		$html .= '>' . implode('', $cells) . '</tr>';

		return $html;
	}
671624
protected function editColumns($data, $row)
    {
        foreach ($this->editColumns as $key => $value) {
            $value['content'] = Helper::compileContent($value['content'], $data, $row);
            Arr::set($data, $value['name'], $value['content']);
        }

        return $data;
    }
248264
public function getValue($row): string
    {
        $escape = $this->get('escape', false);
        $value = $this->attributes['value']($row);

        if ($value instanceof Renderable) {
            return $value->render();
        }

        return $escape === true ? e($value) : $value;
    }
1147788
public function translateRowValues($row, $key)
    {
        $row = parent::translateRowValues($row, $key);

        if (! $row) {
            return false;
        }

        if ((! isset($row['grs_id_user'])) && isset($row['gr2o_patient_nr'], $row['gr2o_id_organization'])) {
            $sql = 'SELECT gr2o_id_user
                    FROM gems__respondent2org
                    WHERE gr2o_patient_nr = ? AND gr2o_id_organization = ?';

            $id = $this->db->fetchOne($sql, array($row['gr2o_patient_nr'], $row['gr2o_id_organization']));

            if ($id) {
                $row['grs_id_user']  = $id;
                $row['gr2o_id_user'] = $id;
            }
        }

        if (empty($row['gr2o_email'])) {
            $row['calc_email'] = 1;
        }

        return $row;
    }