<commit_before><?php
namespace CrudView\Listener\Traits;

use Cake\Event\Event;

trait UtilityNavigationTrait
{
    /**
     * beforeRender event
     *
     * @param \Cake\Event\Event $event Event.
     * @return void
     */
    public function beforeRenderUtilityNavigation(Event $event)
    {
        $controller = $this->_controller();
        $controller->set('utilityNavigation', $this->_getUtilityNavigation());
    }

    /**
     * Returns the utility navigation to show on scaffolded view
     *
     * @return string
     */
    protected function _getUtilityNavigation()
    {
        $action = $this->_action();

        $utilityNavigation = $action->config('scaffold.utility_navigation');
        if (empty($utilityNavigation)) {
            $utilityNavigation = null;
        }

        return $utilityNavigation;
    }
}<commit_msg>feat: set default utility navigation to match documentation<commit_after><?php
namespace CrudView\Listener\Traits;

use Cake\Event\Event;
use CrudView\Menu\MenuItem;

trait UtilityNavigationTrait
{
    /**
     * beforeRender event
     *
     * @param \Cake\Event\Event $event Event.
     * @return void
     */
    public function beforeRenderUtilityNavigation(Event $event)
    {
        $controller = $this->_controller();
        $controller->set('utilityNavigation', $this->_getUtilityNavigation());
    }

    /**
     * Returns the utility navigation to show on scaffolded view
     *
     * @return string
     */
    protected function _getUtilityNavigation()
    {
        $action = $this->_action();

        $utilityNavigation = $action->config('scaffold.utility_navigation');
        if ($utilityNavigation === null) {
            $utilityNavigation = [
                new MenuItem('Account', ['controller' => 'Users', 'action' => 'account']),
                new MenuItem('Log Out', ['controller' => 'Users', 'action' => 'logout']),
            ];
        }

        return $utilityNavigation;
    }
}
{'fraction_non_alphanumeric': 0.1266531027466938, 'fraction_numerical': 0.0, 'mean_word_length': 2.576363636363636, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '6532407', 'n_tokens_mistral': 543, 'n_tokens_neox': 535, 'n_words': 116}