creates formatted output for calendar component property completed

@author Kjell-Inge Gustafsson <ical@kigkonsult.se>
@since 0.9.7 - 2006-11-20
@return string
555345
function createCompleted( ) {
    if( !isset( $this->completed['value']['year'] )  &&
        !isset( $this->completed['value']['month'] ) &&
        !isset( $this->completed['value']['day'] )   &&
        !isset( $this->completed['value']['hour'] )  &&
        !isset( $this->completed['value']['min'] )   &&
        !isset( $this->completed['value']['sec'] ))
      return;
    $formatted  = $this->_format_date_time( $this->completed['value'], 7 );
    $attributes = $this->_createParams( $this->completed['params'] );
    return $this->_createElement( 'COMPLETED', $attributes, $formatted );
  }
858089
function createComponent( &$xcaldecl ) {
    $objectname    = $this->_createFormat();
    $component     = $this->componentStart1.$objectname.$this->componentStart2.$this->nl;
    $component    .= $this->createUid();
    $component    .= $this->createDtstamp();
    $component    .= $this->createAttach();
    $component    .= $this->createAttendee();
    $component    .= $this->createCategories();
    $component    .= $this->createClass();
    $component    .= $this->createComment();
    $component    .= $this->createCompleted();
    $component    .= $this->createContact();
    $component    .= $this->createCreated();
    $component    .= $this->createDescription();
    $component    .= $this->createDtstart();
    $component    .= $this->createDue();
    $component    .= $this->createDuration();
    $component    .= $this->createExdate();
    $component    .= $this->createExrule();
    $component    .= $this->createGeo();
    $component    .= $this->createLastModified();
    $component    .= $this->createLocation();
    $component    .= $this->createOrganizer();
    $component    .= $this->createPercentComplete();
    $component    .= $this->createPriority();
    $component    .= $this->createRdate();
    $component    .= $this->createRelatedTo();
    $component    .= $this->createRequestStatus();
    $component    .= $this->createRecurrenceid();
    $component    .= $this->createResources();
    $component    .= $this->createRrule();
    $component    .= $this->createSequence();
    $component    .= $this->createStatus();
    $component    .= $this->createSummary();
    $component    .= $this->createUrl();
    $component    .= $this->createXprop();
    if( $this->nl != substr( $component, ( 0 - strlen( $this->nl ))))
      $component  .= $this->nl;
    $component    .= $this->createSubComponent();
    $component    .= $this->componentEnd1.$objectname.$this->componentEnd2;
    if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) {
      foreach( $this->xcaldecl as $localxcaldecl )
        $xcaldecl[] = $localxcaldecl;
    }
    return $component;
  }
758305
protected function buildFrom()
    {
        if (!$this->from) {
            return '';
        }

        $refs = array();
        foreach ($this->from as $from) {
            $refs[] = implode(' ', $from);
        }
        return ' FROM' . $this->indentCsv($refs);
    }
770472
protected function createOutputContents()
    {
        $formattedItems = $this->formatterInstance()->format($this->rows);

        $ret = array();
        foreach ($formattedItems as $label => $value) {
            $ret[] = $label . ':' . $value;
        }

        return join("\t", $ret) . $this->EOL;
    }
1282414
public function toString()
    {
        if ($this->isEmpty()) {
            return '';
        }

        $traitNames = $this->toArray();
        $tabulationFormatted = $this->getTabulationFormatted();

        $compositionMethods = ';' . PHP_EOL;
        if (!$this->getMethods()->isEmpty()) {
            $compositionMethods = ' ' . $this->getMethods()->toString();
        }

        return $tabulationFormatted . 'use ' . implode(', ', $traitNames) . $compositionMethods;
    }
18498
public function output()
    {
        $data = [
            'classes' => [],
            'files'   => [],
        ];
        foreach ($this->processed as $type => $classes) {
            foreach ($classes as $name => $values) {
                $covered = $values['covered'];
                $total   = $values['total'];
                $pct     = (((int) $covered / (int) $total) * 100);

                $covered    = str_pad((string) $covered, 7, ' ', STR_PAD_LEFT);
                $total      = str_pad((string) $total, 5, ' ', STR_PAD_LEFT);
                $percentage = number_format($pct, 2).'%';
                $percentage = str_pad((string) $percentage, 10, ' ', STR_PAD_LEFT);

                if ($pct < 25) {
                    $covered    = $this->output->red($covered);
                    $total      = $this->output->red($total);
                    $percentage = $this->output->red($percentage);
                }

                if ($pct < 75) {
                    $covered    = $this->output->black->yellow($covered);
                    $total      = $this->output->black->yellow($total);
                    $percentage = $this->output->black->yellow($percentage);
                }

                if ($pct >= 75) {
                    $covered    = $this->output->green($covered);
                    $total      = $this->output->green($total);
                    $percentage = $this->output->green($percentage);
                }

                $data[$type][] = [$name, $covered, $total, $percentage];
            }
        }

        $out = [];
        if (count($data['classes']) > 0) {
            array_unshift($data['classes'], ['Class', 'Covered', 'Lines', 'Percentage']);

            $out[] = new Table($data['classes'], [
                'headerColor'     => Graphite::YELLOW,
                'columnSeparator' => '',
                'headerSeparator' => '',
                'cellPadding'     => 1,
            ]);
        }

        if (count($data['files']) > 0) {
            array_unshift($data['files'], ['File', 'Covered', 'Lines', 'Percentage']);

            $out[] = new Table($data['files'], [
                'headerColor'     => Graphite::YELLOW,
                'columnSeparator' => '',
                'headerSeparator' => '',
                'cellPadding'     => 1,
            ]);
        }

        return $this->output->render(implode("\n\n", $out));
    }
530350
public function getHeaderRowHTML()
    {
        $output = [];
        foreach ($this->columns as $name => $column) {

            // If multiple formatters are defined, use the first for the header cell
            if (is_array($column)) {
                $column = $column[0];
            }

            if (!is_int($name)) {
                $field = $this->model->getElement($name);

                $output[] = $column->getHeaderCellHTML($field);
            } else {
                $output[] = $column->getHeaderCellHTML();
            }
        }

        return implode('', $output);
    }
113314
protected function output()
    {
        $content = $this->getContentRaw();
        $result  = '';

        // Iterate log content
        foreach ($content as $logEntry) {
            // Build the final log entry
            $result .= $logEntry['time'].' '.
                '['.$logEntry['type'].'] '.
                $logEntry['fingerprint'].' '.
                $logEntry['message'].
                $this->lineBreak.$this->getLineSeparator().$this->lineBreak;
        }

        // so we can clear the existing log
        $this->clearContent();

        return $result;
    }
932857
public function completed_at_datetimepicker()
    {
        if ($this->wrappedObject->completed_at) {
            return $this->dates->make($this->wrappedObject->completed_at)->format('Y-m-d H:i');
        }
    }
876364
public function getFormatted()
    {
        if ($this->getUnit() != "") {
            return $this->getValue() . " " . $this->getUnit();
        } else {
            return (string)$this->getValue();
        }
    }
715339
public function getFinished()
    {
        $rtn    = $this->data['finished'];

        if (!empty($rtn)) {
            $rtn    = new \DateTime($rtn);
        }
        
        return $rtn;
    }
883188
public function getTotalsRowHTML()
    {
        $output = [];
        foreach ($this->columns as $name => $column) {
            // if no totals plan, then show dash, but keep column formatting
            if (!isset($this->totals_plan[$name])) {
                $output[] = $column->getTag('foot', '-');
                continue;
            }

            // if totals plan is set as array, then show formatted value
            if (is_array($this->totals_plan[$name])) {
                // todo - format
                $field = $this->model->getElement($name);
                $output[] = $column->getTotalsCellHTML($field, $this->totals[$name]);
                continue;
            }

            // otherwise just show it, for example, "Totals:" cell
            $output[] = $column->getTag('foot', $this->totals_plan[$name]);
        }

        return implode('', $output);
    }
503637
public function generate()
    {
        $code = array();

        $doc = $this->generateDocumentation();
        if ($doc !== null) {
            $code[] = $doc;
        }

        $propertyCode = $this->getIndentation() . $this->getVisibility() . ' ';
        if ($this->isStatic() === true) {
            $propertyCode .= 'static ';
        }

        $propertyCode .= '$' . $this->name;

        if ($this->defaultValue !== null && $this->defaultValue->getValue() !== null) {
            $propertyCode .= ' = ' . $this->defaultValue . ';';
        } else {
            $propertyCode .= ';';
        }

        $code[] = $propertyCode;

        return implode($this->getLineFeed(), $code);
    }
741008
public function getOutput() {
		// assign template and frame_template to page
		$this->_content['page']['template'] = $this->template;

		if (!is_dir($this->compile_path)) mkdir($this->compile_path, 0777, true); // create temp dir if it does not exist

		// init serpent
		$_engine = new \McSodbrenner\Serpent\Serpent($this->compile_path, 'utf-8', $this->force_compile);

		// handle mappings
		$mappings = [
			'dump'			=> '\\Morrow\\Debug::dump',
			'url'			=> '\\Morrow\\Factory::load("Url")->create',
			'securl'		=> '\\Morrow\\Factory::load("Security")->createCSRFUrl',
			'cycle'			=> '\\Morrow\\Views\\Serpent::cycle',
			'mailto'		=> '\\Morrow\\Views\\Serpent::mailto',
			'hidelink'		=> '\\Morrow\\Views\\Serpent::hidelink',
			'thumb'			=> '\\Morrow\\Views\\Serpent::thumb',
			'fileurl'		=> '\\Morrow\\Views\\Serpent::fileurl',
			'truncate'		=> '\\Morrow\\Views\\Serpent::truncate',
			'strip'			=> 'ob_start(["\\Morrow\\Views\\Serpent::strip"]) //',
			'endstrip'		=> 'ob_end_flush',
			'loremipsum'	=> '\\Morrow\\Views\\Serpent::loremipsum',
			'_'				=> '\\Morrow\\Factory::load("Language")->_',
			'module'		=> 'stream_get_contents(\\Morrow\\Factory::load("Core\\Feature")->run',
		];
		// add user mappings
		foreach ($this->mappings as $key => $value) {
			$mappings[$key] = $value;
		}

		$_engine->addMappings($mappings);

		// handle resources
		$_engine->addResource('file',
			new \McSodbrenner\Serpent\ResourceFile($this->template_path, $this->template_suffix, Factory::load('Language')->get())
		);

		foreach ($this->resources as $resource) {
			call_user_func_array([$_engine, 'addResource'], $resource);
		}

		// create stream handle for the output
		$handle = fopen('php://temp/maxmemory:'.(1*1024*1024), 'r+'); // 1MB


		// write source to stream
		$_engine->pass($this->_content);
		fwrite($handle, $_engine->render($this->template));

		return $handle;
	}
1027828
protected function output()
    {
        if ($this->bottomIcon === null) {
            $this->bottomIcon = '';
            //throw new IncompleteStackException();
        }

        $stackClasses = 'fa-stack';

        if (count($this->classes) > 0) {
            $stackClasses .= ' ' . implode(' ', $this->classes);
        }

        return sprintf(self::STACK_HTML, $stackClasses, $this->topIcon, $this->bottomIcon);
    }
429470
protected function generateOutput() {
        $flashMessages = [];
        foreach ($this->messages as $messageItem) {
            /** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
            $flashMessages[] = GeneralUtility::makeInstance(FlashMessage::class, $messageItem[2], $messageItem[1], $messageItem[0]);
        }

            /** @var $resolver FlashMessageRendererResolver */
        $resolver = GeneralUtility::makeInstance(FlashMessageRendererResolver::class);
        $renderer = $resolver->resolve();
        return $renderer->render($flashMessages);
    }
570952
protected function getFormResultClass()
    {
        $result = '';
        $formObject = $this->formService->getFormObject();

        if ($formObject->formWasSubmitted()
            && $formObject->hasFormResult()
        ) {
            $fieldResult = $formObject->getFormResult()->forProperty($this->fieldName);
            $result = $this->getPropertyResultClass($fieldResult);
        }

        return $result;
    }