当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_Util::showMySQLDocu方法代码示例

本文整理汇总了PHP中PMA_Util::showMySQLDocu方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Util::showMySQLDocu方法的具体用法?PHP PMA_Util::showMySQLDocu怎么用?PHP PMA_Util::showMySQLDocu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMA_Util的用法示例。


在下文中一共展示了PMA_Util::showMySQLDocu方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_RTE_getFooterLinks

/**
 * Creates a fieldset for adding a new item, if the user has the privileges.
 *
 * @param string $docu String used to create a link to the MySQL docs
 * @param string $priv Privilege to check for adding a new item
 * @param string $name MySQL name of the item
 *
 * @return string An HTML snippet with the link to add a new item
 */
function PMA_RTE_getFooterLinks($docu, $priv, $name)
{
    global $db, $url_query, $ajax_class;
    $icon = 'b_' . strtolower($name) . '_add.png';
    $retval = "";
    $retval .= "<!-- ADD " . $name . " FORM START -->\n";
    $retval .= "<fieldset class='left'>\n";
    $retval .= "<legend>" . _pgettext('Create new procedure', 'New') . "</legend>\n";
    $retval .= "        <div class='wrap'>\n";
    if (PMA_Util::currentUserHasPrivilege($priv, $db)) {
        $retval .= "            <a {$ajax_class['add']} ";
        $retval .= "href='db_" . strtolower($name) . "s.php";
        $retval .= "?{$url_query}&amp;add_item=1' onclick='\$.datepicker.initialized = false;'>";
        $retval .= PMA_Util::getIcon($icon);
        $retval .= PMA_RTE_getWord('add') . "</a>\n";
    } else {
        $retval .= "            " . PMA_Util::getIcon($icon);
        $retval .= PMA_RTE_getWord('no_create') . "\n";
    }
    $retval .= "            " . PMA_Util::showMySQLDocu($docu) . "\n";
    $retval .= "        </div>\n";
    $retval .= "</fieldset>\n";
    $retval .= "<!-- ADD " . $name . " FORM END -->\n\n";
    return $retval;
}
开发者ID:minggLu,项目名称:openemr,代码行数:34,代码来源:rte_footer.lib.php

示例2: PMA_getHtmlForQueryStatistics

/**
 * Returns the html content for the query statistics
 *
 * @param PMA_ServerStatusData $ServerStatusData Server status data
 *
 * @return string
 */
function PMA_getHtmlForQueryStatistics($ServerStatusData)
{
    $retval = '';
    $hour_factor = 3600 / $ServerStatusData->status['Uptime'];
    $used_queries = $ServerStatusData->used_queries;
    $total_queries = array_sum($used_queries);
    $retval .= '<h3 id="serverstatusqueries">';
    /* l10n: Questions is the name of a MySQL Status variable */
    $retval .= sprintf(__('Questions since startup: %s'), PMA_Util::formatNumber($total_queries, 0));
    $retval .= ' ';
    $retval .= PMA_Util::showMySQLDocu('server-status-variables', false, 'statvar_Questions');
    $retval .= '<br />';
    $retval .= '<span>';
    $retval .= '&oslash; ' . __('per hour:') . ' ';
    $retval .= PMA_Util::formatNumber($total_queries * $hour_factor, 0);
    $retval .= '<br />';
    $retval .= '&oslash; ' . __('per minute:') . ' ';
    $retval .= PMA_Util::formatNumber($total_queries * 60 / $ServerStatusData->status['Uptime'], 0);
    $retval .= '<br />';
    if ($total_queries / $ServerStatusData->status['Uptime'] >= 1) {
        $retval .= '&oslash; ' . __('per second:') . ' ';
        $retval .= PMA_Util::formatNumber($total_queries / $ServerStatusData->status['Uptime'], 0);
    }
    $retval .= '</span>';
    $retval .= '</h3>';
    $retval .= PMA_getHtmlForServerStatusQueriesDetails($ServerStatusData);
    return $retval;
}
开发者ID:altesien,项目名称:FinalProject,代码行数:35,代码来源:server_status_queries.lib.php

示例3: PMA_getHtmlForSpecifiedServerEngines

/**
 * setup HTML for a given Storage Engine
 *
 * @return string
 */
function PMA_getHtmlForSpecifiedServerEngines()
{
    /**
     * Displays details about a given Storage Engine
     */
    $html = '';
    $engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']);
    $html .= '<h2>' . "\n" . PMA_Util::getImage('b_engine.png') . '    ' . htmlspecialchars($engine_plugin->getTitle()) . "\n" . '    ' . PMA_Util::showMySQLDocu($engine_plugin->getMysqlHelpPage()) . "\n" . '</h2>' . "\n\n";
    $html .= '<p>' . "\n" . '    <em>' . "\n" . '        ' . htmlspecialchars($engine_plugin->getComment()) . "\n" . '    </em>' . "\n" . '</p>' . "\n\n";
    $infoPages = $engine_plugin->getInfoPages();
    if (!empty($infoPages) && is_array($infoPages)) {
        $html .= '<p>' . "\n" . '    <strong>[</strong>' . "\n";
        if (empty($_REQUEST['page'])) {
            $html .= '    <strong>' . __('Variables') . '</strong>' . "\n";
        } else {
            $html .= '    <a href="server_engines.php' . PMA_URL_getCommon(array('engine' => $_REQUEST['engine'])) . '">' . __('Variables') . '</a>' . "\n";
        }
        foreach ($infoPages as $current => $label) {
            $html .= '    <strong>|</strong>' . "\n";
            if (isset($_REQUEST['page']) && $_REQUEST['page'] == $current) {
                $html .= '    <strong>' . $label . '</strong>' . "\n";
            } else {
                $html .= '    <a href="server_engines.php' . PMA_URL_getCommon(array('engine' => $_REQUEST['engine'], 'page' => $current)) . '">' . htmlspecialchars($label) . '</a>' . "\n";
            }
        }
        unset($current, $label);
        $html .= '    <strong>]</strong>' . "\n" . '</p>' . "\n\n";
    }
    unset($infoPages, $page_output);
    if (!empty($_REQUEST['page'])) {
        $page_output = $engine_plugin->getPage($_REQUEST['page']);
    }
    if (!empty($page_output)) {
        $html .= $page_output;
    } else {
        $html .= '<p> ' . $engine_plugin->getSupportInformationMessage() . "\n" . '</p>' . "\n" . $engine_plugin->getHtmlVariables();
    }
    return $html;
}
开发者ID:nervo,项目名称:phpmyadmin,代码行数:44,代码来源:server_engines.lib.php

示例4: PMA_getHtmlForChangePassword

/**
 * Get HTML for the Change password dialog
 *
 * @param string $mode     where is the function being called?
 *                         values : 'change_pw' or 'edit_other'
 * @param string $username username
 * @param string $hostname hostname
 *
 * @return string html snippet
 */
function PMA_getHtmlForChangePassword($mode, $username, $hostname)
{
    /**
     * autocomplete feature of IE kills the "onchange" event handler and it
     * must be replaced by the "onpropertychange" one in this case
     */
    $chg_evt_handler = PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5 && PMA_USR_BROWSER_VER < 7 ? 'onpropertychange' : 'onchange';
    $is_privileges = basename($_SERVER['SCRIPT_NAME']) === 'server_privileges.php';
    $html = '<form method="post" id="change_password_form" ' . 'action="' . basename($GLOBALS['PMA_PHP_SELF']) . '" ' . 'name="chgPassword" ' . 'class="' . ($is_privileges ? 'submenu-item' : '') . '">';
    $html .= PMA_URL_getHiddenInputs();
    if (strpos($GLOBALS['PMA_PHP_SELF'], 'server_privileges') !== false) {
        $html .= '<input type="hidden" name="username" ' . 'value="' . htmlspecialchars($username) . '" />' . '<input type="hidden" name="hostname" ' . 'value="' . htmlspecialchars($hostname) . '" />';
    }
    $html .= '<fieldset id="fieldset_change_password">' . '<legend' . ($is_privileges ? ' data-submenu-label="' . __('Change password') . '"' : '') . '>' . __('Change password') . '</legend>' . '<table class="data noclick">' . '<tr class="odd">' . '<td colspan="2">' . '<input type="radio" name="nopass" value="1" id="nopass_1" ' . 'onclick="pma_pw.value = \'\'; pma_pw2.value = \'\'; ' . 'this.checked = true" />' . '<label for="nopass_1">' . __('No Password') . '</label>' . '</td>' . '</tr>' . '<tr class="even vmiddle">' . '<td>' . '<input type="radio" name="nopass" value="0" id="nopass_0" ' . 'onclick="document.getElementById(\'text_pma_pw\').focus();" ' . 'checked="checked" />' . '<label for="nopass_0">' . __('Password:') . '&nbsp;</label>' . '</td>' . '<td>' . '<input type="password" name="pma_pw" id="text_pma_pw" size="10" ' . 'class="textfield"' . $chg_evt_handler . '="nopass[1].checked = true" />' . '&nbsp;&nbsp;' . __('Re-type:') . '&nbsp;' . '<input type="password" name="pma_pw2" id="text_pma_pw2" size="10" ' . 'class="textfield"' . $chg_evt_handler . '="nopass[1].checked = true" />' . '</td>' . '</tr>';
    $serverType = PMA_Util::getServerType();
    $orig_auth_plugin = PMA_getCurrentAuthenticationPlugin('change', $username, $hostname);
    $is_superuser = $GLOBALS['dbi']->isSuperuser();
    if ($serverType == 'MySQL' && PMA_MYSQL_INT_VERSION >= 50507 || $serverType == 'MariaDB' && PMA_MYSQL_INT_VERSION >= 50200) {
        // Provide this option only for 5.7.6+
        // OR for privileged users in 5.5.7+
        if ($serverType == 'MySQL' && PMA_MYSQL_INT_VERSION >= 50706 || $is_superuser && $mode == 'edit_other') {
            $auth_plugin_dropdown = PMA_getHtmlForAuthPluginsDropdown($username, $hostname, $orig_auth_plugin, 'change_pw', 'new');
            $html .= '<tr class="vmiddle">' . '<td>' . __('Password Hashing:') . '</td><td>';
            $html .= $auth_plugin_dropdown;
            $html .= '</td></tr>' . '<tr id="tr_element_before_generate_password"></tr>' . '</table>';
            $html .= '<div ' . ($orig_auth_plugin != 'sha256_password' ? 'style="display:none"' : '') . ' id="ssl_reqd_warning_cp">' . PMA_Message::notice(__('This method requires using an \'<i>SSL connection</i>\' ' . 'or an \'<i>unencrypted connection that encrypts the password ' . 'using RSA</i>\'; while connecting to the server.') . PMA_Util::showMySQLDocu('sha256-authentication-plugin'))->getDisplay() . '</div>';
        } else {
            $html .= '<tr id="tr_element_before_generate_password"></tr>' . '</table>';
        }
    } else {
        $auth_plugin_dropdown = PMA_getHtmlForAuthPluginsDropdown($username, $hostname, $orig_auth_plugin, 'change_pw', 'old');
        $html .= '<tr class="vmiddle">' . '<td>' . __('Password Hashing:') . '</td><td>';
        $html .= $auth_plugin_dropdown . '</td></tr>' . '<tr id="tr_element_before_generate_password"></tr>' . '</table>';
    }
    $html .= '</fieldset>' . '<fieldset id="fieldset_change_password_footer" class="tblFooters">' . '<input type="hidden" name="change_pw" value="1" />' . '<input type="submit" value="' . __('Go') . '" />' . '</fieldset>' . '</form>';
    return $html;
}
开发者ID:FuhrerMalkovich,项目名称:Blogpost,代码行数:47,代码来源:display_change_password.lib.php

示例5: PMA_getHtmlForChangePassword

/**
 * Get HTML for the Change password dialog
 *
 * @param string $username username
 * @param string $hostname hostname
 *
 * @return string html snippet
 */
function PMA_getHtmlForChangePassword($username, $hostname)
{
    /**
     * autocomplete feature of IE kills the "onchange" event handler and it
     * must be replaced by the "onpropertychange" one in this case
     */
    $chg_evt_handler = PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5 && PMA_USR_BROWSER_VER < 7 ? 'onpropertychange' : 'onchange';
    $is_privileges = basename($_SERVER['SCRIPT_NAME']) === 'server_privileges.php';
    $html = '<form method="post" id="change_password_form" ' . 'action="' . basename($GLOBALS['PMA_PHP_SELF']) . '" ' . 'name="chgPassword" ' . 'class="' . ($is_privileges ? 'submenu-item' : '') . '">';
    $html .= PMA_URL_getHiddenInputs();
    if (strpos($GLOBALS['PMA_PHP_SELF'], 'server_privileges') !== false) {
        $html .= '<input type="hidden" name="username" ' . 'value="' . htmlspecialchars($username) . '" />' . '<input type="hidden" name="hostname" ' . 'value="' . htmlspecialchars($hostname) . '" />';
    }
    $html .= '<fieldset id="fieldset_change_password">' . '<legend' . ($is_privileges ? ' data-submenu-label="' . __('Change password') . '"' : '') . '>' . __('Change password') . '</legend>' . '<table class="data noclick">' . '<tr class="odd">' . '<td colspan="2">' . '<input type="radio" name="nopass" value="1" id="nopass_1" ' . 'onclick="pma_pw.value = \'\'; pma_pw2.value = \'\'; ' . 'this.checked = true" />' . '<label for="nopass_1">' . __('No Password') . '</label>' . '</td>' . '</tr>' . '<tr class="even vmiddle">' . '<td>' . '<input type="radio" name="nopass" value="0" id="nopass_0" ' . 'onclick="document.getElementById(\'text_pma_pw\').focus();" ' . 'checked="checked" />' . '<label for="nopass_0">' . __('Password:') . '&nbsp;</label>' . '</td>' . '<td>' . '<input type="password" name="pma_pw" id="text_pma_pw" size="10" ' . 'class="textfield"' . $chg_evt_handler . '="nopass[1].checked = true" />' . '&nbsp;&nbsp;' . __('Re-type:') . '&nbsp;' . '<input type="password" name="pma_pw2" id="text_pma_pw2" size="10" ' . 'class="textfield"' . $chg_evt_handler . '="nopass[1].checked = true" />' . '</td>' . '</tr>';
    $default_auth_plugin = PMA_getCurrentAuthenticationPlugin('change', $username, $hostname);
    // See http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-5.html
    if (PMA_MYSQL_INT_VERSION >= 50705) {
        $html .= '<tr class="vmiddle">' . '<td>' . __('Password Hashing:') . '</td>' . '<td>' . '<input type="radio" name="pw_hash" id="radio_pw_hash_mysql_native" ' . 'value="mysql_native_password"';
        if ($default_auth_plugin == 'mysql_native_password') {
            $html .= '" checked="checked"';
        }
        $html .= ' />' . '<label for="radio_pw_hash_mysql_native">' . __('MySQL native password') . '</label>' . '</td>' . '</tr>' . '<tr id="tr_element_before_generate_password">' . '<td>&nbsp;</td>' . '<td>' . '<input type="radio" name="pw_hash" id="radio_pw_hash_sha256" ' . 'value="sha256_password"';
        if ($default_auth_plugin == 'sha256_password') {
            $html .= '" checked="checked"';
        }
        $html .= ' />' . '<label for="radio_pw_hash_sha256">' . __('SHA256 password') . '</label>' . '</td>' . '</tr>';
    } elseif (PMA_MYSQL_INT_VERSION >= 50606) {
        $html .= '<tr class="vmiddle" id="tr_element_before_generate_password">' . '<td>' . __('Password Hashing:') . '</td>' . '<td>' . '<input type="radio" name="pw_hash" id="radio_pw_hash_new" ' . 'value="' . $default_auth_plugin . '" checked="checked" />' . '<label for="radio_pw_hash_new">' . $default_auth_plugin . '</label>' . '</td>' . '</tr>';
    } else {
        $html .= '<tr class="vmiddle">' . '<td>' . __('Password Hashing:') . '</td>' . '<td>' . '<input type="radio" name="pw_hash" id="radio_pw_hash_new" ' . 'value="mysql_native_password" checked="checked" />' . '<label for="radio_pw_hash_new">mysql_native_password</label>' . '</td>' . '</tr>' . '<tr id="tr_element_before_generate_password" >' . '<td>&nbsp;</td>' . '<td>' . '<input type="radio" name="pw_hash" id="radio_pw_hash_old" ' . 'value="old" />' . '<label for="radio_pw_hash_old">' . __('MySQL 4.0 compatible') . '</label>' . '</td>' . '</tr>';
    }
    $html .= '</table>';
    $html .= '<div ' . ($default_auth_plugin != 'sha256_password' ? 'style="display:none"' : '') . ' id="ssl_reqd_warning">' . PMA_Message::notice(__('This method requires using an \'<i>SSL connection</i>\' ' . 'or an \'<i>unencrypted connection that encrypts the password ' . 'using RSA</i>\'; while connecting to the server.') . PMA_Util::showMySQLDocu('sha256-authentication-plugin'))->getDisplay() . '</div>';
    $html .= '</fieldset>' . '<fieldset id="fieldset_change_password_footer" class="tblFooters">' . '<input type="hidden" name="change_pw" value="1" />' . '<input type="submit" value="' . __('Go') . '" />' . '</fieldset>' . '</form>';
    return $html;
}
开发者ID:sagarshah007,项目名称:phpmyadmin,代码行数:44,代码来源:display_change_password.lib.php

示例6: getSelectionForm

 /**
  * Provides the main search form's html
  *
  * @return string HTML for selection form
  */
 public function getSelectionForm()
 {
     $html_output = '<a id="db_search"></a>';
     $html_output .= '<form id="db_search_form"' . ' class="ajax"' . ' method="post" action="db_search.php" name="db_search">';
     $html_output .= PMA_URL_getHiddenInputs($GLOBALS['db']);
     $html_output .= '<fieldset>';
     // set legend caption
     $html_output .= '<legend>' . __('Search in database') . '</legend>';
     $html_output .= '<table class="formlayout">';
     // inputbox for search phrase
     $html_output .= '<tr>';
     $html_output .= '<td>' . __('Words or values to search for (wildcard: "%"):') . '</td>';
     $html_output .= '<td><input type="text"' . ' name="criteriaSearchString" size="60"' . ' value="' . htmlspecialchars($this->_criteriaSearchString) . '" />';
     $html_output .= '</td>';
     $html_output .= '</tr>';
     // choices for types of search
     $html_output .= '<tr>';
     $html_output .= '<td class="right vtop">' . __('Find:') . '</td>';
     $html_output .= '<td>';
     $choices = array('1' => __('at least one of the words') . PMA_Util::showHint(__('Words are separated by a space character (" ").')), '2' => __('all words') . PMA_Util::showHint(__('Words are separated by a space character (" ").')), '3' => __('the exact phrase'), '4' => __('as regular expression') . ' ' . PMA_Util::showMySQLDocu('Regexp'));
     // 4th parameter set to true to add line breaks
     // 5th parameter set to false to avoid htmlspecialchars() escaping
     // in the label since we have some HTML in some labels
     $html_output .= PMA_Util::getRadioFields('criteriaSearchType', $choices, $this->_criteriaSearchType, true, false);
     $html_output .= '</td></tr>';
     // displays table names as select options
     $html_output .= '<tr>';
     $html_output .= '<td class="right vtop">' . __('Inside tables:') . '</td>';
     $html_output .= '<td rowspan="2">';
     $html_output .= '<select name="criteriaTables[]" size="6"' . ' multiple="multiple">';
     foreach ($this->_tables_names_only as $each_table) {
         if (in_array($each_table, $this->_criteriaTables)) {
             $is_selected = ' selected="selected"';
         } else {
             $is_selected = '';
         }
         $html_output .= '<option value="' . htmlspecialchars($each_table) . '"' . $is_selected . '>' . str_replace(' ', '&nbsp;', htmlspecialchars($each_table)) . '</option>';
     }
     // end for
     $html_output .= '</select>';
     $html_output .= '</td></tr>';
     // Displays 'select all' and 'unselect all' links
     $alter_select = '<a href="#" ' . 'onclick="setSelectOptions(\'db_search\',' . ' \'criteriaTables[]\', true); return false;">' . __('Select All') . '</a> &nbsp;/&nbsp;';
     $alter_select .= '<a href="#" ' . 'onclick="setSelectOptions(\'db_search\',' . ' \'criteriaTables[]\', false); return false;">' . __('Unselect All') . '</a>';
     $html_output .= '<tr><td class="right vbottom">' . $alter_select . '</td></tr>';
     // Inputbox for column name entry
     $html_output .= '<tr>';
     $html_output .= '<td class="right">' . __('Inside column:') . '</td>';
     $html_output .= '<td><input type="text" name="criteriaColumnName" size="60"' . 'value="' . (!empty($this->_criteriaColumnName) ? htmlspecialchars($this->_criteriaColumnName) : '') . '" /></td>';
     $html_output .= '</tr>';
     $html_output .= '</table>';
     $html_output .= '</fieldset>';
     $html_output .= '<fieldset class="tblFooters">';
     $html_output .= '<input type="submit" name="submit_search" value="' . __('Go') . '" id="buttonGo" />';
     $html_output .= '</fieldset>';
     $html_output .= '</form>';
     $html_output .= '<div id="togglesearchformdiv">' . '<a id="togglesearchformlink"></a></div>';
     return $html_output;
 }
开发者ID:FilipeRamosFernandes,项目名称:phpmyadmin,代码行数:64,代码来源:DbSearch.class.php

示例7: PMA_getHtmlForProfilingChart

/**
 * Get the HTML for the profiling table and accompanying chart if profiling is set.
 * Otherwise returns null
 *
 * @param string $url_query         url query
 * @param string $db                current database
 * @param array  $profiling_results array containing the profiling info
 *
 * @return string $profiling_table html for the profiling table and chart
 */
function PMA_getHtmlForProfilingChart($url_query, $db, $profiling_results)
{
    if (isset($profiling_results)) {
        $pma_token = $_SESSION[' PMA_token '];
        $url_query = isset($url_query) ? $url_query : PMA_URL_getCommon(array('db' => $db));
        $profiling_table = '';
        $profiling_table .= '<fieldset><legend>' . __('Profiling') . '</legend>' . "\n";
        $profiling_table .= '<div style="float: left;">';
        $profiling_table .= '<h3>' . __('Detailed profile') . '</h3>';
        $profiling_table .= '<table id="profiletable"><thead>' . "\n";
        $profiling_table .= ' <tr>' . "\n";
        $profiling_table .= '  <th>' . __('Order') . '<div class="sorticon"></div></th>' . "\n";
        $profiling_table .= '  <th>' . __('State') . PMA_Util::showMySQLDocu('general-thread-states') . '<div class="sorticon"></div></th>' . "\n";
        $profiling_table .= '  <th>' . __('Time') . '<div class="sorticon"></div></th>' . "\n";
        $profiling_table .= ' </tr></thead><tbody>' . "\n";
        list($detailed_table, $chart_json, $profiling_stats) = PMA_analyzeAndGetTableHtmlForProfilingResults($profiling_results);
        $profiling_table .= $detailed_table;
        $profiling_table .= '</tbody></table>' . "\n";
        $profiling_table .= '</div>';
        $profiling_table .= '<div style="float: left; margin-left:10px;">';
        $profiling_table .= '<h3>' . __('Summary by state') . '</h3>';
        $profiling_table .= '<table id="profilesummarytable"><thead>' . "\n";
        $profiling_table .= ' <tr>' . "\n";
        $profiling_table .= '  <th>' . __('State') . PMA_Util::showMySQLDocu('general-thread-states') . '<div class="sorticon"></div></th>' . "\n";
        $profiling_table .= '  <th>' . __('Total Time') . '<div class="sorticon"></div></th>' . "\n";
        $profiling_table .= '  <th>' . __('% Time') . '<div class="sorticon"></div></th>' . "\n";
        $profiling_table .= '  <th>' . __('Calls') . '<div class="sorticon"></div></th>' . "\n";
        $profiling_table .= '  <th>' . __('ø Time') . '<div class="sorticon"></div></th>' . "\n";
        $profiling_table .= ' </tr></thead><tbody>' . "\n";
        $profiling_table .= PMA_getTableHtmlForProfilingSummaryByState($profiling_stats);
        $profiling_table .= '</tbody></table>' . "\n";
        $profiling_table .= <<<EOT
<script type="text/javascript">
    pma_token = '{$pma_token}';
    url_query = '{$url_query}';
</script>
EOT;
        $profiling_table .= "</div>";
        $profiling_table .= "<div class='clearfloat'></div>";
        //require_once 'libraries/chart.lib.php';
        $profiling_table .= '<div id="profilingChartData" style="display:none;">';
        $profiling_table .= json_encode($chart_json);
        $profiling_table .= '</div>';
        $profiling_table .= '<div id="profilingchart" style="display:none;">';
        $profiling_table .= '</div>';
        $profiling_table .= '<script type="text/javascript">';
        $profiling_table .= "AJAX.registerOnload('sql.js', function () {";
        $profiling_table .= 'makeProfilingChart();';
        $profiling_table .= 'initProfilingTables();';
        $profiling_table .= '});';
        $profiling_table .= '</script>';
        $profiling_table .= '</fieldset>' . "\n";
    } else {
        $profiling_table = null;
    }
    return $profiling_table;
}
开发者ID:harryboulderdash,项目名称:PlayGFC,代码行数:67,代码来源:sql.lib.php

示例8: PMA_getHtmlForClientSideDataAndLinks

/**
 * Define some data and links needed on the client side
 *
 * @param PMA_ServerStatusData $ServerStatusData Server status data
 *
 * @return string
 */
function PMA_getHtmlForClientSideDataAndLinks($ServerStatusData)
{
    /**
     * Define some data needed on the client side
     */
    $input = '<input type="hidden" name="%s" value="%s" />';
    $form = '<form id="js_data" class="hide">';
    $form .= sprintf($input, 'server_time', microtime(true) * 1000);
    $form .= sprintf($input, 'server_os', PHP_OS);
    $form .= sprintf($input, 'is_superuser', $GLOBALS['dbi']->isSuperuser());
    $form .= sprintf($input, 'server_db_isLocal', $ServerStatusData->db_isLocal);
    $form .= '</form>';
    /**
     * Define some links used on client side
     */
    $links = '<div id="profiling_docu" class="hide">';
    $links .= PMA_Util::showMySQLDocu('general-thread-states');
    $links .= '</div>';
    $links .= '<div id="explain_docu" class="hide">';
    $links .= PMA_Util::showMySQLDocu('explain-output');
    $links .= '</div>';
    return $form . $links;
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:30,代码来源:server_status_monitor.lib.php

示例9: PMA_getHtmlForUserOverview

/**
 * Get HTML snippet for display user overview page
 *
 * @param string $pmaThemeImage a image source link
 * @param string $text_dir      text directory
 *
 * @return string $html_output
 */
function PMA_getHtmlForUserOverview($pmaThemeImage, $text_dir)
{
    $html_output = '<h2>' . "\n" . PMA_Util::getIcon('b_usrlist.png') . __('User accounts overview') . "\n" . '</h2>' . "\n";
    $password_column = 'Password';
    if (PMA_Util::getServerType() == 'MySQL' && PMA_MYSQL_INT_VERSION >= 50706) {
        $password_column = 'authentication_string';
    }
    // $sql_query is for the initial-filtered,
    // $sql_query_all is for counting the total no. of users
    $sql_query = $sql_query_all = 'SELECT *,' . " IF(`" . $password_column . "` = _latin1 '', 'N', 'Y') AS 'Password'" . ' FROM `mysql`.`user`';
    $sql_query .= isset($_REQUEST['initial']) ? PMA_rangeOfUsers($_REQUEST['initial']) : '';
    $sql_query .= ' ORDER BY `User` ASC, `Host` ASC;';
    $sql_query_all .= ' ;';
    $res = $GLOBALS['dbi']->tryQuery($sql_query, null, PMA_DatabaseInterface::QUERY_STORE);
    $res_all = $GLOBALS['dbi']->tryQuery($sql_query_all, null, PMA_DatabaseInterface::QUERY_STORE);
    if (!$res) {
        // the query failed! This may have two reasons:
        // - the user does not have enough privileges
        // - the privilege tables use a structure of an earlier version.
        // so let's try a more simple query
        $GLOBALS['dbi']->freeResult($res);
        $GLOBALS['dbi']->freeResult($res_all);
        $sql_query = 'SELECT * FROM `mysql`.`user`';
        $res = $GLOBALS['dbi']->tryQuery($sql_query, null, PMA_DatabaseInterface::QUERY_STORE);
        if (!$res) {
            $html_output .= PMA_getHtmlForViewUsersError();
            $html_output .= PMA_getAddUserHtmlFieldset();
        } else {
            // This message is hardcoded because I will replace it by
            // a automatic repair feature soon.
            $raw = 'Your privilege table structure seems to be older than' . ' this MySQL version!<br />' . 'Please run the <code>mysql_upgrade</code> command' . '(<code>mysql_fix_privilege_tables</code> on older systems)' . ' that should be included in your MySQL server distribution' . ' to solve this problem!';
            $html_output .= PMA_Message::rawError($raw)->getDisplay();
        }
        $GLOBALS['dbi']->freeResult($res);
    } else {
        $db_rights = PMA_getDbRightsForUserOverview();
        // for all initials, even non A-Z
        $array_initials = array();
        foreach ($db_rights as $right) {
            foreach ($right as $account) {
                if (empty($account['User']) && $account['Host'] == 'localhost') {
                    $html_output .= PMA_Message::notice(__('A user account allowing any user from localhost to ' . 'connect is present. This will prevent other users ' . 'from connecting if the host part of their account ' . 'allows a connection from any (%) host.') . PMA_Util::showMySQLDocu('problems-connecting'))->getDisplay();
                    break 2;
                }
            }
        }
        /**
         * Displays the initials
         * Also not necessary if there is less than 20 privileges
         */
        if ($GLOBALS['dbi']->numRows($res_all) > 20) {
            $html_output .= PMA_getHtmlForInitials($array_initials);
        }
        /**
         * Display the user overview
         * (if less than 50 users, display them immediately)
         */
        if (isset($_REQUEST['initial']) || isset($_REQUEST['showall']) || $GLOBALS['dbi']->numRows($res) < 50) {
            $html_output .= PMA_getUsersOverview($res, $db_rights, $pmaThemeImage, $text_dir);
        } else {
            $html_output .= PMA_getAddUserHtmlFieldset();
        }
        // end if (display overview)
        if (!$GLOBALS['is_ajax_request'] || !empty($_REQUEST['ajax_page_request'])) {
            if (isset($GLOBALS['flush_priv']) && $GLOBALS['flush_priv']) {
                $flushnote = new PMA_Message(__('Note: phpMyAdmin gets the users\' privileges directly ' . 'from MySQL\'s privilege tables. The content of these ' . 'tables may differ from the privileges the server uses, ' . 'if they have been changed manually. In this case, ' . 'you should %sreload the privileges%s before you continue.'), PMA_Message::NOTICE);
                $flushLink = '<a href="server_privileges.php' . PMA_URL_getCommon(array('flush_privileges' => 1)) . '" id="reload_privileges_anchor">';
                $flushnote->addParam($flushLink, false);
                $flushnote->addParam('</a>', false);
            } else {
                $flushnote = new PMA_Message(__('Note: phpMyAdmin gets the users\' privileges directly ' . 'from MySQL\'s privilege tables. The content of these ' . 'tables may differ from the privileges the server uses, ' . 'if they have been changed manually. In this case, ' . 'the privileges have to be reloaded but currently, you ' . 'don\'t have the RELOAD privilege.') . PMA_Util::showMySQLDocu('privileges-provided', false, 'priv_reload'), PMA_Message::NOTICE);
            }
            $html_output .= $flushnote->getDisplay();
        }
    }
    return $html_output;
}
开发者ID:joshuawatson,项目名称:phpmyadmin,代码行数:85,代码来源:server_privileges.lib.php

示例10: testPMAGetHtmlForSqlQueryFormInsert

 /**
  * Test for PMA_getHtmlForSqlQueryFormInsert
  *
  * @return void
  */
 public function testPMAGetHtmlForSqlQueryFormInsert()
 {
     //Call the test function
     $query = "select * from PMA";
     $html = PMA_getHtmlForSqlQueryFormInsert($query);
     //validate 1: query
     $this->assertContains(htmlspecialchars($query), $html);
     //validate 2: enable auto select text in textarea
     $auto_sel = ' onclick="selectContent(this, sql_box_locked, true);"';
     $this->assertContains($auto_sel, $html);
     //validate 3: showMySQLDocu
     $this->assertContains(PMA_Util::showMySQLDocu('SELECT'), $html);
     //validate 4: $fields_list
     $this->assertContains('<input type="button" value="DELETE" id="delete"', $html);
     $this->assertContains('<input type="button" value="UPDATE" id="update"', $html);
     $this->assertContains('<input type="button" value="INSERT" id="insert"', $html);
     $this->assertContains('<input type="button" value="SELECT" id="select"', $html);
     $this->assertContains('<input type="button" value="SELECT *" id="selectall"', $html);
     //validate 5: Clear button
     $this->assertContains('<input type="button" value="DELETE" id="delete"', $html);
     $this->assertContains(__('Clear'), $html);
 }
开发者ID:xtreme-jamil-shamy,项目名称:phpmyadmin-cf,代码行数:27,代码来源:PMA_sql_query_form_test.php

示例11: PMA_RTE_getList

/**
 * Creates a list of items containing the relevant
 * information and some action links.
 *
 * @param string $type  One of ['routine'|'trigger'|'event']
 * @param array  $items An array of items
 *
 * @return string HTML code of the list of items
 */
function PMA_RTE_getList($type, $items)
{
    global $table;
    /**
     * Conditional classes switch the list on or off
     */
    $class1 = 'hide';
    $class2 = '';
    if (!$items) {
        $class1 = '';
        $class2 = ' hide';
    }
    /**
     * Generate output
     */
    $retval = "<!-- LIST OF " . PMA_RTE_getWord('docu') . " START -->\n";
    $retval .= "<fieldset>\n";
    $retval .= "    <legend>\n";
    $retval .= "        " . PMA_RTE_getWord('title') . "\n";
    $retval .= "        " . PMA_Util::showMySQLDocu(PMA_RTE_getWord('docu')) . "\n";
    $retval .= "    </legend>\n";
    $retval .= "    <div class='{$class1}' id='nothing2display'>\n";
    $retval .= "      " . PMA_RTE_getWord('nothing') . "\n";
    $retval .= "    </div>\n";
    $retval .= "    <table class='data{$class2}'>\n";
    $retval .= "        <!-- TABLE HEADERS -->\n";
    $retval .= "        <tr>\n";
    // th cells with a colspan need corresponding td cells, according to W3C
    switch ($type) {
        case 'routine':
            $retval .= "            <th>" . __('Name') . "</th>\n";
            $retval .= "            <th colspan='4'>" . __('Action') . "</th>\n";
            $retval .= "            <th>" . __('Type') . "</th>\n";
            $retval .= "            <th>" . __('Returns') . "</th>\n";
            $retval .= "        </tr>\n";
            $retval .= "        <tr style='display: none'>\n";
            // see comment above
            for ($i = 0; $i < 7; $i++) {
                $retval .= "            <td></td>\n";
            }
            break;
        case 'trigger':
            $retval .= "            <th>" . __('Name') . "</th>\n";
            if (empty($table)) {
                $retval .= "            <th>" . __('Table') . "</th>\n";
            }
            $retval .= "            <th colspan='3'>" . __('Action') . "</th>\n";
            $retval .= "            <th>" . __('Time') . "</th>\n";
            $retval .= "            <th>" . __('Event') . "</th>\n";
            $retval .= "        </tr>\n";
            $retval .= "        <tr style='display: none'>\n";
            // see comment above
            for ($i = 0; $i < (empty($table) ? 7 : 6); $i++) {
                $retval .= "            <td></td>\n";
            }
            break;
        case 'event':
            $retval .= "            <th>" . __('Name') . "</th>\n";
            $retval .= "            <th>" . __('Status') . "</th>\n";
            $retval .= "            <th colspan='3'>" . __('Action') . "</th>\n";
            $retval .= "            <th>" . __('Type') . "</th>\n";
            $retval .= "        </tr>\n";
            $retval .= "        <tr style='display: none'>\n";
            // see comment above
            for ($i = 0; $i < 6; $i++) {
                $retval .= "            <td></td>\n";
            }
            break;
        default:
            break;
    }
    $retval .= "        </tr>\n";
    $retval .= "        <!-- TABLE DATA -->\n";
    $count = 0;
    foreach ($items as $item) {
        $rowclass = $count % 2 == 0 ? 'odd' : 'even';
        if ($GLOBALS['is_ajax_request'] && empty($_REQUEST['ajax_page_request'])) {
            $rowclass .= ' ajaxInsert hide';
        }
        // Get each row from the correct function
        switch ($type) {
            case 'routine':
                $retval .= PMA_RTN_getRowForList($item, $rowclass);
                break;
            case 'trigger':
                $retval .= PMA_TRI_getRowForList($item, $rowclass);
                break;
            case 'event':
                $retval .= PMA_EVN_getRowForList($item, $rowclass);
                break;
            default:
//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:101,代码来源:rte_list.lib.php

示例12: _links

 /**
  * Creates the code for displaying the links
  * at the top of the navigation panel
  *
  * @return string HTML code for the links
  */
 private function _links()
 {
     // always iconic
     $showIcon = true;
     $showText = false;
     $retval = '<!-- LINKS START -->';
     $retval .= '<div id="navipanellinks">';
     $retval .= $this->_getLink('index.php?' . PMA_URL_getCommon(), $showText, __('Home'), $showIcon, 'b_home.png');
     // if we have chosen server
     if ($GLOBALS['server'] != 0) {
         // Logout for advanced authentication
         if ($GLOBALS['cfg']['Server']['auth_type'] != 'config') {
             $link = 'index.php?' . $GLOBALS['url_query'];
             $link .= '&amp;old_usr=' . urlencode($GLOBALS['PHP_AUTH_USER']);
             $retval .= $this->_getLink($link, $showText, __('Log out'), $showIcon, 's_loggoff.png', '', true);
         }
         $link = 'querywindow.php?';
         $link .= PMA_URL_getCommon($GLOBALS['db'], $GLOBALS['table']);
         $link .= '&amp;no_js=true';
         $retval .= $this->_getLink($link, $showText, __('Query window'), $showIcon, 'b_selboard.png', 'pma_open_querywindow', true);
     }
     $retval .= $this->_getLink(PMA_Util::getDocuLink('index'), $showText, __('phpMyAdmin documentation'), $showIcon, 'b_docs.png', '', false, 'documentation');
     if ($showIcon) {
         $retval .= PMA_Util::showMySQLDocu('', true);
     }
     if ($showText) {
         // PMA_showMySQLDocu always spits out an icon,
         // we just replace it with some perl regexp.
         $link = preg_replace('/<img[^>]+>/i', __('Documentation'), PMA_Util::showMySQLDocu('', true));
         $retval .= $link;
         $retval .= '<br />';
     }
     $retval .= $this->_getLink('#', $showText, __('Reload navigation panel'), $showIcon, 's_reload.png', 'pma_navigation_reload');
     $retval .= '</div>';
     $retval .= '<!-- LINKS ENDS -->';
     return $retval;
 }
开发者ID:skduncan,项目名称:pizza-order,代码行数:43,代码来源:NavigationHeader.class.php

示例13: PMA_pluginGetOneOption


//.........这里部分代码省略.........
                // for subgroups
                // each subgroup can have a header, which may also be a form element
                $subgroup_header = $propertyItem->getSubgroupHeader();
                if (isset($subgroup_header)) {
                    $ret .= PMA_pluginGetOneOption($section, $plugin_name, $subgroup_header);
                }
                $ret .= '<li class="subgroup"><ul';
                if (isset($subgroup_header)) {
                    $ret .= ' id="ul_' . $subgroup_header->getName() . '">';
                } else {
                    $ret .= '>';
                }
                $ret .= PMA_pluginGetOneOption($section, $plugin_name, $propertyItem, true);
            } else {
                // single property item
                switch ($property_class) {
                    case "BoolPropertyItem":
                        $ret .= '<li>' . "\n";
                        $ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' value="something" id="checkbox_' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $propertyItem->getName());
                        if ($propertyItem->getForce() != null) {
                            // Same code is also few lines lower, update both if needed
                            $ret .= ' onclick="if (!this.checked &amp;&amp; ' . '(!document.getElementById(\'checkbox_' . $plugin_name . '_' . $propertyItem->getForce() . '\') ' . '|| !document.getElementById(\'checkbox_' . $plugin_name . '_' . $propertyItem->getForce() . '\').checked)) ' . 'return false; else return true;"';
                        }
                        $ret .= ' />';
                        $ret .= '<label for="checkbox_' . $plugin_name . '_' . $propertyItem->getName() . '">' . PMA_getString($propertyItem->getText()) . '</label>';
                        break;
                    case "DocPropertyItem":
                        echo "DocPropertyItem";
                        break;
                    case "HiddenPropertyItem":
                        $ret .= '<li><input type="hidden" name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName()) . '"' . ' /></li>';
                        break;
                    case "MessageOnlyPropertyItem":
                        $ret .= '<li>' . "\n";
                        $ret .= '<p>' . PMA_getString($propertyItem->getText()) . '</p>';
                        break;
                    case "RadioPropertyItem":
                        $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName());
                        foreach ($propertyItem->getValues() as $key => $val) {
                            $ret .= '<li><input type="radio" name="' . $plugin_name . '_' . $propertyItem->getName() . '" value="' . $key . '" id="radio_' . $plugin_name . '_' . $propertyItem->getName() . '_' . $key . '"';
                            if ($key == $default) {
                                $ret .= ' checked="checked"';
                            }
                            $ret .= ' />' . '<label for="radio_' . $plugin_name . '_' . $propertyItem->getName() . '_' . $key . '">' . PMA_getString($val) . '</label></li>';
                        }
                        break;
                    case "SelectPropertyItem":
                        $ret .= '<li>' . "\n";
                        $ret .= '<label for="select_' . $plugin_name . '_' . $propertyItem->getName() . '" class="desc">' . PMA_getString($propertyItem->getText()) . '</label>';
                        $ret .= '<select name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' id="select_' . $plugin_name . '_' . $propertyItem->getName() . '">';
                        $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName());
                        foreach ($propertyItem->getValues() as $key => $val) {
                            $ret .= '<option value="' . $key . '"';
                            if ($key == $default) {
                                $ret .= ' selected="selected"';
                            }
                            $ret .= '>' . PMA_getString($val) . '</option>';
                        }
                        $ret .= '</select>';
                        break;
                    case "TextPropertyItem":
                        $ret .= '<li>' . "\n";
                        $ret .= '<label for="text_' . $plugin_name . '_' . $propertyItem->getName() . '" class="desc">' . PMA_getString($propertyItem->getText()) . '</label>';
                        $ret .= '<input type="text" name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName()) . '"' . ' id="text_' . $plugin_name . '_' . $propertyItem->getName() . '"' . ($propertyItem->getSize() != null ? ' size="' . $propertyItem->getSize() . '"' : '') . ($propertyItem->getLen() != null ? ' maxlength="' . $propertyItem->getLen() . '"' : '') . ' />';
                        break;
                    default:
                }
            }
        }
    }
    if ($is_subgroup) {
        // end subgroup
        $ret .= '</ul></li>';
    } else {
        // end main group
        if (!empty($not_subgroup_header)) {
            $ret .= '</ul></div>';
        }
    }
    if (method_exists($propertyGroup, "getDoc")) {
        $doc = $propertyGroup->getDoc();
        if ($doc != null) {
            if (count($doc) == 3) {
                $ret .= PMA_Util::showMySQLDocu($doc[0], $doc[1], false, $doc[2]);
            } elseif (count($doc) == 1) {
                $ret .= PMA_Util::showDocu('faq', $doc[0]);
            } else {
                $ret .= PMA_Util::showMySQLDocu($doc[0], $doc[1]);
            }
        }
    }
    // Close the list element after $doc link is displayed
    if (isset($property_class)) {
        if ($property_class == 'BoolPropertyItem' || $property_class == 'MessageOnlyPropertyItem' || $property_class == 'SelectPropertyItem' || $property_class == 'TextPropertyItem') {
            $ret .= '</li>';
        }
    }
    $ret .= "\n";
    return $ret;
}
开发者ID:dram1008,项目名称:gleb,代码行数:101,代码来源:plugin_interface.lib.php

示例14: PMA_getHtmlForServerVariablesItems

/**
 * Prints Html for Server Variables Items
 *
 * @param Array $variable_doc_links documentation links
 * @param Array $serverVars         global variables
 * @param Array $serverVarsSession  session variables
 *
 * @return string
 */
function PMA_getHtmlForServerVariablesItems($variable_doc_links, $serverVars, $serverVarsSession)
{
    // list of static system variables
    $static_variables = PMA_getStaticSystemVariables();
    $output = '<tbody>';
    $odd_row = true;
    foreach ($serverVars as $name => $value) {
        $has_session_value = isset($serverVarsSession[$name]) && $serverVarsSession[$name] != $value;
        $row_class = ($odd_row ? ' odd' : ' even') . ($has_session_value ? ' diffSession' : '');
        $output .= '<tr class="var-row' . $row_class . '">';
        $output .= '<td class="var-action">';
        // Edit Link active only for Dynamic System variables
        if (!in_array(strtolower($name), $static_variables)) {
            $output .= '<a href="#" class="editLink">' . PMA_Util::getIcon('b_edit.png', __('Edit')) . '</a>';
        } else {
            $output .= '<span title="' . __('This is a read-only variable and can not be edited') . '" class="read_only_var" >' . PMA_Util::getIcon('bd_edit.png', __('Edit')) . '</span>';
        }
        $output .= '</td>';
        $output .= '<td class="var-name">';
        // To display variable documentation link
        if (isset($variable_doc_links[$name])) {
            $output .= '<span title="' . htmlspecialchars(str_replace('_', ' ', $name)) . '">';
            $output .= PMA_Util::showMySQLDocu($variable_doc_links[$name][1], false, $variable_doc_links[$name][2] . '_' . $variable_doc_links[$name][0], true);
            $output .= htmlspecialchars(str_replace('_', ' ', $name));
            $output .= '</a>';
            $output .= '</span>';
        } else {
            $output .= htmlspecialchars(str_replace('_', ' ', $name));
        }
        $output .= '</td>';
        $output .= '<td class="var-value value' . ($GLOBALS['dbi']->isSuperuser() ? ' editable' : '') . '">&nbsp;' . PMA_formatVariable($name, $value, $variable_doc_links) . '</td>' . '</tr>';
        if ($has_session_value) {
            $output .= '<tr class="var-row' . ($odd_row ? ' odd' : ' even') . '">' . '<td class="var-action"></td>' . '<td class="var-name session">(' . __('Session value') . ')</td>' . '<td class="var-value value">&nbsp;' . PMA_formatVariable($name, $serverVarsSession[$name], $variable_doc_links) . '</td>' . '</tr>';
        }
        $odd_row = !$odd_row;
    }
    $output .= '</tbody>';
    return $output;
}
开发者ID:FuhrerMalkovich,项目名称:Blogpost,代码行数:48,代码来源:server_variables.lib.php

示例15: PMA_pluginGetOneOption

/**
 * Returns single option in a list element
 *
 * @param string  $section        name of config section in
 *                               $GLOBALS['cfg'][$section] for plugin
 * @param string  $plugin_name    unique plugin name
 * @param array   &$propertyGroup options property main group instance
 * @param boolean $is_subgroup    if this group is a subgroup
 *
 * @return string  table row with option
 */
function PMA_pluginGetOneOption($section, $plugin_name, &$propertyGroup, $is_subgroup = false)
{
    $ret = "\n";
    if (!$is_subgroup) {
        // for subgroup headers
        if (mb_strpos(get_class($propertyGroup), "PropertyItem")) {
            $properties = array($propertyGroup);
        } else {
            // for main groups
            $ret .= '<div class="export_sub_options" id="' . $plugin_name . '_' . $propertyGroup->getName() . '">';
            if (method_exists($propertyGroup, 'getText')) {
                $text = $propertyGroup->getText();
            }
            if ($text != null) {
                $ret .= '<h4>' . PMA_getString($text) . '</h4>';
            }
            $ret .= '<ul>';
        }
    }
    if (!isset($properties)) {
        $not_subgroup_header = true;
        if (method_exists($propertyGroup, 'getProperties')) {
            $properties = $propertyGroup->getProperties();
        }
    }
    if (isset($properties)) {
        /** @var OptionsPropertySubgroup $propertyItem */
        foreach ($properties as $propertyItem) {
            $property_class = get_class($propertyItem);
            // if the property is a subgroup, we deal with it recursively
            if (mb_strpos($property_class, "Subgroup")) {
                // for subgroups
                // each subgroup can have a header, which may also be a form element
                /** @var OptionsPropertyItem $subgroup_header */
                $subgroup_header = $propertyItem->getSubgroupHeader();
                if (isset($subgroup_header)) {
                    $ret .= PMA_pluginGetOneOption($section, $plugin_name, $subgroup_header);
                }
                $ret .= '<li class="subgroup"><ul';
                if (isset($subgroup_header)) {
                    $ret .= ' id="ul_' . $subgroup_header->getName() . '">';
                } else {
                    $ret .= '>';
                }
                $ret .= PMA_pluginGetOneOption($section, $plugin_name, $propertyItem, true);
                continue;
            }
            // single property item
            $ret .= PMA_getHtmlForProperty($section, $plugin_name, $propertyItem);
        }
    }
    if ($is_subgroup) {
        // end subgroup
        $ret .= '</ul></li>';
    } else {
        // end main group
        if (!empty($not_subgroup_header)) {
            $ret .= '</ul></div>';
        }
    }
    if (method_exists($propertyGroup, "getDoc")) {
        $doc = $propertyGroup->getDoc();
        if ($doc != null) {
            if (count($doc) == 3) {
                $ret .= PMA_Util::showMySQLDocu($doc[1], false, $doc[2]);
            } elseif (count($doc) == 1) {
                $ret .= PMA_Util::showDocu('faq', $doc[0]);
            } else {
                $ret .= PMA_Util::showMySQLDocu($doc[1]);
            }
        }
    }
    // Close the list element after $doc link is displayed
    if (isset($property_class)) {
        if ($property_class == 'BoolPropertyItem' || $property_class == 'MessageOnlyPropertyItem' || $property_class == 'SelectPropertyItem' || $property_class == 'TextPropertyItem') {
            $ret .= '</li>';
        }
    }
    $ret .= "\n";
    return $ret;
}
开发者ID:TheBlackBloodyUnicorn,项目名称:pico_wanderblog,代码行数:92,代码来源:plugin_interface.lib.php


注:本文中的PMA_Util::showMySQLDocu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。