diff --git a/libraries/Header.class.php b/libraries/Header.class.php index d61dda9fa2..aa95d08de9 100644 --- a/libraries/Header.class.php +++ b/libraries/Header.class.php @@ -495,7 +495,7 @@ class PMA_Header } $retval .= ""; $retval .= PMA_message::error( - __("Javascript must be enabled past this point") + __("Javascript must be enabled past this point") )->getDisplay(); $retval .= ""; } diff --git a/libraries/TableSearch.class.php b/libraries/TableSearch.class.php index b8b55a4086..cc4221aa20 100644 --- a/libraries/TableSearch.class.php +++ b/libraries/TableSearch.class.php @@ -111,7 +111,7 @@ class PMA_TableSearch * @return array column names */ public function getColumnNames() - { + { return $this->_columnNames; } @@ -260,10 +260,10 @@ class PMA_TableSearch $column_index, $titles, $foreignMaxLimit, $criteriaValues, $column_id, $in_zoom_search_edit = false ) { - $html_output = ''; + $html_output = ''; if (is_array($foreignData['disp_row'])) { - $html_output .= ''; + $html_output .= ''; $html_output .= PMA_foreignDropdown( $foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], '', $foreignMaxLimit @@ -329,9 +329,9 @@ EOT; $html_output .= ''; } else { - $html_output .= ''; + $html_output .= ''; } //Add select options @@ -377,7 +377,8 @@ EOT; $column_type = (string)$column_type; $column_id = ($in_zoom_search_edit) ? 'edit_fieldID_' : 'fieldID_'; - //Get inputbox based on different column types (Foreign key, geometrical, enum) + // Get inputbox based on different column types + // (Foreign key, geometrical, enum) if ($this->_foreigners && isset($this->_foreigners[$column_name])) { $str .= $this->_getForeignKeyInputBox( $foreignData, $column_name, $column_index, $titles, @@ -401,7 +402,9 @@ EOT; if ($column_type == 'date') { $the_class .= ' datefield'; - } elseif ($column_type == 'datetime' || substr($column_type, 0, 9) == 'timestamp') { + } elseif ($column_type == 'datetime' + || substr($column_type, 0, 9) == 'timestamp' + ) { $the_class .= ' datetimefield'; } elseif (substr($column_type, 0, 3) == 'bit') { $the_class .= ' bit'; @@ -471,8 +474,9 @@ EOT; * * @return string part of where clause. */ - private function _getGeomWhereClause($criteriaValues, $names, $func_type, $geom_func = null) - { + private function _getGeomWhereClause($criteriaValues, $names, + $func_type, $geom_func = null + ) { $geom_unary_functions = array( 'IsEmpty' => 1, 'IsSimple' => 1, @@ -498,10 +502,14 @@ EOT; } // If the where clause is something like 'IsEmpty(`spatial_col_name`)' - if (isset($geom_unary_functions[$geom_func]) && trim($criteriaValues) == '') { + if (isset($geom_unary_functions[$geom_func]) + && trim($criteriaValues) == '' + ) { $where = $backquoted_name; - } elseif (in_array($types, PMA_getGISDatatypes()) && ! empty($criteriaValues)) { + } elseif (in_array($types, PMA_getGISDatatypes()) + && ! empty($criteriaValues) + ) { // create gis data from the criteria input $gis_data = PMA_createGISData($criteriaValues); $where = $backquoted_name . ' ' . $func_type . ' ' . $gis_data; @@ -527,7 +535,9 @@ EOT; ) { // If geometry function is set if ($geom_func != null && trim($geom_func) != '') { - return $this->_getGeomWhereClause($criteriaValues, $names, $func_type, $geom_func); + return $this->_getGeomWhereClause( + $criteriaValues, $names, $func_type, $geom_func + ); } $backquoted_name = PMA_backquote($names); @@ -541,9 +551,10 @@ EOT; $where .= $this->_getEnumWhereClause($criteriaValues, $func_type); } elseif ($criteriaValues != '') { - // For these types we quote the value. Even if it's another type (like INT), - // for a LIKE we always quote the value. MySQL converts strings to numbers - // and numbers to strings as necessary during the comparison + // For these types we quote the value. Even if it's another type + // (like INT), for a LIKE we always quote the value. MySQL converts + // strings to numbers and numbers to strings as necessary + // during the comparison if (preg_match('@char|binary|blob|text|set|date|time|year@i', $types) || strpos(' ' . $func_type, 'LIKE') ) { @@ -622,7 +633,7 @@ EOT; $sql_query .= ' FROM ' . PMA_backquote($_POST['table']); $whereClause = $this->_generateWhereClause(); $sql_query .= $whereClause; - + // if the search results are to be ordered if (isset($_POST['orderByColumn']) && $_POST['orderByColumn'] != '--nil--') { $sql_query .= ' ORDER BY ' . PMA_backquote($_POST['orderByColumn']) @@ -640,7 +651,9 @@ EOT; { $fullWhereClause = ''; - if (isset($_POST['customWhereClause']) && trim($_POST['customWhereClause']) != '') { + if (isset($_POST['customWhereClause']) + && trim($_POST['customWhereClause']) != '' + ) { $fullWhereClause .= ' WHERE ' . $_POST['customWhereClause']; return $fullWhereClause; } @@ -665,7 +678,9 @@ EOT; $_POST['criteriaValues'][$column_index], $_POST['criteriaColumnNames'][$column_index], $_POST['criteriaColumnTypes'][$column_index], - $_POST['criteriaColumnCollations'][$column_index], $operator, $unaryFlag, + $_POST['criteriaColumnCollations'][$column_index], + $operator, + $unaryFlag, $tmp_geom_func ); @@ -706,9 +721,12 @@ EOT; $html_output .= ''; // get the relevant list of GIS functions - $funcs = PMA_getGISFunctions($this->_columnTypes[$column_index], true, true); + $funcs = PMA_getGISFunctions( + $this->_columnTypes[$column_index], true, true + ); /** - * For each function in the list of functions, add an option to select list + * For each function in the list of functions, + * add an option to select list */ foreach ($funcs as $func_name => $func) { $name = isset($func['display']) ? $func['display'] : $func_name; @@ -737,8 +755,9 @@ EOT; */ $html_output .= '' . '' . __('Select columns (at least one):') . '' - . ''; + . ''; // Displays the list of the fields foreach ($this->_columnNames as $each_field) { $html_output .= ' ' @@ -757,8 +776,8 @@ EOT; . '' . '' . __('Or') . ' ' . __('Add search conditions (body of the "where" clause):') . ''; $html_output .= PMA_showMySQLDocu('SQL-Syntax', 'Functions'); - $html_output .= ''; + $html_output .= ''; $html_output .= ''; /** @@ -771,7 +790,8 @@ EOT; . ''; /** - * Displays option for ordering search results by a column value (Asc or Desc) + * Displays option for ordering search results + * by a column value (Asc or Desc) */ $html_output .= '' . '' . __('Display order:') . '' @@ -833,8 +853,9 @@ EOT; $html_output .= '' . __("Maximum rows to plot") . ''; $html_output .= ''; - $html_output .= ''; @@ -902,8 +923,8 @@ EOT; //If 'Function' column is present $html_output .= $this->_getGeomFuncHtml($column_index); //Displays column's name, type, collation and value - $html_output .= '' . htmlspecialchars($this->_columnNames[$column_index]) - . ''; + $html_output .= '' + . htmlspecialchars($this->_columnNames[$column_index]) . ''; $properties = $this->getColumnProperties($column_index, $column_index); $html_output .= '' . $properties['type'] . ''; $html_output .= '' . $properties['collation'] . ''; @@ -912,16 +933,19 @@ EOT; $html_output .= ''; //Displays hidden fields $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; } // end for - + return $html_output; } @@ -971,7 +995,10 @@ EOT; if (isset($_POST['criteriaColumnNames']) && $_POST['criteriaColumnNames'][$i] != 'pma_null' ) { - $key = array_search($_POST['criteriaColumnNames'][$i], $this->_columnNames); + $key = array_search( + $_POST['criteriaColumnNames'][$i], + $this->_columnNames + ); $properties = $this->getColumnProperties($i, $key); $type[$i] = $properties['type']; $collation[$i] = $properties['collation']; @@ -983,7 +1010,7 @@ EOT; //Column Collation $html_output .= '' . (isset($collation[$i]) ? $collation[$i] : '') . ''; - //Select options for column operators + //Select options for column operators $html_output .= '' . (isset($func[$i]) ? $func[$i] : '') . ''; //Inputbox for search criteria value $html_output .= '' . (isset($value[$i]) ? $value[$i] : '') . ''; @@ -1192,8 +1219,9 @@ EOT; //Column's Input box $html_output .= ''; $html_output .= $this->_getInputbox( - $foreignData, $fieldpopup, $this->_columnTypes[$column_index], $column_index, - $titles, $GLOBALS['cfg']['ForeignKeyMaxLimit'], '', false, true + $foreignData, $fieldpopup, $this->_columnTypes[$column_index], + $column_index, $titles, $GLOBALS['cfg']['ForeignKeyMaxLimit'], + '', false, true ); $html_output .= ''; } diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php index 8b370000c4..413c87cf36 100644 --- a/libraries/sql_query_form.lib.php +++ b/libraries/sql_query_form.lib.php @@ -267,7 +267,9 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, .' cols="' . $GLOBALS['cfg']['TextareaCols'] . '"' .' rows="' . $height . '"' .' dir="' . $GLOBALS['text_dir'] . '"' - .$auto_sel . $locking . '>' . htmlspecialchars($query) . '' . "\n"; + .$auto_sel . $locking . '>' + . htmlspecialchars($query) + . '' . "\n"; // Add buttons to generate query easily for // select all, single select, insert, update and delete if (count($fields_list)) { @@ -289,7 +291,10 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, foreach ($fields_list as $field) { echo '' . htmlspecialchars($field['Field']) . '' . "\n";