aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-08-28 00:32:39 +0000
committerrvelices <rv-github@modusoptimus.com>2008-08-28 00:32:39 +0000
commitabb2f22b2e96a89a44ad9d36db3bf612c6f88b9f (patch)
treeca36d7b1bd7035f9952c4f564406eaa87c954cdb /admin/include
parent7f956e71b91f32ff6ca87ea6a0f56cc0f02c7005 (diff)
- based on test_menu by grum (thanks to you) - integration of dynamic menu bar to pwg
- the menubar is composed now of dynamic blocks that can be ordered/hidden - plugins can add their own blocks git-svn-id: http://piwigo.org/svn/trunk@2488 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions.php31
1 files changed, 24 insertions, 7 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 59c63ff0c..db95ab383 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1845,7 +1845,7 @@ UPDATE '.USER_CACHE_TABLE.'
*/
function create_table_add_character_set($query)
{
- defined('DB_CHARSET') or die('create_table_add_character_set DB_CHARSET undefined');
+ defined('DB_CHARSET') or trigger_error('create_table_add_character_set DB_CHARSET undefined', E_USER_ERROR);
if ('DB_CHARSET'!='')
{
if ( version_compare(mysql_get_server_info(), '4.1.0', '<') )
@@ -1853,17 +1853,34 @@ function create_table_add_character_set($query)
return $query;
}
$charset_collate = " DEFAULT CHARACTER SET ".DB_CHARSET;
- if ('DB_COLLATE'!='')
+ if (DB_COLLATE!='')
{
$charset_collate .= " COLLATE ".DB_COLLATE;
}
- $query=trim($query);
- $query=trim($query, ';');
- if (preg_match('/^CREATE\s+TABLE/i',$query))
+ if ( is_array($query) )
{
- $query.=$charset_collate;
+ foreach( $query as $id=>$q)
+ {
+ $q=trim($q);
+ $q=trim($q, ';');
+ if (preg_match('/^CREATE\s+TABLE/i',$q))
+ {
+ $q.=$charset_collate;
+ }
+ $q .= ';';
+ $query[$id] = $q;
+ }
+ }
+ else
+ {
+ $query=trim($query);
+ $query=trim($query, ';');
+ if (preg_match('/^CREATE\s+TABLE/i',$query))
+ {
+ $query.=$charset_collate;
+ }
+ $query .= ';';
}
- $query .= ';';
}
return $query;
}