當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PMA_readUserprefsFieldNames函數代碼示例

本文整理匯總了PHP中PMA_readUserprefsFieldNames函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_readUserprefsFieldNames函數的具體用法?PHP PMA_readUserprefsFieldNames怎麽用?PHP PMA_readUserprefsFieldNames使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PMA_readUserprefsFieldNames函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: PMA_applyUserprefs

/**
 * Returns a user preferences array filtered by $cfg['UserprefsDisallow']
 * (blacklist) and keys from user preferences form (whitelist)
 *
 * @param array $config_data path => value pairs
 *
 * @return array
 */
function PMA_applyUserprefs(array $config_data)
{
    $cfg = array();
    $blacklist = array_flip($GLOBALS['cfg']['UserprefsDisallow']);
    if (!$GLOBALS['cfg']['UserprefsDeveloperTab']) {
        // disallow everything in the Developers tab
        $blacklist['DBG/sql'] = true;
    }
    $whitelist = array_flip(PMA_readUserprefsFieldNames());
    // whitelist some additional fields which are custom handled
    $whitelist['ThemeDefault'] = true;
    $whitelist['fontsize'] = true;
    $whitelist['lang'] = true;
    $whitelist['collation_connection'] = true;
    $whitelist['Server/hide_db'] = true;
    $whitelist['Server/only_db'] = true;
    foreach ($config_data as $path => $value) {
        if (!isset($whitelist[$path]) || isset($blacklist[$path])) {
            continue;
        }
        PMA_arrayWrite($path, $cfg, $value);
    }
    return $cfg;
}
開發者ID:wp-cloud,項目名稱:phpmyadmin,代碼行數:32,代碼來源:user_preferences.lib.php

示例2: _loadUserprefsInfo

 /**
  * Fills out {@link userprefs_keys} and {@link userprefs_disallow}
  *
  * @return void
  */
 private function _loadUserprefsInfo()
 {
     if ($this->_userprefsKeys !== null) {
         return;
     }
     $this->_userprefsKeys = array_flip(PMA_readUserprefsFieldNames());
     // read real config for user preferences display
     $userprefs_disallow = defined('PMA_SETUP') ? $this->_configFile->get('UserprefsDisallow', array()) : $GLOBALS['cfg']['UserprefsDisallow'];
     $this->_userprefsDisallow = array_flip($userprefs_disallow);
 }
開發者ID:rclakmal,項目名稱:phpmyadmin,代碼行數:15,代碼來源:FormDisplay.php

示例3: testReadUserprefsFieldNames

 /**
  * Test for PMA_readUserprefsFieldNames
  *
  * @return void
  */
 public function testReadUserprefsFieldNames()
 {
     $this->assertGreaterThan(0, count(PMA_readUserprefsFieldNames()));
     $forms = array('form1' => array(array('Servers/1/hide_db', 'bar'), array('test' => 'val')));
     $this->assertEquals(array('Servers/1/hide_db', 'bar', 'test'), PMA_readUserprefsFieldNames($forms));
 }
開發者ID:phpmyadmin,項目名稱:phpmyadmin,代碼行數:11,代碼來源:PMA_user_preferences_test.php


注:本文中的PMA_readUserprefsFieldNames函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。