<commit_before><?php
declare(strict_types = 1);
namespace CkTools\View\Helper;

use Cake\Core\Configure;
use Cake\Routing\Router;
use Cake\Utility\Text;
use Cake\View\Helper;
use Cake\View\View;

/**
 * @property \AuthActions\View\Helper\AuthHelper $Auth
 * @property \Cake\Http\ServerRequest            $request
 */
class MenuHelper extends Helper
{

    /**
     * Used helpers
     *
     * @var array
     */
    public $helpers = ['AuthActions.Auth'];

    /**
     * Default configuration
     *
     * @var array
     */
    protected $_defaultConfig = [
        'configKey' => 'menu',
        'templates' => [
            'icon' => '<i class="fa fa-:icon fa-fw"></i>',
            'item' => '<li class=":liclass"><a href=":href" class=":class">:icon :title :childrenArrow</a>:childrenContainer</li>',
            'childrenArrow' => '<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>',
            'childrenContainer' => '<ul class="treeview-menu">:children</ul>',
        ],
    ];

    /**
     * Holds the current URL as an array
     *
     * @var array
     */
    protected $_currentUrl;

    /**
     * flag indicating active status of a controller item
     *
     * @var bool
     */
    protected $_controllerActive = false;

    /**
     * flag indicating active status of a action item
     *
     * @var bool
     */
    protected $_actionActive = false;

    /**
     * Configures the instance
     *
     * @param \Cake\View\View $View CakePHP View instance
     * @param array $config helper config
     */
    public function __construct(View $View, array $config = [])
    {
        parent::__construct($View, $config);
        $this->_currentUrl = [
            'controller' => $this->request->getParam('controller'),
            'action' => $this->request->getParam('action'),
            'pass' => $this->request->getParam('pass'),
            'prefix' => $this->request->getParam('prefix'),
            'plugin' => $this->request->getParam('plugin'),
        ];
    }

    /**
     * Renders
     *
     * @param string|array $config Either the config file to load or the menu config as an array<commit_msg>Use new getAttribute API to get params of request<commit_after><?php
declare(strict_types = 1);
namespace CkTools\View\Helper;

use Cake\Core\Configure;
use Cake\Routing\Router;
use Cake\Utility\Text;
use Cake\View\Helper;
use Cake\View\View;

/**
 * @property \AuthActions\View\Helper\AuthHelper $Auth
 * @property \Cake\Http\ServerRequest            $request
 */
class MenuHelper extends Helper
{

    /**
     * Used helpers
     *
     * @var array
     */
    public $helpers = ['AuthActions.Auth'];

    /**
     * Default configuration
     *
     * @var array
     */
    protected $_defaultConfig = [
        'configKey' => 'menu',
        'templates' => [
            'icon' => '<i class="fa fa-:icon fa-fw"></i>',
            'item' => '<li class=":liclass"><a href=":href" class=":class">:icon :title :childrenArrow</a>:childrenContainer</li>',
            'childrenArrow' => '<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>',
            'childrenContainer' => '<ul class="treeview-menu">:children</ul>',
        ],
    ];

    /**
     * Holds the current URL as an array
     *
     * @var array
     */
    protected $_currentUrl;

    /**
     * flag indicating active status of a controller item
     *
     * @var bool
     */
    protected $_controllerActive = false;

    /**
     * flag indicating active status of a action item
     *
     * @var bool
     */
    protected $_actionActive = false;

    /**
     * Configures the instance
     *
     * @param \Cake\View\View $View CakePHP View instance
     * @param array $config helper config
     */
    public function __construct(View $View, array $config = [])
    {
        parent::__construct($View, $config);
        $this->_currentUrl = $this->request->getAttribute('params');
    }

    /**
     * Renders
     *
     * @param string|array $config Either the config file to load or the menu config as an array
{'fraction_non_alphanumeric': 0.15135266877894224, 'fraction_numerical': 0.0004874482086278333, 'mean_word_length': 2.3123486682808716, 'pattern_counts': {'":': 6, '<': 29, '<?xml version=': 0, '>': 58, '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': '100584', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1203, 'n_words': 296}