<?php
require_once DIR_CORE.'categories-'.DB_TYPE.'.php';
require_once DIR_CORE.'categories-admin.php';
require_once DIR_CORE.'categories.php';

if( $a == 'Config' ){
  if( isset( $sOption ) && $sOption == 'save' ){
    saveConfig( $_POST, DB_CONFIG );
    saveConfig( $_POST, DB_CONFIG_LANG );
    $link = $aActions['g'].'Config';

    $content .= $tpl->tbHtml( 'messages.tpl', 'SAVED' );
  }
  else{
    $sLangSelect =        throwLangSelect( $config['language'] );
    $sTemplateSelect =    throwTemplatesSelect( $config['template'] );
    $sStartPageSelect =   throwPagesSelect( $config['start_page'] );
    $sInfoMailSelect =    throwTrueFalseSelect( $config['mail_informing'] );
    $sHiddenShowsSelect = throwTrueFalseSelect( $config['hidden_shows'] );

    $sContactPageSelect = listCategories( 'categories_contact_select.tpl', null, null, Array( $config['contact_page'] ), null, null, 0 );
    if( !isset( $sContactPageSelect ) )
      $sContactPageSelect = $tpl->tbHtml( 'categories_contact_select.tpl', 'NOT_FOUND' );

    $content .= $tpl->tbHtml( 'config_form.tpl', 'FORM' );
  }
}
elseif( $a == 'About' ){
  $content .= $tpl->tHtml( 'about.tpl' );
}
elseif( $a == 'Validate' ){
  $content .= throwWarnings( 'messages.tpl' );
}
elseif( $a == 'Gallery' ){
  $content .= $tpl->tbHtml( 'gallery.tpl', 'SHOW' );
}
?>