<commit_before><?php
/**
 * FoodCoopShop - The open source software for your foodcoop
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @since         FoodCoopShop 1.0.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 * @author        <NAME> <<EMAIL>>
 * @copyright     Copyright (c) <NAME>, http://www.rothauer-it.com
 * @link          https://www.foodcoopshop.com
 */

if (! $appAuth->loggedIn() || $this->action == 'iframeStartPage') {
    return;
}
?>

<?php

// used multiple times...
$paymentProductMenuElement = $this->Menu->getPaymentProductMenuElement();
$paymentMemberFeeMenuElement = $this->Menu->getPaymentMemberFeeMenuElement();
$actionLogsMenuElement = array(
    'slug' => '/admin/action_logs',
    'name' => 'Aktivitäten',
    'options' => array(
        'fa-icon' => 'fa-fw fa-eye'
    )
);
$cancelledArticlesMenuElement = array(
    'slug' => '/admin/action_logs/index/type:order_detail_cancelled',
    'name' => 'Stornierte Produkte',
    'options' => array(
        'fa-icon' => 'fa-fw fa-remove'
    )
);
$ordersMenuElement = array(
    'slug' => '/admin/orders',
    'name' => 'Bestellungen',
    'options' => array(
        'fa-icon' => 'fa-fw fa-shopping-cart'
    )
);
$orderDetailsMenuElement = array(
    'slug' => '/admin/order_details',
    'name' => 'Bestellte Produkte',
    'options' => array(
        'fa-icon' => 'fa-fw fa-shopping-cart'
    )
);
$customerProfileMenuElement = array(
    'slug' => $this->Slug->getCustomerProfile(),
    'name' => 'Meine Daten',
    'options' => array(
        'fa-icon' => 'fa-fw fa-home'
    )
);
$changePasswordMenuElement = array(
    'slug' => $this->Slug->getChangePassword(),
    'name' => 'Passwort ändern',
    'options' => array(
        'fa-icon' => 'fa-fw fa-key'
    )
);
$blogPostsMenuElement = array(
    'slug' => $this->Slug->getBlogPostListAdmin(),
    'name' => 'Blog-Artikel',
    'options' => array(
        'fa-icon' => 'fa-fw fa-file-text'
    )
);
$homepageAdministrationElement = array(
    'slug' => $this->Slug->getPagesListAdmin(),
    'name' => 'Homepage-Verwaltung',
    'options' => array(
        'fa-icon' => 'fa-fw fa-pencil-square-o'
    )
);
$menu = array();
$logoHtml = '<img class="logo" src="/files/images/logo.jpg" width="100%" />';
$menu[] = array(
    'slug' => $this->Slug->getHome(),
    'name' => $logoHtml,
    'options' => array()
);
$menu[] = array(
    'slug' => $this->Slug->getHome(),
    'name' => 'Home',
    'options' => array(
        'fa-icon' => 'fa-fw fa-home'
    )
);

if ($appAuth->isCustomer()) {
    $ordersMenuElement['children'] = array(
        $orderDetailsMenuElement,
        $cancelledArticlesMenuElement
    );
    $menu[] = $ordersMenuElement;
    $menu[] = $customerProfileMenuElement;
    if (! empty($paymentProductMenuElement)) {
        $menu[]= $paymentProductMenuElement;
    }
    if (! empty($paymentMemberFeeMenuElement)) {
        $menu[]= $paymentMemberFeeMenuElement;
    }
    $menu[] = $changePasswordMenuElement;
    $menu[] = $actionLogsMenuElement;
}

if ($appAuth->isSuperadmin() || $appAuth->isAdmin()) {
    $ordersMenuElement['children'] = array(
        $orderDetailsMenuElement,
        $cancelledArticlesMenuElement,
        array(
            'slug' => '/admin/lists/orderLists',
            'name' => 'Bestelllisten',
            'options' => array(
                'fa-icon' => 'fa-fw fa-book'
            )
        )
    );
    $menu[] = $ordersMenuElement;
    $manufacturerMenu = array(
        'slug' => '/admin/manufacturers',
        'name' => 'Hersteller',
        'options' => array(
            'fa-icon' => 'fa-fw fa-leaf'
        )
    );
    $manufacturerMenu['children'][] = array(
        'slug' => $this->Slug->getProductAdmin(),
        'name' => 'Produkte',
        'options' => array(
            'fa-icon' => 'fa-fw fa-tags'
        )
    );

    if (date('Y-m-d') > Configure::read('app.depositForManufacturersStartDate')) {
        $manufacturerMenu['children'][] = array(
            'slug' => $this->Slug->getDepositList(),
            'name' => 'Pfandkonto',
            'options' => array(
                'fa-icon' => 'fa-fw fa-recycle'
            )
        );
    }

    $menu[] = $manufacturerMenu;

    $menu[] = array(
        'slug' => $this->Slug->getCustomerListAdmin(),
        'name' => 'Mitglieder',
        'options' => array(
            'fa-icon' => 'fa-fw fa-male'
        )
    );
    $menu[] = $actionLogsMenuElement;
    if (! empty($paymentProductMenuElement)) {
        $customerProfileMenuElement['children'][] = $paymentProductMenuElement;
    }
    if (! empty($paymentMemberFeeMenuElement)) {
        $customerProfileMenuElement['children'][] = $paymentMemberFeeMenuElement;
    }
    $customerProfileMenuElement['children'][] = $changePasswordMenuElement;
    $menu[] = $customerProfileMenuElement;
    $menu[] = $blogPostsMenuElement;

    $homepageAdministrationElement['children'][] = array(
        'slug' => $this->Slug->getCategoriesList(),
        'name' => 'Kategorien',
        'options' => array(
            'fa-icon' => 'fa-fw fa-list'
        )
    );
    $homepageAdministrationElement['children'][] = array(
        'slug' => $this->Slug->getAttributesList(),
        'name' => 'Varianten',
        'options' => array(
            'fa-icon' => 'fa-fw fa-chevron-circle-right'
        )
    );
    $homepageAdministrationElement['children'][] = array(
        'slug' => $this->Slug->getSlidersList(),
        'name' => 'Slideshow',
        'options' => array(
            'fa-icon' => 'fa-fw fa-image'
        )<commit_msg>pages administration linked in admin menu<commit_after><?php
/**
 * FoodCoopShop - The open source software for your foodcoop
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @since         FoodCoopShop 1.0.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 * @author        <NAME> <<EMAIL>>
 * @copyright     Copyright (c) <NAME>, http://www.rothauer-it.com
 * @link          https://www.foodcoopshop.com
 */

if (! $appAuth->loggedIn() || $this->action == 'iframeStartPage') {
    return;
}
?>

<?php

// used multiple times...
$paymentProductMenuElement = $this->Menu->getPaymentProductMenuElement();
$paymentMemberFeeMenuElement = $this->Menu->getPaymentMemberFeeMenuElement();
$actionLogsMenuElement = array(
    'slug' => '/admin/action_logs',
    'name' => 'Aktivitäten',
    'options' => array(
        'fa-icon' => 'fa-fw fa-eye'
    )
);
$cancelledArticlesMenuElement = array(
    'slug' => '/admin/action_logs/index/type:order_detail_cancelled',
    'name' => 'Stornierte Produkte',
    'options' => array(
        'fa-icon' => 'fa-fw fa-remove'
    )
);
$ordersMenuElement = array(
    'slug' => '/admin/orders',
    'name' => 'Bestellungen',
    'options' => array(
        'fa-icon' => 'fa-fw fa-shopping-cart'
    )
);
$orderDetailsMenuElement = array(
    'slug' => '/admin/order_details',
    'name' => 'Bestellte Produkte',
    'options' => array(
        'fa-icon' => 'fa-fw fa-shopping-cart'
    )
);
$customerProfileMenuElement = array(
    'slug' => $this->Slug->getCustomerProfile(),
    'name' => 'Meine Daten',
    'options' => array(
        'fa-icon' => 'fa-fw fa-home'
    )
);
$changePasswordMenuElement = array(
    'slug' => $this->Slug->getChangePassword(),
    'name' => 'Passwort ändern',
    'options' => array(
        'fa-icon' => 'fa-fw fa-key'
    )
);
$blogPostsMenuElement = array(
    'slug' => $this->Slug->getBlogPostListAdmin(),
    'name' => 'Blog-Artikel',
    'options' => array(
        'fa-icon' => 'fa-fw fa-file-text'
    )
);
$homepageAdministrationElement = array(
    'slug' => $this->Slug->getPagesListAdmin(),
    'name' => 'Homepage-Verwaltung',
    'options' => array(
        'fa-icon' => 'fa-fw fa-pencil-square-o'
    )
);
$menu = array();
$logoHtml = '<img class="logo" src="/files/images/logo.jpg" width="100%" />';
$menu[] = array(
    'slug' => $this->Slug->getHome(),
    'name' => $logoHtml,
    'options' => array()
);
$menu[] = array(
    'slug' => $this->Slug->getHome(),
    'name' => 'Home',
    'options' => array(
        'fa-icon' => 'fa-fw fa-home'
    )
);

if ($appAuth->isCustomer()) {
    $ordersMenuElement['children'] = array(
        $orderDetailsMenuElement,
        $cancelledArticlesMenuElement
    );
    $menu[] = $ordersMenuElement;
    $menu[] = $customerProfileMenuElement;
    if (! empty($paymentProductMenuElement)) {
        $menu[]= $paymentProductMenuElement;
    }
    if (! empty($paymentMemberFeeMenuElement)) {
        $menu[]= $paymentMemberFeeMenuElement;
    }
    $menu[] = $changePasswordMenuElement;
    $menu[] = $actionLogsMenuElement;
}

if ($appAuth->isSuperadmin() || $appAuth->isAdmin()) {
    $ordersMenuElement['children'] = array(
        $orderDetailsMenuElement,
        $cancelledArticlesMenuElement,
        array(
            'slug' => '/admin/lists/orderLists',
            'name' => 'Bestelllisten',
            'options' => array(
                'fa-icon' => 'fa-fw fa-book'
            )
        )
    );
    $menu[] = $ordersMenuElement;
    $manufacturerMenu = array(
        'slug' => '/admin/manufacturers',
        'name' => 'Hersteller',
        'options' => array(
            'fa-icon' => 'fa-fw fa-leaf'
        )
    );
    $manufacturerMenu['children'][] = array(
        'slug' => $this->Slug->getProductAdmin(),
        'name' => 'Produkte',
        'options' => array(
            'fa-icon' => 'fa-fw fa-tags'
        )
    );

    if (date('Y-m-d') > Configure::read('app.depositForManufacturersStartDate')) {
        $manufacturerMenu['children'][] = array(
            'slug' => $this->Slug->getDepositList(),
            'name' => 'Pfandkonto',
            'options' => array(
                'fa-icon' => 'fa-fw fa-recycle'
            )
        );
    }

    $menu[] = $manufacturerMenu;

    $menu[] = array(
        'slug' => $this->Slug->getCustomerListAdmin(),
        'name' => 'Mitglieder',
        'options' => array(
            'fa-icon' => 'fa-fw fa-male'
        )
    );
    $menu[] = $actionLogsMenuElement;
    if (! empty($paymentProductMenuElement)) {
        $customerProfileMenuElement['children'][] = $paymentProductMenuElement;
    }
    if (! empty($paymentMemberFeeMenuElement)) {
        $customerProfileMenuElement['children'][] = $paymentMemberFeeMenuElement;
    }
    $customerProfileMenuElement['children'][] = $changePasswordMenuElement;
    $menu[] = $customerProfileMenuElement;
    $menu[] = $blogPostsMenuElement;

    $homepageAdministrationElement['children'][] = array(
        'slug' => $this->Slug->getPagesListAdmin(),
        'name' => 'Seiten',
        'options' => array(
            'fa-icon' => 'fa-fw fa-pencil-square-o'
        )
    );

    $homepageAdministrationElement['children'][] = array(
        'slug' => $this->Slug->getCategoriesList(),
        'name' => 'Kategorien',
        'options' => array(
            'fa-icon' => 'fa-fw fa-list'
        )
    );
    $homepageAdministrationElement['children'][] = array(
        'slug' => $this->Slug->getAttributesList(),
        'name' => 'Varianten',
        'options' => array(
            'fa-icon' => 'fa-fw fa-chevron-circle-right'
        )
    );
    $homepageAdministrationElement['children'][] = array(
        'slug' => $this->Slug->getSlidersList(),
        'name' => 'Slideshow',
        'options' => array(
            'fa-icon' => 'fa-fw fa-image'
        )
{'fraction_non_alphanumeric': 0.1836577868852459, 'fraction_numerical': 0.0010245901639344263, 'mean_word_length': 2.6511845386533666, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 231, 'https://': 2, 'lorem ipsum': 0, 'www.': 6, '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': '6419866', 'n_tokens_mistral': 3861, 'n_tokens_neox': 3840, 'n_words': 656}