本文整理汇总了PHP中PMA_userprefsPageInit函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_userprefsPageInit函数的具体用法?PHP PMA_userprefsPageInit怎么用?PHP PMA_userprefsPageInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_userprefsPageInit函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param string $formGroupName The name of config form group to display
* @param string $elemId Id of the div containing settings
*/
public function __construct($formGroupName, $elemId = null)
{
global $forms;
if (empty($forms[$formGroupName])) {
return;
}
if (isset($_REQUEST['printview']) && $_REQUEST['printview'] == '1') {
return;
}
if (!empty($elemId)) {
$this->_elemId = $elemId;
}
$this->_groupName = $formGroupName;
$cf = new ConfigFile($GLOBALS['PMA_Config']->base_settings);
PMA_userprefsPageInit($cf);
$form_display = new FormDisplay($cf);
foreach ($forms[$formGroupName] as $form_name => $form) {
// skip Developer form if no setting is available
if ($form_name == 'Developer' && !$GLOBALS['cfg']['UserprefsDeveloperTab']) {
continue;
}
$form_display->registerForm($form_name, $form, 1);
}
// Process form
$error = null;
if (isset($_POST['submit_save']) && $_POST['submit_save'] == $formGroupName) {
$this->_processPageSettings($form_display, $cf, $error);
}
// Display forms
$this->_HTML = $this->_getPageSettingsDisplay($form_display, $error);
}
示例2: testUserPrefPageInit
/**
* Test for PMA_userprefsPageInit
*
* @return void
*/
public function testUserPrefPageInit()
{
$GLOBALS['cfg'] = array(
'Server/hide_db' => 'testval123',
'Server/only_db' => 'test213'
);
$GLOBALS['cfg']['AvailableCharsets'] = array();
$GLOBALS['forms'] = array(
'form1' => array(
array('Servers/1/hide_db', 'bar'),
array('test' => 'val')
)
);
PMA_userprefsPageInit(new ConfigFile());
$this->assertEquals(
array(
'Servers' => array(
1 => array(
'hide_db' => 'testval123'
)
)
),
$_SESSION['ConfigFile' . $GLOBALS['server']]
);
}
示例3: ConfigFile
use PMA\libraries\config\ConfigFile;
use PMA\libraries\config\FormDisplay;
use PMA\libraries\Message;
use PMA\libraries\Response;
use PMA\libraries\PMA_String;
use PMA\libraries\Util;
/**
* Gets some core libraries and displays a top message if required
*/
require_once 'libraries/common.inc.php';
require_once 'libraries/user_preferences.lib.php';
require_once 'libraries/config/config_functions.lib.php';
require_once 'libraries/config/messages.inc.php';
require 'libraries/config/user_preferences.forms.php';
$cf = new ConfigFile($GLOBALS['PMA_Config']->base_settings);
PMA_userprefsPageInit($cf);
$error = '';
if (isset($_POST['submit_export']) && isset($_POST['export_type']) && $_POST['export_type'] == 'text_file') {
// export to JSON file
PMA\libraries\Response::getInstance()->disable();
$filename = 'phpMyAdmin-config-' . urlencode(PMA_getenv('HTTP_HOST')) . '.json';
PMA_downloadHeader($filename, 'application/json');
$settings = PMA_loadUserprefs();
echo json_encode($settings['config_data'], JSON_PRETTY_PRINT);
exit;
} else {
if (isset($_POST['submit_get_json'])) {
$settings = PMA_loadUserprefs();
$response = PMA\libraries\Response::getInstance();
$response->addJSON('prefs', json_encode($settings['config_data']));
$response->addJSON('mtime', $settings['mtime']);
示例4: PMA_userprefsPageInit
* User preferences management page
*
* @package PhpMyAdmin
*/
/**
* Gets some core libraries and displays a top message if required
*/
require_once 'libraries/common.inc.php';
require_once 'libraries/user_preferences.lib.php';
require_once 'libraries/config/config_functions.lib.php';
require_once 'libraries/config/messages.inc.php';
require_once 'libraries/config/ConfigFile.class.php';
require_once 'libraries/config/Form.class.php';
require_once 'libraries/config/FormDisplay.class.php';
require 'libraries/config/user_preferences.forms.php';
PMA_userprefsPageInit();
$error = '';
if (isset($_POST['submit_export']) && filter_input(INPUT_POST, 'export_type') == 'text_file') {
// export to JSON file
PMA_Response::getInstance()->disable();
$filename = 'phpMyAdmin-config-' . urlencode(PMA_getenv('HTTP_HOST')) . '.json';
PMA_downloadHeader($filename, 'application/json');
$settings = PMA_loadUserprefs();
echo json_encode($settings['config_data']);
exit;
} else {
if (isset($_POST['submit_get_json'])) {
$settings = PMA_loadUserprefs();
$response = PMA_Response::getInstance();
$response->addJSON('prefs', json_encode($settings['config_data']));
$response->addJSON('mtime', $settings['mtime']);