<?php
/*
Copyright (C) 2008 by oscim   Project lossim  [ 15.09.2009, 09:17:59] @oscim
// kate: replace-trailing-space-save true; space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; word-wrap-marker-color #41C2A4
ENCODE UTF-8
*/
/**

  @package lossim <web http://www.lossim.org>
  @author oscim <mail dom@oscim.fr > <web http://www.oscim.fr>
  @class db_lang

*/

error_reporting(E_ALL);
class db_lang  extends db{

  /**
    Tableau des fichier présents
  */
  var $files;


  function db_lang(){
    /**
      Recup db php detail des posts
    */
    $this->lg=$this->add_tbl_php(ADD_PATH_ADMIN.TBL_LANG_INC,'lg');

    $this->modele_db=array(
                'lang'=>'text',
                'txt'=> 'text'
                );

    $this->key_tbl_php='rubrique';
  }



  /**
    Creation de repertoire mutliple liée au lang
    @a string path rubrique (sans la lang)
  */
  /*private*/ /*function mkdir_rep_multi ($rub){
    $lg=appel_lang();
    $s='';
    while ($r=each($lg)){
      if(!tep_mkdir(ADD_PATH_ADMIN.REP_DATA.$r['key'].'/'.$rub)) $cstr->_call('message_stack','add_session',CREATE_REP_RUB_NOT_OK,'erreur');
    }
    return $s;
  }*/


  /**
    recuperation des elements des categories
    @param
      @p array db cat
      @a string (option) key categorie
  */
  /*public*/ function db_lg($key_cat=''){
    if (isset($this->lg[$key_cat])) return $this->lg[$key_cat];
    return $this->lg;
  }


  /**
    Affichage lang
    @param
      @a string $lang key
      @a string params html
      @a bollean  just_array pour un retour tableau uniquement
  */
  /*public*/ function cat_lang($lang,$params='',$just_array=false){
    $arryData='';
    foreach($this->lg as $k=>$v){
      $arryData[$k]= $v['txt'];
    }
    if (!$just_array) return input_select('choose_lg',$arryData,$lang,$params);
    else return $arryData;
  }


  /**
    Add/up d'une cat
  @param
    @a string ckey de rubrique (new)
    @a string chek de rub (bak)
    @a array tableau retour des post
  */
  /*public*/ /*function up_cat($new_key,$bak_key,$array){
    foreach($array as $k=>$v)
       if ($k =='lang') $this->add_array($this->prepa_lang($v));
       else $this->add_item($k,$v);

    $this->add_item('path',$array['rub_parent'].$array['rubrique']);

    $this->sync_db($new_key,$bak_key,$this->test_key_cat($new_key),$this->db_cat($new_key), TBL_MODULE_RUBRIQUE_INC);
    //! add folder
    $this->mkdir_rep_multi($array['rub_parent'].$array['rubrique']);
  }*/

  /**
    Test la key de la cat
  */
  /*private*/ /*function test_key_cat($key_cat=''){
    if (isset($this->cat[$key_cat])) return true;
    return false;
  }*/

  /**
    Supp d'une entrée complete ds db
    @a string key a supp
  */
  /*private*/ /*function del_item_db($key){
    $query =" DELETE FROM  ".TBL_MODULE_RUBRIQUE_INC." WHERE id  = '".$key."' ";
    return sql ('',ADD_PATH_ADMIN.TBL_MODULE_RUBRIQUE_INC,'rubrique',$query,'');
  }*/



  /**
    Debugg
  */
  /*public*/ function debugg(){
      print_r($this);
  }
}

?>