Generate an ordered list of items.

@param  array   $list
@param  array   $attributes
@return string
974549
public static function ol($list, $attributes = array())
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        return call_user_func_array(array($html, __FUNCTION__), $args);
    }
1358382
protected function mapEntityList(array $list, $rowElementName = null)
    {
        if (is_null($rowElementName)) {
            $rowElementName = 'row';
        }
        $xml = '';
        $no = 1;
        foreach ($list as $element) {
            $xml .= '<' . $rowElementName . ' no="' . $no++ . '">';
            $xml .= $this->mapSingleEntity($element);
            $xml .= "</$rowElementName>";
        }

        return $xml;
    }
302760
protected function prepareListLanguage(array &$list)
    {
        foreach ($list as $id => &$item) {
            $item['file_exists'] = is_file($this->translation->getFile($id));
        }
    }
956219
public static function ListItem( $content, $level = 0, $attributes = array() )
	{
		$depth	= 2 * abs( (int) $level ) + 1;
		$indent	= str_repeat( "  ", $depth );
		$tag	= UI_HTML_Tag::create( "li", $content, $attributes );
		$code	= $indent.$tag;
		return $code;
	}
1160570
public function writeAutoload( array $list ) {

    $file = Autoload::FILE;
    if( is_dir( dirname( $file ) ) || mkdir( dirname( $file ), 0777, true ) ) {

      //
      uksort( $list, function ( $a, $b ) {
        return strlen( $b ) - strlen( $a );
      } );

      //
      $content = [];
      foreach( $list as $namespace => $path ) {

        // detect if the path can be relative (then remove the root)
        $is_absolute = substr( $path, 0, strlen( $this->root ) ) != $this->root;
        if( !$is_absolute ) $path = substr( $path, strlen( $this->root ) );

        $count     = substr_count( $namespace, '\\' );
        $namespace = str_replace( [ '\\', "'" ], [ '\\\\', "\\'" ], $namespace );
        $path      = str_replace( [ '\\', "'" ], [ '\\\\', "\\'" ], $path );

        $prefix    = $is_absolute ? "'" : "__DIR__ . '/../";
        $content[] = "  '{$namespace}' => [ {$prefix}{$path}', {$count} ]";
      }

      // 
      file_put_contents( $file, "<?php return [\n" . implode( ",\n", $content ) . "\n];\n" );

      // invalidate opcache
      if( function_exists( 'opcache_invalidate' ) ) {
        opcache_invalidate( $file, true );
      }
    }
  }
735360
protected function prepareListOrderAccount(array &$list)
    {
        foreach ($list as &$item) {
            $this->setItemTotalFormatted($item, $this->price);
            $this->setItemOrderAddress($item, $this->address);
            $this->setItemOrderStoreName($item, $this->store);
            $this->setItemOrderStatusName($item, $this->order);
            $this->setItemOrderPaymentName($item, $this->payment);
            $this->setItemOrderShippingName($item, $this->shipping);
        }
    }
1131069
protected function prepareList(array $list)
    {
        foreach ($list as &$item) {
            if (!empty($item['data']['conditions'])) {
                gplcart_array_sort($item['data']['conditions']);
            }
        }

        return $list;
    }
367698
private static function __s_list2($list)
    {
        $structure = new Structure(Structure::TYPE_LIST, '-', Structure::FOUR_SPACE_TAB);

        return static::buildStructure($list, $structure);
    }
222589
public function ul($list, $attr = null)
    {
        $out = $this->tag('ul', $attr);

        if (! empty($list) && is_array($list)) {
            $out .= $this->processList($list);
        }

        $out .= $this->tag('/ul');

        return $out;
    }
164168
protected function prepareListFieldValue(array &$list)
    {
        foreach ($list as &$item) {
            $this->setItemThumb($item, $this->image, array('placeholder' => false));
        }
    }
731954
protected function _formatAttributes(array $attributes, ItemInterface $item)
    {
        if (!empty($attributes)) {
            return $this->templater()->formatAttributes(
                $attributes + ['escape' => $item->getExtra('escape', true)]
            );
        }

        return '';
    }
651956
static public function listSortForMany($list, $orderBy)
    {
        if (!is_array($list) || !$orderBy) {
            return $list;
        }

        if (is_string($orderBy)) {
            $orderBy = explode(',',$orderBy);
        }

        list($key,$sort) = explode(' ',reset($orderBy));

        $arr = [];
        foreach ($list as $row) {
            $arr[$row[$key]][] = $row;
        }

        if ($sort == "desc") {
            krsort($arr);
        }else{
            ksort($arr);
        }

        array_shift($orderBy);

        if (!empty($orderBy)) {
            foreach ($arr as &$row) {
                $row = self::listSortForMany($row,$orderBy);
            }
        }

        return (count($arr) >= 1) ? array_merge(...array_values($arr)) : $arr;
    }
690486
protected function prepareListReportEvent(array &$list)
    {
        foreach ($list as &$item) {

            $variables = array();

            if (!empty($item['data']['variables'])) {
                $variables = $item['data']['variables'];
            }

            $item['created'] = $this->date($item['created']);

            $type = "event_{$item['type']}";
            $item['type'] = $this->text($type);

            if (!empty($item['translatable'])) {
                $item['text'] = $this->text($item['text'], $variables);
            }

            $item['summary'] = $this->truncate($item['text']);
            $item['severity_text'] = $this->text($item['severity']);
        }
    }
1082304
public static function createAttributes($attributes = [])
    {
        $list = [];

        foreach ($attributes as $key => $value)
        {
            $list[] = sprintf('%s="%s"', $key, is_array($value) ? implode(' ', $value) : $value);
        }

        return implode(' ', $list);
    }
795570
protected function listifyAttr($array) {
        ksort($array);
        $list = array();
        foreach ($array as $name => $obj) {
            if ($obj === false) continue;
            $list[] = "$name&nbsp;=&nbsp;<i>" . $this->getClass($obj, 'AttrDef_') . '</i>';
        }
        return $this->listify($list);
    }
277233
public static function arrayToAttributes(array $attributes)
	{
		//Build a list of single attributes first
		$attributeList = array();

		foreach ( $attributes as $key => $value )
		{
			// If the value is not false add the attribute. This allows attributes to not be shown.
			if ( $value !== false )
			{
				if ( is_string($key) )
				{
					$attributeList[] = htmlspecialchars($key) . '="' . htmlspecialchars($value) . '"';
				}
				else
				{
					$attributeList[] = $value;
				}
			}
		}

		return implode(' ', $attributeList);
	}
15106
protected function generate_list($listitems) {
        $list = "";
        $current_depth = 1;
        $next_depth = 1;
        $liststack = array();
        for ($lc = 0; $lc < count($listitems) && $next_depth; $lc++) {
            $cli = $listitems[$lc];
            $nli = isset($listitems[$lc + 1]) ? $listitems[$lc + 1] : null;

            $text = $cli[1];

            $current_depth = $next_depth;
            $next_depth = $nli ? $nli[0] : null;

            if ($next_depth == $current_depth || $next_depth == null) {
                $list .= parser_utils::h('li', $text) . "\n";
            } else if ($next_depth > $current_depth) {
                $next_depth = $current_depth + 1;

                $list .= "<li>" . $text . "\n";
                $list .= "<" . $nli[2] . ">" . "\n";
                $liststack[] = $nli[2];
            } else {
                $list .= parser_utils::h('li', $text) . "\n";

                for ($lv = $next_depth; $lv < $current_depth; $lv++) {
                    $type = array_pop($liststack);
                    $list .= "</$type>" . "\n" . "</li>" . "\n";
                }
            }
        }

        for ($lv = 1; $lv < $current_depth; $lv++) {
            $type = array_pop($liststack);
            $list .= "</$type>" . "\n" . "</li>" . "\n";
        }

        return $list;
    }