Coding style: Fix some methods names
This commit is contained in:
parent
d23417635f
commit
1a177f10ae
@ -692,9 +692,9 @@ class PMA_Config
|
||||
) {
|
||||
// load required libraries
|
||||
include_once './libraries/user_preferences.lib.php';
|
||||
$prefs = PMA_load_userprefs();
|
||||
$prefs = PMA_loadUserprefs();
|
||||
$_SESSION['cache'][$cache_key]['userprefs']
|
||||
= PMA_apply_userprefs($prefs['config_data']);
|
||||
= PMA_applyUserprefs($prefs['config_data']);
|
||||
$_SESSION['cache'][$cache_key]['userprefs_mtime'] = $prefs['mtime'];
|
||||
$_SESSION['cache'][$cache_key]['userprefs_type'] = $prefs['type'];
|
||||
$_SESSION['cache'][$cache_key]['config_mtime'] = $config_mtime;
|
||||
@ -834,7 +834,7 @@ class PMA_Config
|
||||
if ($default_value === null) {
|
||||
$default_value = PMA_arrayRead($cfg_path, $this->default);
|
||||
}
|
||||
PMA_persist_option($cfg_path, $new_cfg_value, $default_value);
|
||||
PMA_persistOption($cfg_path, $new_cfg_value, $default_value);
|
||||
}
|
||||
if ($prefs_type != 'db' && $cookie_name) {
|
||||
// fall back to cookies
|
||||
|
||||
@ -736,7 +736,7 @@ class FormDisplay
|
||||
private function _loadUserprefsInfo()
|
||||
{
|
||||
if ($this->_userprefs_keys === null) {
|
||||
$this->_userprefs_keys = array_flip(PMA_read_userprefs_fieldnames());
|
||||
$this->_userprefs_keys = array_flip(PMA_readUserprefsFieldNames());
|
||||
// read real config for user preferences display
|
||||
$userprefs_disallow = defined('PMA_SETUP')
|
||||
? ConfigFile::getInstance()->get('UserprefsDisallow', array())
|
||||
|
||||
@ -14,9 +14,9 @@ if (! defined('PHPMYADMIN')) {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function PMA_userprefs_pageinit()
|
||||
function PMA_userprefsPageInit()
|
||||
{
|
||||
$forms_all_keys = PMA_read_userprefs_fieldnames($GLOBALS['forms']);
|
||||
$forms_all_keys = PMA_readUserprefsFieldNames($GLOBALS['forms']);
|
||||
$cf = ConfigFile::getInstance();
|
||||
$cf->resetConfigData(); // start with a clean instance
|
||||
$cf->setAllowedKeys($forms_all_keys);
|
||||
@ -39,7 +39,7 @@ function PMA_userprefs_pageinit()
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function PMA_load_userprefs()
|
||||
function PMA_loadUserprefs()
|
||||
{
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
if (! $cfgRelation['userconfigwork']) {
|
||||
@ -76,7 +76,7 @@ function PMA_load_userprefs()
|
||||
*
|
||||
* @return true|PMA_Message
|
||||
*/
|
||||
function PMA_save_userprefs(array $config_array)
|
||||
function PMA_saveUserprefs(array $config_array)
|
||||
{
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
$server = isset($GLOBALS['server'])
|
||||
@ -137,7 +137,7 @@ function PMA_save_userprefs(array $config_array)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function PMA_apply_userprefs(array $config_data)
|
||||
function PMA_applyUserprefs(array $config_data)
|
||||
{
|
||||
$cfg = array();
|
||||
$blacklist = array_flip($GLOBALS['cfg']['UserprefsDisallow']);
|
||||
@ -147,7 +147,7 @@ function PMA_apply_userprefs(array $config_data)
|
||||
$blacklist['Error_Handler/gather'] = true;
|
||||
$blacklist['DBG/sql'] = true;
|
||||
}
|
||||
$whitelist = array_flip(PMA_read_userprefs_fieldnames());
|
||||
$whitelist = array_flip(PMA_readUserprefsFieldNames());
|
||||
// whitelist some additional fields which are custom handled
|
||||
$whitelist['ThemeDefault'] = true;
|
||||
$whitelist['fontsize'] = true;
|
||||
@ -171,7 +171,7 @@ function PMA_apply_userprefs(array $config_data)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function PMA_read_userprefs_fieldnames(array $forms = null)
|
||||
function PMA_readUserprefsFieldNames(array $forms = null)
|
||||
{
|
||||
static $names;
|
||||
|
||||
@ -205,9 +205,9 @@ function PMA_read_userprefs_fieldnames(array $forms = null)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function PMA_persist_option($path, $value, $default_value)
|
||||
function PMA_persistOption($path, $value, $default_value)
|
||||
{
|
||||
$prefs = PMA_load_userprefs();
|
||||
$prefs = PMA_loadUserprefs();
|
||||
if ($value === $default_value) {
|
||||
if (isset($prefs['config_data'][$path])) {
|
||||
unset($prefs['config_data'][$path]);
|
||||
@ -217,7 +217,7 @@ function PMA_persist_option($path, $value, $default_value)
|
||||
} else {
|
||||
$prefs['config_data'][$path] = $value;
|
||||
}
|
||||
PMA_save_userprefs($prefs['config_data']);
|
||||
PMA_saveUserprefs($prefs['config_data']);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -231,7 +231,7 @@ function PMA_persist_option($path, $value, $default_value)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function PMA_userprefs_redirect(array $forms, array $old_settings, $file_name,
|
||||
function PMA_userprefsRedirect(array $forms, array $old_settings, $file_name,
|
||||
$params = null, $hash = null
|
||||
) {
|
||||
$reload_left_frame = isset($params['reload_left_frame']) && $params['reload_left_frame'];
|
||||
|
||||
@ -18,7 +18,7 @@ require_once 'libraries/config/Form.class.php';
|
||||
require_once 'libraries/config/FormDisplay.class.php';
|
||||
require 'libraries/config/user_preferences.forms.php';
|
||||
|
||||
PMA_userprefs_pageinit();
|
||||
PMA_userprefsPageInit();
|
||||
|
||||
// handle form processing
|
||||
|
||||
@ -52,13 +52,13 @@ if (isset($_POST['revert'])) {
|
||||
$error = null;
|
||||
if ($form_display->process(false) && !$form_display->hasErrors()) {
|
||||
// save settings
|
||||
$old_settings = PMA_load_userprefs();
|
||||
$result = PMA_save_userprefs(ConfigFile::getInstance()->getConfigArray());
|
||||
$old_settings = PMA_loadUserprefs();
|
||||
$result = PMA_saveUserprefs(ConfigFile::getInstance()->getConfigArray());
|
||||
if ($result === true) {
|
||||
// reload config
|
||||
$GLOBALS['PMA_Config']->loadUserPreferences();
|
||||
$hash = ltrim(filter_input(INPUT_POST, 'tab_hash'), '#');
|
||||
PMA_userprefs_redirect(
|
||||
PMA_userprefsRedirect(
|
||||
$forms, $old_settings, 'prefs_forms.php',
|
||||
array('form' => $form_param), $hash
|
||||
);
|
||||
|
||||
@ -18,7 +18,7 @@ require_once 'libraries/config/Form.class.php';
|
||||
require_once 'libraries/config/FormDisplay.class.php';
|
||||
require 'libraries/config/user_preferences.forms.php';
|
||||
|
||||
PMA_userprefs_pageinit();
|
||||
PMA_userprefsPageInit();
|
||||
|
||||
$error = '';
|
||||
if (isset($_POST['submit_export'])
|
||||
@ -28,11 +28,11 @@ if (isset($_POST['submit_export'])
|
||||
PMA_Response::getInstance()->disable();
|
||||
$filename = 'phpMyAdmin-config-' . urlencode(PMA_getenv('HTTP_HOST')) . '.json';
|
||||
PMA_downloadHeader($filename, 'application/json');
|
||||
$settings = PMA_load_userprefs();
|
||||
$settings = PMA_loadUserprefs();
|
||||
echo json_encode($settings['config_data']);
|
||||
exit;
|
||||
} else if (isset($_POST['submit_get_json'])) {
|
||||
$settings = PMA_load_userprefs();
|
||||
$settings = PMA_loadUserprefs();
|
||||
$response = PMA_Response::getInstance();
|
||||
$response->addJSON('prefs', json_encode($settings['config_data']));
|
||||
$response->addJSON('mtime', $settings['mtime']);
|
||||
@ -164,8 +164,8 @@ if (isset($_POST['submit_export'])
|
||||
}
|
||||
|
||||
// save settings
|
||||
$old_settings = PMA_load_userprefs();
|
||||
$result = PMA_save_userprefs($cf->getConfigArray());
|
||||
$old_settings = PMA_loadUserprefs();
|
||||
$result = PMA_saveUserprefs($cf->getConfigArray());
|
||||
if ($result === true) {
|
||||
if ($return_url) {
|
||||
$query = explode('&', parse_url($return_url, PHP_URL_QUERY));
|
||||
@ -183,15 +183,15 @@ if (isset($_POST['submit_export'])
|
||||
}
|
||||
// reload config
|
||||
$GLOBALS['PMA_Config']->loadUserPreferences();
|
||||
PMA_userprefs_redirect($forms, $old_settings, $return_url, $params);
|
||||
PMA_userprefsRedirect($forms, $old_settings, $return_url, $params);
|
||||
exit;
|
||||
} else {
|
||||
$error = $result;
|
||||
}
|
||||
}
|
||||
} else if (isset($_POST['submit_clear'])) {
|
||||
$old_settings = PMA_load_userprefs();
|
||||
$result = PMA_save_userprefs(array());
|
||||
$old_settings = PMA_loadUserprefs();
|
||||
$result = PMA_saveUserprefs(array());
|
||||
if ($result === true) {
|
||||
$params = array();
|
||||
if ($_SESSION['PMA_Theme_Manager']->theme->getId() != 'original') {
|
||||
@ -208,7 +208,7 @@ if (isset($_POST['submit_export'])
|
||||
}
|
||||
$GLOBALS['PMA_Config']->removeCookie('pma_collaction_connection');
|
||||
$GLOBALS['PMA_Config']->removeCookie('pma_lang');
|
||||
PMA_userprefs_redirect($forms, $old_settings, 'prefs_manage.php', $params);
|
||||
PMA_userprefsRedirect($forms, $old_settings, 'prefs_manage.php', $params);
|
||||
exit;
|
||||
} else {
|
||||
$error = $result;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user