Example #1
0
 protected function getConf()
 {
     $conf = ['ID' => Core::ID, 'ajaxURL' => Url::getAjax(), 'lang' => ['loading' => L10n::__('Loading, please wait...'), 'error' => L10n::__('Sorry, server is busy now, can not respond your request, please try again later.'), 'close' => L10n::__('Close'), 'ok' => L10n::__('OK')]];
     if (Condition::isAdmin()) {
         $conf['_nonce'] = Security::createNonce();
     }
     return \apply_filters(Functions::buildActionName('dynamicConf'), $conf);
 }
Example #2
0
 public function ajaxProcessLogged()
 {
     Security::checkNonce();
     Security::checkReferer();
     switch (filter_input(INPUT_GET, 'type', FILTER_SANITIZE_STRING)) {
         case 'searchUsers':
             $this->ajaxSearchUsers();
             break;
         case 'getUser':
             $this->ajaxGetUser();
             break;
     }
 }
Example #3
0
    public function displayBackend()
    {
        ?>
        <div class="wrap <?php 
        echo Core::ID;
        ?>
-wrap">
        <form class="backend-fm <?php 
        echo Core::ID;
        ?>
-backend-fm" method="post" action="<?php 
        echo Url::getAjax(static::getOptID(), ['_nonce' => Security::createNonce()]);
        ?>
">
        <div class="tab-nav-container <?php 
        echo Core::ID;
        ?>
-tab-nav-container"></div>

        <div class="tab-body">
            <?php 
        $settings = \apply_filters(Functions::buildActionName('backendSettings'), []);
        ksort($settings);
        foreach ($settings as $legend => $setting) {
            ?>
                <fieldset>
                    <legend class="button button-primary">
                        <i class="fa fa-fw fa-<?php 
            echo $setting['icon'];
            ?>
"></i> <?php 
            echo $setting['title'];
            ?>
                    </legend>
                    <?php 
            call_user_func($setting['content']);
            ?>
                </fieldset>
            <?php 
        }
        ?>

        </div>

        <p>
            <input type="hidden" name="_nonce" value="<?php 
        echo Security::createNonce();
        ?>
">

            <button id="submit" type="submit" class="backend-submit button button-primary"><i class="fa fa-check"></i> <span class="tx"><?php 
        echo L10n::__('Save');
        ?>
</span></button>

            <label for="options-restore" class="label-options-restore" title="<?php 
        echo L10n::__('Something error with plugin? Try to restore. Be careful, plugin options will be cleared up!');
        ?>
">
                <input id="options-restore" name="restore" type="checkbox" value="1"/>
                <?php 
        echo L10n::__('Restore to default options');
        ?>
 <i class="fa fa-question-circle"></i>
            </label>
        </p>
        </form>
        </div>
        <?php 
    }