1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-30 01:30:12 +02:00

Compare commits

...

245 Commits

Author SHA1 Message Date
Jakub Vrana
a59de5640c Release 3.2.0 2011-02-24 17:34:25 +01:00
Jakub Vrana
83d659ca42 Comments 2011-02-24 17:30:15 +01:00
Jakub Vrana
37cb691d8e Search for NULL foreign key (Editor) 2011-02-24 15:06:47 +01:00
Jakub Vrana
55bcd40dd5 Utilize table function 2011-02-24 14:48:40 +01:00
Jakub Vrana
b0cf430b2a Use function 2011-02-18 19:37:39 +01:00
Jakub Vrana
544b562cfe Simplify variables 2011-02-18 19:26:23 +01:00
Jakub Vrana
35c8c9224d Escaping 2011-02-18 16:18:14 +01:00
Jakub Vrana
6cb8749916 New plugin: Edit calendar 2011-02-18 16:16:36 +01:00
Jakub Vrana
f9287eef65 Use static variable instead of property 2011-02-17 21:39:20 +01:00
Jakub Vrana
3e94e9d5f9 Support SameOrigin 2011-02-17 21:22:21 +01:00
Jakub Vrana
5677bc4dd9 New plugin: Dump ZIP 2011-02-17 11:47:36 +01:00
Jakub Vrana
8ab6fffe74 Centralize dump_headers 2011-02-17 11:43:21 +01:00
Jakub Vrana
b1d8bfba36 Print <database> only once 2011-02-17 11:41:19 +01:00
Jakub Vrana
15cf62ce35 New plugins: version-noverify, frames 2011-02-17 09:52:40 +01:00
Jakub Vrana
052828422d Save complete original text 2011-02-15 19:42:22 +01:00
Jakub Vrana
eb41053c61 Improve work with references 2011-02-15 19:42:21 +01:00
Jakub Vrana
e4deeb61ba Utilize location.protocol 2011-02-15 18:11:43 +01:00
Jakub Vrana
15715b32ff Export SQL command result (bug #3116854) 2011-02-15 17:22:50 +01:00
Jakub Vrana
0836c34aef EnumOption plugin 2011-02-10 18:16:10 +01:00
Jakub Vrana
045bce3c9f Use editVal for set values 2011-02-10 11:05:40 +01:00
Jakub Vrana
24fac38d26 Better support for bit data type 2011-02-10 11:04:38 +01:00
Jakub Vrana
d663eed8a5 Update plugins 2011-02-09 22:06:08 +01:00
Jakub Vrana
26b475312d Update plugins 2011-02-09 21:15:34 +01:00
Jakub Vrana
cd6d2fc7a3 Typos 2011-02-09 18:39:25 +01:00
Jakub Vrana
4f9ff89fed Plugins 2011-02-09 18:09:01 +01:00
Jakub Vrana
37ecc2932b Don't call procedures by AJAX (may create tables) 2011-02-09 15:31:20 +01:00
Jakub Vrana
fa63eba7b9 Don't copy tables (to the same database) by AJAX 2011-02-09 15:29:51 +01:00
Jakub Vrana
1be289e8f5 Optimize compiling files 2011-02-09 15:28:45 +01:00
Jakub Vrana
ecc8166f08 Scroll to top with AJAX 2011-02-08 21:52:55 +01:00
Jakub Vrana
ad279e1171 Fix inline edit in IE8 (thanks to kozotoc) 2011-02-08 21:41:57 +01:00
Jakub Vrana
3eba7310da Fix saving schema to cookie in Opera and Firefox 4 2011-02-08 20:58:31 +01:00
Jakub Vrana
806264851e Use IS NULL operator for null value in where_link function 2011-02-08 19:59:16 +01:00
Jakub Vrana
bb4da636e9 Update translations 2011-02-08 19:58:33 +01:00
Jakub Vrana
1518d4bf64 Turkish translation 2011-02-08 19:57:06 +01:00
Jakub Vrana
99b980ab60 Avoid % with operator in Editor (forum 4090988) 2011-02-06 12:42:24 +01:00
Jakub Vrana
3fa68cef99 Slovenian translation 2011-02-06 12:32:00 +01:00
Jakub Vrana
cd68210224 Display upload_max_filesize 2011-02-03 10:21:07 +01:00
Jakub Vrana
a379bde2a4 Save bytes 2011-02-03 10:15:52 +01:00
Jakub Vrana
fb7b5ce29e No auto-focus with POST 2011-02-02 16:28:22 +01:00
Jakub Vrana
efd7b901a7 Avoid warning 2011-02-01 16:26:21 +01:00
Jakub Vrana
4cab347f92 Better auto-focus 2011-02-01 16:21:10 +01:00
Jakub Vrana
37d814649a Utilize oids in PostgreSQL 2011-02-01 16:19:39 +01:00
Jakub Vrana
741b19bc79 Copy tables (bug #3158027) 2011-02-01 14:12:22 +01:00
Jakub Vrana
c5b594d067 Call onchange 2011-02-01 14:11:25 +01:00
Jakub Vrana
ca4de555ba Whitespace 2011-02-01 10:16:31 +01:00
Jakub Vrana
b5a11cde84 Explain numbers 2011-01-31 21:01:07 +01:00
Jakub Vrana
f195903964 Use rel="noreferrer" for documentation links 2011-01-31 20:35:48 +01:00
Jakub Vrana
79fa7dab3b Minimize the chance of displaying message on different page (thanks to Tomas Brukner) 2011-01-31 20:09:08 +01:00
Jakub Vrana
ceef6bc6d3 Focus first field with insert (bug #3126501) 2011-01-31 15:57:28 +01:00
Jakub Vrana
e26b1864e3 Avoid fatal error (bug #3110257) 2011-01-31 15:49:07 +01:00
Jakub Vrana
1d47454079 Hide credentials for SQLite 2011-01-31 14:48:40 +01:00
Jakub Vrana
9e8ab1df31 Whitespace 2011-01-31 14:36:47 +01:00
Jakub Vrana
fbc668cfe3 Simplify JavaScript 2011-01-31 14:36:31 +01:00
Jakub Vrana
0997455fb6 Revert "Better <noscript> removal"
This reverts commit f40b874c0b.
2011-01-31 11:57:35 +01:00
Jakub Vrana
dfc03ca74a Comment 2011-01-31 11:02:00 +01:00
Jakub Vrana
56b0377451 Import supports TSV 2011-01-31 11:01:29 +01:00
Jakub Vrana
675ac01cc1 Ability to search by expression in select (bug #3158017) 2011-01-30 02:12:06 +01:00
Jakub Vrana
ae84525613 Save bytes 2011-01-30 02:12:06 +01:00
Jakub Vrana
241fc4ef6c Ctrl+Up and Down in edit and in-place edit 2011-01-25 17:13:57 +01:00
Jakub Vrana
0926122e14 Use password input for _md5 and _sha1 fields (Editor) 2011-01-25 16:40:33 +01:00
Jakub Vrana
fdea1970d0 Simplify AJAX redirect 2011-01-25 16:13:31 +01:00
Jakub Vrana
4a5eb8b408 Create table keyboard shortcuts: Ctrl+Up, Ctrl+Down 2011-01-25 15:26:13 +01:00
Jakub Vrana
57ec8f0266 Disable AJAX in database change 2011-01-24 15:58:46 +01:00
Jakub Vrana
12443f2f4c Send <input type='image'> by AJAX 2011-01-24 15:35:06 +01:00
Jakub Vrana
d6611f40cb Use generic AJAX 2011-01-24 14:15:44 +01:00
Jakub Vrana
684e70d07a Search for empty enum 2011-01-21 17:36:56 +01:00
Jakub Vrana
f40b874c0b Better <noscript> removal 2011-01-21 17:36:50 +01:00
Jakub Vrana
39d52932f2 Save dump options to cookie 2011-01-21 11:23:31 +01:00
Jakub Vrana
d893e45162 Disable wrap in SQL textarea 2011-01-21 11:23:30 +01:00
Jakub Vrana
ef9d6d4512 Save memory 2011-01-20 23:12:34 +01:00
Jakub Vrana
33aec2c764 Move <td> from Adminer::backwardKeysPrint 2011-01-18 17:33:17 +01:00
Jakub Vrana
c0682062ca Use $adminer->editVal in enum_input function 2011-01-18 14:06:23 +01:00
Jakub Vrana
5b6b0e1b85 Case insensitive M:N relation 2011-01-18 11:25:53 +01:00
Jakub Vrana
13155372b5 No error for big text length (bug #264133) 2011-01-10 17:23:47 +01:00
Jakub Vrana
5e4450ba11 Ability to delete blob (Editor) 2011-01-10 16:56:51 +01:00
Jakub Vrana
3a11358dc7 Use IN for search in numeric fields (Editor) 2011-01-06 09:45:45 +01:00
Jakub Vrana
21192be01e Typo 2011-01-06 09:30:19 +01:00
Jakub Vrana
7416164966 Homepage customization 2011-01-06 09:30:07 +01:00
Jakub Vrana
d7a3e415d5 Don't use AJAX with Alt 2011-01-03 16:53:50 +01:00
Jakub Vrana
10ff7870f5 Change language by JS for AJAX 2011-01-03 16:29:01 +01:00
Jakub Vrana
e37c427e87 Function get_lang useful for customization 2010-12-30 13:53:39 +01:00
Jakub Vrana
fce2312c55 Avoid nowrap on printer 2010-12-30 13:30:08 +01:00
Jakub Vrana
876af58944 Fix sid function 2010-12-30 10:58:26 +01:00
Jakub Vrana
29d7d6ce52 Modify dump link in AJAX 2010-12-30 10:58:26 +01:00
Jakub Vrana
61b1fd57e0 Permanent link in schema 2010-12-30 10:57:23 +01:00
Jakub Vrana
850d1aa130 Report errors only 2010-12-29 17:28:53 +01:00
Jakub Vrana
ed85096367 Avoid double usage of fieldName function 2010-12-28 12:32:47 +01:00
Jakub Vrana
f30fd121c1 Work without session.use_cookies (bug #3138640) 2010-12-20 18:09:13 +01:00
Jakub Vrana
0449351a60 Report errors only in primary connection 2010-12-17 18:25:24 +01:00
Jakub Vrana
9eced7872d Display total time in show only errors mode in SQL command 2010-12-17 18:11:06 +01:00
Jakub Vrana
d7fdd06f12 Comment 2010-12-17 17:13:07 +01:00
Jakub Vrana
be58b9cdbc Escape \n in JSON 2010-12-16 22:52:03 +01:00
Jakub Vrana
991944e82b Fix partitions count (thanks to Igor Aufricht) 2010-12-16 10:52:59 +01:00
Jakub Vrana
fe0866724d Portuguese translation 2010-12-15 18:00:20 +01:00
Jakub Vrana
c29562d369 Declare global variables to allow including from inside a function 2010-12-15 17:41:04 +01:00
Jakub Vrana
5a2c0646d4 Link to EXPLAIN output 2010-12-10 17:54:57 +01:00
Jakub Vrana
3fad0c6ef7 Show number of connections (thanks to fos4) 2010-12-10 17:08:07 +01:00
Jakub Vrana
8a6669f4fa Shorten query in processlist (thanks to fos4) 2010-12-10 17:05:30 +01:00
Jakub Vrana
30c4bec9a7 Auto-select index type after selecting column 2010-12-10 01:16:01 +01:00
Jakub Vrana
79c145a108 Remove <noscript> in AJAX 2010-12-10 01:09:19 +01:00
Jakub Vrana
16c7dc6bb6 Auto focus new table name 2010-12-08 00:42:22 +01:00
Jakub Vrana
c8b14a1eff Default type is int or integer 2010-12-08 00:25:01 +01:00
Jakub Vrana
694a3420fa No AJAX for right-click 2010-12-06 01:13:03 +01:00
Jakub Vrana
5f9282f132 No AJAX for non-HTML output 2010-12-06 01:12:55 +01:00
Jakub Vrana
fc6e71a930 Disable AJAX export 2010-12-03 19:42:10 +01:00
Jakub Vrana
53409fcbe8 AJAX: fix active link 2010-12-03 19:42:10 +01:00
Jakub Vrana
08d51f2ecf Fix index length 2010-12-03 16:13:01 +01:00
Jakub Vrana
01125fd24e Fix event.returnValue 2010-12-03 13:40:37 +01:00
Jakub Vrana
f2c34f43dc Avoid fatal error 2010-12-02 09:56:10 +01:00
Jakub Vrana
9bb0fdc91b Display login in auth form (regression) 2010-12-01 18:44:17 +01:00
Jakub Vrana
ac8ff42689 Typo 2010-12-01 17:49:10 +01:00
Jakub Vrana
ddaa8947ee History: edit all 2010-12-01 09:40:39 +01:00
Jakub Vrana
02d6b90889 CR+LF in CSV export 2010-12-01 09:39:47 +01:00
Jakub Vrana
d0cf5a863f Create table options width 2010-11-29 22:08:42 +01:00
Jakub Vrana
06a916102d Disable AJAX for schema change 2010-11-29 22:02:11 +01:00
Jakub Vrana
a4982c90e0 MS SQL: Create primary key for Auto Increment column 2010-11-29 22:02:11 +01:00
Jakub Vrana
d7079f1778 MS SQL: Foreign key in create table 2010-11-29 22:02:11 +01:00
Jakub Vrana
e86c15479f Reset value for NULL in inline edit 2010-11-29 22:02:11 +01:00
Jakub Vrana
9f69d7ae93 MS SQL: Do not update AI value 2010-11-29 22:02:10 +01:00
Jakub Vrana
4a2fe5eac1 MS SQL: Foreign key in create table 2010-11-29 22:02:10 +01:00
Jakub Vrana
ca27ffc2c4 Display 0 in SQLite (bug #3120685) 2010-11-29 11:12:06 +01:00
Jakub Vrana
8c10fc05f4 Don't print error message with no error (bug #3118538) 2010-11-26 14:13:38 +01:00
Jakub Vrana
50bb1f8d84 Fix active class 2010-11-26 13:06:07 +01:00
Jakub Vrana
e197ccd433 Respect error in EXPLAIN (bug #3118536) 2010-11-26 11:09:50 +01:00
Jakub Vrana
3e1fca97be Utilize js_escape 2010-11-26 10:59:16 +01:00
Jakub Vrana
b7cd6520af No AJAX in drop table, drop database and logout 2010-11-26 10:58:22 +01:00
Jakub Vrana
8194002102 AJAX only with login 2010-11-26 10:32:30 +01:00
Jakub Vrana
8ce9ba616d Don't rely on headers_sent 2010-11-25 10:40:16 +01:00
Jakub Vrana
87fa3d45d7 Don't send login form by AJAX 2010-11-25 10:31:35 +01:00
Jakub Vrana
38894b2977 Send all forms by AJAX 2010-11-23 13:01:30 +01:00
Jakub Vrana
0e29a6a783 AJAX title 2010-11-22 18:13:07 +01:00
Jakub Vrana
341290ce12 Run <script> in AJAX 2010-11-22 18:00:53 +01:00
Jakub Vrana
6585b23ba8 Generic AJAX links 2010-11-22 18:00:53 +01:00
Jakub Vrana
8ad4809bc0 Use class="active" instead of <b> 2010-11-22 18:00:53 +01:00
Jakub Vrana
c108c7a96f Specify UTF-8 (bug #3097662) 2010-11-19 16:14:17 +01:00
Jakub Vrana
9b267eeceb Finish PDO_OCI 2010-11-19 16:13:49 +01:00
Jakub Vrana
4c9044800d Refresh breadcrumb and title in AJAX 2010-11-19 15:50:56 +01:00
Jakub Vrana
a97c45fc9b Utilize innerText or textContent in inline edit 2010-11-19 15:50:55 +01:00
Jakub Vrana
fe2d55ac00 Caret is at the end after setting the value 2010-11-19 15:50:09 +01:00
Jakub Vrana
71438d57c3 Handle keypress instead of keydown (bug #3112458) 2010-11-19 15:07:06 +01:00
Jakub Vrana
293fc0fd60 Merge branch ajax 2010-11-16 13:47:57 +01:00
Jakub Vrana
48ba0c44f9 Release 3.1.0 2010-11-16 13:18:24 +01:00
Jakub Vrana
7dc1fc7ad4 Update translations 2010-11-16 11:18:36 +01:00
Jakub Vrana
b4b59779b9 Include only active translations 2010-11-15 16:54:08 +01:00
Jakub Vrana
8db1469dbc Text direction 2010-11-15 16:24:54 +01:00
Jakub Vrana
d0106295f7 Update translations 2010-11-15 16:20:50 +01:00
Jakub Vrana
caf1ba8af5 Bump version 2010-11-12 18:07:29 +01:00
Jakub Vrana
87d617c68d No extra newline for English 2010-11-12 18:00:19 +01:00
Jakub Vrana
3d4b831280 Whitespace 2010-11-12 17:55:13 +01:00
Jakub Vrana
9802869d0a Merge from master 2010-11-12 17:52:09 +01:00
Jakub Vrana
d8c7ea9837 Highlighting only inside <code> 2010-11-12 17:17:46 +01:00
Jakub Vrana
b535853694 Full AJAX only with pushState to work correctly with history 2010-11-12 17:09:54 +01:00
Jakub Vrana
af0cacba90 Update translations 2010-11-12 14:05:02 +01:00
Jakub Vrana
620df3c44a Move up create table link (thanks to Filip Prochazka) 2010-11-11 13:40:04 +01:00
Jakub Vrana
f4256013a9 Hide hidden columns in PostgreSQL (thanks to Pavel Stehule) 2010-11-11 10:51:20 +01:00
Jakub Vrana
540de0b7c9 RTL text direction support 2010-11-11 10:12:26 +01:00
Jakub Vrana
5bfeeef402 Update translations 2010-11-11 10:00:57 +01:00
Jakub Vrana
7d052b2680 Arabic translation 2010-11-10 17:44:38 +01:00
Jakub Vrana
8aac3b6e05 Dual licensing: Apache or GPL 2010-11-09 12:59:51 +01:00
Jakub Vrana
15ccbec1fd Comments 2010-11-08 09:49:42 +01:00
Jakub Vrana
2ebf4d75d1 Offset probably required in fetch_field (bug #3100185) 2010-11-04 09:51:23 +01:00
Jakub Vrana
014373ca82 Hide hashes in select 2010-11-04 09:51:23 +01:00
Jakub Vrana
7abc734607 Comment 2010-11-04 09:51:23 +01:00
Jakub Vrana
9e51a1d890 Breadcrumb on No extension page 2010-11-04 00:12:01 +01:00
Jakub Vrana
865453f7c9 Comments 2010-11-04 00:00:45 +01:00
Jakub Vrana
cec86f5f9d Link to refresh database cache (bug #3102451) 2010-11-03 23:59:49 +01:00
Jakub Vrana
81f58ed909 Link more foreign keys 2010-11-03 08:40:10 +01:00
Jakub Vrana
c64557aaf5 Support 'character varying' 2010-11-01 16:10:17 +01:00
Jakub Vrana
dca7c51bd3 Hidden Polish translation 2010-11-01 01:22:02 +01:00
Jakub Vrana
9cdeb31ca7 Improve description 2010-10-30 15:25:30 +02:00
Jakub Vrana
5a99ef5cf0 Save bytes 2010-10-30 09:21:42 +02:00
Jakub Vrana
bec5ef28ec Comments 2010-10-30 01:56:49 +02:00
Jakub Vrana
e225d22f97 TSV export and import (bug #3097657) 2010-10-29 18:02:20 +02:00
Jakub Vrana
772f71a780 Print CSV header only in CSV 2010-10-29 17:51:52 +02:00
Jakub Vrana
e908155196 Increase version 2010-10-29 17:44:22 +02:00
Jakub Vrana
164cd3bbb8 Report errors in data export 2010-10-29 17:29:35 +02:00
Jakub Vrana
be3410f822 Simplify dumpOutput, dumpFormat and dumpData methods 2010-10-29 17:23:03 +02:00
Jakub Vrana
095d472366 Customizable export 2010-10-29 17:03:02 +02:00
Jakub Vrana
a2443670f8 Always display all drivers (bug #3097666) 2010-10-29 15:24:06 +02:00
Jakub Vrana
753909ecea Support for virtual foreign keys 2010-10-29 14:01:19 +02:00
Jakub Vrana
43f936a0d8 Links 2010-10-29 00:26:47 +02:00
Jakub Vrana
b05684a5c9 Order by DESC with grouping 2010-10-24 11:52:01 +02:00
Jakub Vrana
8aeb9be791 Show hash columns 2010-10-24 11:43:03 +02:00
Jakub Vrana
9bc9b9fa3a Don't overwrite variable 2010-10-24 11:36:32 +02:00
Jakub Vrana
c918bc83f3 Use shortest PostgreSQL $$ 2010-10-24 08:25:40 +02:00
Jakub Vrana
b7b40b5bd9 Link to bookmark SQL command 2010-10-24 00:45:12 +02:00
Jakub Vrana
b69f9b4a60 Parse MS SQL identifiers 2010-10-24 00:35:27 +02:00
Jakub Vrana
aa1bed7249 Parse PostgreSQL multiline strings 2010-10-24 00:24:32 +02:00
Jakub Vrana
7e5bf6e383 Use DELIMITER only in MySQL 2010-10-24 00:03:13 +02:00
Jakub Vrana
fe0690851f Allow redefining editInput for enum (bug #3048711) 2010-10-23 00:28:48 +02:00
Jakub Vrana
677687fc1a Don't highlight empty queries 2010-10-23 00:02:46 +02:00
Jakub Vrana
5002b89bd5 Big numbers without E 2010-10-23 00:02:24 +02:00
Jakub Vrana
e9ae743578 Fix set prefill 2010-10-22 23:38:57 +02:00
Jakub Vrana
04eccbad62 Allow bigger numbers under 32 bits 2010-10-22 23:36:56 +02:00
Jakub Vrana
28f21aaa6c Escape JavaScript strings (bug #3093243) 2010-10-22 23:07:30 +02:00
Jakub Vrana
7d601c07fc Allow only apostrophes in enums
Use possessive quantifier in enum to fit in backtrack limit
2010-10-22 22:42:40 +02:00
Jakub Vrana
3da0f3be13 Timestamp in export 2010-10-22 21:46:35 +02:00
Jakub Vrana
b3c8d71163 Print data in only_errors mode (important for ALTER export) 2010-10-22 21:27:38 +02:00
Jakub Vrana
6775ac1296 Whitespace 2010-10-22 16:27:16 +02:00
Jakub Vrana
178e23dfe2 Categorize translations 2010-10-22 16:26:31 +02:00
Jakub Vrana
606b10c5e6 Update changes 2010-10-22 14:34:16 +02:00
Jakub Vrana
18e158fcdf Option to show only errors in SQL command 2010-10-22 14:31:46 +02:00
Jakub Vrana
b12756643f Comment 2010-10-22 14:25:56 +02:00
Jakub Vrana
07df8c63c9 Fix translation 2010-10-20 22:53:15 +02:00
Jakub Vrana
1ee0e69b7b Comments 2010-10-20 22:47:15 +02:00
Jakub Vrana
c1363a6ae4 Update translation 2010-10-20 22:44:06 +02:00
Jakub Vrana
0f3a525801 Uses own XSS protection 2010-10-20 22:27:51 +02:00
Jakub Vrana
cb153ac0d1 Auto-focus database name 2010-10-20 12:40:27 +02:00
Jakub Vrana
97344335e7 Improve favicon (thanks to tiso) 2010-10-20 10:19:11 +02:00
Jakub Vrana
b37435d716 Don't use AJAX with Ctrl 2010-10-20 00:15:33 +02:00
Jakub Vrana
8e02d5dfd3 Update TODO 2010-10-19 17:46:28 +02:00
Jakub Vrana
9d47d1e64d Whitespace 2010-10-19 17:29:27 +02:00
Jakub Vrana
84d9ecf0c9 Highlight and edit SQL command in processlist 2010-10-19 16:54:48 +02:00
Jakub Vrana
0ba6eaa3e2 Handle sending the form without AJAX after AJAX request 2010-10-19 16:44:12 +02:00
Jakub Vrana
0311083b49 Comment 2010-10-19 13:28:43 +02:00
Jakub Vrana
dfa1a98829 Merge branch 'master' into ajax 2010-10-19 01:45:48 +02:00
Jakub Vrana
c313dd83a2 Deferred operations by AJAX instead of JS (doesn't require sending token) 2010-10-19 01:40:49 +02:00
Jakub Vrana
1b66afcb82 Disable repetitive events as soon as possible 2010-10-19 01:06:30 +02:00
Jakub Vrana
772f05178d Files can be disabled 2010-10-19 00:58:45 +02:00
Jakub Vrana
c5ee9778b4 Set in-place input name after value to never send empty data 2010-10-19 00:57:37 +02:00
Jakub Vrana
4fe9b606ec Don't send SQL commands by AJAX (can change navigation and flushes output) 2010-10-19 00:22:09 +02:00
Jakub Vrana
21e70bc00f IE compatibility 2010-10-19 00:11:54 +02:00
Jakub Vrana
a93bc19108 Create confirm function 2010-10-18 23:57:39 +02:00
Jakub Vrana
d9fbb905f3 SQL command by AJAX 2010-10-18 23:44:00 +02:00
Jakub Vrana
b50a0fc615 Disable zend.ze1_compatibility_mode (bug #3089645) 2010-10-18 23:09:26 +02:00
Jakub Vrana
6e3c7cba1f Use AJAX for pagination 2010-10-18 22:39:17 +02:00
Jakub Vrana
31afb968bc Last page with empty result (thanks to Frantisek Svoboda) 2010-10-18 22:20:17 +02:00
Jakub Vrana
d8d419317d Last page with empty result (thanks to Frantisek Svoboda) 2010-10-18 22:17:43 +02:00
Jakub Vrana
7f15b99d8f Maria renamed to Aria 2010-10-18 18:26:21 +02:00
Jakub Vrana
388680ac62 Maria renamed to Aria 2010-10-18 16:56:10 +02:00
Jakub Vrana
390e38b8f5 Load long texts for inline-edit by AJAX
Display link to current page only under AJAX
2010-10-18 13:57:22 +02:00
Jakub Vrana
3a1fcdba4e Develop 2010-10-18 10:34:47 +02:00
Jakub Vrana
78adfc2e3a Cancel link for multi-edit 2010-10-18 07:54:08 +02:00
Jakub Vrana
a1f2769309 Merge branch 'master' into ajax 2010-10-18 07:52:49 +02:00
Jakub Vrana
28f494783f Multi save and delete by AJAX 2010-10-18 07:43:50 +02:00
Jakub Vrana
e3b829701e Save and continue by AJAX 2010-10-18 00:09:29 +02:00
Jakub Vrana
de24145d81 Clear POST with AJAX redirect 2010-10-18 00:05:39 +02:00
Jakub Vrana
a93e069d06 Edit, clone and delete by AJAX 2010-10-17 23:54:41 +02:00
Jakub Vrana
41f4c62fcd Change message to "increase Text length" 2010-10-17 16:07:09 +02:00
Jakub Vrana
d82e69636c Minimal inline edit input width 2010-10-17 16:00:29 +02:00
Jakub Vrana
1a5bec94d9 Send the form by AJAX with Ctrl+Enter 2010-10-17 08:02:12 +02:00
Jakub Vrana
ea38096433 Merge from master 2010-10-17 07:55:58 +02:00
Jakub Vrana
a6bbe1bb3b Save select data by AJAX 2010-10-17 07:50:40 +02:00
Jakub Vrana
8d4b241156 Save bytes 2010-10-17 07:19:01 +02:00
Jakub Vrana
7eb85a75f8 Use AJAX in select 2010-10-17 02:22:22 +02:00
94 changed files with 4142 additions and 1160 deletions

9
.gitmodules vendored
View File

@@ -4,3 +4,12 @@
[submodule "jsmin-php"]
path = externals/jsmin-php
url = git://github.com/rgrove/jsmin-php.git
[submodule "tinymce"]
path = externals/tinymce
url = git://github.com/tinymce/tinymce.git
[submodule "jquery-ui"]
path = externals/jquery-ui
url = git://github.com/jquery/jquery-ui.git
[submodule "jquery-timepicker"]
path = externals/jquery-timepicker
url = git://github.com/trentrichardson/jQuery-Timepicker-Addon.git

View File

@@ -57,8 +57,13 @@ if ($in) {
$name = $field["field"];
echo "<tr><th>" . $adminer->fieldName($field);
$value = $_POST["fields"][$name];
if ($value != "" && ereg("enum|set", $field["type"])) {
$value = intval($value);
if ($value != "") {
if ($field["type"] == "enum") {
$value = +$value;
}
if ($field["type"] == "set") {
$value = array_sum($value);
}
}
input($field, $value, (string) $_POST["function"][$name]); // param name can be empty
echo "\n";

View File

@@ -44,7 +44,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
$fields[] = array($field["orig"], $process_field, $after);
}
if (isset($foreign_key)) {
$foreign[] = ($TABLE != "" ? "ADD" : " ") . " FOREIGN KEY (" . idf_escape($field["field"]) . ") REFERENCES " . idf_escape($foreign_keys[$field["type"]]) . " (" . idf_escape($type_field["field"]) . ")" . (in_array($field["on_delete"], $on_actions) ? " ON DELETE $field[on_delete]" : "");
$foreign[idf_escape($field["field"])] = ($TABLE != "" ? "ADD" : " ") . " FOREIGN KEY (" . idf_escape($field["field"]) . ") REFERENCES " . table($foreign_keys[$field["type"]]) . " (" . idf_escape($type_field["field"]) . ")" . (in_array($field["on_delete"], $on_actions) ? " ON DELETE $field[on_delete]" : "");
}
$after = "AFTER " . idf_escape($field["field"]);
} elseif ($field["orig"] != "") {
@@ -65,7 +65,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
}
$partitioning .= "\nPARTITION BY $_POST[partition_by]($_POST[partition])" . ($partitions // $_POST["partition"] can be expression, not only column
? " (" . implode(",", $partitions) . "\n)"
: ($_POST["partitions"] ? " PARTITIONS " . intval($_POST["partitions"]) : "")
: ($_POST["partitions"] ? " PARTITIONS " . (+$_POST["partitions"]) : "")
);
} elseif ($TABLE != "" && support("partitioning")) {
$partitioning .= "\nREMOVE PARTITIONING";
@@ -83,7 +83,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
$_POST["Comment"],
($_POST["Engine"] && $_POST["Engine"] != $orig_status["Engine"] ? $_POST["Engine"] : ""),
($_POST["Collation"] && $_POST["Collation"] != $orig_status["Collation"] ? $_POST["Collation"] : ""),
($_POST["Auto_increment"] != "" ? preg_replace('~\\D+~', '', $_POST["Auto_increment"]) : ""),
($_POST["Auto_increment"] != "" ? +$_POST["Auto_increment"] : ""),
$partitioning
));
}
@@ -93,7 +93,7 @@ page_header(($TABLE != "" ? lang('Alter table') : lang('Create table')), $error,
$row = array(
"Engine" => $_COOKIE["adminer_engine"],
"fields" => array(array("field" => "")),
"fields" => array(array("field" => "", "type" => (isset($types["int"]) ? "int" : (isset($types["integer"]) ? "integer" : "")))),
"partition_names" => array(""),
);
if ($_POST) {
@@ -118,7 +118,7 @@ if ($_POST) {
}
if (support("partitioning")) {
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . q(DB) . " AND TABLE_NAME = " . q($TABLE);
$result = $connection->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $from ORDER BY PARTITION_ORDINAL_POSITION LIMIT 1");
$result = $connection->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
list($row["partition_by"], $row["partitions"], $row["partition"]) = $result->fetch_row();
$row["partition_names"] = array();
$row["partition_values"] = array();
@@ -149,6 +149,7 @@ foreach ($engines as $engine) {
<form action="" method="post" id="form">
<p>
<?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo h($row["name"]); ?>">
<?php if ($TABLE == "" && !$_POST) { ?><script type='text/javascript'>document.getElementById('form')['name'].focus();</script><?php } ?>
<?php echo ($engines ? html_select("Engine", array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) : ""); ?>
<?php echo ($collations && !ereg("sqlite|mssql", $jush) ? html_select("Collation", array("" => "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?>
<input type="submit" value="<?php echo lang('Save'); ?>">
@@ -157,14 +158,12 @@ foreach ($engines as $engine) {
</table>
<p>
<?php echo lang('Auto Increment'); ?>: <input name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>">
<script type="text/javascript">
document.write('<label><input type="checkbox" onclick="columnShow(this.checked, 5);"><?php echo lang('Default values'); ?><\/label>');
</script>
<label><input type="checkbox" onclick="columnShow(this.checked, 5);"><?php echo lang('Default values'); ?></label>
<?php echo (support("comment") ? checkbox("", "", $comments, lang('Comment'), "columnShow(this.checked, 6); toggle('Comment'); if (this.checked) this.form['Comment'].focus();") . ' <input id="Comment" name="Comment" value="' . h($row["Comment"]) . '" maxlength="60"' . ($comments ? '' : ' class="hidden"') . '>' : ''); ?>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if (strlen($_GET["create"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
<?php if (strlen($_GET["create"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
<?php
if (support("partitioning")) {
$partition_table = ereg('RANGE|LIST', $row["partition_by"]);

View File

@@ -57,15 +57,16 @@ if ($_POST) {
<p>
<?php
echo ($_POST["add_x"] || strpos($name, "\n")
? '<textarea name="name" rows="10" cols="40" onkeydown="return textareaKeydown(this, event);">' . h($name) . '</textarea><br>'
: '<input name="name" value="' . h($name) . '" maxlength="64">'
? '<textarea id="name" name="name" rows="10" cols="40" onkeypress="return textareaKeypress(this, event);">' . h($name) . '</textarea><br>'
: '<input id="name" name="name" value="' . h($name) . '" maxlength="64">'
) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $collate) : "");
?>
<script type='text/javascript'>document.getElementById('name').focus();</script>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php
if (DB != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n";
} elseif (!$_POST["add_x"] && $_GET["db"] == "") {
echo "<input type='image' name='add' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>\n";
}

View File

@@ -4,7 +4,7 @@ $tables_views = array_merge((array) $_POST["tables"], (array) $_POST["views"]);
if ($tables_views && !$error && !$_POST["search"]) {
$result = true;
$message = "";
if ($jush == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"])) {
if ($jush == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"] || $_POST["copy"])) {
queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once
}
if ($_POST["truncate"]) {
@@ -15,6 +15,9 @@ if ($tables_views && !$error && !$_POST["search"]) {
} elseif ($_POST["move"]) {
$result = move_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]);
$message = lang('Tables have been moved.');
} elseif ($_POST["copy"]) {
$result = copy_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]);
$message = lang('Tables have been copied.');
} elseif ($_POST["drop"]) {
if ($_POST["views"]) {
$result = drop_views($_POST["views"]);
@@ -32,131 +35,131 @@ if ($tables_views && !$error && !$_POST["search"]) {
}
page_header(($_GET["ns"] == "" ? lang('Database') . ": " . h(DB) : lang('Schema') . ": " . h($_GET["ns"])), $error, true);
echo '<p>' . ($_GET["ns"] == "" ? '<a href="' . h(ME) . 'database=">' . lang('Alter database') . "</a>\n" : "");
if (support("scheme")) {
echo "<a href='" . h(ME) . "scheme='>" . ($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema')) . "</a>\n";
}
if ($_GET["ns"] !== "") {
echo '<a href="' . h(ME) . 'schema=">' . lang('Database schema') . "</a>\n";
echo "<h3>" . lang('Tables and views') . "</h3>\n";
$tables_list = tables_list();
if (!$tables_list) {
echo "<p class='message'>" . lang('No tables.') . "\n";
} else {
echo "<form action='' method='post'>\n";
echo "<p>" . lang('Search data in tables') . ": <input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' name='search' value='" . lang('Search') . "'>\n";
if ($_POST["search"] && $_POST["query"] != "") {
search_tables();
}
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);"><th>' . lang('Table') . '<td>' . lang('Engine') . '<td>' . lang('Collation') . '<td>' . lang('Data Length') . '<td>' . lang('Index Length') . '<td>' . lang('Data Free') . '<td>' . lang('Auto Increment') . '<td>' . lang('Rows') . (support("comment") ? '<td>' . lang('Comment') : '') . "</thead>\n";
foreach ($tables_list as $name => $type) {
$view = (isset($type) && !eregi("table", $type));
echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');");
echo '<th><a href="' . h(ME) . 'table=' . urlencode($name) . '">' . h($name) . '</a>';
if ($view) {
echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '">' . lang('View') . '</a>';
echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '">?</a>';
} else {
echo "<td id='Engine-" . h($name) . "'>&nbsp;<td id='Collation-" . h($name) . "'>&nbsp;";
foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "auto_increment=1&create", "Rows" => "select") as $key => $link) {
echo "<td align='right'><a href='" . h(ME . "$link=") . urlencode($name) . "' id='$key-" . h($name) . "'>?</a>";
if ($adminer->homepage()) {
if ($_GET["ns"] !== "") {
echo '<a href="' . h(ME) . 'schema=">' . lang('Database schema') . "</a>\n";
echo "<h3>" . lang('Tables and views') . "</h3>\n";
$tables_list = tables_list();
if (!$tables_list) {
echo "<p class='message'>" . lang('No tables.') . "\n";
} else {
echo "<form action='' method='post'>\n";
echo "<p>" . lang('Search data in tables') . ": <input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' name='search' value='" . lang('Search') . "'>\n";
if ($_POST["search"] && $_POST["query"] != "") {
search_tables();
}
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);"><th>' . lang('Table') . '<td>' . lang('Engine') . '<td>' . lang('Collation') . '<td>' . lang('Data Length') . '<td>' . lang('Index Length') . '<td>' . lang('Data Free') . '<td>' . lang('Auto Increment') . '<td>' . lang('Rows') . (support("comment") ? '<td>' . lang('Comment') : '') . "</thead>\n";
foreach ($tables_list as $name => $type) {
$view = (isset($type) && !eregi("table", $type));
echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');");
echo '<th><a href="' . h(ME) . 'table=' . urlencode($name) . '">' . h($name) . '</a>';
if ($view) {
echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '">' . lang('View') . '</a>';
echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '">?</a>';
} else {
foreach (array("Engine" => "", "Collation" => "", "Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "auto_increment=1&create", "Rows" => "select") as $key => $link) {
echo ($link ? "<td align='right'><a href='" . h(ME . "$link=") . urlencode($name) . "' id='$key-" . h($name) . "'>?</a>" : "<td id='$key-" . h($name) . "'>&nbsp;");
}
}
echo (support("comment") ? "<td id='Comment-" . h($name) . "'>&nbsp;" : "");
}
echo "<tr><td>&nbsp;<th>" . lang('%d in total', count($tables_list));
echo "<td>" . nbsp($connection->result("SELECT @@storage_engine"));
echo "<td>" . nbsp(db_collation(DB, collations()));
foreach (array("Data_length", "Index_length", "Data_free") as $key) {
echo "<td align='right' id='sum-$key'>&nbsp;";
}
echo "</table>\n";
if (!information_schema(DB)) {
echo "<p><input type='hidden' name='token' value='$token'>" . ($jush == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'> <input type='submit' name='optimize' value='" . lang('Optimize') . "'> <input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate') . "'" . confirm("formChecked(this, /tables/)") . "> <input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /tables|views/)", 1) . ">\n"; // 1 - eventStop
$databases = (support("scheme") ? schemas() : get_databases());
if (count($databases) != 1 && $jush != "sqlite") {
$db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
echo "<p>" . lang('Move to other database') . ": ";
echo ($databases ? html_select("target", $databases, $db) : '<input name="target" value="' . h($db) . '">');
echo " <input type='submit' name='move' value='" . lang('Move') . "' onclick='eventStop(event);'>";
echo (support("copy") ? " <input type='submit' name='copy' value='" . lang('Copy') . "' onclick='eventStop(event);'>" : "");
echo "\n";
}
}
echo (support("comment") ? "<td id='Comment-" . h($name) . "'>&nbsp;" : "");
echo "</form>\n";
}
echo "<tr><td>&nbsp;<th>" . lang('%d in total', count($tables_list));
echo "<td>" . nbsp($connection->result("SELECT @@storage_engine"));
echo "<td>" . nbsp(db_collation(DB, collations()));
foreach (array("Data_length", "Index_length", "Data_free") as $key) {
echo "<td align='right' id='sum-$key'>&nbsp;";
echo '<p><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n";
if (support("view")) {
echo '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n";
}
echo "</table>\n";
if (!information_schema(DB)) {
echo "<p><input type='hidden' name='token' value='$token'>" . ($jush == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'> <input type='submit' name='optimize' value='" . lang('Optimize') . "'> <input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables/) + ')');\"> <input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables|views/) + ')');\">\n";
$databases = (support("scheme") ? schemas() : get_databases());
if (count($databases) != 1 && $jush != "sqlite") {
$db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
echo "<p>" . lang('Move to other database') . ($databases ? ": " . html_select("target", $databases, $db) : ': <input name="target" value="' . h($db) . '">') . " <input type='submit' name='move' value='" . lang('Move') . "'>\n";
}
}
echo "</form>\n";
}
echo '<p><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n";
if (support("view")) {
echo '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n";
}
if (support("routine")) {
echo "<h3>" . lang('Routines') . "</h3>\n";
$routines = routines();
if ($routines) {
echo "<table cellspacing='0'>\n";
echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td>&nbsp;</thead>\n";
odd('');
foreach ($routines as $row) {
echo '<tr' . odd() . '>';
echo '<th><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . h($row["ROUTINE_NAME"]) . '</a>';
echo '<td>' . h($row["ROUTINE_TYPE"]);
echo '<td>' . h($row["DTD_IDENTIFIER"]);
echo '<td><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a>";
if (support("routine")) {
echo "<h3>" . lang('Routines') . "</h3>\n";
$routines = routines();
if ($routines) {
echo "<table cellspacing='0'>\n";
echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td>&nbsp;</thead>\n";
odd('');
foreach ($routines as $row) {
echo '<tr' . odd() . '>';
echo '<th><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . h($row["ROUTINE_NAME"]) . '</a>';
echo '<td>' . h($row["ROUTINE_TYPE"]);
echo '<td>' . h($row["DTD_IDENTIFIER"]);
echo '<td><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a>";
}
echo "</table>\n";
}
echo "</table>\n";
echo '<p><a href="' . h(ME) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . h(ME) . 'function=">' . lang('Create function') . "</a>\n";
}
echo '<p><a href="' . h(ME) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . h(ME) . 'function=">' . lang('Create function') . "</a>\n";
}
if (support("sequence")) {
echo "<h3>" . lang('Sequences') . "</h3>\n";
$sequences = get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema()");
if ($sequences) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
odd('');
foreach ($sequences as $val) {
echo "<tr" . odd() . "><th><a href='" . h(ME) . "sequence=" . urlencode($val) . "'>" . h($val) . "</a>\n";
if (support("sequence")) {
echo "<h3>" . lang('Sequences') . "</h3>\n";
$sequences = get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema()");
if ($sequences) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
odd('');
foreach ($sequences as $val) {
echo "<tr" . odd() . "><th><a href='" . h(ME) . "sequence=" . urlencode($val) . "'>" . h($val) . "</a>\n";
}
echo "</table>\n";
}
echo "</table>\n";
echo "<p><a href='" . h(ME) . "sequence='>" . lang('Create sequence') . "</a>\n";
}
echo "<p><a href='" . h(ME) . "sequence='>" . lang('Create sequence') . "</a>\n";
}
if (support("type")) {
echo "<h3>" . lang('User types') . "</h3>\n";
$types = types();
if ($types) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
odd('');
foreach ($types as $val) {
echo "<tr" . odd() . "><th><a href='" . h(ME) . "type=" . urlencode($val) . "'>" . h($val) . "</a>\n";
if (support("type")) {
echo "<h3>" . lang('User types') . "</h3>\n";
$types = types();
if ($types) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
odd('');
foreach ($types as $val) {
echo "<tr" . odd() . "><th><a href='" . h(ME) . "type=" . urlencode($val) . "'>" . h($val) . "</a>\n";
}
echo "</table>\n";
}
echo "</table>\n";
echo "<p><a href='" . h(ME) . "type='>" . lang('Create type') . "</a>\n";
}
echo "<p><a href='" . h(ME) . "type='>" . lang('Create type') . "</a>\n";
}
if (support("event")) {
echo "<h3>" . lang('Events') . "</h3>\n";
$rows = get_rows("SHOW EVENTS");
if ($rows) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "</thead>\n";
foreach ($rows as $row) {
echo "<tr>";
echo '<th><a href="' . h(ME) . 'event=' . urlencode($row["Name"]) . '">' . h($row["Name"]) . "</a>";
echo "<td>" . ($row["Execute at"] ? lang('At given time') . "<td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "<td>$row[Starts]");
echo "<td>$row[Ends]";
if (support("event")) {
echo "<h3>" . lang('Events') . "</h3>\n";
$rows = get_rows("SHOW EVENTS");
if ($rows) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "</thead>\n";
foreach ($rows as $row) {
echo "<tr>";
echo '<th><a href="' . h(ME) . 'event=' . urlencode($row["Name"]) . '">' . h($row["Name"]) . "</a>";
echo "<td>" . ($row["Execute at"] ? lang('At given time') . "<td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "<td>$row[Starts]");
echo "<td>$row[Ends]";
}
echo "</table>\n";
}
echo "</table>\n";
echo '<p><a href="' . h(ME) . 'event=">' . lang('Create event') . "</a>\n";
}
if ($tables_list) {
echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=db');</script>\n";
}
echo '<p><a href="' . h(ME) . 'event=">' . lang('Create event') . "</a>\n";
}
if ($tables_list) {
page_footer();
echo "<script type='text/javascript' src='" . h(ME . "script=db&token=$token") . "'></script>\n";
exit; // page_footer() already called
}
}

View File

@@ -5,13 +5,10 @@
* @author Jakub Vrana
*/
$possible_drivers[] = "SQLSRV";
$possible_drivers[] = "MSSQL";
if (extension_loaded("sqlsrv") || extension_loaded("mssql")) {
$drivers["mssql"] = "MS SQL";
}
$drivers["mssql"] = "MS SQL";
if (isset($_GET["mssql"])) {
$possible_drivers = array("SQLSRV", "MSSQL");
define("DRIVER", "mssql");
if (extension_loaded("sqlsrv")) {
class Min_DB {
@@ -309,7 +306,7 @@ if (isset($_GET["mssql"])) {
return true;
}
function fields($table, $hidden = false) {
function fields($table) {
$return = array();
foreach (get_rows("SELECT c.*, t.name type, d.definition [default]
FROM sys.all_columns c
@@ -399,7 +396,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
}
function auto_increment() {
return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . preg_replace('~\\D+~', '', $_POST["Auto_increment"]) . ",1)" : "");
return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . (+$_POST["Auto_increment"]) . ",1)" : "") . " PRIMARY KEY";
}
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
@@ -408,11 +405,11 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
$column = idf_escape($field[0]);
$val = $field[1];
if (!$val) {
$alter["DROP"][] = " COLUMN $field[0]";
$alter["DROP"][] = " COLUMN $column";
} else {
$val[1] = preg_replace("~( COLLATE )'(\\w+)'~", "\\1\\2", $val[1]);
if ($field[0] == "") {
$alter["ADD"][] = "\n " . implode("", $val);
$alter["ADD"][] = "\n " . implode("", $val) . ($table == "" ? substr($foreign[$val[0]], 16 + strlen($val[0])) : ""); // 16 - strlen(" FOREIGN KEY ()")
} else {
unset($val[6]); //! identity can't be removed
if ($column != $val[0]) {
@@ -428,6 +425,9 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
if ($table != $name) {
queries("EXEC sp_rename " . q(table($table)) . ", " . q($name));
}
if ($foreign) {
$alter[""] = $foreign;
}
foreach ($alter as $key => $val) {
if (!queries("ALTER TABLE " . idf_escape($name) . " $key" . implode(",", $val))) {
return false;
@@ -603,7 +603,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)
$structured_types[$key] = array_keys($val);
}
$unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL");
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "");
$functions = array("len", "lower", "round", "upper");
$grouping = array("avg", "count", "count distinct", "max", "min", "sum");
$edit_functions = array(

View File

@@ -1,12 +1,8 @@
<?php
$possible_drivers[] = "MySQLi";
$possible_drivers[] = "MySQL";
$possible_drivers[] = "PDO_MySQL";
if (extension_loaded("mysqli") || extension_loaded("mysql") || extension_loaded("pdo_mysql")) {
$drivers = array("server" => "MySQL") + $drivers;
}
$drivers = array("server" => "MySQL") + $drivers;
if (!defined("DRIVER")) {
$possible_drivers = array("MySQLi", "MySQL", "PDO_MySQL");
define("DRIVER", "server"); // server - backwards compatibility
// MySQLi supports everything, MySQL doesn't support multiple result sets, PDO_MySQL doesn't support orgtable
if (extension_loaded("mysqli")) {
@@ -154,7 +150,7 @@ if (!defined("DRIVER")) {
*/
function result($query, $field = 0) {
$result = $this->query($query);
if (!$result) {
if (!$result || !$result->num_rows) {
return false;
}
return mysql_result($result->_result, 0, $field);
@@ -164,7 +160,7 @@ if (!defined("DRIVER")) {
class Min_Result {
var
$num_rows, ///< @var int number of rows in the result
$_result ///< @access private
$_result, $_offset = 0 ///< @access private
;
/** Constructor
@@ -193,7 +189,7 @@ if (!defined("DRIVER")) {
* @return object properties: name, type, orgtable, orgname, charsetnr
*/
function fetch_field() {
$return = mysql_fetch_field($this->_result);
$return = mysql_fetch_field($this->_result, $this->_offset++); // offset required under certain conditions
$return->orgtable = $return->table;
$return->orgname = $return->name;
$return->charsetnr = ($return->blob ? 63 : 0);
@@ -212,7 +208,7 @@ if (!defined("DRIVER")) {
var $extension = "PDO_MySQL";
function connect($server, $username, $password) {
$this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:([0-9])~', ';port=\\1', $server)), $username, $password);
$this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password);
$this->query("SET NAMES utf8"); // charset in DSN is ignored
return true;
}
@@ -397,10 +393,9 @@ if (!defined("DRIVER")) {
/** Get information about fields
* @param string
* @param bool display hidden table columns
* @return array array($name => array("field" => , "full_type" => , "type" => , "length" => , "unsigned" => , "default" => , "null" => , "auto_increment" => , "on_update" => , "collation" => , "privileges" => , "comment" => , "primary" => ))
*/
function fields($table, $hidden = false) {
function fields($table) {
$return = array();
foreach (get_rows("SHOW FULL COLUMNS FROM " . table($table)) as $row) {
preg_match('~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~', $row["Type"], $match);
@@ -651,6 +646,7 @@ if (!defined("DRIVER")) {
/** Move tables to other schema
* @param array
* @param array
* @param string
* @return bool
*/
@@ -663,6 +659,34 @@ if (!defined("DRIVER")) {
//! move triggers
}
/** Copy tables to other schema
* @param array
* @param array
* @param string
* @return bool
*/
function copy_tables($tables, $views, $target) {
foreach ($tables as $table) {
$name = ($target == DB ? table("copy_$table") : idf_escape($target) . "." . table($table));
if (!queries("DROP TABLE IF EXISTS $name")
|| !queries("CREATE TABLE $name LIKE " . table($table))
|| !queries("INSERT INTO $name SELECT * FROM " . table($table))
) {
return false;
}
}
foreach ($views as $table) {
$name = ($target == DB ? table("copy_$table") : idf_escape($target) . "." . table($table));
$view = view($table);
if (!queries("DROP VIEW IF EXISTS $name")
|| !queries("CREATE VIEW $name AS $view[select]") //! USE to avoid db.table
) {
return false;
}
}
return true;
}
/** Get information about trigger
* @param string trigger name
* @return array array("Trigger" => , "Timing" => , "Event" => , "Statement" => )
@@ -820,7 +844,7 @@ if (!defined("DRIVER")) {
global $connection;
$return = $connection->result("SHOW CREATE TABLE " . table($table), 1);
if (!$auto_increment) {
$return = preg_replace('~ AUTO_INCREMENT=[0-9]+~', '', $return); //! skip comments
$return = preg_replace('~ AUTO_INCREMENT=\\d+~', '', $return); //! skip comments
}
return $return;
}
@@ -870,7 +894,7 @@ if (!defined("DRIVER")) {
}
/** Check whether a feature is supported
* @param string "comment", "drop_col", "dump", "event", "partitioning", "routine", "scheme", "sequence", "status", "trigger", "type", "variables", "view"
* @param string "comment", "drop_col", "dump", "event", "partitioning", "routine", "scheme", "sequence", "status", "trigger", "type", "variables", "view", "copy"
* @return bool
*/
function support($feature) {
@@ -892,7 +916,7 @@ if (!defined("DRIVER")) {
$structured_types[$key] = array_keys($val);
}
$unsigned = array("unsigned", "zerofill", "unsigned zerofill"); ///< @var array number variants
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL"); ///< @var array operators used in select
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", ""); ///< @var array operators used in select
$functions = array("char_length", "date", "from_unixtime", "hex", "lower", "round", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select
$grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); ///< @var array grouping functions used in select
$edit_functions = array( ///< @var array of array("$type|$type2" => "$function/$function2") functions used in editing, [0] - edit and insert, [1] - edit only

View File

@@ -1,11 +1,8 @@
<?php
$possible_drivers[] = "OCI8";
$possible_drivers[] = "PDO_OCI";
if (extension_loaded("oci8") || extension_loaded("pdo_oci")) {
$drivers["oracle"] = "Oracle";
}
$drivers["oracle"] = "Oracle";
if (isset($_GET["oracle"])) {
$possible_drivers = array("OCI8", "PDO_OCI");
define("DRIVER", "oracle");
if (extension_loaded("oci8")) {
class Min_DB {
@@ -20,7 +17,7 @@ if (isset($_GET["oracle"])) {
}
function connect($server, $username, $password) {
$this->_link = @oci_new_connect($username, $password, $server); //! AL32UTF8
$this->_link = @oci_new_connect($username, $password, $server, "AL32UTF8");
if ($this->_link) {
$this->server_info = oci_server_version($this->_link);
return true;
@@ -122,9 +119,12 @@ if (isset($_GET["oracle"])) {
var $extension = "PDO_OCI";
function connect($server, $username, $password) {
$this->dsn("oci:dbname=//$server;charset=AL32UTF8", $username, $password);
return true;
}
function select_db($database) {
return true;
}
}
@@ -206,7 +206,7 @@ UNION SELECT view_name, 'view' FROM user_views" . ($name != "" ? " WHERE view_na
return true;
}
function fields($table, $hidden = false) {
function fields($table) {
$return = array();
foreach (get_rows("SELECT * FROM all_tab_columns WHERE table_name = " . q($table) . " ORDER BY column_id") as $row) {
$type = $row["DATA_TYPE"];
@@ -350,7 +350,7 @@ UNION SELECT view_name, 'view' FROM user_views" . ($name != "" ? " WHERE view_na
$structured_types[$key] = array_keys($val);
}
$unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL");
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "");
$functions = array("length", "lower", "round", "upper");
$grouping = array("avg", "count", "count distinct", "max", "min", "sum");
$edit_functions = array(

View File

@@ -1,11 +1,8 @@
<?php
$possible_drivers[] = "PgSQL";
$possible_drivers[] = "PDO_PgSQL";
if (extension_loaded("pgsql") || extension_loaded("pdo_pgsql")) {
$drivers["pgsql"] = "PostgreSQL";
}
$drivers["pgsql"] = "PostgreSQL";
if (isset($_GET["pgsql"])) {
$possible_drivers = array("PgSQL", "PDO_PgSQL");
define("DRIVER", "pgsql");
if (extension_loaded("pgsql")) {
class Min_DB {
@@ -83,7 +80,7 @@ if (isset($_GET["pgsql"])) {
function result($query, $field = 0) {
$result = $this->query($query);
if (!$result) {
if (!$result || !$result->num_rows) {
return false;
}
return pg_fetch_result($result->_result, 0, $field);
@@ -199,7 +196,7 @@ if (isset($_GET["pgsql"])) {
function table_status($name = "") {
$return = array();
foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN '' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\"
foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN '' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids AS \"Oid\"
FROM pg_class
WHERE relkind IN ('r','v')
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())"
@@ -218,7 +215,7 @@ AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema(
return true;
}
function fields($table, $hidden = false) {
function fields($table) {
$return = array();
foreach (get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, d.adsrc AS default, a.attnotnull, col_description(c.oid, a.attnum) AS comment
FROM pg_class c
@@ -228,8 +225,8 @@ LEFT JOIN pg_attrdef d ON c.oid = d.adrelid AND a.attnum = d.adnum
WHERE c.relname = " . q($table) . "
AND n.nspname = current_schema()
AND NOT a.attisdropped
" . ($hidden ? "" : "AND a.attnum > 0") . "
ORDER BY a.attnum < 0, a.attnum"
AND a.attnum > 0
ORDER BY a.attnum"
) as $row) {
//! collation, primary
ereg('(.*)(\\((.*)\\))?', $row["full_type"], $match);
@@ -536,7 +533,7 @@ AND typelem = 0"
$structured_types[$key] = array_keys($val);
}
$unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL");
$operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "");
$functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
$grouping = array("avg", "count", "count distinct", "max", "min", "sum");
$edit_functions = array(

View File

@@ -1,18 +1,83 @@
<?php
$possible_drivers[] = "SQLite";
$possible_drivers[] = "SQLite3";
$possible_drivers[] = "PDO_SQLite";
if (extension_loaded("sqlite3") || extension_loaded("pdo_sqlite")) {
$drivers["sqlite"] = "SQLite 3";
}
if (extension_loaded("sqlite") || extension_loaded("pdo_sqlite")) {
$drivers["sqlite2"] = "SQLite 2";
}
$drivers["sqlite"] = "SQLite 3";
$drivers["sqlite2"] = "SQLite 2";
if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
$possible_drivers = array((isset($_GET["sqlite"]) ? "SQLite3" : "SQLite"), "PDO_SQLite");
define("DRIVER", (isset($_GET["sqlite"]) ? "sqlite" : "sqlite2"));
if (extension_loaded(isset($_GET["sqlite2"]) ? "sqlite" : "sqlite3")) {
if (isset($_GET["sqlite2"])) {
if (extension_loaded(isset($_GET["sqlite"]) ? "sqlite3" : "sqlite")) {
if (isset($_GET["sqlite"])) {
class Min_SQLite {
var $extension = "SQLite3", $server_info, $affected_rows, $error, $_link;
function Min_SQLite($filename) {
$this->_link = new SQLite3($filename);
$version = $this->_link->version();
$this->server_info = $version["versionString"];
}
function query($query) {
$result = @$this->_link->query($query);
if (!$result) {
$this->error = $this->_link->lastErrorMsg();
return false;
} elseif ($result->numColumns()) {
return new Min_Result($result);
}
$this->affected_rows = $this->_link->changes();
return true;
}
function quote($string) {
return "'" . $this->_link->escapeString($string) . "'";
}
function store_result() {
return $this->_result;
}
function result($query, $field = 0) {
$result = $this->query($query);
if (!is_object($result)) {
return false;
}
$row = $result->_result->fetchArray();
return $row[$field];
}
}
class Min_Result {
var $_result, $_offset = 0, $num_rows;
function Min_Result($result) {
$this->_result = $result;
}
function fetch_assoc() {
return $this->_result->fetchArray(SQLITE3_ASSOC);
}
function fetch_row() {
return $this->_result->fetchArray(SQLITE3_NUM);
}
function fetch_field() {
$column = $this->_offset++;
$type = $this->_result->columnType($column);
return (object) array(
"name" => $this->_result->columnName($column),
"type" => $type,
"charsetnr" => ($type == SQLITE3_BLOB ? 63 : 0), // 63 - binary
);
}
function __desctruct() {
return $this->_result->finalize();
}
}
} else {
class Min_SQLite {
var $extension = "SQLite", $server_info, $affected_rows, $error, $_link;
@@ -95,77 +160,6 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
}
} else {
class Min_SQLite {
var $extension = "SQLite3", $server_info, $affected_rows, $error, $_link;
function Min_SQLite($filename) {
$this->_link = new SQLite3($filename);
$version = $this->_link->version();
$this->server_info = $version["versionString"];
}
function query($query) {
$result = @$this->_link->query($query);
if (!$result) {
$this->error = $this->_link->lastErrorMsg();
return false;
} elseif ($result->numColumns()) {
return new Min_Result($result);
}
$this->affected_rows = $this->_link->changes();
return true;
}
function quote($string) {
return "'" . $this->_link->escapeString($string) . "'";
}
function store_result() {
return $this->_result;
}
function result($query, $field = 0) {
$result = $this->query($query);
if (!is_object($result)) {
return false;
}
$row = $result->_result->fetchArray();
return $row[$field];
}
}
class Min_Result {
var $_result, $_offset = 0, $num_rows;
function Min_Result($result) {
$this->_result = $result;
}
function fetch_assoc() {
return $this->_result->fetchArray(SQLITE3_ASSOC);
}
function fetch_row() {
return $this->_result->fetchArray(SQLITE3_NUM);
}
function fetch_field() {
$column = $this->_offset++;
$type = $this->_result->columnType($column);
return (object) array(
"name" => $this->_result->columnName($column),
"type" => $type,
"charsetnr" => ($type == SQLITE3_BLOB ? 63 : 0), // 63 - binary
);
}
function __desctruct() {
return $this->_result->finalize();
}
}
}
} elseif (extension_loaded("pdo_sqlite")) {
@@ -179,26 +173,28 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
}
class Min_DB extends Min_SQLite {
function Min_DB() {
$this->Min_SQLite(":memory:");
}
function select_db($filename) {
if (is_readable($filename) && $this->query("ATTACH " . $this->quote(ereg("(^[/\\]|:)", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3
$this->Min_SQLite($filename);
return true;
if (class_exists("Min_SQLite")) {
class Min_DB extends Min_SQLite {
function Min_DB() {
$this->Min_SQLite(":memory:");
}
function select_db($filename) {
if (is_readable($filename) && $this->query("ATTACH " . $this->quote(ereg("(^[/\\]|:)", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3
$this->Min_SQLite($filename);
return true;
}
return false;
}
function multi_query($query) {
return $this->_result = $this->query($query);
}
function next_result() {
return false;
}
return false;
}
function multi_query($query) {
return $this->_result = $this->query($query);
}
function next_result() {
return false;
}
}
@@ -269,7 +265,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return !$connection->result("SELECT sqlite_compileoption_used('OMIT_FOREIGN_KEY')");
}
function fields($table, $hidden = false) {
function fields($table) {
$return = array();
foreach (get_rows("PRAGMA table_info(" . table($table) . ")") as $row) {
$type = strtolower($row["type"]);
@@ -558,7 +554,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
$types = array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0);
$structured_types = array_keys($types);
$unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // REGEXP can be user defined function
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", ""); // REGEXP can be user defined function
$functions = array("hex", "length", "lower", "round", "unixepoch", "upper");
$grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
$edit_functions = array(

View File

@@ -3,12 +3,13 @@ $TABLE = $_GET["dump"];
if ($_POST) {
$cookie = "";
foreach (array("output", "format", "db_style", "table_style", "data_style") as $key) {
foreach (array("output", "format", "db_style", "routines", "events", "table_style", "auto_increment", "triggers", "data_style") as $key) {
$cookie .= "&$key=" . urlencode($_POST[$key]);
}
cookie("adminer_export", substr($cookie, 1));
$ext = dump_headers(($TABLE != "" ? $TABLE : DB), (DB == "" || count((array) $_POST["tables"] + (array) $_POST["data"]) > 1));
if ($_POST["format"] == "sql") {
$is_sql = ($_POST["format"] == "sql");
if ($is_sql) {
echo "-- Adminer $VERSION " . $drivers[DRIVER] . " dump
" . ($jush != "sql" ? "" : "SET NAMES utf8;
@@ -29,13 +30,13 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
}
foreach ((array) $databases as $db) {
if ($connection->select_db($db)) {
if ($_POST["format"] == "sql" && ereg('CREATE', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) {
if ($is_sql && ereg('CREATE', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) {
if ($style == "DROP+CREATE") {
echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n";
}
echo ($style == "CREATE+ALTER" ? preg_replace('~^CREATE DATABASE ~', '\\0IF NOT EXISTS ', $create) : $create) . ";\n";
}
if ($_POST["format"] == "sql") {
if ($is_sql) {
if ($style) {
echo use_sql($db) . ";\n\n";
}
@@ -72,11 +73,11 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
if ($ext == "tar") {
ob_start();
}
dump_table($row["Name"], ($table ? $_POST["table_style"] : ""));
$adminer->dumpTable($row["Name"], ($table ? $_POST["table_style"] : ""));
if ($data) {
dump_data($row["Name"], $_POST["data_style"]);
$adminer->dumpData($row["Name"], $_POST["data_style"], "SELECT * FROM " . table($row["Name"]));
}
if ($_POST["format"] == "sql" && $_POST["triggers"]) {
if ($is_sql && $_POST["triggers"]) {
$triggers = trigger_sql($row["Name"], $_POST["table_style"]);
if ($triggers) {
echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n";
@@ -84,23 +85,23 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
}
if ($ext == "tar") {
echo tar_file((DB != "" ? "" : "$db/") . "$row[Name].csv", ob_get_clean());
} elseif ($_POST["format"] == "sql") {
} elseif ($is_sql) {
echo "\n";
}
} elseif ($_POST["format"] == "sql") {
} elseif ($is_sql) {
$views[] = $row["Name"];
}
}
}
foreach ($views as $view) {
dump_table($view, $_POST["table_style"], true);
$adminer->dumpTable($view, $_POST["table_style"], true);
}
if ($ext == "tar") {
echo pack("x512");
}
}
if ($style == "CREATE+ALTER" && $_POST["format"] == "sql") {
if ($style == "CREATE+ALTER" && $is_sql) {
// drop old tables
$query = "SELECT TABLE_NAME, ENGINE, TABLE_COLLATION, TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()";
echo "DELIMITER ;;
@@ -136,11 +137,14 @@ CALL adminer_alter(@adminer_alter);
DROP PROCEDURE adminer_alter;
";
}
if (in_array("CREATE+ALTER", array($style, $_POST["table_style"])) && $_POST["format"] == "sql") {
if (in_array("CREATE+ALTER", array($style, $_POST["table_style"])) && $is_sql) {
echo "SELECT @adminer_alter;\n";
}
}
}
if ($is_sql) {
echo "-- " . $connection->result("SELECT NOW()") . "\n";
}
exit;
}
@@ -162,16 +166,19 @@ parse_str($_COOKIE["adminer_export"], $row);
if (!$row) {
$row = array("output" => "text", "format" => "sql", "db_style" => (DB != "" ? "" : "CREATE"), "table_style" => "DROP+CREATE", "data_style" => "INSERT");
}
$checked = ($_GET["dump"] == "");
echo "<tr><th>" . lang('Output') . "<td>" . $adminer->dumpOutput(0, $row["output"]) . "\n";
echo "<tr><th>" . lang('Format') . "<td>" . $adminer->dumpFormat(0, $row["format"]) . "\n";
if (!isset($row["events"])) { // backwards compatibility
$row["routines"] = $row["events"] = ($_GET["dump"] == "");
$row["auto_increment"] = $row["triggers"] = $row["table_style"];
}
echo "<tr><th>" . lang('Output') . "<td>" . html_select("output", $adminer->dumpOutput(), $row["output"], 0) . "\n"; // 0 - radio
echo "<tr><th>" . lang('Format') . "<td>" . html_select("format", $adminer->dumpFormat(), $row["format"], 0) . "\n"; // 0 - radio
echo ($jush == "sqlite" ? "" : "<tr><th>" . lang('Database') . "<td>" . html_select('db_style', $db_style, $row["db_style"])
. (support("routine") ? checkbox("routines", 1, $checked, lang('Routines')) : "")
. (support("event") ? checkbox("events", 1, $checked, lang('Events')) : "")
. (support("routine") ? checkbox("routines", 1, $row["routines"], lang('Routines')) : "")
. (support("event") ? checkbox("events", 1, $row["events"], lang('Events')) : "")
);
echo "<tr><th>" . lang('Tables') . "<td>" . html_select('table_style', $table_style, $row["table_style"])
. checkbox("auto_increment", 1, $row["table_style"], lang('Auto Increment'))
. (support("trigger") ? checkbox("triggers", 1, $row["table_style"], lang('Triggers')) : "")
. checkbox("auto_increment", 1, $row["auto_increment"], lang('Auto Increment'))
. (support("trigger") ? checkbox("triggers", 1, $row["triggers"], lang('Triggers')) : "")
;
echo "<tr><th>" . lang('Data') . "<td>" . html_select('data_style', $data_style, $row["data_style"]);
?>
@@ -214,7 +221,7 @@ if (DB != "") {
}
}
} else {
echo "<tr><td><textarea name='databases' rows='10' cols='20' onkeydown='return textareaKeydown(this, event);'></textarea>";
echo "<tr><td><textarea name='databases' rows='10' cols='20' onkeypress='return textareaKeypress(this, event);'></textarea>";
}
}
?>

View File

@@ -64,15 +64,15 @@ if ($_POST["save"]) {
}
?>
<form action="" method="post" enctype="multipart/form-data">
<form action="" method="post" enctype="multipart/form-data" id="form">
<?php
if ($fields) {
echo "<table cellspacing='0'>\n";
echo "<table cellspacing='0' onkeydown='return editingKeydown(event);'>\n";
foreach ($fields as $name => $field) {
echo "<tr><th>" . $adminer->fieldName($field);
$default = $_GET["set"][bracket_escape($name)];
$value = (isset($row)
? ($row[$name] != "" && ereg("enum|set", $field["type"]) ? intval($row[$name]) : $row[$name])
? ($row[$name] != "" && ereg("enum|set", $field["type"]) ? +$row[$name] : $row[$name])
: (!$update && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : (isset($default) ? $default : $field["default"])))
);
if (!$_POST["save"] && is_string($value)) {
@@ -103,8 +103,8 @@ if ($fields) {
echo '<input type="submit" name="insert" value="' . ($update ? lang('Save and continue edit') : lang('Save and insert next')) . "\">\n";
}
}
if ($update) {
echo "<input type='submit' name='delete' value='" . lang('Delete') . "'$confirm>\n";
}
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\">\n"
: ($_POST ? "" : "<script type='text/javascript'>document.getElementById('form').getElementsByTagName('td')[1].firstChild.focus();</script>\n")
);
?>
</form>

View File

@@ -49,5 +49,5 @@ if ($_POST) {
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($EVENT != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
<?php if ($EVENT != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
</form>

View File

@@ -18,6 +18,7 @@ if ($_GET["file"] == "favicon.ico") {
case "up.gif": echo base64_decode("compile_file('../adminer/static/up.gif', 'base64_encode');"); break;
case "down.gif": echo base64_decode("compile_file('../adminer/static/down.gif', 'base64_encode');"); break;
case "arrow.gif": echo base64_decode("compile_file('../adminer/static/arrow.gif', 'base64_encode');"); break;
case "loader.gif": echo base64_decode("compile_file('../adminer/static/loader.gif', 'base64_encode');"); break;
}
}
exit;

View File

@@ -60,8 +60,8 @@ foreach (table_status() as $name => $table_status) {
$j = 0;
foreach ($row["source"] as $key => $val) {
echo "<tr>";
echo "<td>" . html_select("source[" . intval($key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1));
echo "<td>" . html_select("target[" . intval($key) . "]", $target, $row["target"][$key]);
echo "<td>" . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1));
echo "<td>" . html_select("target[" . (+$key) . "]", $target, $row["target"][$key]);
$j++;
}
?>
@@ -73,6 +73,6 @@ foreach ($row["source"] as $key => $val) {
<input type="submit" value="<?php echo lang('Save'); ?>">
<noscript><p><input type="submit" name="add" value="<?php echo lang('Add column'); ?>"></noscript>
<?php } ?>
<?php if ($_GET["name"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
<?php if ($_GET["name"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>

View File

@@ -36,7 +36,8 @@ class Adminer {
* @return null
*/
function headers() {
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox 3.6.9
header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page
}
/** Print login form
@@ -46,13 +47,15 @@ class Adminer {
global $drivers;
?>
<table cellspacing="0">
<tr><th><?php echo lang('System'); ?><td><?php echo html_select("driver", $drivers, DRIVER); ?>
<tr><th><?php echo lang('System'); ?><td><?php echo html_select("driver", $drivers, DRIVER, "loginDriver(this);"); ?>
<tr><th><?php echo lang('Server'); ?><td><input name="server" value="<?php echo h(SERVER); ?>">
<tr><th><?php echo lang('Username'); ?><td><input id="username" name="username" value="<?php echo h($_GET["username"]); ?>">
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
</table>
<script type="text/javascript">
document.getElementById('username').focus();
var username = document.getElementById('username');
username.focus();
username.form['driver'].onchange();
</script>
<?php
echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
@@ -102,11 +105,19 @@ document.getElementById('username').focus();
$links["edit"] = lang('New item');
}
foreach ($links as $key => $val) {
echo " <a href='" . h(ME) . "$key=" . urlencode($tableStatus["Name"]) . ($key == "edit" ? $set : "") . "'>" . bold($val, isset($_GET[$key])) . "</a>";
echo " <a href='" . h(ME) . "$key=" . urlencode($tableStatus["Name"]) . ($key == "edit" ? $set : "") . "'" . bold(isset($_GET[$key])) . ">$val</a>";
}
echo "\n";
}
/** Get foreign keys for table
* @param string
* @return array same format as foreign_keys()
*/
function foreignKeys($table) {
return foreign_keys($table);
}
/** Find backward keys for table
* @param string
* @param string
@@ -130,7 +141,7 @@ document.getElementById('username').focus();
*/
function selectQuery($query) {
global $jush;
return "<p><a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Page') . ": " . lang('last') . "'>&gt;&gt;</a> <code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
return "<p><a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Last page') . "'>&gt;&gt;</a> <code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
}
/** Description of a row in a table
@@ -157,7 +168,7 @@ document.getElementById('username').focus();
* @return string
*/
function selectVal($val, $link, $field) {
$return = ($val != "<i>NULL</i>" && ereg("^char|binary", $field["type"]) ? "<code>$val</code>" : $val);
$return = ($val != "<i>NULL</i>" && ereg("char|binary", $field["type"]) && !ereg("var", $field["type"]) ? "<code>$val</code>" : $val);
if (ereg('blob|bytea|raw|file', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen(html_entity_decode($val, ENT_QUOTES)));
}
@@ -220,7 +231,7 @@ document.getElementById('username').focus();
}
}
echo "<div><select name='where[$i][col]' onchange='selectAddRow(this);'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, null, true) . "</select>";
echo html_select("where[$i][op]", $this->operators);
echo html_select("where[$i][op]", $this->operators, "=");
echo "<input name='where[$i][val]'></div>\n";
echo "</div></fieldset>\n";
}
@@ -324,6 +335,8 @@ document.getElementById('username').focus();
if (ereg('IN$', $val["op"])) {
$in = process_length($val["val"]);
$cond .= " (" . ($in != "" ? $in : "NULL") . ")";
} elseif (!$val["op"]) {
$cond .= $val["val"]; // SQL injection
} elseif ($val["op"] == "LIKE %%") {
$cond = " LIKE " . $this->processInput($fields[$val["col"]], "%$val[val]%");
} elseif (!ereg('NULL$', $val["op"])) {
@@ -391,14 +404,15 @@ document.getElementById('username').focus();
*/
function messageQuery($query) {
global $jush;
static $count = 0;
restart_session();
$id = "sql-" . count($_SESSION["messages"]);
$id = "sql-" . ($count++);
$history = &get_session("queries");
$history[$_GET["db"]][] = (strlen($query) > 1e6 // not DB - reset in drop database
? ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..." // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
: $query
); //! respect $_GET["ns"]
return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre class='jush-$jush'>" . shorten_utf8($query, 1000) . '</pre><p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a></div>';
return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre><p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a></div>';
}
/** Functions displayed in edit form
@@ -429,8 +443,9 @@ document.getElementById('username').focus();
*/
function editInput($table, $field, $attrs, $value) {
if ($field["type"] == "enum") {
return ($field["null"] ? "<label><input type='radio'$attrs value=''" . (isset($value) || isset($_GET["select"]) ? "" : " checked") . "><i>NULL</i></label> " : "")
. "<label><input type='radio'$attrs value='0'" . ($value === 0 ? " checked" : "") . "><i>" . lang('empty') . "</i></label>"
return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='-1' checked><i>" . lang('original') . "</i></label> " : "")
. ($field["null"] ? "<label><input type='radio'$attrs value=''" . (isset($value) || isset($_GET["select"]) ? "" : " checked") . "><i>NULL</i></label> " : "")
. enum_input("radio", $attrs, $field, $value, 0) // 0 - empty
;
}
return "";
@@ -444,7 +459,7 @@ document.getElementById('username').focus();
*/
function processInput($field, $value, $function = "") {
$name = $field["field"];
$return = q($value);
$return = ($field["type"] == "bit" && ereg('^[0-9]+$', $value) ? $value : q($value));
if (ereg('^(now|getdate|uuid)$', $function)) {
$return = "$function()";
} elseif (ereg('^current_(date|timestamp)$', $function)) {
@@ -452,7 +467,7 @@ document.getElementById('username').focus();
} elseif (ereg('^([+-]|\\|\\|)$', $function)) {
$return = idf_escape($name) . " $function $return";
} elseif (ereg('^[+-] interval$', $function)) {
$return = idf_escape($name) . " $function " . (preg_match("~^([0-9]+|'[0-9.: -]') [A-Z_]+$~i", $value) ? $value : $return);
$return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+$~i", $value) ? $value : $return);
} elseif (ereg('^(addtime|subtime|concat)$', $function)) {
$return = "$function(" . idf_escape($name) . ", $return)";
} elseif (ereg('^(md5|sha1|password|encrypt|hex)$', $function)) {
@@ -465,11 +480,9 @@ document.getElementById('username').focus();
}
/** Returns export output options
* @param bool generate select (otherwise radio)
* @param string
* @return string
* @return array
*/
function dumpOutput($select, $value = "") {
function dumpOutput() {
$return = array('text' => lang('open'), 'file' => lang('save'));
if (function_exists('gzencode')) {
$return['gz'] = 'gzip';
@@ -478,16 +491,211 @@ document.getElementById('username').focus();
$return['bz2'] = 'bzip2';
}
// ZipArchive requires temporary file, ZIP can be created by gzcompress - see PEAR File_Archive
return html_select("output", $return, $value, $select);
return $return;
}
/** Returns export format options
* @param bool generate select (otherwise radio)
* @param string
* @return string
* @return array
*/
function dumpFormat($select, $value = "") {
return html_select("format", array('sql' => 'SQL', 'csv' => 'CSV,', 'csv;' => 'CSV;'), $value, $select);
function dumpFormat() {
return array('sql' => 'SQL', 'csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV');
}
/** Export table structure
* @param string
* @param string
* @param bool
* @return null prints data
*/
function dumpTable($table, $style, $is_view = false) {
if ($_POST["format"] != "sql") {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
if ($style) {
dump_csv(array_keys(fields($table)));
}
} elseif ($style) {
$create = create_sql($table, $_POST["auto_increment"]);
if ($create) {
if ($style == "DROP+CREATE") {
echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . table($table) . ";\n";
}
if ($is_view) {
// remove DEFINER with current user
$create = preg_replace('~^([A-Z =]+) DEFINER=`' . str_replace("@", "`@`", logged_user()) . '`~', '\\1', $create); //! proper escaping of user
}
echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n";
}
if ($style == "CREATE+ALTER" && !$is_view) {
// create procedure which iterates over original columns and adds new and removes old
$query = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, COLLATION_NAME, COLUMN_TYPE, EXTRA, COLUMN_COMMENT FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = " . q($table) . " ORDER BY ORDINAL_POSITION";
echo "DELIMITER ;;
CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
DECLARE _column_name, _collation_name, after varchar(64) DEFAULT '';
DECLARE _column_type, _column_default text;
DECLARE _is_nullable char(3);
DECLARE _extra varchar(30);
DECLARE _column_comment varchar(255);
DECLARE done, set_after bool DEFAULT 0;
DECLARE add_columns text DEFAULT '";
$fields = array();
$after = "";
foreach (get_rows($query) as $row) {
$default = $row["COLUMN_DEFAULT"];
$row["default"] = (isset($default) ? q($default) : "NULL");
$row["after"] = q($after); //! rgt AFTER lft, lft AFTER id doesn't work
$row["alter"] = escape_string(idf_escape($row["COLUMN_NAME"])
. " $row[COLUMN_TYPE]"
. ($row["COLLATION_NAME"] ? " COLLATE $row[COLLATION_NAME]" : "")
. (isset($default) ? " DEFAULT " . ($default == "CURRENT_TIMESTAMP" ? $default : $row["default"]) : "")
. ($row["IS_NULLABLE"] == "YES" ? "" : " NOT NULL")
. ($row["EXTRA"] ? " $row[EXTRA]" : "")
. ($row["COLUMN_COMMENT"] ? " COMMENT " . q($row["COLUMN_COMMENT"]) : "")
. ($after ? " AFTER " . idf_escape($after) : " FIRST")
);
echo ", ADD $row[alter]";
$fields[] = $row;
$after = $row["COLUMN_NAME"];
}
echo "';
DECLARE columns CURSOR FOR $query;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
SET @alter_table = '';
OPEN columns;
REPEAT
FETCH columns INTO _column_name, _column_default, _is_nullable, _collation_name, _column_type, _extra, _column_comment;
IF NOT done THEN
SET set_after = 1;
CASE _column_name";
foreach ($fields as $row) {
echo "
WHEN " . q($row["COLUMN_NAME"]) . " THEN
SET add_columns = REPLACE(add_columns, ', ADD $row[alter]', '');
IF NOT (_column_default <=> $row[default]) OR _is_nullable != '$row[IS_NULLABLE]' OR _collation_name != '$row[COLLATION_NAME]' OR _column_type != " . q($row["COLUMN_TYPE"]) . " OR _extra != '$row[EXTRA]' OR _column_comment != " . q($row["COLUMN_COMMENT"]) . " OR after != $row[after] THEN
SET @alter_table = CONCAT(@alter_table, ', MODIFY $row[alter]');
END IF;"; //! don't replace in comment
}
echo "
ELSE
SET @alter_table = CONCAT(@alter_table, ', DROP ', _column_name);
SET set_after = 0;
END CASE;
IF set_after THEN
SET after = _column_name;
END IF;
END IF;
UNTIL done END REPEAT;
CLOSE columns;
IF @alter_table != '' OR add_columns != '' THEN
SET alter_command = CONCAT(alter_command, 'ALTER TABLE " . table($table) . "', SUBSTR(CONCAT(add_columns, @alter_table), 2), ';\\n');
END IF;
END;;
DELIMITER ;
CALL adminer_alter(@adminer_alter);
DROP PROCEDURE adminer_alter;
";
//! indexes
}
}
}
/** Export table data
* @param string
* @param string
* @param string
* @return null prints data
*/
function dumpData($table, $style, $query) {
global $connection, $jush;
$max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024
if ($style) {
if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
echo truncate_sql($table) . ";\n";
}
if ($_POST["format"] == "sql") {
$fields = fields($table);
}
$result = $connection->query($query, 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers
if ($result) {
$insert = "";
$buffer = "";
while ($row = $result->fetch_assoc()) {
if ($_POST["format"] != "sql") {
if ($style == "table") {
dump_csv(array_keys($row));
$style = "INSERT";
}
dump_csv($row);
} else {
if (!$insert) {
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', array_keys($row))) . ") VALUES";
}
foreach ($row as $key => $val) {
$row[$key] = (isset($val) ? (ereg('int|float|double|decimal', $fields[$key]["type"]) ? $val : q($val)) : "NULL"); //! columns looking like functions
}
$s = implode(",\t", $row);
if ($style == "INSERT+UPDATE") {
$set = array();
foreach ($row as $key => $val) {
$set[] = idf_escape($key) . " = $val";
}
echo "$insert ($s) ON DUPLICATE KEY UPDATE " . implode(", ", $set) . ";\n";
} else {
$s = ($max_packet ? "\n" : " ") . "($s)";
if (!$buffer) {
$buffer = $insert . $s;
} elseif (strlen($buffer) + 2 + strlen($s) < $max_packet) { // 2 - separator and terminator length
$buffer .= ",$s";
} else {
$buffer .= ";\n";
echo $buffer;
$buffer = $insert . $s;
}
}
}
}
if ($_POST["format"] == "sql" && $style != "INSERT+UPDATE" && $buffer) {
$buffer .= ";\n";
echo $buffer;
}
} elseif ($_POST["format"] == "sql") {
echo "-- " . str_replace("\n", " ", $connection->error) . "\n";
}
}
}
/** Send headers for export
* @param string
* @param bool
* @return string extension
*/
function dumpHeaders($identifier, $multi_table = false) {
$output = $_POST["output"];
$ext = ($_POST["format"] == "sql" ? "sql" : ($multi_table ? "tar" : "csv")); // multiple CSV packed to TAR
header("Content-Type: " .
($output == "bz2" ? "application/x-bzip" :
($output == "gz" ? "application/x-gzip" :
($ext == "tar" ? "application/x-tar" :
($ext == "sql" || $output != "file" ? "text/plain" : "text/csv") . "; charset=utf-8"
))));
if ($output == "bz2") {
ob_start('bzcompress', 1e6);
}
if ($output == "gz") {
ob_start('gzencode', 1e6);
}
return $ext;
}
/** Print homepage
* @return bool whether to print default homepage
*/
function homepage() {
echo '<p>' . ($_GET["ns"] == "" ? '<a href="' . h(ME) . 'database=">' . lang('Alter database') . "</a>\n" : "");
if (support("scheme")) {
echo "<a href='" . h(ME) . "scheme='>" . ($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema')) . "</a>\n";
}
return true;
}
/** Prints navigation after Adminer title
@@ -510,7 +718,7 @@ document.getElementById('username').focus();
foreach ($usernames as $username => $password) {
if (isset($password)) {
if ($first) {
echo "<p>\n";
echo "<p onclick='eventStop(event);'>\n";
$first = false;
}
echo "<a href='" . h(auth_url($driver, $server, $username)) . "'>($drivers[$driver]) " . h($username . ($server != "" ? "@$server" : "")) . "</a><br>\n";
@@ -524,22 +732,22 @@ document.getElementById('username').focus();
<form action="" method="post">
<p class="logout">
<?php
if (DB == "" || !$missing) {
echo "<a href='" . h(ME) . "sql='>" . bold(lang('SQL command'), isset($_GET["sql"])) . "</a>\n";
if (support("dump")) {
echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "'>" . bold(lang('Dump'), isset($_GET["dump"])) . "</a>\n";
}
}
?>
if (DB == "" || !$missing) {
echo "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"])) . ">" . lang('SQL command') . "</a>\n";
if (support("dump")) {
echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Dump') . "</a>\n";
}
}
?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" onclick="eventStop(event);">
</p>
</form>
<form action="">
<p>
<?php hidden_fields_get(); ?>
<?php echo ($databases ? html_select("db", array("" => "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : '<input name="db" value="' . h(DB) . '">'); ?>
<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?>>
<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?> onclick="eventStop(event);">
<?php
if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
if (support("scheme")) {
@@ -549,6 +757,7 @@ if (DB == "" || !$missing) {
}
}
if ($_GET["ns"] !== "" && !$missing) {
echo '<p><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create new table') . "</a>\n";
$tables = tables_list();
if (!$tables) {
echo "<p class='message'>" . lang('No tables.') . "\n";
@@ -559,13 +768,12 @@ if (DB == "" || !$missing) {
$links[] = preg_quote($table, '/');
}
echo "<script type='text/javascript'>\n";
echo "var jushLinks = { $jush: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
echo "var jushLinks = { $jush: [ '" . js_escape(ME) . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
echo "jushLinks.$val = jushLinks.$jush;\n";
}
echo "</script>\n";
}
echo '<p><a href="' . h(ME) . 'create=">' . bold(lang('Create new table'), $_GET["create"] === "") . "</a>\n";
}
}
echo (isset($_GET["sql"]) ? '<input type="hidden" name="sql" value="">'
@@ -583,8 +791,8 @@ if (DB == "" || !$missing) {
function tablesPrint($tables) {
echo "<p id='tables'>\n";
foreach ($tables as $table => $type) {
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '">' . bold(lang('select'), $_GET["select"] == $table) . '</a> ';
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '">' . bold($this->tableName(array("Name" => $table)), $_GET["table"] == $table) . "</a><br>\n"; //! Adminer::tableName may work with full table status
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . ">" . $this->tableName(array("Name" => $table)) . "</a><br>\n"; //! Adminer::tableName may work with full table status
}
}

View File

@@ -1,12 +1,6 @@
<?php
$connection = '';
if (!$drivers) {
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), null);
page_footer("auth");
exit;
}
$token = $_SESSION["token"];
if (!$_SESSION["token"]) {
$_SESSION["token"] = rand(1, 1e6); // defense against cross-site request forgery
@@ -80,7 +74,7 @@ function auth_error($exception = null) {
}
}
page_header(lang('Login'), $error, null);
echo "<form action='' method='post'>\n";
echo "<form action='' method='post' onclick='eventStop(event);'>\n";
$adminer->loginForm();
echo "<div>";
hidden_fields($_POST, array("driver", "server", "username", "password", "permanent")); // expired session
@@ -89,7 +83,13 @@ function auth_error($exception = null) {
page_footer("auth");
}
if (isset($_GET["username"]) && class_exists("Min_DB")) { // doesn't exists with passing wrong driver
if (isset($_GET["username"])) {
if (!class_exists("Min_DB")) {
unset($_SESSION["pwds"][DRIVER]); //! remove also from adminer_permanent
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), false);
page_footer("auth");
exit;
}
$connection = connect();
}
if (is_string($connection) || !$adminer->login($_GET["username"], get_session("pwds"))) {

View File

@@ -21,6 +21,7 @@ if (isset($_GET["file"])) {
include "../adminer/include/functions.inc.php";
global $adminer, $connection, $drivers, $edit_functions, $enum_length, $error, $functions, $grouping, $HTTPS, $inout, $jush, $LANG, $langs, $on_actions, $structured_types, $token, $translations, $types, $unsigned, $VERSION; // allows including Adminer inside a function
if (!isset($_SERVER["REQUEST_URI"])) {
$_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"] . ($_SERVER["QUERY_STRING"] != "" ? "?$_SERVER[QUERY_STRING]" : ""); // IIS 5 compatibility
}
@@ -39,10 +40,12 @@ if (!defined("SID")) {
// disable magic quotes to be able to use database escaping function
remove_slashes(array(&$_GET, &$_POST, &$_COOKIE));
if (function_exists("set_magic_quotes_runtime")) {
if (function_exists("set_magic_quotes_runtime")) { // removed in PHP 6
set_magic_quotes_runtime(false);
}
@set_time_limit(0); // @ - can be disabled
@ini_set("zend.ze1_compatibility_mode", false); // @ - deprecated
@ini_set("precision", 20); // @ - can be disabled
include "../adminer/include/lang.inc.php";
include "../adminer/lang/$LANG.inc.php";
@@ -56,7 +59,7 @@ include "../adminer/drivers/mysql.inc.php"; // must be included as last driver
define("SERVER", $_GET[DRIVER]); // read from pgsql=localhost
define("DB", $_GET["db"]); // for the sake of speed and size
define("ME", preg_replace('~^[^?]*/([^?]*).*~', '\\1', $_SERVER["REQUEST_URI"]) . '?'
. (SID && !$_COOKIE ? SID . '&' : '') // !$_COOKIE - don't pass SID with permanent login
. (sid() ? SID . '&' : '')
. (SERVER !== null ? DRIVER . "=" . urlencode(SERVER) . '&' : '')
. (isset($_GET["username"]) ? "username=" . urlencode($_GET["username"]) . '&' : '')
. (DB != "" ? 'db=' . urlencode(DB) . '&' . (isset($_GET["ns"]) ? "ns=" . urlencode($_GET["ns"]) . "&" : "") : '')
@@ -69,7 +72,6 @@ include "../adminer/include/xxtea.inc.php";
include "../adminer/include/auth.inc.php";
include "./include/connect.inc.php";
include "./include/editing.inc.php";
include "./include/export.inc.php";
session_cache_limiter(""); // to allow restarting session
if (!ini_bool("session.use_cookies") || @ini_set("session.use_cookies", false) !== false) { // @ - may be disabled
@@ -77,4 +79,3 @@ if (!ini_bool("session.use_cookies") || @ini_set("session.use_cookies", false) !
}
$on_actions = array("RESTRICT", "CASCADE", "SET NULL", "NO ACTION"); ///< @var array used in foreign_keys()
$confirm = " onclick=\"return confirm('" . lang('Are you sure?') . "');\""; ///< @var string

View File

@@ -23,6 +23,9 @@ function connect_error() {
}
echo "<p>" . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>$connection->server_info</b>", "<b>$connection->extension</b>") . "\n";
echo "<p>" . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
if ($_GET["refresh"]) {
set_session("dbs", null);
}
$databases = get_databases();
if ($databases) {
$scheme = support("scheme");
@@ -39,13 +42,14 @@ function connect_error() {
echo "\n";
}
echo "</table>\n";
echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /db/) + ')');\">\n";
echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /db/)", 1) . ">\n"; // 1 - eventStop
echo "<a href='" . h(ME) . "refresh=1' onclick='eventStop(event);'>" . lang('Refresh') . "</a>\n";
echo "</form>\n";
}
}
page_footer("db");
if ($databases) {
echo "<script type='text/javascript' src='" . h(ME . "script=connect&token=$token") . "'></script>\n";
echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=connect');</script>\n";
}
}

View File

@@ -7,30 +7,34 @@
* @return null
*/
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
global $LANG, $HTTPS, $adminer, $connection, $drivers;
global $LANG, $adminer, $connection, $drivers;
header("Content-Type: text/html; charset=utf-8");
$adminer->headers();
$title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
$protocol = ($HTTPS ? "https" : "http");
?>
$title_page = $title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name();
if (is_ajax()) {
header("X-AJAX-Title: " . rawurlencode($title_page));
} else {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="<?php echo $LANG; ?>">
<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="robots" content="noindex">
<title><?php echo $title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name(); ?></title>
<title><?php echo $title_page; ?></title>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css<?php // Ondrej Valka, http://valka.info ?>">
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css">
<?php if (file_exists("adminer.css")) { ?>
<link rel="stylesheet" type="text/css" href="adminer.css">
<?php } ?>
<body onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
<body class="<?php echo lang('ltr'); ?>" onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>
<div id="content">
<?php
}
if (isset($breadcrumb)) {
$link = substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1);
echo '<p id="breadcrumb"><a href="' . ($link ? h($link) : ".") . '">' . $drivers[DRIVER] . '</a> &raquo; ';
@@ -59,9 +63,11 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
}
echo "<h2>$title_all</h2>\n";
restart_session();
if ($_SESSION["messages"]) {
echo "<div class='message'>" . implode("</div>\n<div class='message'>", $_SESSION["messages"]) . "</div>\n";
$_SESSION["messages"] = array();
$uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]);
$messages = $_SESSION["messages"][$uri];
if ($messages) {
echo "<div class='message'>" . implode("</div>\n<div class='message'>", $messages) . "</div>\n";
unset($_SESSION["messages"][$uri]);
}
$databases = &get_session("dbs");
if (DB != "" && $databases && !in_array(DB, $databases, true)) {
@@ -70,6 +76,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
if ($error) {
echo "<div class='error'>$error</div>\n";
}
define("PAGE_HEADER", 1);
}
/** Print HTML footer
@@ -78,7 +85,8 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
*/
function page_footer($missing = "") {
global $adminer;
?>
if (!is_ajax()) {
?>
</div>
<?php switch_lang(); ?>
@@ -86,4 +94,5 @@ function page_footer($missing = "") {
<?php $adminer->navigation($missing); ?>
</div>
<?php
}
}

View File

@@ -2,9 +2,10 @@
/** Print select result
* @param Min_Result
* @param Min_DB connection to examine indexes
* @param string base link for <th> fields
* @return null
*/
function select($result, $connection2 = null) {
function select($result, $connection2 = null, $href = "") {
$links = array(); // colno => orgtable - create links from these columns
$indexes = array(); // orgtable => array(column => colno) - primary keys
$columns = array(); // orgtable => array(column => ) - not selected columns in primary key
@@ -41,7 +42,8 @@ function select($result, $connection2 = null) {
$blobs[$j] = true;
}
$types[$j] = $field->type;
echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . h($field->name);
$name = h($field->name);
echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . ($href ? "<a href='$href" . strtolower($name) . "' target='_blank' rel='noreferrer'>$name</a>" : $name);
}
echo "</thead>\n";
}
@@ -104,7 +106,24 @@ function referencable_primary($self) {
* @return null
*/
function textarea($name, $value, $rows = 10, $cols = 80) {
echo "<textarea name='$name' rows='$rows' cols='$cols' style='width: 98%;' spellcheck='false' onkeydown='return textareaKeydown(this, event, true);'>" . h($value) . "</textarea>"; // spellcheck - not valid before HTML5
echo "<textarea name='$name' rows='$rows' cols='$cols' style='width: 98%;' spellcheck='false' wrap='off' onkeypress='return textareaKeypress(this, event, true);'>"; // spellcheck, wrap - not valid before HTML5
if (is_array($value)) {
foreach ($value as $val) { // not implode() to save memory
echo h($val) . ";\n\n\n"; // rtrim(, ';') would possibly damage DELIMITER
}
} else {
echo h($value);
}
echo "</textarea>";
}
/** Format time difference
* @param array ($sec, $sec)
* @param array ($sec, $sec)
* @return string HTML code
*/
function format_time($start, $end) {
return " <span class='time'>(" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . ")</span>";
}
/** Print table columns for type edit
@@ -118,7 +137,7 @@ function edit_type($key, $field, $collations, $foreign_keys = array()) {
global $structured_types, $types, $unsigned, $on_actions;
?>
<td><select name="<?php echo $key; ?>[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"><?php echo optionlist((!$field["type"] || isset($types[$field["type"]]) ? array() : array($field["type"])) + $structured_types + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select>
<td><input name="<?php echo $key; ?>[length]" value="<?php echo h($field["length"]); ?>" size="3" onfocus="editingLengthFocus(this);"><td><?php
<td><input name="<?php echo $key; ?>[length]" value="<?php echo h($field["length"]); ?>" size="3" onfocus="editingLengthFocus(this);"><td class="options"><?php
echo "<select name='$key" . "[collation]'" . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
echo ($unsigned ? "<select name='$key" . "[unsigned]'" . (!$field["type"] || ereg('(int|float|double|decimal)$', $field["type"]) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
echo ($foreign_keys ? "<select name='$key" . "[on_delete]'" . (ereg("`", $field["type"]) ? "" : " class='hidden'") . "><option value=''>(" . lang('ON DELETE') . ")" . optionlist($on_actions, $field["on_delete"]) . "</select> " : " "); // space for IE
@@ -212,6 +231,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
<?php } ?>
<td><?php echo "<input type='image' name='add[" . (support("move_col") ? 0 : count($fields)) . "]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script>
</thead>
<tbody onkeydown="return editingKeydown(event);">
<?php
foreach ($fields as $i => $field) {
$i++;
@@ -295,7 +315,7 @@ function normalize_enum($match) {
* @param array
* @param string
* @param string
* @return
* @return bool
*/
function grant($grant, $privileges, $columns, $on) {
if (!$privileges) {
@@ -328,8 +348,22 @@ function drop_create($drop, $create, $location, $message_drop, $message_alter, $
$dropped = $name != "" && ($_POST["dropped"] || queries($drop));
$created = queries($create);
if (!queries_redirect($location, ($name != "" ? $message_alter : $message_create), $created) && $dropped) {
restart_session();
$_SESSION["messages"][] = $message_drop;
redirect(null, $message_drop);
}
return $dropped;
}
/** Get string to add a file in TAR
* @param string
* @param string
* @return string
*/
function tar_file($filename, $contents) {
$return = pack("a100a8a8a8a12a12", $filename, 644, 0, 0, decoct(strlen($contents)), decoct(time()));
$checksum = 8*32; // space for checksum itself
for ($i=0; $i < strlen($return); $i++) {
$checksum += ord($return{$i});
}
$return .= sprintf("%06o", $checksum) . "\0 ";
return $return . str_repeat("\0", 512 - strlen($return)) . $contents . str_repeat("\0", 511 - (strlen($contents) + 511) % 512);
}

View File

@@ -1,176 +0,0 @@
<?php
function tar_file($filename, $contents) {
$return = pack("a100a8a8a8a12a12", $filename, 644, 0, 0, decoct(strlen($contents)), decoct(time()));
$checksum = 8*32; // space for checksum itself
for ($i=0; $i < strlen($return); $i++) {
$checksum += ord($return{$i});
}
$return .= sprintf("%06o", $checksum) . "\0 ";
return $return . str_repeat("\0", 512 - strlen($return)) . $contents . str_repeat("\0", 511 - (strlen($contents) + 511) % 512);
}
function dump_table($table, $style, $is_view = false) {
if ($_POST["format"] != "sql") {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
if ($style) {
dump_csv(array_keys(fields($table)));
}
} elseif ($style) {
$create = create_sql($table, $_POST["auto_increment"]);
if ($create) {
if ($style == "DROP+CREATE") {
echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . table($table) . ";\n";
}
if ($is_view) {
// remove DEFINER with current user
$create = preg_replace('~^([A-Z =]+) DEFINER=`' . str_replace("@", "`@`", logged_user()) . '`~', '\\1', $create); //! proper escaping of user
}
echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n";
}
if ($style == "CREATE+ALTER" && !$is_view) {
// create procedure which iterates over original columns and adds new and removes old
$query = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, COLLATION_NAME, COLUMN_TYPE, EXTRA, COLUMN_COMMENT FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = " . q($table) . " ORDER BY ORDINAL_POSITION";
echo "DELIMITER ;;
CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
DECLARE _column_name, _collation_name, after varchar(64) DEFAULT '';
DECLARE _column_type, _column_default text;
DECLARE _is_nullable char(3);
DECLARE _extra varchar(30);
DECLARE _column_comment varchar(255);
DECLARE done, set_after bool DEFAULT 0;
DECLARE add_columns text DEFAULT '";
$fields = array();
$after = "";
foreach (get_rows($query) as $row) {
$default = $row["COLUMN_DEFAULT"];
$row["default"] = (isset($default) ? q($default) : "NULL");
$row["after"] = q($after); //! rgt AFTER lft, lft AFTER id doesn't work
$row["alter"] = escape_string(idf_escape($row["COLUMN_NAME"])
. " $row[COLUMN_TYPE]"
. ($row["COLLATION_NAME"] ? " COLLATE $row[COLLATION_NAME]" : "")
. (isset($default) ? " DEFAULT " . ($default == "CURRENT_TIMESTAMP" ? $default : $row["default"]) : "")
. ($row["IS_NULLABLE"] == "YES" ? "" : " NOT NULL")
. ($row["EXTRA"] ? " $row[EXTRA]" : "")
. ($row["COLUMN_COMMENT"] ? " COMMENT " . q($row["COLUMN_COMMENT"]) : "")
. ($after ? " AFTER " . idf_escape($after) : " FIRST")
);
echo ", ADD $row[alter]";
$fields[] = $row;
$after = $row["COLUMN_NAME"];
}
echo "';
DECLARE columns CURSOR FOR $query;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
SET @alter_table = '';
OPEN columns;
REPEAT
FETCH columns INTO _column_name, _column_default, _is_nullable, _collation_name, _column_type, _extra, _column_comment;
IF NOT done THEN
SET set_after = 1;
CASE _column_name";
foreach ($fields as $row) {
echo "
WHEN " . q($row["COLUMN_NAME"]) . " THEN
SET add_columns = REPLACE(add_columns, ', ADD $row[alter]', '');
IF NOT (_column_default <=> $row[default]) OR _is_nullable != '$row[IS_NULLABLE]' OR _collation_name != '$row[COLLATION_NAME]' OR _column_type != " . q($row["COLUMN_TYPE"]) . " OR _extra != '$row[EXTRA]' OR _column_comment != " . q($row["COLUMN_COMMENT"]) . " OR after != $row[after] THEN
SET @alter_table = CONCAT(@alter_table, ', MODIFY $row[alter]');
END IF;"; //! don't replace in comment
}
echo "
ELSE
SET @alter_table = CONCAT(@alter_table, ', DROP ', _column_name);
SET set_after = 0;
END CASE;
IF set_after THEN
SET after = _column_name;
END IF;
END IF;
UNTIL done END REPEAT;
CLOSE columns;
IF @alter_table != '' OR add_columns != '' THEN
SET alter_command = CONCAT(alter_command, 'ALTER TABLE " . table($table) . "', SUBSTR(CONCAT(add_columns, @alter_table), 2), ';\\n');
END IF;
END;;
DELIMITER ;
CALL adminer_alter(@adminer_alter);
DROP PROCEDURE adminer_alter;
";
//! indexes
}
}
}
function dump_data($table, $style, $select = "") {
global $connection, $jush;
$max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024
if ($style) {
if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
echo truncate_sql($table) . ";\n";
}
$fields = fields($table);
$result = $connection->query(($select ? $select : "SELECT * FROM " . table($table)), 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers
if ($result) {
$insert = "";
$buffer = "";
while ($row = $result->fetch_assoc()) {
if ($_POST["format"] != "sql") {
dump_csv($row);
} else {
if (!$insert) {
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', array_keys($row))) . ") VALUES";
}
foreach ($row as $key => $val) {
$row[$key] = (isset($val) ? (ereg('int|float|double|decimal', $fields[$key]["type"]) ? $val : q($val)) : "NULL"); //! columns looking like functions
}
$s = implode(",\t", $row);
if ($style == "INSERT+UPDATE") {
$set = array();
foreach ($row as $key => $val) {
$set[] = idf_escape($key) . " = $val";
}
echo "$insert ($s) ON DUPLICATE KEY UPDATE " . implode(", ", $set) . ";\n";
} else {
$s = ($max_packet ? "\n" : " ") . "($s)";
if (!$buffer) {
$buffer = $insert . $s;
} elseif (strlen($buffer) + 2 + strlen($s) < $max_packet) { // 2 - separator and terminator length
$buffer .= ",$s";
} else {
$buffer .= ";\n";
echo $buffer;
$buffer = $insert . $s;
}
}
}
}
if ($_POST["format"] == "sql" && $style != "INSERT+UPDATE" && $buffer) {
$buffer .= ";\n";
echo $buffer;
}
}
}
}
function dump_headers($identifier, $multi_table = false) {
$filename = ($identifier != "" ? friendly_url($identifier) : "adminer");
$output = $_POST["output"];
$ext = ($_POST["format"] == "sql" ? "sql" : ($multi_table ? "tar" : "csv")); // multiple CSV packed to TAR
header("Content-Type: " .
($output == "bz2" ? "application/x-bzip" :
($output == "gz" ? "application/x-gzip" :
($ext == "tar" ? "application/x-tar" :
($ext == "sql" || $output != "file" ? "text/plain" : "text/csv") . "; charset=utf-8"
))));
if ($output != "text") {
header("Content-Disposition: attachment; filename=$filename.$ext" . ($output != "file" && !ereg('[^0-9a-z]', $output) ? ".$output" : ""));
}
session_write_close();
if ($_POST["output"] == "bz2") {
ob_start('bzcompress', 1e6);
}
if ($_POST["output"] == "gz") {
ob_start('gzencode', 1e6);
}
return $ext;
}

View File

@@ -135,6 +135,23 @@ function html_select($name, $options, $value = "", $onchange = true) {
return $return;
}
/** Get onclick confirmation
* @param string JavaScript expression
* @param bool stop event propagation
* @return string
*/
function confirm($count = "", $stop = false) {
return " onclick=\"" . ($stop ? "eventStop(event); " : "") . "return confirm('" . lang('Are you sure?') . ($count ? " (' + $count + ')" : "") . "');\"";
}
/** Escape string for JavaScript apostrophes
* @param string
* @return string
*/
function js_escape($string) {
return addcslashes($string, "\r\n'\\/"); // slash for <script>
}
/** Get INI boolean value
* @param string
* @return bool
@@ -144,6 +161,21 @@ function ini_bool($ini) {
return (eregi('^(on|true|yes)$', $val) || (int) $val); // boolean values set by php_value are strings
}
/** Check if SID is neccessary
* @return bool
*/
function sid() {
static $return;
if (!isset($return)) { // restart_session() defines SID
$return = (SID && !($_COOKIE && ini_bool("session.use_cookies"))); // $_COOKIE - don't pass SID with permanent login
}
return $return;
}
/** Shortcut for $connection->quote($string)
* @param string
* @return string
*/
function q($string) {
global $connection;
return $connection->quote($string);
@@ -178,8 +210,10 @@ function get_key_vals($query, $connection2 = null) {
}
$return = array();
$result = $connection2->query($query);
while ($row = $result->fetch_row()) {
$return[$row[0]] = $row[1];
if (is_object($result)) {
while ($row = $result->fetch_row()) {
$return[$row[0]] = $row[1];
}
}
return $return;
}
@@ -199,7 +233,7 @@ function get_rows($query, $connection2 = null, $error = "<p class='error'>") {
while ($row = $result->fetch_assoc()) {
$return[] = $row;
}
} elseif (!$result && $error && (headers_sent() || ob_get_level())) {
} elseif (!$result && $connection->error && $error && defined("PAGE_HEADER")) {
echo $error . error() . "\n";
}
return $return;
@@ -268,7 +302,7 @@ function where_check($val) {
* @return string
*/
function where_link($i, $column, $value, $operator = "=") {
return "&where%5B$i%5D%5Bcol%5D=" . urlencode($column) . "&where%5B$i%5D%5Bop%5D=" . urlencode($operator) . "&where%5B$i%5D%5Bval%5D=" . urlencode($value);
return "&where%5B$i%5D%5Bcol%5D=" . urlencode($column) . "&where%5B$i%5D%5Bop%5D=" . urlencode((isset($value) ? $operator : "IS NULL")) . "&where%5B$i%5D%5Bval%5D=" . urlencode($value);
}
/** Set cookie valid for 1 month
@@ -328,13 +362,20 @@ function auth_url($driver, $server, $username) {
global $drivers;
preg_match('~([^?]*)\\??(.*)~', remove_from_uri(implode("|", array_keys($drivers)) . "|username|" . session_name()), $match);
return "$match[1]?"
. (SID && !$_COOKIE ? SID . "&" : "")
. (sid() ? SID . "&" : "")
. ($driver != "server" || $server != "" ? urlencode($driver) . "=" . urlencode($server) . "&" : "")
. "username=" . urlencode($username)
. ($match[2] ? "&$match[2]" : "")
;
}
/** Find whether it is an AJAX request
* @return bool
*/
function is_ajax() {
return ($_SERVER["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest");
}
/** Send Location header and exit
* @param string null to only set a message
* @param string
@@ -343,10 +384,13 @@ function auth_url($driver, $server, $username) {
function redirect($location, $message = null) {
if (isset($message)) {
restart_session();
$_SESSION["messages"][] = $message;
$_SESSION["messages"][preg_replace('~^[^?]*~', '', (isset($location) ? $location : $_SERVER["REQUEST_URI"]))][] = $message;
}
if (isset($location)) {
header("Location: " . ($location != "" ? $location : "."));
if ($location == "") {
$location = ".";
}
header((is_ajax() ? "X-AJAX-Redirect" : "Location") . ": $location");
exit;
}
}
@@ -472,6 +516,25 @@ function odd($return = ' class="odd"') {
return ($i++ % 2 ? $return : '');
}
/** Print one row in JSON object
* @param string or "" to close the object
* @param string
* @return null
*/
function json_row($key, $val = null) {
static $first = true;
if ($first) {
echo "{";
}
if ($key != "") {
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\"\\") . '": ' . (isset($val) ? '"' . addcslashes($val, "\r\n\"\\") . '"' : 'undefined');
$first = false;
} else {
echo "\n}\n";
$first = true;
}
}
/** Check whether the string is in UTF-8
* @param string
* @return bool
@@ -481,6 +544,16 @@ function is_utf8($val) {
return (preg_match('~~u', $val) && !preg_match('~[\\0-\\x8\\xB\\xC\\xE-\\x1F]~', $val));
}
/** Create repeat pattern for preg
* @param string
* @param int
* @return string
*/
function repeat_pattern($pattern, $length) {
// fix for Compilation failed: number too big in {} quantifier
return str_repeat("$pattern{0,65535}", $length / 65535) . "$pattern{0," . ($length % 65535) . "}"; // can create {0,0} which is OK
}
/** Shorten UTF-8 string
* @param string
* @param int
@@ -488,8 +561,8 @@ function is_utf8($val) {
* @return string escaped string with appended ...
*/
function shorten_utf8($string, $length = 80, $suffix = "") {
if (!preg_match("(^([\t\r\n -\x{FFFF}]{0,$length})($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow
preg_match("(^([\t\r\n -~]{0,$length})($)?)", $string, $match);
if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow
preg_match("(^(" . repeat_pattern("[\t\r\n -~]", $length) . ")($)?)", $string, $match);
}
return h($match[1]) . $suffix . (isset($match[2]) ? "" : "<i>...</i>");
}
@@ -524,7 +597,7 @@ function hidden_fields($process, $ignore = array()) {
* @return null
*/
function hidden_fields_get() {
echo (SID && !$_COOKIE ? '<input type="hidden" name="' . session_name() . '" value="' . h(session_id()) . '">' : '');
echo (sid() ? '<input type="hidden" name="' . session_name() . '" value="' . h(session_id()) . '">' : '');
echo (SERVER !== null ? '<input type="hidden" name="' . DRIVER . '" value="' . h(SERVER) . '">' : "");
echo '<input type="hidden" name="username" value="' . h($_GET["username"]) . '">';
}
@@ -534,8 +607,9 @@ function hidden_fields_get() {
* @return array array($col => array())
*/
function column_foreign_keys($table) {
global $adminer;
$return = array();
foreach (foreign_keys($table) as $foreign_key) {
foreach ($adminer->foreignKeys($table) as $foreign_key) {
foreach ($foreign_key["source"] as $val) {
$return[$val][] = $foreign_key;
}
@@ -548,15 +622,19 @@ function column_foreign_keys($table) {
* @param string
* @param array
* @param mixed int|string|array
* @param string
* @return null
*/
function enum_input($type, $attrs, $field, $value) {
function enum_input($type, $attrs, $field, $value, $empty = null) {
global $adminer;
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
$return = (isset($empty) ? "<label><input type='$type'$attrs value='$empty'" . ((is_array($value) ? in_array($empty, $value) : $value === 0) ? " checked" : "") . "><i>" . lang('empty') . "</i></label>" : "");
foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? $value == $i+1 : (is_array($value) ? in_array($i+1, $value) : $value === $val));
echo " <label><input type='$type'$attrs value='" . ($i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($val) . '</label>';
$return .= " <label><input type='$type'$attrs value='" . ($i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($adminer->editVal($val, $field)) . '</label>';
}
return $return;
}
/** Print edit input field
@@ -569,12 +647,14 @@ function input($field, $value, $function) {
global $types, $adminer, $jush;
$name = h(bracket_escape($field["field"]));
echo "<td class='function'>";
$functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
$reset = ($jush == "mssql" && $field["auto_increment"]);
if ($reset && !$_POST["save"]) {
$function = null;
}
$functions = (isset($_GET["select"]) || $reset ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
$attrs = " name='fields[$name]'";
if ($field["type"] == "enum") {
echo nbsp($functions[""]) . "<td>" . ($functions["orig"] ? "<label><input type='radio'$attrs value='-1' checked><i>$functions[orig]</i></label> " : "");
echo $adminer->editInput($_GET["edit"], $field, $attrs, $value);
enum_input("radio", $attrs, $field, $value);
echo nbsp($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
} else {
$first = 0;
foreach ($functions as $key => $val) {
@@ -583,7 +663,7 @@ function input($field, $value, $function) {
}
$first++;
}
$onchange = ($first ? " onchange=\"var f = this.form['function[" . addcslashes($name, "\r\n'\\") . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
$onchange = ($first ? " onchange=\"var f = this.form['function[" . js_escape($name) . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
$attrs .= $onchange;
echo (count($functions) > 1 ? html_select("function[$name]", $functions, !isset($function) || in_array($function, $functions) || isset($functions[$function]) ? $function : "") : nbsp(reset($functions))) . '<td>';
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
@@ -594,15 +674,15 @@ function input($field, $value, $function) {
foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true));
echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($val) . '</label>';
echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($adminer->editVal($val, $field)) . '</label>';
}
} elseif (ereg('blob|bytea|raw|file', $field["type"]) && ini_bool("file_uploads")) {
echo "<input type='file' name='fields-$name'$onchange>";
} elseif (ereg('text|lob', $field["type"])) {
echo "<textarea " . ($jush != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs onkeydown='return textareaKeydown(this, event);'>" . h($value) . '</textarea>'; // 1.2em - line-height
echo "<textarea " . ($jush != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs onkeypress='return textareaKeypress(this, event);'>" . h($value) . '</textarea>'; // 1.2em - line-height
} else {
// int(3) is only a display hint
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
echo "<input value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . (ereg('char|binary', $field["type"]) && $maxlength > 20 ? " size='40'" : "") . "$attrs>";
}
}
@@ -624,7 +704,7 @@ function process_input($field) {
if ($value == "") {
return "NULL";
}
return intval($value);
return +$value;
}
if ($field["auto_increment"] && $value == "") {
return null;
@@ -674,17 +754,33 @@ function search_tables() {
echo ($found ? "</ul>" : "<p class='message'>" . lang('No tables.')) . "\n";
}
/** Send headers for export
* @param string
* @param bool
* @return string extension
*/
function dump_headers($identifier, $multi_table = false) {
global $adminer;
$return = $adminer->dumpHeaders($identifier, $multi_table);
$output = $_POST["output"];
if ($output != "text") {
header("Content-Disposition: attachment; filename=" . ($identifier != "" ? friendly_url($identifier) : "dump") . ".$return" . ($output != "file" && !ereg('[^0-9a-z]', $output) ? ".$output" : ""));
}
session_write_close();
return $return;
}
/** Print CSV row
* @param array
* @return null
*/
function dump_csv($row) {
foreach ($row as $key => $val) {
if (preg_match("~[\"\n,;]~", $val) || $val === "") {
if (preg_match("~[\"\n,;\t]~", $val) || $val === "") {
$row[$key] = '"' . str_replace('"', '""', $val) . '"';
}
}
echo implode(($_POST["format"] == "csv" ? "," : ";"), $row) . "\n";
echo implode(($_POST["format"] == "csv" ? "," : ($_POST["format"] == "tsv" ? "\t" : ";")), $row) . "\r\n";
}
/** Apply SQL function
@@ -744,7 +840,7 @@ function is_mail($email) {
*/
function is_url($string) {
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component //! IDN
return (preg_match("~^(https?)://($domain?\\.)+$domain(:[0-9]+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string, $match) ? strtolower($match[1]) : ""); //! restrict path, query and fragment characters
return (preg_match("~^(https?)://($domain?\\.)+$domain(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string, $match) ? strtolower($match[1]) : ""); //! restrict path, query and fragment characters
}
/** Print header for hidden fieldset (close by </div></fieldset>)
@@ -757,11 +853,10 @@ function print_fieldset($id, $legend, $visible = false) {
echo "<fieldset><legend><a href='#fieldset-$id' onclick=\"return !toggle('fieldset-$id');\">$legend</a></legend><div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
}
/** Enclose $string to <b> if $bold is true
* @param string
/** Return class='active' if $bold is true
* @param bool
* @return string
*/
function bold($string, $bold) {
return ($bold ? "<b>$string</b>" : $string);
function bold($bold) {
return ($bold ? " class='active'" : "");
}

View File

@@ -2,8 +2,8 @@
// not used in a single language version
$langs = array(
'en' => 'English', // Jakub Vrána - http://php.vrana.cz
'cs' => 'Čeština', // Jakub Vrána - http://php.vrana.cz
'en' => 'English', // Jakub Vrána - http://www.vrana.cz
'cs' => 'Čeština', // Jakub Vrána - http://www.vrana.cz
'sk' => 'Slovenčina', // Ivan Suchy - http://www.ivansuchy.com, Juraj Krivda - http://www.jstudio.cz
'nl' => 'Nederlands', // Maarten Balliauw - http://blog.maartenballiauw.be
'es' => 'Español', // Klemens Häckel - http://clickdimension.wordpress.com
@@ -12,19 +12,40 @@ $langs = array(
'it' => 'Italiano', // Alessandro Fiorotto, Paolo Asperti
'et' => 'Eesti', // Priit Kallas
'hu' => 'Magyar', // Borsos Szilárd (Borsosfi) - http://www.borsosfi.hu, info@borsosfi.hu
// hidden because of poor quality according to author: 'pl' => 'Polski', // Helmut von Ślask cieszyński
'ca' => 'Català', // Joan Llosas
'pt' => 'Português', // Gian Live - gian@live.com
'sl' => 'Slovenski', // Matej Ferlan - www.itdinamik.com, matej.ferlan@itdinamik.com
'tr' => 'Türkçe', // Bilgehan Korkmaz - turktron.com
'ru' => 'Русский язык', // Maksim Izmaylov
'zh' => '简体中文', // Mr. Lodar
'zh-tw' => '繁體中文', // http://tzangms.com
'ja' => '日本語', // Hitoshi Ozawa - http://sourceforge.jp/projects/oss-ja-jpn/releases/
'ta' => 'த‌மிழ்', // G. Sampath Kumar, Chennai, India, sampathkumar11@gmail.com
'ar' => 'العربية', // Y.M Amine - Algeria - nbr7@live.fr
);
/** Get current language
* @return string
*/
function get_lang() {
global $LANG;
return $LANG;
}
/** Translate string
* @param string
* @param int
* @return string
*/
function lang($idf, $number = null) {
global $LANG, $translations;
$translation = $translations[$idf];
if (is_array($translation) && $translation) {
$pos = ($number == 1 || (!$number && $LANG == 'fr') ? 0 : ((!$number || $number >= 5) && ereg('cs|sk|ru', $LANG) ? 2 : 1)); // French treat zero as singular, Slavic languages use different form for 2, 3, 4
$pos = ($number == 1 || (!$number && $LANG == 'fr') ? 0 // French treat zero as singular
: ($LANG == 'sl' && (!$number || $number > 2) ? 1 : 0) // Slovenian use different forms for 1, 2, 3-4, other
+ ((!$number || $number >= 5) && ereg('cs|sk|ru|sl', $LANG) ? 2 : 1) // Slavic languages use different forms for 1, 2-4, other
);
$translation = $translation[$pos];
}
$args = func_get_args();
@@ -36,7 +57,7 @@ function switch_lang() {
global $LANG, $langs;
echo "<form action=''>\n<div id='lang'>";
hidden_fields($_GET, array('lang'));
echo lang('Language') . ": " . html_select("lang", $langs, $LANG, "this.form.submit();");
echo lang('Language') . ": " . html_select("lang", $langs, $LANG, "var loc = location.search.replace(/[?&]lang=[^&]*/, ''); location.search = loc + (loc ? '&' : '') + 'lang=' + this.value;");
echo " <input type='submit' value='" . lang('Use') . "' class='hidden'>\n";
echo "</div>\n</form>\n";
}

View File

@@ -79,5 +79,4 @@ if (extension_loaded('pdo')) {
}
}
$possible_drivers = array();
$drivers = array();

View File

@@ -1,2 +1,2 @@
<?php
$VERSION = "3.0.1";
$VERSION = "3.2.0";

View File

@@ -1,14 +1,15 @@
<?php
/** Adminer - Compact database management
* @link http://www.adminer.org/
* @author Jakub Vrana, http://php.vrana.cz/
* @author Jakub Vrana, http://www.vrana.cz/
* @copyright 2007 Jakub Vrana
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
include "./include/bootstrap.inc.php";
$enum_length = '\'(?:\'\'|[^\'\\\\]|\\\\.)*\'|"(?:""|[^"\\\\]|\\\\.)*"';
$enum_length = "'(?:''|[^'\\\\]|\\\\.)*+'";
$inout = array("IN", "OUT", "INOUT");
if (isset($_GET["select"]) && ($_POST["edit"] || $_POST["clone"]) && !$_POST["save"]) {

View File

@@ -2,7 +2,7 @@
$TABLE = $_GET["indexes"];
$index_types = array("PRIMARY", "UNIQUE", "INDEX");
$table_status = table_status($TABLE);
if (ereg("MyISAM|Maria", $table_status["Engine"])) {
if (eregi("MyISAM|M?aria", $table_status["Engine"])) {
$index_types[] = "FULLTEXT";
}
$indexes = indexes($TABLE);
@@ -21,7 +21,7 @@ if ($_POST && !$error && !$_POST["add"]) {
foreach ($index["columns"] as $key => $column) {
if ($column != "") {
$length = $index["lengths"][$key];
$set[] = idf_escape($column) . ($length ? "(" . intval($length) . ")" : "");
$set[] = idf_escape($column) . ($length ? "(" . (+$length) . ")" : "");
$columns[] = $column;
$lengths[] = ($length ? $length : null);
}
@@ -84,9 +84,9 @@ foreach ($row["indexes"] as $index) {
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow(this);" : 1)) . "<td>";
ksort($index["columns"]);
$i = 1;
foreach ($index["columns"] as $column) {
foreach ($index["columns"] as $key => $column) {
echo "<span>" . html_select("indexes[$j][columns][$i]", array(-1 => "") + $fields, $column, ($i == count($index["columns"]) ? "indexesAddColumn(this);" : 1));
echo "<input name='indexes[$j][lengths][$i]' size='2' value='" . h($index["lengths"][$i]) . "'> </span>"; //! hide for non-MySQL drivers, add ASC|DESC
echo "<input name='indexes[$j][lengths][$i]' size='2' value='" . h($index["lengths"][$key]) . "'> </span>"; //! hide for non-MySQL drivers, add ASC|DESC
$i++;
}
$j++;

267
adminer/lang/ar.inc.php Normal file
View File

@@ -0,0 +1,267 @@
<?php
$translations = array(
'Login' => 'تسجيل الدخول',
'Logout successful.' => 'مع السلامة.',
'Invalid credentials.' => 'فشل في تسجيل الدخول.',
'Server' => 'الخادم',
'Username' => 'المستعمل',
'Password' => 'كلمة المرور',
'Select database' => 'إختر قاعدة البيانات',
'Invalid database.' => 'قاعدة بيانات خاطئة.',
'Create new database' => 'أنشئ فاعدة بيانات',
'Table has been dropped.' => 'تم حذف الجدول.',
'Table has been altered.' => 'تم تعديل الجدول.',
'Table has been created.' => 'تم إنشاء الجدول.',
'Alter table' => 'تعديل الجدول',
'Create table' => 'إنشاء جدول',
'Table name' => 'إسم الجدول',
'engine' => 'المحرك',
'collation' => 'الترتيب',
'Column name' => 'إسم العمود',
'Type' => 'النوع',
'Length' => 'الطول',
'Auto Increment' => 'تزايد تلقائي',
'Options' => 'خيارات',
'Save' => 'حفظ',
'Drop' => 'حذف',
'Database has been created.' => 'تم إنشاء قاعدة البيانات.',
'Database has been renamed.' => 'تمت إعادة تسمية فاعدة البيانات.',
'Database has been altered.' => 'تم تعديل قاعدة البيانات.',
'Alter database' => 'تعديل قاعدة البيانات',
'Create database' => 'إنشاء قاعدة بيانات',
'SQL command' => 'إستعلام SQL',
'Dump' => 'تصدير',
'Logout' => 'تسجيل الخروج',
'database' => 'قاعدة بيانات',
'Use' => 'المستعمل',
'No tables.' => 'لا توجد جداول.',
'select' => 'تحديد',
'Create new table' => 'أنشئ جدول جديد',
'Item has been deleted.' => 'تم حذف العنصر.',
'Item has been updated.' => 'تم تعديل العنصر.',
'Edit' => 'تعديل',
'Insert' => 'إنشاء',
'Save and insert next' => 'جفظ و إنشاء التالي',
'Delete' => 'مسح',
'Database' => 'قاعدة بيانات',
'Routines' => 'الروتينات',
'Indexes have been altered.' => 'تم تعديل المؤشر.',
'Indexes' => 'المؤشرات',
'Alter indexes' => 'تعديل المؤشرات',
'Add next' => 'إضافة التالي',
'Language' => 'اللغة',
'Select' => 'إختيار',
'New item' => 'عنصر جديد',
'Search' => 'بحث',
'Sort' => 'ترتيب',
'descending' => 'تنازلي',
'Limit' => 'حد',
'No rows.' => 'لا توجد نتائج.',
'Action' => 'حركة',
'edit' => 'تعديل',
'Page' => 'صفحة',
'Query executed OK, %d row(s) affected.' => 'تم تنفسذ الإستعلام, %d عدد الأسطر المعدلة.',
'Error in query' => 'هناك خطأ في الإستعلام',
'Execute' => 'تنفيذ',
'Table' => 'جدول',
'Foreign keys' => 'مفاتيح أجنبية',
'Triggers' => 'الزنادات',
'View' => 'عرض',
'Unable to select the table' => 'من غير الممكن إختيار الجدول',
'Invalid CSRF token. Send the form again.' => 'CSRF Token خاطئ. من فضلك أعد إرسال الإستمارة.',
'Comment' => 'تعليق',
'Default values' => 'القيمة الإفتراضية',
'%d byte(s)' => '%d بايت',
'No commands to execute.' => 'لا توجد أوامر للتنفيذ.',
'Unable to upload a file.' => 'من غير الممكن رفع الملف.',
'File upload' => 'رفع ملف',
'File uploads are disabled.' => 'تم إلغاء رفع الملفات.',
'Routine has been called, %d row(s) affected.' => 'تم إستدعاء الروتين, عدد الأسطر المعدلة %d.',
'Call' => 'إستدعاء',
'No extension' => 'إمتداد غير موجود',
'None of the supported PHP extensions (%s) are available.' => 'إمتدادات php المدعومة غير موجودة.',
'Session support must be enabled.' => 'عليك تفعيل نظام الجلسات.',
'Session expired, please login again.' => 'إنتهت الجلسة، من فضلك أعد تسجيل الدخول.',
'Text length' => 'طول النص',
'Foreign key has been dropped.' => 'المفتاح الأجنبي تم مسحه.',
'Foreign key has been altered.' => 'المفتاح الأجنبي تم تعديله.',
'Foreign key has been created.' => 'المفتاح الأجنبي تم إنشاؤه.',
'Foreign key' => 'مفتاح أجنبي',
'Target table' => 'الجدول المستهدف',
'Change' => 'تعديل',
'Source' => 'المصدر',
'Target' => 'الهدف',
'Add column' => 'أضف عمود',
'Alter' => 'تعديل',
'Add foreign key' => 'إضافة مفتاح أجنبي',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'نوع المؤشر',
'Column (length)' => 'العمود (الطول)',
'View has been dropped.' => 'تم مسح العرض.',
'View has been altered.' => 'تم تعديل العرض.',
'View has been created.' => 'تم إنشاء العرض.',
'Alter view' => 'تعديل عرض',
'Create view' => 'إنشاء عرض',
'Name' => 'الإسم',
'Process list' => 'قائمة الإجراءات',
'%d process(es) have been killed.' => 'عدد الإجراءات التي تم إيقافها %d.',
'Kill' => 'إيقاف',
'Parameter name' => 'إسم المتغير',
'Database schema' => 'مخطط فاعدة البيانات',
'Create procedure' => 'إنشاء إجراء',
'Create function' => 'إنشاء دالة',
'Routine has been dropped.' => 'تم حذف الروتين.',
'Routine has been altered.' => 'تم تعديل الروتين.',
'Routine has been created.' => 'تم إنشاء الروتين.',
'Alter function' => 'تعديل الدالة',
'Alter procedure' => 'تعديل الإجراء',
'Return type' => 'نوع العودة',
'Add trigger' => 'إضافة زناد',
'Trigger has been dropped.' => 'تم حذف الزناد.',
'Trigger has been altered.' => 'تم تعديل الزناد.',
'Trigger has been created.' => 'تم إنشاء الزناد.',
'Alter trigger' => 'تعديل زناد',
'Create trigger' => 'إنشاء زناد',
'Time' => 'الوقت',
'Event' => 'الحدث',
'%d row(s)' => '%d أسطر',
'Remove' => 'مسح',
'Are you sure?' => 'هل أنت متأكد؟',
'Privileges' => 'الإمتيازات',
'Create user' => 'إنشاء مستخدم',
'User has been dropped.' => 'تم حذف المستخدم.',
'User has been altered.' => 'تم تعديل المستخدم.',
'User has been created.' => 'تم إنشاء المستخدم.',
'Hashed' => 'تلبيد',
'Column' => 'عمود',
'Routine' => 'روتين',
'Grant' => 'Grant',
'Revoke' => 'Revoke',
'%s version: %s through PHP extension %s' => 'النسخة %s : %s عن طريق إمتداد ال PHP %s',
'Logged as: %s' => 'تم تسجيل الدخول بإسم %s',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'معلومات POST كبيرة جدا. قم بتقليص حجم المعلومات أو قم بزيادة قيمة %s في خيارات ال PHP.',
'Move up' => 'نقل للأعلى',
'Move down' => 'نقل للأسفل',
'Export' => 'تصدير',
'Tables' => 'جداول',
'Data' => 'معلومات',
'Output' => 'إخراج',
'open' => 'فتح',
'save' => 'حفظ',
'Format' => 'الصيغة',
'Functions' => 'الدوال',
'Aggregation' => 'تجميع',
'Event has been dropped.' => 'تم مسح الحدث.',
'Event has been altered.' => 'تم تعديل الحدث.',
'Event has been created.' => 'تم إنشاء الحدث.',
'Alter event' => 'تعديل حدث',
'Create event' => 'إنشاء حدث',
'Start' => 'إبدأ',
'End' => 'إنهاء',
'Every' => 'كل',
'Status' => 'حالة',
'On completion preserve' => 'حفظ عند الإنتهاء',
'Events' => 'الأحداث',
'Schedule' => 'مواعيد',
'At given time' => 'في وقت محدد',
'Save and continue edit' => 'إحفظ و واصل التعديل',
'original' => 'الأصلي',
'Tables have been truncated.' => 'تم قطع الجداول.',
'Tables have been moved.' => 'تم نقل الجداول.',
'Tables have been dropped.' => 'تم حذف الجداول.',
'Tables and views' => 'الجداول و العروض',
'Engine' => 'المحرك',
'Collation' => 'ترتيب',
'Data Length' => 'طول المعطيات.',
'Index Length' => 'طول المؤشر.',
'Data Free' => 'المساحة الحرة',
'Rows' => 'الأسطر',
',' => ',',
'Analyze' => 'تحليل',
'Optimize' => 'تحسين',
'Check' => 'فحص',
'Repair' => 'إصلاح',
'Truncate' => 'قطع',
'Move to other database' => 'نقل إلى قاعدة بيانات أخرى',
'Move' => 'نقل',
'%d item(s) have been affected.' => 'عدد العناصر المعدلة هو %d.',
'whole result' => 'نتيجة كاملة',
'Clone' => 'نسخ',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'لقد تجاوزت العدد الأقصى للحقول. يرجى الرفع من %s و %s.',
'Partition by' => 'مقسم بواسطة',
'Partitions' => 'التقسيمات',
'Partition name' => 'إسم التقسيم',
'Values' => 'القيم',
'%d row(s) have been imported.' => 'عدد الأسطر المستوردة هو %d.',
'anywhere' => 'في اي مكان',
'Import' => 'إستيراد',
'Stop on error' => 'أوقف في حالة حدوث خطأ',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$5/$3/$1',
'[yyyy]-mm-dd' => 'jj/mm/[aaaa]',
'History' => 'تاريخ',
'Variables' => 'متغيرات',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'أعمدة المصدر و الهدف يجب أن تكون بنفس النوع, يجب أن يكون هناك مؤشر في أعمدة الهدف و البيانات المرجعية يجب ان تكون موجودة.',
'Relations' => 'علاقات',
'Run file' => 'نفذ الملف',
'Clear' => 'مسح',
'Maximum allowed file size is %sB.' => 'حجم الملف الأقصى هو %sB.',
'Numbers' => 'أعداد',
'Date and time' => 'التاريخ و الوقت',
'Strings' => 'سلاسل',
'Binary' => 'ثنائية',
'Lists' => 'قوائم',
'Editor' => 'المحرر',
'E-mail' => 'البريد الإلكتروني',
'From' => 'من',
'Subject' => 'الموضوع',
'Send' => 'إرسال',
'%d e-mail(s) have been sent.' => 'تم إرسال %d رسالة.',
'Webserver file %s' => 'ملف %s من خادم الويب',
'File does not exist.' => 'الملف غير موجود.',
'%d in total' => '%d في المجموع',
'Permanent login' => 'تسجيل دخول دائم',
'Databases have been dropped.' => 'تم حذف قواعد البيانات.',
'Database has been dropped.' => 'تم حذف قاعدة البيانات.',
'Search data in tables' => 'بحث في الجداول',
'schema' => 'المخطط',
'Schema' => 'المخطط',
'Alter schema' => 'تعديل المخطط',
'Create schema' => 'إنشاء مخطط',
'Schema has been dropped.' => 'تم حذف المخطط.',
'Schema has been created.' => 'تم إنشاء المخطط.',
'Schema has been altered.' => 'تم تعديل المخطط.',
'Sequences' => 'السلاسل',
'Create sequence' => 'إنشاء سلسلة',
'Alter sequence' => 'تعديل سلسلة',
'Sequence has been dropped.' => 'تم حذف السلسلة.',
'Sequence has been created.' => 'تم إنشاء السلسلة.',
'Sequence has been altered.' => 'تم تعديل السلسلة.',
'User types' => 'نوع المستخدم',
'Create type' => 'إنشاء نوع',
'Alter type' => 'تعديل نوع',
'Type has been dropped.' => 'تم حذف النوع.',
'Type has been created.' => 'تم إنشاء النوع.',
'Double click on a value to modify it.' => 'أنقر نقرا مزدوجا على قيمة لتعديلها.',
'Use edit link to modify this value.' => 'إستعمل الرابط "تعديل" لتعديل هذه القيمة.',
'last' => 'الأخيرة',
'From server' => 'من الخادم',
'System' => 'النظام',
'Select data' => 'عرض البيانات',
'Show structure' => 'عرض التركيبة',
'empty' => 'فارغ',
'Network' => 'شبكة',
'Geometry' => 'هندسة',
'File exists.' => 'الملف موجود.',
'Attachments' => 'ملفات مرفقة.',
'Item%s has been inserted.' => 'تم إدراج العنصر.',
'now' => 'الآن',
'%d query(s) executed OK.' => array('تم تنفيذ الإستعلام %d بنجاح.', 'تم تنفيذ الإستعلامات %d بنجاح.'),
'Show only errors' => 'إعرض الأخطاء فقط',
'Last page' => 'الصفحة السابقة',
'Refresh' => 'تحديث',
'Invalid schema.' => 'مخطط خاطئ.',
'Please use one of the extensions %s.' => 'من فضلك إستعمل إحدى الغمتدادات: %s.',
'ltr' => 'rtl',
);

View File

@@ -9,8 +9,8 @@ $translations = array(
'Select database' => 'Selecciona base de dades',
'Invalid database.' => 'Base de dades invàlida.',
'Create new database' => 'Crea una nova base de dades',
'Table has been dropped.' => 'S\'ha creat la taula.',
'Table has been altered.' => 'S\'ha creat la taula.',
'Table has been dropped.' => 'S\'ha suprimit la taula.',
'Table has been altered.' => 'S\'ha modificat la taula.',
'Table has been created.' => 'S\'ha creat la taula.',
'Alter table' => 'Modifica la taula',
'Create table' => 'Crea una taula',
@@ -35,8 +35,8 @@ $translations = array(
'Logout' => 'Desconnecta',
'database' => 'base de dades',
'Use' => 'Utilitza',
'No tables.' => 'Cap taula.',
'select' => 'escull',
'No tables.' => 'No hi ha cap taula.',
'select' => 'registres',
'Create new table' => 'Crea una nova taula',
'Item has been deleted.' => 'S\'ha suprmit l\'element.',
'Item has been updated.' => 'S\'ha actualitzat l\'element.',
@@ -52,7 +52,7 @@ $translations = array(
'Alter indexes' => 'Modifica els índexs',
'Add next' => 'Afegeix el següent',
'Language' => 'Idioma',
'Select' => 'Escull',
'Select' => 'Selecciona',
'New item' => 'Nou element',
'Search' => 'Cerca',
'Sort' => 'Ordena',
@@ -129,7 +129,7 @@ $translations = array(
'Event' => 'Event',
'%s version: %s through PHP extension %s' => 'Versió %s: %s amb l\'extensió de PHP %s',
'%d row(s)' => array('%d fila', '%d files'),
'Remove' => 'Esborra',
'Remove' => 'Suprimeix',
'Are you sure?' => 'Estàs segur?',
'Privileges' => 'Privilegis',
'Create user' => 'Crea un usuari',
@@ -195,16 +195,15 @@ $translations = array(
'Partition name' => 'Nom de la partició',
'Values' => 'Valors',
'%d row(s) have been imported.' => array('S\'ha importat %d fila.', 'S\'han importat %d files.'),
'CSV Import' => 'Importa CSV',
'Import' => 'Importa',
'Show structure' => 'Mostra l\'estructura',
'Select data' => 'Escull dades',
'Select data' => 'Selecciona dades',
'Stop on error' => 'Atura en trobar un error',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'S\'ha assolit el nombre màxim de camps. Incrementa %s i %s.',
'anywhere' => 'a qualsevol lloc',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$5/$3/$1',
'[yyyy]-mm-dd' => 'dd-mm-[aaaa]',
'[yyyy]-mm-dd' => 'dd/mm/[aaaa]',
'History' => 'Història',
'Variables' => 'Variables',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Les columnes origen i destí han de ser del mateix tipus, la columna destí ha d\'estar indexada i les dades referenciades han d\'existir.',
@@ -215,13 +214,13 @@ $translations = array(
'%d e-mail(s) have been sent.' => array('S\'ha enviat %d correu electrònic.', 'S\'han enviat %d correus electrònics.'),
'Run file' => 'Executa el fitxer',
'Numbers' => 'Nombres',
'Date and time' => 'Data i temps',
'Date and time' => 'Data i hora',
'Strings' => 'Cadenes',
'Binary' => 'Binari',
'Lists' => 'Llistes',
'Relations' => 'Relacions',
'Maximum allowed file size is %sB.' => 'La mida màxima permesa del fitxer és de %sB.',
'Clear' => 'Esborra',
'Clear' => 'Suprimeix',
'Editor' => 'Editor',
'Webserver file %s' => 'Fitxer %s del servidor web',
'File does not exist.' => 'El fitxer no existeix.',
@@ -235,7 +234,6 @@ $translations = array(
'Databases have been dropped.' => 'S\'han suprimit les bases de dades.',
'File exists.' => 'El fitxer ja existeix.',
'Double click on a value to modify it.' => 'Fes un doble clic a un valor per modificar-lo.',
'Increase Text length to modify this value.' => 'Incrementa la Longitud del text per modificar aquest valor.',
'Use edit link to modify this value.' => 'Utilitza l\'enllaç d\'edició per modificar aquest valor.',
'Alter schema' => 'Modifica l\'esquema',
'Create schema' => 'Crea un esquema',
@@ -259,4 +257,11 @@ $translations = array(
'From server' => 'En el servidor',
'empty' => 'buit',
'now' => 'ara',
'%d query(s) executed OK.' => array('%d consulta executada correctament.', '%d consultes executades correctament.'),
'Show only errors' => 'Mostra només els errors',
'Last page' => 'Darrera plana',
'Refresh' => 'Refresca',
'Invalid schema.' => 'Esquema invàlid.',
'Please use one of the extensions %s.' => 'Si us plau, utilitza una de les extensions %s.',
'ltr' => 'ltr',
);

View File

@@ -1,140 +1,28 @@
<?php
$translations = array(
'Login' => 'Přihlásit se',
'Logout successful.' => 'Odhlášení proběhlo v pořádku.',
'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Systém',
'Server' => 'Server',
'Username' => 'Uživatel',
'Password' => 'Heslo',
'Select database' => 'Vybrat databázi',
'Invalid database.' => 'Nesprávná databáze.',
'Create new database' => 'Vytvořit novou databázi',
'Table has been dropped.' => 'Tabulka byla odstraněna.',
'Table has been altered.' => 'Tabulka byla změněna.',
'Table has been created.' => 'Tabulka byla vytvořena.',
'Alter table' => 'Pozměnit tabulku',
'Create table' => 'Vytvořit tabulku',
'Table name' => 'Název tabulky',
'engine' => 'úložiště',
'collation' => 'porovnávání',
'Column name' => 'Název sloupce',
'Type' => 'Typ',
'Length' => 'Délka',
'Auto Increment' => 'Auto Increment',
'Options' => 'Volby',
'Save' => 'Uložit',
'Drop' => 'Odstranit',
'Database has been dropped.' => 'Databáze byla odstraněna.',
'Databases have been dropped.' => 'Databáze byly odstraněny.',
'Database has been created.' => 'Databáze byla vytvořena.',
'Database has been renamed.' => 'Databáze byla přejmenována.',
'Database has been altered.' => 'Databáze byla změněna.',
'Alter database' => 'Pozměnit databázi',
'Create database' => 'Vytvořit databázi',
'SQL command' => 'SQL příkaz',
'Dump' => 'Export',
'Permanent login' => 'Trvalé přihlášení',
'Login' => 'Přihlásit se',
'Logout' => 'Odhlásit',
'database' => 'databáze',
'Use' => 'Vybrat',
'No tables.' => 'Žádné tabulky.',
'select' => 'vypsat',
'Create new table' => 'Vytvořit novou tabulku',
'Item has been deleted.' => 'Položka byla smazána.',
'Item has been updated.' => 'Položka byla aktualizována.',
// %s can contain auto-increment value
'Item%s has been inserted.' => 'Položka%s byla vložena.',
'Edit' => 'Upravit',
'Insert' => 'Vložit',
'Save and insert next' => 'Uložit a vložit další',
'Delete' => 'Smazat',
'Database' => 'Databáze',
'Routines' => 'Procedury a funkce',
'Indexes have been altered.' => 'Indexy byly změněny.',
'Indexes' => 'Indexy',
'Alter indexes' => 'Pozměnit indexy',
'Add next' => 'Přidat další',
'Logged as: %s' => 'Přihlášen jako: %s',
'Logout successful.' => 'Odhlášení proběhlo v pořádku.',
'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
'Language' => 'Jazyk',
'Select' => 'Vypsat',
'New item' => 'Nová položka',
'Search' => 'Vyhledat',
'Sort' => 'Seřadit',
'descending' => 'sestupně',
'Limit' => 'Limit',
'No rows.' => 'Žádné řádky.',
'Action' => 'Akce',
'edit' => 'upravit',
'Page' => 'Stránka',
'Query executed OK, %d row(s) affected.' => array('Příkaz proběhl v pořádku, byl změněn %d záznam.', 'Příkaz proběhl v pořádku, byly změněny %d záznamy.', 'Příkaz proběhl v pořádku, bylo změněno %d záznamů.'),
'Error in query' => 'Chyba v dotazu',
'Execute' => 'Provést',
'Table' => 'Tabulka',
'Foreign keys' => 'Cizí klíče',
'Triggers' => 'Triggery',
'View' => 'Pohled',
'Unable to select the table' => 'Nepodařilo se vypsat tabulku',
'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odešlete formulář znovu.',
'Comment' => 'Komentář',
'Default values' => 'Výchozí hodnoty',
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtů'),
'No commands to execute.' => 'Žádné příkazy k vykonání.',
'Unable to upload a file.' => 'Nepodařilo se nahrát soubor.',
'File upload' => 'Nahrání souboru',
'File uploads are disabled.' => 'Nahrávání souborů není povoleno.',
'Routine has been called, %d row(s) affected.' => array('Procedura byla zavolána, byl změněn %d záznam.', 'Procedura byla zavolána, byly změněny %d záznamy.', 'Procedura byla zavolána, bylo změněno %d záznamů.'),
'Call' => 'Zavolat',
'No extension' => 'Žádná extenze',
'None of the supported PHP extensions (%s) are available.' => 'Není dostupná žádná z podporovaných PHP extenzí (%s).',
'Session support must be enabled.' => 'Session proměnné musí být povolené.',
'Session expired, please login again.' => 'Session vypršela, přihlašte se prosím znovu.',
'Text length' => 'Délka textů',
'Foreign key has been dropped.' => 'Cizí klíč byl odstraněn.',
'Foreign key has been altered.' => 'Cizí klíč byl změněn.',
'Foreign key has been created.' => 'Cizí klíč byl vytvořen.',
'Foreign key' => 'Cizí klíč',
'Target table' => 'Cílová tabulka',
'Change' => 'Změnit',
'Source' => 'Zdroj',
'Target' => 'Cíl',
'Add column' => 'Přidat sloupec',
'Alter' => 'Změnit',
'Add foreign key' => 'Přidat cizí klíč',
'ON DELETE' => 'Při smazání',
'ON UPDATE' => 'Při změně',
'Index Type' => 'Typ indexu',
'Column (length)' => 'Sloupec (délka)',
'View has been dropped.' => 'Pohled byl odstraněn.',
'View has been altered.' => 'Pohled byl změněn.',
'View has been created.' => 'Pohled byl vytvořen.',
'Alter view' => 'Pozměnit pohled',
'Create view' => 'Vytvořit pohled',
'Name' => 'Název',
'Process list' => 'Seznam procesů',
'%d process(es) have been killed.' => array('Byl ukončen %d proces.', 'Byly ukončeny %d procesy.', 'Bylo ukončeno %d procesů.'),
'Kill' => 'Ukončit',
'Parameter name' => 'Název parametru',
'Database schema' => 'Schéma databáze',
'Create procedure' => 'Vytvořit proceduru',
'Create function' => 'Vytvořit funkci',
'Routine has been dropped.' => 'Procedura byla odstraněna.',
'Routine has been altered.' => 'Procedura byla změněna.',
'Routine has been created.' => 'Procedura byla vytvořena.',
'Alter function' => 'Změnit funkci',
'Alter procedure' => 'Změnit proceduru',
'Return type' => 'Návratový typ',
'Add trigger' => 'Přidat trigger',
'Trigger has been dropped.' => 'Trigger byl odstraněn.',
'Trigger has been altered.' => 'Trigger byl změněn.',
'Trigger has been created.' => 'Trigger byl vytvořen.',
'Alter trigger' => 'Změnit trigger',
'Create trigger' => 'Vytvořit trigger',
'Time' => 'Čas',
'Event' => 'Událost',
'%s version: %s through PHP extension %s' => 'Verze %s: %s přes PHP extenzi %s',
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
'Remove' => 'Odebrat',
'Are you sure?' => 'Opravdu?',
'Refresh' => 'Obnovit',
// text direction
'ltr' => 'ltr',
'Privileges' => 'Oprávnění',
'Create user' => 'Vytvořit uživatele',
'User has been dropped.' => 'Uživatel byl odstraněn.',
@@ -145,19 +33,95 @@ $translations = array(
'Routine' => 'Procedura',
'Grant' => 'Povolit',
'Revoke' => 'Zakázat',
'Process list' => 'Seznam procesů',
'%d process(es) have been killed.' => array('Byl ukončen %d proces.', 'Byly ukončeny %d procesy.', 'Bylo ukončeno %d procesů.'),
'Kill' => 'Ukončit',
'Variables' => 'Proměnné',
'Status' => 'Stav',
'SQL command' => 'SQL příkaz',
'%d query(s) executed OK.' => array('%d příkaz proběhl v pořádku.', '%d příkazy proběhly v pořádku.', '%d příkazů proběhlo v pořádku.'),
'Query executed OK, %d row(s) affected.' => array('Příkaz proběhl v pořádku, byl změněn %d záznam.', 'Příkaz proběhl v pořádku, byly změněny %d záznamy.', 'Příkaz proběhl v pořádku, bylo změněno %d záznamů.'),
'No commands to execute.' => 'Žádné příkazy k vykonání.',
'Error in query' => 'Chyba v dotazu',
'Execute' => 'Provést',
'Stop on error' => 'Zastavit při chybě',
'Show only errors' => 'Zobrazit pouze chyby',
// sprintf() format for time of the command
'%.3f s' => '%.3f s',
'History' => 'Historie',
'Clear' => 'Vyčistit',
'File upload' => 'Nahrání souboru',
'From server' => 'Ze serveru',
'Webserver file %s' => 'Soubor %s na webovém serveru',
'Run file' => 'Spustit soubor',
'File does not exist.' => 'Soubor neexistuje.',
'File uploads are disabled.' => 'Nahrávání souborů není povoleno.',
'Unable to upload a file.' => 'Nepodařilo se nahrát soubor.',
'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Příliš velká POST data. Zmenšete data nebo zvyšte hodnotu konfigurační direktivy %s.',
'Logged as: %s' => 'Přihlášen jako: %s',
'Move up' => 'Přesunout nahoru',
'Move down' => 'Přesunout dolů',
'Functions' => 'Funkce',
'Aggregation' => 'Agregace',
'Export' => 'Export',
'Dump' => 'Export',
'Output' => 'Výstup',
'open' => 'otevřít',
'save' => 'uložit',
'Format' => 'Formát',
'Tables' => 'Tabulky',
'Data' => 'Data',
'Database' => 'Databáze',
'database' => 'databáze',
'Use' => 'Vybrat',
'Select database' => 'Vybrat databázi',
'Invalid database.' => 'Nesprávná databáze.',
'Create new database' => 'Vytvořit novou databázi',
'Database has been dropped.' => 'Databáze byla odstraněna.',
'Databases have been dropped.' => 'Databáze byly odstraněny.',
'Database has been created.' => 'Databáze byla vytvořena.',
'Database has been renamed.' => 'Databáze byla přejmenována.',
'Database has been altered.' => 'Databáze byla změněna.',
'Alter database' => 'Pozměnit databázi',
'Create database' => 'Vytvořit databázi',
'Database schema' => 'Schéma databáze',
// thousands separator - must contain single byte
',' => ' ',
'Engine' => 'Úložiště',
'Collation' => 'Porovnávání',
'Data Length' => 'Velikost dat',
'Index Length' => 'Velikost indexů',
'Data Free' => 'Volné místo',
'Rows' => 'Řádků',
'%d in total' => '%d celkem',
'Analyze' => 'Analyzovat',
'Optimize' => 'Optimalizovat',
'Check' => 'Zkontrolovat',
'Repair' => 'Opravit',
'Truncate' => 'Vyprázdnit',
'Tables have been truncated.' => 'Tabulky byly vyprázdněny.',
'Move to other database' => 'Přesunout do jiné databáze',
'Move' => 'Přesunout',
'Tables have been moved.' => 'Tabulky byly přesunuty.',
'Copy' => 'Zkopírovat',
'Tables have been copied.' => 'Tabulky byly zkopírovány.',
'Routines' => 'Procedury a funkce',
'Routine has been called, %d row(s) affected.' => array('Procedura byla zavolána, byl změněn %d záznam.', 'Procedura byla zavolána, byly změněny %d záznamy.', 'Procedura byla zavolána, bylo změněno %d záznamů.'),
'Call' => 'Zavolat',
'Parameter name' => 'Název parametru',
'Create procedure' => 'Vytvořit proceduru',
'Create function' => 'Vytvořit funkci',
'Routine has been dropped.' => 'Procedura byla odstraněna.',
'Routine has been altered.' => 'Procedura byla změněna.',
'Routine has been created.' => 'Procedura byla vytvořena.',
'Alter function' => 'Změnit funkci',
'Alter procedure' => 'Změnit proceduru',
'Return type' => 'Návratový typ',
'Events' => 'Události',
'Event has been dropped.' => 'Událost byla odstraněna.',
'Event has been altered.' => 'Událost byla změněna.',
'Event has been created.' => 'Událost byla vytvořena.',
@@ -165,95 +129,161 @@ $translations = array(
'Create event' => 'Vytvořit událost',
'At given time' => 'V daný čas',
'Every' => 'Každých',
'Events' => 'Události',
'Schedule' => 'Plán',
'Start' => 'Začátek',
'End' => 'Konec',
'Status' => 'Stav',
'On completion preserve' => 'Po dokončení zachovat',
'Tables' => 'Tabulky',
'Tables and views' => 'Tabulky a pohledy',
'Data Length' => 'Velikost dat',
'Index Length' => 'Velikost indexů',
'Data Free' => 'Volné místo',
'Collation' => 'Porovnávání',
'Analyze' => 'Analyzovat',
'Optimize' => 'Optimalizovat',
'Check' => 'Zkontrolovat',
'Repair' => 'Opravit',
'Truncate' => 'Vyprázdnit',
'Tables have been truncated.' => 'Tabulky byly vyprázdněny.',
'Rows' => 'Řádků',
',' => ' ',
'Tables have been moved.' => 'Tabulky byly přesunuty.',
'Move to other database' => 'Přesunout do jiné databáze',
'Move' => 'Přesunout',
'Engine' => 'Úložiště',
'Save and continue edit' => 'Uložit a pokračovat v editaci',
'original' => 'původní',
'%d item(s) have been affected.' => array('Byl ovlivněn %d záznam.', 'Byly ovlivněny %d záznamy.', 'Bylo ovlivněno %d záznamů.'),
'whole result' => 'celý výsledek',
'Table' => 'Tabulka',
'No tables.' => 'Žádné tabulky.',
'Alter table' => 'Pozměnit tabulku',
'Create table' => 'Vytvořit tabulku',
'Create new table' => 'Vytvořit novou tabulku',
'Table has been dropped.' => 'Tabulka byla odstraněna.',
'Tables have been dropped.' => 'Tabulky byly odstraněny.',
'Clone' => 'Klonovat',
'Table has been altered.' => 'Tabulka byla změněna.',
'Table has been created.' => 'Tabulka byla vytvořena.',
'Table name' => 'Název tabulky',
'Show structure' => 'Zobrazit strukturu',
'engine' => 'úložiště',
'collation' => 'porovnávání',
'Column name' => 'Název sloupce',
'Type' => 'Typ',
'Length' => 'Délka',
'Auto Increment' => 'Auto Increment',
'Options' => 'Volby',
'Comment' => 'Komentář',
'Default values' => 'Výchozí hodnoty',
'Drop' => 'Odstranit',
'Are you sure?' => 'Opravdu?',
'Move up' => 'Přesunout nahoru',
'Move down' => 'Přesunout dolů',
'Remove' => 'Odebrat',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Byl překročen maximální povolený počet polí. Zvyšte prosím %s a %s.',
'Partition by' => 'Rozdělit podle',
'Partitions' => 'Oddíly',
'Partition name' => 'Název oddílu',
'Values' => 'Hodnoty',
'%d row(s) have been imported.' => array('Byl importován %d záznam.', 'Byly importovány %d záznamy.', 'Bylo importováno %d záznamů.'),
'CSV Import' => 'Import CSV',
'Import' => 'Import',
'Show structure' => 'Zobrazit strukturu',
'Select data' => 'Vypsat data',
'Stop on error' => 'Zastavit při chybě',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Byl překročen maximální povolený počet polí. Zvyšte prosím %s a %s.',
'anywhere' => 'kdekoliv',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$6.$4.$1',
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
'History' => 'Historie',
'Variables' => 'Proměnné',
'View' => 'Pohled',
'View has been dropped.' => 'Pohled byl odstraněn.',
'View has been altered.' => 'Pohled byl změněn.',
'View has been created.' => 'Pohled byl vytvořen.',
'Alter view' => 'Pozměnit pohled',
'Create view' => 'Vytvořit pohled',
'Indexes' => 'Indexy',
'Indexes have been altered.' => 'Indexy byly změněny.',
'Alter indexes' => 'Pozměnit indexy',
'Add next' => 'Přidat další',
'Index Type' => 'Typ indexu',
'Column (length)' => 'Sloupec (délka)',
'Foreign keys' => 'Cizí klíče',
'Foreign key' => 'Cizí klíč',
'Foreign key has been dropped.' => 'Cizí klíč byl odstraněn.',
'Foreign key has been altered.' => 'Cizí klíč byl změněn.',
'Foreign key has been created.' => 'Cizí klíč byl vytvořen.',
'Target table' => 'Cílová tabulka',
'Change' => 'Změnit',
'Source' => 'Zdroj',
'Target' => 'Cíl',
'Add column' => 'Přidat sloupec',
'Alter' => 'Změnit',
'Add foreign key' => 'Přidat cizí klíč',
'ON DELETE' => 'Při smazání',
'ON UPDATE' => 'Při změně',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Zdrojové a cílové sloupce musí mít stejný datový typ, nad cílovými sloupci musí být definován index a odkazovaná data musí existovat.',
'Triggers' => 'Triggery',
'Add trigger' => 'Přidat trigger',
'Trigger has been dropped.' => 'Trigger byl odstraněn.',
'Trigger has been altered.' => 'Trigger byl změněn.',
'Trigger has been created.' => 'Trigger byl vytvořen.',
'Alter trigger' => 'Změnit trigger',
'Create trigger' => 'Vytvořit trigger',
'Time' => 'Čas',
'Event' => 'Událost',
'Name' => 'Název',
'select' => 'vypsat',
'Select' => 'Vypsat',
'Select data' => 'Vypsat data',
'Functions' => 'Funkce',
'Aggregation' => 'Agregace',
'Search' => 'Vyhledat',
'anywhere' => 'kdekoliv',
'Search data in tables' => 'Vyhledat data v tabulkách',
'Sort' => 'Seřadit',
'descending' => 'sestupně',
'Limit' => 'Limit',
'Text length' => 'Délka textů',
'Action' => 'Akce',
'Unable to select the table' => 'Nepodařilo se vypsat tabulku',
'No rows.' => 'Žádné řádky.',
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
'Page' => 'Stránka',
'last' => 'poslední',
'Last page' => 'Poslední stránka',
'whole result' => 'celý výsledek',
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtů'),
'Import' => 'Import',
'%d row(s) have been imported.' => array('Byl importován %d záznam.', 'Byly importovány %d záznamy.', 'Bylo importováno %d záznamů.'),
// in-place editing in select
'Double click on a value to modify it.' => 'Dvojklikněte na políčko, které chcete změnit.',
'Use edit link to modify this value.' => 'Ke změně této hodnoty použijte odkaz upravit.',
// %s can contain auto-increment value
'Item%s has been inserted.' => 'Položka%s byla vložena.',
'Item has been deleted.' => 'Položka byla smazána.',
'Item has been updated.' => 'Položka byla aktualizována.',
'%d item(s) have been affected.' => array('Byl ovlivněn %d záznam.', 'Byly ovlivněny %d záznamy.', 'Bylo ovlivněno %d záznamů.'),
'New item' => 'Nová položka',
'original' => 'původní',
// label for value '' in enum data type
'empty' => 'prázdné',
'edit' => 'upravit',
'Edit' => 'Upravit',
'Insert' => 'Vložit',
'Save' => 'Uložit',
'Save and continue edit' => 'Uložit a pokračovat v editaci',
'Save and insert next' => 'Uložit a vložit další',
'Clone' => 'Klonovat',
'Delete' => 'Smazat',
'E-mail' => 'E-mail',
'From' => 'Odesílatel',
'Subject' => 'Předmět',
'Attachments' => 'Přílohy',
'Send' => 'Odeslat',
'%d e-mail(s) have been sent.' => array('Byl odeslán %d e-mail.', 'Byly odeslány %d e-maily.', 'Bylo odesláno %d e-mailů.'),
'Run file' => 'Spustit soubor',
// data type descriptions
'Numbers' => 'Čísla',
'Date and time' => 'Datum a čas',
'Strings' => 'Řetězce',
'Binary' => 'Binární',
'Lists' => 'Seznamy',
'Relations' => 'Vztahy',
'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.',
'Clear' => 'Vyčistit',
'Editor' => 'Editor',
'Webserver file %s' => 'Soubor %s na webovém serveru',
'File does not exist.' => 'Soubor neexistuje.',
'Permanent login' => 'Trvalé přihlášení',
'%d in total' => '%d celkem',
// label for e-mail attachments in Adminer Editor
'Attachments' => 'Přílohy',
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Systém',
// link to last page if exact number is unknown
'last' => 'poslední',
// new data type categories
'Network' => 'Síť',
'Geometry' => 'Geometrie',
'Relations' => 'Vztahy',
'Editor' => 'Editor',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$6.$4.$1',
// hint for date format - use language equivalents for day, month and year shortcuts
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
'now' => 'teď',
// general SQLite error in create, drop or rename database
'File exists.' => 'Soubor existuje.',
'Please use one of the extensions %s.' => 'Prosím použijte jednu z koncovek %s.',
// selects now support in-place editing
'Double click on a value to modify it.' => 'Dvojklikněte na políčko, které chcete změnit.',
'Increase Text length to modify this value.' => 'Ke změně této hodnoty zvyšte Délku textů.',
'Use edit link to modify this value.' => 'Ke změně této hodnoty použijte odkaz upravit.',
// PostgreSQL and MS SQL schema support
'Alter schema' => 'Pozměnit schéma',
'Create schema' => 'Vytvořit schéma',
@@ -278,16 +308,4 @@ $translations = array(
'Type has been dropped.' => 'Typ byl odstraněn.',
'Type has been created.' => 'Typ byl vytvořen.',
'Alter type' => 'Pozměnit typ',
// label for search in whole database
'Search data in tables' => 'Vyhledat data v tabulkách',
// label for box with "Run webserver file adminer.sql"
'From server' => 'Ze serveru',
// label for value '' in enum data type
'empty' => 'prázdné',
// function translation used in Editor
'now' => 'teď',
);

View File

@@ -187,7 +187,7 @@ $translations = array(
'Save and continue edit' => 'Speichern und weiter bearbeiten',
'original' => 'Original',
'Tables have been dropped.' => 'Tabellen wurden entfernt (drop).',
'%d item(s) have been affected.' => array('%d Artikel betroffen.', '%d Artikel betroffen.'),
'%d item(s) have been affected.' => '%d Artikel betroffen.',
'whole result' => 'Gesamtergebnis',
'Clone' => 'Klonen',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Die maximal erlaubte Anzahl der Felder ist überschritten. Bitte %s und %s erhöhen.',
@@ -197,7 +197,6 @@ $translations = array(
'Values' => 'Werte',
'%d row(s) have been imported.' => array('%d Datensatz importiert.', '%d Datensätze wurden importiert.'),
'anywhere' => 'beliebig',
'CSV Import' => 'Importiere CSV',
'Import' => 'Importieren',
'Stop on error' => 'Bei Fehler anhalten',
'%.3f s' => '%.3f s',
@@ -246,7 +245,6 @@ $translations = array(
'Type has been dropped.' => 'Typ gelöscht.',
'Type has been created.' => 'Typ erstellt.',
'Double click on a value to modify it.' => 'Doppelklick zum Bearbeiten des Wertes.',
'Increase Text length to modify this value.' => 'Vergrössern Sie die Textlänge um den Wert ändern zu können.',
'Use edit link to modify this value.' => 'Benutzen Sie den Link zum editieren dieses Wertes.',
'last' => 'letzte',
'From server' => 'Auf Server',
@@ -258,4 +256,12 @@ $translations = array(
'Geometry' => 'Geometrie',
'File exists.' => 'Datei existiert schon.',
'Attachments' => 'Anhänge',
'%d query(s) executed OK.' => array('SQL-Query erfolgreich ausgeführt.', '%d SQL-Queries erfolgreich ausgeführt.'),
'Show only errors' => 'Nur Fehler anzeigen',
'Last page' => 'Letzte Seite',
'Refresh' => 'Aktualisieren',
'Invalid schema.' => 'Schema nicht gültig.',
'Please use one of the extensions %s.' => 'Bitte einen der Dateitypen %s benutzen.',
'now' => 'jetzt',
'ltr' => 'ltr',
);

View File

@@ -9,4 +9,5 @@ $translations = array(
'%d row(s) have been imported.' => array('%d row has been imported.', '%d rows have been imported.'),
'%d e-mail(s) have been sent.' => array('%d e-mail has been sent.', '%d e-mails have been sent.'),
'%d in total' => '%d in total',
'%d query(s) executed OK.' => array('%d query executed OK.', '%d queries executed OK.'),
);

View File

@@ -197,7 +197,6 @@ $translations = array(
'Values' => 'Valores',
'%d row(s) have been imported.' => array('%d registro importado.', '%d registros importados.'),
'anywhere' => 'donde sea',
'CSV Import' => 'Importar CSV',
'Import' => 'Importar',
'Stop on error' => 'Parar en caso de error',
'%.3f s' => '%.3f s',
@@ -246,7 +245,6 @@ $translations = array(
'Type has been dropped.' => 'Tipo eliminado.',
'Type has been created.' => 'Tipo creado.',
'Double click on a value to modify it.' => 'Doble-clic sobre el valor para editarlo.',
'Increase Text length to modify this value.' => 'Aumente el tamaño del campo de texto para modificar este valor.',
'Use edit link to modify this value.' => 'Utilice el enlace de modificar para realizar los cambios.',
'last' => 'último',
'From server' => 'Desde servidor',
@@ -258,4 +256,12 @@ $translations = array(
'Geometry' => 'Geometría',
'File exists.' => 'Archivo ya existe.',
'Attachments' => 'Adjuntos',
'%d query(s) executed OK.' => array('%d sentencia sql ejecutada correctamente.', '%d sentencias sql ejecutadas correctamente.'),
'Show only errors' => 'Mostrar solamente errores',
'Last page' => 'Ultima página',
'Refresh' => 'Refrescar',
'Invalid schema.' => 'Esquema inválido.',
'Please use one of the extensions %s.' => 'Por favor use una de las extensiones %s.',
'now' => 'ahora',
'ltr' => 'ltr',
);

View File

@@ -62,7 +62,7 @@ $translations = array(
'Action' => 'Tegevus',
'edit' => 'muuda',
'Page' => 'Lehekülg',
'Query executed OK, %d row(s) affected.' => array('Päring õnnestus, mõjutatatud ridu: %d.', 'Päring õnnestus, mõjutatatud ridu: %d.'),
'Query executed OK, %d row(s) affected.' => 'Päring õnnestus, mõjutatatud ridu: %d.',
'Error in query' => 'Päringus esines viga',
'Execute' => 'Käivita',
'Table' => 'Tabel',
@@ -78,7 +78,7 @@ $translations = array(
'Unable to upload a file.' => 'Faili üleslaadimine pole võimalik.',
'File upload' => 'Faili üleslaadimine',
'File uploads are disabled.' => 'Failide üleslaadimine on keelatud.',
'Routine has been called, %d row(s) affected.' => array('Protseduur täideti edukalt, mõjutatud ridu: %d.', 'Protseduur täideti edukalt, mõjutatud ridu: %d.'),
'Routine has been called, %d row(s) affected.' => 'Protseduur täideti edukalt, mõjutatud ridu: %d.',
'Call' => 'Käivita',
'No extension' => 'Ei leitud laiendust',
'None of the supported PHP extensions (%s) are available.' => 'Serveris pole ühtegi toetatud PHP laiendustest (%s).',
@@ -127,7 +127,7 @@ $translations = array(
'Create trigger' => 'Loo uus päästik (TRIGGER)',
'Time' => 'Aeg',
'Event' => 'Sündmus',
'%d row(s)' => array('%d rida', '%d rida'),
'%d row(s)' => '%d rida',
'Remove' => 'Eemalda',
'Are you sure?' => 'Kas oled kindel?',
'Privileges' => 'Õigused',
@@ -187,7 +187,7 @@ $translations = array(
'Truncate' => 'Tühjenda',
'Move to other database' => 'Liiguta teise andmebaasi',
'Move' => 'Liiguta',
'%d item(s) have been affected.' => array('Mõjutatud kirjeid: %d.', 'Mõjutatud kirjeid: %d.'),
'%d item(s) have been affected.' => 'Mõjutatud kirjeid: %d.',
'whole result' => 'Täielikud tulemused',
'Clone' => 'Kloon',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Maksimaalne väljade arv ületatud. Palun suurendage %s ja %s.',
@@ -195,9 +195,8 @@ $translations = array(
'Partitions' => 'Partitsioonid',
'Partition name' => 'Partitsiooni nimi',
'Values' => 'Väärtused',
'%d row(s) have been imported.' => array('Imporditi %d rida.', 'Imporditi %d rida.'),
'%d row(s) have been imported.' => 'Imporditi %d rida.',
'anywhere' => 'vahet pole',
'CSV Import' => 'Impordi CSV',
'Import' => 'Impordi',
'Stop on error' => 'Peatuda vea esinemisel',
'%.3f s' => '%.3f s',
@@ -220,7 +219,7 @@ $translations = array(
'From' => 'Kellelt',
'Subject' => 'Pealkiri',
'Send' => 'Saada',
'%d e-mail(s) have been sent.' => array('Saadetud kirju: %d.', 'Saadetud kirju: %d.'),
'%d e-mail(s) have been sent.' => 'Saadetud kirju: %d.',
'Webserver file %s' => 'Fail serveris: %s',
'File does not exist.' => 'Faili ei leitud.',
'%d in total' => 'Kokku: %d',
@@ -246,7 +245,6 @@ $translations = array(
'Type has been dropped.' => 'Tüüp on edukalt kustutatud.',
'Type has been created.' => 'Tüüp on edukalt loodud.',
'Double click on a value to modify it.' => 'Väärtuse muutmiseks topelt-kliki sellel.',
'Increase Text length to modify this value.' => 'Väärtuse muutmiseks suurenda Tekstiveeru pikkust.',
'Use edit link to modify this value.' => 'Väärtuse muutmiseks kasuta muutmislinki.',
'last' => 'viimane',
'From server' => 'Serverist',
@@ -258,4 +256,12 @@ $translations = array(
'Geometry' => 'Geomeetria',
'File exists.' => 'Fail juba eksisteerib.',
'Attachments' => 'Manused',
'%d query(s) executed OK.' => array('%d päring edukalt käivitatud.', '%d päringut edukalt käivitatud.'),
'Show only errors' => 'Kuva vaid veateateid',
'Last page' => 'Viimane lehekülg',
'Refresh' => 'Uuenda',
'Invalid schema.' => 'Sobimatu skeema.',
'Please use one of the extensions %s.' => 'Palun kasuta üht laiendustest %s.',
'now' => 'nüüd',
'ltr' => 'ltr',
);

View File

@@ -1,7 +1,7 @@
<?php
$translations = array(
'Login' => 'Authentification',
'Logout successful.' => 'Au revoir!',
'Logout successful.' => 'Au revoir !',
'Invalid credentials.' => 'Authentification échouée.',
'Server' => 'Serveur',
'Username' => 'Utilisateur',
@@ -139,7 +139,7 @@ $translations = array(
'Grant' => 'Grant',
'Revoke' => 'Revoke',
'%s version: %s through PHP extension %s' => 'Version de %s : %s via l\'extension PHP %s',
'Logged as: %s' => 'Authentifié en tant que %s',
'Logged as: %s' => 'Authentifié en tant que : %s',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Données POST trop grandes. Réduisez la taille des données ou augmentez la valeur de %s dans la configuration de PHP.',
'Move up' => 'Déplacer vers le haut',
'Move down' => 'Déplacer vers le bas',
@@ -195,7 +195,6 @@ $translations = array(
'Values' => 'Valeurs',
'%d row(s) have been imported.' => array('%d ligne a été importée.','%d lignes ont été importées.'),
'anywhere' => 'n\'importe où',
'CSV Import' => 'Importer CSV',
'Import' => 'Importer',
'Stop on error' => 'Arrêter en cas d\'erreur',
'%.3f s' => '%.3f s',
@@ -245,7 +244,6 @@ $translations = array(
'Type has been dropped.' => 'Le type a été supprimé.',
'Type has been created.' => 'Le type a été créé.',
'Double click on a value to modify it.' => 'Double-cliquez sur une valeur pour la modifier.',
'Increase Text length to modify this value.' => 'Augmentez la Longueur de texte affiché pour modifier cette valeur.',
'Use edit link to modify this value.' => 'Utilisez le lien "modifier" pour modifier cette valeur.',
'last' => 'dernière',
'From server' => 'Depuis le serveur',
@@ -259,4 +257,11 @@ $translations = array(
'Attachments' => 'Pièces jointes',
'Item%s has been inserted.' => 'L\'élément%s a été inséré.',
'now' => 'maintenant',
'%d query(s) executed OK.' => array('%d requête exécutée avec succès.', '%d requêtes exécutées avec succès.'),
'Show only errors' => 'Montrer seulement les erreurs',
'Last page' => 'Dernière page',
'Refresh' => 'Rafraîchir',
'Invalid schema.' => 'Schéma invalide.',
'Please use one of the extensions %s.' => 'Veuillez utiliser l\'une des extensions %s.',
'ltr' => 'ltr',
);

View File

@@ -190,12 +190,11 @@ $translations = array(
'whole result' => 'összes eredményt mutatása',
'Tables have been dropped.' => 'Táblák eldobva.',
'Clone' => 'Klónoz',
'Partition by' => 'Rozdělit podle',
'Partition by' => 'Particionálás ezzel',
'Partitions' => 'Particiók',
'Partition name' => 'Partició neve',
'Values' => 'Értékek',
'%d row(s) have been imported.' => array('%d sor importálva.', '%d sor importálva.', '%d sor importálva.'),
'CSV Import' => 'CSV importálása',
'Import' => 'Importálás',
'Show structure' => 'Struktúra',
'Select data' => 'Tartalom',
@@ -204,7 +203,7 @@ $translations = array(
'anywhere' => 'bárhol',
'%.3f s' => '%.3f másodperc',
'$1-$3-$5' => '$6.$4.$1',
'[yyyy]-mm-dd' => '[yyyy].mm.dd',
'[yyyy]-mm-dd' => '[yyyy].m.d',
'History' => 'Történet',
'Variables' => 'Változók',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'A forrás és cél oszlopoknak azonos típusúak legyenek, a cél oszlopok indexeltek legyenek, és a hivatkozott adatnak léteznie kell.',
@@ -235,15 +234,14 @@ $translations = array(
'Databases have been dropped.' => 'Adatbázis eldobva.',
'File exists.' => 'A fájl létezik.',
'Double click on a value to modify it.' => 'Kattints kétszer az értékre a szerkesztéshez.',
'Increase Text length to modify this value.' => 'Növeld a Szöveg hosszát, hogy módosítani tudd ezt az értéket.',
'Use edit link to modify this value.' => 'Használd a szerkesztés hivatkozást ezen érték módosításához.',
'Alter schema' => 'Séma módosítása',
'Create schema' => 'Séma létrehozása',
'Schema has been dropped.' => 'Séma eldobva.',
'Schema has been created.' => 'Séma létrejött.',
'Schema has been altered.' => 'Séma módosult.',
'schema' => 'schéma',
'Schema' => 'Schéma',
'schema' => 'séma',
'Schema' => 'Séma',
'Sequences' => 'Sorozatok',
'Create sequence' => 'Sorozat létrehozása',
'Sequence has been dropped.' => 'Sorozat eldobva.',
@@ -259,4 +257,11 @@ $translations = array(
'From server' => 'Szerverről',
'empty' => 'üres',
'now' => 'most',
'%d query(s) executed OK.' => '%d sikeres lekérdezés.',
'Show only errors' => 'Csak a hibák mutatása',
'Last page' => 'Utolsó oldal',
'Refresh' => 'Frissítés',
'Invalid schema.' => 'Érvénytelen séma.',
'Please use one of the extensions %s.' => 'Használja a(z) %s kiterjesztést.',
'ltr' => 'ltr',
);

View File

@@ -197,7 +197,6 @@ $translations = array(
'Values' => 'Valori',
'%d row(s) have been imported.' => array('%d riga importata.', '%d righe importate.'),
'anywhere' => 'ovunque',
'CSV Import' => 'Importa da CSV',
'Import' => 'Importa',
'Stop on error' => 'Stop su errore',
'%.3f s' => '%.3f s',
@@ -246,7 +245,6 @@ $translations = array(
'Type has been dropped.' => 'Tipo definito dall\'utente eliminato.',
'Type has been created.' => 'Tipo definito dall\'utente creato.',
'Double click on a value to modify it.' => 'Fai doppio click su un valore per modificarlo.',
'Increase Text length to modify this value.' => 'Aumenta la Lunghezza del testo per modificare questo valore.',
'Use edit link to modify this value.' => 'Usa il link modifica per modificare questo valore.',
'last' => 'ultima',
'From server' => 'Dal server',
@@ -258,4 +256,12 @@ $translations = array(
'Geometry' => 'Geometria',
'File exists.' => 'Il file esiste già.',
'Attachments' => 'Allegati',
'%d query(s) executed OK.' => array('%d query eseguita con successo.', '%d query eseguite con successo.'),
'Show only errors' => 'Mostra solo gli errori',
'Last page' => 'Ultima pagina',
'Refresh' => 'Aggiorna',
'Invalid schema.' => 'Schema non valido.',
'Please use one of the extensions %s.' => 'Usa una delle estensioni %s.',
'now' => 'adesso',
'ltr' => 'ltr',
);

View File

@@ -128,7 +128,7 @@ $translations = array(
'Event' => 'イベント',
'%s version: %s through PHP extension %s' => '%sバージョン%s、 PHP拡張機能 %s',
'%d row(s)' => '%d 行',
'Remove' => '除',
'Remove' => '除',
'Are you sure?' => '実行しますか?',
'Privileges' => '権限',
'Create user' => 'ユーザを作成',
@@ -181,7 +181,7 @@ $translations = array(
'Check' => 'チェック',
'Repair' => '修復',
'Truncate' => 'Truncate',
'Move to other database' => '別のデータベースへ移動?',
'Move to other database' => '別のデータベースへ移動',
'Move' => '移動',
'Save and continue edit' => '保存して継続',
'original' => '元',
@@ -197,7 +197,6 @@ $translations = array(
'%d row(s) have been imported.' => '%d 行をインポートしました',
'Show structure' => '構造',
'anywhere' => '任意',
'CSV Import' => 'CSV インポート',
'Import' => 'インポート',
'Stop on error' => 'エラーの場合は停止',
'Select data' => 'データ',
@@ -247,7 +246,6 @@ $translations = array(
'Type has been dropped.' => 'ユーザー定義型を削除しました',
'Type has been created.' => 'ユーザー定義型を追加しました',
'Double click on a value to modify it.' => 'ダブルクリックして編集',
'Increase Text length to modify this value.' => '編集枠を広げる',
'Use edit link to modify this value.' => 'リンクを編集する',
'last' => '最終',
'From server' => 'サーバーから実行',
@@ -259,4 +257,11 @@ $translations = array(
'Attachments' => '添付ファイル',
'Item%s has been inserted.' => '%s項目を挿入しました',
'now' => '現在の日時',
'%d query(s) executed OK.' => '%d クエリーを実行しました',
'Show only errors' => 'エラーのみ表示',
'Last page' => '最後のページ',
'Refresh' => 'リフレッシュ',
'Invalid schema.' => '無効なスキーマ',
'Please use one of the extensions %s.' => 'いずれかの拡張機能を使ってください %s',
'ltr' => 'ltr',
);

View File

@@ -198,7 +198,6 @@ $translations = array(
'Values' => 'Waarden',
'%d row(s) have been imported.' => array('%d rij werd geïmporteerd.', '%d rijen werden geïmporteerd.'),
'anywhere' => 'overal',
'CSV Import' => 'CSV Import',
'Import' => 'Importeren',
'Stop on error' => 'Stoppen bij fout',
'%.3f s' => '%.3f s',
@@ -246,7 +245,6 @@ $translations = array(
'Type has been dropped.' => 'Type verwijderd.',
'Type has been created.' => 'Type aangemaakt.',
'Double click on a value to modify it.' => 'Dubbelklik op een waarde om deze te bewerken.',
'Increase Text length to modify this value.' => 'Verhoog de lengte om deze waarde te bewerken.',
'Use edit link to modify this value.' => 'Gebruik de link "bewerk" om deze waarde te wijzigen.',
'last' => 'laatste',
'From server' => 'Van server',
@@ -258,4 +256,12 @@ $translations = array(
'Geometry' => 'Geometrie',
'File exists.' => 'Bestand bestaat reeds.',
'Attachments' => 'Bijlagen',
'%d query(s) executed OK.' => array('%d query succesvol uitgevoerd.', '%d querys succesvol uitgevoerd'),
'Show only errors' => 'Enkel fouten tonen',
'Last page' => 'Laatste pagina',
'Refresh' => 'Vernieuwen',
'Invalid schema.' => 'Ongeldig schema.',
'Please use one of the extensions %s.' => 'Gebruik 1 van volgende extensies: %s.',
'now' => 'nu',
'ltr' => 'ltr',
);

260
adminer/lang/pl.inc.php Normal file
View File

@@ -0,0 +1,260 @@
<?php
$translations = array(
'Login' => 'Zalogować się',
'Logout successful.' => 'Wylogowanie pomyślne.',
'Invalid credentials.' => 'Nieprawidłowe dane.',
'Server' => 'Serwer',
'Username' => 'Użytkownik',
'Password' => 'Hasło',
'Select database' => 'Wybierz bazę danych',
'Invalid database.' => 'Nie znaleziono bazę danych.',
'Create new database' => 'Utwórz nową bazę danych',
'Table has been dropped.' => 'Tabela została usunięta.',
'Table has been altered.' => 'Tabela została zmieniona.',
'Table has been created.' => 'Tabela została utworzona.',
'Alter table' => 'Zmień tabelę',
'Create table' => 'Utwórz nową tabelę',
'Table name' => 'Nazwa tabeli',
'engine' => 'składowanie',
'collation' => 'porównywanie',
'Column name' => 'Nazwa kolumny',
'Type' => 'Typ',
'Length' => 'Długość',
'Auto Increment' => 'Auto Increment',
'Options' => 'Operacje',
'Save' => 'Zachowaj',
'Drop' => 'Usuń',
'Database has been dropped.' => 'Baza danych została usunięta.',
'Database has been created.' => 'Baza danych została utworzona.',
'Database has been renamed.' => 'Baza danych została przemianowana.',
'Database has been altered.' => 'Baza danych została zmieniona.',
'Alter database' => 'Zmień bazę danych',
'Create database' => 'Utwórz bazę danych',
'SQL command' => 'SQL zapytanie',
'Dump' => 'Eksport',
'Logout' => 'Wyjście',
'database' => 'baza danych',
'Use' => 'Vybrat',
'No tables.' => 'Nie znaleziono tabeli.',
'select' => 'pokaż',
'Create new table' => 'Utwórz nową tabelę',
'Item has been deleted.' => 'Rekord został usunięty.',
'Item has been updated.' => 'Rekord został aktualizowany.',
'Item%s has been inserted.' => 'Rekord%s został włożony.',
'Edit' => 'Edytuj',
'Insert' => 'Dodaj',
'Save and insert next' => 'Wykonaj i dodaj następny',
'Delete' => 'Usuń',
'Database' => 'Baza danych',
'Routines' => 'Procedury i funkcje',
'Indexes have been altered.' => 'Indeksy uległy zmianie.',
'Indexes' => 'Indeksy',
'Alter indexes' => 'Edytuj indeksy',
'Add next' => 'Dodaj następny',
'Language' => 'Język',
'Select' => 'Przeglądaj',
'New item' => 'Nowy rekord',
'Search' => 'Szukaj',
'Sort' => 'Sortuj',
'descending' => 'malejąco',
'Limit' => 'Limit',
'No rows.' => 'Pusty wynik.',
'Action' => 'Czynność',
'edit' => 'zmień',
'Page' => 'Strona',
'Query executed OK, %d row(s) affected.' => array('Wykonanie pomyślne, zmieniono %d rekord.', 'Wykonanie pomyślne, zmieniono %d rekordy.', 'Wykonanie pomyślne, zmieniono %d rekordów.'),
'Error in query' => 'Bląd w zapytaniu',
'Execute' => 'Wykonaj',
'Table' => 'Tabela',
'Foreign keys' => 'Klucze obce',
'Triggers' => 'Wyzwalacze',
'View' => 'Perspektywa',
'Unable to select the table' => 'Nie mozna było przeglądać tabel',
'Invalid CSRF token. Send the form again.' => 'Niepoprawny CSRF token. Odeślij ponownie.',
'Comment' => 'Komentarz',
'Default values' => 'Wartości domyślne',
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtów'),
'No commands to execute.' => 'Nic do wykonania.',
'Unable to upload a file.' => 'Nie było możliwe nagrać plik.',
'File upload' => 'Nagranie pliku',
'File uploads are disabled.' => 'Nagranie pliku nie jest dozwolone.',
'Routine has been called, %d row(s) affected.' => array('Procedura była uruchomiona, został zmieniony %d rekord.', 'Procedura była uruchomiona, zostały zmienione %d rekordy.', 'Procedura była uruchomiona, %d rekordów zostało zmienionych.'),
'Call' => 'Uruchomić',
'No extension' => 'Bez rozszerzenia',
'None of the supported PHP extensions (%s) are available.' => 'Nie jest dostępne żadne z PHP rozszerzeń (%s).',
'Session support must be enabled.' => 'Session zmienne muszą być dozwolone.',
'Session expired, please login again.' => 'Minął czas session, zaloguj się ponownie.',
'Text length' => 'Długość tekstu',
'Foreign key has been dropped.' => 'Klucz obcy został usunięty.',
'Foreign key has been altered.' => 'Klucz obcy został zmieniony.',
'Foreign key has been created.' => 'Klucz obcy został utworzony.',
'Foreign key' => 'Obcy klucz',
'Target table' => 'Tabela celowa',
'Change' => 'Zmienić',
'Source' => 'Źródło',
'Target' => 'Cel',
'Add column' => 'Dodaj kolumnę',
'Alter' => 'Zmień',
'Add foreign key' => 'Dodaj klucz obcy',
'ON DELETE' => 'W przypadku usunięcia',
'ON UPDATE' => 'W przypadku zmiany',
'Index Type' => 'Typ indeksu',
'Column (length)' => 'Kolumna (długość)',
'View has been dropped.' => 'Perspektywa została usunięta.',
'View has been altered.' => 'Perspektywa została zmieniona.',
'View has been created.' => 'Perspektywa została utworzona.',
'Alter view' => 'Zmień perspektywę',
'Create view' => 'Utwórz perspektywę',
'Name' => 'Nazwa',
'Process list' => 'Lista procesów',
'%d process(es) have been killed.' => array('Wątek %d został unicestwiony.', 'Unicestwiono %d wątki.', 'Unicestwiono %d wątków.'),
'Kill' => 'Unicestwij',
'Parameter name' => 'Nazwa parametru',
'Database schema' => 'Schemat bazy danych',
'Create procedure' => 'Utwórz procedurę',
'Create function' => 'Utwórz funkcję',
'Routine has been dropped.' => 'Procedura została usunięta.',
'Routine has been altered.' => 'Procedura została zmieniona.',
'Routine has been created.' => 'Procedura została utworzona.',
'Alter function' => 'Zmień funkcję',
'Alter procedure' => 'Zmień procedurę',
'Return type' => 'Typ zwracania',
'Add trigger' => 'Dodaj wyzwalacz',
'Trigger has been dropped.' => 'Wyzwalacz został usunięty.',
'Trigger has been altered.' => 'Wyzwalacz został zmieniony.',
'Trigger has been created.' => 'Wyzwalacz został utworzony.',
'Alter trigger' => 'Zmień wyzwalacz',
'Create trigger' => 'Utwórz wyzwalacz',
'Time' => 'Czas',
'Event' => 'Wydarzenie',
'%s version: %s through PHP extension %s' => 'Wersja %s: %s przez PHP rozszerzenie %s',
'%d row(s)' => array('%d linia', '%d linie ', '%d linii'),
'Remove' => 'Usunąć',
'Are you sure?' => 'Naprawdę?',
'Privileges' => 'Uprawnienia użytkowników',
'Create user' => 'Utwórz użytkownika',
'User has been dropped.' => 'Użytkownik został usunięty.',
'User has been altered.' => 'Użytkownik został zmieniony.',
'User has been created.' => 'Użytkownik został utworzony.',
'Hashed' => 'Hashed',
'Column' => 'Kolumna',
'Routine' => 'Procedura',
'Grant' => 'Udzielić',
'Revoke' => 'Odwołać',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Zbyt duże POST data. Zmiejszyj data albo podwyższ wartość w konfiguracji %s.',
'Logged as: %s' => 'Zalogowany jako: %s',
'Move up' => 'Przesuń w górę',
'Move down' => 'Przesuń w dół',
'Functions' => 'Funkcje',
'Aggregation' => 'Agregacje',
'Export' => 'Eksport',
'Output' => 'Wyjście',
'open' => 'otworzyć',
'save' => 'uchować',
'Format' => 'Format',
'Tables' => 'Tabele',
'Data' => 'Data',
'Event has been dropped.' => 'Wydarzenie zostało usunięte.',
'Event has been altered.' => 'Wydarzenie zostało zmienione.',
'Event has been created.' => 'Wydarzenie zostało utworzone.',
'Alter event' => 'Zmień wydarzenie',
'Create event' => 'Utwórz wydarzenie',
'At given time' => 'O danym czasie',
'Every' => 'Każdych',
'Events' => 'Wydarzenie',
'Schedule' => 'Harmonogram',
'Start' => 'Początek',
'End' => 'Koniec',
'Status' => 'Status',
'On completion preserve' => 'Po zakończeniu zachować',
'Tables and views' => 'Tabele a perspektywy',
'Data Length' => 'Długość danych',
'Index Length' => 'Długość indeksów',
'Data Free' => 'Wolne miejsce',
'Collation' => 'Porównywanie',
'Analyze' => 'Analizuj',
'Optimize' => 'Optymalizacja',
'Check' => 'Sprawdź',
'Repair' => 'Napraw',
'Truncate' => 'Wypróźnij',
'Tables have been truncated.' => 'Tabele zostały wypróźnione.',
'Rows' => 'Linie',
',' => ' ',
'Tables have been moved.' => 'Tabele zostały przesunięte',
'Move to other database' => 'Przesunąć do innej bazy danych',
'Move' => 'Przesunąć',
'Engine' => 'Engine',
'Save and continue edit' => 'Zapisz i kontynuuj edycję',
'original' => 'oryginalny',
'%d item(s) have been affected.' => array('Został dotknięty %d rekord.', 'Zostały dotknięte %d rekordy.', 'Zostało dotkniętych %d rekordów.'),
'whole result' => 'cały wynik',
'Tables have been dropped.' => 'Tabele zostały usunięte.',
'Clone' => 'Klonować',
'Partition by' => 'Rozdzielić przez',
'Partitions' => 'Rozdziały',
'Partition name' => 'Nazwa rozdziału',
'Values' => 'Wartości',
'%d row(s) have been imported.' => array('%d rekord został importowany.', '%d rekordy zostały importowane.', 'Zostało importowanych %d rekordów.'),
'Import' => 'Import',
'Show structure' => 'Pokaż całą strukturę',
'Select data' => 'Pokaż dane',
'Stop on error' => 'Stop w przypadku błędu',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Przekroczono maksymalną liczbę pól. Zwiększ %s i %s.',
'anywhere' => 'kdziekolwiek',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$6.$4.$1',
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
'History' => 'Historia',
'Variables' => 'Zmienne',
'E-mail' => 'E-mail',
'From' => 'Nadawca',
'Subject' => 'Temat',
'Send' => 'Wyślij',
'%d e-mail(s) have been sent.' => array('Został wysłany %d e-mail.', 'Zostały wysłane %d e-maile.', 'Zostało wysłanych %d e-mailów.'),
'Run file' => 'Uruchomić plik',
'Numbers' => 'Numery',
'Date and time' => 'Datum i czas',
'Strings' => 'Typu string',
'Binary' => 'Binarny',
'Lists' => 'Listy',
'Relations' => 'Relacje',
'Maximum allowed file size is %sB.' => 'Maksymalna wielkość pliku to %sB.',
'Clear' => 'Wyczyścić',
'Editor' => 'Edytor',
'Webserver file %s' => 'Plik %s na serweru',
'File does not exist.' => 'Plik nieistnieje.',
'Permanent login' => 'Logowanie stałe',
'%d in total' => '%d w sumie',
'Attachments' => 'Załączniki',
'System' => 'System',
'last' => 'ostatni',
'Network' => 'Sieć',
'Geometry' => 'Geometria',
'Databases have been dropped.' => 'Baze danych zostały usunięte.',
'File exists.' => 'Plik istnieje.',
'Double click on a value to modify it.' => 'Kliknij podwójnie by zmienić wartość.',
'Increase text length to modify this value.' => 'Aby zmienić wartość to potrzeba powiększyć długość tekstu.',
'Use edit link to modify this value.' => 'Użyj linku zmienić by poprawić wartość.',
'Alter schema' => 'Zmienić schemat',
'Create schema' => 'Utwórz schemat',
'Schema has been dropped.' => 'Schemat został usunięty.',
'Schema has been created.' => 'Schemat został utworzony.',
'Schema has been altered.' => 'Schemat został zmieniony.',
'schema' => 'schemat',
'Schema' => 'Schemat',
'Sequences' => 'Sekwencje',
'Create sequence' => 'Utwórz sekwencję',
'Sequence has been dropped.' => 'Sekwencja została usunięta.',
'Sequence has been created.' => 'Sekwencja została utworzona.',
'Sequence has been altered.' => 'Sekwencja została zmieniona.',
'Alter sequence' => 'Zmień sekwencję',
'User types' => 'Typy definiowane użytkownikiem',
'Create type' => 'Utwórz definiowany typ',
'Type has been dropped.' => 'Typ został usunięty.',
'Type has been created.' => 'Typ został utworzony.',
'Alter type' => 'Zmień typ',
'Search data in tables' => 'Wyszukaj data w tabelach',
'From server' => 'Ze serweru',
'empty' => 'puste',
'now' => 'teraz',
);

267
adminer/lang/pt.inc.php Normal file
View File

@@ -0,0 +1,267 @@
<?php
$translations = array(
'Login' => 'Entrar',
'Logout successful.' => 'Saida bem sucedida.',
'Invalid credentials.' => 'Identificação inválida.',
'Server' => 'Servidor',
'Username' => 'Usuario',
'Password' => 'Senha',
'Select database' => 'Selecionar Base de dados',
'Invalid database.' => 'Base de dados inválida.',
'Create new database' => 'Criar nova base de dados',
'Table has been dropped.' => 'Tabela eliminada.',
'Table has been altered.' => 'Tabela modificada.',
'Table has been created.' => 'Tabela criada.',
'Alter table' => 'Modificar estrutura',
'Create table' => 'Criar tabela',
'Table name' => 'Nome da tabela',
'engine' => 'motor',
'collation' => 'collation',
'Column name' => 'Nome da coluna',
'Type' => 'Tipo',
'Length' => 'Tamanho',
'Auto Increment' => 'Incremento Automático',
'Options' => 'Opções',
'Save' => 'Salvar',
'Drop' => 'Remover',
'Database has been dropped.' => 'Base de dados eliminada.',
'Database has been created.' => 'Base de dados criada.',
'Database has been renamed.' => 'Base de dados renomeada.',
'Database has been altered.' => 'Base de dados modificada.',
'Alter database' => 'Modificar Base de dados',
'Create database' => 'Criar Base de dados',
'SQL command' => 'Comando SQL',
'Dump' => 'Exportar',
'Logout' => 'Sair',
'database' => 'base de dados',
'Use' => 'Usar',
'No tables.' => 'Não existem tabelas.',
'select' => 'registros',
'Create new table' => 'Nova tabela',
'Item has been deleted.' => 'Registro eliminado.',
'Item has been updated.' => 'Registro modificado.',
'Item%s has been inserted.' => 'Registro%s inserido.',
'Edit' => 'Modificar',
'Insert' => 'Inserir',
'Save and insert next' => 'Salvar e inserir outro',
'Delete' => 'Apagar',
'Database' => 'Base de dados',
'Routines' => 'Procedimentos',
'Indexes have been altered.' => 'Indices modificados.',
'Indexes' => 'Indices',
'Alter indexes' => 'Modificar indices',
'Add next' => 'Adicionar proximo',
'Language' => 'Idioma',
'Select' => 'Selecionar',
'New item' => 'Novo Registro',
'Search' => 'Procurar',
'Sort' => 'Ordenar',
'descending' => 'decrescente',
'Limit' => 'Limite',
'No rows.' => 'Não existem registros.',
'Action' => 'Ação',
'edit' => 'modificar',
'Page' => 'Página',
'Query executed OK, %d row(s) affected.' => array('Consulta executada, %d registro afetados.', 'Consulta executada, %d registros afetados.'),
'Error in query' => 'Erro na consulta',
'Execute' => 'Executar',
'Table' => 'Tabela',
'Foreign keys' => 'Chaves foráneas',
'Triggers' => 'Triggers',
'View' => 'Visualizar',
'Unable to select the table' => 'Não é possivel selecionar a Tabela',
'Invalid CSRF token. Send the form again.' => 'Token CSRF inválido. Enviar o formulario novamente.',
'Comment' => 'Comentario',
'Default values' => 'Valores predeterminados',
'%d byte(s)' => array('%d byte', '%d bytes'),
'No commands to execute.' => 'Nenhum comando para executar.',
'Unable to upload a file.' => 'Não é possivel enviar o arquivo.',
'File upload' => 'Importar arquivo',
'File uploads are disabled.' => 'Importação de arquivos desablilitado.',
'Routine has been called, %d row(s) affected.' => array('Consulta executada, %d registro afetado.', 'Consulta executada, %d registros afetados.'),
'Call' => 'Chamar',
'No extension' => 'Não ha extension',
'None of the supported PHP extensions (%s) are available.' => 'Nenhuma das extensões PHP soportadas (%s) está disponivel.',
'Session support must be enabled.' => 'Devem estar habilitadas as sessões.',
'Session expired, please login again.' => 'Sessão expirada, por favor entre sua Chave de novo.',
'Text length' => 'Tamanho de texto',
'Foreign key has been dropped.' => 'Chave externa eliminada.',
'Foreign key has been altered.' => 'Chave externa modificada.',
'Foreign key has been created.' => 'Chave externa criada.',
'Foreign key' => 'Chave externa',
'Target table' => 'Tabela de destino',
'Change' => 'Modificar',
'Source' => 'Origem',
'Target' => 'Destino',
'Add column' => 'Adicionar coluna',
'Alter' => 'Modificar',
'Add foreign key' => 'Adicionar Chave foránea',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'Tipo de índice',
'Column (length)' => 'coluna (tamanho)',
'View has been dropped.' => 'Vista eliminada.',
'View has been altered.' => 'Vista modificada.',
'View has been created.' => 'Vista criada.',
'Alter view' => 'Modificar vista',
'Create view' => 'Criar vista',
'Name' => 'Nome',
'Process list' => 'Lista de processos',
'%d process(es) have been killed.' => array('%d processo terminado.', '%d processos terminados.'),
'Kill' => 'Parar',
'Parameter name' => 'Nome de Parametro',
'Database schema' => 'Esquema de Base de dados',
'Create procedure' => 'Criar procedimento',
'Create function' => 'Criar função',
'Routine has been dropped.' => 'Procedimento eliminado.',
'Routine has been altered.' => 'Procedimento modificado.',
'Routine has been created.' => 'Procedimento criado.',
'Alter function' => 'Modificar Função',
'Alter procedure' => 'Modificar procedimiento',
'Return type' => 'Tipo de valor de regreso',
'Add trigger' => 'Adicionar trigger',
'Trigger has been dropped.' => 'Trigger eliminado.',
'Trigger has been altered.' => 'Trigger modificado.',
'Trigger has been created.' => 'Trigger criado.',
'Alter trigger' => 'Modificar Trigger',
'Create trigger' => 'Adicionar Trigger',
'Time' => 'Tempo',
'Event' => 'Evento',
'%s version: %s through PHP extension %s' => 'Versão %s: %s através da extensão PHP %s',
'%d row(s)' => array('%d registro', '%d registros'),
'Remove' => 'Remover',
'Are you sure?' => 'Está seguro?',
'Privileges' => 'Privilegios',
'Create user' => 'Criar Usuario',
'User has been dropped.' => 'Usuario eliminado.',
'User has been altered.' => 'Usuario modificado.',
'User has been created.' => 'Usuario criado.',
'Hashed' => 'Hash',
'Column' => 'Coluna',
'Routine' => 'Rotina',
'Grant' => 'Conceder',
'Revoke' => 'Impedir',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'POST data demasiado grande. Reduza o tamanho ou aumente a diretiva de configuração %s.',
'Logged as: %s' => 'Logado como: %s',
'Move up' => 'Mover acima',
'Move down' => 'Mover abaixo',
'Functions' => 'Funções',
'Aggregation' => 'Adições',
'Export' => 'Exportar',
'Output' => 'Saida',
'open' => 'mostrar',
'save' => 'salvas',
'Format' => 'Formato',
'Tables' => 'Tabelas',
'Data' => 'Dados',
'Event has been dropped.' => 'Evento eliminado.',
'Event has been altered.' => 'Evento modificado.',
'Event has been created.' => 'Evento criado.',
'Alter event' => 'Modificar Evento',
'Create event' => 'Criar Evento',
'At given time' => 'A hora determinada',
'Every' => 'Cada',
'Events' => 'Eventos',
'Schedule' => 'Agenda',
'Start' => 'Inicio',
'End' => 'Fim',
'Status' => 'Estado',
'On completion preserve' => 'Ao completar preservar',
'Tables and views' => 'Tabelas e vistas',
'Data Length' => 'Tamanho de dados',
'Index Length' => 'Tamanho de índice',
'Data Free' => 'Espaço Livre',
'Collation' => 'Colação',
'Analyze' => 'Analizar',
'Optimize' => 'Otimizar',
'Check' => 'Verificar',
'Repair' => 'Reparar',
'Truncate' => 'Truncar',
'Tables have been truncated.' => 'Tabelas truncadas (truncate).',
'Rows' => 'Registros',
',' => ' ',
'Tables have been moved.' => 'As Tabelas foram movidas.',
'Move to other database' => 'Mover outra Base de dados',
'Move' => 'Mover',
'Engine' => 'Motor',
'Save and continue edit' => 'Salvar e continuar editando',
'original' => 'original',
'Tables have been dropped.' => 'Tabelas eliminadas.',
'%d item(s) have been affected.' => array('%d ítem afetado.', '%d itens afetados.'),
'whole result' => 'resultado completo',
'Clone' => 'Clonar',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Cantida máxima de campos permitidos excedidos. Por favor aumente %s y %s.',
'Partition by' => 'Particionar por',
'Partitions' => 'Partições',
'Partition name' => 'Nome da Partição',
'Values' => 'Valores',
'%d row(s) have been imported.' => array('%d registro importado.', '%d registros importados.'),
'anywhere' => 'qualquer local',
'Import' => 'Importar',
'Stop on error' => 'Parar em caso de erro',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$5/$3/$1',
'[yyyy]-mm-dd' => 'dd/mm/[aaaa]',
'History' => 'Historico',
'Variables' => 'Variaveis',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'As colunas de origen e destino devem ser do mesmo tipo, deve existir um índice entre as colunas de destino e o registro referenciado deve existir.',
'Relations' => 'Relações',
'Run file' => 'Executar Arquivo',
'Clear' => 'Limpar',
'Maximum allowed file size is %sB.' => 'Tamanho máximo do arquivo é %sB.',
'Numbers' => 'Números',
'Date and time' => 'Data e hora',
'Strings' => 'Cadena',
'Binary' => 'Binario',
'Lists' => 'Listas',
'Editor' => 'Editor',
'E-mail' => 'E-mail',
'From' => 'De',
'Subject' => 'Assunto',
'Send' => 'Enviar',
'%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'),
'Webserver file %s' => 'Arquivo do servidor web %s',
'File does not exist.' => 'Arquivo não existe.',
'%d in total' => '%d no total',
'Permanent login' => 'Salvar Senha',
'Databases have been dropped.' => 'Bases de dados eliminadas.',
'Search data in tables' => 'Buscar dados nas Tabelas',
'schema' => 'esquema',
'Schema' => 'Esquema',
'Alter schema' => 'Modificar esquema',
'Create schema' => 'Criar esquema',
'Schema has been dropped.' => 'Esquema eliminado.',
'Schema has been created.' => 'Esquema criado.',
'Schema has been altered.' => 'Esquema modificado.',
'Sequences' => 'Sequencias',
'Create sequence' => 'Criar sequencias',
'Alter sequence' => 'Modificar sequencia',
'Sequence has been dropped.' => 'Sequencia eliminada.',
'Sequence has been created.' => 'Sequencia criada.',
'Sequence has been altered.' => 'Sequencia modificada.',
'User types' => 'Tipos definido pelo usuario',
'Create type' => 'Criar tipo',
'Alter type' => 'Modificar tipo',
'Type has been dropped.' => 'Tipo eliminado.',
'Type has been created.' => 'Tipo criado.',
'Double click on a value to modify it.' => 'Doble-clic sobre o valor para edita-lo.',
'Use edit link to modify this value.' => 'Utilize o link modificar para alterar.',
'last' => 'último',
'From server' => 'Desde servidor',
'System' => 'Motor de Base de dados',
'Select data' => 'Selecionar dados',
'Show structure' => 'Mostrar estrutura',
'empty' => 'vazio',
'Network' => 'Rede',
'Geometry' => 'Geometría',
'File exists.' => 'Arquivo ja existe.',
'Attachments' => 'Anexos',
'%d query(s) executed OK.' => array('%d consulta sql executada corretamente.', '%d consulta sql executadas corretamente.'),
'Show only errors' => 'Mostrar somente erros',
'Last page' => 'Ultima página',
'Refresh' => 'Atualizar',
'Invalid schema.' => 'Esquema inválido.',
'Please use one of the extensions %s.' => 'Por favor use uma das extensões %s.',
'now' => 'agora',
'ltr' => 'ltr',
);

View File

@@ -195,7 +195,6 @@ $translations = array(
'Partition name' => 'Название раздела',
'Values' => 'Параметры',
'%d row(s) have been imported.' => array('Импортирована %d строка.', 'Импортировано %d строки.', 'Импортировано %d строк.'),
'CSV Import' => 'Импорт CSV',
'Import' => 'Импорт',
'Stop on error' => 'Остановить при ошибке',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Достигнуто максимальное значение количества доступных полей. Увеличьте %s и %s.',
@@ -246,7 +245,6 @@ $translations = array(
'Type has been dropped.' => 'Тип удален.',
'Type has been created.' => 'Создан новый тип.',
'Double click on a value to modify it.' => 'Кликни два раза по значению, чтобы его изменить.',
'Increase Text length to modify this value.' => 'Увеличь Длину текста, чтобы изменить это значение.',
'Use edit link to modify this value.' => 'Изменить это значение можно с помощью ссылки «изменить».',
'last' => 'последняя',
'From server' => 'С сервера',
@@ -258,4 +256,12 @@ $translations = array(
'Geometry' => 'Геометрия',
'File exists.' => 'Файл уже существует.',
'Attachments' => 'Прикрепленные файлы',
'%d query(s) executed OK.' => array('%d запрос выполнен успешно.', '%d запроса выполнено успешно.', '%d запросов выполнено успешно.'),
'Show only errors' => 'Только ошибки',
'Last page' => 'Последняя страница',
'Refresh' => 'Обновить',
'Invalid schema.' => 'Неправильная схема.',
'Please use one of the extensions %s.' => 'Используйте одно из этих расширений %s.',
'now' => 'сейчас',
'ltr' => 'ltr',
);

View File

@@ -196,7 +196,6 @@ $translations = array(
'Partition name' => 'Názov oddielu',
'Values' => 'Hodnoty',
'%d row(s) have been imported.' => array('Bol importovaný %d záznam.', 'Boli importované %d záznamy.', 'Bolo importovaných %d záznamov.'),
'CSV Import' => 'Import CSV',
'Import' => 'Import',
'Stop on error' => 'Zastaviť pri chybe',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Bol prekročený maximálny počet povolených polí. Zvýšte prosím %s a %s.',
@@ -246,7 +245,6 @@ $translations = array(
'Type has been created.' => 'Typ bol vytvorený.',
'Alter type' => 'Pozmeniť typ',
'Double click on a value to modify it.' => 'Dvojkliknite na políčko, ktoré chcete zmeniť.',
'Increase Text length to modify this value.' => 'Pre zmenu tejto hodnoty zvýšte Dĺžku textov.',
'Use edit link to modify this value.' => 'Pre zmenu tejto hodnoty použite odkaz upraviť.',
'last' => 'posledný',
'From server' => 'Zo serveru',
@@ -258,4 +256,12 @@ $translations = array(
'Geometry' => 'Geometria',
'File exists.' => 'Súbor existuje.',
'Attachments' => 'Prílohy',
'%d query(s) executed OK.' => array('Bol vykonaný %d dotaz.', 'Boli vykonané %d dotazy.', 'Bolo vykonaných %d dotazov.'),
'Show only errors' => 'Zobraziť iba chyby',
'Last page' => 'Posledná stránka',
'Refresh' => 'Obnoviť',
'Invalid schema.' => 'Neplatné schéma.',
'Please use one of the extensions %s.' => 'Prosím vyberte jednu z koncoviek %s.',
'now' => 'teraz',
'ltr' => 'ltr',
);

311
adminer/lang/sl.inc.php Normal file
View File

@@ -0,0 +1,311 @@
<?php
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Sistem',
'Server' => 'Strežnik',
'Username' => 'Uporabniško ime',
'Password' => 'Geslo',
'Permanent login' => 'Trajna prijava',
'Login' => 'Prijavi se',
'Logout' => 'Odjavi se',
'Logged as: %s' => 'Prijavljen kot: %s',
'Logout successful.' => 'Prijava uspešna.',
'Invalid credentials.' => 'Neveljavne pravice.',
'Language' => 'Jezik',
'Invalid CSRF token. Send the form again.' => 'Neveljaven token CSRF. Pošljite formular še enkrat.',
'No extension' => 'Brez dodatkov',
'None of the supported PHP extensions (%s) are available.' => 'Noben od podprtih dodatkov za PHP (%s) ni na voljo.',
'Session support must be enabled.' => 'Podpora za seje mora biti omogočena.',
'Session expired, please login again.' => 'Seja je potekla. Prosimo, ponovno se prijavite.',
'%s version: %s through PHP extension %s' => 'Verzija %s: %s preko dodatka za PHP %s',
'Refresh' => 'Osveži',
// text direction
'ltr' => 'ltr',
'Privileges' => 'Pravice',
'Create user' => 'Ustvari uporabnika',
'User has been dropped.' => 'Uporabnik je odstranjen.',
'User has been altered.' => 'Uporabnik je spremenjen.',
'User has been created.' => 'Uporabnik je ustvarjen.',
'Hashed' => 'Zakodirano',
'Column' => 'Stolpec',
'Routine' => 'Postopek',
'Grant' => 'Dovoli',
'Revoke' => 'Odvzemi',
'Process list' => 'Seznam procesov',
'%d process(es) have been killed.' => array('Končan je %d proces.', 'Končana sta %d procesa.', 'Končani so %d procesi.', 'Končanih je %d procesov.'),
'Kill' => 'Končaj',
'Variables' => 'Spremenljivke',
'Status' => 'Stanje',
'SQL command' => 'Ukaz SQL',
'%d query(s) executed OK.' => array('Uspešno se je končala %d poizvedba.', 'Uspešno sta se končali %d poizvedbi.', 'Uspešno so se končale %d poizvedbe.', 'Uspešno se je končalo %d poizvedb.'),
'Query executed OK, %d row(s) affected.' => array('Poizvedba se je uspešno izvedla, spremenjena je %d vrstica.', 'Poizvedba se je uspešno izvedla, spremenjeni sta %d vrstici.', 'Poizvedba se je uspešno izvedla, spremenjene so %d vrstice.', 'Poizvedba se je uspešno izvedla, spremenjenih je %d vrstic.'),
'No commands to execute.' => 'Ni ukazov za izvedbo.',
'Error in query' => 'Napaka v poizvedbi',
'Execute' => 'Izvedi',
'Stop on error' => 'Ustavi ob napaki',
'Show only errors' => 'Pokaži samo napake',
// sprintf() format for time of the command
'%.3f s' => '%.3f s',
'History' => 'Zgodovina',
'Clear' => 'Počisti',
'File upload' => 'Naloži datoteko',
'From server' => 'z strežnika',
'Webserver file %s' => 'Datoteka na spletnem strežniku %s',
'Run file' => 'Zaženi datoteko',
'File does not exist.' => 'Datoteka ne obstaja.',
'File uploads are disabled.' => 'Nalaganje datotek je onemogočeno.',
'Unable to upload a file.' => 'Ne morem naložiti datoteke.',
'Maximum allowed file size is %sB.' => 'Največja velikost datoteke je %sB.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Preveliko podatkov za POST. Zmanjšajte število podatkov ali povečajte nastavitev za %s.',
'Export' => 'Izvozi',
'Dump' => 'Izvozi',
'Output' => 'Izhod rezultata',
'open' => 'odpri',
'save' => 'shrani',
'Format' => 'Format',
'Data' => 'Podatki',
'Database' => 'Baza',
'database' => 'baza',
'Use' => 'Uporabi',
'Select database' => 'Izberi bazo',
'Invalid database.' => 'Neveljavna baza.',
'Create new database' => 'Ustvari novo bazo',
'Database has been dropped.' => 'Baza je zavržena.',
'Databases have been dropped.' => 'Baze so zavržene.',
'Database has been created.' => 'Baza je ustvarjena.',
'Database has been renamed.' => 'Baza je preimenovana.',
'Database has been altered.' => 'Baza je spremenjena.',
'Alter database' => 'Spremeni bazo',
'Create database' => 'Ustvari bazo',
'Database schema' => 'Shema baze',
// thousands separator - must contain single byte
',' => ' ',
'Engine' => 'Pogon',
'Collation' => 'Zbiranje',
'Data Length' => 'Velikost podatkov',
'Index Length' => 'Velikost indeksa',
'Data Free' => 'Podatkov prosto ',
'Rows' => 'Vrstic',
'%d in total' => 'Skupaj %d',
'Analyze' => 'Analiziraj',
'Optimize' => 'Optimiziraj',
'Check' => 'Preveri',
'Repair' => 'Popravi',
'Truncate' => 'Skrajšaj',
'Tables have been truncated.' => 'Tabele so skrajšane.',
'Move to other database' => 'Premakni v drugo bazo',
'Move' => 'Premakni',
'Tables have been moved.' => 'Tabele so premaknjene.',
'Copy' => 'Kopiraj',
'Tables have been copied.' => 'Tabele so kopirane.',
'Routines' => 'Postopki',
'Routine has been called, %d row(s) affected.' => array('Klican je bil postopek, spremenjena je %d vrstica.', 'Klican je bil postopek, spremenjeni sta %d vrstici.', 'Klican je bil postopek, spremenjene so %d vrstice.', 'Klican je bil postopek, spremenjenih je %d vrstic.'),
'Call' => 'Pokliči',
'Parameter name' => 'Ime parametra',
'Create procedure' => 'Ustvari postopek',
'Create function' => 'Ustvari funkcijo',
'Routine has been dropped.' => 'Postopek je zavržen.',
'Routine has been altered.' => 'Postopek je spremenjen.',
'Routine has been created.' => 'Postopek je ustvarjen.',
'Alter function' => 'Spremeni funkcijo',
'Alter procedure' => 'Spremeni postopek',
'Return type' => 'Vračalni tip',
'Events' => 'Dogodki',
'Event has been dropped.' => 'Dogodek je zavržen.',
'Event has been altered.' => 'Dogodek je spremenjen.',
'Event has been created.' => 'Dogodek je ustvarjen.',
'Alter event' => 'Spremeni dogodek',
'Create event' => 'Ustvari dogodek',
'At given time' => 'v danem času',
'Every' => 'vsake',
'Schedule' => 'Urnik',
'Start' => 'Začetek',
'End' => 'Konec',
'On completion preserve' => 'Po zaključku ohrani',
'Tables' => 'Tabele',
'Tables and views' => 'Tabele in pogledi',
'Table' => 'Tabela',
'No tables.' => 'Ni tabel.',
'Alter table' => 'Spremeni tabelo',
'Create table' => 'Ustvari tabelo',
'Create new table' => 'Ustvari novo tabelo',
'Table has been dropped.' => 'Tabela je zavržena.',
'Tables have been dropped.' => 'Tabele so zavržene.',
'Table has been altered.' => 'Tabela je spremenjena.',
'Table has been created.' => 'Tabela je ustvarjena.',
'Table name' => 'Ime tabele',
'Show structure' => 'Pokaži zgradbo',
'engine' => 'pogon',
'collation' => 'zbiranje',
'Column name' => 'Ime stolpca',
'Type' => 'Tip',
'Length' => 'Dolžina',
'Auto Increment' => 'Samodejno povečevanje',
'Options' => 'Možnosti',
'Comment' => 'Komentar',
'Default values' => 'Privzete vrednosti',
'Drop' => 'Zavrzi',
'Are you sure?' => 'Ste prepričani?',
'Move up' => 'Premakni gor',
'Move down' => 'Premakni dol',
'Remove' => 'Odstrani',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Največje število dovoljenih polje je preseženo. Prosimo, povečajte %s in %s.',
'Partition by' => 'Porazdeli po',
'Partitions' => 'Porazdelitve',
'Partition name' => 'Ime porazdelitve',
'Values' => 'Vrednosti',
'View' => 'Pogledi',
'View has been dropped.' => 'Pogled je zavržen.',
'View has been altered.' => 'Pogled je spremenjen.',
'View has been created.' => 'Pogled je ustvarjen.',
'Alter view' => 'Spremeni pogled',
'Create view' => 'Ustvari pogled',
'Indexes' => 'Indeksi',
'Indexes have been altered.' => 'Indeksi so spremenjeni.',
'Alter indexes' => 'Spremeni indekse',
'Add next' => 'Dodaj naslednjega',
'Index Type' => 'Tip indeksa',
'Column (length)' => 'Stolpec (dolžina)',
'Foreign keys' => 'Tuji ključi',
'Foreign key' => 'Tuj ključ',
'Foreign key has been dropped.' => 'Tuj ključ je zavržen.',
'Foreign key has been altered.' => 'Tuj ključ je spremenjen.',
'Foreign key has been created.' => 'Tuj ključ je ustvarjen.',
'Target table' => 'Ciljna tabela',
'Change' => 'Spremeni',
'Source' => 'Izvor',
'Target' => 'Cilj',
'Add column' => 'Dodaj stolpec',
'Alter' => 'Spremeni',
'Add foreign key' => 'Dodaj tuj ključ',
'ON DELETE' => 'pri brisanju',
'ON UPDATE' => 'pri posodabljanju',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Izvorni in ciljni stolpec mora imeti isti podatkovni tip. Obstajati mora indeks na ciljnih stolpcih in obstajati morajo referenčni podatki.',
'Triggers' => 'Sprožilniki',
'Add trigger' => 'Dodaj sprožilnik',
'Trigger has been dropped.' => 'Sprožilnik je odstranjen.',
'Trigger has been altered.' => 'Sprožilnik je spremenjen.',
'Trigger has been created.' => 'Sprožilnik je ustvarjen.',
'Alter trigger' => 'Spremeni sprožilnik',
'Create trigger' => 'Ustvari sprožilnik',
'Time' => 'Čas',
'Event' => 'Dogodek',
'Name' => 'Naziv',
'select' => 'izberi',
'Select' => 'Izberi',
'Select data' => 'Izberi podatke',
'Functions' => 'Funkcije',
'Aggregation' => 'Združitev',
'Search' => 'Išči',
'anywhere' => 'kjerkoli',
'Search data in tables' => 'Išče podatke po tabelah',
'Sort' => 'Sortiraj',
'descending' => 'padajoče',
'Limit' => 'Limita',
'Text length' => 'Dolžina teksta',
'Action' => 'Dejanje',
'Unable to select the table' => 'Ne morem izbrati tabele',
'No rows.' => 'Ni vrstic.',
'%d row(s)' => array('%d vrstica', '%d vrstici', '%d vrstice', '%d vrstic'),
'Page' => 'Stran',
'last' => 'Zadnja',
'Last page' => 'Zadnja stran',
'whole result' => 'cel razultat',
'%d byte(s)' => array('%d bajt', '%d bajta', '%d bajti', '%d bajtov'),
'Import' => 'Uvozi',
'%d row(s) have been imported.' => array('Uvožena je %d vrstica.', 'Uvoženi sta %d vrstici.', 'Uvožene so %d vrstice.', 'Uvoženih je %d vrstic.'),
// in-place editing in select
'Double click on a value to modify it.' => 'Dvojni klik na vrednost za urejanje.',
'Use edit link to modify this value.' => 'Uporabite urejanje povezave za spreminjanje te vrednosti.',
// %s can contain auto-increment value
'Item%s has been inserted.' => 'Predmet%s je vstavljen.',
'Item has been deleted.' => 'Predmet je izbrisan.',
'Item has been updated.' => 'Predmet je posodobljen.',
'%d item(s) have been affected.' => array('Spremenjen je %d predmet.', 'Spremenjena sta %d predmeta.', 'Spremenjeni so %d predmeti.', 'Spremenjenih je %d predmetov.'),
'New item' => 'Nov predmet',
'original' => 'original',
// label for value '' in enum data type
'empty' => 'prazno',
'edit' => 'uredi',
'Edit' => 'Uredi',
'Insert' => 'Vstavi',
'Save' => 'Shrani',
'Save and continue edit' => 'Shrani in nadaljuj z urejanjem',
'Save and insert next' => 'Shrani in vstavi tekst',
'Clone' => 'Kloniraj',
'Delete' => 'Izbriši',
'E-mail' => 'E-mail',
'From' => 'Od',
'Subject' => 'Zadeva',
'Attachments' => 'Priponke',
'Send' => 'Pošlji',
'%d e-mail(s) have been sent.' => array('Poslan je %d e-mail.', 'Poslana sta %d e-maila.', 'Poslani so %d e-maili.', 'Poslanih je %d e-mailov.'),
// data type descriptions
'Numbers' => 'Števila',
'Date and time' => 'Datum in čas',
'Strings' => 'Nizi',
'Binary' => 'Binarni',
'Lists' => 'Seznami',
'Network' => 'Mrežni',
'Geometry' => 'Geometrčni',
'Relations' => 'Relacijski',
'Editor' => 'Urejevalnik',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$6.$4.$1',
// hint for date format - use language equivalents for day, month and year shortcuts
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
'now' => 'zdaj',
// general SQLite error in create, drop or rename database
'File exists.' => 'Datoteka obstaja.',
'Please use one of the extensions %s.' => 'Prosim, uporabite enega od dodatkov %s.',
// PostgreSQL and MS SQL schema support
'Alter schema' => 'Spremeni shemo',
'Create schema' => 'Ustvari shemo',
'Schema has been dropped.' => 'Shema je zavržena.',
'Schema has been created.' => 'Shema je ustvarjena.',
'Schema has been altered.' => 'Shema je spremenjena.',
'schema' => 'shema',
'Schema' => 'Shema',
'Invalid schema.' => 'Neveljavna shema.',
// PostgreSQL sequences support
'Sequences' => 'Sekvence',
'Create sequence' => 'Ustvari sekvenco',
'Sequence has been dropped.' => 'Sekvenca je zavržena.',
'Sequence has been created.' => 'Sekvence je ustvarjena.',
'Sequence has been altered.' => 'Sekvence je spremenjena.',
'Alter sequence' => 'Spremni sekvenco',
// PostgreSQL user types support
'User types' => 'Uporabniški tipi',
'Create type' => 'Ustvari tip',
'Type has been dropped.' => 'Tip je zavržen.',
'Type has been created.' => 'Tip je ustvarjen.',
'Alter type' => 'Spremeni tip',
);

View File

@@ -194,7 +194,6 @@ $translations = array(
'Values' => 'ம‌திப்புக‌ள்',
'%d row(s) have been imported.' => array('%d வ‌ரிசை இற‌க்கும‌தி (Import) செய்ய‌ப்ப‌ட்ட‌து.', '%d வ‌ரிசைக‌ள் இற‌க்கும‌தி (Import) செய்ய‌ப்ப‌ட்டன‌.'),
'Show structure' => 'க‌ட்ட‌மைப்பை காண்பிக்க‌வும்',
'CSV Import' => 'இம்போர்ட் CSV',
'Import' => 'இற‌க்கும‌தி (Import)',
'Stop on error' => 'பிழை ஏற்ப‌டின் நிற்க‌',
'Select data' => 'த‌க‌வ‌லை தேர்வு செய்',
@@ -236,7 +235,6 @@ $translations = array(
'Schema has been created.' => 'அமைப்புமுறை உருவாக்க‌ப்ப‌ட்ட‌து.',
'Schema has been altered.' => 'அமைப்புமுறை மாற்ற‌ப்ப‌ட்ட‌து.',
'Double click on a value to modify it.' => 'ம‌திப்பினை மாற்ற அத‌ன் மீது இருமுறை சொடுக்க‌வும் (Double click).',
'Increase Text length to modify this value.' => 'இந்த‌ ம‌திப்பினை மாற்ற, டெக்ஸ்ட் நீள‌த்தினை அதிக‌ரிக்க‌வும்.',
'Use edit link to modify this value.' => 'இந்த‌ ம‌திப்பினை மாற்ற‌, தொகுப்பு இணைப்பினை உப‌யோகிக்க‌வும்.',
'last' => 'க‌டைசி',
'Sequence has been dropped.' => 'வ‌ரிசைமுறை நீக்க‌ப்ப‌ட்ட‌து.',
@@ -259,4 +257,11 @@ $translations = array(
'File exists.' => 'கோப்பு உள்ள‌து.',
'Attachments' => 'இணைப்புக‌ள்',
'now' => 'இப்பொழுது',
'%d query(s) executed OK.' => array('%d வின‌வ‌ல் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌து.', '%d வின‌வ‌ல்க‌ள் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌ன‌.'),
'Show only errors' => 'பிழைக‌ளை ம‌ட்டும் காண்பிக்க‌வும்',
'Last page' => 'க‌டைசி ப‌க்க‌ம்',
'Refresh' => 'புதுப்பி (Refresh)',
'Invalid schema.' => 'அமைப்புமுறை ச‌ரியான‌த‌ல்ல‌ (Invalid Schema).',
'Please use one of the extensions %s.' => 'த‌ய‌வு செய்து ஒரு விரிவினை %s (extension) உப‌யோகிக்க‌வும்.',
'ltr' => 'ltr',
);

311
adminer/lang/tr.inc.php Normal file
View File

@@ -0,0 +1,311 @@
<?php
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Sistem',
'Server' => 'Sunucu',
'Username' => 'Kullanıcı',
'Password' => 'Parola',
'Permanent login' => 'Kalıcı giriş',
'Login' => 'Giriş',
'Logout' => ıkış',
'Logged as: %s' => '%s olarak giriş yapıldı.',
'Logout successful.' => 'Başarıyla çıkıldı.',
'Invalid credentials.' => 'Geçersiz kimlik.',
'Language' => 'Dil',
'Invalid CSRF token. Send the form again.' => 'Geçersiz Cross-site request forgery (CSRF) jetonu. Forumu tekrar yolla.',
'No extension' => 'Uzantı yok',
'None of the supported PHP extensions (%s) are available.' => 'Desteklenen PHP uzantılarından (%s) hiçbiri mevcut değil.',
'Session support must be enabled.' => 'Oturum desteği etkin olmalıdır.',
'Session expired, please login again.' => 'Oturum süresi doldu, lütfen tekrar giriş yapın.',
'%s version: %s through PHP extension %s' => '%s sürüm: %s PHP uzantısı ile %s',
'Refresh' => 'Tazele',
// text direction
'ltr' => 'ltr',
'Privileges' => 'İzinler',
'Create user' => 'Kullanıcı yarat',
'User has been dropped.' => 'Kullanıcı düşürüldü.',
'User has been altered.' => 'Kullanıcı değiştirildi.',
'User has been created.' => 'Kullanıcı yaratıldı.',
'Hashed' => 'Harmanlandı.',
'Column' => 'Kolon',
'Routine' => 'Yordam',
'Grant' => 'İmtiyaz',
'Revoke' => 'Geri al',
'Process list' => 'İşlem listesi',
'%d process(es) have been killed.' => array('%d süreç öldürüldü.', '%d adet süreç öldürüldü.'),
'Kill' => 'Öldür',
'Variables' => 'Değişkenler',
'Status' => 'Durum',
'SQL command' => 'SQL komutu',
'%d query(s) executed OK.' => array('%d sorgunun işletilmesi tamamlandı.', '%d kadar sorgunun işletilmesi tamamlandı.'),
'Query executed OK, %d row(s) affected.' => array('Sorgu işletilmesi tamamlandı. %d sıra(row) etkilendi.', 'Sorgu işletilmesi tamamlandı. Bundan %d kadar sıra etkilendi.'),
'No commands to execute.' => 'İşletilmek için komut yok.',
'Error in query' => 'Sorguda hata',
'Execute' => 'İşlet',
'Stop on error' => 'Dur hata',
'Show only errors' => 'Sadece hataları göster.',
// sprintf() format for time of the command
'%.3f s' => '%.3f s',
'History' => 'Tarih',
'Clear' => 'Boşluk',
'File upload' => 'Dosya gönder',
'From server' => 'Sunucudan',
'Webserver file %s' => '%s web sunucusu dosyası',
'Run file' => 'Dosya çalıştır',
'File does not exist.' => 'Dosya mevcut değil.',
'File uploads are disabled.' => 'Dosya gönderimi etkin değil.',
'Unable to upload a file.' => 'Dosya gönderilemiyor.',
'Maximum allowed file size is %sB.' => 'Bir dosya için izin verilen dosya sınırı %sB.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Çok büyük POST verisi, veriyi azaltın ya da ayar yönergesini uygun olarak yapılandırın.',
'Export' => 'İhraç',
'Dump' => 'Döküm',
'Output' => ıktı',
'open' => 'aç',
'save' => 'kaydet',
'Format' => 'Biçim',
'Data' => 'Veri',
'Database' => 'Veritabanı',
'database' => 'veritabanı',
'Use' => 'Kullan',
'Select database' => 'Veritabanı seç',
'Invalid database.' => 'Geçersiz veritabanı.',
'Create new database' => 'Yeni veritabanı yarat',
'Database has been dropped.' => 'Veritabanı düşürüldü.',
'Databases have been dropped.' => 'Veritabanları düşüüldü.',
'Database has been created.' => 'Veritabanı yaratıldı.',
'Database has been renamed.' => 'Veritabanının ismi değiştirildi.',
'Database has been altered.' => 'Veritabanı değiştirildi.',
'Alter database' => 'Veritabanı değiştir',
'Create database' => 'Veritabanı yarat',
'Database schema' => 'Veritabanı şeması',
// thousands separator - must contain single byte
',' => ' ',
'Engine' => 'Motor',
'Collation' => 'Karşılaştırma',
'Data Length' => 'Veri uzunluğu',
'Index Length' => 'Dizin uzunluğu',
'Data Free' => 'Serbest veri',
'Rows' => 'Sıralar (Rows)',
'%d in total' => '%d toplamda',
'Analyze' => 'Çözümleme',
'Optimize' => 'En uygun hale getirme',
'Check' => 'Denetleme',
'Repair' => 'Tamir',
'Truncate' => 'Buda',
'Tables have been truncated.' => 'Tablolar budandı.',
'Move to other database' => 'Diğer veritabanına taşı',
'Move' => 'Taşı',
'Tables have been moved.' => 'Tablolar taşındı.',
'Copy' => 'Kopyala',
'Tables have been copied.' => 'Tablolar kopyalandı.',
'Routines' => 'Yordamlar',
'Routine has been called, %d row(s) affected.' => array('Yordam çağrıldı, %d sıra(row) etkilendi.', 'Yordam çağrıldı, %d sıralar(rows) etkilendi.'),
'Call' => 'Çağrı',
'Parameter name' => 'Parametre adı',
'Create procedure' => 'Yöntem yarat',
'Create function' => 'Fonksiyon yarat',
'Routine has been dropped.' => 'Yordam düşürüldü.',
'Routine has been altered.' => 'Yordam değiştirildi.',
'Routine has been created.' => 'Yordam yaratıldı.',
'Alter function' => 'Değiştirme fonksyionu',
'Alter procedure' => 'Değiştirme yöntemi',
'Return type' => 'Geri dönüş türü',
'Events' => 'Olaylar',
'Event has been dropped.' => 'Olay düşüdüldü.',
'Event has been altered.' => 'Olay değiştirildi.',
'Event has been created.' => 'Olay yaratıldı.',
'Alter event' => 'Değiştirme olayı',
'Create event' => 'Yaratma olayı',
'At given time' => 'Bir anda',
'Every' => 'Herzaman',
'Schedule' => 'Takvimli',
'Start' => 'Başla',
'End' => 'Son',
'On completion preserve' => 'Tamamlama koruması AÇIK',
'Tables' => 'Tablolar',
'Tables and views' => 'Tablolar ve görünümler',
'Table' => 'Tablo',
'No tables.' => 'Tablo yok.',
'Alter table' => 'Tablo değiştir',
'Create table' => 'Tablo yarat',
'Create new table' => 'Yeni tablo yarat',
'Table has been dropped.' => 'Tablo düşürüldü.',
'Tables have been dropped.' => 'Tablolar düşürüldü.',
'Table has been altered.' => 'Tablo değiştirildi.',
'Table has been created.' => 'Tablo yaratıldı.',
'Table name' => 'Tablo adı',
'Show structure' => 'Yapıyı göster',
'engine' => 'motor',
'collation' => 'karşılaştırma',
'Column name' => 'Kolon adı',
'Type' => 'Tür',
'Length' => 'Uzunluk',
'Auto Increment' => 'Otomatik yükselt',
'Options' => 'Seçenekler',
'Comment' => 'Yorum',
'Default values' => 'Varsayılan değerler',
'Drop' => 'Düşür',
'Are you sure?' => 'Emin misin?',
'Move up' => 'Yukarı taşı',
'Move down' => 'AŞağı taş',
'Remove' => 'Kaldır',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'kabul edilebilir alan sayısııldı. Lütfen %s ve %s düşürün.',
'Partition by' => 'Bölümü tarafından',
'Partitions' => 'Bölümler',
'Partition name' => 'BÖlüm adı',
'Values' => 'Değerler',
'View' => 'Görünüm',
'View has been dropped.' => 'Görünüm düşürüldü.',
'View has been altered.' => 'Görünüm değiştirildi.',
'View has been created.' => 'Görünüm yaratıldı.',
'Alter view' => 'Değişim görünüm',
'Create view' => 'Görünüm yarat',
'Indexes' => 'Dizinler',
'Indexes have been altered.' => 'Dizinler değiştirilidi.',
'Alter indexes' => 'Dizinleri değiştir',
'Add next' => 'Sonraya ekle',
'Index Type' => 'Dizin Türü',
'Column (length)' => 'Kolon (uzunluğu)',
'Foreign keys' => 'Dış anahtarlar',
'Foreign key' => 'Dış anahtar',
'Foreign key has been dropped.' => 'Dış anahtar düşürüldü.',
'Foreign key has been altered.' => 'Dış anahtar değiştir.',
'Foreign key has been created.' => 'Dış anahtar yarat.',
'Target table' => 'Hedef tablo',
'Change' => 'Değiş',
'Source' => 'Kaynak',
'Target' => 'Hedef',
'Add column' => 'Kolon eklde',
'Alter' => 'Değiştir',
'Add foreign key' => 'Dış anahtar ekle',
'ON DELETE' => 'Silinmek üzere',
'ON UPDATE' => 'Yükseltilmek üzere',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Kaynak ve hedef kolonlar aynı veri türü olmak zorunda, hedef kolonda bir dizin ve başvurulan veri bulunmalı.',
'Triggers' => 'Tetikler',
'Add trigger' => 'Tetik ekle',
'Trigger has been dropped.' => 'Tetik düşürüldü.',
'Trigger has been altered.' => 'Tetik değiştirildi.',
'Trigger has been created.' => 'Tetik yaratıldı.',
'Alter trigger' => 'Tetik değiştir.',
'Create trigger' => 'Tetik yarat',
'Time' => 'Zaman',
'Event' => 'Olay',
'Name' => 'Ad',
'select' => 'seç',
'Select' => 'Seç',
'Select data' => 'Veri seç',
'Functions' => 'Fonksiyonlar',
'Aggregation' => 'Kümeleme',
'Search' => 'Arama',
'anywhere' => 'herhangi bir yer',
'Search data in tables' => 'Tablolarda veri ara.',
'Sort' => 'Sırala',
'descending' => 'azalan',
'Limit' => 'sınır',
'Text length' => 'Yazı uzunluğu',
'Action' => 'Eylem',
'Unable to select the table' => 'Tablo seçilemedi',
'No rows.' => 'Sıra yok.',
'%d row(s)' => array('%d sıra)', '%d kadar sıra'),
'Page' => 'Sayfa',
'last' => 'son',
'Last page' => 'Son sayfa',
'whole result' => 'tüm sonuç',
'%d byte(s)' => array('%d bayt', '%d kadar bayt'),
'Import' => 'İthal',
'%d row(s) have been imported.' => array('%d sıra ithal edildi.', '%d kadar sıra ithal edildi.'),
// in-place editing in select
'Double click on a value to modify it.' => 'Değerin üzerine çift tıklayın ve değiştirin.',
'Use edit link to modify this value.' => 'Değeri değiştirmek için düzenleme bağlantısını kullanın.',
// %s can contain auto-increment value
'Item%s has been inserted.' => 'Öğeler eklendi.',
'Item has been deleted.' => 'Öğe silindi.',
'Item has been updated.' => 'Öğe güncellendi.',
'%d item(s) have been affected.' => array('%d öğe etkilendi.', '%d kadar öğe etkilendi.'),
'New item' => 'Yeni öğe',
'original' => 'orijinal',
// label for value '' in enum data type
'empty' => 'boş',
'edit' => 'düzen',
'Edit' => 'Düzen',
'Insert' => 'Ekle',
'Save' => 'Kaydet',
'Save and continue edit' => 'Kaydet ve düzenlemeye devam et',
'Save and insert next' => 'Kaydet ve sonrakin ekle',
'Clone' => 'Klonla',
'Delete' => 'Sil',
'E-mail' => 'E-posta',
'From' => 'Gönderen',
'Subject' => 'Konu',
'Attachments' => 'Ekler',
'Send' => 'Gönder',
'%d e-mail(s) have been sent.' => array('%d e-posta dönderildi.', '%d kadar e-posta gönderildi.'),
// data type descriptions
'Numbers' => 'Sayılar',
'Date and time' => 'Tarih ve zaman',
'Strings' => 'Sözcükler',
'Binary' => 'İkili',
'Lists' => 'Listeler',
'Network' => 'Ağ',
'Geometry' => 'Geometri',
'Relations' => 'İlişkiler',
'Editor' => 'Düzenleyici',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$6.$4.$1',
// hint for date format - use language equivalents for day, month and year shortcuts
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
'now' => 'şimdi',
// general SQLite error in create, drop or rename database
'File exists.' => 'Dosya mevcut.',
'Please use one of the extensions %s.' => '%s uzantılarından birini kullanın.',
// PostgreSQL and MS SQL schema support
'Alter schema' => 'Değişim şeması',
'Create schema' => 'Yaratım şeması',
'Schema has been dropped.' => 'Şema düşürüldü.',
'Schema has been created.' => 'Şema yaratıldı.',
'Schema has been altered.' => 'Şema değiştirildi.',
'schema' => 'şema',
'Schema' => 'Şema',
'Invalid schema.' => 'Geçersiz şema.',
// PostgreSQL sequences support
'Sequences' => 'Diziler',
'Create sequence' => 'Dizi yarat',
'Sequence has been dropped.' => 'Dizi düşürüldü.',
'Sequence has been created.' => 'Dizi yaratıldı.',
'Sequence has been altered.' => 'Dizi değiştirildi.',
'Alter sequence' => 'Dizi değiştir',
// PostgreSQL user types support
'User types' => 'Kullanıcı türleri',
'Create type' => 'Tür yarat',
'Type has been dropped.' => 'Tür düşürüldü.',
'Type has been created.' => 'Tür yaratıldı.',
'Alter type' => 'Tür değiştir',
);

View File

@@ -195,7 +195,6 @@ $translations = array(
'Values' => '值',
'%d row(s) have been imported.' => '%d行已導入。',
'anywhere' => '任意位置',
'CSV Import' => '匯入 CSV',
'Import' => '匯入',
'Stop on error' => '出錯時停止',
'%.3f s' => '%.3f秒',
@@ -227,13 +226,13 @@ $translations = array(
'Table has been dropped.' => '已經刪除資料表。',
'Databases have been dropped.' => '資料庫已刪除。',
'Search data in tables' => '在資料庫搜尋',
'schema' => '構',
'Schema' => '構',
'Alter schema' => '更改構',
'Create schema' => '建立構',
'Schema has been dropped.' => '已刪除構。',
'Schema has been created.' => '已建立構。',
'Schema has been altered.' => '已更改構。',
'schema' => '資料表結構',
'Schema' => '資料表結構',
'Alter schema' => '更改資料表結構',
'Create schema' => '建立資料表結構',
'Schema has been dropped.' => '已刪除資料表結構。',
'Schema has been created.' => '已建立資料表結構。',
'Schema has been altered.' => '已更改資料表結構。',
'Sequences' => 'Sequences',
'Create sequence' => '建立 sequence',
'Alter sequence' => '更改 sequence',
@@ -246,7 +245,6 @@ $translations = array(
'Type has been dropped.' => '已刪除類型。',
'Type has been created.' => '已建立類型。',
'Double click on a value to modify it.' => '雙擊以進行修改。',
'Increase Text length to modify this value.' => '增加字串長度來修改。',
'Use edit link to modify this value.' => '使用編輯連結來修改。',
'last' => '最後一頁',
'From server' => '從伺服器',
@@ -258,4 +256,12 @@ $translations = array(
'Geometry' => '幾何',
'File exists.' => '檔案已存在。',
'Attachments' => '附件',
'%d query(s) executed OK.' => '已順利執行 %d 個查詢。',
'Show only errors' => '僅顯示錯誤訊息',
'Last page' => '最後一頁',
'Refresh' => '重新載入',
'Invalid schema.' => '無效的資料表結構。',
'Please use one of the extensions %s.' => '請使用下列其中一個 extension %s。',
'now' => '現在',
'ltr' => 'ltr',
);

View File

@@ -197,7 +197,6 @@ $translations = array(
'Values' => '值',
'%d row(s) have been imported.' => '%d 行已导入。',
'anywhere' => '任意位置',
'CSV Import' => 'CSV 导入',
'Import' => '导入',
'Stop on error' => '出错时停止',
'%.3f s' => '%.3f 秒',
@@ -246,7 +245,6 @@ $translations = array(
'Type has been dropped.' => '已丢弃类型。',
'Type has been created.' => '已创建类型。',
'Double click on a value to modify it.' => '在值上双击类修改它。',
'Increase Text length to modify this value.' => '增加文本长度以修改该值。',
'Use edit link to modify this value.' => '使用编辑链接来修改该值。',
'last' => '最后',
'From server' => '来自服务器',
@@ -258,4 +256,12 @@ $translations = array(
'Geometry' => '几何图形',
'File exists.' => '文件已存在。',
'Attachments' => '附件',
'%d query(s) executed OK.' => '%d 条查询已成功执行。',
'Show only errors' => '仅显示错误',
'Last page' => '末页',
'Refresh' => '刷新',
'Invalid schema.' => '非法模式。',
'Please use one of the extensions %s.' => '请使用这些扩展中的一个:%s。',
'now' => '现在',
'ltr' => 'ltr',
);

32
adminer/plugin.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
function adminer_object() {
// required to run any plugin
include_once "../plugins/plugin.php";
// autoloader
foreach (glob("../plugins/*.php") as $filename) {
include_once $filename;
}
/* It is possible to combine customization and plugins:
class AdminerCustomization extends AdminerPlugin {
}
return new AdminerCustomization($plugins);
*/
return new AdminerPlugin(array(
// specify enabled plugins here
new AdminerDumpZip,
new AdminerDumpXml,
new AdminerEditCalendar("<script type='text/javascript' src='../externals/jquery-ui/jquery-1.4.4.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.core.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.widget.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.datepicker.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.mouse.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.slider.js'></script>\n<script type='text/javascript' src='../externals/jquery-timepicker/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' href='../externals/jquery-ui/themes/base/jquery.ui.all.css'>\n<style type='text/css'>\n.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }\n.ui-timepicker-div dl { text-align: left; }\n.ui-timepicker-div dl dt { height: 25px; }\n.ui-timepicker-div dl dd { margin: -25px 0 10px 65px; }\n.ui-timepicker-div td { font-size: 90%; }\n</style>\n", "../externals/jquery-ui/ui/i18n/jquery.ui.datepicker-%s.js"),
new AdminerTinymce("../externals/tinymce/jscripts/tiny_mce/tiny_mce_dev.js"),
new AdminerFileUpload(""),
new AdminerSlugify,
new AdminerTranslation,
new AdminerForeignSystem,
new AdminerEnumOption,
));
}
// include original Adminer or Adminer Editor (usually named adminer.php)
include "./index.php";

View File

@@ -54,5 +54,5 @@ if (isset($_GET["function"])) {
<input type="hidden" name="token" value="<?php echo $token; ?>">
<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1"><?php } ?>
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($PROCEDURE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
<?php if ($PROCEDURE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
</form>

View File

@@ -2,7 +2,7 @@
if ($_POST && !$error) {
$killed = 0;
foreach ((array) $_POST["kill"] as $val) {
if (queries("KILL " . ereg_replace("[^0-9]+", "", $val))) {
if (queries("KILL " . (+$val))) {
$killed++;
}
}
@@ -15,14 +15,20 @@ page_header(lang('Process list'), $error);
<form action="" method="post">
<table cellspacing="0" onclick="tableClick(event);" class="nowrap">
<?php
$i = -1;
foreach (get_rows("SHOW FULL PROCESSLIST") as $i => $row) {
if (!$i) {
echo "<thead><tr lang='en'><th>&nbsp;<th>" . implode("<th>", array_keys($row)) . "</thead>\n";
}
echo "<tr" . odd() . "><td>" . checkbox("kill[]", $row["Id"], 0) . "<td>" . implode("<td>", array_map('nbsp', $row)) . "\n";
echo "<tr" . odd() . "><td>" . checkbox("kill[]", $row["Id"], 0);
foreach ($row as $key => $val) {
echo "<td>" . ($key == "Info" && $val != "" ? "<code class='jush-$jush'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Edit') . '</a>' : nbsp($val));
}
echo "\n";
}
?>
</table>
<p><?php echo ($i + 1) . "/" . lang('%d in total', $connection->result("SELECT @@max_connections")); ?>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Kill'); ?>">

View File

@@ -4,10 +4,11 @@ page_header(lang('Database schema'), "", array(), DB);
$table_pos = array();
$table_pos_js = array();
// saved in one cookie because there is a limit of 20 cookies per domain
preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~', $_COOKIE["adminer_schema"], $matches, PREG_SET_ORDER); //! ':' in table name
$name = "adminer_schema";
preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~', ($_GET["schema"] ? $_GET["schema"] : $_COOKIE[($_COOKIE["$name-" . DB] ? "$name-" . DB : $name)]), $matches, PREG_SET_ORDER); // $_COOKIE["adminer_schema"] was used before 3.2.0 //! ':' in table name
foreach ($matches as $i => $match) {
$table_pos[$match[1]] = array($match[2], $match[3]);
$table_pos_js[] = "\n\t'" . addcslashes($match[1], "\r\n'\\/") . "': [ $match[2], $match[3] ]";
$table_pos_js[] = "\n\t'" . js_escape($match[1]) . "': [ $match[2], $match[3] ]";
}
$top = 0;
@@ -27,23 +28,21 @@ foreach (table_status() as $row) {
$schema[$row["Name"]]["fields"][$name] = $field;
}
$schema[$row["Name"]]["pos"] = ($table_pos[$row["Name"]] ? $table_pos[$row["Name"]] : array($top, 0));
if (fk_support($row)) {
foreach (foreign_keys($row["Name"]) as $val) {
if (!$val["db"]) {
$left = $base_left;
if ($table_pos[$row["Name"]][1] || $table_pos[$val["table"]][1]) {
$left = min(floatval($table_pos[$row["Name"]][1]), floatval($table_pos[$val["table"]][1])) - 1;
} else {
$base_left -= .1;
}
while ($lefts[(string) $left]) {
// find free $left
$left -= .0001;
}
$schema[$row["Name"]]["references"][$val["table"]][(string) $left] = array($val["source"], $val["target"]);
$referenced[$val["table"]][$row["Name"]][(string) $left] = $val["target"];
$lefts[(string) $left] = true;
foreach ($adminer->foreignKeys($row["Name"]) as $val) {
if (!$val["db"]) {
$left = $base_left;
if ($table_pos[$row["Name"]][1] || $table_pos[$val["table"]][1]) {
$left = min(floatval($table_pos[$row["Name"]][1]), floatval($table_pos[$val["table"]][1])) - 1;
} else {
$base_left -= .1;
}
while ($lefts[(string) $left]) {
// find free $left
$left -= .0001;
}
$schema[$row["Name"]]["references"][$val["table"]][(string) $left] = array($val["source"], $val["target"]);
$referenced[$val["table"]][$row["Name"]][(string) $left] = $val["target"];
$lefts[(string) $left] = true;
}
}
$top = max($top, $schema[$row["Name"]]["pos"][0] + 2.5 + $pos);
@@ -55,7 +54,9 @@ foreach (table_status() as $row) {
tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
em = document.getElementById('schema').offsetHeight / <?php echo $top; ?>;
document.onmousemove = schemaMousemove;
document.onmouseup = schemaMouseup;
document.onmouseup = function (ev) {
schemaMouseup(ev, '<?php echo js_escape(DB); ?>');
};
</script>
<?php
foreach ($schema as $name => $table) {
@@ -102,3 +103,4 @@ foreach ($schema as $name => $table) {
}
?>
</div>
<p><a href="<?php echo h($_SERVER["REQUEST_URI"]); ?>" id="schema-link">#</a>

View File

@@ -29,7 +29,7 @@ if ($_POST) {
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php
if ($_GET["ns"] != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n";
}
?>
</form>

View File

@@ -1,38 +1,37 @@
<?php
header("Content-Type: text/javascript; charset=utf-8");
if ($_GET["token"] != $token) { // CSRF protection
exit;
}
if ($_GET["script"] == "db") {
$sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0);
foreach (table_status() as $row) {
$id = addcslashes($row["Name"], "\\'/");
echo "setHtml('Comment-$id', '" . addcslashes(nbsp($row["Comment"]), "'\\") . "');\n";
$id = js_escape($row["Name"]);
json_row("Comment-$id", nbsp($row["Comment"]));
if (!is_view($row)) {
foreach (array("Engine", "Collation") as $key) {
echo "setHtml('$key-$id', '" . addcslashes(nbsp($row[$key]), "'\\") . "');\n";
json_row("$key-$id", nbsp($row[$key]));
}
foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) {
if ($row[$key] != "") {
$val = number_format($row[$key], 0, '.', lang(','));
echo "setHtml('$key-$id', '" . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "');\n";
json_row("$key-$id", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? "~ $val" : $val));
if (isset($sums[$key])) {
$sums[$key] += ($row["Engine"] != "InnoDB" || $key != "Data_free" ? $row[$key] : 0);
}
} elseif (array_key_exists($key, $row)) {
echo "setHtml('$key-$id');\n";
json_row("$key-$id");
}
}
}
}
foreach ($sums as $key => $val) {
echo "setHtml('sum-$key', '" . number_format($val, 0, '.', lang(',')) . "');\n";
json_row("sum-$key", number_format($val, 0, '.', lang(',')));
}
json_row("");
} else { // connect
foreach (count_tables(get_databases()) as $db => $val) {
echo "setHtml('tables-" . addcslashes($db, "\\'/") . "', '$val');\n";
json_row("tables-" . js_escape($db), $val);
}
json_row("");
}
exit; // don't print footer

View File

@@ -2,8 +2,11 @@
$TABLE = $_GET["select"];
$table_status = table_status($TABLE);
$indexes = indexes($TABLE);
$fields = fields($TABLE, 1); // 1 - hidden
$fields = fields($TABLE);
$foreign_keys = column_foreign_keys($TABLE);
if ($table_status["Oid"] == "t") {
$indexes[] = array("type" => "PRIMARY", "columns" => array("oid"));
}
$rights = array(); // privilege => 0
$columns = array(); // selectable columns
@@ -23,9 +26,17 @@ list($select, $group) = $adminer->selectColumnsProcess($columns, $indexes);
$where = $adminer->selectSearchProcess($fields, $indexes);
$order = $adminer->selectOrderProcess($fields, $indexes);
$limit = $adminer->selectLimitProcess();
$from = ($select ? implode(", ", $select) : "*") . "\nFROM " . table($TABLE);
$from = ($select ? implode(", ", $select) : ($table_status["Oid"] == "t" ? "oid, " : "") . "*") . "\nFROM " . table($TABLE);
$group_by = ($group && count($group) < count($select) ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : "");
if ($_GET["val"] && is_ajax()) {
header("Content-Type: text/plain; charset=utf-8");
foreach ($_GET["val"] as $unique_idf => $row) {
echo $connection->result("SELECT" . limit(idf_escape(key($row)) . " FROM " . table($TABLE), " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : ""), 1));
}
exit;
}
if ($_POST && !$error) {
$where_check = "(" . implode(") OR (", array_map('where_check', (array) $_POST["check"])) . ")";
$primary = $unselected = null;
@@ -44,31 +55,22 @@ if ($_POST && !$error) {
}
if ($_POST["export"]) {
dump_headers($TABLE);
dump_table($TABLE, "");
if ($_POST["format"] != "sql") { // Editor doesn't send format
$row = array_keys($fields);
if ($select) {
$row = array();
foreach ($select as $val) {
$row[] = (ereg('^`.*`$', $val) ? idf_unescape($val) : $val); //! columns looking like functions
}
}
dump_csv($row);
}
$adminer->dumpTable($TABLE, "");
if (!is_array($_POST["check"]) || $unselected === array()) {
$where2 = $where;
if (is_array($_POST["check"])) {
$where2[] = "($where_check)";
}
dump_data($TABLE, "INSERT", "SELECT $from" . ($where2 ? "\nWHERE " . implode(" AND ", $where2) : "") . $group_by);
$query = "SELECT $from" . ($where2 ? "\nWHERE " . implode(" AND ", $where2) : "") . $group_by;
} else {
$union = array();
foreach ($_POST["check"] as $val) {
// where is not unique so OR can't be used
$union[] = "(SELECT" . limit($from, "\nWHERE " . ($where ? implode(" AND ", $where) . " AND " : "") . where_check($val) . $group_by, 1) . ")";
}
dump_data($TABLE, "INSERT", implode(" UNION ALL ", $union));
$query = implode(" UNION ALL ", $union);
}
$adminer->dumpData($TABLE, "table", $query);
exit;
}
if (!$adminer->selectEmailProcess($where, $foreign_keys)) {
@@ -128,7 +130,9 @@ if ($_POST && !$error) {
$key = bracket_escape($key, 1); // 1 - back
$set[] = idf_escape($key) . " = " . (ereg('char|text', $fields[$key]["type"]) || $val != "" ? $adminer->processInput($fields[$key], $val) : "NULL");
}
$result = queries("UPDATE" . limit1(table($TABLE) . " SET " . implode(", ", $set), " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : ""))); // can change row on a different page without unique key
$query = table($TABLE) . " SET " . implode(", ", $set);
$where2 = " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : "");
$result = queries("UPDATE" . (count($group) < count($select) ? " $query$where2" : limit1($query, $where2))); // can change row on a different page without unique key
if (!$result) {
break;
}
@@ -143,7 +147,7 @@ if ($_POST && !$error) {
preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~', $file, $matches);
$affected = count($matches[0]);
begin();
$separator = ($_POST["separator"] == "csv" ? "," : ";");
$separator = ($_POST["separator"] == "csv" ? "," : ($_POST["separator"] == "tsv" ? "\t" : ";"));
foreach ($matches[0] as $key => $val) {
preg_match_all("~((\"[^\"]*\")+|[^$separator]*)$separator~", $val . $separator, $matches2);
if (!$key && !array_diff($matches2[1], $cols)) { //! doesn't work with column names containing ",\n
@@ -209,10 +213,10 @@ if (!$columns) {
$page = $_GET["page"];
if ($page == "last") {
$found_rows = $connection->result("SELECT COUNT(*) FROM " . table($TABLE) . ($where ? " WHERE " . implode(" AND ", $where) : ""));
$page = floor(($found_rows - 1) / $limit);
$page = floor(max(0, $found_rows - 1) / $limit);
}
$query = "SELECT" . limit((intval($limit) && $group && count($group) < count($select) && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from, ($where ? "\nWHERE " . implode(" AND ", $where) : "") . $group_by, ($limit != "" ? intval($limit) : null), ($page ? $limit * $page : 0), "\n");
$query = "SELECT" . limit((+$limit && $group && count($group) < count($select) && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from, ($where ? "\nWHERE " . implode(" AND ", $where) : "") . $group_by, ($limit != "" ? +$limit : null), ($page ? $limit * $page : 0), "\n");
echo $adminer->selectQuery($query);
$result = $connection->query($query);
@@ -230,7 +234,7 @@ if (!$columns) {
}
// use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest)
if ($_GET["page"] != "last") {
$found_rows = (intval($limit) && $group && count($group) < count($select)
$found_rows = (+$limit && $group && count($group) < count($select)
? ($jush == "sql" ? $connection->result(" SELECT FOUND_ROWS()") : $connection->result("SELECT COUNT(*) FROM ($query) x")) // space to allow mysql.trace_mode
: count($rows)
);
@@ -241,23 +245,26 @@ if (!$columns) {
} else {
$backward_keys = $adminer->backwardKeys($TABLE, $table_name);
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);' onkeydown='return editingKeydown(event);'>\n";
echo "<thead><tr>" . (!$group && $select ? "" : "<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='" . h($_GET["modify"] ? remove_from_uri("modify") : $_SERVER["REQUEST_URI"] . "&modify=1") . "'>" . lang('edit') . "</a>");
$names = array();
$functions = array();
reset($select);
$order = 1;
$rank = 1;
foreach ($rows[0] as $key => $val) {
$val = $_GET["columns"][key($select)];
$field = $fields[$select ? $val["col"] : $key];
$name = ($field ? $adminer->fieldName($field, $order) : "*");
if ($name != "") {
$order++;
$names[$key] = $name;
echo '<th><a href="' . h(remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"][0] == $key && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . apply_sql_function($val["fun"], $name) . "</a>"; //! columns looking like functions
if ($table_status["Oid"] != "t" || $key != "oid") {
$val = $_GET["columns"][key($select)];
$field = $fields[$select ? $val["col"] : $key];
$name = ($field ? $adminer->fieldName($field, $rank) : "*");
if ($name != "") {
$rank++;
$names[$key] = $name;
$column = idf_escape($key);
echo '<th><a href="' . h(remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key) . ($order[0] == $column || $order[0] == $key || (!$order && $group[0] == $column) ? '&desc%5B0%5D=1' : '')) . '">' . apply_sql_function($val["fun"], $name) . "</a>"; // $order[0] == $key - COUNT(*) //! columns looking like functions
}
$functions[$key] = $val["fun"];
next($select);
}
$functions[$key] = $val["fun"];
next($select);
}
$lengths = array();
if ($_GET["modify"]) {
@@ -289,22 +296,25 @@ if (!$columns) {
if (ereg('blob|bytea|raw|file', $field["type"]) && $val != "") {
$link = h(ME . 'download=' . urlencode($TABLE) . '&field=' . urlencode($key) . $unique_idf);
}
if ($val == "") {
if ($val === "") { // === - may be int
$val = "&nbsp;";
} elseif ($text_length != "" && ereg('text|blob', $field["type"]) && is_utf8($val)) {
$val = shorten_utf8($val, max(0, intval($text_length))); // usage of LEFT() would reduce traffic but complicate query - expected average speedup: .001 s VS .01 s on local network
$val = shorten_utf8($val, max(0, +$text_length)); // usage of LEFT() would reduce traffic but complicate query - expected average speedup: .001 s VS .01 s on local network
} else {
$val = h($val);
}
if (!$link) { // link related items
foreach ((array) $foreign_keys[$key] as $foreign_key) {
if (count($foreign_keys[$key]) == 1 || count($foreign_key["source"]) == 1) {
if (count($foreign_keys[$key]) == 1 || end($foreign_key["source"]) == $key) {
$link = "";
foreach ($foreign_key["source"] as $i => $source) {
$link .= where_link($i, $foreign_key["target"][$i], $rows[$n][$source]);
}
$link = h(($foreign_key["db"] != "" ? preg_replace('~([?&]db=)[^&]+~', '\\1' . urlencode($foreign_key["db"]), ME) : ME) . 'select=' . urlencode($foreign_key["table"]) . $link); // InnoDB supports non-UNIQUE keys
break;
if (count($foreign_key["source"]) == 1) {
break;
}
}
}
}
@@ -317,7 +327,7 @@ if (!$columns) {
}
}
foreach ($unique_array as $k => $v) {
$link .= h(where_link($i++, $k, $v, (isset($v) ? "=" : "IS NULL")));
$link .= h(where_link($i++, $k, $v));
}
}
}
@@ -336,14 +346,17 @@ if (!$columns) {
$value = $_POST["val"][$unique_idf][bracket_escape($key)];
$h_value = h(isset($value) ? $value : $row[$key]);
$long = strpos($val, "<i>...</i>");
$editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key];
$editable = is_utf8($val) && $rows[$n][$key] == $row[$key] && !$functions[$key];
$text = ereg('text|lob', $field["type"]);
echo (($_GET["modify"] && $editable) || isset($value)
? "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "' onkeydown='return textareaKeydown(this, event);'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>")
: "<td id='$id' ondblclick=\"" . ($editable ? "selectDblClick(this, event" . ($text ? ", 1" : "") . ")" : "alert('" . h($long ? lang('Increase Text length to modify this value.') : lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
? "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "' onkeypress='return textareaKeypress(this, event);'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>")
: "<td id='$id' ondblclick=\"" . ($editable ? "selectDblClick(this, event" . ($long ? ", 2" : ($text ? ", 1" : "")) . ")" : "alert('" . h(lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
);
}
}
if ($backward_keys) {
echo "<td>";
}
$adminer->backwardKeysPrint($backward_keys, $rows[$n]);
echo "</tr>\n"; // close to allow white-space: pre
}
@@ -354,7 +367,7 @@ if (!$columns) {
if ($rows || $page) {
$exact_count = true;
if ($_GET["page"] != "last" && intval($limit) && count($group) >= count($select) && ($found_rows >= $limit || $page)) {
if ($_GET["page"] != "last" && +$limit && count($group) >= count($select) && ($found_rows >= $limit || $page)) {
$found_rows = $table_status["Rows"];
if (!isset($found_rows) || $where || 2 * $page * $limit > $found_rows || ($table_status["Engine"] == "InnoDB" && $found_rows < 1e4)) {
// slow with big tables
@@ -366,10 +379,11 @@ if (!$columns) {
}
}
echo "<p class='pages'>";
if (intval($limit) && $found_rows > $limit) {
if (+$limit && $found_rows > $limit) {
// display first, previous 4, next 4 and last page
$max_page = floor(($found_rows - 1) / $limit);
echo '<a href="' . h(remove_from_uri("page")) . "\" onclick=\"var page = +prompt('" . lang('Page') . "', '" . ($page + 1) . "'); if (!isNaN(page) &amp;&amp; page) location.href = this.href + (page != 1 ? '&amp;page=' + (page - 1) : ''); return false;\">" . lang('Page') . "</a>:" . pagination(0, $page) . ($page > 5 ? " ..." : "");
echo '<a href="' . h(remove_from_uri("page")) . "\" onclick=\"pageClick(this.href, +prompt('" . lang('Page') . "', '" . ($page + 1) . "'), event); return false;\">" . lang('Page') . "</a>:";
echo pagination(0, $page) . ($page > 5 ? " ..." : "");
for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) {
echo pagination($i, $page);
}
@@ -380,7 +394,7 @@ if (!$columns) {
if (!information_schema(DB)) {
?>
<fieldset><legend><?php echo lang('Edit'); ?></legend><div>
<input type="submit" value="<?php echo lang('Save'); ?>" title="<?php echo lang('Double click on a value to modify it.'); ?>">
<input type="submit" id="save" value="<?php echo lang('Save'); ?>" title="<?php echo lang('Double click on a value to modify it.'); ?>">
<input type="submit" name="edit" value="<?php echo lang('Edit'); ?>">
<input type="submit" name="clone" value="<?php echo lang('Clone'); ?>">
<input type="submit" name="delete" value="<?php echo lang('Delete'); ?>" onclick="return confirm('<?php echo lang('Are you sure?'); ?> (' + (this.form['all'].checked ? <?php echo $found_rows; ?> : formChecked(this, /check/)) + ')');">
@@ -388,13 +402,15 @@ if (!$columns) {
<?php
}
print_fieldset("export", lang('Export'));
echo $adminer->dumpOutput(1, $adminer_export["output"]) . " " . $adminer->dumpFormat(1, $adminer_export["format"]); // 1 - select
echo " <input type='submit' name='export' value='" . lang('Export') . "'>\n";
$output = $adminer->dumpOutput();
echo ($output ? html_select("output", $output, $adminer_export["output"]) . " " : "");
echo html_select("format", $adminer->dumpFormat(), $adminer_export["format"]);
echo " <input type='submit' name='export' value='" . lang('Export') . "' onclick='eventStop(event);'>\n";
echo "</div></fieldset>\n";
}
print_fieldset("import", lang('CSV Import'), !$rows);
print_fieldset("import", lang('Import'), !$rows);
echo "<input type='hidden' name='token' value='$token'><input type='file' name='csv_file'> ";
echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;"), $adminer_export["format"], 1); // 1 - select
echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;", "tsv" => "TSV"), $adminer_export["format"], 1); // 1 - select
echo " <input type='submit' name='import' value='" . lang('Import') . "'>\n";
echo "</div></fieldset>\n";

View File

@@ -28,7 +28,7 @@ if ($_POST) {
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php
if ($SEQUENCE != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n";
}
?>
</form>

View File

@@ -1,4 +1,11 @@
<?php
if (!$error && $_POST["export"]) {
dump_headers("sql");
$adminer->dumpTable("", "");
$adminer->dumpData("", "table", $_POST["query"]);
exit;
}
restart_session();
$history_all = &get_session("queries");
$history = &$history_all[DB];
@@ -18,7 +25,7 @@ if (!$error && $_POST) {
: "compress.bzip2://adminer.sql.bz2"
)), "rb");
$query = ($fp ? fread($fp, 1e6) : false);
} elseif ($_FILES["sql_file"]["error"] != 4) { // 4 - UPLOAD_ERR_NO_FILE
} elseif ($_FILES && $_FILES["sql_file"]["error"] != 4) { // 4 - UPLOAD_ERR_NO_FILE
$query = get_file("sql_file", true);
}
if (is_string($query)) { // get_file() returns error as number, fread() as false
@@ -40,13 +47,18 @@ if (!$error && $_POST) {
$connection2->select_db(DB);
}
$commands = 0;
$errors = "";
$errors = array();
$parse = '[\'`"]' . ($jush == "pgsql" ? '|\\$[^$]*\\$' : ($jush == "mssql" || $jush == "sqlite" ? '|\\[' : '')) . '|/\\*|-- |#'; //! ` and # not everywhere
$total_start = explode(" ", microtime());
parse_str($_COOKIE["adminer_export"], $adminer_export);
$dump_format = $adminer->dumpFormat();
unset($dump_format["sql"]);
while ($query != "") {
if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
if (!$offset && $jush == "sql" && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
$delimiter = $match[1];
$query = substr($query, strlen($match[0]));
} else {
preg_match('(' . preg_quote($delimiter) . '|[\'`"]|/\\*|-- |#|$)', $query, $match, PREG_OFFSET_CAPTURE, $offset); // should always match
preg_match('(' . preg_quote($delimiter) . "|$parse|\$)", $query, $match, PREG_OFFSET_CAPTURE, $offset); // should always match
$found = $match[0][0];
$offset = $match[0][1] + strlen($found);
if (!$found && $fp && !feof($fp)) {
@@ -55,54 +67,8 @@ if (!$error && $_POST) {
if (!$found && rtrim($query) == "") {
break;
}
if (!$found || $found == $delimiter) { // end of a query
$empty = false;
$q = substr($query, 0, $match[0][1]);
$commands++;
echo "<pre class='jush-$jush' id='sql-$commands'>" . shorten_utf8(trim($q), 1000) . "</pre>\n";
ob_flush();
flush(); // can take a long time - show the running query
$start = explode(" ", microtime()); // microtime(true) is available since PHP 5
//! don't allow changing of character_set_results, convert encoding of displayed query
if (!$connection->multi_query($q)) {
echo "<p class='error'>" . lang('Error in query') . ": " . error() . "\n";
$errors .= " <a href='#sql-$commands'>$commands</a>";
if ($_POST["error_stops"]) {
break;
}
} else {
if (is_object($connection2) && preg_match("~^$space*(USE)\\b~isU", $q)) {
$connection2->query($q);
}
do {
$result = $connection->store_result();
$end = explode(" ", microtime());
$time = " <span class='time'>(" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . ")</span>";
if (is_object($result)) {
select($result, $connection2);
echo "<p>" . ($result->num_rows ? lang('%d row(s)', $result->num_rows) : "") . $time;
if ($connection2 && preg_match("~^($space|\\()*SELECT\\b~isU", $q)) {
$id = "explain-$commands";
echo ", <a href='#$id' onclick=\"return !toggle('$id');\">EXPLAIN</a>\n";
echo "<div id='$id' class='hidden'>\n";
select(explain($connection2, $q));
echo "</div>\n";
}
} else {
if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) {
restart_session();
set_session("dbs", null); // clear cache
session_write_close();
}
echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n";
}
$start = $end;
} while ($connection->next_result());
}
$query = substr($query, $offset);
$offset = 0;
} else { // find matching quote or comment end
while (preg_match('~' . ($found == '/*' ? '\\*/' : (ereg('-- |#', $found) ? "\n" : "$found|\\\\.")) . '|$~s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES
if ($found && $found != $delimiter) { // find matching quote or comment end
while (preg_match('(' . ($found == '/*' ? '\\*/' : ($found == '[' ? ']' : (ereg('^-- |^#', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES
$s = $match[0][0];
$offset = $match[0][1] + strlen($s);
if (!$s && $fp && !feof($fp)) {
@@ -111,15 +77,84 @@ if (!$error && $_POST) {
break;
}
}
} else { // end of a query
$empty = false;
$q = substr($query, 0, $match[0][1]);
$commands++;
$print = "<pre id='sql-$commands'><code class='jush-$jush'>" . shorten_utf8(trim($q), 1000) . "</code></pre>\n";
if (!$_POST["only_errors"]) {
echo $print;
ob_flush();
flush(); // can take a long time - show the running query
}
$start = explode(" ", microtime()); // microtime(true) is available since PHP 5
//! don't allow changing of character_set_results, convert encoding of displayed query
if ($connection->multi_query($q)) {
if (is_object($connection2) && preg_match("~^$space*(USE)\\b~isU", $q)) {
$connection2->query($q);
}
do {
$result = $connection->store_result();
$end = explode(" ", microtime());
$time = format_time($start, $end) . (strlen($q) < 1000 ? " <a href='" . h(ME) . "sql=" . urlencode(trim($q)) . "'>" . lang('Edit') . "</a>" : ""); // 1000 - maximum length of encoded URL in IE is 2083 characters
if (!is_object($result)) {
if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) {
restart_session();
set_session("dbs", null); // clear cache
session_write_close();
}
if (!$_POST["only_errors"]) {
echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n";
}
} else {
if ($_POST["only_errors"]) {
echo $print;
$print = "";
}
select($result, $connection2);
echo "<form action='' method='post'>\n";
echo "<p>" . ($result->num_rows ? lang('%d row(s)', $result->num_rows) : "") . $time;
$id = "export-$commands";
$export = ", <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('Export') . "</a><span id='$id' class='hidden'>: "
. html_select("output", $adminer->dumpOutput(), $adminer_export["output"]) . " "
. html_select("format", $dump_format, $adminer_export["format"])
. " <input type='hidden' name='query' value='" . h($q) . "' />"
. " <input type='hidden' name='token' value='$token' />"
. " <input type='submit' name='export' value='" . lang('Export') . "' onclick='eventStop(event);'></span>"
;
if ($connection2 && preg_match("~^($space|\\()*SELECT\\b~isU", $q) && ($explain = explain($connection2, $q))) {
$id = "explain-$commands";
echo ", <a href='#$id' onclick=\"return !toggle('$id');\">EXPLAIN</a>$export\n";
echo "<div id='$id' class='hidden'>\n";
select($explain, $connection2, ($jush == "sql" ? "http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/explain-output.html#" : ""));
echo "</div>\n";
} else {
echo "$export\n";
}
echo "</form>\n";
}
$start = $end;
} while ($connection->next_result());
} elseif ($connection->error) {
echo ($_POST["only_errors"] ? $print : "");
echo "<p class='error'>" . lang('Error in query') . ": " . error() . "\n";
$errors[] = " <a href='#sql-$commands'>$commands</a>";
if ($_POST["error_stops"]) {
break;
}
}
$query = substr($query, $offset);
$offset = 0;
}
}
}
}
if ($errors && $commands > 1) {
echo "<p class='error'>" . lang('Error in query') . ": $errors\n";
}
if ($empty) {
echo "<p class='message'>" . lang('No commands to execute.') . "\n";
} elseif ($_POST["only_errors"]) {
echo "<p class='message'>" . lang('%d query(s) executed OK.', $commands - count($errors)) . format_time($total_start, explode(" ", microtime())) . "\n";
} elseif ($errors && $commands > 1) {
echo "<p class='error'>" . lang('Error in query') . ": " . implode("", $errors) . "\n";
}
//! MS SQL - SET SHOWPLAN_ALL OFF
} else {
@@ -133,19 +168,22 @@ if (!$error && $_POST) {
$q = $_GET["sql"]; // overwrite $q from if ($_POST) to save memory
if ($_POST) {
$q = $_POST["query"];
} elseif ($_GET["history"] == "all") {
$q = $history;
} elseif ($_GET["history"] != "") {
$q = $history[$_GET["history"]];
}
textarea("query", $q, 20);
echo ($_POST ? "" : "<script type='text/javascript'>document.getElementsByTagName('textarea')[0].focus();</script>\n");
echo "<p>" . (ini_bool("file_uploads") ? lang('File upload') . ': <input type="file" name="sql_file">' : lang('File uploads are disabled.'));
echo "<p>" . (ini_bool("file_uploads") ? lang('File upload') . ': <input type="file" name="sql_file"> (&lt; ' . ini_get("upload_max_filesize") . 'B)' : lang('File uploads are disabled.')); // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
?>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Execute'); ?>" title="Ctrl+Enter">
<?php
echo checkbox("error_stops", 1, $_POST["error_stops"], lang('Stop on error'));
echo checkbox("error_stops", 1, $_POST["error_stops"], lang('Stop on error')) . "\n";
echo checkbox("only_errors", 1, $_POST["only_errors"], lang('Show only errors')) . "\n";
print_fieldset("webfile", lang('From server'), $_POST["webfile"]);
$compress = array();
@@ -165,6 +203,7 @@ if ($history) {
echo '<a href="' . h(ME . "sql=&history=$key") . '">' . lang('Edit') . "</a> <code class='jush-$jush'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $val)))), 80, "</code>") . "<br>\n";
}
echo "<input type='submit' name='clear' value='" . lang('Clear') . "'>\n";
echo "<a href='" . h(ME . "sql=&history=all") . "'>" . lang('Edit') . "</a>\n";
echo "</div></fieldset>\n";
}
?>

View File

@@ -1,3 +1,4 @@
/** @author Ondrej Valka, http://valka.info */
body { color: #000; background: #fff; font: 90%/1.25 Verdana, Arial, Helvetica, sans-serif; margin: 0; }
a { color: blue; }
a:visited { color: navy; }
@@ -36,6 +37,8 @@ pre { margin: 1em 0 0; }
.number { text-align: right; }
.datetime { text-align: right; }
.type { width: 15ex; width: auto\9; }
.options select { width: 20ex; width: auto\9; }
.active { font-weight: bold; }
#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; overflow: auto; overflow-y: hidden; white-space: nowrap; }
#menu p { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; }
#content { margin: 2em 0 0 21em; padding: 10px 20px 20px 0; }
@@ -47,8 +50,15 @@ pre { margin: 1em 0 0; }
#schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; }
#schema .references { position: absolute; }
.rtl h2 { margin: 0 -18px 20px 0; }
.rtl p, .rtl table, .rtl .error, .rtl .message { margin: 1em 0 0 20px; }
.rtl #content { margin: 2em 21em 0 0; padding: 10px 0 20px 20px; }
.rtl #breadcrumb { left: auto; right: 21em; margin: 0 -18px 0 0; }
.rtl #lang, .rtl #menu { left: auto; right: 0; }
@media print {
#lang, #menu { display: none; }
#content { margin-left: 1em; }
#breadcrumb { left: 1em; }
.nowrap td, .nowrap th, td.nowrap { white-space: normal; }
}

View File

@@ -2,15 +2,14 @@
/** Load syntax highlighting
* @param string first three characters of database system version
* @param string 'http' or 'https' - used after compilation
*/
function bodyLoad(version, protocol) {
function bodyLoad(version) {
var jushRoot = '../externals/jush/';
var script = document.createElement('script');
script.src = jushRoot + 'jush.js';
script.onload = function () {
if (window.jush) { // IE runs in case of an error too
jush.create_links = ' target="_blank"';
jush.create_links = ' target="_blank" rel="noreferrer"';
jush.urls.sql[0] = 'http://dev.mysql.com/doc/refman/' + version + '/en/$key';
jush.urls.sql_sqlset = jush.urls.sql[0];
jush.urls.sqlset[0] = jush.urls.sql[0];
@@ -22,8 +21,7 @@ function bodyLoad(version, protocol) {
if (window.jushLinks) {
jush.custom_links = jushLinks;
}
jush.highlight_tag('pre', 0);
jush.highlight_tag('code');
jush.highlight_tag('code', 0);
}
};
script.onreadystatechange = function () {
@@ -34,21 +32,13 @@ function bodyLoad(version, protocol) {
document.body.appendChild(script);
}
/** Get value of select
* @param HTMLSelectElement
* @return string
*/
function selectValue(select) {
return select.value || select.options[select.selectedIndex].text;
}
/** Get value of dynamically created form field
* @param HTMLFormElement
* @param string
* @return HTMLElement
*/
function formField(form, name) {
// required in old IE, maybe can be rewritten as form.elements[name]
// required in IE < 8, form.elements[name] doesn't work
for (var i=0; i < form.length; i++) {
if (form[i].name == name) {
return form[i];
@@ -67,6 +57,13 @@ function typePassword(el, disable) {
}
}
function loginDriver(driver) {
var trs = driver.parentNode.parentNode.parentNode.rows;
for (var i=1; i < trs.length; i++) {
trs[i].className = (/sqlite/.test(driver.value) ? 'hidden' : '');
}
}
var added = '.', rowCount;
@@ -139,7 +136,7 @@ function editingAddRow(button, allowed, focus) {
if (allowed && rowCount >= allowed) {
return false;
}
var match = /([0-9]+)(\.[0-9]+)?/.exec(button.name);
var match = /(\d+)(\.\d+)?/.exec(button.name);
var x = match[0] + (match[2] ? added.substr(match[2].length) : added) + '1';
var row = button.parentNode.parentNode;
var row2 = row.cloneNode(true);
@@ -285,6 +282,7 @@ function partitionNameChange(el) {
* @param HTMLSelectElement
*/
function foreignAddRow(field) {
field.onchange = function () { };
var row = field.parentNode.parentNode.cloneNode(true);
var selects = row.getElementsByTagName('select');
for (var i=0; i < selects.length; i++) {
@@ -292,7 +290,6 @@ function foreignAddRow(field) {
selects[i].selectedIndex = 0;
}
field.parentNode.parentNode.parentNode.appendChild(row);
field.onchange = function () { };
}
@@ -301,6 +298,7 @@ function foreignAddRow(field) {
* @param HTMLSelectElement
*/
function indexesAddRow(field) {
field.onchange = function () { };
var row = field.parentNode.parentNode.cloneNode(true);
var spans = row.getElementsByTagName('span');
for (var i=0; i < spans.length - 1; i++) {
@@ -308,29 +306,32 @@ function indexesAddRow(field) {
}
var selects = row.getElementsByTagName('select');
for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/indexes\[[0-9]+/, '$&1');
selects[i].name = selects[i].name.replace(/indexes\[\d+/, '$&1');
selects[i].selectedIndex = 0;
}
var input = row.getElementsByTagName('input')[0];
input.name = input.name.replace(/indexes\[[0-9]+/, '$&1');
input.name = input.name.replace(/indexes\[\d+/, '$&1');
input.value = '';
field.parentNode.parentNode.parentNode.appendChild(row);
field.onchange = function () { };
}
/** Add column for index
* @param HTMLSelectElement
*/
function indexesAddColumn(field) {
field.onchange = function () { };
var column = field.parentNode.cloneNode(true);
var select = column.getElementsByTagName('select')[0];
select.name = select.name.replace(/\]\[[0-9]+/, '$&1');
select.name = select.name.replace(/\]\[\d+/, '$&1');
select.selectedIndex = 0;
var input = column.getElementsByTagName('input')[0];
input.name = input.name.replace(/\]\[[0-9]+/, '$&1');
input.name = input.name.replace(/\]\[\d+/, '$&1');
input.value = '';
field.parentNode.parentNode.appendChild(column);
field.onchange = function () { };
select = field.form[field.name.replace(/\].*/, '][type]')];
if (!select.selectedIndex) {
select.selectedIndex = 3;
}
}
@@ -374,7 +375,7 @@ function schemaMousemove(ev) {
isTop = (div2.offsetTop + ref[0] * em > divs[i].offsetTop + top * em);
}
if (!lineSet[id]) {
var line = document.getElementById(divs[i].id.replace(/^....(.+)-[0-9]+$/, 'refl$1'));
var line = document.getElementById(divs[i].id.replace(/^....(.+)-\d+$/, 'refl$1'));
var shift = ev.clientY - y - that.offsetTop;
line.style.left = (left + left1) + 'em';
if (isTop) {
@@ -395,8 +396,9 @@ function schemaMousemove(ev) {
/** Finish move
* @param MouseEvent
* @param string
*/
function schemaMouseup(ev) {
function schemaMouseup(ev, db) {
if (that !== undefined) {
ev = ev || event;
tablePos[that.firstChild.firstChild.firstChild.data] = [ (ev.clientY - y) / em, (ev.clientX - x) / em ];
@@ -405,6 +407,9 @@ function schemaMouseup(ev) {
for (var key in tablePos) {
s += '_' + key + ':' + Math.round(tablePos[key][0] * 10000) / 10000 + 'x' + Math.round(tablePos[key][1] * 10000) / 10000;
}
cookie('adminer_schema=' + encodeURIComponent(s.substr(1)), 30, '; path="' + location.pathname + location.search + '"');
s = encodeURIComponent(s.substr(1));
var link = document.getElementById('schema-link');
link.href = link.href.replace(/[^=]+$/, '') + s;
cookie('adminer_schema-' + db + '=' + s, 30); //! special chars in db
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

View File

@@ -1,5 +1,5 @@
// to hide elements displayed by JavaScript
document.body.className = 'js';
document.body.className += ' js';
/** Toggle visibility
* @param string
@@ -16,22 +16,29 @@ function toggle(id) {
* @param number
* @param string optional
*/
function cookie(assign, days, params) {
function cookie(assign, days) {
var date = new Date();
date.setDate(date.getDate() + days);
document.cookie = assign + '; expires=' + date + (params || '');
document.cookie = assign + '; expires=' + date;
}
/** Verify current Adminer version
* @param string 'http' or 'https'
*/
function verifyVersion(protocol) {
function verifyVersion() {
cookie('adminer_version=0', 1);
var script = document.createElement('script');
script.src = protocol + '://www.adminer.org/version.php';
script.src = location.protocol + '//www.adminer.org/version.php';
document.body.appendChild(script);
}
/** Get value of select
* @param HTMLSelectElement
* @return string
*/
function selectValue(select) {
return (select.value !== undefined ? select.value : select.options[select.selectedIndex].text);
}
/** Check all elements matching given name
* @param HTMLInputElement
* @param RegExp
@@ -94,7 +101,33 @@ function setHtml(id, html) {
if (html == undefined) {
el.parentNode.innerHTML = '&nbsp;';
} else {
el.innerHTML = html;
el.innerHTML = html.replace(/<noscript>.*<\/noscript>/i, ''); // required for Google Chrome // hopes that there will be only one <noscript> on each line
}
}
}
/** Find node position
* @param Node
* @return number
*/
function nodePosition(el) {
var pos = 0;
while (el = el.previousSibling) {
pos++;
}
return pos;
}
/** Go to the specified page
* @param string
* @param string
* @param [MouseEvent]
*/
function pageClick(href, page, event) {
if (!isNaN(page) && page) {
href += (page != 1 ? '&page=' + (page - 1) : '');
if (!ajaxMain(href, '', event)) {
location.href = href;
}
}
}
@@ -105,20 +138,20 @@ function setHtml(id, html) {
* @param HTMLSelectElement
*/
function selectAddRow(field) {
field.onchange = function () { };
var row = field.parentNode.cloneNode(true);
var selects = row.getElementsByTagName('select');
for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/[a-z]\[[0-9]+/, '$&1');
selects[i].name = selects[i].name.replace(/[a-z]\[\d+/, '$&1');
selects[i].selectedIndex = 0;
}
var inputs = row.getElementsByTagName('input');
if (inputs.length) {
inputs[0].name = inputs[0].name.replace(/[a-z]\[[0-9]+/, '$&1');
inputs[0].name = inputs[0].name.replace(/[a-z]\[\d+/, '$&1');
inputs[0].value = '';
inputs[0].className = '';
}
field.parentNode.parentNode.appendChild(row);
field.onchange = function () { };
}
@@ -130,7 +163,7 @@ function selectAddRow(field) {
* @param HTMLInputElement submit button
* @return boolean
*/
function textareaKeydown(target, event, tab, button) {
function textareaKeypress(target, event, tab, button) {
if (tab && event.keyCode == 9 && !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) {
// inspired by http://pallieter.org/Projects/insertTab/
if (target.setSelectionRange) {
@@ -144,26 +177,198 @@ function textareaKeydown(target, event, tab, button) {
}
}
if (event.ctrlKey && (event.keyCode == 13 || event.keyCode == 10) && !event.altKey && !event.metaKey) { // shiftKey allowed
target.blur();
if (button) {
button.click();
} else {
} else if (!target.form.onsubmit || target.form.onsubmit() !== false) {
target.form.submit();
}
}
return true;
}
/** Change focus by Ctrl+Up or Ctrl+Down
* @param KeyboardEvent
* @return boolean
*/
function editingKeydown(event) {
if ((event.keyCode == 40 || event.keyCode == 38) && event.ctrlKey && !event.altKey && !event.metaKey) { // shiftKey allowed
var target = event.target || event.srcElement;
var sibling = (event.keyCode == 40 ? 'nextSibling' : 'previousSibling');
var el = target.parentNode.parentNode[sibling];
if (el && (/^tr$/i.test(el.tagName) || (el = el[sibling])) && /^tr$/i.test(el.tagName) && (el = el.childNodes[nodePosition(target.parentNode)]) && (el = el.childNodes[nodePosition(target)])) {
el.focus();
}
return false;
}
return true;
}
/** Create AJAX request
* @param string
* @param function (text)
* @param [string]
* @return XMLHttpRequest or false in case of an error
*/
function ajax(url, callback, data) {
var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false));
if (xmlhttp) {
xmlhttp.open((data ? 'POST' : 'GET'), url);
if (data) {
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
}
xmlhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
var redirect = xmlhttp.getResponseHeader('X-AJAX-Redirect');
if (redirect) {
if (history.replaceState) {
history.replaceState(null, '', redirect);
}
return ajaxSend(redirect);
}
var title = xmlhttp.getResponseHeader('X-AJAX-Title');
if (title) {
document.title = decodeURIComponent(title);
}
callback(xmlhttp.responseText);
}
};
xmlhttp.send(data);
}
return xmlhttp;
}
/** Use setHtml(key, value) for JSON response
* @param string
* @return XMLHttpRequest or false in case of an error
*/
function ajaxSetHtml(url) {
return ajax(url, function (text) {
var data = eval('(' + text + ')');
for (var key in data) {
setHtml(key, data[key]);
}
});
}
var ajaxState = 0, ajaxTimeout;
/** Safely load content to #content
* @param string
* @param [string]
* @return XMLHttpRequest or false in case of an error
*/
function ajaxSend(url, data) {
var currentState = ++ajaxState;
clearTimeout(ajaxTimeout);
ajaxTimeout = setTimeout(function () {
scrollTo(0, 0);
setHtml('content', '<img src="../adminer/static/loader.gif" alt="">');
}, 500); // defer displaying loader
return ajax(url, function (text) {
if (currentState == ajaxState) {
clearTimeout(ajaxTimeout);
scrollTo(0, 0);
setHtml('content', text);
var content = document.getElementById('content');
var scripts = content.getElementsByTagName('script');
var length = scripts.length; // required to avoid infinite loop
for (var i=0; i < length; i++) {
var script = document.createElement('script');
script.text = scripts[i].text;
content.appendChild(script);
}
var as = document.getElementById('menu').getElementsByTagName('a');
var href = location.href.replace(/(&(sql=|dump=|(select|table)=[^&]*)).*/, '$1');
for (var i=0; i < as.length; i++) {
if (href == as[i].href) {
as[i].className = 'active';
} else if (as[i].className == 'active') {
as[i].className = '';
}
}
var dump = document.getElementById('dump');
if (dump) {
var match = /&(select|table)=([^&]+)/.exec(href);
dump.href = dump.href.replace(/[^=]+$/, '') + (match ? match[2] : '');
}
//! modify Change database hidden fields
if (window.jush) {
jush.highlight_tag('code', 0);
}
}
}, data);
}
/** Load content to #content
* @param string
* @param [string]
* @param [MouseEvent]
* @return XMLHttpRequest or false in case of an error
*/
function ajaxMain(url, data, event) {
if (!history.pushState || (event && (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey))) {
return false;
}
history.pushState(data, '', url);
return ajaxSend(url, data);
}
/** Revive page from history
* @param PopStateEvent
*/
window.onpopstate = function (event) {
if (ajaxState || event.state) {
ajaxSend(location.href, event.state);
}
}
/** Send form by AJAX GET
* @param HTMLFormElement
* @param [string]
* @return XMLHttpRequest or false in case of an error
*/
function ajaxForm(form, data) {
var params = [ ];
for (var i=0; i < form.elements.length; i++) {
var el = form.elements[i];
if (/file/i.test(el.type) && el.value) {
return false;
} else if (el.name && (!/checkbox|radio|submit|file/i.test(el.type) || el.checked)) {
params.push(encodeURIComponent(el.name) + '=' + encodeURIComponent(/select/i.test(el.tagName) ? selectValue(el) : el.value));
}
}
if (data) {
params.push(data);
}
if (form.method == 'post') {
return ajaxMain((/\?/.test(form.action) ? form.action : location.href), params.join('&')); // ? - always part of Adminer URL
}
return ajaxMain((form.action || location.pathname) + '?' + params.join('&'));
}
/** Display edit field
* @param HTMLElement
* @param MouseEvent
* @param boolean display textarea instead of input
* @param number display textarea instead of input, 2 - load long text
*/
function selectDblClick(td, event, text) {
td.ondblclick = function () { };
var pos = event.rangeOffset;
var value = (td.firstChild.firstChild ? td.firstChild.firstChild.data : (td.firstChild.alt ? td.firstChild.alt : td.firstChild.data));
var value = (td.firstChild.alt ? td.firstChild.alt : (td.textContent ? td.textContent : td.innerText));
if (value == '\u00A0' || td.getElementsByTagName('i').length) { // &nbsp; or i - NULL
value = '';
}
var input = document.createElement(text ? 'textarea' : 'input');
input.name = td.id;
input.value = (value == '\u00A0' || td.getElementsByTagName('i').length ? '' : value); // &nbsp; or i - NULL
input.style.width = Math.max(td.clientWidth - 14, 20) + 'px'; // 14 = 2 * (td.border + td.padding + input.border)
if (text) {
var rows = 1;
@@ -171,13 +376,13 @@ function selectDblClick(td, event, text) {
rows++;
});
input.rows = rows;
input.onkeydown = function (event) {
return textareaKeydown(input, event || window.event);
input.onkeypress = function (event) {
return textareaKeypress(input, event || window.event, false, document.getElementById('save'));
};
}
if (document.selection) {
var range = document.selection.createRange();
range.moveToPoint(event.x, event.y);
range.moveToPoint(event.clientX, event.clientY);
var range2 = range.duplicate();
range2.moveToElementText(td);
range2.setEndPoint('EndToEnd', range);
@@ -186,12 +391,60 @@ function selectDblClick(td, event, text) {
td.innerHTML = '';
td.appendChild(input);
input.focus();
if (text == 2) { // long text
return ajax(location.href + '&' + encodeURIComponent(td.id) + '=', function (text) {
input.value = text;
input.name = td.id;
});
}
input.value = value;
input.name = td.id;
input.selectionStart = pos;
input.selectionEnd = pos;
if (document.selection) {
var range = document.selection.createRange();
range.moveStart('character', pos);
range.moveEnd('character', -input.value.length + pos);
range.select();
}
td.ondblclick = function () { };
}
/** Load link by AJAX
* @param MouseEvent
* @param string
* @param string
* @return bool
*/
function bodyClick(event, db, ns) {
if (event.button) {
return;
}
if (event.getPreventDefault ? event.getPreventDefault() : event.returnValue === false) {
return false;
}
var el = event.target || event.srcElement;
if (/^a$/i.test(el.parentNode.tagName)) {
el = el.parentNode;
}
if (/^a$/i.test(el.tagName) && !/^https?:|#|&download=/i.test(el.getAttribute('href')) && /[&?]username=/.exec(el.href)) {
var match = /&db=([^&]*)/.exec(el.href);
var match2 = /&ns=([^&]*)/.exec(el.href);
return !(db == (match ? match[1] : '') && ns == (match2 ? match2[1] : '') && ajaxMain(el.href, '', event));
}
if (/^input$/i.test(el.tagName) && (el.type == 'image' || (el.type == 'submit' && !/&(database|scheme|create|view|sql|user|dump|call)=/.test(location.href)))) {
return !ajaxForm(el.form, (el.name ? encodeURIComponent(el.name) + (el.type == 'image' ? '.x' : '') + '=1' : ''));
}
return true;
}
/** Stop event propagation
* @param Event
*/
function eventStop(event) {
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
}

BIN
adminer/static/loader.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

View File

@@ -30,7 +30,7 @@ if ($_POST) {
<form action="" method="post" id="form">
<table cellspacing="0">
<tr><th><?php echo lang('Time'); ?><td><?php echo html_select("Timing", $trigger_options["Timing"], $row["Timing"], "if (/^" . h(preg_quote($TABLE, "/")) . "_[ba][iud]$/.test(this.form['Trigger'].value)) this.form['Trigger'].value = '" . h(addcslashes($TABLE, "\r\n'\\")) . "_' + selectValue(this).charAt(0).toLowerCase() + selectValue(this.form['Event']).charAt(0).toLowerCase();"); ?>
<tr><th><?php echo lang('Time'); ?><td><?php echo html_select("Timing", $trigger_options["Timing"], $row["Timing"], "if (/^" . h(preg_quote($TABLE, "/")) . "_[ba][iud]$/.test(this.form['Trigger'].value)) this.form['Trigger'].value = '" . h(js_escape($TABLE)) . "_' + selectValue(this).charAt(0).toLowerCase() + selectValue(this.form['Event']).charAt(0).toLowerCase();"); ?>
<tr><th><?php echo lang('Event'); ?><td><?php echo html_select("Event", $trigger_event, $row["Event"], "this.form['Timing'].onchange();"); ?>
<tr><th><?php echo lang('Type'); ?><td><?php echo html_select("Type", $trigger_options["Type"], $row["Type"]); ?>
</table>
@@ -40,5 +40,5 @@ if ($_POST) {
<input type="hidden" name="token" value="<?php echo $token; ?>">
<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1"><?php } ?>
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($_GET["name"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
<?php if ($_GET["name"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
</form>

View File

@@ -23,7 +23,7 @@ if ($_POST) {
<input type="hidden" name="token" value="<?php echo $token; ?>">
<?php
if ($TYPE != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n";
} else {
echo "<input name='name' value='" . h($row['name']) . "'>\n";
textarea("as", $row["as"]);

View File

@@ -127,7 +127,7 @@ if ($_POST) {
<?php
//! MAX_* limits, REQUIRE
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th colspan='2'><a href='http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/grant.html'>" . lang('Privileges') . "</a>";
echo "<thead><tr><th colspan='2'><a href='http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/grant.html#priv_level' target='_blank' rel='noreferrer'>" . lang('Privileges') . "</a>";
$i = 0;
foreach ($grants as $object => $grant) {
echo '<th>' . ($object != "*.*" ? "<input name='objects[$i]' value='" . h($object) . "' size='10'>" : "<input type='hidden' name='objects[$i]' value='*.*' size='10'>*.*"); //! separate db, table, columns, PROCEDURE|FUNCTION, routine
@@ -164,5 +164,5 @@ echo "</table>\n";
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if (isset($_GET["host"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
<?php if (isset($_GET["host"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
</form>

View File

@@ -1,3 +1,43 @@
Adminer 3.2.0 (released 2011-02-24):
Get long texts and slow information by AJAX
Most links and forms by AJAX in browsers with support for history.pushState
Copy tables
Ability to search by expression in select
Export SQL command result (bug #3116854)
Focus first field with insert (bug #3126501)
Permanent link in schema
Display total time in show only errors mode in SQL command
History: edit all
MS SQL: auto primary and foreign key
SQLite: display 0
Create table default data type: int
Focus upper/lower fields by Ctrl+Up/Ctrl+Down
Hide credentials for SQLite
Utilize oids in PostgreSQL
Homepage customization
Use IN for search in numeric fields (Editor)
Use password input for _md5 and _sha1 fields (Editor)
Work without session.use_cookies (bug #3138640)
Fix saving schema to cookie in Opera
Portuguese, Slovenian and Turkish translation
Adminer 3.1.0 (released 2010-11-16):
TSV export and import
Customizable export
Option to show only errors in SQL command
Link to bookmark SQL command
Recognize $$ strings in SQL command (PostgreSQL)
Highlight and edit SQL command in processlist
Always display all drivers
Timestamp at the end of export
Link to refresh database cache (bug #3102451)
Support for virtual foreign keys
Disable XSS "protection" of IE8
Immunity against zend.ze1_compatibility_mode (bug #3089645)
Fix last page with empty result set
Arabic translation and RTL support
Dual licensing: Apache or GPL
Adminer 3.0.1 (released 2010-10-18):
Send the form by Ctrl+Enter in all textareas
Disable creating SQLite databases with extension other than db, sdb, sqlite

View File

@@ -51,29 +51,37 @@ function put_file($match) {
if (basename($match[2]) != "lang.inc.php" || !$_SESSION["lang"]) {
$tokens = token_get_all($return); // to find out the last token
return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? "<?php" : "");
} elseif (preg_match('~\\s*(\\$pos = .*)~', $return, $match2)) {
} elseif (preg_match('~\\s*(\\$pos = .*;)~sU', $return, $match2)) {
// single language lang() is used for plural
return "function lang(\$translation, \$number) {\n\t" . str_replace('$LANG', "'$_SESSION[lang]'", $match2[1]) . "\n\treturn sprintf(\$translation[\$pos], \$number);\n}\n";
return "function get_lang() {
return '$_SESSION[lang]';
}
function lang(\$translation, \$number) {
" . str_replace('$LANG', "'$_SESSION[lang]'", $match2[1]) . '
return sprintf($translation[$pos], $number);
}
';
} else {
echo "lang() not found\n";
}
}
function put_file_lang($match) {
global $lang_ids, $project;
global $lang_ids, $project, $langs;
if ($_SESSION["lang"]) {
return "";
}
$return = "";
foreach (glob(dirname(__FILE__) . "/adminer/lang/*.inc.php") as $filename) {
include $filename; // assign $translations
foreach ($langs as $lang => $val) {
include dirname(__FILE__) . "/adminer/lang/$lang.inc.php"; // assign $translations
$translation_ids = array_flip($lang_ids); // default translation
foreach ($translations as $key => $val) {
if (isset($val)) {
$translation_ids[$lang_ids[$key]] = $val;
}
}
$return .= "\tcase \"" . basename($filename, '.inc.php') . '": $translations = array(';
$return .= "\tcase \"$lang\": \$translations = array(";
foreach ($translation_ids as $val) {
$return .= (is_array($val) ? "array('" . implode("', '", array_map('add_apo_slashes', $val)) . "')" : "'" . add_apo_slashes($val) . "'") . ", ";
}
@@ -165,7 +173,7 @@ function php_shrink($input) {
}
function minify_css($file) {
return preg_replace('~\\s*([:;{},])\\s*~', '\\1', $file);
return preg_replace('~\\s*([:;{},])\\s*~', '\\1', preg_replace('~/\\*.*\\*/~sU', '', $file));
}
function compile_file($match) {
@@ -253,10 +261,11 @@ foreach (array("adminer", "editor") as $project) {
}
$file = str_replace('<script type="text/javascript" src="static/editing.js"></script>' . "\n", "", $file);
$file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\);~", 'compile_file', $file); // integrate static files
$replace = 'h(preg_replace("~\\\\\\\\?.*~", "", $_SERVER["REQUEST_URI"])) . "?file=\\1&amp;version=' . $VERSION;
$replace = 'h(preg_replace("~\\\\\\\\?.*~", "", ME)) . "?file=\\1&amp;version=' . $VERSION;
$file = preg_replace('~\\.\\./adminer/static/(loader\\.gif)~', "'+location.pathname+'?file=\\1&amp;version=$VERSION", $file);
$file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
$file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file);
$file = str_replace("'../externals/jush/'", "protocol + '://www.adminer.org/static/'", $file);
$file = str_replace("'../externals/jush/'", "location.protocol + '//www.adminer.org/static/'", $file);
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
$file = php_shrink($file);

View File

@@ -1,21 +1,23 @@
<?php
page_header(lang('Server'), "", false);
echo "<form action='' method='post'>\n";
echo "<p>" . lang('Search data in tables') . ": <input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' value='" . lang('Search') . "'>\n";
if ($_POST["query"] != "") {
search_tables();
}
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^tables\[/);"><th>' . lang('Table') . '<td>' . lang('Rows') . "</thead>\n";
foreach (table_status() as $table => $row) {
$name = $adminer->tableName($row);
if (isset($row["Engine"]) && $name != "") {
echo '<tr' . odd() . '><td>' . checkbox("tables[]", $table, in_array($table, (array) $_POST["tables"], true), "", "formUncheck('check-all');");
echo '<th><a href="' . h(ME) . 'select=' . urlencode($table) . '">' . h($name) . '</a>';
$val = number_format($row["Rows"], 0, '.', lang(','));
echo "<td align='right'><a href='" . h(ME . "edit=") . urlencode($table) . "'>" . ($row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "</a>";
if ($adminer->homepage()) {
echo "<form action='' method='post'>\n";
echo "<p>" . lang('Search data in tables') . ": <input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' value='" . lang('Search') . "'>\n";
if ($_POST["query"] != "") {
search_tables();
}
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^tables\[/);"><th>' . lang('Table') . '<td>' . lang('Rows') . "</thead>\n";
foreach (table_status() as $table => $row) {
$name = $adminer->tableName($row);
if (isset($row["Engine"]) && $name != "") {
echo '<tr' . odd() . '><td>' . checkbox("tables[]", $table, in_array($table, (array) $_POST["tables"], true), "", "formUncheck('check-all');");
echo '<th><a href="' . h(ME) . 'select=' . urlencode($table) . '">' . h($name) . '</a>';
$val = number_format($row["Rows"], 0, '.', lang(','));
echo "<td align='right'><a href='" . h(ME . "edit=") . urlencode($table) . "'>" . ($row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "</a>";
}
}
echo "</table>\n";
echo "</form>\n";
}
echo "</table>\n";
echo "</form>\n";

View File

@@ -29,8 +29,11 @@ function adminer_object() {
}
function fieldName($field, $order = 0) {
if ($order && ereg('_(md5|sha1)$', $field["field"])) {
return ""; // hide hashes in select
}
// only columns with comments will be displayed and only the first five in select
return ($order <= 5 && !ereg('_(md5|sha1)$', $field["field"]) ? h($field["comment"]) : "");
return ($order <= 5 ? h($field["comment"]) : "");
}
}

View File

@@ -28,6 +28,7 @@ class Adminer {
function headers() {
header("X-Frame-Options: deny");
header("X-XSS-Protection: 0");
}
function loginForm() {
@@ -61,7 +62,11 @@ document.getElementById('username').focus();
if (isset($set)) {
echo '<p class="tabs"><a href="' . h(ME . 'edit=' . urlencode($TABLE) . $set) . '">' . lang('New item') . "</a>\n";
}
echo "<a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Page') . ": " . lang('last') . "'>&gt;&gt;</a>\n";
echo "<a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Last page') . "'>&gt;&gt;</a>\n";
}
function foreignKeys($table) {
return foreign_keys($table);
}
function backwardKeys($table, $tableName) {
@@ -79,7 +84,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
if ($name != "") {
$search = preg_quote($tableName);
$separator = "(:|\\s*-)?\\s+";
$return[$key]["name"] = (preg_match("(^$search$separator(.+)|^(.+?)$separator$search\$)", $name, $match) ? $match[2] . $match[3] : $name);
$return[$key]["name"] = (preg_match("(^$search$separator(.+)|^(.+?)$separator$search\$)iu", $name, $match) ? $match[2] . $match[3] : $name);
} else {
unset($return[$key]);
}
@@ -88,22 +93,19 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
}
function backwardKeysPrint($backwardKeys, $row) {
if ($backwardKeys) {
echo "<td>";
foreach ($backwardKeys as $table => $backwardKey) {
foreach ($backwardKey["keys"] as $cols) {
$link = ME . 'select=' . urlencode($table);
$i = 0;
foreach ($cols as $column => $val) {
$link .= where_link($i++, $column, $row[$val]);
}
echo "<a href='" . h($link) . "'>" . h($backwardKey["name"]) . "</a>";
$link = ME . 'edit=' . urlencode($table);
foreach ($cols as $column => $val) {
$link .= "&set" . urlencode("[" . bracket_escape($column) . "]") . "=" . urlencode($row[$val]);
}
echo "<a href='" . h($link) . "' title='" . lang('New item') . "'>+</a> ";
foreach ($backwardKeys as $table => $backwardKey) {
foreach ($backwardKey["keys"] as $cols) {
$link = ME . 'select=' . urlencode($table);
$i = 0;
foreach ($cols as $column => $val) {
$link .= where_link($i++, $column, $row[$val]);
}
echo "<a href='" . h($link) . "'>" . h($backwardKey["name"]) . "</a>";
$link = ME . 'edit=' . urlencode($table);
foreach ($cols as $column => $val) {
$link .= "&set" . urlencode("[" . bracket_escape($column) . "]") . "=" . urlencode($row[$val]);
}
echo "<a href='" . h($link) . "' title='" . lang('New item') . "'>+</a> ";
}
}
}
@@ -138,7 +140,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
// uses constant number of queries to get the descriptions, join would be complex, multiple queries would be slow
$descriptions = $this->_values[$foreignKey["table"]];
if (!$descriptions) {
$descriptions = get_key_vals("SELECT $id, $name FROM " . idf_escape($foreignKey["table"]) . " WHERE $id IN (" . implode(", ", $ids) . ")");
$descriptions = get_key_vals("SELECT $id, $name FROM " . table($foreignKey["table"]) . " WHERE $id IN (" . implode(", ", $ids) . ")");
}
// use the descriptions
foreach ($rows as $n => $row) {
@@ -162,13 +164,13 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$return = "<img src='$link' alt='$return'>";
}
}
if ($field["full_type"] == "tinyint(1)" && $return != "&nbsp;") { // bool
if (ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) && $return != "&nbsp;") { // bool
$return = '<img src="' . ($val ? "../adminer/static/plus.gif" : "../adminer/static/cross.gif") . '" alt="' . h($val) . '">';
}
if ($link) {
$return = "<a href='$link'>$return</a>";
}
if (!$link && $field["full_type"] != "tinyint(1)" && ereg('int|float|double|decimal', $field["type"])) {
if (!$link && !ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) && ereg('int|float|double|decimal', $field["type"])) {
$return = "<div class='number'>$return</div>"; // Firefox doesn't support <colgroup>
} elseif (ereg('date', $field["type"])) {
$return = "<div class='datetime'>$return</div>";
@@ -178,7 +180,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
function editVal($val, $field) {
if (ereg('date|timestamp', $field["type"]) && isset($val)) {
return preg_replace('~^([0-9]{2}([0-9]+))-(0?([0-9]+))-(0?([0-9]+))~', lang('$1-$3-$5'), $val);
return preg_replace('~^(\\d{2}(\\d+))-(0?(\\d+))-(0?(\\d+))~', lang('$1-$3-$5'), $val);
}
return (ereg("binary", $field["type"]) ? reset(unpack("H*", $val)) : $val);
}
@@ -195,13 +197,14 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$keys[$val["col"]] = $key;
}
$i = 0;
foreach (fields($_GET["select"]) as $name => $field) {
$fields = fields($_GET["select"]);
foreach ($fields as $name => $field) {
if (ereg("enum", $field["type"])) { //! set - uses 1 << $i and FIND_IN_SET()
$desc = $columns[$name];
$key = $keys[$name];
$i--;
echo "<div>" . h($desc) . "<input type='hidden' name='where[$i][col]' value='" . h($name) . "'>:";
enum_input("checkbox", " name='where[$i][val][]'", $field, (array) $where[$key]["val"]); //! impossible to search for NULL
echo enum_input("checkbox", " name='where[$i][val][]'", $field, (array) $where[$key]["val"], ($field["null"] ? 0 : null));
echo "</div>\n";
unset($columns[$name]);
}
@@ -209,6 +212,9 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
foreach ($columns as $name => $desc) {
$options = $this->_foreignKeyOptions($_GET["select"], $name);
if ($options) {
if ($fields[$name]["null"]) {
$options[0] = '(' . lang('empty') . ')';
}
$key = $keys[$name];
$i--;
echo "<div>" . h($desc) . "<input type='hidden' name='where[$i][col]' value='" . h($name) . "'><input type='hidden' name='where[$i][op]' value='='>: <select name='where[$i][val]'>" . optionlist($options, $where[$key]["val"], true) . "</select></div>\n";
@@ -236,7 +242,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
foreach ($indexes as $key => $index) {
$order = array();
foreach ($index["columns"] as $val) {
$order[] = $this->fieldName(array("field" => $val, "comment" => $columns[$val]));
$order[] = $columns[$val];
}
if (count(array_filter($order, 'strlen')) > 1 && $key != "PRIMARY") {
$orders[$key] = implode(", ", $order);
@@ -266,12 +272,12 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
function selectEmailPrint($emailFields, $columns) {
if ($emailFields) {
echo '<fieldset><legend><a href="#fieldset-email" onclick="return !toggle(\'fieldset-email\');">' . lang('E-mail') . "</a></legend><div id='fieldset-email'" . ($_POST["email_append"] ? "" : " class='hidden'") . ">\n";
print_fieldset("email", lang('E-mail'), $_POST["email_append"]);
echo "<p>" . lang('From') . ": <input name='email_from' value='" . h($_POST ? $_POST["email_from"] : $_COOKIE["adminer_email"]) . "'>\n";
echo lang('Subject') . ": <input name='email_subject' value='" . h($_POST["email_subject"]) . "'>\n";
echo "<p><textarea name='email_message' rows='15' cols='75' onkeydown='return textareaKeydown(this, event, false, this.form.email);'>" . h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea><br>\n";
echo "<p><textarea name='email_message' rows='15' cols='75' onkeypress='return textareaKeypress(this, event, false, this.form.email);'>" . h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea><br>\n";
echo html_select("email_addition", $columns, $_POST["email_addition"]) . "<input type='submit' name='email_append' value='" . lang('Insert') . "'>\n"; //! JavaScript
echo "<p>" . lang('Attachments') . ": <input type='file' name='email_files[]' onchange=\"var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el); this.onchange = function () { };\">";
echo "<p>" . lang('Attachments') . ": <input type='file' name='email_files[]' onchange=\"this.onchange = function () { }; var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el);\">";
echo "<p>" . (count($emailFields) == 1 ? '<input type="hidden" name="email_field" value="' . h(key($emailFields)) . '">' : html_select("email_field", $emailFields));
echo "<input type='submit' name='email' value='" . lang('Send') . "' onclick=\"return this.form['delete'].onclick();\">\n";
echo "</div></fieldset>\n";
@@ -292,12 +298,20 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$conds = array();
foreach (($col != "" ? array($col => $fields[$col]) : $fields) as $name => $field) {
if ($col != "" || is_numeric($val) || !ereg('int|float|double|decimal', $field["type"])) {
$name = idf_escape($name);
if ($col != "" && $field["type"] == "enum") {
$conds[] = idf_escape($name) . " IN (" . implode(", ", array_map('intval', $val)) . ")";
$conds[] = (in_array(0, $val) ? "$name IS NULL OR " : "") . "$name IN (" . implode(", ", array_map('intval', $val)) . ")";
} else {
$text_type = ereg('char|text|enum|set', $field["type"]);
$value = $this->processInput($field, ($text_type && ereg('^[^%]+$', $val) ? "%$val%" : $val));
$conds[] = idf_escape($name) . ($value == "NULL" ? " IS" . ($op == ">=" ? " NOT" : "") : (in_array($op, $this->operators) ? " $op" : ($op != "=" && $text_type ? " LIKE" : " ="))) . " $value"; //! can issue "Illegal mix of collations" for columns in other character sets - solve by CONVERT($name using utf8)
$value = $this->processInput($field, (!$op && $text_type && ereg('^[^%]+$', $val) ? "%$val%" : $val));
$conds[] = $name . ($value == "NULL" ? " IS" . ($op == ">=" ? " NOT" : "") . " $value"
: (in_array($op, $this->operators) || $op == "=" ? " $op $value"
: ($text_type ? " LIKE $value"
: " IN (" . str_replace(",", "', '", $value) . ")"
))); //! can issue "Illegal mix of collations" for columns in other character sets - solve by CONVERT($name using utf8)
if ($key < 0 && $val == "0") {
$conds[] = "$name IS NULL";
}
}
}
}
@@ -350,7 +364,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$subject = $_POST["email_subject"];
$message = $_POST["email_message"];
preg_match_all('~\\{\\$([a-z0-9_]+)\\}~i', "$subject.$message", $matches); // allows {$name} in subject or message
$rows = get_rows("SELECT DISTINCT $field" . ($matches[1] ? ", " . implode(", ", array_map('idf_escape', array_unique($matches[1]))) : "") . " FROM " . idf_escape($_GET["select"])
$rows = get_rows("SELECT DISTINCT $field" . ($matches[1] ? ", " . implode(", ", array_map('idf_escape', array_unique($matches[1]))) : "") . " FROM " . table($_GET["select"])
. " WHERE $field IS NOT NULL AND $field != ''"
. ($where ? " AND " . implode(" AND ", $where) : "")
. ($_POST["all"] ? "" : " AND ((" . implode(") OR (", array_map('where_check', (array) $_POST["check"])) . "))")
@@ -378,7 +392,11 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
}
function editFunctions($field) {
$return = array("" => ($field["null"] || $field["auto_increment"] || $field["full_type"] == "tinyint(1)" ? "" : "*"));
$return = array();
if ($field["null"] && ereg('blob', $field["type"])) {
$return["NULL"] = lang('empty');
}
$return[""] = ($field["null"] || $field["auto_increment"] || ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) ? "" : "*");
//! respect driver
if (ereg('date|time', $field["type"])) {
$return["now"] = lang('now');
@@ -391,18 +409,23 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
function editInput($table, $field, $attrs, $value) {
if ($field["type"] == "enum") {
return ($field["null"] ? "<input type='radio'$attrs value=''" . ($value || isset($_GET["select"]) ? "" : " checked") . ">" : "");
return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='-1' checked><i>" . lang('original') . "</i></label> " : "")
. enum_input("radio", $attrs, $field, ($value || isset($_GET["select"]) ? $value : 0), ($field["null"] ? "" : null))
;
}
$options = $this->_foreignKeyOptions($table, $field["field"]);
if ($options) {
return "<select$attrs>" . optionlist($options, $value, true) . "</select>";
}
if ($field["full_type"] == "tinyint(1)") { // bool
if (ereg("(tinyint|bit)\\(1\\)", $field["full_type"])) { // bool
return '<input type="checkbox" value="' . h($value ? $value : 1) . '"' . ($value ? ' checked' : '') . "$attrs>";
}
if (ereg('date|timestamp', $field["type"])) {
return "<input value='" . h($value) . "'$attrs> (" . lang('[yyyy]-mm-dd') . ")"; //! maxlength
}
if (eregi('_(md5|sha1)$', $field["field"])) {
return "<input type='password' value='" . h($value) . "'$attrs>";
}
return '';
}
@@ -411,11 +434,11 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
return "$function()";
}
$return = $value;
if (ereg('date|timestamp', $field["type"]) && preg_match('(^' . str_replace('\\$1', '(?P<p1>[0-9]*)', preg_replace('~(\\\\\\$([2-6]))~', '(?P<p\\2>[0-9]{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) {
if (ereg('date|timestamp', $field["type"]) && preg_match('(^' . str_replace('\\$1', '(?P<p1>\\d*)', preg_replace('~(\\\\\\$([2-6]))~', '(?P<p\\2>\\d{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) {
$return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match);
}
$return = q($return);
if (!ereg('char|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && $value == "") {
$return = ($field["type"] == "bit" && ereg('^[0-9]+$', $value) ? $return : q($return));
if (!ereg('char|text', $field["type"]) && !ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) && $value == "") {
$return = "NULL";
} elseif (ereg('^(md5|sha1)$', $function)) {
$return = "$function($return)";
@@ -426,12 +449,36 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
return $return;
}
function dumpOutput($select, $value = "") {
return "";
function dumpOutput() {
return array();
}
function dumpFormat($select, $value = "") {
return html_select("format", array('csv' => 'CSV,', 'csv;' => 'CSV;'), $value, $select);
function dumpFormat() {
return array('csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV');
}
function dumpTable() {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
}
function dumpData($table, $style, $query) {
global $connection;
$result = $connection->query($query, 1); // 1 - MYSQLI_USE_RESULT
if ($result) {
while ($row = $result->fetch_assoc()) {
dump_csv($row);
}
}
}
function dumpHeaders($identifier, $multi_table = false) {
$ext = "csv";
header("Content-Type: text/csv; charset=utf-8");
return $ext;
}
function homepage() {
return true;
}
function navigation($missing) {
@@ -448,7 +495,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
foreach ((array) $_SESSION["pwds"]["server"][""] as $username => $password) {
if (isset($password)) {
if ($first) {
echo "<p>\n";
echo "<p onclick='eventStop(event);'>\n";
$first = false;
}
echo "<a href='" . h(auth_url("server", "", $username)) . "'>" . ($username != "" ? h($username) : "<i>" . lang('empty') . "</i>") . "</a><br>\n";
@@ -459,7 +506,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
<form action="" method="post">
<p class="logout">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" onclick="eventStop(event);">
</p>
</form>
<?php
@@ -479,7 +526,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
foreach ($tables as $row) {
$name = $this->tableName($row);
if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name
echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'>" . bold($name, $_GET["select"] == $row["Name"]) . "</a><br>\n";
echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'" . bold($_GET["select"] == $row["Name"]) . ">$name</a><br>\n";
}
}
}
@@ -494,7 +541,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$return = &$this->_values[$foreignKey["table"]];
if (!isset($return)) {
$table_status = table_status($foreignKey["table"]);
$return = ($table_status["Rows"] > 1000 ? array() : array("" => "") + get_key_vals("SELECT $id, $name FROM " . idf_escape($foreignKey["table"]) . " ORDER BY 2"));
$return = ($table_status["Rows"] > 1000 ? array() : array("" => "") + get_key_vals("SELECT $id, $name FROM " . table($foreignKey["table"]) . " ORDER BY 2"));
}
return $return;
}

View File

@@ -14,9 +14,9 @@ function email_header($header) {
* @param string
* @param string
* @param array
* @return
* @return bool
*/
function send_mail($email, $subject, $message, $from = "", $files = array()) {
function send_mail($email, $subject, $message, $from = "", $files = array("error" => array())) {
$eol = (strncasecmp(PHP_OS, "win", 3) ? "\n" : "\r\n"); // PHP_EOL available since PHP 4.3.10 and 5.0.2
$message = str_replace("\n", $eol, wordwrap(str_replace("\r", "", "$message\n")));
$boundary = uniqid("boundary");

View File

@@ -1,23 +0,0 @@
<?php
function dump_table($table) {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
}
function dump_data($table, $style, $select = "") {
global $connection;
$result = $connection->query(($select ? $select : "SELECT * FROM " . idf_escape($table)), 1); // 1 - MYSQLI_USE_RESULT
if ($result) {
while ($row = $result->fetch_assoc()) {
dump_csv($row);
}
}
}
function dump_headers($identifier) {
$filename = ($identifier != "" ? friendly_url($identifier) : "dump");
$ext = "csv";
header("Content-Type: text/csv; charset=utf-8");
header("Content-Disposition: attachment; filename=$filename.$ext");
session_write_close();
return $ext;
}

View File

@@ -1,9 +1,10 @@
<?php
/** Adminer Editor - Compact database editor
* @link http://www.adminer.org/
* @author Jakub Vrana, http://php.vrana.cz/
* @author Jakub Vrana, http://www.vrana.cz/
* @copyright 2009 Jakub Vrana
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
include "../adminer/include/bootstrap.inc.php";

1
externals/jquery-timepicker vendored Submodule

1
externals/jquery-ui vendored Submodule

Submodule externals/jquery-ui added at c44818fcca

1
externals/tinymce vendored Submodule

Submodule externals/tinymce added at 00968708de

View File

@@ -40,12 +40,17 @@ foreach (glob(dirname(__FILE__) . "/adminer/lang/" . ($_SESSION["lang"] ? $_SESS
$s .= "$match[1]// $match[2],\n";
}
}
foreach($messages as $idf => $val) {
// add new messages
if ($val == "," && strpos($idf, "%d")) {
$s .= "\t$idf => array(),\n";
} elseif (basename($filename) != "en.inc.php") {
$s .= "\t$idf => null,\n";
if ($messages) {
if (basename($filename) != "en.inc.php") {
$s .= "\n";
}
foreach ($messages as $idf => $val) {
// add new messages
if ($val == "," && strpos($idf, "%d")) {
$s .= "\t$idf => array(),\n";
} elseif (basename($filename) != "en.inc.php") {
$s .= "\t$idf => null,\n";
}
}
}
$s = "<?php\n\$translations = array(\n$s);\n";

54
plugins/dump-xml.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
/** Dump to XML format in structure <database name=""><table name=""><column name="">value
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerDumpXml {
function dumpFormat() {
return array('xml' => 'XML');
}
function dumpTable($table, $style, $is_view = false) {
if ($_POST["format"] == "xml") {
return true;
}
}
function _database() {
echo "</database>\n";
}
function dumpData($table, $style, $query) {
static $database = false;
if ($_POST["format"] == "xml") {
if (!$database) {
$database = true;
echo "<database name='" . h(DB) . "'>\n";
register_shutdown_function(array($this, '_database'));
}
$connection = connection();
$result = $connection->query($query, 1);
if ($result) {
while ($row = $result->fetch_assoc()) {
echo "\t<table name='" . h($table) . "'>\n";
foreach ($row as $key => $val) {
echo "\t\t<column name='" . h($key) . "'>" . h($val) . "</column>\n";
}
echo "\t</table>\n";
}
}
return true;
}
}
function dumpHeaders($identifier, $multi_table = false) {
if ($_POST["format"] == "xml") {
header("Content-Type: text/xml; charset=utf-8");
return "xml";
}
}
}

43
plugins/dump-zip.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
/** Dump to ZIP format
* @uses ZipArchive, tempnam("")
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerDumpZip {
var $filename;
function dumpOutput() {
if (!class_exists('ZipArchive')) {
return array();
}
return array('zip' => 'ZIP');
}
function _zip($string, $state) {
static $data = "";
$data .= $string;
if ($state & PHP_OUTPUT_HANDLER_END) {
$zip = new ZipArchive;
$zipFile = tempnam("", "zip");
$zip->open($zipFile, ZipArchive::OVERWRITE); // php://output is not supported
$zip->addFromString($this->filename, $data);
$zip->close();
$return = file_get_contents($zipFile);
unlink($zipFile);
return $return;
}
return "";
}
function dumpHeaders($identifier, $multi_table = false) {
$this->filename = "$identifier." . ($multi_table && ereg("[ct]sv", $_POST["format"]) ? "tar" : $_POST["format"]);
if ($_POST["output"] == "zip") {
header("Content-Type: application/zip");
}
ob_start(array($this, '_zip'));
}
}

47
plugins/edit-calendar.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
/** Display jQuery UI Timepicker for each date and datetime field
* @uses jQuery-Timepicker, http://trentrichardson.com/examples/timepicker/
* @uses jQuery UI: core, widget, mouse, slider, datepicker
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerEditCalendar {
var $prepend, $langPath;
/**
* @param string text to append before first calendar usage
* @param string path to language file, %s stands for language code
*/
function AdminerEditCalendar($prepend = "<script type='text/javascript' src='jquery-ui/jquery.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' type='text/css' href='jquery-ui/jquery-ui.css'>\n", $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") { //! insert <link> by JavaScript to achieve HTML validity
$this->prepend = $prepend;
$this->langPath = $langPath;
}
function editInput($table, $field, $attrs, $value) {
static $calendar = false;
if (ereg("date|time", $field["type"])) {
if (!$calendar) {
$calendar = true;
echo $this->prepend;
if ($this->langPath && function_exists('get_lang')) { // since Adminer 3.2.0
$lang = get_lang();
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
if ($lang != "en" && file_exists(sprintf($this->langPath, $lang))) {
printf("<script type='text/javascript' src='$this->langPath'></script>\n", $lang);
echo "<script type='text/javascript'>jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });</script>\n";
}
}
}
$dateFormat = "changeYear: true, dateFormat: 'yy-mm-dd'"; //! yy-mm-dd regional
$timeFormat = "showSecond: true, timeFormat: 'hh:mm:ss'";
return "<input id='fields-" . h($field["field"]) . "' value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . "$attrs><script type='text/javascript'>jQuery(function () { jQuery('#fields-" . js_escape($field["field"]) . "')."
. ($field["type"] == "time" ? "timepicker({ $timeFormat })"
: (ereg("time", $field["type"]) ? "datetimepicker({ $dateFormat, $timeFormat })"
: "datepicker({ $dateFormat })"
)) . "; });</script>";
}
}
}

36
plugins/enum-option.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
/** Use <select><option> for enum edit instead of <input type="radio">
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerEnumOption {
function editInput($table, $field, $attrs, $value) {
if ($field["type"] == "enum") {
$options = array("" => array());
$selected = $value;
if (isset($_GET["select"])) {
$options[""][-1] = lang('original');
}
if ($field["null"]) {
$options[""][""] = "NULL";
if (!isset($value) && !isset($_GET["select"])) {
$selected = "";
}
}
$options[""][0] = lang('empty');
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val));
$options[$i + 1] = $val;
if ($value === $val) {
$selected = $i + 1;
}
}
return "<select$attrs>" . optionlist($options, (string) $selected, 1) . "</select>"; // 1 - use keys
}
}
}

48
plugins/file-upload.php Normal file
View File

@@ -0,0 +1,48 @@
<?php
/** Edit fields ending with "_path" by <input type="file"> and link to the uploaded files from select
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerFileUpload {
var $uploadPath, $displayPath;
/**
* @param string prefix for uploading data (create writable subdirectory for each table containing uploadable fields)
* @param string prefix for displaying data, null stands for $uploadPath
*/
function AdminerFileUpload($uploadPath = "../static/data/", $displayPath = null) {
$this->uploadPath = $uploadPath;
$this->displayPath = (isset($displayPath) ? $displayPath : $uploadPath);
}
function editInput($table, $field, $attrs, $value) {
if (ereg('(.*)_path$', $field["field"])) {
return "<input type='file' name='fields-$field[field]'>";
}
}
function processInput($field, $value, $function = "") {
if (ereg('(.*)_path$', $field["field"], $regs)) {
$table = ($_GET["edit"] != "" ? $_GET["edit"] : $_GET["select"]);
$name = "fields-$field[field]";
if ($_FILES[$name]["error"] || !eregi('(\\.([a-z0-9]+))?$', $_FILES[$name]["name"], $regs2)) {
return false;
}
//! unlink old
$filename = uniqid() . $regs2[0];
if (!move_uploaded_file($_FILES[$name]["tmp_name"], "$this->uploadPath$table/$regs[1]-$filename")) {
return false;
}
return q($filename);
}
}
function selectVal($val, &$link, $field) {
if ($val != "&nbsp;" && ereg('(.*)_path$', $field["field"], $regs)) {
$link = "$this->displayPath$_GET[select]/$regs[1]-$val";
}
}
}

View File

@@ -0,0 +1,55 @@
<?php
/** Link system tables (in mysql and information_schema databases) by foreign keys
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerForeignSystem {
function foreignKeys($table) {
if (DRIVER == "server" && DB == "mysql") {
switch ($table) {
case "columns_priv": return array(array("table" => "user", "source" => array("Host", "User"), "target" => array("Host", "User")));
case "db": return array(array("table" => "user", "source" => array("Host", "User"), "target" => array("Host", "User")));
case "help_category": return array(array("table" => "help_category", "source" => array("parent_category_id"), "target" => array("help_category_id")));
case "help_relation": return array(array("table" => "help_topic", "source" => array("help_topic_id"), "target" => array("help_topic_id")), array("table" => "help_keyword", "source" => array("help_keyword_id"), "target" => array("help_keyword_id")));
case "help_topic": return array(array("table" => "help_category", "source" => array("help_category_id"), "target" => array("help_category_id")));
case "procs_priv": return array(array("table" => "user", "source" => array("Host", "User"), "target" => array("Host", "User")), array("table" => "proc", "source" => array("Db", "Routine_name"), "target" => array("db", "name")));
case "tables_priv": return array(array("table" => "user", "source" => array("Host", "User"), "target" => array("Host", "User")));
case "time_zone_name": return array(array("table" => "time_zone", "source" => array("Time_zone_id"), "target" => array("Time_zone_id")));
case "time_zone_transition": return array(array("table" => "time_zone", "source" => array("Time_zone_id"), "target" => array("Time_zone_id")), array("table" => "time_zone_transition_type", "source" => array("Time_zone_id", "Transition_type_id"), "target" => array("Time_zone_id", "Transition_type_id")));
case "time_zone_transition_type": return array(array("table" => "time_zone", "source" => array("Time_zone_id"), "target" => array("Time_zone_id")));
}
} elseif (DB == "information_schema") {
$schemata = array("table" => "SCHEMATA", "source" => array("TABLE_CATALOG", "TABLE_SCHEMA"), "target" => array("CATALOG_NAME", "SCHEMA_NAME"));
$tables = array("table" => "TABLES", "source" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"), "target" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"));
$columns = array("table" => "COLUMNS", "source" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME"), "target" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME"));
$character_sets = array("table" => "CHARACTER_SETS", "source" => array("CHARACTER_SET_NAME"), "target" => array("CHARACTER_SET_NAME"));
$collations = array("table" => "COLLATIONS", "source" => array("COLLATION_NAME"), "target" => array("COLLATION_NAME"));
$routine_charsets = array(array("source" => array("CHARACTER_SET_CLIENT")) + $character_sets, array("source" => array("COLLATION_CONNECTION")) + $collations, array("source" => array("DATABASE_COLLATION")) + $collations);
switch ($table) {
case "CHARACTER_SETS": return array(array("source" => array("DEFAULT_COLLATE_NAME")) + $collations);
case "COLLATIONS": return array($character_sets);
case "COLLATION_CHARACTER_SET_APPLICABILITY": return array($collations, $character_sets);
case "COLUMNS": return array($schemata, $tables, $character_sets, $collations);
case "COLUMN_PRIVILEGES": return array($schemata, $tables, $columns);
case "TABLES": return array($schemata, array("source" => array("TABLE_COLLATION")) + $collations);
case "SCHEMATA": return array(array("source" => array("DEFAULT_CHARACTER_SET_NAME")) + $character_sets, array("source" => array("DEFAULT_COLLATION_NAME")) + $collations);
case "EVENTS": return array_merge(array(array("source" => array("EVENT_CATALOG", "EVENT_SCHEMA")) + $schemata), $routine_charsets);
case "FILES": return array($schemata, $tables);
case "KEY_COLUMN_USAGE": return array(array("source" => array("CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA")) + $schemata, $schemata, $tables, $columns, array("source" => array("TABLE_CATALOG", "REFERENCED_TABLE_SCHEMA")) + $schemata, array("source" => array("TABLE_CATALOG", "REFERENCED_TABLE_SCHEMA", "REFERENCED_TABLE_NAME")) + $tables, array("source" => array("TABLE_CATALOG", "REFERENCED_TABLE_SCHEMA", "REFERENCED_TABLE_NAME", "REFERENCED_COLUMN_NAME")) + $columns);
case "PARTITIONS": return array($schemata, $tables);
case "REFERENTIAL_CONSTRAINTS": return array(array("source" => array("CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA")) + $schemata, array("source" => array("UNIQUE_CONSTRAINT_CATALOG", "UNIQUE_CONSTRAINT_SCHEMA")) + $schemata, array("source" => array("CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA", "TABLE_NAME")) + $tables, array("source" => array("CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA", "REFERENCED_TABLE_NAME")) + $tables);
case "ROUTINES": return array_merge(array(array("source" => array("ROUTINE_CATALOG", "ROUTINE_SCHEMA")) + $schemata), $routine_charsets);
case "SCHEMA_PRIVILEGES": return array($schemata);
case "STATISTICS": return array($schemata, $tables, $columns, array("source" => array("TABLE_CATALOG", "INDEX_SCHEMA")) + $schemata);
case "TABLE_CONSTRAINTS": return array(array("source" => array("CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA")) + $schemata, array("source" => array("CONSTRAINT_CATALOG", "TABLE_SCHEMA")) + $schemata, array("source" => array("CONSTRAINT_CATALOG", "TABLE_SCHEMA", "TABLE_NAME")) + $tables);
case "TABLE_PRIVILEGES": return array($schemata, $tables);
case "TRIGGERS": return array_merge(array(array("source" => array("TRIGGER_CATALOG", "TRIGGER_SCHEMA")) + $schemata, array("source" => array("EVENT_OBJECT_CATALOG", "EVENT_OBJECT_SCHEMA")) + $schemata, array("source" => array("EVENT_OBJECT_CATALOG", "EVENT_OBJECT_SCHEMA", "EVENT_OBJECT_TABLE")) + $tables), $routine_charsets);
case "VIEWS": return array($schemata);
}
}
}
}

26
plugins/frames.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
/** Allow using Adminer inside a frame (disables ClickJacking protection)
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerFrames {
var $sameOrigin;
/**
* @param bool allow running from the same origin only
*/
function AdminerFrames($sameOrigin = false) {
$this->sameOrigin = $sameOrigin;
}
function headers() {
if ($this->sameOrigin) {
header("X-Frame-Options: SameOrigin");
}
header("X-XSS-Protection: 0");
return true;
}
}

29
plugins/login-table.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
/* Requires this table:
CREATE TABLE login (
id int NOT NULL AUTO_INCREMENT, -- optional
login varchar(30) NOT NULL, -- any length
password_sha1 char(40) NOT NULL,
UNIQUE (login),
PRIMARY KEY (id)
);
*/
/** Authenticate a user from the login table
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerLoginTable {
var $database;
function AdminerLoginTable($database) {
$this->database = $database;
}
function login($login, $password) {
$connection = connection();
return (bool) $connection->result($q = "SELECT COUNT(*) FROM " . idf_escape($this->database) . ".login WHERE login = " . $connection->quote($login) . " AND password_sha1 = " . $connection->quote(sha1($password)));
}
}

267
plugins/plugin.php Normal file
View File

@@ -0,0 +1,267 @@
<?php
/** Adminer customization allowing usage of plugins
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerPlugin extends Adminer {
var $plugins;
/**
* @param array
*/
function AdminerPlugin($plugins) {
$this->plugins = $plugins;
// it is possible to use ReflectionObject in PHP 5 to find out which plugins defines which methods at once
}
function _applyPlugin($function, $args) {
foreach ($this->plugins as $plugin) {
if (method_exists($plugin, $function)) {
switch (count($args)) { // call_user_func_array() doesn't work well with references
case 0: $return = $plugin->$function(); break;
case 1: $return = $plugin->$function($args[0]); break;
case 2: $return = $plugin->$function($args[0], $args[1]); break;
case 3: $return = $plugin->$function($args[0], $args[1], $args[2]); break;
case 4: $return = $plugin->$function($args[0], $args[1], $args[2], $args[3]); break;
default: trigger_error('Too many parameters.', E_USER_WARNING);
}
if (isset($return)) {
return $return;
}
}
}
return call_user_func_array(array($this, "parent::$function"), $args);
}
function _appendPlugin($function, $args) {
$return = call_user_func_array(array($this, "parent::$function"), $args);
foreach ($this->plugins as $plugin) {
if (method_exists($plugin, $function)) {
$return += call_user_func_array(array($plugin, $function), $args);
}
}
return $return;
}
// appendPlugin
function dumpFormat() {
$args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args);
}
function dumpOutput() {
$args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args);
}
function editFunctions() {
$args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args);
}
// applyPlugin
function name() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function credentials() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function permanentLogin() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function database() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function headers() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function loginForm() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function login() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function tableName() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function fieldName() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectLinks() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function foreignKeys() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function backwardKeys() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function backwardKeysPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectQuery() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function rowDescription() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function rowDescriptions() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectVal() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function editVal() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectColumnsPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectSearchPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectOrderPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectLimitPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectLengthPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectActionPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectEmailPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectColumnsProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectSearchProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectOrderProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectLimitProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectLengthProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectEmailProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function messageQuery() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function editInput() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function processInput() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function dumpTable() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function dumpData() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function dumpHeaders() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function homepage() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function navigation() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function tablesPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
}

2
plugins/readme.txt Normal file
View File

@@ -0,0 +1,2 @@
../adminer/plugin.php - demo usage
http://www.adminer.org/en/plugins/ - documentation

40
plugins/slugify.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
/** Prefill field containing "_slug" with slugified value of a previous field (JavaScript)
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerSlugify {
var $from, $to;
/**
* @param string find these characters ...
* @param string ... and replace them by these
*/
function AdminerSlugify($from = 'áčďéěíňóřšťúůýž', $to = 'acdeeinorstuuyz') {
$this->from = $from;
$this->to = $to;
}
function editInput($table, $field, $attrs, $value) {
static $slugify;
if (!$_GET["select"] && !$_GET["where"]) {
if (!isset($slugify)) {
$slugify = array();
$prev = null;
foreach (fields($table) as $name => $field) {
if ($prev && ereg('(^|_)slug(_|$)', $name)) {
$slugify[$prev] = $name;
}
$prev = $name;
}
}
$slug = $slugify[$field["field"]];
if (isset($slug)) {
return "<input value='" . h($value) . "' maxlength='$field[length]' size='40'$attrs onchange=\"var find = '$this->from'; var repl = '$this->to'; this.form['fields[$slug]'].value = this.value.toLowerCase().replace(new RegExp('[' + find + ']', 'g'), function (str) { return repl[find.indexOf(str)]; }).replace(/[^a-z0-9_]+/g, '-').replace(/^-|-\$/g, '').substr(0, $field[length]);\">";
}
}
}
}

60
plugins/tinymce.php Normal file
View File

@@ -0,0 +1,60 @@
<?php
/** Edit all fields containing "_html" by HTML editor TinyMCE and display the HTML in select
* @uses TinyMCE, http://tinymce.moxiecode.com/
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerTinymce {
var $path;
/**
* @param string
*/
function AdminerTinymce($path = "tiny_mce/tiny_mce.js") {
$this->path = $path;
}
function selectVal(&$val, $link, $field) {
if (ereg("_html", $field["field"]) && $val != '&nbsp;') {
$val = preg_replace('~<[^>]*$~', '', html_entity_decode($val, ENT_QUOTES)); //! close all opened tags (text can be shortened)
}
}
function editInput($table, $field, $attrs, $value) {
static $tiny_mce = false;
if (ereg("text", $field["type"]) && ereg("_html", $field["field"])) {
if (!$tiny_mce) {
$tiny_mce = true;
$lang = "en";
if (function_exists('get_lang')) { // since Adminer 3.2.0
$lang = get_lang();
$lang = ($lang == "zh" ? "zh-cn" : ($lang == "zh-tw" ? "zh" : $lang));
if (!file_exists(dirname($this->path) . "/langs/$lang.js")) {
$lang = "en";
}
}
?>
<script type="text/javascript" src="<?php echo h($this->path); ?>"></script>
<script type="text/javascript">
tinyMCE.init({
mode: 'none',
theme: 'advanced',
plugins: 'contextmenu,paste,table',
entity_encoding: 'raw',
theme_advanced_buttons1: 'bold,italic,link,unlink,|,sub,sup,|,bullist,numlist,|,cleanup,code',
theme_advanced_buttons2: 'tablecontrols',
theme_advanced_buttons3: '',
theme_advanced_toolbar_location: 'top',
theme_advanced_toolbar_align: 'left',
language: '<?php echo $lang; ?>'
});
</script>
<?php
}
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>tinyMCE.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "');</script>";
}
}
}

54
plugins/translation.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
/* Requires this table:
CREATE TABLE translation (
id int NOT NULL AUTO_INCREMENT, -- optional
language_id varchar(5) NOT NULL,
idf text NOT NULL COLLATE utf8_bin,
translation text NOT NULL,
UNIQUE (language_id, idf(100)),
PRIMARY KEY (id)
);
*/
/** Translate all table and field comments, enum and set values from the translation table (inserts new translations)
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerTranslation {
function _translate($idf) {
static $translations, $lang;
if (!isset($lang)) {
$lang = get_lang();
}
if ($idf == "" || $lang == "en") {
return $idf;
}
if (!isset($translations)) {
$translations = get_key_vals("SELECT idf, translation FROM translation WHERE language_id = " . q($lang));
}
$return = &$translations[$idf];
if (!isset($return)) {
$return = $idf;
$connection = connection();
$connection->query("INSERT INTO translation (language_id, idf, translation) VALUES (" . q($lang) . ", " . q($idf) . ", " . q($idf) . ")");
}
return $return;
}
function tableName(&$tableStatus) {
$tableStatus["Comment"] = $this->_translate($tableStatus["Comment"]);
}
function fieldName(&$field, $order = 0) {
$field["comment"] = $this->_translate($field["comment"]);
}
function editVal(&$val, $field) {
if ($field["type"] == "enum") {
$val = $this->_translate($val);
}
}
}

View File

@@ -0,0 +1,19 @@
<?php
/** Disable version checker
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerVersionNoverify {
function navigation($missing) {
?>
<script type="text/javascript">
verifyVersion = function () {
};
</script>
<?php
}
}

View File

@@ -3,12 +3,14 @@ Adminer Editor - Data manipulation for end-users
http://www.adminer.org/
Supports: MySQL, PostgreSQL, SQLite, MS SQL, Oracle
Requirements: PHP 4.3.2+ or PHP 5+
Apache License, Version 2.0
Requirements: PHP 4.3.3+ or PHP 5+
Apache License 2.0 or GPL 2
adminer/index.php - Run development version of Adminer
editor/index.php - Run development version of Adminer Editor
editor/example.php - Example customization
plugins/readme.txt - Plugins for Adminer and Adminer Editor
adminer/plugin.php - Plugin demo
compile.php [driver] [lang] - Create a single file version
lang.php [lang] - Update translations
tests/selenium.html - Selenium test suite

View File

@@ -1,19 +1,17 @@
Transactions in export
Create view and routine options
Variables editation, especially timezone (or set by PHP date.timezone)
Highlight SQL textarea, then display query inside textarea in select - may use external CodeMirror
Blob download and image display in edit form (important for Editor with hidden fields in select)
Add title to Logout, edit (in select) and select (in menu) in style "hever"
Variables editation, especially timezone, or set by PHP date("0")
Highlight SQL textarea - may use external CodeMirror
Blob download and image display in edit form (important for Editor with hidden fields in select and SQL command)
Add title to Logout, edit (in select) and select (in menu) for style "hever"
Shift-click in checkboxes to select range
Export by GET parameters
Only first part of big BZ2 export is readable, files are missing in TAR
Auto-refresh processlist (thanks to Jan Garaj)
Save schema layout to #hash in URL
Double click in select - Esc to abort editation
XML export
Draggable columns in alter table (thanks to Michal Manak)
? Filter by value in row under <thead> in select
? Column and table names auto-completition in SQL textarea
? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, aliasing of $connection->query, $connection->result and $connection->quote can save ~ 3 KB, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB
? Column and table names auto-completition in SQL textarea - http://blog.quplo.com/2010/06/css-code-completion-in-your-browser/
? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, aliasing of $connection->query can save 24 B, JS Closure compiler can save 2 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB
? Branch binary_compile: LZW compression of translations can save 30 KB, LZW compression of all texts can save 11 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB
Editor:
@@ -25,10 +23,11 @@ Add whisperer to fields with foreign key to big table
JS calendar for date fields
MySQL:
Saving of MySQL 5 BIT data type - don't use quote()
Data longer than max_allowed_packet can be sent by mysqli_stmt_send_long_data()
? Geometry support
SQLite:
Copy tables
ASC and DESC instead of text length in index
Delimiter in export and SQL command
Backward keys in Editor
@@ -39,13 +38,13 @@ Users - SELECT * FROM pg_user
ORDER BY COUNT(*)
Export - http://www.postgresql.org/docs/8.4/static/functions-info.html
Column rights - http://www.postgresql.org/docs/8.4/static/functions-info.html
Dollar terminated string in SQL command
bool in Editor
MS SQL:
Display default value
Non UTF-8 character sets
Detection of table collation
PDO driver with seek
PDO_MSSQL and PDO_SQLSRV driver with seek
Oracle:
clob comparable with string