<?php

namespace modules\custom;

use Yii;

/**
 * Inline Customizations Module
 *
 * This module provides Customization features, including custom data
 * for shift work patterns. It can be integrated into any Yii2 application.
 */
class Module extends \yii\base\Module
{
    public $controllerNamespace = 'modules\custom\controllers';

    public function init()
    {
        parent::init();

        // Register translations if needed
        if (!isset(Yii::$app->i18n->translations['custom*'])) {
            Yii::$app->i18n->translations['custom*'] = [
                'class' => 'yii\i18n\PhpMessageSource',
                'sourceLanguage' => 'en-US',
                'basePath' => '@modules/custom/messages',
            ];
        }
        \Yii::$app->urlManager->addRules([
            'contacts/<action:[\w\-]+>' => 'custom/contacts/<action>',
            'contacts' => 'custom/contacts/index',
            'accounts/<action:[\w\-]+>' => 'custom/accounts/<action>',
            'accounts' => 'custom/accounts/index',
            'complaints/<action:[\w\-]+>' => 'custom/complaints/<action>',
            'complaints' => 'custom/complaints/index',
            'tasks/<action:[\w\-]+>' => 'custom/tasks/<action>',
            'tasks' => 'custom/tasks/index',
            'investigation/<action:[\w\-]+>' => 'custom/investigation/<action>',
            'investigation' => 'custom/investigation/index',
        ]);
    }
}