Elements to display when outputting, e.g., to DOT file
@return Iterable
516481
@Override
    public scala.collection.Iterable<String> displayableElements() {
        LinkedList<String> elements = new LinkedList<>();
        if (geographicalLocation.nonEmpty()) {
            elements.add("Lat=" + geographicalLocation.get()._1());
            elements.add("Long=" + geographicalLocation.get()._2());
        }
        if (isSecret.nonEmpty() && isSecret.get()) {
            elements.add("IsSecret=True");
        }

        // Also possible to build a Scala collection directly in Java code, but building in Java and converting at
        // the very end is probably easier for Java developers than having to figure out the Scala collection classes
        // and deal with the annoying Java-interop syntax, e.g., to rewrite the Scala code "myArray += valToInsert" in
        // Java would look like "myArray.$plus$eq(valToInsert);", which we'd rather avoid.

        return linkedListToScalaIterable(elements);
    }
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;
    }
670
public function outputElement() : string
    {
        $selected = explode(',', $this->getValue());
        $disabled = $this->disabled;
        $hidden = $this->hidden;

        $return = '<div class="checkboxgroup">';
        foreach ($this->options as $val=>$txt) {
            if (in_array($val, $hidden)) {
                break;
            }
            $d = (in_array($val, $disabled)) ? ' disabled="disabled"' : '';
            $s = (in_array($val, $selected)) ? ' checked="checked"' : '';
            $return .= '<div><input id="cb-' . $val . '" type="checkbox" name="' . $this->attributes['name'] . '[]" value="' . $val . '" ' . $d . $s . ' /> <label class="cblabel" for="cb-' . $val . '">' . $txt . "</label></div>\n";
        }
        $return .= '</div>';

        return $return;
    }
625179
public function getTocs()
    {
        $tocs = array();

        $nodes = $this->getNodes(function($node) {
            return $node instanceof TocNode;
        });

        foreach ($nodes as $toc) {
            $files = $toc->getFiles();

            foreach ($files as &$file) {
                $file = $this->environment->canonicalUrl($file);
            }

            $tocs[] = $files;
        }

        return $tocs;
    }
653769
public function format(array $output): iterable
    {
        $previousLineType = self::LINE_TYPE_START;
        // for each line of the output
        for ($i = 0, $length = count($output); $i < $length; $i++) {
            $line = $output[$i];
            // depending on the previous line type
            // check for all possible following line types and handle it
            foreach (self::$lineTypesToCheck[$previousLineType] as $typeToCheck) {
                $call = 'is' . $typeToCheck . 'Line';
                // if the line type could be matched
                if ($this->$call($line)) {
                    // remember the line type
                    $previousLineType = $typeToCheck;
                    break;
                }
            }
        }
        $this->appendCollectedFileAndChanges();

        return $this->files;
    }
715422
private function tableRows()
    {
        $output = [];

        $filesContent = [];

        foreach ($this->files as $languageKey => $file) {
            foreach ($filesContent[$languageKey] = Arr::dot($this->manager->getFileContent($file)) as $key => $value) {
                if (! $this->shouldShowKey($key)) {
                    continue;
                }

                $output[$key]['key'] = $key;
                $output[$key][$languageKey] = $value ?: '';
            }
        }

        // Now that we have collected all existing values, we are going to fill the
        // missing ones with emptiness indicators to balance the table structure
        // and alert developers so that they can take proper actions.
        foreach ($output as $key => $values) {
            $original = [];

            foreach ($this->languages as $languageKey) {
                $original[$languageKey] = isset($values[$languageKey]) && $values[$languageKey]
                    ? $values[$languageKey]
                    : '<bg=red>  MISSING  </>';
            }

            // Sort the language values based on language name
            ksort($original);

            $output[$key] = array_merge(['key' => "<fg=yellow>$key</>"], $original);
        }

        return array_values($output);
    }
740325
public function renderElements()
    {
        if ($this->isSelfClosing) {
            return '';
        }

        $html = '';

        foreach ($this->elements as $element) {
            $html .= $element;
        }

        return $html;
    }
335234
public function getIterator()
    {
        $elements = new NodeList();
        if ($this->node->hasChildNodes()) {
            foreach ($this->node->childNodes as $node) {
                $elements[] = new Element($node);
            }
        }

        return $elements;
    }
1144201
public function outputAr()
    {
        $aOut = [];

        foreach ($this->aEntries as $aEntry) {

            $sTemp = !empty($aEntry['tag']) ? '<' . $aEntry['tag'] . ' ' : '<meta ';
            unset($aEntry['tag']);
            foreach ($aEntry as $sKey => $sValue) {

                $sTemp .= $sKey . '="' . $sValue . '" ';
            }
            $sTemp  = trim($sTemp) . '>';
            $aOut[] = $sTemp;
        }

        return $aOut;
    }
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));
    }
132390
private function getOutput()
    {
        $output = "# Todo list\n\n";

        // Make menu
        $columns = 12;

        $captions = implode('|', array_fill(0, $columns, ' '));
        $subcaptions = implode('|', array_fill(0, $columns, ':---:'));

        $output .= "|$captions|\n";
        $output .= "|$subcaptions|\n";

        $menu = [];
        foreach (array_keys($this->output) as $language) {
            $menu[] = "[$language](#$language)";
        }

        $rows = array_chunk($menu, $columns);
        array_map(function ($row) use (&$output) {
            $row = implode(' | ', $row);
            $output .= $row."\n";
        }, $rows);

        $output .= "\n\n";

        // Make items
        foreach ($this->output as $language => $values) {
            $output .= "#### {$language}:\n";
            $output .= implode(PHP_EOL, $values);
            $output .= "\n\n[ [to top](#todo-list) ]\n\n";
        }

        return $output;
    }
636977
public function buildHtml()
	{
		$list	= array();
		$divs	= array();
		foreach( $this->steps as $nr => $step )
		{
			$id		= $this->id."_link".$nr;
			$list[]	= UI_HTML_Elements::ListItem( $step['label'], 0, array( 'id' => $id ) );
			$id		= $this->id."_".$nr;
			$divs[] = UI_HTML_Tag::create( 'div', $step['content'], array( 'id' => $id ) );
		}
		$list	= UI_HTML_Elements::unorderedList( $list );
		$divs	= implode( "\n", $divs );
		$div	= UI_HTML_Tag::create( 'div', "\n".$list.$divs."\n", array( 'id' => $this->id ) );
		return $div;
	}
1024252
public static function objects()
    {
        //====================================================================//
        // Check if Object Manager is Overriden
        if (self::local() instanceof ObjectsProviderInterface) {
            return self::local()->objects();
        }
        $objectsList = array();
        //====================================================================//
        // Safety Check => Verify Objects Folder Exists
        $path = self::getLocalPath().'/Objects';
        if (!is_dir($path)) {
            return $objectsList;
        }
        //====================================================================//
        // Scan Local Objects Folder
        $scan = scandir($path, 1);
        if (false == $scan) {
            return $objectsList;
        }
        //====================================================================//
        // Scan Each File in Folder
        $files = array_diff($scan, array('..', '.', 'index.php', 'index.html'));
        foreach ($files as $filename) {
            //====================================================================//
            // Verify Filename is a File (Not a Directory)
            if (!is_file($path.'/'.$filename)) {
                continue;
            }
            //====================================================================//
            // Extract Class Name
            $className = pathinfo($path.'/'.$filename, PATHINFO_FILENAME);
            //====================================================================//
            // Verify ClassName is a Valid Object File
            if (false == self::validate()->isValidObject($className)) {
                continue;
            }
            $objectsList[] = $className;
        }

        return $objectsList;
    }
826190
protected function get_iterator() {
        global $DB;

        // Build the SQL dynamically here
        $fieldslist = 't.' . implode(', t.', $this->fields);
        $sql = "SELECT t.id, $fieldslist
                  FROM {" . $this->tablename . "} t
                  JOIN {backup_ids_temp} b ON b.newitemid = t.id
                 WHERE b.backupid = ?
                   AND b.itemname = ?
                   AND t.blockname = 'html'";
        $params = array($this->restoreid, $this->mapping);
        return ($DB->get_recordset_sql($sql, $params));
    }
340408
public function renderElements()
    {
        $returnValue = '';


		foreach($this->elements as $element){

			 if($this->getElementGroup($element->getName()) !== ''){
			 	continue;	//render grouped elements after
			 }

			 if(!is_null($this->getDecorator()) && !($element instanceof tao_helpers_form_elements_Hidden)){
			 	$returnValue .= $this->getDecorator()->preRender();
			 }

             if(!$this->isValid() && $element->getError()) {
                $element->addClass('error');
             }

			 //render element
			 $returnValue .= $element->render();

			 //render element help
			 $help = trim($element->getHelp());
			 if(!empty($help)){
				 if(!is_null($this->getDecorator('help'))){
			 		$returnValue .= $this->getDecorator('help')->preRender();
			 	}

			 	$returnValue .= $help;

				if(!is_null($this->getDecorator('help'))){
			 		$returnValue .= $this->getDecorator('help')->postRender();
			 	}
			 }

			 //render error message
			 if(!$this->isValid() && $element->getError()){
			 	if(!is_null($this->getDecorator('error'))){
			 		$returnValue .= $this->getDecorator('error')->preRender();
			 	}

			 	$returnValue .= nl2br($element->getError());

				if(!is_null($this->getDecorator('error'))){
			 		$returnValue .= $this->getDecorator('error')->postRender();
			 	}
			 }

			 if(!is_null($this->getDecorator()) && !($element instanceof tao_helpers_form_elements_Hidden)){
			 	$returnValue .= $this->getDecorator()->postRender();
			 }
		}

		$subGroupDecorator = null;
		if(!is_null($this->getDecorator('group'))){
			$decoratorClass = get_class($this->getDecorator('group'));
			$subGroupDecorator = new $decoratorClass();
		}

		//render group
		foreach($this->groups as $groupName => $group){

			if(!is_null($this->getDecorator('group'))){
				$this->getDecorator('group')->setOption('id', $groupName);
				if(isset($group['options'])){
					if(isset($group['options']['class'])){
						$currentClasses = array_map('trim', explode(' ',$this->getDecorator('group')->getOption('cssClass')));
						if(!in_array($group['options']['class'], $currentClasses)){
							$currentClasses[] = $group['options']['class'];
							$this->getDecorator('group')->setOption('cssClass', implode(' ', array_unique($currentClasses)));
						}
					}
				}
				$returnValue .= $this->getDecorator('group')->preRender();
			}
			$returnValue .= $group['title'];
			if(!is_null($subGroupDecorator)){
				$returnValue .= $subGroupDecorator->preRender();
			}
			foreach($group['elements'] as $elementName){
				 if($this->getElementGroup($elementName) === $groupName && $element = $this->getElement( $elementName )){

				 	if(!is_null($this->getDecorator())){// && !($element instanceof tao_helpers_form_elements_Hidden) ){

					 	$returnValue .= $this->getDecorator()->preRender();
					 }

					 //render element
                     if ( ! $this->isValid() && $element->getError()) {
                         $element->addClass( 'error' );
                     }
					 $returnValue .= $element->render();

					 //render element help
					 $help = trim($element->getHelp());
					 if(!empty($help)){
						 if(!is_null($this->getDecorator('help'))){
					 		$returnValue .= $this->getDecorator('help')->preRender();
					 	}

					 	$returnValue .= $help;

						if(!is_null($this->getDecorator('help'))){
					 		$returnValue .= $this->getDecorator('help')->postRender();
					 	}
					 }

					 //render error message
					 if(!$this->isValid() && $element->getError()){
					 	if(!is_null($this->getDecorator('error'))){
					 		$returnValue .= $this->getDecorator('error')->preRender();
					 	}
					 	$returnValue .= nl2br($element->getError());
						if(!is_null($this->getDecorator('error'))){
					 		$returnValue .= $this->getDecorator('error')->postRender();
					 	}
					 }

					 if(!is_null($this->getDecorator())){// && !($element instanceof tao_helpers_form_elements_Hidden) ){
					 	$returnValue .= $this->getDecorator()->postRender();
					 }
				 }
			}
			if(!is_null($subGroupDecorator)){
				$returnValue .= $subGroupDecorator->postRender();
			}
			if(!is_null($this->getDecorator('group'))){
				$returnValue .= $this->getDecorator('group')->postRender();
				$this->getDecorator('group')->setOption('id', '');
			}
		}


        return $returnValue;
    }
18438
public function toString()
    {
        $output = [];
        $output[] = '<table' . $this->renderAttributes($this->getTableAttributes()) . '>';

        if (count($this->specialRows['header'])) {
            $output[] = $this->renderArea($this->specialRows['header'], 'thead', 'th');
        }

        $ids = array_diff(
            array_keys($this->rows),
            array_merge($this->specialRows['header'], $this->specialRows['footer'])
        );

        if (count($ids)) {
            $output[] = $this->renderArea($ids);
        }

        if (count($this->specialRows['footer'])) {
            $output[] = $this->renderArea($this->specialRows['footer'], 'tfoot');
        }

        $output[] = '</table>';

        return implode('', $output);
    }
690380
public function idArray() {
        $data = [];
        foreach ($this->getElements() as $item) $data[] = $item->id;       
        return $data;
    }