You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-28 07:41:55 +03:00
Move CharEditing setting to constructor
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
@@ -88,7 +88,6 @@ if (isset($_REQUEST['edit_central_columns_page'])) {
|
||||
$selected_fld = $_REQUEST['selected_fld'];
|
||||
$selected_db = $_REQUEST['db'];
|
||||
$edit_central_column_page = $centralColumns->getHtmlForEditingPage(
|
||||
$GLOBALS['cfg']['CharEditing'],
|
||||
$GLOBALS['cfg']['Server']['DisableIS'],
|
||||
$selected_fld,
|
||||
$selected_db
|
||||
@@ -122,7 +121,6 @@ if (Core::isValid($_REQUEST['pos'], 'integer')) {
|
||||
$pos = 0;
|
||||
}
|
||||
$addNewColumn = $centralColumns->getHtmlForAddNewColumn(
|
||||
$GLOBALS['cfg']['CharEditing'],
|
||||
$GLOBALS['cfg']['Server']['DisableIS'],
|
||||
$db,
|
||||
$total_rows
|
||||
@@ -167,7 +165,6 @@ $result = $centralColumns->getColumnsList($db, $pos, $max_rows);
|
||||
$row_num = 0;
|
||||
foreach ($result as $row) {
|
||||
$tableHtmlRow = $centralColumns->getHtmlForTableRow(
|
||||
$GLOBALS['cfg']['CharEditing'],
|
||||
$GLOBALS['cfg']['Server']['DisableIS'],
|
||||
$row,
|
||||
$row_num,
|
||||
|
||||
@@ -43,6 +43,13 @@ class CentralColumns
|
||||
*/
|
||||
private $maxRows;
|
||||
|
||||
/**
|
||||
* Which editor should be used for CHAR/VARCHAR fields
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $charEditing;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -54,6 +61,7 @@ class CentralColumns
|
||||
|
||||
$this->user = $GLOBALS['cfg']['Server']['user'];
|
||||
$this->maxRows = (int) $GLOBALS['cfg']['MaxRows'];
|
||||
$this->charEditing = $GLOBALS['cfg']['CharEditing'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -750,7 +758,7 @@ class CentralColumns
|
||||
*
|
||||
* @return string html for table header in central columns view/edit page
|
||||
*/
|
||||
public function getTableHeader($class='', $title='', $actionCount=0)
|
||||
public function getTableHeader($class = '', $title = '', $actionCount = 0)
|
||||
{
|
||||
$action = '';
|
||||
if ($actionCount > 0) {
|
||||
@@ -896,16 +904,14 @@ class CentralColumns
|
||||
/**
|
||||
* build html for a row in central columns table
|
||||
*
|
||||
* @param string $charEditing which editor should be used for CHAR/VARCHAR fields
|
||||
* @param boolean $disableIs Disable use of INFORMATION_SCHEMA
|
||||
* @param array $row array contains complete information of a particular row of central list table
|
||||
* @param int $row_num position the row in the table
|
||||
* @param string $db current database
|
||||
* @param boolean $disableIs Disable use of INFORMATION_SCHEMA
|
||||
* @param array $row array contains complete information of a particular row of central list table
|
||||
* @param int $row_num position the row in the table
|
||||
* @param string $db current database
|
||||
*
|
||||
* @return string html of a particular row in the central columns table.
|
||||
*/
|
||||
public function getHtmlForTableRow(
|
||||
$charEditing,
|
||||
$disableIs,
|
||||
array $row,
|
||||
$row_num,
|
||||
@@ -1003,7 +1009,7 @@ class CentralColumns
|
||||
'ci_offset' => 0,
|
||||
'type_upper' => mb_strtoupper($row['col_type']),
|
||||
'column_meta' => $meta,
|
||||
'char_editing' => $charEditing,
|
||||
'char_editing' => $this->charEditing,
|
||||
)
|
||||
)
|
||||
. '</td>';
|
||||
@@ -1075,16 +1081,14 @@ class CentralColumns
|
||||
/**
|
||||
* build html for editing a row in central columns table
|
||||
*
|
||||
* @param string $charEditing which editor should be used for CHAR/VARCHAR fields
|
||||
* @param boolean $disableIs Disable use of INFORMATION_SCHEMA
|
||||
* @param array $row array contains complete information of a
|
||||
* particular row of central list table
|
||||
* @param int $row_num position the row in the table
|
||||
* @param boolean $disableIs Disable use of INFORMATION_SCHEMA
|
||||
* @param array $row array contains complete information of a
|
||||
* particular row of central list table
|
||||
* @param int $row_num position the row in the table
|
||||
*
|
||||
* @return string html of a particular row in the central columns table.
|
||||
*/
|
||||
private function getHtmlForEditTableRow(
|
||||
$charEditing,
|
||||
$disableIs,
|
||||
array $row,
|
||||
$row_num
|
||||
@@ -1154,7 +1158,7 @@ class CentralColumns
|
||||
'ci_offset' => 0,
|
||||
'type_upper' => mb_strtoupper($row['col_default']),
|
||||
'column_meta' => $meta,
|
||||
'char_editing' => $charEditing,
|
||||
'char_editing' => $this->charEditing,
|
||||
)
|
||||
)
|
||||
. '</td>';
|
||||
@@ -1340,16 +1344,14 @@ class CentralColumns
|
||||
/**
|
||||
* build html for adding a new user defined column to central list
|
||||
*
|
||||
* @param string $charEditing which editor should be used for CHAR/VARCHAR fields
|
||||
* @param boolean $disableIs Disable use of INFORMATION_SCHEMA
|
||||
* @param string $db current database
|
||||
* @param integer $total_rows number of rows in central columns
|
||||
* @param boolean $disableIs Disable use of INFORMATION_SCHEMA
|
||||
* @param string $db current database
|
||||
* @param integer $total_rows number of rows in central columns
|
||||
*
|
||||
* @return string html of the form to let user add a new user defined column to the
|
||||
* list
|
||||
*/
|
||||
public function getHtmlForAddNewColumn(
|
||||
$charEditing,
|
||||
$disableIs,
|
||||
$db,
|
||||
$total_rows
|
||||
@@ -1412,7 +1414,7 @@ class CentralColumns
|
||||
'ci_offset' => 0,
|
||||
'type_upper' => '',
|
||||
'column_meta' => array(),
|
||||
'char_editing' => $charEditing,
|
||||
'char_editing' => $this->charEditing,
|
||||
)
|
||||
)
|
||||
. '</td>'
|
||||
@@ -1470,7 +1472,6 @@ class CentralColumns
|
||||
/**
|
||||
* Get HTML for editing page central columns
|
||||
*
|
||||
* @param string $charEditing which editor should be used for CHAR/VARCHAR fields
|
||||
* @param boolean $disableIs Disable use of INFORMATION_SCHEMA
|
||||
* @param array $selected_fld Array containing the selected fields
|
||||
* @param string $selected_db String containing the name of database
|
||||
@@ -1478,7 +1479,6 @@ class CentralColumns
|
||||
* @return string HTML for complete editing page for central columns
|
||||
*/
|
||||
public function getHtmlForEditingPage(
|
||||
$charEditing,
|
||||
$disableIs,
|
||||
array $selected_fld,
|
||||
$selected_db
|
||||
@@ -1499,7 +1499,6 @@ class CentralColumns
|
||||
$row_num = 0;
|
||||
foreach ($list_detail_cols as $row) {
|
||||
$tableHtmlRow = $this->getHtmlForEditTableRow(
|
||||
$charEditing,
|
||||
$disableIs,
|
||||
$row,
|
||||
$row_num
|
||||
|
||||
@@ -435,7 +435,6 @@ class CentralColumnsTest extends TestCase
|
||||
$this->returnValue($this->columnData)
|
||||
);
|
||||
$result = $this->centralColumns->getHtmlForEditingPage(
|
||||
$GLOBALS['cfg']['CharEditing'],
|
||||
$GLOBALS['cfg']['Server']['DisableIS'],
|
||||
array("col1", "col2"),
|
||||
'phpmyadmin'
|
||||
@@ -467,7 +466,6 @@ class CentralColumnsTest extends TestCase
|
||||
$this->callProtectedMethod(
|
||||
'getHtmlForEditTableRow',
|
||||
[
|
||||
$GLOBALS['cfg']['CharEditing'],
|
||||
$GLOBALS['cfg']['Server']['DisableIS'],
|
||||
$list_detail_cols[0],
|
||||
0,
|
||||
@@ -611,7 +609,6 @@ class CentralColumnsTest extends TestCase
|
||||
public function testGetHtmlForAddNewColumn()
|
||||
{
|
||||
$result = $this->centralColumns->getHtmlForAddNewColumn(
|
||||
$GLOBALS['cfg']['CharEditing'],
|
||||
$GLOBALS['cfg']['Server']['DisableIS'],
|
||||
'phpmyadmin',
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user