Пример #1
0
        ym_wizard_render();
        // loop
        ym_admin_menu();
        echo '<div style="clear: both; padding: 0px; margin: 0px;">';
        ym_admin_loader();
        echo '</div>';
        ym_admin_menu_end();
        // end
        echo '</div>';
    }
} else {
    global $ym_version_resp;
    ym_check_version(true);
    // ym conf hook
    if (!isset($_POST['activate_plugin'])) {
        ym_check_for_ymconf();
    }
    $auth_key_result = false;
    // no key
    if (ym_post('activate_plugin', false) && ym_post('registration_email', false)) {
        $auth_key_result = $ym_auth->ym_authorize_key(ym_post('registration_email'));
    }
    global $ym_version_resp;
    if (!is_wp_error($auth_key_result) && ym_post('registration_email')) {
        // key ok TOS check
        ym_tos_checks();
    } else {
        echo '
<div class="wrap" id="poststuff">
	<h2>' . YM_ADMIN_NAME . '</h2>
	<div id="message" class="error ym_auth">
Пример #2
0
<?php

$conf_dir = YM_PLUGIN_DIR_PATH . 'confs';
if ($_POST) {
    if ($_POST['go_import'] == 'import') {
        if ($file = $_POST['file_to_use']) {
            ym_check_for_ymconf($conf_dir . '/' . $file);
            echo '<div id="message" class="updated"><p>' . __('Import Processed, you should check all the settings should be what they ought to be', 'ym') . '</p></div>';
        }
    }
}
echo '<div class="wrap" id="poststuff">';
echo ym_box_top(__('Import/Export Configuration', 'ym'));
echo '<p>' . __('Here you can choose to import and/or export your configuration to share with others, or reset your settings', 'ym') . '</p>';
echo '<p><strong>' . __('Before using/uploading a configuration file, you should ensure you trust it, the source, and nothing untoward will happen when the file is executed', 'ym') . '</strong></p>';
echo '<p>' . __('Configuration files need to be manually upload to the <em>conf</em> Directory within the YM plugin', 'ym') . '</p>';
echo '
<form method="post" action="">
	<input type="hidden" name="go_import" value="import" />
	<p style="text-align: center">
	';
if (is_dir($conf_dir)) {
    echo '<select name="file_to_use">
<option value="">' . __('Select a Conf File to Load', 'ym') . '</option>';
    $dir = opendir($conf_dir);
    while (FALSE !== ($file = readdir($dir))) {
        if ($file != ".." && $file != "." && $file != "index.html" && is_file($conf_dir . '/' . $file)) {
            echo '<option value="' . $file . '">' . $file . '</option>';
        }
    }
    closedir($dir);