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


PHP CF7DBPlugin::getPluginDirUrl方法代码示例

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


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

示例1: export

    public function export($formName, $options = null)
    {
        $plugin = new CF7DBPlugin();
        if (!$plugin->canUserDoRoleOption('CanSeeSubmitData')) {
            CFDBDie::wp_die(__('You do not have sufficient permissions to access this page.', 'contact-form-7-to-database-extension'));
        }
        header('Expires: 0');
        header('Cache-Control: no-store, no-cache, must-revalidate');
        $pluginUrlDir = $plugin->getPluginDirUrl();
        $scriptLink = $pluginUrlDir . 'Cf7ToDBGGoogleSS.js.php';
        $imageUrlDir = $pluginUrlDir . "help";
        $siteUrl = get_option('home');
        $search = isset($options['search']) ? $options['search'] : '';
        ob_start();
        ?>
        <style type="text/css">
            *.popup-trigger {
                position: relative;
                z-index: 0;
            }

            *.popup-trigger:hover {
                background-color: transparent;
                z-index: 50;
            }

            *.popup-content {
                position: absolute!important;
                background-color: #ffffff;
                padding: 5px;
                border: 2px gray;
                visibility: hidden!important;
                color: black;
                text-decoration: none;
                min-width:400px;
                max-width:600px;
                overflow: auto;
            }

            *.popup-trigger:hover *.popup-content {
                visibility: visible!important;
                top: 50px!important;
                left: 50px!important;
            }
        </style>
        Setting up a Google Spreadsheet to pull in data from WordPress requires these manual steps:
        <table cellspacing="15px" cellpadding="15px">
            <tbody>
            <tr>
                <td>
                    <div class="popup-trigger">
                        <a href="<?php 
        echo $imageUrlDir;
        ?>
/GoogleNewSS.png">
                            <img src="<?php 
        echo $imageUrlDir;
        ?>
/GoogleNewSS.png" alt="Create a new spreadsheet" height="100px" width="61px"/>

                            <div class="popup-content">
                                <img src="<?php 
        echo $imageUrlDir;
        ?>
/GoogleNewSS.png" alt="Create a new spreadsheet"/>
                            </div>
                        </a>
                    </div>
                </td>
                <td><p>Log into Google Docs and create a new Google Spreadsheet</p></td>
            </tr>
            <tr>
                <td>
                    <div class="popup-trigger">
                        <a href="<?php 
        echo $imageUrlDir;
        ?>
/GoogleOpenScriptEditor.png">
                            <img src="<?php 
        echo $imageUrlDir;
        ?>
/GoogleOpenScriptEditor.png" alt="Create a new spreadsheet" height="69px" width="100px"/>

                            <div class="popup-content">
                                <img src="<?php 
        echo $imageUrlDir;
        ?>
/GoogleOpenScriptEditor.png" alt="Create a new spreadsheet"/>
                            </div>
                        </a>
                    </div>
                </td>
                <td><p>Go to <b>Tools</b> menu -> <b>Scripts</b> -> <b>Script Editor...</b></p></td>
            </tr>
            <tr>
                <td>
                    <div class="popup-trigger">
                        <a href="<?php 
        echo $imageUrlDir;
        ?>
//.........这里部分代码省略.........
开发者ID:rconnelly,项目名称:vacationware,代码行数:101,代码来源:ExportToGoogleLiveData.php

示例2: export

    public function export($formName, $options = null)
    {
        $plugin = new CF7DBPlugin();
        if (!$plugin->canUserDoRoleOption('CanSeeSubmitData')) {
            CFDBDie::wp_die(__('You do not have sufficient permissions to access this page.', 'contact-form-7-to-database-extension'));
        }
        header('Expires: 0');
        header('Cache-Control: no-store, no-cache, must-revalidate');
        $pluginUrlDir = $plugin->getPluginDirUrl();
        $scriptLink = $pluginUrlDir . 'CFDBGoogleSSLiveData.php';
        $imageUrlDir = $pluginUrlDir . "help";
        $siteUrl = get_option('home');
        $userName = is_user_logged_in() ? wp_get_current_user()->user_login : 'user';
        ob_start();
        ?>
        <style type="text/css">
            *.popup-trigger {
                position: relative;
                z-index: 0;
            }

            *.popup-trigger:hover {
                background-color: transparent;
                z-index: 50;
            }

            *.popup-content {
                position: absolute!important;
                background-color: #ffffff;
                padding: 5px;
                border: 2px gray;
                visibility: hidden!important;
                color: black;
                text-decoration: none;
                min-width:400px;
                max-width:600px;
                overflow: auto;
            }

            *.popup-trigger:hover *.popup-content {
                visibility: visible!important;
                top: 50px!important;
                left: 50px!important;
            }
        </style>
        <?php 
        _e('Setting up a Google Spreadsheet to pull in data from WordPress requires these manual steps:', 'contact-form-7-to-database-extension');
        ?>
        <table cellspacing="15px" cellpadding="15px">
            <tbody>
            <tr>
                <td>
                    <div class="popup-trigger">
                        <a href="<?php 
        echo $imageUrlDir;
        ?>
/GoogleNewSS.png">
                            <img src="<?php 
        echo $imageUrlDir;
        ?>
/GoogleNewSS.png" alt="Create a new spreadsheet" height="100px" width="61px"/>

                            <div class="popup-content">
                                <img src="<?php 
        echo $imageUrlDir;
        ?>
/GoogleNewSS.png" alt="Create a new spreadsheet" height="75%" width="75%"/>
                            </div>
                        </a>
                    </div>
                </td>
                <td><p><?php 
        _e('Log into Google Docs and create a new Google Spreadsheet', 'contact-form-7-to-database-extension');
        ?>
</p></td>
            </tr>
            <tr>
                <td>
                    <div class="popup-trigger">
                        <a href="<?php 
        echo $imageUrlDir;
        ?>
/GoogleOpenScriptEditor.png">
                            <img src="<?php 
        echo $imageUrlDir;
        ?>
/GoogleOpenScriptEditor.png" alt="Create a new spreadsheet" height="69px" width="100px"/>

                            <div class="popup-content">
                                <img src="<?php 
        echo $imageUrlDir;
        ?>
/GoogleOpenScriptEditor.png" alt="Create a new spreadsheet" height="75%" width="75%"/>
                            </div>
                        </a>
                    </div>
                </td>
                <td><p><?php 
        _e('Go to <strong>Tools</strong> menu -> <strong>Script Editor...', 'contact-form-7-to-database-extension');
        ?>
//.........这里部分代码省略.........
开发者ID:aagivecamp,项目名称:FlintRiver,代码行数:101,代码来源:ExportToGoogleLiveData.php

示例3: display

    /**
     * @param  $plugin CF7DBPlugin
     * @return void
     */
    function display(&$plugin)
    {
        if ($plugin == null) {
            $plugin = new CF7DBPlugin();
        }
        $forms = $plugin->getForms();
        $importUrl = admin_url('admin-ajax.php') . '?action=cfdb-importcsv';
        ?>
        <h2><?php 
        _e('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 
        _e('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 
        _e('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 
        _e('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 
        _e('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>

        <h2><?php 
        _e('Backup Form to CSV File', 'contact-form-7-to-database-extension');
        ?>
</h2>
        <ul>
            <li><?php 
        _e('Backup a form into a CSV file that can be re-imported without loss of data.', 'contact-form-7-to-database-extension');
        ?>
</li>
            <li><?php 
        _e('Limitation: this will not export file uploads.', 'contact-form-7-to-database-extension');
        ?>
</li>
            <li><?php 
        _e('Limitation: extremely large numbers of records in your form may cause the export operation on your server to run out of memory, thereby not giving you all the rows.', 'contact-form-7-to-database-extension');
        ?>
</li>
        </ul>
        <form method="get" action="<?php 
        echo $plugin->getPluginDirUrl();
        ?>
export.php">
            <input type="hidden" name="enc" value="CSV"/>
            <input type="hidden" name="bak" value="true"/>
            <select name="form">
                <option value=""></option>
                <?php 
        foreach ($forms as $formName) {
            echo "<option value=\"{$formName}\">{$formName}</option>";
        }
//.........这里部分代码省略.........
开发者ID:BennyHudson,项目名称:laurenjack,代码行数:101,代码来源:CFDBViewImportCsv.php


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