<?php

//  define('SHOW_VARIABLES', 1);
//  define('DEBUG_LEVEL', 1);

//  error_reporting(E_ALL ^ E_NOTICE);
//  ini_set('display_errors', 'On');

set_include_path('.' . PATH_SEPARATOR . get_include_path());


include_once dirname(__FILE__) . '/' . 'components/utils/system_utils.php';

//  SystemUtils::DisableMagicQuotesRuntime();

SystemUtils::SetTimeZoneIfNeed('Europe/Belgrade');

function GetGlobalConnectionOptions()
{
    return array(
  'server' => 'localhost',
  'port' => '5432',
  'username' => 'postgres',
  'password' => '[PASSWORD]',
  'database' => 'TD2015'
);
}

function HasAdminPage()
{
    return false;
}

function GetPageGroups()
{
    $result = array('Objets', 'Paramètres');
    return $result;
}

function GetPageInfos()
{
    $result = array();
    $result[] = array('caption' => 'Vue de base des objets', 'short_caption' => 'Vue de base des objets', 'filename' => 'vues.vm_objet_vue_de_base.php', 'name' => 'vues.vm_objet_vue_de_base', 'group_name' => 'Objets', 'add_separator' => false);
    $result[] = array('caption' => 'Paramètres', 'short_caption' => 'Paramètres', 'filename' => 'parametres.parametre_systeme.php', 'name' => 'parametres.parametre_systeme', 'group_name' => 'Paramètres', 'add_separator' => false);
    $result[] = array('caption' => 'Dates des objets', 'short_caption' => 'Dates des objets', 'filename' => 'objets.date_objet.php', 'name' => 'objets.date_objet', 'group_name' => 'Objets', 'add_separator' => false);
    $result[] = array('caption' => 'Noms des objets', 'short_caption' => 'Noms des objets', 'filename' => 'objets.nom_objet.php', 'name' => 'objets.nom_objet', 'group_name' => 'Objets', 'add_separator' => false);
    $result[] = array('caption' => 'Associations des objets source', 'short_caption' => 'Associations des objets source', 'filename' => 'vues.vm_association_objets.php', 'name' => 'vues.vm_association_objets', 'group_name' => 'Objets', 'add_separator' => false);
    $result[] = array('caption' => 'Associations des objets cible', 'short_caption' => 'Associations des objets cible', 'filename' => 'vues.vm_association_objets_inv.php', 'name' => 'vues.vm_association_objets_inv', 'group_name' => 'Objets', 'add_separator' => false);
    return $result;
}

function GetPagesHeader()
{
    return
    '';
}

function GetPagesFooter()
{
    return
        ''; 
    }

function ApplyCommonPageSettings(Page $page, Grid $grid)
{
    $page->SetShowUserAuthBar(false);
    $page->OnCustomHTMLHeader->AddListener('Global_CustomHTMLHeaderHandler');
    $page->OnGetCustomTemplate->AddListener('Global_GetCustomTemplateHandler');
    $grid->BeforeUpdateRecord->AddListener('Global_BeforeUpdateHandler');
    $grid->BeforeDeleteRecord->AddListener('Global_BeforeDeleteHandler');
    $grid->BeforeInsertRecord->AddListener('Global_BeforeInsertHandler');
}

/*
  Default code page: 1252
*/
function GetAnsiEncoding() { return 'windows-1252'; }

function Global_CustomHTMLHeaderHandler($page, &$customHtmlHeaderText)
{

}

function Global_GetCustomTemplateHandler($part, $mode, &$result, &$params, CommonPage $page = null)
{

}

function Global_BeforeUpdateHandler($page, &$rowData, &$cancel, &$message, $tableName)
{

}

function Global_BeforeDeleteHandler($page, &$rowData, &$cancel, &$message, $tableName)
{

}

function Global_BeforeInsertHandler($page, &$rowData, &$cancel, &$message, $tableName)
{

}

function GetDefaultDateFormat()
{
    return 'Y-m-d';
}

function GetFirstDayOfWeek()
{
    return 0;
}

function GetEnableLessFilesRunTimeCompilation()
{
    return false;
}

function GetPageListType()
{
    return PageList::TYPE_MENU;
}



?>