Changeset 6153


Ignore:
Timestamp:
May 9, 2010, 10:52:38 PM (10 years ago)
Author:
nikrou
Message:

Fix get_enums function for SQLite
hard coded enums values for all tables
because enum feature doesn't exists for SQLite.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/user_list.php

    r5920 r6153  
    593593    isset($_POST['pref_submit']) ? $_POST['language'] : get_default_language());
    594594
    595 //Log::getInstance()->debug($status);
    596595// Status options
    597596foreach (get_enums(USER_INFOS_TABLE, 'status') as $status)
  • trunk/include/dblayer/functions_pdo-sqlite.inc.php

    r6090 r6153  
    432432function get_enums($table, $field)
    433433{
    434   return array();
     434  $Enums['categories']['status'] = array('public', 'private');
     435  $Enums['history']['section'] = array('categories','tags','search','list','favorites','most_visited','best_rated','recent_pics','recent_cats');
     436  $Enums['user_infos']['status'] = array('webmaster','admin','normal','generic','guest');
     437  $Enums['image']['type'] = array('picture','high','other');
     438  $Enums['plugins']['state'] = array('active', 'inactive');
     439  $Enums['user_cache_image']['access_type'] = array('NOT IN','IN');
     440
     441  $table = str_replace($GLOBALS['prefixeTable'], '', $table);
     442  if (isset($Enums[$table][$field])) {
     443    return $Enums[$table][$field];
     444  } else {
     445    return array();
     446  }
    435447}
    436448
  • trunk/include/dblayer/functions_sqlite.inc.php

    r6090 r6153  
    444444function get_enums($table, $field)
    445445{
    446   return array();
     446  $Enums['categories']['status'] = array('public', 'private');
     447  $Enums['history']['section'] = array('categories','tags','search','list','favorites','most_visited','best_rated','recent_pics','recent_cats');
     448  $Enums['user_infos']['status'] = array('webmaster','admin','normal','generic','guest');
     449  $Enums['image']['type'] = array('picture','high','other');
     450  $Enums['plugins']['state'] = array('active', 'inactive');
     451  $Enums['user_cache_image']['access_type'] = array('NOT IN','IN');
     452
     453  $table = str_replace($GLOBALS['prefixeTable'], '', $table);
     454  if (isset($Enums[$table][$field])) {
     455    return $Enums[$table][$field];
     456  } else {
     457    return array();
     458  }
    447459}
    448460
Note: See TracChangeset for help on using the changeset viewer.