<commit_before><?php

namespace Croogo\Menus\Controller\Component;

use Cake\Controller\Component;
use Cake\Core\Configure;
use Cake\Event\Event;
use Cake\ORM\TableRegistry;
use Cake\Utility\Hash;
use Croogo\Croogo\Controller\Component\CroogoComponent;

/**
 * Menus Component
 *
 * @property CroogoComponent Croogo
 * @package Croogo.Menus.Controller.Component
 */
class MenusComponent extends Component {

/**
 * Other components used by this component
 *
 * @var array
 * @access public
 */
	public $components = array(
		'Croogo.Croogo',
	);

/**
 * Menus for layout
 *
 * @var string
 * @access public
 */
	public $menusForLayout = array();

/**
 * Startup
 *
 * @param object $controller instance of controller
 * @return void
 */
	public function startup(Event $event) {
		$this->controller = $event->subject();
		if (isset($this->controller->Link)) {
			$this->Links = $this->controller->Links;
		} else {
			$this->Links = TableRegistry::get('Croogo/Menus.Links');
		}

		$controller = $event->subject();
		if (($controller->request->param('prefix') !== 'admin')  && !isset($controller->request->params['requested'])) {
			$this->menus();

		} else {
			$this->_adminData();
		}
	}

	protected function _adminData() {
		// menus
		$menus = $this->Links->Menus->find('all', array(
			'recursive' => '-1',
			'order' => 'Menu.id ASC',<commit_msg>Get the custom admin menus to load<commit_after><?php

namespace Croogo\Menus\Controller\Component;

use Cake\Controller\Component;
use Cake\Core\Configure;
use Cake\Event\Event;
use Cake\ORM\TableRegistry;
use Cake\Utility\Hash;
use Croogo\Croogo\Controller\Component\CroogoComponent;

/**
 * Menus Component
 *
 * @property CroogoComponent Croogo
 * @package Croogo.Menus.Controller.Component
 */
class MenusComponent extends Component {

/**
 * Other components used by this component
 *
 * @var array
 * @access public
 */
	public $components = array(
		'Croogo.Croogo',
	);

/**
 * Menus for layout
 *
 * @var string
 * @access public
 */
	public $menusForLayout = array();

/**
 * Startup
 *
 * @param object $controller instance of controller
 * @return void
 */
	public function startup(Event $event) {
		$this->controller = $event->subject();
		if (isset($this->controller->Link)) {
			$this->Links = $this->controller->Links;
		} else {
			$this->Links = TableRegistry::get('Croogo/Menus.Links');
		}

		$controller = $event->subject();
		if (($controller->request->param('prefix') !== 'admin')  && !isset($controller->request->params['requested'])) {
			$this->menus();

		} else {
			$this->_adminData();
		}
	}

	protected function _adminData() {
		// menus
		$menus = $this->Links->Menus->find('all', array(
			'recursive' => '-1',
			'order' => 'Menus.id ASC',
{'fraction_non_alphanumeric': 0.17155425219941348, 'fraction_numerical': 0.0007331378299120235, 'mean_word_length': 3.989031078610603, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '5444286', 'n_tokens_mistral': 947, 'n_tokens_neox': 871, 'n_words': 191}