diff --git a/js/functions.js b/js/functions.js index b6195c13bf..e7877e0db2 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2598,33 +2598,37 @@ $(function() { $(this).dialog('close'); }; $.get($(this).attr('href'), {'ajax_request': true}, function(data) { - $('
') - .dialog({ - title: PMA_messages['strChangePassword'], - width: 600, - close: function(ev, ui) { - $(this).remove(); - }, - buttons : button_options, - modal: true - }) - .append(data.message); - // for this dialog, we remove the fieldset wrapping due to double headings - $("fieldset#fieldset_change_password") - .find("legend").remove().end() - .find("table.noclick").unwrap().addClass("some-margin") - .find("input#text_pma_pw").focus(); - displayPasswordGenerateButton(); - $('#fieldset_change_password_footer').hide(); - PMA_ajaxRemoveMessage($msgbox); - $('#change_password_form').bind('submit', function (e) { - e.preventDefault(); - $(this) - .closest('.ui-dialog') - .find('.ui-dialog-buttonpane .ui-button') - .first() - .click(); - }); + if (data.success) { + $('
') + .dialog({ + title: PMA_messages['strChangePassword'], + width: 600, + close: function(ev, ui) { + $(this).remove(); + }, + buttons : button_options, + modal: true + }) + .append(data.message); + // for this dialog, we remove the fieldset wrapping due to double headings + $("fieldset#fieldset_change_password") + .find("legend").remove().end() + .find("table.noclick").unwrap().addClass("some-margin") + .find("input#text_pma_pw").focus(); + displayPasswordGenerateButton(); + $('#fieldset_change_password_footer').hide(); + PMA_ajaxRemoveMessage($msgbox); + $('#change_password_form').bind('submit', function (e) { + e.preventDefault(); + $(this) + .closest('.ui-dialog') + .find('.ui-dialog-buttonpane .ui-button') + .first() + .click(); + }); + } else { + PMA_ajaxShowMessage(data.error, false); + } }); // end $.get() }); // end handler for change password anchor }); // end $() for Change Password diff --git a/libraries/CommonFunctions.class.php b/libraries/CommonFunctions.class.php index de5a172d42..6ffa509590 100644 --- a/libraries/CommonFunctions.class.php +++ b/libraries/CommonFunctions.class.php @@ -2302,7 +2302,9 @@ class PMA_CommonFunctions $con_key = $this->backquote($meta->table) . '.' . $this->backquote($meta->orgname); } // end if... else... - $condition = ' ' . $con_key . ' '; + $condition = ($fields_cnt == 1) + ? ' CHAR_LENGTH(' . $con_key . ') ' + : ' ' . $con_key . ' '; if (! isset($row[$i]) || is_null($row[$i])) { $con_val = 'IS NULL'; @@ -2330,7 +2332,9 @@ class PMA_CommonFunctions $con_val = '= CAST(0x' . bin2hex($row[$i]) . ' AS BINARY)'; } else { // this blob won't be part of the final condition - $con_val = null; + $con_val = ($fields_cnt == 1) + ? ' = '. strlen($row[$i]) + : null; } } elseif (in_array($meta->type, $this->getGISDatatypes()) diff --git a/libraries/Menu.class.php b/libraries/Menu.class.php index adbc5081fa..1a1160cee9 100644 --- a/libraries/Menu.class.php +++ b/libraries/Menu.class.php @@ -36,22 +36,11 @@ class PMA_Menu * @access private * @var string */ - private $_table; - - private $_common_functions; - + private $_table; /** - * Get CommmonFunctions - * - * @return CommonFunctions object + * @var object A reference to the common functions object */ - public function getCommonFunctions() - { - if (is_null($this->_common_functions)) { - $this->_common_functions = PMA_CommonFunctions::getInstance(); - } - return $this->_common_functions; - } + private $_commonFunctions; /** * Creates a new instance of PMA_Menu @@ -67,6 +56,7 @@ class PMA_Menu $this->_server = $server; $this->_db = $db; $this->_table = $table; + $this->_commonFunctions = PMA_commonFunctions::getInstance(); } /** @@ -92,7 +82,7 @@ class PMA_Menu if (isset($GLOBALS['buffer_message'])) { $buffer_message = $GLOBALS['buffer_message']; } - $retval .= $this->getCommonFunctions()->getMessage($GLOBALS['message']); + $retval .= $this->_commonFunctions->getMessage($GLOBALS['message']); unset($GLOBALS['message']); if (isset($buffer_message)) { $GLOBALS['buffer_message'] = $buffer_message; @@ -118,7 +108,7 @@ class PMA_Menu } else { $tabs = $this->_getServerTabs(); } - return $this->getCommonFunctions()->getHtmlTabs($tabs, $url_params); + return $this->_commonFunctions->getHtmlTabs($tabs, $url_params); } /** @@ -147,7 +137,7 @@ class PMA_Menu $retval .= "
"; $retval .= "
"; if ($GLOBALS['cfg']['NavigationBarIconic']) { - $retval .= $this->getCommonFunctions()->getImage( + $retval .= $this->_commonFunctions->getImage( 's_host.png', '', array('class' => 'item') @@ -164,7 +154,7 @@ class PMA_Menu if (strlen($this->_db)) { $retval .= $separator; if ($GLOBALS['cfg']['NavigationBarIconic']) { - $retval .= $this->getCommonFunctions()->getImage( + $retval .= $this->_commonFunctions->getImage( 's_db.png', '', array('class' => 'item') @@ -187,7 +177,7 @@ class PMA_Menu $retval .= $separator; if ($GLOBALS['cfg']['NavigationBarIconic']) { $icon = $tbl_is_view ? 'b_views.png' : 's_tbl.png'; - $retval .= $this->getCommonFunctions()->getImage( + $retval .= $this->_commonFunctions->getImage( $icon, '', array('class' => 'item') @@ -309,7 +299,7 @@ class PMA_Menu } if (! $db_is_information_schema && ! PMA_DRIZZLE - && $this->getCommonFunctions()->currentUserHasPrivilege('TRIGGER', $this->_db, $this->_table) + && $this->_commonFunctions->currentUserHasPrivilege('TRIGGER', $this->_db, $this->_table) && ! $tbl_is_view ) { $tabs['triggers']['link'] = 'tbl_triggers.php'; @@ -351,15 +341,6 @@ class PMA_Menu $tabs = array(); - /** - * export, search and qbe links if there is at least one table - */ - if ($num_tables == 0) { - $tabs['qbe']['warning'] = __('Database seems to be empty!'); - $tabs['search']['warning'] = __('Database seems to be empty!'); - $tabs['export']['warning'] = __('Database seems to be empty!'); - } - $tabs['structure']['link'] = 'db_structure.php'; $tabs['structure']['text'] = __('Structure'); $tabs['structure']['icon'] = 'b_props.png'; @@ -372,14 +353,23 @@ class PMA_Menu $tabs['search']['text'] = __('Search'); $tabs['search']['icon'] = 'b_search.png'; $tabs['search']['link'] = 'db_search.php'; + if ($num_tables == 0) { + $tabs['search']['warning'] = __('Database seems to be empty!'); + } $tabs['qbe']['text'] = __('Query'); $tabs['qbe']['icon'] = 's_db.png'; $tabs['qbe']['link'] = 'db_qbe.php'; + if ($num_tables == 0) { + $tabs['qbe']['warning'] = __('Database seems to be empty!'); + } $tabs['export']['text'] = __('Export'); $tabs['export']['icon'] = 'b_export.png'; $tabs['export']['link'] = 'db_export.php'; + if ($num_tables == 0) { + $tabs['export']['warning'] = __('Database seems to be empty!'); + } if (! $db_is_information_schema) { $tabs['import']['link'] = 'db_import.php'; @@ -405,14 +395,14 @@ class PMA_Menu } if (PMA_MYSQL_INT_VERSION >= 50106 && ! PMA_DRIZZLE - && $this->getCommonFunctions()->currentUserHasPrivilege('EVENT', $this->_db) + && $this->_commonFunctions->currentUserHasPrivilege('EVENT', $this->_db) ) { $tabs['events']['link'] = 'db_events.php'; $tabs['events']['text'] = __('Events'); $tabs['events']['icon'] = 'b_events.png'; } if (! PMA_DRIZZLE - && $this->getCommonFunctions()->currentUserHasPrivilege('TRIGGER', $this->_db) + && $this->_commonFunctions->currentUserHasPrivilege('TRIGGER', $this->_db) ) { $tabs['triggers']['link'] = 'db_triggers.php'; $tabs['triggers']['text'] = __('Triggers'); diff --git a/libraries/Table.class.php b/libraries/Table.class.php index c646f28eca..e504746fd5 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -65,12 +65,12 @@ class PMA_Table * @var array messages */ var $messages = array(); - + private $_common_functions; - + /** * Get CommmonFunctions - * + * * @return CommonFunctions object */ public function getCommonFunctions() @@ -201,9 +201,9 @@ class PMA_Table */ static public function isView($db = null, $table = null) { - + $common_functions = PMA_CommonFunctions::getInstance(); - + if (empty($db) || empty($table)) { return false; } @@ -319,11 +319,11 @@ class PMA_Table static public function sGetStatusInfo($db, $table, $info = null, $force_read = false, $disable_error = false ) { - - if ($_SESSION['is_multi_query']) { + + if (! empty($_SESSION['is_multi_query'])) { $disable_error = true; } - + if (! isset(PMA_Table::$cache[$db][$table]) || $force_read) { PMA_DBI_get_tables_full($db, $table); } @@ -383,7 +383,7 @@ class PMA_Table $default_type = 'USER_DEFINED', $default_value = '', $extra = '', $comment = '', &$field_primary = null, $move_to = '' ) { - + $common_functions = PMA_CommonFunctions::getInstance(); $is_timestamp = strpos(strtoupper($type), 'TIMESTAMP') !== false; @@ -519,9 +519,9 @@ class PMA_Table static public function countRecords($db, $table, $force_exact = false, $is_view = null ) { - + $common_functions = PMA_CommonFunctions::getInstance(); - + if (isset(PMA_Table::$cache[$db][$table]['ExactRows'])) { $row_count = PMA_Table::$cache[$db][$table]['ExactRows']; } else { @@ -649,7 +649,7 @@ class PMA_Table static public function duplicateInfo($work, $pma_table, $get_fields, $where_fields, $new_fields ) { - + $common_functions = PMA_CommonFunctions::getInstance(); $last_id = -1; @@ -732,7 +732,7 @@ class PMA_Table $target_table, $what, $move, $mode ) { global $err_url; - + $common_functions = PMA_CommonFunctions::getInstance(); /* Try moving table directly */ @@ -787,7 +787,7 @@ class PMA_Table // get Export SQL instance $export_sql_plugin = PMA_getPlugin( "export", - "sql", + "sql", 'libraries/plugins/export/', array( 'export_type' => $export_type, diff --git a/libraries/plugins/auth/AuthenticationCookie.class.php b/libraries/plugins/auth/AuthenticationCookie.class.php index a4bd88982f..01ca6da1db 100644 --- a/libraries/plugins/auth/AuthenticationCookie.class.php +++ b/libraries/plugins/auth/AuthenticationCookie.class.php @@ -73,7 +73,12 @@ class AuthenticationCookie extends AuthenticationPlugin if ($response->isAjax()) { $response->isSuccess(false); if (! empty($conn_error)) { - $response->addJSON('message', $conn_error); + $response->addJSON( + 'message', + PMA_Message::error( + $conn_error + ) + ); } else { $response->addJSON( 'message', @@ -688,4 +693,4 @@ class AuthenticationCookie extends AuthenticationPlugin public function update (SplSubject $subject) { } -} \ No newline at end of file +} diff --git a/po/fa.po b/po/fa.po index 0b787b01a7..31699fc055 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4,15 +4,16 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-27 10:40+0200\n" -"PO-Revision-Date: 2012-07-22 18:51+0200\n" +"PO-Revision-Date: 2012-08-03 00:13+0200\n" "Last-Translator: Ashiyane Digital Security Team \n" -"Language-Team: persian \n" +"Language-Team: Persian " +"\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Weblate 1.1\n" +"X-Generator: Weblate 1.2\n" #: browse_foreigners.php:36 browse_foreigners.php:60 js/messages.php:354 #: libraries/DisplayResults.class.php:794 @@ -2896,7 +2897,7 @@ msgstr "فایل آپلود شده نبود." #: libraries/File.class.php:273 msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini." -msgstr "" +msgstr "فایل آپلود شده بیش از upload_max_size قرار دستور در فایل php.ini اجرا" #: libraries/File.class.php:276 msgid "" diff --git a/themes/pmahomme/css/common.css.php b/themes/pmahomme/css/common.css.php index 0744db065a..f327394629 100644 --- a/themes/pmahomme/css/common.css.php +++ b/themes/pmahomme/css/common.css.php @@ -1747,7 +1747,6 @@ li#li_user_preferences { display: block; margin-top: 1em; margin-bottom: 1em; - background: #f3f3f3; width: 100%; border-top: .1em solid silver; text-align: ;