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


PHP CF7DBPlugin::getAdminUrlPrefix方法代碼示例

本文整理匯總了PHP中CF7DBPlugin::getAdminUrlPrefix方法的典型用法代碼示例。如果您正苦於以下問題:PHP CF7DBPlugin::getAdminUrlPrefix方法的具體用法?PHP CF7DBPlugin::getAdminUrlPrefix怎麽用?PHP CF7DBPlugin::getAdminUrlPrefix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CF7DBPlugin的用法示例。


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

示例1: outputJavascript


//.........這裏部分代碼省略.........
                        break;
                    case '[cfdb-export-link]':
                        enc = jQuery('#enc_cntl').val();
                        scElements.push(getValue('enc', enc, scValidationErrors));
                        scUrlElements.push(getValueUrl('enc', enc));

                        if (['CSVUTF8BOM', 'CSVUTF8', 'CSVSJIS'].indexOf(enc) > -1) {
                            delim = jQuery('#export_link_csv_delim').val();
                            if (delim != ',') {
                                scElements.push(getValue('delimiter', delim, scValidationErrors));
                                scUrlElements.push(getValueUrl('delimiter', delim));
                            }
                        }

                        scElements.push(getValue('urlonly', jQuery('#urlonly_cntl').val(), scValidationErrors));
                        scElements.push(getValue('linktext', jQuery('#linktext_cntl').val(), scValidationErrors));

                        if (!jQuery('#header_cntl').is(':checked')) {
                            scElements.push('header="false"');
                            scUrlElements.push(getValueUrl('header', 'false'));
                        }
                        val = jQuery('#headers_cntl').val();
                        scElements.push(getValue('headers', val, scValidationErrors));
                        scUrlElements.push(getValueUrl('headers', val));

                        scText = join(scElements) + ']';
                        break;
                    default:
                        scText = shortcode;
                        break;
                }

                var urlBase = '<?php 
        echo $this->plugin->getAdminUrlPrefix('admin-ajax.php');
        ?>
action=cfdb-export&';

                if (shortcode) {
                    // Output short code text
                    var scUrl = urlBase + join(scUrlElements, '&');
                    jQuery('#shortcode_result_text').html('<a target="_cfdb_sc_results" href="' + scUrl + '">' + scText + '</a>');

                    // Output short code errors
                    jQuery('#shortcode_validations_text').html(scValidationErrors.join('<br/>'));
                }
                else {
                    // Don't report errors
                    jQuery('#shortcode_validations_text').html('');
                }

                // Export link or Google Spreadsheet function call
                var exportSelection = jQuery('#export_cntl').val();
                if (exportSelection) {
                    if (exportSelection != 'GLD') {
                        exportUrlElements.push(getValueUrl('enc', exportSelection));
                    }
                    if (exportSelection == 'RSS') {
                        exportUrlElements.push(getValueUrl('itemtitle', jQuery('#add_itemtitle').val()));
                    } else {
                        if (!jQuery('#header_cntl').is(':checked')) {
                            exportUrlElements.push(getValueUrl('header', 'false'));
                            pushNameValue("header", "false", googleScriptElements, googleScriptValidationErrors);
                        }
                        val = jQuery('#headers_cntl').val();
                        exportUrlElements.push(getValueUrl('headers', val, scValidationErrors));
                        pushNameValue("headers", val, googleScriptElements, googleScriptValidationErrors);
開發者ID:spielhoelle,項目名稱:amnesty,代碼行數:67,代碼來源:CFDBViewShortCodeBuilder.php

示例2: display

    /**
     * @param  $plugin CF7DBPlugin
     * @return void
     */
    function display(&$plugin)
    {
        if ($plugin == null) {
            $plugin = new CF7DBPlugin();
        }
        $forms = $plugin->getForms();
        $importUrl = $plugin->getAdminUrlPrefix('admin-ajax.php') . 'action=cfdb-importcsv';
        $renameUrl = $plugin->getAdminUrlPrefix('admin-ajax.php') . 'action=cfdb-renameform';
        $clenaupUrl = $plugin->getAdminUrlPrefix('admin-ajax.php') . 'action=cfdb-cleanup';
        ?>
        <h2><?php 
        echo htmlspecialchars(__('Import CSV File into Form', 'contact-form-7-to-database-extension'));
        ?>
</h2>
        <form enctype="multipart/form-data" action="<?php 
        echo $importUrl;
        ?>
" method="post">
            <table>
                <tbody>
                <tr>
                    <td><label for="file"><?php 
        echo htmlspecialchars(__('File', 'contact-form-7-to-database-extension'));
        ?>
</label></td>
                    <td><input type="file" name="file" id="file" size="50"></td>
                </tr>
                <tr>
                    <td><input type="radio" name="into" id="new" value="new" checked> <?php 
        echo htmlspecialchars(__('New Form', 'contact-form-7-to-database-extension'));
        ?>
</td>
                    <td><input type="text" name="newformname" id="newformname" size="50"/></td>
                </tr>
                <tr>
                    <td><input type="radio" name="into" id="existing" value="into"> <?php 
        echo htmlspecialchars(__('Existing Form', 'contact-form-7-to-database-extension'));
        ?>
</td>
                    <td>
                        <select name="form" id="form">
                            <option value=""></option>
                            <?php 
        foreach ($forms as $formName) {
            echo "<option value=\"{$formName}\">{$formName}</option>";
        }
        ?>
                        </select>
                    </td>
                </tr>
                </tbody>
            </table>
            <input type="submit" name="<?php 
        echo htmlspecialchars(__('Import', 'contact-form-7-to-database-extension'));
        ?>
" id="importsubmit" value="import">
        </form>

        <script type="text/javascript">
                jQuery('#file').change(function () {
                    var val = jQuery(this).val();
                    val = val.substring(val.lastIndexOf('/') + 1);
                    val = val.substring(val.lastIndexOf('\\') + 1);
                    val = val.replace(/\.([^\.])*$/, "");
                    jQuery('#newformname').val(val);
                });
        </script>
        <form enctype="multipart/form-data" action="<?php 
        echo $renameUrl;
        ?>
" method="post">
            <h2><?php 
        echo htmlspecialchars(__('Rename Form', 'contact-form-7-to-database-extension'));
        ?>
</h2>
            <select name="form" id="form">
                <option value=""></option>
                <?php 
        foreach ($forms as $formName) {
            echo "<option value=\"{$formName}\">{$formName}</option>";
        }
        ?>
            </select>
            <td><input type="text" name="newformname" id="renameformname" size="10"/></td>
            <input type="submit" name="rename" id="renamesubmit" value="<?php 
        echo htmlspecialchars(__('Rename', 'contact-form-7-to-database-extension'));
        ?>
">
        </form>

        <h2><?php 
        echo htmlspecialchars(__('Backup Form to CSV File', 'contact-form-7-to-database-extension'));
        ?>
</h2>
        <ul>
            <li><?php 
//.........這裏部分代碼省略.........
開發者ID:crazyyy,項目名稱:uspacetrip,代碼行數:101,代碼來源:CFDBViewImportCsv.php


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