<commit_before><?php
abstract class Vpc_Menu_Abstract_Component extends Vpc_Abstract
{
    private $_currentPages;
    private $_config;

    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['componentName'] = trlVps('Menu');
        $ret['componentIcon'] = new Vps_Asset('layout');
        $ret['cssClass'] = 'webStandard';
        $ret['showParentPage'] = false;
        $ret['assetsAdmin']['dep'][] = 'VpsProxyPanel';
        $ret['assetsAdmin']['files'][] = 'vps/Vpc/Menu/Abstract/Panel.js';
        $ret['showAsEditComponent'] = false;
        $ret['liCssClasses'] = array(
            'offset' => trlVps('Offset')
        );
        $ret['level'] = 'main';
        $ret['dataModel'] = 'Vpc_Menu_Abstract_Model';
        $ret['menuModel'] = 'Vpc_Menu_Abstract_MenuModel';
        return $ret;
    }

    public function getTemplateVars()
    {
        $ret = parent::getTemplateVars();
        $ret['parentPage'] = null;
        if ($this->_getSetting('showParentPage')) {
            $currentPages = array_reverse($this->_getCurrentPages());
            if (isset($this->getData()->level)) {
                $level = $this->getData()->level;
            } else {
                $level = $this->_getSetting('level');
            }
            if (is_string($level)) {
                throw new Vps_Exception("You can't use showParentMenu for MainMenus (what should that do?)");
            }
            if (isset($currentPages[$level-2])) {
                $ret['parentPage'] = $currentPages[$level-2];
            }
        }
        return $ret;
    }

    public function getMenuComponent()
    {
        return $this->_getMenuData() ? $this->getData() : null;
    }

    public function getMenuData($parentData = null)
    {
        return $this->_getMenuData($parentData);
    }

    public function getPageComponent($parentData = null)
    {
        $ret = null;

        $ret = array();
        $currentPages = array_reverse($this->_getCurrentPages());
        if ($parentData) {
            $ret = $parentData;
        } else {
            if (isset($this->getData()->level)) {<commit_msg>Menü bearbeiten: Expanded-Menü wurde zu oft im PagesController angezeigt<commit_after><?php
abstract class Vpc_Menu_Abstract_Component extends Vpc_Abstract
{
    private $_currentPages;
    private $_config;

    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['componentName'] = trlVps('Menu');
        $ret['componentIcon'] = new Vps_Asset('layout');
        $ret['cssClass'] = 'webStandard';
        $ret['showParentPage'] = false;
        $ret['assetsAdmin']['dep'][] = 'VpsProxyPanel';
        $ret['assetsAdmin']['files'][] = 'vps/Vpc/Menu/Abstract/Panel.js';
        $ret['showAsEditComponent'] = false;
        $ret['liCssClasses'] = array(
            'offset' => trlVps('Offset')
        );
        $ret['level'] = 'main';
        $ret['dataModel'] = 'Vpc_Menu_Abstract_Model';
        $ret['menuModel'] = 'Vpc_Menu_Abstract_MenuModel';
        return $ret;
    }

    public function getTemplateVars()
    {
        $ret = parent::getTemplateVars();
        $ret['parentPage'] = null;
        if ($this->_getSetting('showParentPage')) {
            $currentPages = array_reverse($this->_getCurrentPages());
            if (isset($this->getData()->level)) {
                $level = $this->getData()->level;
            } else {
                $level = $this->_getSetting('level');
            }
            if (is_string($level)) {
                throw new Vps_Exception("You can't use showParentMenu for MainMenus (what should that do?)");
            }
            if (isset($currentPages[$level-2])) {
                $ret['parentPage'] = $currentPages[$level-2];
            }
        }
        return $ret;
    }

    public function getMenuComponent()
    {
        $component = $this->getData()->getPage();
        $level = 1;
        while ($component) {
            $menuCategory = Vpc_Abstract::getFlag($component->componentClass, 'menuCategory');
            if ($menuCategory) {
                $component = null;
                if ($level == 1) $level = $menuCategory;
            } else {
                $component = $component->parent;
                $level++;
            }
        }
        if ($level == $this->_getSetting('level') && $this->_getMenuData()) {
            return $this->getData();
        }
        return null;
    }

    public function getMenuData($parentData = null)
    {
        return $this->_getMenuData($parentData);
    }

    public function getPageComponent($parentData = null)
    {
        $ret = null;

        $ret = array();
        $currentPages = array_reverse($this->_getCurrentPages());
        if ($parentData) {
            $ret = $parentData;
        } else {
            if (isset($this->getData()->level)) {
{'fraction_non_alphanumeric': 0.15436654366543665, 'fraction_numerical': 0.0012300123001230013, 'mean_word_length': 2.168181818181818, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, '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': '6320816', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1375, 'n_words': 256}