<commit_before><?php
/**
 * Backend {{ moduleName }} installer
 */
class {{ moduleNameSafe }}Installer extends ModuleInstaller
{
    /**
     * Install the module
     */
    public function install()
    {
        // Load install.sql
        $this->importSQL(__DIR__ . '/data/install.sql');

        // Add module
        $this->addModule('{{ moduleName }}');

        // Import locale
        $this->importLocale(__DIR__ . '/data/locale.xml');

        // Set navigation
        $navigationModulesId = $this->setNavigation(null, 'Modules');
        $navigation{{ moduleNameSafe }}Id = $this->setNavigation($navigationModulesId, '{{ moduleNameSafe }}', '{{ moduleName }}/index');

{% for action in backendActions %}
{% if action.name == 'index' %}
        $this->setNavigation(
            $navigation{{ moduleNameSafe }}Id,
            'Overview',
            '{{ moduleName }}/{{ action.name }}',
            array(
{% for otheraction in backendActions %}
{% if otheraction.name in ['add', 'edit', 'delete'] %}
                '{{ moduleName }}/{{ otheraction.name }}',
{% endif %}
{% endfor %}
            )
        );
{% elseif action.name not in ['index', 'add', 'edit', 'delete'] %}
        $this->setNavigation($navigation{{ moduleNameSafe }}Id, '{{ action.safe }}', '{{ moduleName }}/{{ action.name }}');
{% endif %}
{% endfor %}

        // Set rights for admin
        $this->setModuleRights(1, '{{ moduleName }}');
{% for action in backendActions %}
        $this->setActionRights(1, '{{ moduleName }}', '{{ action.name }}');
{% endfor %}
        // Set rights for users
        $this->setModuleRights(2, '{{ moduleName }}');
{% for action in backendActions %}
        $this->setActionRights(2, '{{ moduleName }}', '{{ action.name }}');
{% endfor %}

{% if backendWidgets %}
<commit_msg>Add a link to settings.php backend action in fork settings when present<commit_after><?php
/**
 * Backend {{ moduleName }} installer
 */
class {{ moduleNameSafe }}Installer extends ModuleInstaller
{
    /**
     * Install the module
     */
    public function install()
    {
        // Load install.sql
        $this->importSQL(__DIR__ . '/data/install.sql');

        // Add module
        $this->addModule('{{ moduleName }}');

        // Import locale
        $this->importLocale(__DIR__ . '/data/locale.xml');

        // Set navigation
        $navigationModulesId = $this->setNavigation(null, 'Modules');
        $navigation{{ moduleNameSafe }}Id = $this->setNavigation($navigationModulesId, '{{ moduleNameSafe }}', '{{ moduleName }}/index');

{% for action in backendActions %}
{% if action.name == 'index' %}
        $this->setNavigation(
            $navigation{{ moduleNameSafe }}Id,
            'Overview',
            '{{ moduleName }}/{{ action.name }}',
            array(
{% for otheraction in backendActions %}
{% if otheraction.name in ['add', 'edit', 'delete'] %}
                '{{ moduleName }}/{{ otheraction.name }}',
{% endif %}
{% endfor %}
            )
        );
{% elseif action.name not in ['index', 'add', 'edit', 'delete', 'settings'] %}
        $this->setNavigation($navigation{{ moduleNameSafe }}Id, '{{ action.safe }}', '{{ moduleName }}/{{ action.name }}');
{% elseif action.name == 'settings' %}
        $navigationSettingsId = $this->setNavigation(null, 'Settings');
        $navigationModulesId = $this->setNavigation($navigationSettingsId, 'Modules');
        $this->setNavigation($navigationModulesId, {{ moduleNameSafe }}, '{{ moduleName }}/settings');
{% endif %}
{% endfor %}

        // Set rights for admin
        $this->setModuleRights(1, '{{ moduleName }}');
{% for action in backendActions %}
        $this->setActionRights(1, '{{ moduleName }}', '{{ action.name }}');
{% endfor %}
        // Set rights for users
        $this->setModuleRights(2, '{{ moduleName }}');
{% for action in backendActions %}
        $this->setActionRights(2, '{{ moduleName }}', '{{ action.name }}');
{% endfor %}

{% if backendWidgets %}

{'fraction_non_alphanumeric': 0.18846056941295036, 'fraction_numerical': 0.002015621063240111, 'mean_word_length': 2.7881679389312977, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7141481', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1115, 'n_words': 253}