<commit_before><?php

/*
 * See docs/AUTHORS and docs/COPYRIGHT for relevant info.
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * @author <NAME> <<EMAIL>>
 *
 * @license http://opensource.org/licenses/lgpl-3.0.html
 */

namespace properties\Factory;

class NavBar
{

    public static $items;
    public static $options;

    public static function view()
    {
        $auth = \Current_User::getAuthorization();

        $vars['logged'] = \Current_User::isLogged();
        $vars['admin'] = \Current_User::allow('properties');

        $vars['items'] = null;
        $vars['options'] = null;
        if (!empty(self::$items)) {
            $vars['items'] = implode('&nbsp;', self::$items);
        }
        
        if (!empty(self::$options)) {
            $vars['options'] = implode('</li><li>', self::$options);
        }

        $vars['is_deity'] = \Current_User::isDeity();
        $vars['logout_uri'] = $auth->logout_link;
        $vars['username'] = \Current_User::getDisplayName();
        $vars['home'] = \Server::getSiteUrl();
        $template = new \phpws2\Template($vars);
        $template->setModuleTemplate('properties', 'navbar.html');
        $content = $template->get();
<commit_msg>Items imported into template as an array instead of imploded.<commit_after><?php

/*
 * See docs/AUTHORS and docs/COPYRIGHT for relevant info.
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * @author <NAME> <<EMAIL>>
 *
 * @license http://opensource.org/licenses/lgpl-3.0.html
 */

namespace properties\Factory;

class NavBar
{

    public static $items;
    public static $options;

    public static function view()
    {
        $auth = \Current_User::getAuthorization();

        $vars['logged'] = \Current_User::isLogged();
        $vars['admin'] = \Current_User::allow('properties');

        $vars['items'] = null;
        $vars['options'] = null;
        if (!empty(self::$items)) {
            $vars['items'] = self::$items;
        }
        
        if (!empty(self::$options)) {
            $vars['options'] = implode('</li><li>', self::$options);
        }

        $vars['is_deity'] = \Current_User::isDeity();
        $vars['logout_uri'] = $auth->logout_link;
        $vars['username'] = \Current_User::getDisplayName();
        $vars['home'] = \Server::getSiteUrl();
        $template = new \phpws2\Template($vars);
        $template->setModuleTemplate('properties', 'navbar.html');
        $content = $template->get();

{'fraction_non_alphanumeric': 0.14743390357698288, 'fraction_numerical': 0.002488335925349922, 'mean_word_length': 3.030075187969925, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2815894', 'n_tokens_mistral': 920, 'n_tokens_neox': 913, 'n_words': 268}