diff --git a/libraries/DbSearch.class.php b/libraries/DbSearch.class.php
index 8e7f14cf0b..7c42982bbb 100644
--- a/libraries/DbSearch.class.php
+++ b/libraries/DbSearch.class.php
@@ -93,19 +93,6 @@ class PMA_DbSearch
$this->_setSearchParams();
}
- /**
- * Set CommmonFunctions
- *
- * @param PMA_CommonFunctions $commonFunctions
- *
- * @return void
- */
- public function setCommonFunctions(PMA_CommonFunctions $commonFunctions)
- {
- $this->_common_functions = $commonFunctions;
- }
-
-
/**
* Get CommmonFunctions
*
diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php
index 6882a0dfe6..c64f0c5aac 100644
--- a/libraries/DisplayResults.class.php
+++ b/libraries/DisplayResults.class.php
@@ -29,7 +29,7 @@ class PMA_DisplayResults
const POSITION_RIGHT = 'right';
const POSITION_BOTH = 'both';
const POSITION_NONE = 'none';
-
+
const PLACE_TOP_DIRECTION_DROPDOWN = 'top_direction_dropdown';
const PLACE_BOTTOM_DIRECTION_DROPDOWN = 'bottom_direction_dropdown';
@@ -66,121 +66,122 @@ class PMA_DisplayResults
const TABLE_TYPE_INNO_DB = 'InnoDB';
const ALL_ROWS = 'all';
const QUERY_TYPE_SELECT = 'SELECT';
-
-
+
+
// Declare global fields
/** PMA_CommonFunctions object */
private $_common_functions;
-
+
/** string Database name */
private $_db;
-
+
/** string Table name */
private $_table;
-
+
/** string the URL to go back in case of errors */
private $_goto;
-
+
/** string the SQL query */
private $_sql_query;
-
+
/**
* integer the total number of rows returned by the SQL query without any
* appended "LIMIT" clause programmatically
*/
private $_unlim_num_rows;
-
+
/** array meta information about fields */
private $_fields_meta;
-
+
/** boolean */
private $_is_count;
-
+
/** integer */
private $_is_export;
-
+
/** boolean */
private $_is_func;
-
+
/** integer */
private $_is_analyse;
-
+
/** integer the total number of rows returned by the SQL query */
private $_num_rows;
-
+
/** array table definitions */
private $_showtable;
-
+
/** array column names to highlight */
private $_highlight_columns;
-
+
/** array informations used with vertical display mode */
private $_vertical_display;
-
+
/** integer the total number of fields returned by the SQL query */
private $_fields_cnt;
-
+
/** string */
private $_printview;
-
+
/** double time taken for execute the SQL query */
private $_querytime;
-
+
/** string path for theme images directory */
private $_pma_theme_image;
-
+
/** string */
private $_text_dir;
-
+
/** string URL query */
private $_url_query;
-
+
/** boolean */
private $_is_maint;
-
+
/** boolean */
private $_is_explain;
-
+
/** boolean */
private $_is_show;
-
+
/** array mime types information of fields */
private $_mime_map;
-
-
+
+
/**
* Get any property of this class
- *
+ *
* @param string $property name of the property
+ *
* @return if property exist, value of the relavant property
*/
- public function __get($property) {
-
+ public function __get($property)
+ {
if (property_exists($this, $property)) {
return $this->$property;
}
-
}
-
-
+
+
/**
* Set values for any property of this class
- *
+ *
* @param string $property name of the property
* @param $value value to set
+ *
+ * @return void
*/
- public function __set($property, $value) {
-
+ public function __set($property, $value)
+ {
if (property_exists($this, $property)) {
$this->$property = $value;
}
-
}
-
-
+
+
/**
* Get CommmonFunctions
- *
+ *
* @return CommonFunctions object
*/
public function getCommonFunctions()
@@ -190,8 +191,8 @@ class PMA_DisplayResults
}
return $this->_common_functions;
}
-
-
+
+
/**
* Constructor for PMA_DisplayResults class
*
@@ -209,33 +210,33 @@ class PMA_DisplayResults
$this->__set('_goto', $goto);
$this->__set('_sql_query', $sql_query);
}
-
-
+
+
/**
* Set properties which were not initialized at the constructor
- *
+ *
* @param type $unlim_num_rows integer the total number of rows returned by
* the SQL query without any appended
* "LIMIT" clause programmatically
* @param type $fields_meta array meta information about fields
- * @param type $is_count boolean
- * @param type $is_export integer
- * @param type $is_func boolean
- * @param type $is_analyse integer
+ * @param type $is_count boolean
+ * @param type $is_export integer
+ * @param type $is_func boolean
+ * @param type $is_analyse integer
* @param type $num_rows integer total no. of rows returned by SQL query
* @param type $fields_cnt integer total no.of fields returned by SQL query
* @param type $querytime double time taken for execute the SQL query
* @param type $pmaThemeImage string path for theme images directory
- * @param type $text_dir string
- * @param type $is_maint boolean
- * @param type $is_explain boolean
- * @param type $is_show boolean
+ * @param type $text_dir string
+ * @param type $is_maint boolean
+ * @param type $is_explain boolean
+ * @param type $is_show boolean
* @param type $showtable array table definitions
- * @param type $printview string
+ * @param type $printview string
* @param type $url_query string URL query
- *
+ *
* @return void
- *
+ *
* @see sql.php
*/
public function processParams(
@@ -243,7 +244,7 @@ class PMA_DisplayResults
$is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage, $text_dir,
$is_maint, $is_explain, $is_show, $showtable, $printview, $url_query
) {
-
+
$this->__set('_unlim_num_rows', $unlim_num_rows);
$this->__set('_fields_meta', $fields_meta);
$this->__set('_is_count', $is_count);
@@ -261,7 +262,7 @@ class PMA_DisplayResults
$this->__set('_showtable', $showtable);
$this->__set('_printview', $printview);
$this->__set('_url_query', $url_query);
-
+
}
@@ -322,7 +323,7 @@ class PMA_DisplayResults
// 2. Display mode is not "false for all elements" -> updates the
// display mode
if ($the_disp_mode != 'nnnn000000') {
-
+
if (isset($printview) && ($printview == '1')) {
// 2.0 Print view -> set all elements to false!
$do_display['edit_lnk'] = self::NO_EDIT_OR_DELETE; // no edit link
@@ -333,9 +334,9 @@ class PMA_DisplayResults
$do_display['bkm_form'] = (string) '0';
$do_display['text_btn'] = (string) '0';
$do_display['pview_lnk'] = (string) '0';
-
- } elseif ($this->__get ('_is_count') || $this->__get ('_is_analyse')
- || $this->__get ('_is_maint') || $this->__get ('_is_explain')
+
+ } elseif ($this->__get('_is_count') || $this->__get('_is_analyse')
+ || $this->__get('_is_maint') || $this->__get('_is_explain')
) {
// 2.1 Statement is a "SELECT COUNT", a
// "CHECK/ANALYZE/REPAIR/OPTIMIZE", an "EXPLAIN" one or
@@ -346,15 +347,15 @@ class PMA_DisplayResults
$do_display['nav_bar'] = (string) '0';
$do_display['ins_row'] = (string) '0';
$do_display['bkm_form'] = (string) '1';
-
- if ($this->__get ('_is_maint')) {
+
+ if ($this->__get('_is_maint')) {
$do_display['text_btn'] = (string) '1';
} else {
$do_display['text_btn'] = (string) '0';
}
$do_display['pview_lnk'] = (string) '1';
- } elseif ($this->__get ('_is_show')) {
+ } elseif ($this->__get('_is_show')) {
// 2.2 Statement is a "SHOW..."
/**
* 2.2.1
@@ -387,21 +388,21 @@ class PMA_DisplayResults
$do_display['bkm_form'] = (string) '1';
$do_display['text_btn'] = (string) '1';
$do_display['pview_lnk'] = (string) '1';
-
+
} else {
// 2.3 Other statements (ie "SELECT" ones) -> updates
// $do_display['edit_lnk'], $do_display['del_lnk'] and
// $do_display['text_btn'] (keeps other default values)
$prev_table = $fields_meta[0]->table;
$do_display['text_btn'] = (string) '1';
-
+
for ($i = 0; $i < $this->__get('_fields_cnt'); $i++) {
-
+
$is_link = ($do_display['edit_lnk'] != self::NO_EDIT_OR_DELETE)
|| ($do_display['del_lnk'] != self::NO_EDIT_OR_DELETE)
|| ($do_display['sort_lnk'] != '0')
|| ($do_display['ins_row'] != '0');
-
+
// 2.3.2 Displays edit/delete/sort/insert links?
if ($is_link
&& (($fields_meta[$i]->table == '')
@@ -420,11 +421,11 @@ class PMA_DisplayResults
break;
}
} // end if (2.3.2)
-
+
// 2.3.3 Always display print view link
$do_display['pview_lnk'] = (string) '1';
$prev_table = $fields_meta[$i]->table;
-
+
} // end for
} // end if..elseif...else (2.1 -> 2.3)
} // end if (2)
@@ -469,7 +470,7 @@ class PMA_DisplayResults
/**
* Return true if we are executing a query in the form of
* "SELECT * FROM ..."
- *
+ *
* @param array $analyzed_sql the analyzed query
*
* @return boolean
@@ -480,8 +481,8 @@ class PMA_DisplayResults
*/
private function _isSelect($analyzed_sql)
{
- return ! ($this->__get ('_is_count') || $this->__get('_is_export')
- || $this->__get('_is_func') || $this->__get ('_is_analyse'))
+ return ! ($this->__get('_is_count') || $this->__get('_is_export')
+ || $this->__get('_is_func') || $this->__get('_is_analyse'))
&& (count($analyzed_sql[0]['select_expr']) == 0)
&& isset($analyzed_sql[0]['queryflags']['select_from'])
&& (count($analyzed_sql[0]['table_ref']) == 1);
@@ -808,7 +809,9 @@ class PMA_DisplayResults
);
// prepare some options for the End button
- if ($is_innodb && $this->__get('_unlim_num_rows') > $GLOBALS['cfg']['MaxExactCount']) {
+ if ($is_innodb
+ && $this->__get('_unlim_num_rows') > $GLOBALS['cfg']['MaxExactCount']
+ ) {
$input_for_real_end = ' ';
// no backquote around this message
@@ -908,11 +911,11 @@ class PMA_DisplayResults
/**
* Get the headers of the results table
*
- * @param array &$is_display which elements to display
- * @param array $analyzed_sql the analyzed query
- * @param string $sort_expression sort expression
- * @param string $sort_expression_nodirection sort expression without direction
- * @param string $sort_direction sort direction
+ * @param array &$is_display which elements to display
+ * @param array $analyzed_sql the analyzed query
+ * @param string $sort_expression sort expression
+ * @param string $sort_expression_nodirection sort expression without direction
+ * @param string $sort_direction sort direction
*
* @return string html content
*
@@ -958,9 +961,9 @@ class PMA_DisplayResults
= $this->_getUnsortedSqlAndSortByKeyDropDown(
$analyzed_sql, $sort_expression
);
-
- $table_headers_html .= $drop_down_html;
-
+
+ $table_headers_html .= $drop_down_html;
+
}
// Output data needed for grid editing
@@ -981,7 +984,7 @@ class PMA_DisplayResults
$full_or_partial_text_link = null;
$this->__set('_vertical_display', $vertical_display);
-
+
// Display options (if we are not in print view)
if (! (isset($printview) && ($printview == '1'))) {
@@ -1002,7 +1005,7 @@ class PMA_DisplayResults
= $this->_getFeildVisibilityParams(
$directionCondition, $is_display, $full_or_partial_text_link
);
-
+
$table_headers_html .= $button_html;
// 2. Displays the fields' name
@@ -1014,20 +1017,23 @@ class PMA_DisplayResults
// Do not show comments, if using horizontalflipped mode,
// because of space usage
$comments_map = $this->_getTableCommentsArray($direction, $analyzed_sql);
-
+
if ($GLOBALS['cfgRelation']['commwork']
&& $GLOBALS['cfgRelation']['mimework']
&& $GLOBALS['cfg']['BrowseMIME']
&& ! $_SESSION['tmp_user_values']['hide_transformation']
) {
include_once './libraries/transformations.lib.php';
- $this->__set('_mime_map', PMA_getMIME($this->__get('_db'), $this->__get('_table')));
+ $this->__set(
+ '_mime_map',
+ PMA_getMIME($this->__get('_db'), $this->__get('_table'))
+ );
}
// See if we have to highlight any header fields of a WHERE query.
// Uses SQL-Parser results.
$this->_setHighlightedColumnGlobalField($analyzed_sql);
-
+
list($col_order, $col_visib) = $this->_getColumnParams($analyzed_sql);
for ($j = 0; $j < $this->__get('_fields_cnt'); $j++) {
@@ -1044,11 +1050,11 @@ class PMA_DisplayResults
// 2.0 Prepare comment-HTML-wrappers for each row, if defined/enabled.
$comments = $this->_getCommentForRow($comments_map, $fields_meta[$i]);
-
+
$vertical_display = $this->__get('_vertical_display');
if ($is_display['sort_lnk'] == '1') {
-
+
list($order_link, $sorted_headrer_html)
= $this->_getOrderLinkAndSortedHeaderHtml(
$fields_meta[$i], $sort_expression,
@@ -1057,7 +1063,7 @@ class PMA_DisplayResults
$sort_direction, $directionCondition, $col_visib,
$col_visib[$j], $condition_field
);
-
+
$table_headers_html .= $sorted_headrer_html;
$vertical_display['desc'][] = '
name)
. "\n" . $comments . ' ';
} // end else (2.2)
-
+
$this->__set('_vertical_display', $vertical_display);
-
+
} // end for
-
+
// Display column at rightside - checkboxes or empty column
$table_headers_html .= $this->_getColumnAtRightSide(
$is_display, $directionCondition, $full_or_partial_text_link,
@@ -1103,26 +1109,26 @@ class PMA_DisplayResults
return $table_headers_html;
} // end of the '_getTableHeaders()' function
-
-
+
+
/**
* Prepare unsorted sql query and sort by key drop down
- *
- * @param array $analyzed_sql the analyzed query
- * @param string $sort_expression sort expression
- *
+ *
+ * @param array $analyzed_sql the analyzed query
+ * @param string $sort_expression sort expression
+ *
* @return array two element array - $unsorted_sql_query, $drop_down_html
- *
+ *
* @access private
- *
+ *
* @see _getTableHeaders()
*/
private function _getUnsortedSqlAndSortByKeyDropDown(
$analyzed_sql, $sort_expression
) {
-
+
$drop_down_html = '';
-
+
// Just as fallback
$unsorted_sql_query = $this->__get('_sql_query');
if (isset($analyzed_sql[0]['unsorted_query'])) {
@@ -1141,9 +1147,11 @@ class PMA_DisplayResults
&& isset($analyzed_sql[0]['table_ref'])
&& (count($analyzed_sql[0]['table_ref']) == 1)
) {
-
// grab indexes data:
- $indexes = PMA_Index::getFromTable($this->__get('_table'), $this->__get('_db'));
+ $indexes = PMA_Index::getFromTable(
+ $this->__get('_table'),
+ $this->__get('_db')
+ );
// do we have any index?
if ($indexes) {
@@ -1153,12 +1161,12 @@ class PMA_DisplayResults
);
}
}
-
+
return array($unsorted_sql_query, $drop_down_html);
-
+
} // end of the '_getUnsortedSqlAndSortByKeyDropDown()' function
-
+
/**
* Prepare sort by key dropdown - html code segment
*
@@ -1246,31 +1254,31 @@ class PMA_DisplayResults
return $drop_down_html;
} // end of the '_getSortByKeyDropDown()' function
-
-
+
+
/**
* Set column span, row span and prepare html with full/partial
* text button or link
- *
+ *
* @param boolean $directionCondition display direction horizontal or
* horizontalflipped
* @param array &$is_display which elements to display
* @param string $full_or_partial_text_link full/partial link or text button
- *
+ *
* @return array 3 element array - $colspan, $rowspan, $button_html
- *
+ *
* @access private
- *
+ *
* @see _getTableHeaders()
*/
private function _getFeildVisibilityParams(
$directionCondition, &$is_display, $full_or_partial_text_link
) {
-
+
$button_html = '';
$colspan = $rowspan = null;
$vertical_display = $this->__get('_vertical_display');
-
+
// 1. Displays the full/partial text button (part 1)...
if ($directionCondition) {
@@ -1300,7 +1308,8 @@ class PMA_DisplayResults
if ($directionCondition) {
- $button_html .= ' '
+ $button_html .= ''
+ . ' '
. ''
. '';
@@ -1368,33 +1377,33 @@ class PMA_DisplayResults
// disabled to match the rest of the table
$button_html .= ' ';
}
-
+
$this->__set('_vertical_display', $vertical_display);
-
+
return array($colspan, $rowspan, $button_html);
-
+
} // end of the '_getFeildVisibilityParams()' function
-
-
+
+
/**
* Get table comments as array
- *
- * @param boolean $directionCondition display direction horizontal
- * or horizontalflipped
- * @param array $analyzed_sql the analyzed query
- *
+ *
+ * @param boolean $direction display direction, horizontal
+ * or horizontalflipped
+ * @param array $analyzed_sql the analyzed query
+ *
* @return array $comments_map table comments when condition true
* null when condition falls
- *
+ *
* @access private
- *
+ *
* @see _getTableHeaders()
*/
private function _getTableCommentsArray($direction, $analyzed_sql)
{
-
+
$comments_map = null;
-
+
if ($GLOBALS['cfg']['ShowBrowseComments']
&& ($direction != self::DISP_DIR_HORIZONTAL_FLIPPED)
) {
@@ -1407,26 +1416,26 @@ class PMA_DisplayResults
}
}
}
-
+
return $comments_map;
-
+
} // end of the '_getTableCommentsArray()' function
-
-
+
+
/**
* Set global array for store highlighted header fields
- *
- * @param array $analyzed_sql the analyzed query
- *
+ *
+ * @param array $analyzed_sql the analyzed query
+ *
* @return void
- *
+ *
* @access private
- *
+ *
* @see _getTableHeaders()
*/
private function _setHighlightedColumnGlobalField($analyzed_sql)
{
-
+
$highlight_columns = array();
if (isset($analyzed_sql) && isset($analyzed_sql[0])
&& isset($analyzed_sql[0]['where_clause_identifiers'])
@@ -1443,11 +1452,11 @@ class PMA_DisplayResults
}
}
}
-
+
$this->__set('_highlight_columns', $highlight_columns);
-
+
} // end of the '_setHighlightedColumnGlobalField()' function
-
+
/**
* Prepare data for column restoring and show/hide
@@ -1725,11 +1734,11 @@ class PMA_DisplayResults
}
return $comments;
} // end of the '_getCommentForRow()' function
-
-
+
+
/**
* Prepare parameters and html for sorted table header fields
- *
+ *
* @param array $fields_meta set of field properties
* @param string $sort_expression sort expression
* @param string $sort_expression_nodirection sort expression without direction
@@ -1744,13 +1753,13 @@ class PMA_DisplayResults
* @param boolean $col_visib column is visible(false)
* array column isn't visible(string array)
* @param string $col_visib_j element of $col_visib array
- * @param boolean $condition_field whether the column is a part of the
- * where clause
- *
+ * @param boolean $condition_field whether the column is a part of
+ * the where clause
+ *
* @return array 2 element array - $order_link, $sorted_header_html
- *
+ *
* @access private
- *
+ *
* @see _getTableHeaders()
*/
private function _getOrderLinkAndSortedHeaderHtml(
@@ -1761,7 +1770,7 @@ class PMA_DisplayResults
) {
$sorted_header_html = '';
-
+
// Checks if the table name is required; it's the case
// for a query with a "JOIN" statement and if the column
// isn't aliased, or in queries like
@@ -1852,11 +1861,11 @@ class PMA_DisplayResults
$fields_meta, $order_link, $comments
);
}
-
+
return array($order_link, $sorted_header_html);
-
+
} // end of the '_getOrderLinkAndSortedHeaderHtml()' function
-
+
/**
* Check whether the column is sorted
@@ -1890,8 +1899,8 @@ class PMA_DisplayResults
// SELECT p.*, FROM_UNIXTIME(p.temps) FROM mytable AS p
// (and try clicking on each column's header twice)
if (! empty($sort_tbl)
- && (strpos($sort_expression_nodirection, $sort_tbl) === false)
- && (strpos($sort_expression_nodirection, '(') === false)
+ && strpos($sort_expression_nodirection, $sort_tbl) === false
+ && strpos($sort_expression_nodirection, '(') === false
) {
$new_sort_expression_nodirection = $sort_tbl
. $sort_expression_nodirection;
@@ -1902,8 +1911,8 @@ class PMA_DisplayResults
$is_in_sort = false;
$sort_name = str_replace('`', '', $sort_tbl) . $name_to_use_in_sort;
- if (($sort_name == str_replace('`', '', $new_sort_expression_nodirection))
- || ($sort_name == str_replace('`', '', $sort_expression_nodirection))
+ if ($sort_name == str_replace('`', '', $new_sort_expression_nodirection)
+ || $sort_name == str_replace('`', '', $sort_expression_nodirection)
) {
$is_in_sort = true;
}
@@ -2168,31 +2177,31 @@ class PMA_DisplayResults
} // end of the '_getDraggableClassForNonSortableColumns()' function
-
+
/**
* Prepare column to show at right side - check boxes or empty column
- *
+ *
* @param array &$is_display which elements to display
* @param boolean $directionCondition display direction horizontal
* or horizontalflipped
* @param string $full_or_partial_text_link full/partial link or text button
* @param string $colspan column span of table header
* @param string $rowspan row span of table header
- *
+ *
* @return string html content
- *
+ *
* @access private
- *
+ *
* @see _getTableHeaders()
*/
private function _getColumnAtRightSide(
&$is_display, $directionCondition, $full_or_partial_text_link,
$colspan, $rowspan
) {
-
+
$right_column_html = '';
$vertical_display = $this->__get('_vertical_display');
-
+
// Displays the needed checkboxes at the right
// column of the result table header if possible and required...
if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT)
@@ -2241,13 +2250,13 @@ class PMA_DisplayResults
. '>' . "\n";
} // end vertical mode
}
-
+
$this->__set('_vertical_display', $vertical_display);
-
+
return $right_column_html;
-
+
} // end of the '_getColumnAtRightSide()' function
-
+
/**
* Prepares the display for a value
@@ -2404,7 +2413,7 @@ class PMA_DisplayResults
// query without conditions to shorten URLs when needed, 200 is just
// guess, it should depend on remaining URL length
$url_sql_query = $this->_getUrlSqlQuery($analyzed_sql);
-
+
$vertical_display = $this->__get('_vertical_display');
if (! is_array($map)) {
@@ -2417,7 +2426,7 @@ class PMA_DisplayResults
$vertical_display['delete'] = array();
$vertical_display['data'] = array();
$vertical_display['row_delete'] = array();
- $this->__set('_vertical_display', $vertical_display);
+ $this->__set('_vertical_display', $vertical_display);
// name of the class added to all grid editable elements
$grid_edit_class = 'grid_edit';
@@ -2468,10 +2477,13 @@ class PMA_DisplayResults
*/
list($where_clause, $clause_is_unique, $condition_array)
= $this->getCommonFunctions()->getUniqueCondition(
- $dt_result, $this->__get('_fields_cnt'), $this->__get('_fields_meta'), $row
+ $dt_result,
+ $this->__get('_fields_cnt'),
+ $this->__get('_fields_meta'),
+ $row
);
$where_clause_html = urlencode($where_clause);
-
+
// In print view these variable needs toinitialized
$del_url = $del_query = $del_str = $edit_anchor_class
= $edit_str = $js_conf = $copy_url = $copy_str = null;
@@ -2548,7 +2560,7 @@ class PMA_DisplayResults
$grid_edit_class, $col_visib, $where_clause,
$url_sql_query, $analyzed_sql, $directionCondition
);
-
+
// 3. Displays the modify/delete links on the right if required
if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT)
|| ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH))
@@ -2569,13 +2581,13 @@ class PMA_DisplayResults
} // end if
// 4. Gather links of del_urls and edit_urls in an array for later
- // output
+ // output
$this->_gatherLinksForLaterOutputs(
$row_no, $is_display, $where_clause, $where_clause_html, $js_conf,
$del_url, $del_query, $del_str, $edit_anchor_class, $edit_str,
$copy_url, $copy_str, $alternating_color_class, $condition_array
);
-
+
$table_body_html .= $directionCondition ? "\n" : '';
$row_no++;
@@ -2584,11 +2596,11 @@ class PMA_DisplayResults
return $table_body_html;
} // end of the '_getTableBody()' function
-
-
+
+
/**
* Prepare rows
- *
+ *
* @param integer &$dt_result the link id associated to the query
* which results have to be displayed
* @param array $row current row data
@@ -2605,9 +2617,9 @@ class PMA_DisplayResults
* @param boolean $directionCondition the directional condition
*
* @return string $row_values_html html content
- *
+ *
* @access private
- *
+ *
* @see _getTableBody()
*/
private function _getRowValues(
@@ -2615,16 +2627,16 @@ class PMA_DisplayResults
$grid_edit_class, $col_visib, $where_clause,
$url_sql_query, $analyzed_sql, $directionCondition
) {
-
+
$row_values_html = '';
-
+
// Following variable are needed for use in isset/empty or
// use with array indexes/safe use in foreach
$sql_query = $this->__get('_sql_query');
$fields_meta = $this->__get('_fields_meta');
$highlight_columns = $this->__get('_highlight_columns');
$mime_map = $this->__get('_mime_map');
-
+
for ($j = 0; $j < $this->__get('_fields_cnt'); ++$j) {
// assign $i with appropriate column order
@@ -2721,7 +2733,7 @@ class PMA_DisplayResults
= PMA_generate_common_url($_url_params);
$vertical_display = $this->__get('_vertical_display');
-
+
if ($meta->numeric == 1) {
// n u m e r i c
@@ -2793,19 +2805,19 @@ class PMA_DisplayResults
$vertical_display['rowdata'][$i][$row_no]
= $vertical_display['data'][$row_no][$i];
}
-
+
$this->__set('_vertical_display', $vertical_display);
-
+
} // end for
-
+
return $row_values_html;
-
+
} // end of the '_getRowValues()' function
-
-
+
+
/**
* Gather delete/edit url links for further outputs
- *
+ *
* @param integer $row_no the index of current row
* @param array $is_display which elements to display
* @param string $where_clause where clause
@@ -2819,13 +2831,13 @@ class PMA_DisplayResults
* @param string $copy_url the url for copy row
* @param string $copy_str the label for copy row
* @param string $alternating_color_class class for display two colors in rows
- * @param array $condition_array array of keys
+ * @param array $condition_array array of keys
* (primary,unique,condition)
- *
+ *
* @return void
- *
+ *
* @access private
- *
+ *
* @see _getTableBody()
*/
private function _gatherLinksForLaterOutputs(
@@ -2833,9 +2845,9 @@ class PMA_DisplayResults
$del_url, $del_query, $del_str, $edit_anchor_class, $edit_str,
$copy_url, $copy_str, $alternating_color_class, $condition_array
) {
-
+
$vertical_display = $this->__get('_vertical_display');
-
+
if (! isset($vertical_display['edit'][$row_no])) {
$vertical_display['edit'][$row_no] = '';
$vertical_display['copy'][$row_no] = '';
@@ -2907,11 +2919,11 @@ class PMA_DisplayResults
} else {
unset($vertical_display['delete'][$row_no]);
}
-
+
$this->__set('_vertical_display', $vertical_display);
-
+
} // end of the '_gatherLinksForLaterOutputs()' function
-
+
/**
* Get url sql query without conditions to shorten URLs
@@ -2954,7 +2966,7 @@ class PMA_DisplayResults
/**
* Get column order and column visibility
- *
+ *
* @param array $analyzed_sql the analyzed query
*
* @return array 2 element array - $col_order, $col_visib
@@ -3108,7 +3120,7 @@ class PMA_DisplayResults
) {
$goto = $this->__get('_goto');
-
+
if ($del_lnk == self::DELETE_ROW) { // delete row case
$_url_params = array(
@@ -3244,7 +3256,7 @@ class PMA_DisplayResults
$grid_edit_class, $not_null_class, $relation_class,
$hide_class, $field_type_class, $row_no
) {
-
+
$printview = $this->__get('_printview');
$class = 'data ' . $grid_edit_class . ' ' . $not_null_class . ' '
@@ -3609,8 +3621,8 @@ class PMA_DisplayResults
$transformation_plugin, $default_function, $transform_options,
$is_field_truncated, $analyzed_sql, &$dt_result, $col_index
) {
-
- $is_analyse = $this->__get ('_is_analyse');
+
+ $is_analyse = $this->__get('_is_analyse');
if (! isset($column) || is_null($column)) {
@@ -3720,7 +3732,7 @@ class PMA_DisplayResults
/**
* Get the resulted table with the vertical direction mode.
- *
+ *
* @param array $analyzed_sql the analyzed query
*
* @return string html content
@@ -3750,10 +3762,8 @@ class PMA_DisplayResults
}
$vertical_table_html .= $vertical_display['textbtn']
- . $this->_getCheckBoxesForMultipleRowOperations(
- '_left'
- )
- . ' ' . "\n";
+ . $this->_getCheckBoxesForMultipleRowOperations('_left')
+ . '' . "\n";
} // end if
// Prepares "edit" link at top if required
@@ -3810,7 +3820,7 @@ class PMA_DisplayResults
if (($cell_displayed != 0)
&& ($_SESSION['tmp_user_values']['repeat_cells'] != 0)
- && !($cell_displayed % $_SESSION['tmp_user_values']['repeat_cells'])
+ && ! ($cell_displayed % $_SESSION['tmp_user_values']['repeat_cells'])
) {
$vertical_table_html .= $val;
}
@@ -3881,16 +3891,16 @@ class PMA_DisplayResults
/**
* Prepare edit, copy and delete links for verticle table
*
- * @param string $operation edit/copy/delete
+ * @param string $operation edit/copy/delete
*
- * @return string $links_html html content
+ * @return string $links_html html content
*
* @access private
*
* @see _getVerticalTable()
*/
- private function _getOperationLinksForVerticleTable($operation) {
-
+ private function _getOperationLinksForVerticleTable($operation)
+ {
$link_html = '' . "\n";
$vertical_display = $this->__get('_vertical_display');
@@ -3921,7 +3931,7 @@ class PMA_DisplayResults
/**
* Get checkboxes for multiple row data operations
*
- * @param string $dir _left / _right
+ * @param string $dir _left / _right
*
* @return $checkBoxes_html html content
*
@@ -4245,10 +4255,7 @@ class PMA_DisplayResults
$pre_count = '~';
$after_count = $this->getCommonFunctions()->showHint(
PMA_sanitize(
- __(
- 'May be approximate. See [a@./Documentation.html'
- . '#faq3_11@Documentation]FAQ 3.11[/a]'
- )
+ __('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]')
)
);
} else {
@@ -4319,7 +4326,7 @@ class PMA_DisplayResults
}
}
-
+
if (($is_display['nav_bar'] == '1')
&& empty($analyzed_sql[0]['limit_clause'])
) {
@@ -4353,13 +4360,13 @@ class PMA_DisplayResults
}
- $tabs = '(\'' . join('\',\'', $target) . '\')';
+ $tabs = '(\'' . join('\',\'', $target) . '\')';
if (! strlen($this->__get('_table'))) {
$exist_rel = false;
} else {
// This method set the values for $map array
- $this->_setParamForLinkForiegnKeyRelatedTables($map);
+ $this->_setParamForLinkForiegnKeyRelatedTables($map);
} // end if
// end 2b
@@ -4381,7 +4388,7 @@ class PMA_DisplayResults
} // end if
$this->__set('_vertical_display', null);
-
+
$table_html .= '' . "\n"
. '';
@@ -4408,7 +4415,7 @@ class PMA_DisplayResults
} elseif (! isset($printview) || ($printview != '1')) {
$table_html .= "\n" . ' ' . "\n";
}
-
+
// 6. ----- Prepare "Query results operations"
if (! isset($printview) || ($printview != '1')) {
@@ -4520,7 +4527,7 @@ class PMA_DisplayResults
) {
$fields_meta = $this->__get('_fields_meta'); // To use array indexes
-
+
if (! empty($sort_expression_nodirection)) {
if (strpos($sort_expression_nodirection, '.') === false) {
@@ -4637,7 +4644,7 @@ class PMA_DisplayResults
$sorted_column_message, $limit_clause, $total,
$pos_next, $pre_count, $after_count
) {
-
+
$unlim_num_rows = $this->__get('_unlim_num_rows'); // To use in isset()
if (isset($unlim_num_rows) && ($unlim_num_rows != $total)) {
@@ -4730,21 +4737,21 @@ class PMA_DisplayResults
} // end of the '_setMessageInformation()' function
-
+
/**
* Set the value of $map array for linking foreign key related tables
- *
- * @param array $map the list of relations
- *
+ *
+ * @param array &$map the list of relations
+ *
* @return void
- *
+ *
* @access private
- *
+ *
* @see getTable()
*/
private function _setParamForLinkForiegnKeyRelatedTables(&$map)
{
-
+
// To be able to later display a link to the related table,
// we verify both types of relations: either those that are
// native foreign keys or those defined in the phpMyAdmin
@@ -4771,9 +4778,9 @@ class PMA_DisplayResults
);
} // end while
} // end if
-
+
} // end of the '_setParamForLinkForiegnKeyRelatedTables()' function
-
+
/**
* Prepare multi field edit/delete links
@@ -4827,7 +4834,9 @@ class PMA_DisplayResults
$delete_text, 'b_drop.png', 'delete'
);
- if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == self::QUERY_TYPE_SELECT) {
+ if (isset($analyzed_sql[0])
+ && $analyzed_sql[0]['querytype'] == self::QUERY_TYPE_SELECT
+ ) {
$links_html .= $this->getCommonFunctions()->getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_export',
__('Export'), 'b_tblexport.png', 'export'
@@ -4852,7 +4861,10 @@ class PMA_DisplayResults
// in the multi-edit and multi-delete form
list($where_clause, $clause_is_unique, $condition_array)
= $this->getCommonFunctions()->getUniqueCondition(
- $dt_result, $this->__get('_fields_cnt'), $this->__get('_fields_meta'), $row
+ $dt_result,
+ $this->__get('_fields_cnt'),
+ $this->__get('_fields_meta'),
+ $row
);
// reset to first row for the loop in _getTableBody()
@@ -4867,44 +4879,44 @@ class PMA_DisplayResults
} // end of the '_getMultiRowOperationLinks()' function
-
+
/**
* Prepare table navigation bar at the top or bottom
- *
- * @param integer $pos_next the offset for the "next" page
- * @param integer $pos_prev the offset for the "previous" page
- * @param string $place the place to show navigation
- * @param string $empty_line empty line depend on the $place
- * @param boolean $is_innodb whether its InnoDB or not
- *
+ *
+ * @param integer $pos_next the offset for the "next" page
+ * @param integer $pos_prev the offset for the "previous" page
+ * @param string $place the place to show navigation
+ * @param string $empty_line empty line depend on the $place
+ * @param boolean $is_innodb whether its InnoDB or not
+ *
* @return string html content of navigation bar
- *
+ *
* @access private
- *
+ *
* @see _getTable()
*/
private function _getPlacedTableNavigatoins(
$pos_next, $pos_prev, $place, $empty_line, $is_innodb
) {
-
+
$navigation_html = '';
-
+
if ($place == self::PLACE_BOTTOM_DIRECTION_DROPDOWN) {
$navigation_html .= ' ' . "\n";
}
-
+
$navigation_html .= $this->_getTableNavigation(
$pos_next, $pos_prev, 'top_direction_dropdown', $is_innodb
);
-
+
if ($place == self::PLACE_TOP_DIRECTION_DROPDOWN) {
$navigation_html .= "\n";
}
-
+
return $navigation_html;
-
+
} // end of the '_getPlacedTableNavigatoins()' function
-
+
/**
* Get operations that are available on results.
@@ -4950,7 +4962,10 @@ class PMA_DisplayResults
$this->getCommonFunctions()->getIcon(
'b_print.png', __('Print view'), true
),
- '', true, true, 'print_view'
+ '',
+ true,
+ true,
+ 'print_view'
)
. "\n";
@@ -4965,7 +4980,10 @@ class PMA_DisplayResults
'b_print.png',
__('Print view (with full texts)'), true
),
- '', true, true, 'print_view'
+ '',
+ true,
+ true,
+ 'print_view'
)
. "\n";
unset($_url_params['display_text']);
@@ -4992,7 +5010,7 @@ class PMA_DisplayResults
$_url_params['single_table'] = 'true';
}
- if (!$header_shown) {
+ if (! $header_shown) {
$results_operations_html .= $header;
$header_shown = true;
}
@@ -5007,7 +5025,7 @@ class PMA_DisplayResults
* first table of this database, so that tbl_export.php and
* the script it calls do not fail
*/
- if (empty($_url_params['table']) && !empty($_url_params['db'])) {
+ if (empty($_url_params['table']) && ! empty($_url_params['db'])) {
$_url_params['table'] = PMA_DBI_fetch_value("SHOW TABLES");
/* No result (probably no database selected) */
if ($_url_params['table'] === false) {
@@ -5020,7 +5038,10 @@ class PMA_DisplayResults
$this->getCommonFunctions()->getIcon(
'b_tblexport.png', __('Export'), true
),
- '', true, true, ''
+ '',
+ true,
+ true,
+ ''
)
. "\n";
@@ -5030,7 +5051,10 @@ class PMA_DisplayResults
$this->getCommonFunctions()->getIcon(
'b_chart.png', __('Display chart'), true
),
- '', true, true, ''
+ '',
+ true,
+ true,
+ ''
)
. "\n";
@@ -5052,7 +5076,10 @@ class PMA_DisplayResults
$this->getCommonFunctions()->getIcon(
'b_globe.gif', __('Visualize GIS data'), true
),
- '', true, true, ''
+ '',
+ true,
+ true,
+ ''
)
. "\n";
}
@@ -5115,7 +5142,8 @@ class PMA_DisplayResults
*
* @access private
*
- * @see _getDataCellForBlobColumns(), _getDataCellForGeometryColumns(),
+ * @see _getDataCellForBlobColumns(),
+ * _getDataCellForGeometryColumns(),
* _getDataCellForNonNumericAndNonBlobColumns(),
* _getSortedColumnMessage()
*/
@@ -5123,7 +5151,7 @@ class PMA_DisplayResults
$category, $content, $transformation_plugin, $transform_options,
$default_function, $meta, $url_params = array()
) {
-
+
$result = '[' . $category;
if (is_null($content)) {
@@ -5218,7 +5246,7 @@ class PMA_DisplayResults
$transformation_plugin, $default_function, $nowrap, $where_comparison,
$transform_options, $is_field_truncated
) {
-
+
$printview = $this->__get('_printview');
$result = ' ', $buffer);
return $buffer;
- }
+ }
}
?>
diff --git a/libraries/Menu.class.php b/libraries/Menu.class.php
index dc264560d5..d6de4af77e 100644
--- a/libraries/Menu.class.php
+++ b/libraries/Menu.class.php
@@ -40,20 +40,6 @@ class PMA_Menu
private $_common_functions;
-
- /**
- * Set CommmonFunctions
- *
- * @param PMA_CommonFunctions $commonFunctions
- *
- * @return void
- */
- public function setCommonFunctions(PMA_CommonFunctions $commonFunctions)
- {
- $this->_common_functions = $commonFunctions;
- }
-
-
/**
* Get CommmonFunctions
*
diff --git a/libraries/Table.class.php b/libraries/Table.class.php
index 570a1519cb..891240a1bf 100644
--- a/libraries/Table.class.php
+++ b/libraries/Table.class.php
@@ -68,20 +68,6 @@ class PMA_Table
private $_common_functions;
-
- /**
- * Set CommmonFunctions
- *
- * @param PMA_CommonFunctions $commonFunctions
- *
- * @return void
- */
- public function setCommonFunctions(PMA_CommonFunctions $commonFunctions)
- {
- $this->_common_functions = $commonFunctions;
- }
-
-
/**
* Get CommmonFunctions
*
diff --git a/libraries/TableSearch.class.php b/libraries/TableSearch.class.php
index 5c96dd6c0f..457e8d16af 100644
--- a/libraries/TableSearch.class.php
+++ b/libraries/TableSearch.class.php
@@ -83,20 +83,6 @@ class PMA_TableSearch
private $_common_functions;
-
- /**
- * Set CommmonFunctions
- *
- * @param PMA_CommonFunctions $commonFunctions
- *
- * @return void
- */
- public function setCommonFunctions(PMA_CommonFunctions $commonFunctions)
- {
- $this->_common_functions = $commonFunctions;
- }
-
-
/**
* Get CommmonFunctions
*
diff --git a/libraries/schema/Pdf_Relation_Schema.class.php b/libraries/schema/Pdf_Relation_Schema.class.php
index 83bed4e08f..42befe9998 100644
--- a/libraries/schema/Pdf_Relation_Schema.class.php
+++ b/libraries/schema/Pdf_Relation_Schema.class.php
@@ -37,19 +37,6 @@ class PMA_Schema_PDF extends PMA_PDF
private $_ff = PMA_PDF_FONT;
private $_common_functions;
- /**
- * Set CommmonFunctions
- *
- * @param PMA_CommonFunctions $commonFunctions
- *
- * @return void
- */
- public function setCommonFunctions(PMA_CommonFunctions $commonFunctions)
- {
- $this->_common_functions = $commonFunctions;
- }
-
-
/**
* Get CommmonFunctions
*
@@ -406,19 +393,6 @@ class Table_Stats
private $_ff = PMA_PDF_FONT;
private $_common_functions;
- /**
- * Set CommmonFunctions
- *
- * @param PMA_CommonFunctions $commonFunctions
- *
- * @return void
- */
- public function setCommonFunctions(PMA_CommonFunctions $commonFunctions)
- {
- $this->_common_functions = $commonFunctions;
- }
-
-
/**
* Get CommmonFunctions
*
@@ -886,6 +860,20 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
private $leftMargin = 10;
private $rightMargin = 10;
private $_tablewidth;
+ private $_common_functions;
+
+ /**
+ * Get CommmonFunctions
+ *
+ * @return CommonFunctions object
+ */
+ public function getCommonFunctions()
+ {
+ if (is_null($this->_common_functions)) {
+ $this->_common_functions = PMA_CommonFunctions::getInstance();
+ }
+ return $this->_common_functions;
+ }
/**
* The "PMA_Pdf_Relation_Schema" constructor
diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php
index fb72734ac7..e66645b970 100644
--- a/libraries/schema/User_Schema.class.php
+++ b/libraries/schema/User_Schema.class.php
@@ -25,20 +25,6 @@ class PMA_User_Schema
public $action;
private $_common_functions;
-
- /**
- * Set CommmonFunctions
- *
- * @param PMA_CommonFunctions $commonFunctions
- *
- * @return void
- */
- public function setCommonFunctions(PMA_CommonFunctions $commonFunctions)
- {
- $this->_common_functions = $commonFunctions;
- }
-
-
/**
* Get CommmonFunctions
*
diff --git a/main.php b/main.php
index e158e29b27..a58a938b09 100644
--- a/main.php
+++ b/main.php
@@ -91,7 +91,7 @@ if ($server > 0
/**
* Displays the mysql server related links
*/
- if ($server > 0 && !PMA_DRIZZLE) {
+ if ($server > 0 && ! PMA_DRIZZLE) {
include_once 'libraries/check_user_privileges.lib.php';
// Logout for advanced authentication
@@ -120,10 +120,22 @@ if ($server > 0
. ' ' . "\n"
. ' ' . __('Server connection collation') . "\n"
// put the doc link in the form so that it appears on the same line
- . $common_functions->showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . ': ' . "\n"
+ . $common_functions->showMySQLDocu(
+ 'MySQL_Database_Administration',
+ 'Charset-connection'
+ )
+ . ': ' . "\n"
. ' ' . "\n"
- . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true)
+ . PMA_generateCharsetDropdownBox(
+ PMA_CSDROPDOWN_COLLATION,
+ 'collation_connection',
+ 'select_collation_connection',
+ $collation_connection,
+ true,
+ 4,
+ true
+ )
. ' ' . "\n"
. ' ' . "\n";
} // end of if ($server > 0 && !PMA_DRIZZLE)
@@ -176,13 +188,22 @@ echo '';
if ($server > 0 && $GLOBALS['cfg']['ShowServerInfo']) {
-
+
echo '
';
echo '
' . __('Database server') . ' ';
echo '
' . "\n";
- PMA_printListItem(__('Server') . ': ' . $server_info, 'li_server_info');
- PMA_printListItem(__('Software') . ': ' . $common_functions->getServerType(), 'li_server_type');
- PMA_printListItem(__('Software version') . ': ' . PMA_MYSQL_STR_VERSION . ' - ' . PMA_MYSQL_VERSION_COMMENT, 'li_server_version');
+ PMA_printListItem(
+ __('Server') . ': ' . $server_info,
+ 'li_server_info'
+ );
+ PMA_printListItem(
+ __('Software') . ': ' . $common_functions->getServerType(),
+ 'li_server_type'
+ );
+ PMA_printListItem(
+ __('Software version') . ': ' . PMA_MYSQL_STR_VERSION . ' - ' . PMA_MYSQL_VERSION_COMMENT,
+ 'li_server_version'
+ );
PMA_printListItem(
__('Protocol version') . ': ' . PMA_DBI_get_proto_info(),
'li_mysql_proto'
@@ -221,16 +242,25 @@ if ($GLOBALS['cfg']['ShowServerInfo'] || $GLOBALS['cfg']['ShowPhpInfo']) {
__('Database client version') . ': ' . $client_version_str,
'li_mysql_client_version'
);
+
+ $php_ext_string = __('PHP extension') . ': '
+ . $GLOBALS['cfg']['Server']['extension'] . ' '
+ . $common_functions->showPHPDocu(
+ 'book.' . $GLOBALS['cfg']['Server']['extension'] . '.php'
+ );
PMA_printListItem(
- __('PHP extension') . ': ' . $GLOBALS['cfg']['Server']['extension']. ' '
- . $common_functions->showPHPDocu('book.' . $GLOBALS['cfg']['Server']['extension'] . '.php'),
+ $php_ext_string,
'li_used_php_extension'
);
}
}
if ($cfg['ShowPhpInfo']) {
- PMA_printListItem(__('Show PHP information'), 'li_phpinfo', 'phpinfo.php?' . $common_url_query);
+ PMA_printListItem(
+ __('Show PHP information'),
+ 'li_phpinfo',
+ 'phpinfo.php?' . $common_url_query
+ );
}
echo ' ';
echo '
';
@@ -242,18 +272,64 @@ echo '
';
$class = null;
// We rely on CSP to allow access to http://www.phpmyadmin.net, but IE lacks
// support here and does not allow request to http once using https.
-if ($GLOBALS['cfg']['VersionCheck'] && (! $GLOBALS['PMA_Config']->get('is_https') || PMA_USR_BROWSER_AGENT != 'IE')) {
+if ($GLOBALS['cfg']['VersionCheck']
+ && (! $GLOBALS['PMA_Config']->get('is_https') || PMA_USR_BROWSER_AGENT != 'IE')
+) {
$class = 'jsversioncheck';
}
-PMA_printListItem(__('Version information') . ': ' . PMA_VERSION, 'li_pma_version', null, null, null, null, $class);
-PMA_printListItem(__('Documentation'), 'li_pma_docs', 'Documentation.html', null, '_blank');
-PMA_printListItem(__('Wiki'), 'li_pma_wiki', PMA_linkURL('http://wiki.phpmyadmin.net/'), null, '_blank');
+PMA_printListItem(
+ __('Version information') . ': ' . PMA_VERSION,
+ 'li_pma_version',
+ null,
+ null,
+ null,
+ null,
+ $class
+);
+PMA_printListItem(
+ __('Documentation'),
+ 'li_pma_docs',
+ 'Documentation.html',
+ null,
+ '_blank'
+);
+PMA_printListItem(
+ __('Wiki'),
+ 'li_pma_wiki',
+ PMA_linkURL('http://wiki.phpmyadmin.net/'),
+ null,
+ '_blank'
+);
// does not work if no target specified, don't know why
-PMA_printListItem(__('Official Homepage'), 'li_pma_homepage', PMA_linkURL('http://www.phpMyAdmin.net/'), null, '_blank');
-PMA_printListItem(__('Contribute'), 'li_pma_contribute', PMA_linkURL('http://www.phpmyadmin.net/home_page/improve.php'), null, '_blank');
-PMA_printListItem(__('Get support'), 'li_pma_support', PMA_linkURL('http://www.phpmyadmin.net/home_page/support.php'), null, '_blank');
-PMA_printListItem(__('List of changes'), 'li_pma_changes', PMA_linkURL('changelog.php'), null, '_blank');
+PMA_printListItem(
+ __('Official Homepage'),
+ 'li_pma_homepage',
+ PMA_linkURL('http://www.phpMyAdmin.net/'),
+ null,
+ '_blank'
+);
+PMA_printListItem(
+ __('Contribute'),
+ 'li_pma_contribute',
+ PMA_linkURL('http://www.phpmyadmin.net/home_page/improve.php'),
+ null,
+ '_blank'
+);
+PMA_printListItem(
+ __('Get support'),
+ 'li_pma_support',
+ PMA_linkURL('http://www.phpmyadmin.net/home_page/support.php'),
+ null,
+ '_blank'
+);
+PMA_printListItem(
+ __('List of changes'),
+ 'li_pma_changes',
+ PMA_linkURL('changelog.php'),
+ null,
+ '_blank'
+);
?>
@@ -278,7 +354,10 @@ if ($server != 0
&& $cfg['Server']['user'] == 'root'
&& $cfg['Server']['password'] == ''
) {
- trigger_error(__('Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole by setting a password for user \'root\'.'), E_USER_WARNING);
+ trigger_error(
+ __('Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole by setting a password for user \'root\'.'),
+ E_USER_WARNING
+ );
}
/**
@@ -286,7 +365,10 @@ if ($server != 0
* break it, see bug 1063821.
*/
if (@extension_loaded('mbstring') && @ini_get('mbstring.func_overload') > 1) {
- trigger_error(__('You have enabled mbstring.func_overload in your PHP configuration. This option is incompatible with phpMyAdmin and might cause some data to be corrupted!'), E_USER_WARNING);
+ trigger_error(
+ __('You have enabled mbstring.func_overload in your PHP configuration. This option is incompatible with phpMyAdmin and might cause some data to be corrupted!'),
+ E_USER_WARNING
+ );
}
/**
@@ -294,7 +376,10 @@ if (@extension_loaded('mbstring') && @ini_get('mbstring.func_overload') > 1) {
* to tell user something might be broken without it, see bug #1063149.
*/
if (! @extension_loaded('mbstring')) {
- trigger_error(__('The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.'), E_USER_WARNING);
+ trigger_error(
+ __('The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.'),
+ E_USER_WARNING
+ );
}
/**
@@ -302,14 +387,22 @@ if (! @extension_loaded('mbstring')) {
*/
$gc_time = (int)@ini_get('session.gc_maxlifetime');
if ($gc_time < $GLOBALS['cfg']['LoginCookieValidity'] ) {
- trigger_error(__('Your PHP parameter [a@http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime@_blank]session.gc_maxlifetime[/a] is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'), E_USER_WARNING);
+ trigger_error(
+ __('Your PHP parameter [a@http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime@_blank]session.gc_maxlifetime[/a] is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'),
+ E_USER_WARNING
+ );
}
/**
* Check whether LoginCookieValidity is limited by LoginCookieStore.
*/
-if ($GLOBALS['cfg']['LoginCookieStore'] != 0 && $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity']) {
- trigger_error(__('Login cookie store is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'), E_USER_WARNING);
+if ($GLOBALS['cfg']['LoginCookieStore'] != 0
+ && $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity']
+) {
+ trigger_error(
+ __('Login cookie store is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'),
+ E_USER_WARNING
+ );
}
/**
@@ -318,7 +411,10 @@ if ($GLOBALS['cfg']['LoginCookieStore'] != 0 && $GLOBALS['cfg']['LoginCookieStor
if (! empty($_SESSION['auto_blowfish_secret'])
&& empty($GLOBALS['cfg']['blowfish_secret'])
) {
- trigger_error(__('The configuration file now needs a secret passphrase (blowfish_secret).'), E_USER_WARNING);
+ trigger_error(
+ __('The configuration file now needs a secret passphrase (blowfish_secret).'),
+ E_USER_WARNING
+ );
}
/**
@@ -326,14 +422,22 @@ if (! empty($_SESSION['auto_blowfish_secret'])
* production environment.
*/
if (file_exists('config')) {
- trigger_error(__('Directory [code]config[/code], which is used by the setup script, still exists in your phpMyAdmin directory. You should remove it once phpMyAdmin has been configured.'), E_USER_WARNING);
+ trigger_error(
+ __('Directory [code]config[/code], which is used by the setup script, still exists in your phpMyAdmin directory. You should remove it once phpMyAdmin has been configured.'),
+ E_USER_WARNING
+ );
}
if ($server > 0) {
$cfgRelation = PMA_getRelationsParam();
- if (! $cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
+ if (! $cfgRelation['allworks']
+ && $cfg['PmaNoRelation_DisableWarning'] == false
+ ) {
$msg = PMA_Message::notice(__('The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click %shere%s.'));
- $msg->addParam('', false);
+ $msg->addParam(
+ ' ',
+ false
+ );
$msg->addParam(' ', false);
/* Show error if user has configured something, notice elsewhere */
if (!empty($cfg['Servers'][$server]['pmadb'])) {
@@ -346,14 +450,18 @@ if ($server > 0) {
/**
* Warning about different MySQL library and server version
* (a difference on the third digit does not count).
- * If someday there is a constant that we can check about mysqlnd, we can use it instead
- * of strpos().
+ * If someday there is a constant that we can check about mysqlnd,
+ * we can use it instead of strpos().
* If no default server is set, PMA_DBI_get_client_info() is not defined yet.
- * Drizzle can speak MySQL protocol, so don't warn about version mismatch for Drizzle servers.
+ * Drizzle can speak MySQL protocol, so don't warn about version mismatch for
+ * Drizzle servers.
*/
if (function_exists('PMA_DBI_get_client_info') && !PMA_DRIZZLE) {
$_client_info = PMA_DBI_get_client_info();
- if ($server > 0 && strpos($_client_info, 'mysqlnd') === false && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3)) {
+ if ($server > 0
+ && strpos($_client_info, 'mysqlnd') === false
+ && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3)
+ ) {
trigger_error(
PMA_sanitize(
sprintf(
@@ -391,7 +499,9 @@ if ($cfg['SuhosinDisableWarning'] == false
/**
* Warning about mcrypt.
*/
-if (!function_exists('mcrypt_encrypt') && !$GLOBALS['cfg']['McryptDisableWarning']) {
+if (! function_exists('mcrypt_encrypt')
+ && ! $GLOBALS['cfg']['McryptDisableWarning']
+) {
PMA_warnMissingExtension('mcrypt');
}
@@ -407,25 +517,34 @@ if (file_exists('libraries/language_stats.inc.php')) {
* handling incomplete translations here and focus on english
* speaking users.
*/
- if (isset($GLOBALS['language_stats'][$lang]) && $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold']) {
- trigger_error('You are using an incomplete translation, please help to make it better by contributing .', E_USER_NOTICE);
+ if (isset($GLOBALS['language_stats'][$lang])
+ && $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold']
+ ) {
+ trigger_error(
+ 'You are using an incomplete translation, please help to make it better by contributing .',
+ E_USER_NOTICE
+ );
}
}
/**
* prints list item for main page
*
- * @param string $name displayed text
- * @param string $id id, used for css styles
- * @param string $url make item as link with $url as target
- * @param string $mysql_help_page display a link to MySQL's manual
- * @param string $target special target for $url
- * @param string $a_id id for the anchor, used for jQuery to hook in functions
- * @param string $class class for the li element
- * @param string $a_class class for the anchor element
+ * @param string $name displayed text
+ * @param string $id id, used for css styles
+ * @param string $url make item as link with $url as target
+ * @param string $mysql_help_page display a link to MySQL's manual
+ * @param string $target special target for $url
+ * @param string $a_id id for the anchor,
+ * used for jQuery to hook in functions
+ * @param string $class class for the li element
+ * @param string $a_class class for the anchor element
+ *
+ * @return void
*/
-function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null, $target = null, $a_id = null, $class = null, $a_class = null)
-{
+function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null,
+ $target = null, $a_id = null, $class = null, $a_class = null
+) {
echo '