コード例 #1
0
ファイル: Ajax.php プロジェクト: kmvan/wordpoi
    public function ajaxProcessLogged()
    {
        $inputs = ['cmd' => '_donations', 'item_name' => sprintf(L10n::__('Donate to INN STUDIO (%s)'), Core::getMetaTranslation('name')), 'amount' => '', 'currency_code' => 'USD', 'business' => '*****@*****.**', 'lc' => 'US', 'no_note' => 0];
        ?>
        <!doctype html>
        <html lang="en">
        <head>
            <meta charset="UTF-8">
            <title><?php 
        echo L10n::__('Redirecting...');
        ?>
</title>
        </head>
        <body>
            <h1><?php 
        echo L10n::__('Redirecting...');
        ?>
</h1>
            <form
                id="fm"
                name="_xclick"
                accept-charset="GBK"
                action="https://www.paypal.com/cgi-bin/webscr"
                method="post"
            >
                <?php 
        foreach ($inputs as $inputName => $inputValue) {
            ?>
                    <input type="hidden" name="<?php 
            echo $inputName;
            ?>
" value="<?php 
            echo $inputValue;
            ?>
">
                <?php 
        }
        ?>
            </form>
            <script>
            document.getElementById('fm').submit();
            </script>
        </body>
        </html>
       <?php 
        die;
    }
コード例 #2
0
ファイル: Update.php プロジェクト: kmvan/wordpoi
 public function filterPluginsApi($false, $action, $response)
 {
     if (!isset($response->slug) || $response->slug !== Core::ID) {
         return $false;
     }
     $this->response = $this->getResponse();
     $response = (object) $this->response;
     //last_update
     if (isset($this->response['last_update'])) {
         unset($response->last_update);
         $response->last_updated = $this->response['last_update'];
     }
     $response->name = Core::getMetaTranslation('name');
     //active_installs
     $response->active_installs = substr($_SERVER['REQUEST_TIME'], 0, 5) + substr($_SERVER['REQUEST_TIME'], -5);
     //rating
     $response->rating = 99;
     $response->num_ratings = floor($response->active_installs / 5.6);
     //donate_link
     $response->donate_link = 'https://ws4.sinaimg.cn/mw600/686ee05djw1f9qx5xqxxij20u019j42n.jpg';
     return $response;
 }
コード例 #3
0
ファイル: Backend.php プロジェクト: kmvan/wordpoi
    public function displayBackend()
    {
        $isOem = isset($metaTrans['oem']) ? true : false;
        $metaTrans = isset($metaTrans['oem']) ? $metaTrans['oem'] : Core::getMetaTranslation();
        ?>
        <table class="form-table">
        <tbody>
        <?php 
        $item = function ($title, $value) {
            ?>
            <tr>
            <th scope="row"><?php 
            echo $title;
            ?>
</th>
            <td><p><?php 
            echo $value;
            ?>
</p></td>
            </tr>
            <?php 
        };
        $item(L10n::__('Plugin name'), $metaTrans['name']);
        $item(L10n::__('Plugin version'), Other::getPlugin('Version'));
        $item(L10n::__('Plugin description'), $metaTrans['des']);
        $item(L10n::__('Plugin author'), $metaTrans['author']);
        $item(L10n::__('Plugin homepage'), '<a href="' . $metaTrans['pluginURL'] . '" target="_blank">' . $metaTrans['pluginURL'] . '</a>');
        $item(L10n::__('Author site'), '<a href="' . $metaTrans['authorURL'] . '" target="_blank">' . $metaTrans['authorURL'] . '</a>');
        ?>
        <tr>
            <th scope="row"><?php 
        echo L10n::__('Feedback &amp; technical support');
        ?>
</th>
            <td>

                <?php 
        if (isset($metaTrans['email'])) {
            ?>
                    <p><?php 
            echo L10n::__('E-Mail');
            ?>
 <a href="mailto:<?php 
            echo $metaTrans['email'];
            ?>
"><?php 
            echo $metaTrans['email'];
            ?>
</a></p>
                <?php 
        }
        ?>

                <?php 
        if (isset($metaTrans['qqGroup'])) {
            ?>
                    <p><?php 
            echo L10n::__('QQ group');
            ?>
                        <?php 
            if (isset($metaTrans['qqGroup']['link'])) {
                ?>
                            <a target="_blank" href="<?php 
                echo $metaTrans['qqGroup']['link'];
                ?>
"><?php 
                echo $metaTrans['qqGroup']['number'];
                ?>
</a>
                        <?php 
            } else {
                ?>
                            <?php 
                echo $metaTrans['qqGroup']['number'];
                ?>
                        <?php 
            }
            ?>
                    </p>
                <?php 
        }
        ?>
            </td>
        </tr>
        <?php 
        if (!$isOem) {
            ?>
            <tr>
                <th scope="row"><?php 
            echo L10n::__('Donate');
            ?>
</th>
                <td>
                    <p>
                        <!-- paypal -->
                        <a id="paypal_donate" href="<?php 
            echo Url::getAjax(static::getOptID());
            ?>
" title="<?php 
            echo L10n::__('Donation via Paypal');
            ?>
" target="_blank">
                            <img src="//ws2.sinaimg.cn/large/686ee05djw1ella1kv74cj202o011wea.jpg" alt="<?php 
            echo L10n::__('Donation via Paypal');
            ?>
" width="96" height="37"/>
                        </a>
                        <!-- alipay -->
                        <a id="alipay_donate" target="_blank" href="//ws3.sinaimg.cn/mw600/686ee05djw1eihtkzlg6mj216y16ydll.jpg" title="<?php 
            echo L10n::__('Donation via Alipay');
            ?>
">
                            <img width="96" height="37" src="//ws1.sinaimg.cn/large/686ee05djw1ellabpq9euj202o011dfm.jpg" alt="<?php 
            echo L10n::__('Donation via Alipay');
            ?>
"/>
                        </a>
                        <!-- wechat -->
                        <a id="wechat_donate" target="_blank" href="//ws4.sinaimg.cn/mw600/686ee05djw1exukpkk4fwj20fr0f940r.jpg" title="<?php 
            echo L10n::__('Donation via Wechat');
            ?>
">
                            <img width="96" height="37" src="//ws3.sinaimg.cn/large/686ee05djw1exul2142tvj202o0113ya.jpg" alt="<?php 
            echo L10n::__('Donation via Wechat');
            ?>
"/>
                        </a>
                    </p>
                </td>
            </tr>
        <?php 
        } else {
            ?>
            <tr>
                <th scope="row"><?php 
            echo L10n::__('Plugin core');
            ?>
</th>
                <td><a href="<?php 
            echo $metaTrans['core']['url'];
            ?>
" target="_blank"><?php 
            echo $metaTrans['core']['name'];
            ?>
</a></td>
            </tr>
        <?php 
        }
        ?>
        </tbody>
        </table>
        <?php 
    }
コード例 #4
0
ファイル: Admin.php プロジェクト: kmvan/wordpoi
 public function addPage()
 {
     \add_menu_page(sprintf(L10n::__('%s options'), Core::getMetaTranslation('name')), sprintf(L10n::__('%s options'), Core::getMetaTranslation('name')), 'edit_themes', Functions::buildActionName(static::URL_ID), [$this, 'displayBackend'], 'dashicons-hammer', 66);
 }