mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-01 20:04:51 +02:00
Fix get_enums function for SQLite
hard coded enums values for all tables because enum feature doesn't exists for SQLite. git-svn-id: http://piwigo.org/svn/trunk@6153 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -592,7 +592,6 @@ $template->assign('language_options', get_languages());
|
||||
$template->assign('language_selected',
|
||||
isset($_POST['pref_submit']) ? $_POST['language'] : get_default_language());
|
||||
|
||||
//Log::getInstance()->debug($status);
|
||||
// Status options
|
||||
foreach (get_enums(USER_INFOS_TABLE, 'status') as $status)
|
||||
{
|
||||
|
||||
@@ -431,7 +431,19 @@ function pwg_db_cast_to_text($string)
|
||||
*/
|
||||
function get_enums($table, $field)
|
||||
{
|
||||
return array();
|
||||
$Enums['categories']['status'] = array('public', 'private');
|
||||
$Enums['history']['section'] = array('categories','tags','search','list','favorites','most_visited','best_rated','recent_pics','recent_cats');
|
||||
$Enums['user_infos']['status'] = array('webmaster','admin','normal','generic','guest');
|
||||
$Enums['image']['type'] = array('picture','high','other');
|
||||
$Enums['plugins']['state'] = array('active', 'inactive');
|
||||
$Enums['user_cache_image']['access_type'] = array('NOT IN','IN');
|
||||
|
||||
$table = str_replace($GLOBALS['prefixeTable'], '', $table);
|
||||
if (isset($Enums[$table][$field])) {
|
||||
return $Enums[$table][$field];
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
// get_boolean transforms a string to a boolean value. If the string is
|
||||
|
||||
@@ -443,7 +443,19 @@ function pwg_db_cast_to_text($string)
|
||||
*/
|
||||
function get_enums($table, $field)
|
||||
{
|
||||
return array();
|
||||
$Enums['categories']['status'] = array('public', 'private');
|
||||
$Enums['history']['section'] = array('categories','tags','search','list','favorites','most_visited','best_rated','recent_pics','recent_cats');
|
||||
$Enums['user_infos']['status'] = array('webmaster','admin','normal','generic','guest');
|
||||
$Enums['image']['type'] = array('picture','high','other');
|
||||
$Enums['plugins']['state'] = array('active', 'inactive');
|
||||
$Enums['user_cache_image']['access_type'] = array('NOT IN','IN');
|
||||
|
||||
$table = str_replace($GLOBALS['prefixeTable'], '', $table);
|
||||
if (isset($Enums[$table][$field])) {
|
||||
return $Enums[$table][$field];
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
// get_boolean transforms a string to a boolean value. If the string is
|
||||
|
||||
Reference in New Issue
Block a user