Merge pull request #13265 from mauriciofauth/templates

Port templates to Twig
This commit is contained in:
Michal Čihař 2017-05-15 09:50:04 +02:00 committed by GitHub
commit 6513497e88
87 changed files with 592 additions and 545 deletions

View File

@ -9,6 +9,7 @@ namespace PMA\libraries;
use Twig_Environment;
use Twig_Loader_Filesystem;
use PMA\libraries\twig\CharsetsExtension;
use PMA\libraries\twig\I18nExtension;
use PMA\libraries\twig\SanitizeExtension;
use PMA\libraries\twig\UrlExtension;
@ -69,6 +70,7 @@ class Template
'cache' => $cache_dir,
'debug' => false,
));
$this->twig->addExtension(new CharsetsExtension());
$this->twig->addExtension(new I18nExtension());
$this->twig->addExtension(new SanitizeExtension());
$this->twig->addExtension(new UrlExtension());

View File

@ -2671,7 +2671,7 @@ class Util
'class' => $class,
'placeholder' => $placeholder,
'selected' => $selected,
'resultOptions' => $resultOptions,
'result_options' => $resultOptions,
]);
}
@ -2690,9 +2690,9 @@ class Util
public static function getDivForSliderEffect($id = '', $message = '')
{
return Template::get('div_for_slider_effect')->render([
'id' => $id,
'InitialSlidersState' => $GLOBALS['cfg']['InitialSlidersState'],
'message' => $message,
'id' => $id,
'initial_sliders_state' => $GLOBALS['cfg']['InitialSlidersState'],
'message' => $message,
]);
}
@ -2725,16 +2725,16 @@ class Util
return Template::get('toggle_button')->render(
[
'pmaThemeImage' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'link_on' => $link_on,
'toggleOn' => str_replace(' ', ' ', htmlspecialchars(
'pma_theme_image' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'link_on' => $link_on,
'toggle_on' => str_replace(' ', ' ', htmlspecialchars(
$options[1]['label'])),
'toggleOff' => str_replace(' ', ' ', htmlspecialchars(
'toggle_off' => str_replace(' ', ' ', htmlspecialchars(
$options[0]['label'])),
'link_off' => $link_off,
'callback' => $callback,
'state' => $state
'link_off' => $link_off,
'callback' => $callback,
'state' => $state
]);
} // end toggleButton()

View File

@ -879,11 +879,11 @@ function PMA_getHTMLforCentralColumnsTableRow($row, $row_num, $db)
. PMA\libraries\Template::get('columns_definitions/column_type')
->render(
array(
'columnNumber' => $row_num,
'column_number' => $row_num,
'ci' => 1,
'ci_offset' => 0,
'type_upper' => mb_strtoupper($row['col_type']),
'columnMeta' => array()
'column_meta' => array()
)
)
. '</td>';
@ -893,7 +893,7 @@ function PMA_getHTMLforCentralColumnsTableRow($row, $row_num, $db)
. '</span>'
. PMA\libraries\Template::get('columns_definitions/column_length')->render(
array(
'columnNumber' => $row_num,
'column_number' => $row_num,
'ci' => 2,
'ci_offset' => 0,
'length_values_input_size' => 8,
@ -964,10 +964,10 @@ function PMA_getHTMLforCentralColumnsTableRow($row, $row_num, $db)
. PMA\libraries\Template::get('columns_definitions/column_null')
->render(
array(
'columnNumber' => $row_num,
'column_number' => $row_num,
'ci' => 6,
'ci_offset' => 0,
'columnMeta' => array(
'column_meta' => array(
'Null' => $row['col_isNull']
)
)
@ -979,10 +979,10 @@ function PMA_getHTMLforCentralColumnsTableRow($row, $row_num, $db)
. htmlspecialchars($row['col_extra']) . '</span>'
. PMA\libraries\Template::get('columns_definitions/column_extra')->render(
array(
'columnNumber' => $row_num,
'column_number' => $row_num,
'ci' => 7,
'ci_offset' => 0,
'columnMeta' => array('Extra'=>$row['col_extra'])
'column_meta' => array('Extra'=>$row['col_extra'])
)
)
. '</td>';
@ -1026,11 +1026,11 @@ function PMA_getHTMLforCentralColumnsEditTableRow($row, $row_num)
. PMA\libraries\Template::get('columns_definitions/column_type')
->render(
array(
'columnNumber' => $row_num,
'column_number' => $row_num,
'ci' => 1,
'ci_offset' => 0,
'type_upper' => mb_strtoupper($row['col_type']),
'columnMeta' => array()
'column_meta' => array()
)
)
. '</td>';
@ -1038,7 +1038,7 @@ function PMA_getHTMLforCentralColumnsEditTableRow($row, $row_num)
'<td class="nowrap" name="col_length">'
. PMA\libraries\Template::get('columns_definitions/column_length')->render(
array(
'columnNumber' => $row_num,
'column_number' => $row_num,
'ci' => 2,
'ci_offset' => 0,
'length_values_input_size' => 8,
@ -1100,10 +1100,10 @@ function PMA_getHTMLforCentralColumnsEditTableRow($row, $row_num)
. PMA\libraries\Template::get('columns_definitions/column_null')
->render(
array(
'columnNumber' => $row_num,
'column_number' => $row_num,
'ci' => 6,
'ci_offset' => 0,
'columnMeta' => array(
'column_meta' => array(
'Null' => $row['col_isNull']
)
)
@ -1114,10 +1114,10 @@ function PMA_getHTMLforCentralColumnsEditTableRow($row, $row_num)
'<td class="nowrap" name="col_extra">'
. PMA\libraries\Template::get('columns_definitions/column_extra')->render(
array(
'columnNumber' => $row_num,
'column_number' => $row_num,
'ci' => 7,
'ci_offset' => 0,
'columnMeta' => array('Extra' => $row['col_extra'])
'column_meta' => array('Extra' => $row['col_extra'])
)
)
. '</td>';
@ -1183,9 +1183,9 @@ function PMA_getCentralColumnsTableFooter($pmaThemeImage, $text_dir)
$html_output = PMA\libraries\Template::get('select_all')
->render(
array(
'pmaThemeImage' => $pmaThemeImage,
'text_dir' => $text_dir,
'formName' => 'tableslistcontainer',
'pma_theme_image' => $pmaThemeImage,
'text_dir' => $text_dir,
'form_name' => 'tableslistcontainer',
)
);
$html_output .= Util::getButtonOrImage(
@ -1289,18 +1289,18 @@ function PMA_getHTMLforAddNewColumn($db, $total_rows)
. PMA\libraries\Template::get('columns_definitions/column_type')
->render(
array(
'columnNumber' => 0,
'column_number' => 0,
'ci' => 1,
'ci_offset' => 0,
'type_upper' => '',
'columnMeta' => array()
'column_meta' => array()
)
)
. '</td>'
. '<td class="nowrap" name="col_length">'
. PMA\libraries\Template::get('columns_definitions/column_length')->render(
array(
'columnNumber' => 0,
'column_number' => 0,
'ci' => 2,
'ci_offset' => 0,
'length_values_input_size' => 8,
@ -1343,20 +1343,20 @@ function PMA_getHTMLforAddNewColumn($db, $total_rows)
. PMA\libraries\Template::get('columns_definitions/column_null')
->render(
array(
'columnNumber' => 0,
'column_number' => 0,
'ci' => 6,
'ci_offset' => 0,
'columnMeta' => array()
'column_meta' => array()
)
)
. '</td>'
. '<td class="nowrap" name="col_extra">'
. PMA\libraries\Template::get('columns_definitions/column_extra')->render(
array(
'columnNumber' => 0,
'column_number' => 0,
'ci' => 7,
'ci_offset' => 0,
'columnMeta' => array()
'column_meta' => array()
)
)
. '</td>'

View File

@ -369,7 +369,7 @@ class DatabaseStructureController extends DatabaseController
{
// filtering
$this->response->addHTML(
Template::get('filter')->render(array('filterValue'=>''))
Template::get('filter')->render(array('filter_value'=>''))
);
// table form
$this->response->addHTML(

View File

@ -58,10 +58,10 @@ class ServerCollationsController extends Controller
) {
return Template::get('server/collations/charsets')->render(
array(
'mysqlCharsets' => $mysqlCharsets,
'mysqlCollations' => $mysqlCollations,
'mysqlCharsetsDesc' => $mysqlCharsetsDesc,
'mysqlDftCollations' => $mysqlDftCollations,
'mysql_charsets' => $mysqlCharsets,
'mysql_collations' => $mysqlCollations,
'mysql_charsets_desc' => $mysqlCharsetsDesc,
'mysql_dft_collations' => $mysqlDftCollations,
)
);
}

View File

@ -101,7 +101,7 @@ class ServerDatabasesController extends Controller
$html .= Template::get('server/databases/create')->render();
}
$html .= Template::get('filter')->render(array('filterValue'=>''));
$html .= Template::get('filter')->render(array('filter_value'=>''));
/**
* Gets the databases list
@ -390,9 +390,9 @@ class ServerDatabasesController extends Controller
$html = Template::get('select_all')
->render(
array(
'pmaThemeImage' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'formName' => 'dbStatsForm',
'pma_theme_image' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'form_name' => 'dbStatsForm',
)
);

View File

@ -293,7 +293,7 @@ class ServerVariablesController extends Controller
// filter
$filterValue = ! empty($_REQUEST['filter']) ? $_REQUEST['filter'] : '';
$output = Template::get('filter')
->render(array('filterValue' => $filterValue));
->render(array('filter_value' => $filterValue));
$output .= '<table id="serverVariables" class="data filteredData noclick">';
$output .= Template::get('server/variables/variable_table_head')->render();
@ -357,9 +357,9 @@ class ServerVariablesController extends Controller
$output .= Template::get('server/variables/session_variable_row')
->render(
array(
'rowClass' => $row_class,
'value' => $formattedValue,
'isHtmlFormatted' => $isHtmlFormatted,
'row_class' => $row_class,
'value' => $formattedValue,
'is_html_formatted' => $isHtmlFormatted,
)
);
}

View File

@ -158,7 +158,8 @@ class TableRelationController extends TableController
'db' => $GLOBALS['db'],
'table' => $GLOBALS['table']
),
'engine' => $engine
'is_foreign_key_supported' => Util::isForeignKeySupported($engine),
'cfg_relation' => PMA_getRelationsParam(),
)
)
);

View File

@ -614,10 +614,10 @@ class TableSearchController extends TableController
array(
'db' => $this->db,
'table' => $this->table,
'columnIndex' => $columnIndex,
'column_index' => $columnIndex,
'find' => $find,
'replaceWith' => $replaceWith,
'useRegex' => $useRegex,
'replace_with' => $replaceWith,
'use_regex' => $useRegex,
'result' => $result
)
);

View File

@ -260,7 +260,8 @@ class TableStructureController extends TableController
'db' => $this->db,
'table' => $this->table
),
'engine' => $engine
'is_foreign_key_supported' => Util::isForeignKeySupported($engine),
'cfg_relation' => PMA_getRelationsParam(),
)
)
);

View File

@ -149,9 +149,9 @@ function PMA_RTE_getList($type, $items)
$retval .= Template::get('select_all')
->render(
array(
'pmaThemeImage' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'formName' => 'rteListForm',
'pma_theme_image' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'form_name' => 'rteListForm',
)
);
$retval .= PMA\libraries\Util::getButtonOrImage(
@ -480,4 +480,3 @@ function PMA_EVN_getRowForList($event, $rowclass = '')
return $retval;
} // end PMA_EVN_getRowForList()

View File

@ -540,8 +540,8 @@ function PMA_getHtmlToChooseUserGroup($username)
// render the template
$data = array(
'allUserGroups' => $allUserGroups,
'userGroup' => $userGroup,
'all_user_groups' => $allUserGroups,
'user_group' => $userGroup,
'params' => array('username' => $username)
);
$html_output = Template::get('privileges/choose_user_group')
@ -902,8 +902,8 @@ function PMA_getHtmlForRoutineSpecificPrivilges(
'hostname' => $hostname,
'database' => $db,
'routine' => $routine,
'grantCount' => count($privs),
'privCheckboxes' => $privCheckboxes,
'grant_count' => count($privs),
'priv_checkboxes' => $privCheckboxes,
'header' => $header,
);
$html_output = Template::get('privileges/edit_routine_privileges')
@ -2356,9 +2356,9 @@ function PMA_getHtmlForSpecificDbPrivileges($db)
$html_output .= Template::get('select_all')
->render(
array(
'pmaThemeImage' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'formName' => "usersForm",
'pma_theme_image' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'form_name' => "usersForm",
)
);
$html_output .= Util::getButtonOrImage(
@ -2440,9 +2440,9 @@ function PMA_getHtmlForSpecificTablePrivileges($db, $table)
$html_output .= Template::get('select_all')
->render(
array(
'pmaThemeImage' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'formName' => "usersForm",
'pma_theme_image' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'form_name' => "usersForm",
)
);
$html_output .= Util::getButtonOrImage(
@ -3322,7 +3322,7 @@ function PMA_getHtmlForAllTableSpecificRights(
if ($type == 'database') {
$name = $row['Db'];
$onePrivilege['grant'] = $row['Grant_priv'] == 'Y';
$onePrivilege['tablePrivs'] = ! empty($row['Table_priv'])
$onePrivilege['table_privs'] = ! empty($row['Table_priv'])
|| ! empty($row['Column_priv']);
$onePrivilege['privileges'] = join(',', PMA_extractPrivInfo($row, true));
@ -3334,7 +3334,7 @@ function PMA_getHtmlForAllTableSpecificRights(
'Grant',
explode(',', $row['Table_priv'])
);
$onePrivilege['columnPrivs'] = ! empty($row['Column_priv']);
$onePrivilege['column_privs'] = ! empty($row['Column_priv']);
$onePrivilege['privileges'] = join(',', PMA_extractPrivInfo($row, true));
$paramDbName = $dbname;
@ -3360,9 +3360,9 @@ function PMA_getHtmlForAllTableSpecificRights(
$foundRows[] = $name;
$onePrivilege['name'] = $name;
$onePrivilege['editLink'] = '';
$onePrivilege['edit_link'] = '';
if ($GLOBALS['is_grantuser']) {
$onePrivilege['editLink'] = PMA_getUserLink(
$onePrivilege['edit_link'] = PMA_getUserLink(
'edit',
$username,
$hostname,
@ -3372,9 +3372,9 @@ function PMA_getHtmlForAllTableSpecificRights(
);
}
$onePrivilege['revokeLink'] = '';
$onePrivilege['revoke_link'] = '';
if ($type != 'database' || ! empty($row['can_delete'])) {
$onePrivilege['revokeLink'] = PMA_getUserLink(
$onePrivilege['revoke_link'] = PMA_getUserLink(
'revoke',
$username,
$hostname,
@ -3511,9 +3511,9 @@ function PMA_getUsersOverview($result, $db_rights, $pmaThemeImage, $text_dir)
. Template::get('select_all')
->render(
array(
'pmaThemeImage' => $pmaThemeImage,
'text_dir' => $text_dir,
'formName' => 'usersForm',
'pma_theme_image' => $pmaThemeImage,
'text_dir' => $text_dir,
'form_name' => 'usersForm',
)
) . "\n";
$html_output .= Util::getButtonOrImage(

View File

@ -352,9 +352,9 @@ function PMA_getHtmlForTableVersionDetails(
$html .= PMA\libraries\Template::get('select_all')
->render(
array(
'pmaThemeImage' => $pmaThemeImage,
'text_dir' => $text_dir,
'formName' => 'versionsForm',
'pma_theme_image' => $pmaThemeImage,
'text_dir' => $text_dir,
'form_name' => 'versionsForm',
)
);
$html .= PMA\libraries\Util::getButtonOrImage(
@ -1473,9 +1473,9 @@ function PMA_displayUntrackedTables(
echo PMA\libraries\Template::get('select_all')
->render(
array(
'pmaThemeImage' => $pmaThemeImage,
'text_dir' => $text_dir,
'formName' => 'untrackedForm',
'pma_theme_image' => $pmaThemeImage,
'text_dir' => $text_dir,
'form_name' => 'untrackedForm',
)
);
echo PMA\libraries\Util::getButtonOrImage(
@ -1681,9 +1681,9 @@ function PMA_displayTrackedTables(
echo PMA\libraries\Template::get('select_all')
->render(
array(
'pmaThemeImage' => $pmaThemeImage,
'text_dir' => $text_dir,
'formName' => 'trackedForm',
'pma_theme_image' => $pmaThemeImage,
'text_dir' => $text_dir,
'form_name' => 'trackedForm',
)
);
echo PMA\libraries\Util::getButtonOrImage(

View File

@ -0,0 +1,34 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* hold PMA\libraries\twig\CharsetsExtension class
*
* @package PMA\libraries\twig
*/
namespace PMA\libraries\twig;
use Twig_Extension;
use Twig_SimpleFunction;
/**
* Class CharsetsExtension
*
* @package PMA\libraries\twig
*/
class CharsetsExtension extends Twig_Extension
{
/**
* Returns a list of functions to add to the existing list.
*
* @return Twig_SimpleFunction[]
*/
public function getFunctions()
{
return array(
new Twig_SimpleFunction(
'Charsets_getCollationDescr',
'PMA\libraries\Charsets::getCollationDescr'
),
);
}
}

View File

@ -25,11 +25,20 @@ class UtilExtension extends Twig_Extension
public function getFunctions()
{
return array(
new Twig_SimpleFunction(
'Util_escapeMysqlWildcards',
'PMA\libraries\Util::escapeMysqlWildcards'
),
new Twig_SimpleFunction(
'Util_formatSql',
'PMA\libraries\Util::formatSql',
array('is_safe' => array('html'))
),
new Twig_SimpleFunction(
'Util_getDropdown',
'PMA\libraries\Util::getDropdown',
array('is_safe' => array('html'))
),
new Twig_SimpleFunction(
'Util_getHtmlTab',
'PMA\libraries\Util::getHtmlTab',
@ -50,6 +59,11 @@ class UtilExtension extends Twig_Extension
'PMA\libraries\Util::getSupportedDatatypes',
array('is_safe' => array('html'))
),
new Twig_SimpleFunction(
'Util_showHint',
'PMA\libraries\Util::showHint',
array('is_safe' => array('html'))
),
new Twig_SimpleFunction(
'Util_showIcons',
'PMA\libraries\Util::showIcons'

View File

@ -284,7 +284,7 @@ function PMA_userprefsAutoloadGetHeader()
return PMA\libraries\Template::get('prefs_autoload')
->render(
array(
'hiddenInputs' => URL::getHiddenInputs(),
'hidden_inputs' => URL::getHiddenInputs(),
'return_url' => $return_url,
)
);

View File

@ -4,6 +4,7 @@ define('PHPMYADMIN', 1);
require_once 'libraries/vendor_config.php';
require_once AUTOLOAD_FILE;
use PMA\libraries\twig\CharsetsExtension;
use PMA\libraries\twig\I18nExtension;
use PMA\libraries\twig\SanitizeExtension;
use PMA\libraries\twig\UrlExtension;
@ -18,6 +19,7 @@ $twig = new Twig_Environment($loader, array(
'cache' => $tmpDir,
'auto_reload' => true
));
$twig->addExtension(new CharsetsExtension());
$twig->addExtension(new I18nExtension());
$twig->addExtension(new SanitizeExtension());
$twig->addExtension(new UrlExtension());

View File

@ -1,13 +1,13 @@
{% if privs_available %}
<input name="field_adjust_privileges[{{ columnNumber }}]"
id="field_{{ columnNumber }}_{{ ci - ci_offset }}"
<input name="field_adjust_privileges[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
checked="checked"
type="checkbox"
value="NULL"
class="allow_null"/>
{% else %}
<input name="field_adjust_privileges[{{ columnNumber }}]"
id="field_{{ columnNumber }}_{{ ci - ci_offset }}"
<input name="field_adjust_privileges[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
disabled
type="checkbox"
value="NULL"

View File

@ -22,18 +22,18 @@ $ci_offset = -1;
<!-- column type -->
<?= PMA\libraries\Template::get('columns_definitions/column_type')
->render(array(
'columnNumber' => $columnNumber,
'column_number' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'type_upper' => $type_upper,
'columnMeta' => isset($columnMeta) ? $columnMeta : null
'column_meta' => isset($columnMeta) ? $columnMeta : null
)); ?>
</td>
<td class="center">
<!-- column length -->
<?= PMA\libraries\Template::get('columns_definitions/column_length')
->render(array(
'columnNumber' => $columnNumber,
'column_number' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'length_values_input_size' => $length_values_input_size,
@ -77,10 +77,10 @@ $ci_offset = -1;
<!-- column NULL -->
<?= PMA\libraries\Template::get('columns_definitions/column_null')
->render(array(
'columnNumber' => $columnNumber,
'column_number' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => isset($columnMeta) ? $columnMeta : null
'column_meta' => isset($columnMeta) ? $columnMeta : null
)); ?>
</td>
<?php if (isset($_REQUEST['change_column']) && !empty($_REQUEST['change_column'])): ?>
@ -89,7 +89,7 @@ $ci_offset = -1;
<?php $privs_available = $GLOBALS['col_priv'] && $GLOBALS['is_reload_priv']; ?>
<?= PMA\libraries\Template::get('columns_definitions/column_adjust_privileges')
->render(array(
'columnNumber' => $columnNumber,
'column_number' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'privs_available' => $privs_available
@ -101,10 +101,10 @@ $ci_offset = -1;
<td class="center">
<?= PMA\libraries\Template::get('columns_definitions/column_indexes')
->render(array(
'columnNumber' => $columnNumber,
'column_number' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => $columnMeta
'column_meta' => $columnMeta
)); ?>
</td>
<?php endif; ?>
@ -112,10 +112,10 @@ $ci_offset = -1;
<!-- column auto_increment -->
<?= PMA\libraries\Template::get('columns_definitions/column_auto_increment')
->render(array(
'columnNumber' => $columnNumber,
'column_number' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => $columnMeta
'column_meta' => $columnMeta
)); ?>
</td>
<td class="center">
@ -194,10 +194,10 @@ $ci_offset = -1;
<!-- column Transformation options -->
<?= PMA\libraries\Template::get('columns_definitions/transformation_option')
->render(array(
'columnNumber' => $columnNumber,
'column_number' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => $columnMeta,
'column_meta' => $columnMeta,
'mime_map' => $mime_map,
'type_prefix' => '',
)); ?>
@ -219,10 +219,10 @@ $ci_offset = -1;
<!-- column Input transformation options -->
<?= PMA\libraries\Template::get('columns_definitions/transformation_option')
->render(array(
'columnNumber' => $columnNumber,
'column_number' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => $columnMeta,
'column_meta' => $columnMeta,
'mime_map' => $mime_map,
'type_prefix' => 'input_',
)); ?>

View File

@ -1,6 +1,6 @@
<input name="field_extra[{{ columnNumber }}]"
<input name="field_extra[{{ column_number }}]"
id="field_{{ columnNumber }}_{{ ci - ci_offset }}"
{% if columnMeta['Extra'] is defined and columnMeta['Extra']|lower == 'auto_increment' -%}
{% if column_meta['Extra'] is defined and column_meta['Extra']|lower == 'auto_increment' -%}
checked="checked"
{%- endif %}
type="checkbox"

View File

@ -1,6 +1,6 @@
<input name="col_extra[{{ columnNumber }}]"
id="field_{{ columnNumber }}_{{ ci - ci_offset }}"
{% if columnMeta['Extra'] is not empty and columnMeta['Extra'] == 'auto_increment' -%}
<input name="col_extra[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
{% if column_meta['Extra'] is not empty and column_meta['Extra'] == 'auto_increment' -%}
checked="checked"
{%- endif %}
type="checkbox"

View File

@ -1,24 +1,24 @@
<select name="field_key[{{ columnNumber }}]"
id="field_{{ columnNumber }}_{{ ci - ci_offset }}" data-index="">
<option value="none_{{ columnNumber }}">---</option>
<option value="primary_{{ columnNumber }}" title="{% trans "Primary" %}"
{{- columnMeta['Key'] is defined and columnMeta['Key'] == 'PRI' ? ' selected="selected"' }}>
<select name="field_key[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}" data-index="">
<option value="none_{{ column_number }}">---</option>
<option value="primary_{{ column_number }}" title="{% trans "Primary" %}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'PRI' ? ' selected="selected"' }}>
PRIMARY
</option>
<option value="unique_{{ columnNumber }}" title="{% trans "Unique" %}"
{{- columnMeta['Key'] is defined and columnMeta['Key'] == 'UNI' ? ' selected="selected"' }}>
<option value="unique_{{ column_number }}" title="{% trans "Unique" %}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'UNI' ? ' selected="selected"' }}>
UNIQUE
</option>
<option value="index_{{ columnNumber }}" title="{% trans "Index" %}"
{{- columnMeta['Key'] is defined and columnMeta['Key'] == 'MUL' ? ' selected="selected"' }}>
<option value="index_{{ column_number }}" title="{% trans "Index" %}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'MUL' ? ' selected="selected"' }}>
INDEX
</option>
<option value="fulltext_{{ columnNumber }}" title="{% trans "Fulltext" %}"
{{- columnMeta['Key'] is defined and columnMeta['Key'] == 'FULLTEXT' ? ' selected="selected"' }}>
<option value="fulltext_{{ column_number }}" title="{% trans "Fulltext" %}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'FULLTEXT' ? ' selected="selected"' }}>
FULLTEXT
</option>
<option value="spatial_{{ columnNumber }}" title="{% trans "Spatial" %}"
{{- columnMeta['Key'] is defined and columnMeta['Key'] == 'SPATIAL' ? ' selected="selected"' }}>
<option value="spatial_{{ column_number }}" title="{% trans "Spatial" %}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'SPATIAL' ? ' selected="selected"' }}>
SPATIAL
</option>
</select>

View File

@ -1,10 +1,10 @@
<input id="field_{{ columnNumber }}_{{ ci - ci_offset }}"
<input id="field_{{ column_number }}_{{ ci - ci_offset }}"
type="text"
name="field_length[{{ columnNumber }}]"
name="field_length[{{ column_number }}]"
size="{{ length_values_input_size }}"
value="{{ length_to_display }}"
class="textfield" />
<p class="enum_notice" id="enum_notice_{{ columnNumber }}_{{ ci - ci_offset }}">
<p class="enum_notice" id="enum_notice_{{ column_number }}_{{ ci - ci_offset }}">
<a href="#" class="open_enum_editor">
{% trans 'Edit ENUM/SET values' %}
</a>

View File

@ -1,6 +1,6 @@
<input name="field_null[{{ columnNumber }}]"
id="field_{{ columnNumber }}_{{ ci - ci_offset }}"
{% if columnMeta['Null'] is not empty and columnMeta['Null'] != 'NO' and columnMeta['Null'] != 'NOT NULL' -%}
<input name="field_null[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
{% if column_meta['Null'] is not empty and column_meta['Null'] != 'NO' and column_meta['Null'] != 'NOT NULL' -%}
checked="checked"
{%- endif %}
type="checkbox"

View File

@ -1,7 +1,7 @@
<select class="column_type"
name="field_type[{{ columnNumber }}]"
id="field_{{ columnNumber }}_{{ ci - ci_offset }}"
{%- if columnMeta['column_status'] is defined and not columnMeta['column_status']['isEditable'] -%}
name="field_type[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
{%- if column_meta['column_status'] is defined and not column_meta['column_status']['isEditable'] -%}
disabled="disabled"
{%- endif %}>
{{ Util_getSupportedDatatypes(true, type_upper) }}

View File

@ -1,9 +1,9 @@
{% set options_key = type_prefix ~ 'transformation_options' %}
<input id="field_{{ columnNumber }}_{{ ci - ci_offset }}"
<input id="field_{{ column_number }}_{{ ci - ci_offset }}"
type="text"
name="field_{{ options_key }}[{{ columnNumber }}]"
name="field_{{ options_key }}[{{ column_number }}]"
size="16"
class="textfield"
value="{% if columnMeta['Field'] is defined and mime_map[columnMeta['Field']][options_key] is defined -%}
{{- mime_map[columnMeta['Field']][options_key] -}}
value="{% if column_meta['Field'] is defined and mime_map[column_meta['Field']][options_key] is defined -%}
{{- mime_map[column_meta['Field']][options_key] -}}
{%- endif %}" />

View File

@ -9,8 +9,8 @@
<?= PMA\libraries\Template::get('console/query_action')
->render(
array(
'parentDivClasses' => 'action_content',
'contentArray' => [
'parent_div_classes' => 'action_content',
'content_array' => [
['action collapse', __('Collapse')],
['action expand', __('Expand')],
['action requery', __('Requery')],

View File

@ -4,8 +4,8 @@
<?= PMA\libraries\Template::get('console/toolbar')
->render(
array(
'parentDivClasses' => 'collapsed',
'contentArray' => [
'parent_div_classes' => 'collapsed',
'content_array' => [
['switch_button console_switch', __('Console'),'image'=> $image],
['button clear', __('Clear')],
['button history', __('History')],
@ -43,8 +43,8 @@
<?= PMA\libraries\Template::get('console/query_action')
->render(
array(
'parentDivClasses' => 'action_content',
'contentArray' => [
'parent_div_classes' => 'action_content',
'content_array' => [
['action collapse', __('Collapse')],
['action expand', __('Expand')],
['action requery', __('Requery')],
@ -76,8 +76,8 @@
<?= PMA\libraries\Template::get('console/toolbar')
->render(
array(
'parentDivClasses' => '',
'contentArray' => [
'parent_div_classes' => '',
'content_array' => [
['button order order_asc', __('ascending')],
['button order order_desc', __('descending')],
['text', __('Order:')],
@ -100,8 +100,8 @@
<?= PMA\libraries\Template::get('console/query_action')
->render(
array(
'parentDivClasses' => 'debug_query action_content',
'contentArray' => [
'parent_div_classes' => 'debug_query action_content',
'content_array' => [
['action collapse', __('Collapse')],
['action expand', __('Expand')],
['action dbg_show_trace', __('Show trace')],
@ -119,8 +119,8 @@
<?= PMA\libraries\Template::get('console/toolbar')
->render(
array(
'parentDivClasses' => '',
'contentArray' => [
'parent_div_classes' => '',
'content_array' => [
['switch_button', __('Bookmarks')],
['button refresh', __('Refresh')],
['button add', __('Add')],
@ -136,8 +136,8 @@
<?= PMA\libraries\Template::get('console/toolbar')
->render(
array(
'parentDivClasses' => '',
'contentArray' => [
'parent_div_classes' => '',
'content_array' => [
['switch_button', __('Add bookmark')]
]
)
@ -168,8 +168,8 @@
<?= PMA\libraries\Template::get('console/toolbar')
->render(
array(
'parentDivClasses' => '',
'contentArray' => [
'parent_div_classes' => '',
'content_array' => [
['switch_button', __('Options')],
['button default', __('Set default')]
]
@ -205,8 +205,8 @@
<?= PMA\libraries\Template::get('console/query_action')
->render(
array(
'parentDivClasses' => 'query_actions',
'contentArray' => [
'parent_div_classes' => 'query_actions',
'content_array' => [
['action collapse', __('Collapse')],
['action expand', __('Expand')],
['action requery', __('Requery')],

View File

@ -1,5 +1,5 @@
<div class="{{ parentDivClasses }}">
{% for content in contentArray %}
<div class="{{ parent_div_classes }}">
{% for content in content_array %}
{% if content is defined %}
<span class="{{ content[0] }}">
{{ content[1] }}

View File

@ -1,5 +1,5 @@
<div class="toolbar {{ parentDivClasses }}">
{% for content in contentArray %}
<div class="toolbar {{ parent_div_classes }}">
{% for content in content_array %}
{% if content is defined %}
<div class="{{ content[0] }}">
{{ content['image'] is defined ? content['image']|raw }}

View File

@ -1,3 +1,3 @@
<div id="osn_tab">
<canvas class="pmd" id="canvas" width="100" height="100" ></canvas>
<canvas class="pmd" id="canvas" width="100" height="100"></canvas>
</div>

View File

@ -1,4 +1,4 @@
{% if InitialSlidersState == 'disabled' %}
{% if initial_sliders_state == 'disabled' %}
<div{% if id is defined %} id="{{ id }}"{% endif %}>
{% else %}
{#
@ -10,7 +10,7 @@
append to
#}
<div{% if id is defined %} id="{{ id }}"
{%- endif %} {% if InitialSlidersState == 'closed' -%}
{%- endif %} {% if initial_sliders_state == 'closed' -%}
style="display: none; overflow:auto;"{% endif %} class="pma_auto_slider"
{%- if message is defined %} title="{{ message }}"{% endif %}>
{% endif %}

View File

@ -1,9 +1,10 @@
<select name="{{ select_name }}"{% if id is not empty %} id="{{ id }}"{% endif %}{% if class is not empty %} class="{{ class }}"{% endif %}>
<select name="{{ select_name }}"{% if id is not empty %} id="{{ id }}"{% endif -%}
{%- if class is not empty %} class="{{ class }}"{% endif %}>
{% if placeholder is not empty %}
<option value="" disabled="disabled"
{%- if not selected %} selected="selected"{% endif %}>{{ placeholder }}</option>
{% endif %}
{% for option in resultOptions %}
{% for option in result_options %}
<option value="{{ option['value'] }}"
{{- option['selected'] ? ' selected="selected"' }}>{{ option['label'] }}</option>
{% endfor %}

View File

@ -18,7 +18,7 @@
<div class="label"><label><p>
{% trans "You may examine the data in the error report:" %}
</p></label></div>
<pre class="report-data">{{ report_data }}</pre>
<pre class="report-data">{{ report_data|raw }}</pre>
<input type="checkbox" name="always_send" id="always_send_checkbox" />
<label for="always_send_checkbox">
@ -27,6 +27,6 @@
</fieldset>
{{ hidden_inputs }}
{{ hidden_fields }}
{{ hidden_inputs|raw }}
{{ hidden_fields|raw }}
</form>

View File

@ -3,6 +3,6 @@
<div class="formelement">
<label for="filterText">{% trans "Containing the word:" %}</label>
<input name="filterText" type="text" id="filterText"
value="{{ filterValue }}" />
value="{{ filter_value }}" />
</div>
</fieldset>

View File

@ -1,6 +1,6 @@
<div id="prefs_autoload" class="notice print_ignore" style="display:none">
<form action="prefs_manage.php" method="post" class="disableAjax">
{{ hiddenInputs|raw }}
{{ hidden_inputs|raw }}
<input type="hidden" name="json" value="" />
<input type="hidden" name="submit_import" value="1" />
<input type="hidden" name="return_url" value="{{ return_url }}" />

View File

@ -1,16 +0,0 @@
<?php use PMA\libraries\Util; ?>
<label for="text_dbname"><?= __('Add privileges on the following database(s):'); ?></label>
<?php if (! empty($databases)) : ?>
<select name="pred_dbname[]" multiple="multiple">
<?php foreach ($databases as $database) : ?>
<?php $escapedDatabase = Util::escapeMysqlWildcards($database); ?>
<option value="<?= htmlspecialchars($escapedDatabase); ?>">
<?= htmlspecialchars($database); ?>
</option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<input type="text" id="text_dbname" name="dbname" />
<?= Util::showHint(__('Wildcards % and _ should be escaped with a \ to use them literally.'))?>

View File

@ -0,0 +1,14 @@
<label for="text_dbname">{% trans 'Add privileges on the following database(s):' %}</label>
{%- if databases is not empty %}
<select name="pred_dbname[]" multiple="multiple">
{% for database in databases %}
<option value="{{ Util_escapeMysqlWildcards(database) }}">
{{ database }}
</option>
{% endfor %}
</select>
{% endif -%}
<input type="text" id="text_dbname" name="dbname" />
{{ Util_showHint("Wildcards % and _ should be escaped with a \\ to use them literally."|trans) }}

View File

@ -1,14 +0,0 @@
<input type="hidden" name="dbname" value="<?= htmlspecialchars($database); ?>"/>
<label for="text_routinename"><?= __('Add privileges on the following routine:'); ?></label>
<?php if (! empty($routines)) : ?>
<select name="pred_routinename" class="autosubmit">
<option value="" selected="selected"><?= __('Use text field'); ?>:</option>
<?php foreach ($routines as $routine) : ?>
<option value="<?= htmlspecialchars($routine); ?>"><?= htmlspecialchars($routine); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<input type="text" id="text_routinename" name="routinename" />

View File

@ -0,0 +1,14 @@
<input type="hidden" name="dbname" value="{{ database }}"/>
<label for="text_routinename">{% trans 'Add privileges on the following routine:' %}</label>
{%- if routines is not empty %}
<select name="pred_routinename" class="autosubmit">
<option value="" selected="selected">{% trans 'Use text field' %}:</option>
{% for routine in routines %}
<option value="{{ routine }}">{{ routine }}</option>
{% endfor %}
</select>
{% endif -%}
<input type="text" id="text_routinename" name="routinename" />

View File

@ -1,14 +0,0 @@
<input type="hidden" name="dbname" value="<?= htmlspecialchars($database); ?>"/>
<label for="text_tablename"><?= __('Add privileges on the following table:'); ?></label>
<?php if (! empty($tables)) : ?>
<select name="pred_tablename" class="autosubmit">
<option value="" selected="selected"><?= __('Use text field'); ?>:</option>
<?php foreach ($tables as $table) : ?>
<option value="<?= htmlspecialchars($table); ?>"><?= htmlspecialchars($table); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<input type="text" id="text_tablename" name="tablename" />

View File

@ -0,0 +1,14 @@
<input type="hidden" name="dbname" value="{{ database }}"/>
<label for="text_tablename">{% trans 'Add privileges on the following table:' %}</label>
{%- if tables is not empty %}
<select name="pred_tablename" class="autosubmit">
<option value="" selected="selected">{% trans 'Use text field' %}:</option>
{% for table in tables %}
<option value="{{ table }}">{{ table }}</option>
{% endfor %}
</select>
{% endif -%}
<input type="text" id="text_tablename" name="tablename" />

View File

@ -1,8 +0,0 @@
<fieldset id="fieldset_add_user">
<legend><?= _pgettext('Create new user', 'New') ?></legend>
<a id="add_user_anchor" href="server_privileges.php<?= PMA\libraries\URL::getCommon($url_params) ?>"
<?php if (!empty($rel_params)) : ?>
rel="<?= PMA\libraries\URL::getCommon($rel_params)?>"
<?php endif; ?> >
<?= PMA\libraries\Util::getIcon('b_usradd.png') ?><?= __('Add user account') ?></a>
</fieldset>

View File

@ -0,0 +1,8 @@
<fieldset id="fieldset_add_user">
<legend>{% trans %}New{% context %}Create new user{% endtrans %}</legend>
<a id="add_user_anchor" href="server_privileges.php{{ URL_getCommon(url_params) }}"
{% if rel_params is not empty %}
rel="{{ URL_getCommon(rel_params) }}"
{% endif %}>
{{ Util_getIcon('b_usradd.png') }}{% trans 'Add user account' %}</a>
</fieldset>

View File

@ -1,9 +0,0 @@
<form class="ajax" id="changeUserGroupForm" action="server_privileges.php" method="post">
<?= PMA\libraries\URL::getHiddenInputs($params); ?>
<fieldset id="fieldset_user_group_selection">
<legend><?= __('User group') ?></legend>
<?= __('User group') ?> :
<?= PMA\libraries\Util::getDropdown('userGroup', $allUserGroups, $userGroup, 'userGroup_select'); ?>
<input type="hidden" name="changeUserGroup" value="1">
</fieldset>
</form>

View File

@ -0,0 +1,9 @@
<form class="ajax" id="changeUserGroupForm" action="server_privileges.php" method="post">
{{ URL_getHiddenInputs(params) }}
<fieldset id="fieldset_user_group_selection">
<legend>{% trans 'User group' %}</legend>
{% trans 'User group' %}:
{{ Util_getDropdown('userGroup', all_user_groups, user_group, 'userGroup_select') }}
<input type="hidden" name="changeUserGroup" value="1">
</fieldset>
</form>

View File

@ -1,24 +0,0 @@
<div class="item" id="div_item_<?= $name ?>">
<label for="select_<?= $name ?>_priv">
<code><dfn title="<?= $name_for_dfn ?>"><?= $priv_for_header ?></dfn></code>
</label>
<br/>
<select id="select_<?= $name ?>_priv" name="<?= $name_for_select . '[]' ?>" multiple="multiple" size="8">
<?php foreach ($columns as $currCol => $currColPrivs) : ?>
<option value="<?= htmlspecialchars($currCol) ?>"
<?php if ($row[$name_for_select] == 'Y' || $currColPrivs[$name_for_current]) : ?>
selected="selected"
<?php endif; ?>
> <?= htmlspecialchars($currCol) ?>
</option>
<?php endforeach; ?>
</select>
<i><?= __('Or') ?></i>
<label for="checkbox_<?= $name_for_select ?>_none">
<input type="checkbox" name="<?= $name_for_select ?>_none"
id="checkbox_<?= $name_for_select ?>_none"
title="<?=_pgettext('None privileges', 'None')?>" />
<?= _pgettext('None privileges', 'None') ?>
</label>
</div>

View File

@ -0,0 +1,24 @@
<div class="item" id="div_item_{{ name }}">
<label for="select_{{ name }}_priv">
<code><dfn title="{{ name_for_dfn }}">{{ priv_for_header }}</dfn></code>
</label>
<select id="select_{{ name }}_priv" name="{{ name_for_select }}[]" multiple="multiple" size="8">
{% for curr_col, curr_col_privs in columns %}
<option value="{{ curr_col }}"
{% if row[name_for_select] == 'Y' or curr_col_privs[name_for_current] %}
selected="selected"
{% endif %}>
{{ curr_col }}
</option>
{% endfor %}
</select>
<em>{% trans 'Or' %}</em>
<label for="checkbox_{{ name_for_select }}_none">
<input type="checkbox" name="{{ name_for_select }}_none"
id="checkbox_{{ name_for_select }}_none"
title="{% trans %}None{% context %}None privileges{% endtrans %}" />
{% trans %}None{% context %}None privileges{% endtrans %}
</label>
</div>

View File

@ -1,17 +0,0 @@
<fieldset id="fieldset_delete_user">
<legend>
<?= PMA\libraries\Util::getIcon('b_usrdrop.png')?><?= __('Remove selected user accounts') ?>
</legend>
<input type="hidden" name="mode" value="2" />
( <?= __('Revoke all active privileges from the users and delete them afterwards.') ?> )
<br />
<input type="checkbox" title="<?= __('Drop the databases that have the same names as the users.') ?>"
name="drop_users_db" id="checkbox_drop_users_db" />
<label for="checkbox_drop_users_db" title=<?= __('Drop the databases that have the same names as the users.')?> >
<?= __('Drop the databases that have the same names as the users.') ?>
</label>
</fieldset>
<fieldset id="fieldset_delete_user_footer" class="tblFooters">
<input type="submit" name="delete" value="<?= __('Go') ?>" id="buttonGo" class="ajax" />
</fieldset>

View File

@ -0,0 +1,17 @@
<fieldset id="fieldset_delete_user">
<legend>
{{ Util_getIcon('b_usrdrop.png') }}{% trans 'Remove selected user accounts' %}
</legend>
<input type="hidden" name="mode" value="2" />
<p>({% trans 'Revoke all active privileges from the users and delete them afterwards.' %})</p>
<input type="checkbox" title="{% trans 'Drop the databases that have the same names as the users.' %}"
name="drop_users_db" id="checkbox_drop_users_db" />
<label for="checkbox_drop_users_db"
title="{% trans 'Drop the databases that have the same names as the users.' %}">
{% trans 'Drop the databases that have the same names as the users.' %}
</label>
</fieldset>
<fieldset id="fieldset_delete_user_footer" class="tblFooters">
<input type="submit" name="delete" value="{% trans 'Go' %}" id="buttonGo" class="ajax" />
</fieldset>

View File

@ -1,26 +0,0 @@
<div id="edit_user_dialog">
<?= $header; ?>
<form class="submenu-item" name="usersForm" id="addUsersForm" action="server_privileges.php" method="post">
<?= PMA\libraries\URL::getHiddenInputs(); ?>
<input type="hidden" name="username" value="<?= htmlspecialchars($username); ?>">
<input type="hidden" name="hostname" value="<?= htmlspecialchars($hostname); ?>">
<input type="hidden" name="dbname" value="<?= htmlspecialchars($database); ?>">
<input type="hidden" name="routinename" value="<?= htmlspecialchars($routine); ?>">
<input type="hidden" name="grant_count" value="<?= $grantCount; ?>">
<fieldset id="fieldset_user_global_rights">
<legend data-submenu-label="<?= __('Routine')?>">
<?= __('Routine-specific privileges'); ?>
</legend>
<p>
<small>
<i><?= __('Note: MySQL privilege names are expressed in English.'); ?></i>
</small>
</p>
<?= $privCheckboxes; ?>
</fieldset>
<fieldset id="fieldset_user_privtable_footer" class="tblFooters">
<input type="hidden" name="update_privs" value="1">
<input type="submit" value="<?= __('Go')?>">
</fieldset>
</form>
</div>

View File

@ -0,0 +1,26 @@
<div id="edit_user_dialog">
{{ header }}
<form class="submenu-item" name="usersForm" id="addUsersForm" action="server_privileges.php" method="post">
{{ URL_getHiddenInputs() }}
<input type="hidden" name="username" value="{{ username }}">
<input type="hidden" name="hostname" value="{{ hostname }}">
<input type="hidden" name="dbname" value="{{ database }}">
<input type="hidden" name="routinename" value="{{ routine }}">
<input type="hidden" name="grant_count" value="{{ grant_count }}">
<fieldset id="fieldset_user_global_rights">
<legend data-submenu-label="{% trans 'Routine' %}">
{% trans 'Routine-specific privileges' %}
</legend>
<p>
<small>
<em>{% trans 'Note: MySQL privilege names are expressed in English.' %}</em>
</small>
</p>
{{ priv_checkboxes }}
</fieldset>
<fieldset id="fieldset_user_privtable_footer" class="tblFooters">
<input type="hidden" name="update_privs" value="1">
<input type="submit" value="{% trans 'Go' %}">
</fieldset>
</form>
</div>

View File

@ -1,9 +0,0 @@
<div class="item">
<input type="checkbox" class="checkall" name="<?= $priv[0] ?>_priv" id="checkbox_<?= $priv[0] ?>_priv"
value="Y" title="<?= $priv[2] ?>" <?= $checked ?> />
<label for="checkbox_<?= $priv[0] ?>_priv">
<code>
<?= $formatted_priv ?>
</code>
</label>
</div>

View File

@ -0,0 +1,9 @@
<div class="item">
<input type="checkbox" class="checkall" name="{{ priv[0] }}_priv" id="checkbox_{{ priv[0] }}_priv"
value="Y" title="{{ priv[2] }}" {{ checked }} />
<label for="checkbox_{{ priv[0] }}_priv">
<code>
{{ formatted_priv }}
</code>
</label>
</div>

View File

@ -1,14 +0,0 @@
<tr>
<td><?= htmlspecialchars($name); ?></td>
<td><code><?= $privileges; ?></code></td>
<td><?= ($grant ? __('Yes') : __('No')); ?></td>
<?php if ($type == 'database') : ?>
<td><?= ($tablePrivs ? __('Yes') : __('No')); ?></td>
<?php elseif ($type == 'table') : ?>
<td><?= ($columnPrivs ? __('Yes') : __('No')); ?></td>
<?php endif; ?>
<td><?= $editLink; ?></td>
<td><?= $revokeLink; ?></td>
</tr>

View File

@ -0,0 +1,14 @@
<tr>
<td>{{ name }}</td>
<td><code>{{ privileges }}</code></td>
<td>{{ grant ? 'Yes'|trans : 'No'|trans }}</td>
{% if type == 'database' %}
<td>{{ table_privs ? 'Yes'|trans : 'No'|trans }}</td>
{% elseif type == 'table' %}
<td>{{ column_privs ? 'Yes'|trans : 'No'|trans }}</td>
{% endif %}
<td>{{ edit_link|raw }}</td>
<td>{{ revoke_link|raw }}</td>
</tr>

View File

@ -1,23 +0,0 @@
<div class="item">
<?php if ($require_option['radio']) : ?>
<input type="radio" name="ssl_type"
id="<?= $require_option['name'] . '_' . $require_option['value'] ?>"
title="<?= $require_option['description'] ?>"
value="<?= $require_option['value'] ?>" <?= $require_option['checked']?>
/>
<label for="<?= $require_option['name'] . '_' . $require_option['value'] ?>">
<code><?= $require_option['label'] ?></code>
</label>
<?php else : ?>
<label for="text_<?= $require_option['name'] ?>">
<code><?= $require_option['label'] ?></code>
</label>
<input type="text" name="<?= $require_option['name'] ?>"
id="text_<?= $require_option['name'] ?>" value="<?= $require_option['value'] ?>"
size="80" title="<?= $require_option['description'] ?>"
<?php if ($require_option['disabled']) : ?>
disabled
<?php endif; ?>
/>
<?php endif; ?>
</div>

View File

@ -0,0 +1,23 @@
<div class="item">
{% if require_option['radio'] %}
<input type="radio" name="ssl_type"
id="{{ require_option['name'] }}_{{ require_option['value'] }}"
title="{{ require_option['description'] }}"
value="{{ require_option['value'] }}" {{ require_option['checked']|raw -}}
/>
<label for="{{ require_option['name'] }}_{{ require_option['value'] }}">
<code>{{ require_option['label'] }}</code>
</label>
{% else %}
<label for="text_{{ require_option['name'] }}">
<code>{{ require_option['label'] }}</code>
</label>
<input type="text" name="{{ require_option['name'] }}"
id="text_{{ require_option['name'] }}" value="{{ require_option['value'] }}"
size="80" title="{{ require_option['description'] }}"
{%- if require_option['disabled'] %}
disabled
{%- endif -%}
/>
{% endif %}
</div>

View File

@ -1,11 +0,0 @@
<div class="item">
<label for="text_<?= $limit['input_name'] ?>">
<code>
<dfn title="<?= $limit['description'] ?>">
<?= $limit['name_main'] ?>
</dfn>
</code>
</label>
<input type="number" name="<?= $limit['input_name'] ?>" id="text_<?= $limit['input_name'] ?>"
value="<?= $limit['value'] ?>" title="<?= $limit['description'] ?>" />
</div>

View File

@ -0,0 +1,11 @@
<div class="item">
<label for="text_{{ limit['input_name'] }}">
<code>
<dfn title="{{ limit['description'] }}">
{{ limit['name_main'] }}
</dfn>
</code>
</label>
<input type="number" name="{{ limit['input_name'] }}" id="text_{{ limit['input_name'] }}"
value="{{ limit['value'] }}" title="{{ limit['description'] }}" />
</div>

View File

@ -1,6 +1,6 @@
<img class="selectallarrow" src="{{ pmaThemeImage }}arrow_{{ text_dir }}.png"
<img class="selectallarrow" src="{{ pma_theme_image }}arrow_{{ text_dir }}.png"
width="38" height="22" alt="{% trans 'With selected:' %}" />
<input type="checkbox" id="{{ formName }}_checkall" class="checkall_box"
<input type="checkbox" id="{{ form_name }}_checkall" class="checkall_box"
title="{% trans 'Check all' %}" />
<label for="{{ formName }}_checkall">{% trans 'Check all' %}</label>
<label for="{{ form_name }}_checkall">{% trans 'Check all' %}</label>
<i style="margin-left: 2em">{% trans 'With selected:' %}</i>

View File

@ -1,8 +0,0 @@
<tr class="noclick">
<td><?= $value['Log_name']; ?></td>
<td class="right"><?= $value['Pos']; ?></td>
<td><?= $value['Event_type']; ?></td>
<td class="right"><?= $value['Server_id']; ?></td>
<td class="right"><?= (isset($value['Orig_log_pos']) ? $value['Orig_log_pos'] : $value['End_log_pos']); ?></td>
<td><?= \PMA\libraries\Util::formatSql($value['Info'], ! $dontlimitchars); ?></td>
</tr>

View File

@ -0,0 +1,10 @@
<tr class="noclick">
<td>{{ value['Log_name'] }}</td>
<td class="right">{{ value['Pos'] }}</td>
<td>{{ value['Event_type'] }}</td>
<td class="right">{{ value['Server_id'] }}</td>
<td class="right">
{{- value['Orig_log_pos'] is defined ? value['Orig_log_pos'] : value['End_log_pos'] -}}
</td>
<td>{{ Util_formatSql(value['Info'], not dontlimitchars) }}</td>
</tr>

View File

@ -1,24 +0,0 @@
<div id="div_mysql_charset_collations">
<table class="data noclick">
<tr>
<th id="collationHeader"><?= __('Collation'); ?></th>
<th><?= __('Description'); ?></th>
</tr>
<?php foreach ($mysqlCharsets as $current_charset): ?>
<tr>
<th colspan="2" class="right">
<?= htmlspecialchars($current_charset); ?>
<?php if (! empty($mysqlCharsetsDesc[$current_charset])): ?>
(<i><?= htmlspecialchars($mysqlCharsetsDesc[$current_charset]); ?></i>)
<?php endif; ?>
</th>
</tr>
<?php foreach ($mysqlCollations[$current_charset] as $current_collation): ?>
<tr class="<?= ($mysqlDftCollations[$current_charset] == $current_collation ? ' marked' : ''); ?>">
<td><?= htmlspecialchars($current_collation); ?></td>
<td><?= PMA\libraries\Charsets::getCollationDescr($current_collation); ?></td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
</table>
</div>

View File

@ -0,0 +1,24 @@
<div id="div_mysql_charset_collations">
<table class="data noclick">
<tr>
<th id="collationHeader">{% trans 'Collation' %}</th>
<th>{% trans 'Description' %}</th>
</tr>
{% for current_charset in mysql_charsets %}
<tr>
<th colspan="2" class="right">
{{ current_charset }}
{% if mysql_charsets_desc[current_charset] is not empty %}
(<em>{{ mysql_charsets_desc[current_charset] }}</em>)
{% endif %}
</th>
</tr>
{% for current_collation in mysql_collations[current_charset] %}
<tr class="{{ mysql_dft_collations[current_charset] == current_collation ? ' marked' }}">
<td>{{ current_collation }}</td>
<td>{{ Charsets_getCollationDescr(current_collation) }}</td>
</tr>
{% endfor %}
{% endfor %}
</table>
</div>

View File

@ -1,22 +0,0 @@
<table class="noclick">
<thead>
<tr>
<th><?= __('Storage Engine'); ?></th>
<th><?= __('Description'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($engines as $engine => $details): ?>
<tr class="
<?= $details['Support'] == 'NO' || $details['Support'] == 'DISABLED' ? ' disabled' : ''; ?>
<?= $details['Support'] == 'DEFAULT' ? ' marked' : ''; ?>">
<td>
<a rel="newpage" href="server_engines.php<?= \PMA\libraries\URL::getCommon(array('engine' => $engine)); ?>">
<?= htmlspecialchars($details['Engine']); ?>
</a>
</td>
<td><?= htmlspecialchars($details['Comment']); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

View File

@ -0,0 +1,22 @@
<table class="noclick">
<thead>
<tr>
<th>{% trans 'Storage Engine' %}</th>
<th>{% trans 'Description' %}</th>
</tr>
</thead>
<tbody>
{% for engine, details in engines %}
<tr class="
{{- details['Support'] == 'NO' or details['Support'] == 'DISABLED' ? ' disabled' }}
{{ details['Support'] == 'DEFAULT' ? ' marked' }}">
<td>
<a rel="newpage" href="server_engines.php{{ URL_getCommon({'engine': engine}) }}">
{{ details['Engine'] }}
</a>
</td>
<td>{{ details['Comment'] }}</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -1,11 +0,0 @@
<a style="display: none;" href="<?= $url; ?>" class="ajax saveLink">
<?= \PMA\libraries\Util::getIcon('b_save.png', __('Save')); ?>
</a>
<a style="display: none;" href="#" class="cancelLink">
<?= \PMA\libraries\Util::getIcon('b_close.png', __('Cancel')); ?>
</a>
<?= \PMA\libraries\Util::getImage(
'b_help.png',
__('Documentation'),
array('style' => 'display:none', 'id' => 'docImage')
) ?>

View File

@ -0,0 +1,10 @@
<a href="{{ url|raw }}" class="ajax saveLink hide">
{{ Util_getIcon('b_save.png', 'Save'|trans) }}
</a>
<a href="#" class="cancelLink hide">
{{ Util_getIcon('b_close.png', 'Cancel'|trans) }}
</a>
{{ Util_getImage('b_help.png', 'Documentation'|trans, {
'class': 'hide',
'id': 'docImage'
}) }}

View File

@ -1,5 +0,0 @@
<tr class="var-row <?= $rowClass; ?>">
<td class="var-action"></td>
<td class="var-name session">(<?= __('Session value'); ?> )</td>
<td class="var-value value">&nbsp;<?= htmlspecialchars($value); ?></td>
</tr>

View File

@ -0,0 +1,5 @@
<tr class="var-row {{ row_class }}">
<td class="var-action"></td>
<td class="var-name session">({% trans 'Session value' %})</td>
<td class="var-value value">&nbsp;{{ value }}</td>
</tr>

View File

@ -1,7 +0,0 @@
<thead>
<tr class="var-header var-row">
<td class="var-action"><?= __('Action'); ?></td>
<td class="var-name"><?= __('Variable'); ?></td>
<td class="var-value"><?= __('Session value'); ?> / <?= __('Global value'); ?></td>
</tr>
</thead>

View File

@ -0,0 +1,7 @@
<thead>
<tr class="var-header var-row">
<td class="var-action">{% trans 'Action' %}</td>
<td class="var-name">{% trans 'Variable' %}</td>
<td class="var-value">{% trans 'Session value' %} / {% trans 'Global value' %}</td>
</tr>
</thead>

View File

@ -1,12 +0,0 @@
<?= (! empty($dropdown_question)
? htmlspecialchars($dropdown_question) . '&nbsp;&nbsp;'
: ''); ?><select name="<?= htmlspecialchars($select_name); ?>">
<?php foreach ($choices as $one_value => $one_label): ?>
<option value="<?= htmlspecialchars($one_value); ?>"
<?php if ($selected_value == $one_value): ?>
selected="selected"
<?php endif; ?>>
<?= htmlspecialchars($one_label); ?>
</option>
<?php endforeach; ?>
</select>

View File

@ -0,0 +1,9 @@
{{ dropdown_question is not empty ? dropdown_question ~ '&nbsp;&nbsp;' -}}
<select name="{{ select_name }}">
{% for one_value, one_label in choices %}
<option value="{{ one_value }}"
{%- if selected_value == one_value %} selected="selected"{% endif %}>
{{ one_label }}
</option>
{% endfor %}
</select>

View File

@ -1,18 +0,0 @@
<select name="<?= $name; ?>" title="<?= $title; ?>">
<option value=""></option>
<?php $seen_key = false; ?>
<?php foreach ($values as $value): ?>
<option value="<?= htmlspecialchars($value); ?>"
<?php if ($foreign !== false && $value == $foreign): ?>
selected="selected"
<?php $seen_key = true; ?>
<?php endif; ?>>
<?= htmlspecialchars($value); ?>
</option>
<?php endforeach; ?>
<?php if ($foreign !== false && ! $seen_key): ?>
<option value="<?= htmlspecialchars($foreign); ?>" selected="selected">
<?= htmlspecialchars($foreign); ?>
</option>
<?php endif; ?>
</select>

View File

@ -0,0 +1,18 @@
<select name="{{ name }}" title="{{ title }}">
<option value=""></option>
{% set seen_key = false %}
{% for value in values %}
<option value="{{ value }}"
{%- if foreign != false and value == foreign %}
selected="selected"
{%- set seen_key = true -%}
{%- endif %}>
{{ value }}
</option>
{% endfor %}
{% if foreign != false and not seen_key %}
<option value="{{ foreign }}" selected="selected">
{{ foreign }}
</option>
{% endif %}
</select>

View File

@ -3,7 +3,7 @@
<?php endif; ?>>
<?= PMA\libraries\Template::get('table/search/table_header')
->render(array(
'geomColumnFlag' => $geomColumnFlag
'geom_column_flag' => $geomColumnFlag
)); ?>
<tbody>
<?php if ($searchType == 'zoom'): ?>
@ -23,4 +23,4 @@
)) ?>
<?php endif; ?>
</tbody>
</table>
</table>

View File

@ -1,40 +0,0 @@
<form method="post"
action="tbl_find_replace.php"
name="previewForm"
id="previewForm">
<?= \PMA\libraries\URL::getHiddenInputs($db, $table); ?>
<input type="hidden" name="replace" value="true" />
<input type="hidden" name="columnIndex" value="<?= $columnIndex; ?>" />
<input type="hidden" name="findString" value="<?= htmlspecialchars($find); ?>" />
<input type="hidden" name="replaceWith" value="<?= htmlspecialchars($replaceWith); ?>" />
<input type="hidden" name="useRegex" value="<?= $useRegex; ?>" />
<fieldset id="fieldset_find_replace_preview">
<legend><?= __('Find and replace - preview'); ?></legend>
<table id="previewTable">
<thead>
<tr>
<th><?= __('Count'); ?></th>
<th><?= __('Original string'); ?></th>
<th><?= __('Replaced string'); ?></th>
</tr>
</thead>
<tbody>
<?php if (is_array($result)): ?>
<?php foreach ($result as $row): ?>
<?php $val = $row[0]; $replaced = $row[1]; $count = $row[2]; ?>
<tr>
<td class="right"><?= htmlspecialchars($count); ?></td>
<td><?= htmlspecialchars($val); ?></td>
<td><?= htmlspecialchars($replaced); ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" name="replace" value="<?= __('Replace'); ?>" />
</fieldset>
</form>

View File

@ -0,0 +1,39 @@
<form method="post"
action="tbl_find_replace.php"
name="previewForm"
id="previewForm">
{{ URL_getHiddenInputs(db, table) }}
<input type="hidden" name="replace" value="true" />
<input type="hidden" name="columnIndex" value="{{ column_index }}" />
<input type="hidden" name="findString" value="{{ find }}" />
<input type="hidden" name="replaceWith" value="{{ replace_with }}" />
<input type="hidden" name="useRegex" value="{{ use_regex }}" />
<fieldset id="fieldset_find_replace_preview">
<legend>{% trans 'Find and replace - preview' %}</legend>
<table id="previewTable">
<thead>
<tr>
<th>{% trans 'Count' %}</th>
<th>{% trans 'Original string' %}</th>
<th>{% trans 'Replaced string' %}</th>
</tr>
</thead>
<tbody>
{% if result is iterable %}
{% for row in result %}
<tr>
<td class="right">{{ row[2] }}</td>{# count #}
<td>{{ row[0] }}</td>{# original #}
<td>{{ row[1] }}</td>{# replaced #}
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" name="replace" value="{% trans 'Replace' %}" />
</fieldset>
</form>

View File

@ -1,12 +0,0 @@
<thead>
<tr>
<?php if ($geomColumnFlag): ?>
<th><?= __('Function'); ?></th>
<?php endif; ?>
<th><?= __('Column'); ?></th>
<th><?= __('Type'); ?></th>
<th><?= __('Collation'); ?></th>
<th><?= __('Operator'); ?></th>
<th><?= __('Value'); ?></th>
</tr>
</thead>

View File

@ -0,0 +1,12 @@
<thead>
<tr>
{% if geom_column_flag %}
<th>{% trans 'Function' %}</th>
{% endif %}
<th>{% trans 'Column' %}</th>
<th>{% trans 'Type' %}</th>
<th>{% trans 'Collation' %}</th>
<th>{% trans 'Operator' %}</th>
<th>{% trans 'Value' %}</th>
</tr>
</thead>

View File

@ -1,19 +0,0 @@
<?php $cfgRelation = PMA_getRelationsParam(); ?>
<?php if ($cfgRelation['relwork'] ||
PMA\libraries\Util::isForeignKeySupported($engine)): ?>
<ul id="topmenu2">
<?= PMA\libraries\Util::getHtmlTab(array(
'icon' => 'b_props',
'link' => 'tbl_structure.php',
'text' => __('Table structure'),
'id' => 'table_strucuture_id'
), $url_params); ?>
<?= PMA\libraries\Util::getHtmlTab(array(
'icon' => 'b_relations',
'link' => 'tbl_relation.php',
'text' => __('Relation view'),
'id' => 'table_relation_id'
), $url_params); ?>
</ul>
<div class="clearfloat"></div>
<?php endif; ?>

View File

@ -0,0 +1,17 @@
{% if cfg_relation['relwork'] or is_foreign_key_supported %}
<ul id="topmenu2">
{{ Util_getHtmlTab({
'icon': 'b_props',
'link': 'tbl_structure.php',
'text': 'Table structure'|trans,
'id': 'table_strucuture_id'
}, url_params) }}
{{ Util_getHtmlTab({
'icon': 'b_relations',
'link': 'tbl_relation.php',
'text': 'Relation view'|trans,
'id': 'table_relation_id'
}, url_params) }}
</ul>
<div class="clearfloat"></div>
{% endif %}

View File

@ -2,9 +2,9 @@
<?= PMA\libraries\Template::get('select_all')
->render(
array(
'pmaThemeImage' => $pmaThemeImage,
'text_dir' => $text_dir,
'formName' => "fieldsForm",
'pma_theme_image' => $pmaThemeImage,
'text_dir' => $text_dir,
'form_name' => "fieldsForm",
)
); ?>
<?= PMA\libraries\Util::getButtonOrImage(

View File

@ -2,18 +2,18 @@
<div class='wrapper toggleAjax hide'>
<div class='toggleButton'>
<div title="{% trans 'Click to toggle' %}" class='container {{ state }}'>
<img src="{{ pmaThemeImage }}toggle-{{ text_dir }}.png" alt='' />
<img src="{{ pma_theme_image }}toggle-{{ text_dir }}.png" alt='' />
<table class='nospacing nopadding'>
<tbody>
<tr>
<td class='toggleOn'>
<span class='hide'>{{ link_on }}</span>
<div>{{ toggleOn }}</div>
<div>{{ toggle_on }}</div>
</td>
<td><div>&nbsp;</div></td>
<td class='toggleOff'>
<span class='hide'>{{ link_off }}</span>
<div>{{ toggleOff }}</div>
<div>{{ toggle_off }}</div>
</td>
</tr>
</tbody>

View File

@ -115,7 +115,7 @@ class ServerCollationsControllerTest extends PMATestCase
);
//validate 2: Charset Item
$this->assertContains(
'<i>PMA_armscii8_general_ci</i>',
'<em>PMA_armscii8_general_ci</em>',
$html
);
$this->assertContains(
@ -123,7 +123,7 @@ class ServerCollationsControllerTest extends PMATestCase
$html
);
$this->assertContains(
'<i>PMA_ascii_general_ci</i>',
'<em>PMA_ascii_general_ci</em>',
$html
);
$this->assertContains(
@ -131,7 +131,7 @@ class ServerCollationsControllerTest extends PMATestCase
$html
);
$this->assertContains(
'<i>PMA_big5_general_ci</i>',
'<em>PMA_big5_general_ci</em>',
$html
);
$this->assertContains(