<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
return array(
    'sourceLanguage' => 'en',
    'language' => 'sr_yu',
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name' => 'Konoba Akustik Sutomore',
    // 'theme'=>'bootstrap',

    // preloading 'log' component
    'preload' => array(
        'log',
        'application.ext.bootstrap.*'
    ),

    // autoloading model and component classes
    'import' => array(
        'ext.wform.*',
        'application.models.*',
        'application.models.forms.*',
        'application.controllers.*',
        'application.components.*',
        'application.extensions.giix-components.*',
        'ext.yii-mail.YiiMailMessage',
        'ext.YiiJasper.*',
        'application.ext.bootstrap.*',
        'ext.bootstrap.widgets.TbActiveForm'

    ),


    'modules' => array(
        'rbam' => array(
            'applicationLayout' => 'application.views.layouts.main',
            'authAssignmentsManagerRole' => ' Auth Assignments Manager',
            'authenticatedRole' => 'Authenticated',
            'authItemsManagerRole' => 'Auth Items Manager',
            'baseScriptUrl' => null,
            'baseUrl' => null,
            'cssFile' => null,
            'development' => true,
            //'initialise'=>true,
            'exclude' => 'rbam',
            'guestRole' => 'Guest',
            'layout' => 'rbam.views.layouts.main',
            'juiCssFile' => 'jquery-ui.css',
            'juiHide' => 'puff',
            'juiScriptFile' => 'jquery-ui.min.js',
            'juiScriptUrl' => null,
            'juiShow' => 'fade',
            'juiTheme' => 'base',
            'juiThemeUrl' => null,
            'pageSize' => 10,
            'rbacManagerRole' => 'RBAC Manager',
            'relationshipsPageSize' => 5,
            'showConfirmation' => 3000,
            'showMenu' => true,
            'userClass' => 'User',
            'userCriteria' => array(),
            'userIdAttribute' => 'id',
            'userNameAttribute' => 'username',
        ),
        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => 'admin',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            //'ipFilters'=>array('77.46.237.53','178.222.69.84'),
            //'ipFilters'=>array('127.0.0.1','::1'),

//            'generatorPaths' => array(
//                'ext.giix-core', // templejt za gii
//            ),

            'generatorPaths' => array('bootstrap.gii'),

        ),

    ),

    // application components
    'components' => array(
        'bootstrap'=>array(
            'class'=>'bootstrap.components.Bootstrap',
        ),

        'mustache' => array(
            'class' => 'ext.mustache.components.MustacheApplicationComponent'
            // // Default settings (not needed)
            // 'templatePathAlias'=>'application.templates',
            // 'templateExtension'=>'mustache',
            // 'extension'=>true,
        ),

        'mail' => array(
            'class' => 'ext.yii-mail.YiiMail',
            'transportType' => 'smtp',
            'transportOptions' => array(
                'host' => '',// smtp.host.xy
                //'encryption'=>'tls',
                'username' => 'user',
                'password' => 'password',
                'port' => 25,
            ),
            'viewPath' => 'application.views.mail',
            'logging' => true,
            'dryRun' => false

        ),
        'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => true,
        ),
        // kolacici bitno zbog jezika
        'request' => array(
            'enableCookieValidation' => true,
            'enableCsrfValidation' => false,
        ),
        // uncomment the following to enable URLs in path-format
        'urlManager' => array(
            'urlFormat' => 'path',
            'rules' => array(
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ),
        ),

        /*

        'db'=>array(
            'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
        ),


        */
        // uncomment the following to use a MySQL database
        // na serveru
//        'db' => array(
//            'connectionString' => 'mysql:host=localhost;dbname=konoba',
//            'emulatePrepare' => true,
//            'username' => 'root',
//            'password' => '',
//            'charset' => 'utf8',
//        ),

        'db' => array(
            'connectionString' => 'mysql:host=localhost;dbname=konobabl_sutomore',
            'emulatePrepare' => true,
            'username' => 'konobabl_blag',
            'password' => 'B!)SFln6zU[]',
            'charset' => 'utf8',
        ),
        //lokalno  jdbc:mysql://localhost:3306/beoguma
        /*
        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=hotelguma',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
        ),*/
        //dodato za logovanje
        'authManager' => array(
            'class' => 'CDbAuthManager',
            'connectionID' => 'db',
            'defaultRoles' => array('authenticated', 'guest'),
            // The itemTable name (default:authitem)
            'itemTable' => 'authitem',
            // The assignmentTable name (default:authassignment)
            'assignmentTable' => 'authassignment',
            // The itemChildTable name (default:authitemchild)
            'itemChildTable' => 'authitemchild',
        ),
        //dodato za logovanje 
        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'site/error',
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning',
                ),
                // uncomment the following to show log messages on web pages
                /*
                array(
                    'class'=>'CWebLogRoute',
                ),
                */

            ),
        ),


    ),

    // application-level parameters that can be accessed
    // using Yii::app()->params['defaultMesto']
    'params' => array(
        'defaultPageSize' => '10',
        'adminEmail' => 'nikola.tomic@diginout.com',
        'languages' => array('sr_yu' => 'Srpski', 'en' => 'English'),
        // backup parametri baze
        'charset' => 'utf8',
        'valuta' => 'EUR'

    ),
);