<commit_before><?php

namespace Frontend\Core\Engine;

/*
 * This file is part of Fork CMS.
 *
 * For the full copyright and license information, please view the license
 * file that was distributed with this source code.
 */

use Frontend\Core\Language\Language;
use Symfony\Component\HttpKernel\KernelInterface;
use Backend\Modules\Pages\Engine\Model as BackendPagesModel;
use Frontend\Core\Engine\Base\Object as FrontendBaseObject;
use Frontend\Core\Engine\Model as FrontendModel;
use Frontend\Modules\Profiles\Engine\Authentication as FrontendAuthentication;

/**
 * This class will be used to build the navigation
 */
class Navigation extends FrontendBaseObject
{
    /**
     * The excluded page ids. These will not be shown in the menu.
     *
     * @var array
     */
    private static $excludedPageIds = [];

    /**
     * The selected pageIds
     *
     * @var array
     */
    private static $selectedPageIds = [];

    public function __construct(KernelInterface $kernel)
    {
        parent::__construct($kernel);

        // set selected ids
        $this->setSelectedPageIds();
    }

    /**
     * Creates a Backend URL for a given action and module
     * If you don't specify a language the current language will be used.
     *
     * @param string $action The action to build the URL for.
     * @param string $module The module to build the URL for.
     * @param string $language The language to use, if not provided we will use the working language.
     * @param array $parameters GET-parameters to use.
     * @param bool $urlencode Should the parameters be urlencoded?
     *
     * @return string
     */
    public static function getBackendURLForBlock(
        string $action,
        string $module,
        string $language = null,
        array $parameters = null,
        bool $urlencode = true
    ): string {
        $language = $language ?? LANGUAGE;

        // add at least one parameter
        if (empty($parameters)) {
            $parameters['token'] = 'true';
        }

        if ($urlencode) {
            array_walk($parameters, 'rawurlencode');<commit_msg>Fix notifying admin on blog commment<commit_after><?php

namespace Frontend\Core\Engine;

/*
 * This file is part of Fork CMS.
 *
 * For the full copyright and license information, please view the license
 * file that was distributed with this source code.
 */

use Frontend\Core\Language\Language;
use Symfony\Component\HttpKernel\KernelInterface;
use Backend\Modules\Pages\Engine\Model as BackendPagesModel;
use Frontend\Core\Engine\Base\Object as FrontendBaseObject;
use Frontend\Core\Engine\Model as FrontendModel;
use Frontend\Modules\Profiles\Engine\Authentication as FrontendAuthentication;

/**
 * This class will be used to build the navigation
 */
class Navigation extends FrontendBaseObject
{
    /**
     * The excluded page ids. These will not be shown in the menu.
     *
     * @var array
     */
    private static $excludedPageIds = [];

    /**
     * The selected pageIds
     *
     * @var array
     */
    private static $selectedPageIds = [];

    public function __construct(KernelInterface $kernel)
    {
        parent::__construct($kernel);

        // set selected ids
        $this->setSelectedPageIds();
    }

    /**
     * Creates a Backend URL for a given action and module
     * If you don't specify a language the current language will be used.
     *
     * @param string $action The action to build the URL for.
     * @param string $module The module to build the URL for.
     * @param string $language The language to use, if not provided we will use the working language.
     * @param array $parameters GET-parameters to use.
     * @param bool $urlencode Should the parameters be urlencoded?
     *
     * @return string
     */
    public static function getBackendURLForBlock(
        string $action,
        string $module,
        string $language = null,
        array $parameters = null,
        bool $urlencode = true
    ): string {
        $language = $language ?? LANGUAGE;

        // add at least one parameter
        if (empty($parameters)) {
            $parameters['token'] = 'true';
        }

        if ($urlencode) {
            $parameters = array_map('rawurlencode', $parameters);
{'fraction_non_alphanumeric': 0.08877407233442931, 'fraction_numerical': 0.0, 'mean_word_length': 2.6339590443686007, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '354315', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1120, 'n_words': 413}