List external banner record

@param object $row
@return string	record as html
776128
protected function listBannerExternal($row)
    {
        $fallback_content = '';

        $arrImageSize = $this->BannerImage->getBannerImageSize($row['banner_image_extern'], self::BANNER_TYPE_EXTERN);
    
        //resize if necessary
        $arrImageSizeNew = array();
        switch ($arrImageSize[2])
        {
            case 1: // GIF
            case 2: // JPG
            case 3: // PNG
                $arrImageSizeNew = $this->BannerImage->getCheckBannerImageSize($arrImageSize,250,200);
                $intWidth  = $arrImageSizeNew[0];
                $intHeight = $arrImageSizeNew[1];
                $oriSize   = $arrImageSizeNew[2];
                break;
            case 4:  // Flash swf
            case 13: // Flash swc
                $arrImageSizeNew = $this->BannerImage->getCheckBannerImageSize($arrImageSize,250,200);
                $intWidth  = $arrImageSizeNew[0];
                $intHeight = $arrImageSizeNew[1];
                $oriSize   = $arrImageSizeNew[2];
                break;
            default:
                break;
        }
        unset($oriSize);

        $banner_image = $row['banner_image_extern'];

        //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
        switch ($arrImageSize[2])
        {
            case 1: // GIF
            case 2: // JPG
            case 3: // PNG
                $output = '<div class="mod_banner_be">' .
                        '<div class="name"><img alt="'.specialchars(ampersand($row['banner_name'])).'" src="'. $banner_image .'" height="'.$intHeight.'" width="'.$intWidth.'" /></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']['source_extern'] .'</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 class="url">'.$banner_url_text . (strlen($banner_url)<80 ? $banner_url : substr($banner_url, 0, 36)."[...]".substr($banner_url,-36,36) ).'</div>' .
                        '</div>';
                break;
            case 4:  // Flash swf
            case 13: // Flash swc
                $output = '<div class="mod_banner_be">' .
                        '<div class="name"><div id="flash_'.$row['id'].'">'.specialchars(ampersand($row['banner_name'])).'</div>'.$fallback_content.'</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']['source_extern'] .'</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 class="url">'.$banner_url_text . (strlen($banner_url)<80 ? $banner_url : substr($banner_url, 0, 36)."[...]".substr($banner_url,-36,36) ). '</div>' .
                        '</div>' .
                        '<script>
	new Swiff("'.$banner_image.'", {
	  id: "flash_'.$row['id'].'",
	  width: '.$intWidth.',
	  height: '.$intHeight.',
	  params : {
	  allowfullscreen: "true",
	  wMode: "transparent",
	  flashvars: ""
	  }
	}).replaces($("flash_'.$row['id'].'"));
	</script>';
                break;
            default:
                break;
        }//switch
    
        if ($arrImageSize === false)
        {
            //Externe Banner Grafik
            $output = '<div class="mod_banner_be">' .
                    '<div class="name"><span style="color:red;">'.$GLOBALS['TL_LANG']['tl_banner']['tl_be_read_error'].'</span><br />'.$banner_image.'</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']['source_intern'] .'</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 class="url">'.$banner_url_text . (strlen($banner_url)<80 ? $banner_url : substr($banner_url, 0, 36)."[...]".substr($banner_url,-36,36) ).'</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;
    }
687522
protected function add_data_for_external($row) {
        $this->dataforexternal[] = [
            'id' => $row->id,
            'courseid' => $row->courseid,
            'userid' => $row->userid,
            'fullname' => fullname($row),
            'timemodified' => $row->completed_timemodified,
            'responses' => $this->get_responses_for_external($row),
        ];
    }
984380
public function _prepareArrayRow(\Magento\Framework\DataObject $row)
    {
        $optionExtraAttr = [];
        $optionExtraAttr['option_' . $this->getStatusRenderer()
            ->calcOptionHash($row->getData('status'))]
                         = 'selected="selected"';
        $optionExtraAttr['option_' . $this->getAutomationRenderer()
            ->calcOptionHash($row->getData('automation'))]
                         = 'selected="selected"';
        $row->setData(
            'option_extra_attrs',
            $optionExtraAttr
        );
    }
750865
public function getDbRowAsRowReadyForJSON($row)
    {
        $row4JSON = [
            'id'             => $row['event_id'],
            'name'           => $row['name'],
            'start_datetime' => $row['datetime_start'],
            'location'       => $row['location_place'].', '.$row['location_country'],
            'longitude'      => $row['geocoded_longitude'],
            'latitude'       => $row['geocoded_latitude'],
        ];

        return $row4JSON;
    }
759877
public function castRow($row)
    {
        $outRow = [];
        $validationErrors = [];
        foreach ($this->fields() as $fieldName => $field) {
            $value = array_key_exists($fieldName, $row) ? $row[$fieldName] : null;
            if (in_array($value, $this->missingValues())) {
                $value = null;
            }
            try {
                $outRow[$fieldName] = $field->castValue($value);
            } catch (Exceptions\FieldValidationException $e) {
                $validationErrors = array_merge($validationErrors, $e->validationErrors);
            }
        }
        if (count($validationErrors) > 0) {
            throw new Exceptions\FieldValidationException($validationErrors);
        }

        return $outRow;
    }
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;
    }
1362104
public function decorateActions($row = null)
    {
        if (empty($this->tableActions)) {
            return '';
        }
        $html    = app('html');
        $section = $html->create('div', $html->raw(implode('', $this->tableActions->toArray())), ['class' => 'mass-actions-menu', 'data-id' => $row->id ? $row->id : ''])->get();

        return '<i class="zmdi zmdi-more"></i>' . app('html')->raw($section)->get();
    }
948678
protected function generateBox($row)
    {
        return [
            'name' => $this->boxName(),
            'value' => $row->getKey(),
            'checked' => ($children = $this->children())
                && $children->contains($row->getKey()),

            // Former is giving these a class of "form-control" which isn't correct
            'class' => false,

            // Add the model instance so the decorator can use it
            'model' => $row,
        ];
    }
598912
public function other_cols($column, $row) {
        if (preg_match('/^val(\d+)$/', $column, $matches)) {
            $items = $this->feedbackstructure->get_items();
            $itemobj = feedback_get_item_class($items[$matches[1]]->typ);
            return trim($itemobj->get_printval($items[$matches[1]], (object) ['value' => $row->$column] ));
        }
        return $row->$column;
    }
355343
public function render(\Magento\Framework\DataObject $row)
    {
        return '<div ' . (($this->_getValue($row) == '1'
            || $this->_getValue($row) == true)
            ? 'class="dotmailer-success"  '
            :
            'class="dotmailer-error"  ') . '>  </div>';
    }
1170795
protected function filterRow($row)
    {
        $exportRow = array();
        foreach ($row as $columnName => $result) {
            if ($this->model->get($columnName, 'label')) {
                $options = $this->model->get($columnName, $this->modelFilterAttributes);


                foreach ($options as $optionName => $optionValue) {
                    switch ($optionName) {
                        case 'dateFormat':
                            // if there is a formatFunction skip the date formatting
                            if (array_key_exists('formatFunction', $options)) {
                                continue;
                            }

                            $result = $this->filterDateFormat($result, $optionValue, $columnName);

                            break;
                        case 'formatFunction':
                            $result = $this->filterFormatFunction($result, $optionValue);

                            break;
                        case 'itemDisplay':
                            $result = $this->filterItemDisplay($result, $optionValue);

                            break;
                        case 'multiOptions':
                            $result = $this->filterMultiOptions($result, $optionValue);

                            break;
                        default:
                            break;
                    }
                }

                if ($result instanceof \MUtil_Date) {
                    $result = $this->filterDateFormat($result, 'yyyy-MM-dd HH:mm:ss', $columnName);
                }

                $result = $this->filterHtml($result);

                $exportRow[$columnName] = $result;
            }
        }
        return $exportRow;
    }
207455
public function getDataCellContent($row)
	{
		$data=$this->grid->dataProvider->data[$row];
		if($this->value!==null)
			$value=$this->evaluateExpression($this->value,array('data'=>$data,'row'=>$row));
		elseif($this->name!==null)
			$value=CHtml::value($data,$this->name);
		else
			$value=$this->grid->dataProvider->keys[$row];

		$checked = false;
		if($this->checked!==null)
			$checked=$this->evaluateExpression($this->checked,array('data'=>$data,'row'=>$row));

		$options=$this->checkBoxHtmlOptions;
		if($this->disabled!==null)
			$options['disabled']=$this->evaluateExpression($this->disabled,array('data'=>$data,'row'=>$row));

		$name=$options['name'];
		unset($options['name']);
		$options['value']=$value;
		$options['id']=$this->id.'_'.$row;
		return CHtml::checkBox($name,$checked,$options);
	}
1166387
private function mapDocument(array $row)
    {
        $message = Message::create(
            $row['subject'],
            $row['body'],
            $row['priority'],
            $row['type'],
            $row['channel'],
            $row['role'],
            $row['user'],
            \DateTime::createFromFormat('U', $row['createdAt'])
        );

        return $message;
    }
583713
protected function getAttributesString(array $row)
    {
        $attributes = [];
        foreach ($this->getAttributes() as $attrKey => $attrValue) {
            if ('href' === $attrKey) {
                $attrValue = $this->getLinkReplaced($row);
            }
            $attributes[] = $attrKey.'="'.$attrValue.'"';
        }

        return implode(' ', $attributes);
    }
487292
protected function col_actions($row) {
        global $OUTPUT;

        $action = new \confirm_action(get_string('areyousure'));
        $url = new moodle_url($this->baseurl);
        $url->params(array('removecohort' => $row->id, 'sesskey' => sesskey()));
        $actionlink = $OUTPUT->action_link($url, '', $action, null, new \pix_icon('t/delete',
            get_string('stopsyncingcohort', 'tool_lp')));

        return $actionlink;

    }
225769
public function renderDataCell($row)
	{
		if ($this->grid->json) {
			$data = $this->grid->dataProvider->data[$row];
			$col = array();
			ob_start();
			$this->renderDataCellContent($row, $data);
			$col['content'] = ob_get_contents();
			ob_end_clean();
			$col['attrs'] = '';
			return $col;

		}

		parent::renderDataCell($row);
	}
850744
private function _getLayoutData($row)
    {

        // Get element type
        $eType = (new Query())
            ->select(['type'])
            ->from('{{%fieldlayouts}}')
            ->where('id=:id', [':id' => $row['layoutId']])
            ->scalar();

        // Set default data
        $data = [
            'id'          => $row['layoutId'],
            'elementType' => null,
            'section'     => null,
            'entryType'   => null,
            'tab'         => null,
            'editLayout'  => null,
        ];

        // If not a valid element type, bail
        if (!class_exists($eType)) {
            $data['elementType'] = '<span class="error">'.$eType.'</span>';
            return $data;
        }

        // Set element type
        $data['elementType'] = $eType::displayName();

        // Configure based on element type
        switch ($eType::refHandle()) {

            case 'entry':

                // Get entry type
                $entryType = (new Query())
                    ->select(['id','name','sectionId'])
                    ->from('{{%entrytypes}}')
                    ->where('fieldLayoutId=:id', [':id' => $row['layoutId']])
                    ->one();

                // If no valid section ID, bail
                if (!$entryType) {
                    $error = 'Orphaned layout';
                    $data['section'] = '<span class="error">'.$error.'</span>';
                    return $data;
                }

                // Get section
                $section = Craft::$app->getSections()->getSectionById($entryType['sectionId']);

                // Get tab
                $data['tab'] = (new Query())
                    ->select(['name'])
                    ->from('{{%fieldlayouttabs}}')
                    ->where('id=:id', [':id' => $row['tabId']])
                    ->scalar();

                // Set entry layout data
                $data['section']    = ($section ? $section->name : null);
                $data['entryType']  = $entryType['name'];

                // Edit layout
                $editLayoutPath = 'settings/sections/'.$entryType['sectionId'].'/entrytypes/'.$entryType['id'];
                $data['editLayout'] = UrlHelper::cpUrl($editLayoutPath);

                break;

            case 'globalset':

                // Get global set
                $globalSet = (new Query())
                    ->select(['id','name'])
                    ->from('{{%globalsets}}')
                    ->where('fieldLayoutId=:id', [':id' => $row['layoutId']])
                    ->one();

                // Get section
                $data['section'] = ($globalSet ? $globalSet['name'] : null);

                // Get tab
                $data['tab'] = (new Query())
                    ->select(['name'])
                    ->from('{{%fieldlayouttabs}}')
                    ->where('id=:id', [':id' => $row['tabId']])
                    ->scalar();

                // Edit layout
                $editLayoutPath = 'settings/globals/'.$globalSet['id'].'#set-fieldlayout';
                $data['editLayout'] = UrlHelper::cpUrl($editLayoutPath);

                break;

            case 'asset':

                // Get asset source
                $assetSource = (new Query())
                    ->select(['id','name'])
                    ->from('{{%volumes}}')
                    ->where('fieldLayoutId=:id', [':id' => $row['layoutId']])
                    ->one();

                // Get section
                $data['section'] = ($assetSource ? $assetSource['name'] : null);

                // Edit layout
                $editLayoutPath = 'settings/assets/volumes/'.$assetSource['id'].'#assetvolume-fieldlayout';
                $data['editLayout'] = UrlHelper::cpUrl($editLayoutPath);

                break;

            case 'user':

                // Get tab
                $data['tab'] = (new Query())
                    ->select(['name'])
                    ->from('{{%fieldlayouttabs}}')
                    ->where('id=:id', [':id' => $row['tabId']])
                    ->scalar();

                // Edit layout
                $data['editLayout'] = UrlHelper::cpUrl('settings/users/fields');

                break;

            // TODO: Activate other element types

            // case 'category':
            //     $data['section']   = null;
            //     $data['entryType'] = null;
            //     $data['tab']       = null;
            //     break;

            // case 'tag':
            //     $data['section']   = null;
            //     $data['entryType'] = null;
            //     $data['tab']       = null;
            //     break;

            // case 'matrixblock':
            //     $data['section']   = null;
            //     $data['entryType'] = null;
            //     $data['tab']       = null;
            //     break;

            // case 'commerceproduct':
            //     $data['section']   = null;
            //     $data['entryType'] = null;
            //     $data['tab']       = null;
            //     break;

            // case 'commercevariant':
            //     $data['section']   = null;
            //     $data['entryType'] = null;
            //     $data['tab']       = null;
            //     break;

        }

        // Return layout data
        return $data;
    }