Builds nav bar elements

@param array $items

@return string
495197
private function buildMenuItems(array $items)
    {
        $html = '';

        foreach ($items as $item) {

            if ($this->multilevel && $item->hasChilds()) {
                $html .= '
				<li class="navbar-parent">
					<a href="' . $item->getUrl() . '">' . $item->getText() . '</a>
					<ul>';

                $html .= $this->buildMenuItems($item->getChilds());

                $html .= '
					</ul>
				</li>';
            } else {

                $url = $item->getUrl();

                if ($url) {
                    $html .= '<li><a href="' . $url . '">' . $item->getText() . '</a></li>';
                } else {
                    $html .= '<li><a href="#" onClick="return false">' . $item->getText() . '</a></li>';
                }
            }
        }

        return $html;
    }
721318
protected function renderItems($items)
	{
		$script = '';
		foreach ($items as $key => $item)
		{
			if(is_array($item))
			{
				$script = $script."'$key':[";
				foreach ($item as $value)
					$script = $script."'$value',";
				$script = $script."],";
			} else
				$script = $script."'$key':'$item',";
		}
		return $script;
	}
525988
public function append($items)
    {
        return new ResultScan(array_merge($this->buffered()->toArray(), $this->parseItems($items)));
    }
915252
public function _nav_menu_css_class( $classes, $item, $args, $depth ) {
		if ( ! is_object( $args->walker ) ) {
			return $classes;
		}

		if ( ! $args->walker instanceof \Inc2734\WP_Basis\App\Walker\Navbar ) {
			return $classes;
		}

		if ( $depth > 0 ) {
			$classes[] = 'c-navbar__subitem';
		} else {
			$classes[] = 'c-navbar__item';
		}

		$classes = array_unique( $classes );

		return $classes;
	}
606931
public function addMenus(array $items)
    {
        foreach ($items as $item) {
            /// XXX ugly crutch, but no better ideas for the moment
            $config = $item['menu'];
            if (is_array($config) && empty($config['class'])) {
                continue;
            }

            $menu = Yii::createObject($item['menu']);
            $this->addItems($menu->getItems(), isset($item['where']) ? $item['where'] : null);
        }
    }
896809
public function addFooter($items)
    {
        if (! is_array($items)) {
            $items = func_get_args();
        }

        $this->addElement(new Footer($items));

        return $this;
    }
402052
public function renderItems($items)
    {
        $graph = [];

        // loop over subjects
        foreach ($items as $subjectURI => $subjectStatements) {
            $subject = ['@id' => $this->prefixedName($subjectURI)];

            // loop over predicates
            foreach ($subjectStatements as $predicateURI => $objects) {
                // loop over objects
                foreach ($objects as $objectString => $properties) {
                    if (null === $properties) {
                        $object = $this->prefixedName($objectString);
                    } else {
                        $object = ['@value' => $objectString];

                        if ($properties['language']) {
                            $object['@language'] = $properties['language'];
                        }
                        if ($properties['type']) {
                            $object['@type'] = $properties['type'];
                        }
                    }

                    $predicateURI = $this->prefixedName($predicateURI);
                    if ($subject[$predicateURI]) {
                        if (is_array($subject[$predicateURI])) {
                            $subject[$predicateURI][] = $object;
                        } else {
                            $subject[$predicateURI] = [$subject[$predicateURI], $object];
                        }
                    } else {
                        $subject[$predicateURI] = $object;
                    }
                }
            }

            $graph[] = $subject;
        }

        // Add the prefixes as the @context.
        $context = [];
        foreach (array_keys($this->usedPrefixes) as $prefix) {
            if ($this->prefixes[$prefix]) {
                $context[$prefix] = $this->prefixes[$prefix];
            }
        }

        return json_encode([
            '@context' => $context,
            '@graph' => $graph,
        ]);
    }
468839
public function prepare($items = null)
    {
        $items->each(function ($item) {
            $item->items = collect();
            if ($item->has_categories) {
                $item->items = $this->prepare(ProjectCategories::allForMenu($item->page->uri()));
            }
            $item->href = $this->setHref($item);
            $item->class = $this->setClass($item);
        });

        return $items;
    }
105291
public function rawItems(array $items)
    {
        foreach ($items as $uri => $title) {
            list($title, $uri, $liAttr) = $this->fixData($uri, $title);
            $this->rawItem($title, $uri, $liAttr);
        }
        return $this;
    }
151853
public function setItems($items)
    {
        if ($items && !$items instanceof ItemBag) {
            $items = new MulticardsItemBag($items);
        }

        return $this->setParameter('items', $items);
    }
371431
public static function ul( $items, $options = [] ) {
		$tag         = ArrayHelper::remove( $options, 'tag', 'ul');
		$encode      = ArrayHelper::remove( $options, 'encode', FALSE );
		$formatter   = ArrayHelper::remove( $options, 'item');
		$separator   = ArrayHelper::remove( $options, 'separator', "\n");
		$itemOptions = ArrayHelper::remove( $options, 'itemOptions', []);
		$classFor    = ArrayHelper::remove( $itemOptions, 'class_for', null );

		if ( empty( $items ) ) {
			return static::tag( $tag, '', $options );
		}
		$results = [];
		foreach ( $items as $i => $item ) {
			if ( $formatter !== NULL ) {
				$results[] = call_user_func( $formatter, $item, $i );
			} else {
				$_itemOptions = $itemOptions;
				if ( isset( $classFor ) && array_key_exists( $i, $classFor ) ) {
					static::addCssClass( $_itemOptions, $classFor[ $i ] );
				}
				$results[] = static::tag('li', $encode ? static::encode( $item ) : $item, $_itemOptions );
			}
		}

		return static::tag( $tag, $separator . join( $separator, $results ) . $separator, $options );
	}
898357
public static function navList($items, $htmlOptions = array())
    {
        foreach ($items as $i => $itemOptions) {
            if (is_string($itemOptions)) {
                continue;
            }
            if (!isset($itemOptions['url']) && !isset($itemOptions['items'])) {
                $label = TbArray::popValue('label', $itemOptions, '');
                $items[$i] = self::menuHeader($label, $itemOptions);
            }
        }
        return self::nav(self::NAV_TYPE_LIST, $items, $htmlOptions);
    }
461606
public function addContentItems($items = [])
    {
        // Loop on each item.
        collect($items)->each(function ($item) {
            // Add each content to the Container.
            $this->addSingleContentItem($item);
        });

        // Return object.
        return $this;
    }
900010
protected function getArrayItems($items)
    {
        if (is_array($items)) {
            return $items;
        } elseif ($items instanceof self) {
            return $items->all();
        }

        return (array) $items;
    }
1286313
public static function toResults(array $items) {

        $output = [];

        foreach ($items as $current) {

            if (false === ($current instanceof Select2ItemInterface)) {
                throw new InvalidArgumentException("The item must implements Select2ItemInterface");
            }

            $output[] = [
                "id"   => $current->getSelect2ItemId(),
                "text" => $current->getSelect2ItemText(),
            ];
        }

        return $output;
    }
677264
public function menu($items, $default = null, $title = 'Choose an item')
    {
        if (isset($items[$default]) && strpos($title, '[') === false) {
            $title .= ' [default: ' . $items[$default] . ']';
        }

        $this->line(sprintf('%s: ', $title));

        $i = 1;
        $keys = array();

        foreach ($items as $key => $item) {
            $keys[$i] = $key;
            $this->line(sprintf('  %d. %s', $i, $item));
            $i++;
        }

        $selected = $this->in();

        if ($selected === '') {
            return $default;
        }

        if (isset($keys[$selected])) {
            return $keys[$selected];
        }

        return $selected;
    }
619273
protected function _render($items, $depth = 0)
    {
        $content = '';
        $formatter = $this->config('formatter');

        foreach ($items as $item) {
            $children = '';
            if (is_array($item)) {
                $item = new Entity($item);
            }

            if ($item->has('children') && !empty($item->children) && $item->expanded) {
                $children = $this->formatTemplate('parent', [
                    'attrs' => $this->templater()->formatAttributes([
                        'class' => ($this->config('dropdown') ? 'dropdown-menu multi-level' : ''),
                        'role' => 'menu'
                    ]),
                    'content' => $this->_render($item->children, $depth + 1)
                ]);
            }

            $this->_index++;
            $info = [
                'index' => $this->_index,
                'total' => $this->_count,
                'active' => $this->Link->isActive($item),
                'depth' => $depth,
                'hasChildren' => !empty($children),
                'children' => $children,
            ];
            $content .= $formatter($item, $info);
        }

        return $content;
    }